various fix focused on PSD firmware for VX2730, aim to match firmware version 2024092000
This commit is contained in:
parent
8dd9023b68
commit
bd47bc4928
|
@ -1000,14 +1000,14 @@ void Digitizer2Gen::ProgramBoard(){
|
|||
|
||||
void Digitizer2Gen::ProgramChannels(bool testPulse){
|
||||
|
||||
std::string para_prefix = "/ch/0.." + std::to_string(nChannels-1) + "/par/";
|
||||
|
||||
// Channel setting
|
||||
if( testPulse){
|
||||
WriteValue("/ch/0..63/par/ChEnable" , "false");
|
||||
WriteValue("/ch/0..63/par/ChEnable" , "true");
|
||||
WriteValue((para_prefix + "ChEnable").c_str() , "false");
|
||||
|
||||
WriteValue("/ch/0..63/par/EventTriggerSource", "GlobalTriggerSource");
|
||||
WriteValue("/ch/0..63/par/WaveTriggerSource" , "GlobalTriggerSource"); // EventTriggerSource enought
|
||||
WriteValue((para_prefix + "EventTriggerSource").c_str(), "GlobalTriggerSource");
|
||||
WriteValue((para_prefix + "WaveTriggerSource").c_str() , "GlobalTriggerSource"); // EventTriggerSource enought
|
||||
|
||||
WriteValue("/par/GlobalTriggerSource", "SwTrg | TestPulse");
|
||||
WriteValue("/par/TestPulsePeriod" , "1000000"); // 1.0 msec = 1000Hz, tested, 1 trace recording
|
||||
|
@ -1018,99 +1018,100 @@ void Digitizer2Gen::ProgramChannels(bool testPulse){
|
|||
}else{
|
||||
|
||||
//======== Self trigger for each channel
|
||||
WriteValue("/ch/0..63/par/ChEnable" , "True");
|
||||
WriteValue("/ch/0..63/par/DCOffset" , "50");
|
||||
WriteValue("/ch/0..63/par/TriggerThr" , "1000");
|
||||
WriteValue("/ch/0..63/par/WaveDataSource" , "ADC_DATA");
|
||||
WriteValue("/ch/0..63/par/PulsePolarity" , "Positive");
|
||||
WriteValue("/ch/0..63/par/ChRecordLengthT" , "4096"); /// 4096 ns, S and T are not Sync
|
||||
WriteValue("/ch/0..63/par/ChPreTriggerT" , "1000");
|
||||
WriteValue((para_prefix + "ChEnable").c_str() , "True");
|
||||
|
||||
WriteValue("/ch/0..63/par/WaveSaving" , "OnRequest");
|
||||
WriteValue("/ch/0..63/par/WaveResolution" , "RES8");
|
||||
WriteValue((para_prefix + "DCOffset").c_str() , "50");
|
||||
WriteValue((para_prefix + "TriggerThr").c_str() , "1000");
|
||||
WriteValue((para_prefix + "WaveDataSource").c_str() , "ADC_DATA");
|
||||
WriteValue((para_prefix + "PulsePolarity").c_str() , "Positive");
|
||||
WriteValue((para_prefix + "ChRecordLengthT").c_str() , "4096"); /// 4096 ns, S and T are not Sync
|
||||
WriteValue((para_prefix + "ChPreTriggerT").c_str() , "1000");
|
||||
|
||||
WriteValue((para_prefix + "WaveSaving").c_str() , "OnRequest");
|
||||
WriteValue((para_prefix + "WaveResolution").c_str() , "RES8");
|
||||
|
||||
//======== Trigger setting
|
||||
WriteValue("/ch/0..63/par/EventTriggerSource" , "ChSelfTrigger");
|
||||
WriteValue("/ch/0..63/par/WaveTriggerSource" , "Disabled");
|
||||
WriteValue("/ch/0..63/par/ChannelVetoSource" , "Disabled");
|
||||
WriteValue("/ch/0..63/par/ChannelsTriggerMask" , "0x0");
|
||||
WriteValue("/ch/0..63/par/CoincidenceMask" , "Disabled");
|
||||
WriteValue("/ch/0..63/par/AntiCoincidenceMask" , "Disabled");
|
||||
WriteValue("/ch/0..63/par/CoincidenceLengthT" , "0");
|
||||
WriteValue("/ch/0..63/par/ADCVetoWidth" , "0");
|
||||
WriteValue((para_prefix + "EventTriggerSource").c_str() , "ChSelfTrigger");
|
||||
WriteValue((para_prefix + "WaveTriggerSource").c_str() , "Disabled");
|
||||
WriteValue((para_prefix + "ChannelVetoSource").c_str() , "Disabled");
|
||||
WriteValue((para_prefix + "ChannelsTriggerMask").c_str() , "0x0");
|
||||
WriteValue((para_prefix + "CoincidenceMask").c_str() , "Disabled");
|
||||
WriteValue((para_prefix + "AntiCoincidenceMask").c_str() , "Disabled");
|
||||
WriteValue((para_prefix + "CoincidenceLengthT").c_str() , "0");
|
||||
WriteValue((para_prefix + "ADCVetoWidth").c_str() , "0");
|
||||
|
||||
//======== Other Setting
|
||||
WriteValue("/ch/0..63/par/EventSelector" , "All");
|
||||
WriteValue("/ch/0..63/par/WaveSelector" , "All");
|
||||
WriteValue("/ch/0..63/par/EnergySkimLowDiscriminator" , "0");
|
||||
WriteValue("/ch/0..63/par/EnergySkimHighDiscriminator" , "65534");
|
||||
WriteValue("/ch/0..63/par/ITLConnect" , "Disabled");
|
||||
WriteValue((para_prefix + "EventSelector").c_str() , "All");
|
||||
WriteValue((para_prefix + "WaveSelector").c_str() , "All");
|
||||
WriteValue((para_prefix + "EnergySkimLowDiscriminator").c_str() , "0");
|
||||
WriteValue((para_prefix + "EnergySkimHighDiscriminator").c_str() , "65534");
|
||||
WriteValue((para_prefix + "ITLConnect").c_str() , "Disabled");
|
||||
|
||||
if( FPGAType == DPPType::PHA){
|
||||
|
||||
WriteValue("/ch/0..63/par/TimeFilterRiseTimeT" , "80"); // 80 ns
|
||||
WriteValue("/ch/0..63/par/TimeFilterRetriggerGuardT" , "80"); // 80 ns
|
||||
WriteValue((para_prefix + "TimeFilterRiseTimeT").c_str() , "80"); // 80 ns
|
||||
WriteValue((para_prefix + "TimeFilterRetriggerGuardT").c_str() , "80"); // 80 ns
|
||||
|
||||
WriteValue("/ch/0..63/par/EnergyFilterLFLimitation" , "Off");
|
||||
WriteValue((para_prefix + "EnergyFilterLFLimitation").c_str() , "Off");
|
||||
|
||||
//======== Trapezoid setting
|
||||
WriteValue("/ch/0..63/par/EnergyFilterRiseTimeT" , "496"); // 496 ns
|
||||
WriteValue("/ch/0..63/par/EnergyFilterFlatTopT" , "1600"); // 1600 ns
|
||||
WriteValue("/ch/0..63/par/EnergyFilterPoleZeroT" , "50000"); // 50 us
|
||||
WriteValue("/ch/0..63/par/EnergyFilterPeakingPosition" , "20"); // 20 % = Flatup * 20% = 320 ns
|
||||
WriteValue("/ch/0..63/par/EnergyFilterBaselineGuardT" , "800"); // 800 ns
|
||||
WriteValue("/ch/0..63/par/EnergyFilterPileupGuardT" , "80"); // 80 ns
|
||||
WriteValue("/ch/0..63/par/EnergyFilterBaselineAvg" , "Medium"); // 1024 sample
|
||||
WriteValue("/ch/0..63/par/EnergyFilterFineGain" , "1.0");
|
||||
WriteValue("/ch/0..63/par/EnergyFilterPeakingAvg" , "LowAVG");
|
||||
WriteValue((para_prefix + "EnergyFilterRiseTimeT").c_str() , "496"); // 496 ns
|
||||
WriteValue((para_prefix + "EnergyFilterFlatTopT").c_str() , "1600"); // 1600 ns
|
||||
WriteValue((para_prefix + "EnergyFilterPoleZeroT").c_str() , "50000"); // 50 us
|
||||
WriteValue((para_prefix + "EnergyFilterPeakingPosition").c_str() , "20"); // 20 % = Flatup * 20% = 320 ns
|
||||
WriteValue((para_prefix + "EnergyFilterBaselineGuardT").c_str() , "800"); // 800 ns
|
||||
WriteValue((para_prefix + "EnergyFilterPileupGuardT").c_str() , "80"); // 80 ns
|
||||
WriteValue((para_prefix + "EnergyFilterBaselineAvg").c_str() , "Medium"); // 1024 sample
|
||||
WriteValue((para_prefix + "EnergyFilterFineGain").c_str() , "1.0");
|
||||
WriteValue((para_prefix + "EnergyFilterPeakingAvg").c_str() , "LowAVG");
|
||||
|
||||
//======== Probe Setting
|
||||
WriteValue("/ch/0..63/par/WaveAnalogProbe0" , "ADCInput");
|
||||
WriteValue("/ch/0..63/par/WaveAnalogProbe1" , "EnergyFilterMinusBaseline");
|
||||
WriteValue("/ch/0..63/par/WaveDigitalProbe0" , "Trigger");
|
||||
WriteValue("/ch/0..63/par/WaveDigitalProbe1" , "EnergyFilterPeaking");
|
||||
WriteValue("/ch/0..63/par/WaveDigitalProbe2" , "TimeFilterArmed");
|
||||
WriteValue("/ch/0..63/par/WaveDigitalProbe3" , "EnergyFilterPeakReady");
|
||||
WriteValue((para_prefix + "WaveAnalogProbe0").c_str() , "ADCInput");
|
||||
WriteValue((para_prefix + "WaveAnalogProbe1").c_str() , "EnergyFilterMinusBaseline");
|
||||
WriteValue((para_prefix + "WaveDigitalProbe0").c_str() , "Trigger");
|
||||
WriteValue((para_prefix + "WaveDigitalProbe1").c_str() , "EnergyFilterPeaking");
|
||||
WriteValue((para_prefix + "WaveDigitalProbe2").c_str() , "TimeFilterArmed");
|
||||
WriteValue((para_prefix + "WaveDigitalProbe3").c_str() , "EnergyFilterPeakReady");
|
||||
|
||||
}
|
||||
|
||||
if( FPGAType == DPPType::PSD ){
|
||||
|
||||
WriteValue("/ch/0..63/par/WaveAnalogProbe0" , "ADCInput");
|
||||
WriteValue("/ch/0..63/par/WaveAnalogProbe1" , "CFDFilter");
|
||||
WriteValue("/ch/0..63/par/WaveDigitalProbe0" , "Trigger");
|
||||
WriteValue("/ch/0..63/par/WaveDigitalProbe1" , "LongGate");
|
||||
WriteValue("/ch/0..63/par/WaveDigitalProbe2" , "ShortGate");
|
||||
WriteValue("/ch/0..63/par/WaveDigitalProbe3" , "ChargeReady");
|
||||
WriteValue((para_prefix + "WaveAnalogProbe0").c_str() , "ADCInput");
|
||||
WriteValue((para_prefix + "WaveAnalogProbe1").c_str() , "CFDFilter");
|
||||
WriteValue((para_prefix + "WaveDigitalProbe0").c_str() , "Trigger");
|
||||
WriteValue((para_prefix + "WaveDigitalProbe1").c_str() , "LongGate");
|
||||
WriteValue((para_prefix + "WaveDigitalProbe2").c_str() , "ShortGate");
|
||||
WriteValue((para_prefix + "WaveDigitalProbe3").c_str() , "ChargeReady");
|
||||
|
||||
//=========== QDC
|
||||
WriteValue("/ch/0..63/par/GateLongLengthT" , "400");
|
||||
WriteValue("/ch/0..63/par/GateShortLengthT" , "100");
|
||||
WriteValue("/ch/0..63/par/GateOffsetT" , "50");
|
||||
WriteValue("/ch/0..63/par/LongChargeIntegratorPedestal" , "0");
|
||||
WriteValue("/ch/0..63/par/ShortChargeIntegratorPedestal" , "0");
|
||||
WriteValue("/ch/0..63/par/EnergyGain" , "x1");
|
||||
WriteValue((para_prefix + "GateLongLengthT").c_str() , "400");
|
||||
WriteValue((para_prefix + "GateShortLengthT").c_str() , "100");
|
||||
WriteValue((para_prefix + "GateOffsetT").c_str() , "50");
|
||||
WriteValue((para_prefix + "LongChargeIntegratorPedestal").c_str() , "0");
|
||||
WriteValue((para_prefix + "ShortChargeIntegratorPedestal").c_str() , "0");
|
||||
WriteValue((para_prefix + "EnergyGain").c_str() , "x1");
|
||||
|
||||
//=========== Discrimination
|
||||
WriteValue("/ch/0..63/par/TriggerFilterSelection" , "LeadingEdge");
|
||||
WriteValue("/ch/0..63/par/CFDDelayT" , "32");
|
||||
WriteValue("/ch/0..63/par/CFDFraction" , "25");
|
||||
WriteValue("/ch/0..63/par/TimeFilterSmoothing" , "Disabled");
|
||||
WriteValue("/ch/0..63/par/ChargeSmoothing" , "Disabled");
|
||||
WriteValue("/ch/0..63/par/SmoothingFactor" , "1");
|
||||
WriteValue("/ch/0..63/par/PileupGap" , "1000");
|
||||
WriteValue((para_prefix + "TriggerFilterSelection").c_str() , "LeadingEdge");
|
||||
WriteValue((para_prefix + "CFDDelayT").c_str() , "32");
|
||||
WriteValue((para_prefix + "CFDFraction").c_str() , "25");
|
||||
WriteValue((para_prefix + "TimeFilterSmoothing").c_str() , "Disabled");
|
||||
WriteValue((para_prefix + "ChargeSmoothing").c_str() , "Disabled");
|
||||
WriteValue((para_prefix + "SmoothingFactor").c_str() , "1");
|
||||
WriteValue((para_prefix + "PileupGap").c_str() , "1000");
|
||||
|
||||
//=========== Input
|
||||
WriteValue("/ch/0..63/par/ADCInputBaselineAvg" , "MediumHigh");
|
||||
WriteValue("/ch/0..63/par/AbsoluteBaseline" , "1000");
|
||||
WriteValue("/ch/0..63/par/ADCInputBaselineGuardT" , "0");
|
||||
WriteValue("/ch/0..63/par/TimeFilterRetriggerGuardT" , "0");
|
||||
WriteValue("/ch/0..63/par/TriggerHysteresis" , "Enabled");
|
||||
WriteValue((para_prefix + "ADCInputBaselineAvg").c_str() , "MediumHigh");
|
||||
WriteValue((para_prefix + "AbsoluteBaseline").c_str() , "1000");
|
||||
WriteValue((para_prefix + "ADCInputBaselineGuardT").c_str() , "0");
|
||||
WriteValue((para_prefix + "TimeFilterRetriggerGuardT").c_str() , "8");
|
||||
WriteValue((para_prefix + "TriggerHysteresis").c_str() , "Enabled");
|
||||
|
||||
//========== Other
|
||||
WriteValue("/ch/0..63/par/NeutronThreshold" , "0");
|
||||
WriteValue("/ch/0..63/par/EventNeutronReject" , "Disabled");
|
||||
WriteValue("/ch/0..63/par/WaveNeutronReject" , "Disabled");
|
||||
WriteValue((para_prefix + "NeutronThreshold").c_str() , "0");
|
||||
WriteValue((para_prefix + "EventNeutronReject").c_str() , "Disabled");
|
||||
WriteValue((para_prefix + "WaveNeutronReject").c_str() , "Disabled");
|
||||
|
||||
}
|
||||
|
||||
|
@ -1199,15 +1200,7 @@ void Digitizer2Gen::ReadAllSettings(){
|
|||
if( boardSettings[i].ReadWrite() == RW::WriteOnly) continue;
|
||||
|
||||
// here TempSens is same for PHA and PSD
|
||||
if( !(ModelName == "VX2745") &&
|
||||
(boardSettings[i].GetPara() == PHA::DIG::TempSensADC1.GetPara() ||
|
||||
boardSettings[i].GetPara() == PHA::DIG::TempSensADC2.GetPara() ||
|
||||
boardSettings[i].GetPara() == PHA::DIG::TempSensADC3.GetPara() ||
|
||||
boardSettings[i].GetPara() == PHA::DIG::TempSensADC4.GetPara() ||
|
||||
boardSettings[i].GetPara() == PHA::DIG::TempSensADC5.GetPara() ||
|
||||
boardSettings[i].GetPara() == PHA::DIG::TempSensADC6.GetPara()
|
||||
)
|
||||
) continue;
|
||||
if( ModelName == "VX2740" && boardSettings[i].GetPara() != PHA::DIG::TempSensADC0.GetPara()) continue;
|
||||
|
||||
if( ModelName == "VX2730" &&
|
||||
(boardSettings[i].GetPara() == PHA::DIG::FreqSensCore.GetPara() ||
|
||||
|
|
|
@ -108,7 +108,7 @@ std::string InfluxDB::CheckDatabases(){
|
|||
|
||||
Execute();
|
||||
|
||||
printf("|%s|\n", respondStr.c_str());
|
||||
//printf("|%s|\n", respondStr.c_str());
|
||||
|
||||
if( respond != CURLE_OK) return "CURL Error.";
|
||||
|
||||
|
@ -118,9 +118,10 @@ std::string InfluxDB::CheckDatabases(){
|
|||
std::istringstream iss(respondStr);
|
||||
std::vector<std::string> lines;
|
||||
std::string line;
|
||||
// printf("==== InfluxDB::CheckDatabases()\n");
|
||||
while (std::getline(iss, line)) {
|
||||
printf("%s\n", line.c_str());
|
||||
lines.push_back(line);
|
||||
// printf("%s\n", line.c_str());
|
||||
lines.push_back(line);
|
||||
}
|
||||
|
||||
// Extract the third column from each line and store it in a vector
|
||||
|
|
|
@ -78,7 +78,7 @@ class TimingThread : public QThread {
|
|||
Q_OBJECT
|
||||
public:
|
||||
TimingThread(QObject * parent = 0 ) : QThread(parent){
|
||||
waitTime = 20; // 10 x 100 milisec
|
||||
waitTime = 20; // 20 x 100 milisec
|
||||
stop = false;
|
||||
}
|
||||
void Stop() { this->stop = true;}
|
||||
|
@ -88,7 +88,7 @@ public:
|
|||
unsigned int count = 0;
|
||||
stop = false;
|
||||
do{
|
||||
usleep(100000);
|
||||
usleep(100000); // sleep for 100 ms
|
||||
count ++;
|
||||
if( count % waitTime == 0){
|
||||
emit TimeUp();
|
||||
|
|
|
@ -36,7 +36,7 @@ class Reg {
|
|||
}
|
||||
Reg(std::string para, RW readwrite,
|
||||
TYPE type = TYPE::CH,
|
||||
std::vector<std::pair<std::string,std::string>> answer = {},
|
||||
std::vector<std::pair<std::string,std::string>> answer = {}, // first = value, second = display
|
||||
ANSTYPE ansType = ANSTYPE::COMBOX,
|
||||
std::string ansUnit = "",
|
||||
bool isCmd = false){
|
||||
|
@ -191,7 +191,12 @@ namespace PHA{
|
|||
{"SwTrg", "Software" },
|
||||
{"GPIO", "GPIO" },
|
||||
{"TestPulse", "Test Pulse" },
|
||||
{"LVDS", "LVDS"}}, ANSTYPE::STR);
|
||||
{"LVDS", "LVDS"},
|
||||
{"ITLA", "ITL-A"},
|
||||
{"ITLB", "ITL-B"},
|
||||
{"ITLA_AND_ITLB", "ITL-A & ITL-B"},
|
||||
{"ITLA_OR_ITLB", "ITL-A || ITL-B"},
|
||||
{"UserTrg", "User custom Trigger"}}, ANSTYPE::STR);
|
||||
|
||||
const Reg BusyInSource ("BusyInSource", RW::ReadWrite, TYPE::DIG, {{"Disabled","Disabled"},
|
||||
{"SIN", "SIN"},
|
||||
|
@ -217,6 +222,7 @@ namespace PHA{
|
|||
{"SyncIn", "SyncIn Signal"},
|
||||
{"SIN", "S-IN Signal"},
|
||||
{"GPIO", "GPIO Signal"},
|
||||
{"LBinClk", "GPIO Signal"},
|
||||
{"AcceptTrg", "Acceped Trigger Signal"},
|
||||
{"TrgClk", "Trigger Clock"}});
|
||||
const Reg GPIOMode ("GPIOMode", RW::ReadWrite, TYPE::DIG, {{"Disabled", "Disabled"},
|
||||
|
@ -257,8 +263,8 @@ namespace PHA{
|
|||
const Reg PermanentClockOutDelay ("PermanentClockOutDelay", RW::ReadWrite, TYPE::DIG, {{"-18888.888", ""}, {"18888.888", ""}, {"74.074", ""}}, ANSTYPE::FLOAT, "ps");
|
||||
const Reg TestPulsePeriod ("TestPulsePeriod", RW::ReadWrite, TYPE::DIG, {{"0", ""},{"34359738360", ""}, {"8", ""}}, ANSTYPE::INTEGER, "ns");
|
||||
const Reg TestPulseWidth ("TestPulseWidth", RW::ReadWrite, TYPE::DIG, {{"0", ""},{"34359738360", ""}, {"8", ""}}, ANSTYPE::INTEGER, "ns");
|
||||
const Reg TestPulseLowLevel ("TestPulseLowLevel", RW::ReadWrite, TYPE::DIG, {{"0", ""},{"65535", ""}, {"1", ""}}, ANSTYPE::INTEGER, "ns");
|
||||
const Reg TestPulseHighLevel ("TestPulseHighLevel", RW::ReadWrite, TYPE::DIG, {{"0", ""},{"65535", ""}, {"1", ""}}, ANSTYPE::INTEGER, "ns");
|
||||
const Reg TestPulseLowLevel ("TestPulseLowLevel", RW::ReadWrite, TYPE::DIG, {{"0", ""},{"65535", ""}, {"1", ""}}, ANSTYPE::INTEGER, "ADC counts");
|
||||
const Reg TestPulseHighLevel ("TestPulseHighLevel", RW::ReadWrite, TYPE::DIG, {{"0", ""},{"65535", ""}, {"1", ""}}, ANSTYPE::INTEGER, "ADC counts");
|
||||
const Reg ErrorFlagMask ("ErrorFlagMask", RW::ReadWrite, TYPE::DIG, {}, ANSTYPE::BINARY);
|
||||
const Reg ErrorFlagDataMask ("ErrorFlagDataMask", RW::ReadWrite, TYPE::DIG, {}, ANSTYPE::BINARY);
|
||||
const Reg DACoutMode ("DACoutMode", RW::ReadWrite, TYPE::DIG, {{"Static", "DAC static level"},
|
||||
|
@ -267,6 +273,7 @@ namespace PHA{
|
|||
{"OverThrSum", "Number of Channels triggered"},
|
||||
{"Ramp", "14-bit counter"},
|
||||
{"Sin5MHz", "5 MHz Sin wave Vpp = 2V"},
|
||||
{"IPE", "Internal Pulse Emultor"},
|
||||
{"Square", "Test Pulse"}});
|
||||
const Reg DACoutStaticLevel ("DACoutStaticLevel", RW::ReadWrite, TYPE::DIG, {{"0", ""}, {"16383", ""}, {"1",""}}, ANSTYPE::INTEGER, "units");
|
||||
const Reg DACoutChSelect ("DACoutChSelect", RW::ReadWrite, TYPE::DIG, {{"0", ""}, {"64", ""}, {"1",""}}, ANSTYPE::INTEGER);
|
||||
|
@ -446,10 +453,9 @@ namespace PHA{
|
|||
const Reg ChannelWaveCount ("ChWaveCnt", RW::ReadOnly, TYPE::CH, {}, ANSTYPE::STR);
|
||||
|
||||
/// ======= read write
|
||||
//^ not impletemented
|
||||
//^ not impletemented in digitizer panel
|
||||
const Reg SelfTriggerWidth ("SelfTriggerWidth", RW::ReadWrite, TYPE::CH, {{"0", ""},{"6000", ""},{"8", ""}}, ANSTYPE::INTEGER, "ns"); // not sure the max
|
||||
const Reg SignalOffset ("SignalOffset", RW::ReadWrite, TYPE::CH, {{"0", ""},{"1000", ""},{"1", ""}}, ANSTYPE::INTEGER, "uV"); // not sure the max
|
||||
|
||||
const Reg SignalOffset ("SignalOffset", RW::ReadWrite, TYPE::CH, {{"-1000000", ""},{"1000000", ""},{"1", ""}}, ANSTYPE::INTEGER, "uV"); // not sure the max
|
||||
|
||||
//^ impletemented
|
||||
const Reg ChannelEnable ("ChEnable", RW::ReadWrite, TYPE::CH, {{"True", "Enabled"}, {"False", "Disabled"}});
|
||||
|
@ -462,6 +468,7 @@ namespace PHA{
|
|||
{"ADC_TEST_RAMP", "ADC produces RAMP signal"},
|
||||
{"ADC_TEST_SIN", "ADC produce SIN signal"},
|
||||
{"Ramp", "Ramp generator"},
|
||||
{"IPE", "Internal Pulse Emulator"},
|
||||
{"SquareWave", "Test Pusle (Square Wave)"} });
|
||||
const Reg RecordLength ("ChRecordLengthT", RW::ReadWrite, TYPE::CH, {{"32", ""}, {"64800", ""}, {"8",""}}, ANSTYPE::INTEGER, "ns");
|
||||
const Reg PreTrigger ("ChPreTriggerT", RW::ReadWrite, TYPE::CH, {{"32", ""}, {"32000", ""}, {"8",""}}, ANSTYPE::INTEGER, "ns");
|
||||
|
@ -563,6 +570,9 @@ namespace PHA{
|
|||
{"SWTrigger", "Software Trigger"},
|
||||
{"ChSelfTrigger", "Channel Self-Trigger"},
|
||||
{"Ch64Trigger", "Channel 64-Trigger"},
|
||||
{"ITLA", "ITL-A"},
|
||||
{"ITLB", "ITL-B"},
|
||||
{"LVDS", "LVDS"},
|
||||
{"Disabled", "Disabled"}});
|
||||
const Reg ChannelsTriggerMask ("ChannelsTriggerMask", RW::ReadWrite, TYPE::CH, {}, ANSTYPE::BYTE, "64-bit" );
|
||||
const Reg ChannelVetoSource ("ChannelVetoSource", RW::ReadWrite, TYPE::CH, {{"BoardVeto", "Board Veto"},
|
||||
|
@ -577,6 +587,9 @@ namespace PHA{
|
|||
{"SWTrigger", "Software Trigger"},
|
||||
{"ChSelfTrigger", "Channel Self-Trigger"},
|
||||
{"Ch64Trigger", "Channel 64-Trigger"},
|
||||
{"ITLA", "ITL-A"},
|
||||
{"ITLB", "ITL-B"},
|
||||
{"LVDS", "LVDS"},
|
||||
{"Disabled", "Disabled"}});
|
||||
|
||||
const Reg EventSelector ("EventSelector", RW::ReadWrite, TYPE::CH, {{"All", "All"},
|
||||
|
@ -669,8 +682,11 @@ namespace PHA{
|
|||
WaveDigitalProbe0 ,
|
||||
WaveDigitalProbe1 ,
|
||||
WaveDigitalProbe2 ,
|
||||
WaveDigitalProbe3
|
||||
WaveDigitalProbe3 ,
|
||||
|
||||
SelfTriggerWidth ,
|
||||
SignalOffset
|
||||
|
||||
// CoincidenceLengthSample ,
|
||||
// RecordLengthSample ,
|
||||
// PreTriggerSample ,
|
||||
|
@ -773,10 +789,20 @@ namespace PSD{
|
|||
const Reg EnableStatisticEvents = PHA::DIG::EnableStatisticEvents;
|
||||
const Reg VolatileClockOutDelay = PHA::DIG::VolatileClockOutDelay;
|
||||
const Reg PermanentClockOutDelay = PHA::DIG::PermanentClockOutDelay;
|
||||
|
||||
const Reg TestPulsePeriod = PHA::DIG::TestPulsePeriod;
|
||||
const Reg TestPulseWidth = PHA::DIG::TestPulseWidth;
|
||||
const Reg TestPulseLowLevel = PHA::DIG::TestPulseLowLevel;
|
||||
const Reg TestPulseHighLevel = PHA::DIG::TestPulseHighLevel;
|
||||
|
||||
// only for version >= 2024041200
|
||||
const Reg IPEAmplitude ("IPEAmplitude", RW::ReadWrite, TYPE::DIG, {{"0", ""},{"16383", ""}, {"1", ""}}, ANSTYPE::INTEGER, "ADC counts");
|
||||
const Reg IPEBaseline ("IPEBaseline", RW::ReadWrite, TYPE::DIG, {{"0", ""},{"16383", ""}, {"1", ""}}, ANSTYPE::INTEGER, "ADC counts");
|
||||
const Reg IPEDecayTime ("IPEDecayTime", RW::ReadWrite, TYPE::DIG, {{"8", ""},{ "2000", ""}, {"8", ""}}, ANSTYPE::INTEGER, "ns");
|
||||
const Reg IPERate ("IPERate", RW::ReadWrite, TYPE::DIG, {{"1", ""},{"60000", ""}, {"1", ""}}, ANSTYPE::INTEGER, "Hz");
|
||||
const Reg IPETimeMode ("IPETimeMode", RW::ReadWrite, TYPE::DIG, {{"ConstantRate", "constant rate"},
|
||||
{"Poissonian", "Poisson"}});
|
||||
|
||||
const Reg ErrorFlagMask = PHA::DIG::ErrorFlagMask;
|
||||
const Reg ErrorFlagDataMask = PHA::DIG::ErrorFlagDataMask;
|
||||
const Reg DACoutMode = PHA::DIG::DACoutMode;
|
||||
|
@ -950,10 +976,16 @@ namespace PSD{
|
|||
const Reg ChannelWaveCount = PHA::CH::ChannelWaveCount;
|
||||
|
||||
/// ======= read write
|
||||
//^ not impletemented
|
||||
//^ not impletemented in digitizer panel
|
||||
//--- only for VX2745
|
||||
const Reg SelfTriggerWidth = PHA::CH::SelfTriggerWidth;
|
||||
const Reg SignalOffset = PHA::CH::SignalOffset;
|
||||
|
||||
//--- for VX2730
|
||||
const Reg ChGain ("ChGain", RW::ReadWrite, TYPE::CH, {{"0", ""},{"29", ""}, {"1", ""}}, ANSTYPE::INTEGER, "dB");
|
||||
|
||||
//--- for VX2745 and VX2730
|
||||
const Reg SignalOffset = PHA::CH::SignalOffset;
|
||||
|
||||
//^ impletemented
|
||||
const Reg ChannelEnable = PHA::CH::ChannelEnable;
|
||||
const Reg DC_Offset = PHA::CH::DC_Offset;
|
||||
|
@ -1073,7 +1105,7 @@ namespace PSD{
|
|||
const Reg CFDDelay ("CFDDelayT", RW::ReadWrite, TYPE::CH, {{"32", ""},{"8184", ""},{"8", ""}}, ANSTYPE::INTEGER, "ns");
|
||||
const Reg CFDFraction ("CFDFraction", RW::ReadWrite, TYPE::CH, {{"25", ""},{"100", ""},{"0", ""}}, ANSTYPE::INTEGER, "%");
|
||||
|
||||
const Reg TimeFilterRetriggerGuard ("TimeFilterRetriggerGuardT", RW::ReadWrite, TYPE::CH, {{"0", ""},{"8000", ""},{"8", ""}}, ANSTYPE::INTEGER, "ns");
|
||||
const Reg TimeFilterRetriggerGuard ("TimeFilterRetriggerGuardT", RW::ReadWrite, TYPE::CH, {{"8", ""},{"8000", ""},{"8", ""}}, ANSTYPE::INTEGER, "ns");
|
||||
|
||||
const Reg TriggerHysteresis ("TriggerHysteresis", RW::ReadWrite, TYPE::CH, {{"Enabled", "Enabled"}, {"Disabled", "Disabled"}});
|
||||
const Reg PileupGap ("PileupGap", RW::ReadWrite, TYPE::CH, {{"0", ""},{"65535", ""},{"1", ""}}, ANSTYPE::INTEGER, "sample");
|
||||
|
@ -1159,7 +1191,11 @@ namespace PSD{
|
|||
WaveDigitalProbe0 , //
|
||||
WaveDigitalProbe1 , //
|
||||
WaveDigitalProbe2 , //
|
||||
WaveDigitalProbe3 //,
|
||||
WaveDigitalProbe3 ,
|
||||
|
||||
SelfTriggerWidth ,
|
||||
SignalOffset ,
|
||||
ChGain
|
||||
|
||||
// RecordLengthSample , // 21
|
||||
// PreTriggerSample , // 22
|
||||
|
|
|
@ -119,7 +119,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
|
|||
}
|
||||
}
|
||||
|
||||
{//^====================== Group Board status
|
||||
{//^====================== Group of Board status
|
||||
QGroupBox * statusBox = new QGroupBox("Board Status", digiTab[iDigi]);
|
||||
QGridLayout * statusLayout = new QGridLayout(statusBox);
|
||||
statusLayout->setAlignment(Qt::AlignLeft);
|
||||
|
@ -338,8 +338,9 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
|
|||
|
||||
for( int i = 0; i < (int) PHA::DIG::GlobalTriggerSource.GetAnswers().size(); i++){
|
||||
ckbGlbTrgSource[iDigi][i] = new QCheckBox( QString::fromStdString((PHA::DIG::GlobalTriggerSource.GetAnswers())[i].second), digiTab[iDigi]);
|
||||
boardLayout->addWidget(ckbGlbTrgSource[iDigi][i], rowId, 1 + i);
|
||||
boardLayout->addWidget(ckbGlbTrgSource[iDigi][i], rowId, 1 + i%5);
|
||||
connect(ckbGlbTrgSource[iDigi][i], &QCheckBox::stateChanged, this, &DigiSettingsPanel::SetGlobalTriggerSource);
|
||||
if ( i == 4) rowId++;
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
|
@ -556,13 +557,13 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
|
|||
}
|
||||
});
|
||||
|
||||
connect(cbDACoutMode[iDigi], &RComboBox::currentIndexChanged, this, [=](){
|
||||
if( cbDACoutMode[iDigi]->currentData().toString().toStdString() == "Square" ) {
|
||||
bdTestPulse[iDigi]->setEnabled(true);
|
||||
}else{
|
||||
if( ckbGlbTrgSource[iDigi][3]->isChecked() == false ) bdTestPulse[iDigi]->setEnabled(false);
|
||||
}
|
||||
});
|
||||
// connect(cbDACoutMode[iDigi], &RComboBox::currentIndexChanged, this, [=](){
|
||||
// if( cbDACoutMode[iDigi]->currentData().toString().toStdString() == "Square" ) {
|
||||
// bdTestPulse[iDigi]->setEnabled(true);
|
||||
// }else{
|
||||
// if( ckbGlbTrgSource[iDigi][3]->isChecked() == false ) bdTestPulse[iDigi]->setEnabled(false);
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
|
@ -584,9 +585,22 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
|
|||
spbTestPusleLowLevel[iDigi]->setFixedWidth(100);
|
||||
spbTestPusleHighLevel[iDigi]->setFixedWidth(100);
|
||||
|
||||
QLabel * lbFreq = new QLabel("", bdTestPulse[iDigi]); lbFreq->setAlignment(Qt::AlignCenter); testPulseLayout->addWidget(lbFreq, 0, 2);
|
||||
QLabel * lblow = new QLabel("", bdTestPulse[iDigi]); lblow->setAlignment(Qt::AlignCenter); testPulseLayout->addWidget(lblow, 2, 2);
|
||||
QLabel * lbhigh = new QLabel("", bdTestPulse[iDigi]); lbhigh->setAlignment(Qt::AlignCenter); testPulseLayout->addWidget(lbhigh, 3, 2);
|
||||
|
||||
connect(dsbTestPuslePeriod[iDigi], &RSpinBox::valueChanged, this, [=](){
|
||||
double value = dsbTestPuslePeriod[iDigi]->value();
|
||||
double freq = 1e9/value; // Hz
|
||||
if( 1e3 > freq){
|
||||
lbFreq->setText(" = " + QString::number(freq, 'f', 2) + " Hz");
|
||||
}else if( 1e6 > freq && freq >= 1e3 ) {
|
||||
lbFreq->setText(" = " + QString::number(freq/1e3, 'f', 2) + " KHz");
|
||||
}else if( freq >= 1e6 ) {
|
||||
lbFreq->setText(" = " + QString::number(freq/1e6, 'f', 2) + " MHz");
|
||||
}
|
||||
});
|
||||
|
||||
connect(spbTestPusleLowLevel[iDigi], &RSpinBox::valueChanged, this, [=](){
|
||||
double value = spbTestPusleLowLevel[iDigi]->value();
|
||||
lblow->setText("approx. " + QString::number(value/0xffff*2 - 1, 'f', 2) + " V");
|
||||
|
@ -597,6 +611,38 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
|
|||
lbhigh->setText("approx. " + QString::number(value/0xffff*2 - 1, 'f', 2) + " V");
|
||||
});
|
||||
|
||||
|
||||
QPushButton * bnTestPulse = new QPushButton("Set 1 kHz, +1 V Square Pulse", bdTestPulse[iDigi]);
|
||||
testPulseLayout->addWidget(bnTestPulse, 4, 0, 1, 3);
|
||||
connect(bnTestPulse, &QPushButton::clicked, this, [=](){
|
||||
|
||||
SendLogMsg("Digi-" + QString::number(digi[ID]->GetSerialNumber()) + "|Set Test Pulse to 1kHz, +1V, 3000 ns");
|
||||
|
||||
digi[ID]->WriteValue(PHA::DIG::TestPulsePeriod, std::to_string(1e6));
|
||||
digi[ID]->WriteValue(PHA::DIG::TestPulseWidth, std::to_string(3000));
|
||||
digi[ID]->WriteValue(PHA::DIG::TestPulseLowLevel, std::to_string(24700));
|
||||
digi[ID]->WriteValue(PHA::DIG::TestPulseHighLevel, std::to_string(45000));
|
||||
|
||||
enableSignalSlot = false;
|
||||
|
||||
FillSpinBoxValueFromMemory(dsbTestPuslePeriod[ID], PHA::DIG::TestPulsePeriod);
|
||||
FillSpinBoxValueFromMemory(dsbTestPusleWidth[ID], PHA::DIG::TestPulseWidth);
|
||||
FillSpinBoxValueFromMemory(spbTestPusleLowLevel[ID], PHA::DIG::TestPulseLowLevel);
|
||||
FillSpinBoxValueFromMemory(spbTestPusleHighLevel[ID], PHA::DIG::TestPulseHighLevel);
|
||||
|
||||
enableSignalSlot = true;
|
||||
|
||||
});
|
||||
|
||||
if( digi[iDigi]->GetCupVer() >= 2024041200 && digi[iDigi]->GetFPGAType() == DPPType::PSD ){ // there are expoential test pulse
|
||||
SetupSpinBox(sbIPEAmplitude[iDigi], PSD::DIG::IPEAmplitude, -1, false, "Ampuitude [LSB] :", testPulseLayout, 6, 0);
|
||||
SetupSpinBox(sbIPEBaseline[iDigi], PSD::DIG::IPEBaseline, -1, false, "Base line [LSB] :", testPulseLayout, 7, 0);
|
||||
SetupSpinBox(sbIPEDecayTime[iDigi], PSD::DIG::IPEDecayTime, -1, false, "Decay Time [ns] :", testPulseLayout, 8, 0);
|
||||
SetupSpinBox(sbIPERate[iDigi], PSD::DIG::IPERate, -1, false, "Rate [Hz] :", testPulseLayout, 9, 0);
|
||||
SetupComboBox(cbIPETimeMode[iDigi], PSD::DIG::IPETimeMode, -1, false, "Time Mode :", testPulseLayout, 10, 0);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
{//^====================== VGA settings
|
||||
|
@ -1022,8 +1068,6 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
enableSignalSlot = true;
|
||||
});
|
||||
|
||||
|
@ -1062,7 +1106,10 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
|
|||
|
||||
QPushButton * bnRead = new QPushButton("Read", ICTab);
|
||||
inquiryLayout->addWidget(bnRead, rowID, 5, 2, 1);
|
||||
connect(bnRead, &QPushButton::clicked, this, [=](){ ReadBoardSetting(cbBdSettings->currentIndex()); ReadChannelSetting(cbChSettings->currentIndex()); });
|
||||
connect(bnRead, &QPushButton::clicked, this, [=](){
|
||||
ReadBoardSetting(cbBdSettings->currentIndex());
|
||||
ReadChannelSetting(cbChSettings->currentIndex());
|
||||
});
|
||||
|
||||
cbBdAns = new RComboBox(ICTab);
|
||||
cbBdAns->setFixedWidth(200);
|
||||
|
@ -1228,9 +1275,12 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
|
|||
double value = sbChSettingsWrite->value();
|
||||
sbChSettingsWrite->setValue( (std::round(value/step) * step) );
|
||||
}
|
||||
|
||||
Reg para = PHA::CH::AllSettings[cbChSettings->currentIndex()];
|
||||
|
||||
ID = cbIQDigi->currentIndex();
|
||||
Reg para ;
|
||||
if ( digi[ID]->GetFPGAType() == DPPType::PHA) para = PHA::CH::AllSettings[cbChSettings->currentIndex()];
|
||||
if ( digi[ID]->GetFPGAType() == DPPType::PSD) para = PSD::CH::AllSettings[cbChSettings->currentIndex()];
|
||||
|
||||
int ch_index = cbIQCh->currentIndex();
|
||||
QString msg;
|
||||
msg = "DIG:"+ QString::number(digi[ID]->GetSerialNumber()) + "|" + QString::fromStdString(para.GetPara());
|
||||
|
@ -2339,10 +2389,14 @@ void DigiSettingsPanel::UpdateStatus(){
|
|||
digi[ID]->ReadValue(PHA::DIG::LED_status);
|
||||
digi[ID]->ReadValue(PHA::DIG::ACQ_status);
|
||||
|
||||
for( int i = 0; i < (int) PHA::DIG::TempSensADC.size(); i++){
|
||||
if( digi[ID]->GetModelName() != "VX2745" && i > 0 ) continue;
|
||||
digi[ID]->ReadValue(PHA::DIG::TempSensADC[i]);
|
||||
if( digi[ID]->GetModelName() == "VX2740" ) {
|
||||
digi[ID]->ReadValue(PHA::DIG::TempSensADC[0]);
|
||||
}else{
|
||||
for( int i = 0; i < (int) PHA::DIG::TempSensADC.size(); i++){
|
||||
digi[ID]->ReadValue(PHA::DIG::TempSensADC[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for( int i = 0; i < (int) PHA::DIG::TempSensOthers.size(); i++){
|
||||
digi[ID]->ReadValue(PHA::DIG::TempSensOthers[i]);
|
||||
}
|
||||
|
@ -2384,8 +2438,8 @@ void DigiSettingsPanel::EnableControl(){
|
|||
bnDisarmACQ[id]->setEnabled(enable);
|
||||
bnSoftwareStart[id]->setEnabled(enable);
|
||||
bnSoftwareStop[id]->setEnabled(enable);
|
||||
|
||||
if( digi[id]->GetFPGAType() != "DPP_PHA" || digi[id]->GetModelName() != "VX2745" ) bdVGA[id]->setEnabled(false);
|
||||
|
||||
if( digi[id]->GetModelName() != "VX2745" ) bdVGA[id]->setEnabled(false);
|
||||
|
||||
QVector<QTabWidget*> tempArray = {inputTab[id], trapTab[id], probeTab[id], otherTab[id] };
|
||||
|
||||
|
@ -2518,7 +2572,7 @@ void DigiSettingsPanel::UpdatePanelFromMemory(bool onlyStatus){
|
|||
|
||||
//-------- temperature
|
||||
for( int i = 0; i < 8; i++){
|
||||
leTemp[ID][i]->setText(QString::fromStdString(digi[ID]->GetSettingValueFromMemory(PHA::DIG::TempSensADC[i])));
|
||||
leTemp[ID][i]->setText(QString::fromStdString(digi[ID]->GetSettingValueFromMemory(PHA::DIG::TempSensADC[i]))); // same for PSD
|
||||
}
|
||||
|
||||
if( onlyStatus ) {
|
||||
|
@ -2551,13 +2605,13 @@ void DigiSettingsPanel::UpdatePanelFromMemory(bool onlyStatus){
|
|||
|
||||
result = QString::fromStdString(digi[ID]->GetSettingValueFromMemory(PHA::DIG::GlobalTriggerSource));
|
||||
resultList = result.remove(QChar(' ')).split("|");
|
||||
bdTestPulse[ID]->setEnabled(false);
|
||||
// bdTestPulse[ID]->setEnabled(false);
|
||||
for( int j = 0; j < (int) PHA::DIG::GlobalTriggerSource.GetAnswers().size(); j++){
|
||||
ckbGlbTrgSource[ID][j]->setChecked(false);
|
||||
for( int i = 0; i < resultList.count(); i++){
|
||||
if( resultList[i] == QString::fromStdString((PHA::DIG::GlobalTriggerSource.GetAnswers())[j].first) ) {
|
||||
ckbGlbTrgSource[ID][j]->setChecked(true);
|
||||
if( resultList[i] == "TestPulse" || cbDACoutMode[ID]->currentData().toString().toStdString() == "Square" ) bdTestPulse[ID]->setEnabled(true);
|
||||
// if( resultList[i] == "TestPulse" || cbDACoutMode[ID]->currentData().toString().toStdString() == "Square" ) bdTestPulse[ID]->setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2885,13 +2939,13 @@ void DigiSettingsPanel::SetGlobalTriggerSource(){
|
|||
if( !enableSignalSlot ) return;
|
||||
|
||||
std::string value = "";
|
||||
if( cbDACoutMode[ID]->currentData().toString().toStdString() != "Square") bdTestPulse[ID]->setEnabled(false);
|
||||
// if( cbDACoutMode[ID]->currentData().toString().toStdString() != "Square") bdTestPulse[ID]->setEnabled(false);
|
||||
for( int i = 0; i < (int) PHA::DIG::GlobalTriggerSource.GetAnswers().size(); i++){
|
||||
if( ckbGlbTrgSource[ID][i]->isChecked() ){
|
||||
//printf("----- %s \n", DIGIPARA::DIG::StartSource.GetAnswers()[i].first.c_str());
|
||||
if( value != "" ) value += " | ";
|
||||
value += PHA::DIG::GlobalTriggerSource.GetAnswers()[i].first;
|
||||
if( PHA::DIG::GlobalTriggerSource.GetAnswers()[i].first == "TestPulse" ) bdTestPulse[ID]->setEnabled(true);
|
||||
// if( PHA::DIG::GlobalTriggerSource.GetAnswers()[i].first == "TestPulse" ) bdTestPulse[ID]->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -164,6 +164,12 @@ private:
|
|||
RSpinBox * spbTestPusleLowLevel[MaxNumberOfDigitizer];
|
||||
RSpinBox * spbTestPusleHighLevel[MaxNumberOfDigitizer];
|
||||
|
||||
RSpinBox * sbIPEAmplitude[MaxNumberOfDigitizer];
|
||||
RSpinBox * sbIPEBaseline[MaxNumberOfDigitizer];
|
||||
RSpinBox * sbIPEDecayTime[MaxNumberOfDigitizer];
|
||||
RSpinBox * sbIPERate[MaxNumberOfDigitizer];
|
||||
RComboBox * cbIPETimeMode[MaxNumberOfDigitizer];
|
||||
|
||||
//-------------- VGA
|
||||
RSpinBox * VGA[MaxNumberOfDigitizer][4];
|
||||
|
||||
|
|
BIN
firmwares/V2745-dpp-pha-1G-2025012205.cup
Normal file
BIN
firmwares/V2745-dpp-pha-1G-2025012205.cup
Normal file
Binary file not shown.
3
main.cpp
3
main.cpp
|
@ -8,6 +8,8 @@
|
|||
|
||||
int main(int argc, char *argv[]){
|
||||
|
||||
printf("######### Starting SOLARIS DAQ....\n");
|
||||
|
||||
QApplication a(argc, argv);
|
||||
|
||||
bool isLock = false;
|
||||
|
@ -60,6 +62,7 @@ int main(int argc, char *argv[]){
|
|||
pidFile.write( QString::number(QCoreApplication::applicationPid() ).toStdString().c_str() );
|
||||
pidFile.close();
|
||||
|
||||
printf("######### Open Main Window...\n");
|
||||
MainWindow w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
|
|
|
@ -69,7 +69,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
|
|||
leAccept = nullptr;
|
||||
lbFileSize = nullptr;
|
||||
|
||||
scalarThread = new TimingThread();
|
||||
scalarThread = new TimingThread(); // 2 sec is default
|
||||
//scalarThread->SetWaitTimeSec(2);
|
||||
connect(scalarThread, &TimingThread::TimeUp, this, &MainWindow::UpdateScalar);
|
||||
|
||||
}
|
||||
|
@ -1254,6 +1255,8 @@ void MainWindow::CleanUpScalar(){
|
|||
|
||||
void MainWindow::UpdateScalar(){
|
||||
if( !digi ) return;
|
||||
if( scalar == NULL ) return;
|
||||
if( scalar->isVisible() == false ) return;
|
||||
|
||||
lbLastUpdateTime->setText("Last update: " + QDateTime::currentDateTime().toString("MM.dd hh:mm:ss"));
|
||||
|
||||
|
@ -1268,22 +1271,32 @@ void MainWindow::UpdateScalar(){
|
|||
|
||||
//=========== another method, directly readValue
|
||||
for( int ch = 0; ch < digi[iDigi]->GetNChannels(); ch ++){
|
||||
digiMTX[iDigi].lock();
|
||||
// digiMTX[iDigi].lock();
|
||||
std::string timeStr = digi[iDigi]->ReadValue(PHA::CH::ChannelRealtime, ch); // for refreashing SelfTrgRate and SavedCount
|
||||
haha[ch] = digi[iDigi]->ReadValue(PHA::CH::SelfTrgRate, ch);
|
||||
std::string kakaStr = digi[iDigi]->ReadValue(PHA::CH::ChannelSavedCount, ch);
|
||||
digiMTX[iDigi].unlock();
|
||||
// digiMTX[iDigi].unlock();
|
||||
|
||||
unsigned long kaka = std::stoul(kakaStr.c_str()) ;
|
||||
unsigned long time = std::stoul(timeStr.c_str()) ;
|
||||
leTrigger[iDigi][ch]->setText(QString::fromStdString(haha[ch]));
|
||||
///* it seems that the ChannelRealtime is not in ns for VX2730
|
||||
if( digi[iDigi]->GetModelName() == "VX2730" ){ time = time / 4;}
|
||||
|
||||
leTrigger[iDigi][ch]->setText(QString::fromStdString(haha[ch]));
|
||||
|
||||
if( oldTimeStamp[iDigi][ch] > 0 && time - oldTimeStamp[iDigi][ch] > 1e9 && kaka > oldSavedCount[iDigi][ch]){
|
||||
acceptRate[ch] = (kaka - oldSavedCount[iDigi][ch]) * 1e9 *1.0 / (time - oldTimeStamp[iDigi][ch]);
|
||||
}else{
|
||||
acceptRate[ch] = 0;
|
||||
}
|
||||
|
||||
//if( acceptRate[ch] > 10000 ) printf("%d-%2d | old (%lu, %lu), new (%lu, %lu)\n", iDigi, ch, oldTimeStamp[iDigi][ch], oldSavedCount[iDigi][ch], time, kaka);
|
||||
// if( ch == 3){
|
||||
// printf("time: %lu (%lu) = %12.10f, Channel Saved Count %lu (%lu) = %lu | accepted Rate %f\n",
|
||||
// time, oldTimeStamp[iDigi][ch], (time - oldTimeStamp[iDigi][ch])/1e9,
|
||||
// kaka, oldSavedCount[iDigi][ch], (kaka - oldSavedCount[iDigi][ch]),
|
||||
// acceptRate[ch]);
|
||||
// }
|
||||
|
||||
oldSavedCount[iDigi][ch] = kaka;
|
||||
oldTimeStamp[iDigi][ch] = time;
|
||||
|
|
Loading…
Reference in New Issue
Block a user