Compare commits
2 Commits
aa361938a4
...
1b07b043aa
Author | SHA1 | Date | |
---|---|---|---|
|
1b07b043aa | ||
|
eb799802ab |
|
@ -122,8 +122,9 @@ int Digitizer::OpenDigitizer(int boardID, int portID, bool program, bool verbose
|
||||||
isInputChEqRegCh = true;
|
isInputChEqRegCh = true;
|
||||||
regChannelMask = pow(2, NumInputCh)-1;
|
regChannelMask = pow(2, NumInputCh)-1;
|
||||||
switch(BoardInfo.Model){
|
switch(BoardInfo.Model){
|
||||||
case CAEN_DGTZ_V1730: tick2ns = 2.0; NCoupledCh = NumInputCh/2; break; ///ns -> 500 MSamples/s
|
case CAEN_DGTZ_V1730: tick2ns = 2.0; NCoupledCh = NumInputCh/2; break; ///ns -> 500 MSamples/s
|
||||||
case CAEN_DGTZ_V1725: tick2ns = 4.0; NCoupledCh = NumInputCh/2; break; ///ns -> 250 MSamples/s
|
case CAEN_DGTZ_DT5730: tick2ns = 2.0; NCoupledCh = NumInputCh/2; break; ///ns -> 500 MSamples/s
|
||||||
|
case CAEN_DGTZ_V1725: tick2ns = 4.0; NCoupledCh = NumInputCh/2; break; ///ns -> 250 MSamples/s
|
||||||
case CAEN_DGTZ_V1740: {
|
case CAEN_DGTZ_V1740: {
|
||||||
NumInputCh = 64;
|
NumInputCh = 64;
|
||||||
NCoupledCh = NumRegChannel;
|
NCoupledCh = NumRegChannel;
|
||||||
|
@ -332,14 +333,16 @@ int Digitizer::ProgramBoard_PHA(){
|
||||||
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0x5, 0xAAAA);
|
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0x5, 0xAAAA);
|
||||||
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0x6, 0xAAAA);
|
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0x6, 0xAAAA);
|
||||||
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0x7, 0xAAAA);
|
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0x7, 0xAAAA);
|
||||||
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0x8, 0xAAAA);
|
if( NumRegChannel > 8 ){
|
||||||
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0x9, 0xAAAA);
|
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0x8, 0xAAAA);
|
||||||
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0xA, 0xAAAA);
|
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0x9, 0xAAAA);
|
||||||
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0xB, 0xAAAA);
|
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0xA, 0xAAAA);
|
||||||
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0xC, 0xAAAA);
|
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0xB, 0xAAAA);
|
||||||
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0xD, 0xAAAA);
|
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0xC, 0xAAAA);
|
||||||
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0xE, 0xAAAA);
|
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0xD, 0xAAAA);
|
||||||
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0xF, 0xAAAA);
|
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0xE, 0xAAAA);
|
||||||
|
ret |= CAEN_DGTZ_SetChannelDCOffset(handle, 0xF, 0xAAAA);
|
||||||
|
}
|
||||||
|
|
||||||
ret |= CAEN_DGTZ_WriteRegister(handle, (uint32_t)(DPP::PreTrigger) + 0x7000 , 32 );
|
ret |= CAEN_DGTZ_WriteRegister(handle, (uint32_t)(DPP::PreTrigger) + 0x7000 , 32 );
|
||||||
ret |= CAEN_DGTZ_WriteRegister(handle, (uint32_t)(DPP::InputDynamicRange) + 0x7000 , 0x0 );
|
ret |= CAEN_DGTZ_WriteRegister(handle, (uint32_t)(DPP::InputDynamicRange) + 0x7000 , 0x0 );
|
||||||
|
@ -806,6 +809,7 @@ void Digitizer::ReadAllSettingsFromBoard(bool force){
|
||||||
|
|
||||||
for( int p = 0; p < (int) RegisterBoardList_PHAPSD.size(); p++){
|
for( int p = 0; p < (int) RegisterBoardList_PHAPSD.size(); p++){
|
||||||
if( RegisterBoardList_PHAPSD[p].GetRWType() == RW::WriteONLY) continue;
|
if( RegisterBoardList_PHAPSD[p].GetRWType() == RW::WriteONLY) continue;
|
||||||
|
if( BoardInfo.Model == CAEN_DGTZ_DT5730 && RegisterBoardList_PHAPSD[p].GetAddress() == 0x81C4 ) continue;
|
||||||
ReadRegister(RegisterBoardList_PHAPSD[p]);
|
ReadRegister(RegisterBoardList_PHAPSD[p]);
|
||||||
}
|
}
|
||||||
regChannelMask = GetSettingFromMemory(DPP::RegChannelEnableMask);
|
regChannelMask = GetSettingFromMemory(DPP::RegChannelEnableMask);
|
||||||
|
@ -881,6 +885,7 @@ void Digitizer::ProgramSettingsToBoard(){
|
||||||
if( DPPType == V1730_DPP_PHA_CODE ){
|
if( DPPType == V1730_DPP_PHA_CODE ){
|
||||||
for( int p = 0; p < (int) RegisterChannelList_PHA.size(); p++){
|
for( int p = 0; p < (int) RegisterChannelList_PHA.size(); p++){
|
||||||
if( RegisterChannelList_PHA[p].GetRWType() == RW::ReadWrite ){
|
if( RegisterChannelList_PHA[p].GetRWType() == RW::ReadWrite ){
|
||||||
|
if( BoardInfo.Model == CAEN_DGTZ_DT5730 && RegisterBoardList_PHAPSD[p].GetAddress() == 0x81C4 ) continue;
|
||||||
haha = RegisterChannelList_PHA[p];
|
haha = RegisterChannelList_PHA[p];
|
||||||
WriteRegister(haha, GetSettingFromMemory(haha, ch), ch, false);
|
WriteRegister(haha, GetSettingFromMemory(haha, ch), ch, false);
|
||||||
usleep(pauseMilliSec * 1000);
|
usleep(pauseMilliSec * 1000);
|
||||||
|
@ -890,6 +895,7 @@ void Digitizer::ProgramSettingsToBoard(){
|
||||||
if( DPPType == V1730_DPP_PSD_CODE ){
|
if( DPPType == V1730_DPP_PSD_CODE ){
|
||||||
for( int p = 0; p < (int) RegisterChannelList_PSD.size(); p++){
|
for( int p = 0; p < (int) RegisterChannelList_PSD.size(); p++){
|
||||||
if( RegisterChannelList_PSD[p].GetRWType() == RW::ReadWrite){
|
if( RegisterChannelList_PSD[p].GetRWType() == RW::ReadWrite){
|
||||||
|
if( BoardInfo.Model == CAEN_DGTZ_DT5730 && RegisterBoardList_PHAPSD[p].GetAddress() == 0x81C4 ) continue;
|
||||||
haha = RegisterChannelList_PSD[p];
|
haha = RegisterChannelList_PSD[p];
|
||||||
WriteRegister(haha, GetSettingFromMemory(haha, ch), ch, false);
|
WriteRegister(haha, GetSettingFromMemory(haha, ch), ch, false);
|
||||||
usleep(pauseMilliSec * 1000);
|
usleep(pauseMilliSec * 1000);
|
||||||
|
@ -1126,6 +1132,9 @@ void Digitizer::SaveAllSettingsAsText(std::string fileName){
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( BoardInfo.Model == CAEN_DGTZ_DT5730 && haha.GetAddress() == 0x81C4 ) continue;
|
||||||
|
|
||||||
if( haha.GetName() != "" ) {
|
if( haha.GetName() != "" ) {
|
||||||
std::string typeStr ;
|
std::string typeStr ;
|
||||||
if( haha.GetRWType() == RW::ReadWrite ) typeStr = "R/W";
|
if( haha.GetRWType() == RW::ReadWrite ) typeStr = "R/W";
|
||||||
|
|
|
@ -41,17 +41,16 @@ void InfluxDB::SetURL(std::string url){
|
||||||
}else{
|
}else{
|
||||||
this->databaseIP = url;
|
this->databaseIP = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
headers = curl_slist_append(headers, "Accept: application/csv");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InfluxDB::SetToken(std::string token){
|
void InfluxDB::SetToken(std::string token){
|
||||||
this->token = token;
|
this->token = token;
|
||||||
headers = curl_slist_append(headers, ("Authorization: Token " + token).c_str());
|
headers = curl_slist_append(headers, "Accept: application/csv");
|
||||||
|
if( !token.empty() ) headers = curl_slist_append(headers, ("Authorization: Token " + token).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InfluxDB::TestingConnection(bool debug){
|
bool InfluxDB::TestingConnection(bool debug){
|
||||||
CheckInfluxVersion();
|
CheckInfluxVersion(debug);
|
||||||
if( respond != CURLE_OK ) return false;
|
if( respond != CURLE_OK ) return false;
|
||||||
connectionOK = true;
|
connectionOK = true;
|
||||||
return true;
|
return true;
|
||||||
|
@ -86,7 +85,7 @@ std::string InfluxDB::CheckInfluxVersion(bool debug){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Influx Version : %s | %u\n", influxVersionStr.c_str(), influxVersion);
|
// printf("Influx Version : %s | %u\n", influxVersionStr.c_str(), influxVersion);
|
||||||
|
|
||||||
return respondStr;
|
return respondStr;
|
||||||
|
|
||||||
|
|
58
FSUDAQ.cpp
58
FSUDAQ.cpp
|
@ -123,6 +123,15 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
|
||||||
leDatabaseName->setReadOnly(true);
|
leDatabaseName->setReadOnly(true);
|
||||||
layout->addWidget(leDatabaseName, rowID, 4);
|
layout->addWidget(leDatabaseName, rowID, 4);
|
||||||
|
|
||||||
|
rowID ++;
|
||||||
|
QLabel * lbToken = new QLabel("Influx Token : ", this);
|
||||||
|
lbToken->setAlignment(Qt::AlignRight | Qt::AlignCenter);
|
||||||
|
layout->addWidget(lbToken, rowID, 1);
|
||||||
|
|
||||||
|
leInfluxToken = new QLineEdit(this);
|
||||||
|
leInfluxToken->setReadOnly(true);
|
||||||
|
layout->addWidget(leInfluxToken, rowID, 2, 1, 3);
|
||||||
|
|
||||||
rowID ++;
|
rowID ++;
|
||||||
QLabel * lbElogIP = new QLabel("Elog IP : ", this);
|
QLabel * lbElogIP = new QLabel("Elog IP : ", this);
|
||||||
lbElogIP->setAlignment(Qt::AlignRight | Qt::AlignCenter);
|
lbElogIP->setAlignment(Qt::AlignRight | Qt::AlignCenter);
|
||||||
|
@ -279,6 +288,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
|
||||||
elogPWD = "";
|
elogPWD = "";
|
||||||
influxIP = "";
|
influxIP = "";
|
||||||
dataBaseName = "";
|
dataBaseName = "";
|
||||||
|
influxToken = "";
|
||||||
programSettingsFilePath = QDir::current().absolutePath() + "/programSettings.txt";
|
programSettingsFilePath = QDir::current().absolutePath() + "/programSettings.txt";
|
||||||
LoadProgramSettings();
|
LoadProgramSettings();
|
||||||
|
|
||||||
|
@ -436,10 +446,11 @@ void MainWindow::LoadProgramSettings(){
|
||||||
if( count == 0 ) rawDataPath = line;
|
if( count == 0 ) rawDataPath = line;
|
||||||
if( count == 1 ) influxIP = line;
|
if( count == 1 ) influxIP = line;
|
||||||
if( count == 2 ) dataBaseName = line;
|
if( count == 2 ) dataBaseName = line;
|
||||||
if( count == 3 ) elogIP = line;
|
if( count == 3 ) influxToken = line;
|
||||||
if( count == 4 ) elogName = line;
|
if( count == 4 ) elogIP = line;
|
||||||
if( count == 5 ) elogUser = line;
|
if( count == 5 ) elogName = line;
|
||||||
if( count == 6 ) elogPWD = line;
|
if( count == 6 ) elogUser = line;
|
||||||
|
if( count == 7 ) elogPWD = line;
|
||||||
|
|
||||||
count ++;
|
count ++;
|
||||||
line = in.readLine();
|
line = in.readLine();
|
||||||
|
@ -449,17 +460,19 @@ void MainWindow::LoadProgramSettings(){
|
||||||
leDataPath->setText(rawDataPath);
|
leDataPath->setText(rawDataPath);
|
||||||
leInfluxIP->setText(influxIP);
|
leInfluxIP->setText(influxIP);
|
||||||
leDatabaseName->setText(dataBaseName);
|
leDatabaseName->setText(dataBaseName);
|
||||||
|
leInfluxToken->setText(influxToken);
|
||||||
leElogIP->setText(elogIP);
|
leElogIP->setText(elogIP);
|
||||||
leElogName->setText(elogName);
|
leElogName->setText(elogName);
|
||||||
|
|
||||||
logMsgHTMLMode = false;
|
logMsgHTMLMode = false;
|
||||||
LogMsg("Raw Data Path : " + rawDataPath);
|
LogMsg(" Raw Data Path : " + rawDataPath);
|
||||||
LogMsg(" Influx IP : " + influxIP);
|
LogMsg(" Influx IP : " + influxIP);
|
||||||
LogMsg("Database Name : " + dataBaseName);
|
LogMsg(" Database Name : " + dataBaseName);
|
||||||
LogMsg(" Elog IP : " + elogIP);
|
LogMsg("Database Token : " + influxToken);
|
||||||
LogMsg(" Elog Name : " + elogName);
|
LogMsg(" Elog IP : " + elogIP);
|
||||||
LogMsg(" Elog User : " + elogUser);
|
LogMsg(" Elog Name : " + elogName);
|
||||||
LogMsg(" Elog PWD : " + elogPWD);
|
LogMsg(" Elog User : " + elogUser);
|
||||||
|
LogMsg(" Elog PWD : " + elogPWD);
|
||||||
logMsgHTMLMode = true;
|
logMsgHTMLMode = true;
|
||||||
|
|
||||||
//check is rawDataPath exist, if not, create one
|
//check is rawDataPath exist, if not, create one
|
||||||
|
@ -489,6 +502,7 @@ void MainWindow::SaveProgramSettings(){
|
||||||
file.write((rawDataPath+"\n").toStdString().c_str());
|
file.write((rawDataPath+"\n").toStdString().c_str());
|
||||||
file.write((influxIP+"\n").toStdString().c_str());
|
file.write((influxIP+"\n").toStdString().c_str());
|
||||||
file.write((dataBaseName+"\n").toStdString().c_str());
|
file.write((dataBaseName+"\n").toStdString().c_str());
|
||||||
|
file.write((influxToken+"\n").toStdString().c_str());
|
||||||
file.write((elogIP+"\n").toStdString().c_str());
|
file.write((elogIP+"\n").toStdString().c_str());
|
||||||
file.write((elogName+"\n").toStdString().c_str());
|
file.write((elogName+"\n").toStdString().c_str());
|
||||||
file.write((elogUser+"\n").toStdString().c_str());
|
file.write((elogUser+"\n").toStdString().c_str());
|
||||||
|
@ -1383,16 +1397,19 @@ void MainWindow::SetAndLockInfluxElog(){
|
||||||
|
|
||||||
leInfluxIP->setReadOnly(false);
|
leInfluxIP->setReadOnly(false);
|
||||||
leDatabaseName->setReadOnly(false);
|
leDatabaseName->setReadOnly(false);
|
||||||
|
leInfluxToken->setReadOnly(false);
|
||||||
leElogIP->setReadOnly(false);
|
leElogIP->setReadOnly(false);
|
||||||
leElogName->setReadOnly(false);
|
leElogName->setReadOnly(false);
|
||||||
|
|
||||||
leInfluxIP->setEnabled(true);
|
leInfluxIP->setEnabled(true);
|
||||||
leDatabaseName->setEnabled(true);
|
leDatabaseName->setEnabled(true);
|
||||||
|
leInfluxToken->setEnabled(true);
|
||||||
leElogIP->setEnabled(true);
|
leElogIP->setEnabled(true);
|
||||||
leElogName->setEnabled(true);
|
leElogName->setEnabled(true);
|
||||||
|
|
||||||
leInfluxIP->setStyleSheet("color : blue;");
|
leInfluxIP->setStyleSheet("color : blue;");
|
||||||
leDatabaseName->setStyleSheet("color : blue;");
|
leDatabaseName->setStyleSheet("color : blue;");
|
||||||
|
leInfluxToken->setStyleSheet("color : blue;");
|
||||||
leElogIP->setStyleSheet("color : blue;");
|
leElogIP->setStyleSheet("color : blue;");
|
||||||
leElogName->setStyleSheet("color : blue;");
|
leElogName->setStyleSheet("color : blue;");
|
||||||
|
|
||||||
|
@ -1401,16 +1418,19 @@ void MainWindow::SetAndLockInfluxElog(){
|
||||||
|
|
||||||
leInfluxIP->setReadOnly(true);
|
leInfluxIP->setReadOnly(true);
|
||||||
leDatabaseName->setReadOnly(true);
|
leDatabaseName->setReadOnly(true);
|
||||||
|
leInfluxToken->setReadOnly(true);
|
||||||
leElogIP->setReadOnly(true);
|
leElogIP->setReadOnly(true);
|
||||||
leElogName->setReadOnly(true);
|
leElogName->setReadOnly(true);
|
||||||
|
|
||||||
leInfluxIP->setStyleSheet("");
|
leInfluxIP->setStyleSheet("");
|
||||||
leDatabaseName->setStyleSheet("");
|
leDatabaseName->setStyleSheet("");
|
||||||
|
leInfluxToken->setStyleSheet("");
|
||||||
leElogIP->setStyleSheet("");
|
leElogIP->setStyleSheet("");
|
||||||
leElogName->setStyleSheet("");
|
leElogName->setStyleSheet("");
|
||||||
|
|
||||||
influxIP = leInfluxIP->text();
|
influxIP = leInfluxIP->text();
|
||||||
dataBaseName = leDatabaseName->text();
|
dataBaseName = leDatabaseName->text();
|
||||||
|
influxToken = leInfluxToken->text();
|
||||||
elogIP = leElogIP->text();
|
elogIP = leElogIP->text();
|
||||||
elogName = leElogName->text();
|
elogName = leElogName->text();
|
||||||
|
|
||||||
|
@ -1784,14 +1804,24 @@ void MainWindow::SetUpInflux(){
|
||||||
influx = new InfluxDB(influxIP.toStdString(), false);
|
influx = new InfluxDB(influxIP.toStdString(), false);
|
||||||
|
|
||||||
if( influx->TestingConnection() ){
|
if( influx->TestingConnection() ){
|
||||||
LogMsg("<font style=\"color : green;\"> InfluxDB URL (<b>"+ influxIP + "</b>) is Valid </font>");
|
LogMsg("<font style=\"color : green;\"> InfluxDB URL (<b>"+ influxIP + "</b>) is Valid. Version : " + QString::fromStdString(influx->GetVersionString())+ " </font>");
|
||||||
|
|
||||||
|
if( influx->GetVersionNo() > 1 && influxToken.isEmpty() ) {
|
||||||
|
LogMsg("<font style=\"color : red;\">A Token is required for accessing the database.</font>");
|
||||||
|
delete influx;
|
||||||
|
influx = nullptr;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
influx->SetToken(influxToken.toStdString());
|
||||||
|
|
||||||
//==== chck database exist
|
//==== chck database exist
|
||||||
//LogMsg("List of database:");
|
influx->CheckDatabases();
|
||||||
std::vector<std::string> databaseList = influx->GetDatabaseList();
|
std::vector<std::string> databaseList = influx->GetDatabaseList();
|
||||||
bool foundDatabase = false;
|
bool foundDatabase = false;
|
||||||
for( int i = 0; i < (int) databaseList.size(); i++){
|
for( int i = 0; i < (int) databaseList.size(); i++){
|
||||||
if( databaseList[i] == dataBaseName.toStdString() ) foundDatabase = true;
|
if( databaseList[i] == dataBaseName.toStdString() ) foundDatabase = true;
|
||||||
//LogMsg(QString::number(i) + "|" + QString::fromStdString(databaseList[i]));
|
// LogMsg(QString::number(i) + "|" + QString::fromStdString(databaseList[i]));
|
||||||
}
|
}
|
||||||
if( foundDatabase ){
|
if( foundDatabase ){
|
||||||
LogMsg("<font style=\"color : green;\"> Database <b>" + dataBaseName + "</b> found.");
|
LogMsg("<font style=\"color : green;\"> Database <b>" + dataBaseName + "</b> found.");
|
||||||
|
|
2
FSUDAQ.h
2
FSUDAQ.h
|
@ -131,9 +131,11 @@ private:
|
||||||
|
|
||||||
QString influxIP;
|
QString influxIP;
|
||||||
QString dataBaseName;
|
QString dataBaseName;
|
||||||
|
QLineEdit * leInfluxToken;
|
||||||
QLineEdit * leInfluxIP;
|
QLineEdit * leInfluxIP;
|
||||||
QLineEdit * leDatabaseName;
|
QLineEdit * leDatabaseName;
|
||||||
QPushButton * bnLock;
|
QPushButton * bnLock;
|
||||||
|
QString influxToken;
|
||||||
|
|
||||||
//@----- Elog
|
//@----- Elog
|
||||||
QString elogIP;
|
QString elogIP;
|
||||||
|
|
|
@ -114,6 +114,7 @@ There is a folder Aux, this folder contains many auxillary programs, such as Eve
|
||||||
|
|
||||||
# Known Issues
|
# Known Issues
|
||||||
|
|
||||||
|
* If accessing the database takes too long, recommend to disable the database.
|
||||||
* Pile up rate is not accurate for very high input rate ( > 60 kHz ).
|
* Pile up rate is not accurate for very high input rate ( > 60 kHz ).
|
||||||
* When using the scope, the Agg/Read must be smaller than 512.
|
* When using the scope, the Agg/Read must be smaller than 512.
|
||||||
* Although the Events/Agg used the CAEN API to recalculate before ACQ start, for PHA firmware, when the trigger rate changed, the Events per Agg need to be changed.
|
* Although the Events/Agg used the CAEN API to recalculate before ACQ start, for PHA firmware, when the trigger rate changed, the Events per Agg need to be changed.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user