finsiah the low level settings

This commit is contained in:
Ryan Tang 2023-03-13 16:51:11 -04:00
parent 77d2023776
commit 68953be4bf
4 changed files with 487 additions and 173 deletions

View File

@ -5,7 +5,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
enum ANSTYPE {NUM, STR, NONE}; enum ANSTYPE {INTEGER, FLOAT, LIST, STR, NONE};
enum TYPE {CH, DIG, LVDS, VGA}; enum TYPE {CH, DIG, LVDS, VGA};
enum RW { ReadOnly, WriteOnly, ReadWrite}; enum RW { ReadOnly, WriteOnly, ReadWrite};
@ -28,14 +28,14 @@ class Reg {
type = TYPE::CH; type = TYPE::CH;
isCmd = false; isCmd = false;
value = ""; value = "";
ansType = ANSTYPE::STR; ansType = ANSTYPE::LIST;
answerUnit = ""; answerUnit = "";
answer.clear(); answer.clear();
} }
Reg(std::string para, RW readwrite, Reg(std::string para, RW readwrite,
TYPE type = TYPE::CH, TYPE type = TYPE::CH,
std::vector<std::pair<std::string,std::string>> answer = {}, std::vector<std::pair<std::string,std::string>> answer = {},
ANSTYPE ansType = ANSTYPE::STR, ANSTYPE ansType = ANSTYPE::LIST,
std::string ansUnit = "", std::string ansUnit = "",
bool isCmd = false){ bool isCmd = false){
this->name = para; this->name = para;
@ -114,58 +114,58 @@ namespace DIGIPARA{
namespace DIG{ namespace DIG{
///============== read only ///============== read only
const Reg CupVer ("CupVer", RW::ReadOnly, TYPE::DIG); const Reg CupVer ("CupVer", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::STR);
const Reg FPGA_firmwareVersion ("FPGA_FwVer", RW::ReadOnly, TYPE::DIG); const Reg FPGA_firmwareVersion ("FPGA_FwVer", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::STR);
const Reg FirmwareType ("FwType", RW::ReadOnly, TYPE::DIG, {{"DPP_PHA", ""}, {"DPP_ZLE", ""}, {"DPP_PSD", ""}, {"DPP_DAW", ""}, {"DPP_OPEN", ""}, {"Scope", ""}}); const Reg FirmwareType ("FwType", RW::ReadOnly, TYPE::DIG, {{"DPP_PHA", ""}, {"DPP_ZLE", ""}, {"DPP_PSD", ""}, {"DPP_DAW", ""}, {"DPP_OPEN", ""}, {"Scope", ""}});
const Reg ModelCode ("ModelCode", RW::ReadOnly, TYPE::DIG); const Reg ModelCode ("ModelCode", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::STR);
const Reg PBCode ("PBCode", RW::ReadOnly, TYPE::DIG); const Reg PBCode ("PBCode", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::STR);
const Reg ModelName ("ModelName", RW::ReadOnly, TYPE::DIG); const Reg ModelName ("ModelName", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::STR);
const Reg FromFactor ("FormFactor", RW::ReadOnly, TYPE::DIG, {{"0", "VME"}, {"1", "VME64X"}, {"2", "DT"}}); const Reg FromFactor ("FormFactor", RW::ReadOnly, TYPE::DIG, {{"0", "VME"}, {"1", "VME64X"}, {"2", "DT"}});
const Reg FamilyCode ("FamilyCode", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM); const Reg FamilyCode ("FamilyCode", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER);
const Reg SerialNumber ("SerialNum", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM); const Reg SerialNumber ("SerialNum", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER);
const Reg PCBrev_MB ("PCBrev_MB", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM); const Reg PCBrev_MB ("PCBrev_MB", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER);
const Reg PCBrev_PB ("PCBrev_PB", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM); const Reg PCBrev_PB ("PCBrev_PB", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER);
const Reg DPP_License ("License", RW::ReadOnly, TYPE::DIG); const Reg DPP_License ("License", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::STR);
const Reg DPP_LicenseStatus ("LicenseStatus", RW::ReadOnly, TYPE::DIG); const Reg DPP_LicenseStatus ("LicenseStatus", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::STR);
const Reg DPP_LicenseRemainingTime ("LicenseRemainingTime", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM); const Reg DPP_LicenseRemainingTime ("LicenseRemainingTime", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER);
const Reg NumberOfChannel ("NumCh", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM); const Reg NumberOfChannel ("NumCh", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER);
const Reg ADC_bit ("ADC_Nbit", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "sec"); const Reg ADC_bit ("ADC_Nbit", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "sec");
const Reg ADC_SampleRate ("ADC_SamplRate", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "MS/s"); const Reg ADC_SampleRate ("ADC_SamplRate", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "MS/s");
const Reg InputDynamicRange ("InputRange", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "Vpp"); const Reg InputDynamicRange ("InputRange", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "Vpp");
const Reg InputType ("InputType", RW::ReadOnly, TYPE::DIG, {{"0","Singled ended"}, {"1", "Differential"}}); const Reg InputType ("InputType", RW::ReadOnly, TYPE::DIG, {{"0","Singled ended"}, {"1", "Differential"}});
const Reg InputImpedance ("Zin", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "Ohm"); const Reg InputImpedance ("Zin", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "Ohm");
const Reg IPAddress ("IPAddress", RW::ReadOnly, TYPE::DIG); const Reg IPAddress ("IPAddress", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::STR);
const Reg NetMask ("Netmask", RW::ReadOnly, TYPE::DIG); const Reg NetMask ("Netmask", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::STR);
const Reg Gateway ("Gateway", RW::ReadOnly, TYPE::DIG); const Reg Gateway ("Gateway", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::STR);
const Reg LED_status ("LedStatus", RW::ReadOnly, TYPE::DIG); const Reg LED_status ("LedStatus", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::STR, "byte");
const Reg ACQ_status ("AcquisitionStatus", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "byte"); const Reg ACQ_status ("AcquisitionStatus", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::STR, "byte");
const Reg MaxRawDataSize ("MaxRawDataSize", RW::ReadOnly, TYPE::DIG); const Reg MaxRawDataSize ("MaxRawDataSize", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::STR, "byte");
const Reg TempSensAirIn ("TempSensAirIn", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensAirIn ("TempSensAirIn", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const Reg TempSensAirOut ("TempSensAirOut", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensAirOut ("TempSensAirOut", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const Reg TempSensCore ("TempSensCore", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensCore ("TempSensCore", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const Reg TempSensFirstADC ("TempSensFirstADC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensFirstADC ("TempSensFirstADC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const Reg TempSensLastADC ("TempSensLastADC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensLastADC ("TempSensLastADC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const Reg TempSensHottestADC ("TempSensHottestADC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensHottestADC ("TempSensHottestADC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const Reg TempSensADC0 ("TempSensADC0", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensADC0 ("TempSensADC0", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const Reg TempSensADC1 ("TempSensADC1", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensADC1 ("TempSensADC1", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const Reg TempSensADC2 ("TempSensADC2", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensADC2 ("TempSensADC2", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const Reg TempSensADC3 ("TempSensADC3", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensADC3 ("TempSensADC3", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const Reg TempSensADC4 ("TempSensADC4", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensADC4 ("TempSensADC4", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const Reg TempSensADC5 ("TempSensADC5", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensADC5 ("TempSensADC5", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const Reg TempSensADC6 ("TempSensADC6", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensADC6 ("TempSensADC6", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const Reg TempSensADC7 ("TempSensADC7", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensADC7 ("TempSensADC7", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const std::vector<Reg> TempSensADC = {TempSensADC0,TempSensADC1,TempSensADC2,TempSensADC3,TempSensADC4,TempSensADC5,TempSensADC6,TempSensADC7}; const std::vector<Reg> TempSensADC = {TempSensADC0,TempSensADC1,TempSensADC2,TempSensADC3,TempSensADC4,TempSensADC5,TempSensADC6,TempSensADC7};
const Reg TempSensDCDC ("TempSensDCDC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "C"); const Reg TempSensDCDC ("TempSensDCDC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "C");
const Reg VInSensDCDC ("VInSensDCDC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "V"); const Reg VInSensDCDC ("VInSensDCDC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "V");
const Reg VOutSensDCDC ("VOutSensDCDC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "V"); const Reg VOutSensDCDC ("VOutSensDCDC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "V");
const Reg IOutSensDCDC ("IOutSensDCDC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "Amp"); const Reg IOutSensDCDC ("IOutSensDCDC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "Amp");
const Reg FreqSensCore ("FreqSensCore", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "Hz"); const Reg FreqSensCore ("FreqSensCore", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "Hz");
const Reg DutyCycleSensDCDC ("DutyCycleSensDCDC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "%"); const Reg DutyCycleSensDCDC ("DutyCycleSensDCDC", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "%");
const Reg SpeedSensFan1 ("SpeedSensFan1", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "rpm"); const Reg SpeedSensFan1 ("SpeedSensFan1", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "rpm");
const Reg SpeedSensFan2 ("SpeedSensFan2", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::NUM, "rpm"); const Reg SpeedSensFan2 ("SpeedSensFan2", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::INTEGER, "rpm");
const Reg ErrorFlags ("ErrorFlags", RW::ReadOnly, TYPE::DIG); const Reg ErrorFlags ("ErrorFlags", RW::ReadOnly, TYPE::DIG, {}, ANSTYPE::STR, "byte");
const Reg BoardReady ("BoardReady", RW::ReadOnly, TYPE::DIG, {{"True", "No Error"}, {"False", "Error"}}); const Reg BoardReady ("BoardReady", RW::ReadOnly, TYPE::DIG, {{"True", "No Error"}, {"False", "Error"}});
///============= read write ///============= read write
@ -226,20 +226,20 @@ namespace DIGIPARA{
{"LVDS", "LVDS"}, {"LVDS", "LVDS"},
{"GPIO", "GPIO"}, {"GPIO", "GPIO"},
{"P0", "Back Plane"}}); {"P0", "Back Plane"}});
const Reg BoardVetoWidth ("BoardVetoWidth", RW::ReadWrite, TYPE::DIG, {{"0", ""}, {"34359738360", ""}, {"1", ""}}, ANSTYPE::NUM, "ns"); const Reg BoardVetoWidth ("BoardVetoWidth", RW::ReadWrite, TYPE::DIG, {{"0", ""}, {"34359738360", ""}, {"1", ""}}, ANSTYPE::INTEGER, "ns");
const Reg BoardVetoPolarity ("BoardVetoPolarity", RW::ReadWrite, TYPE::DIG, {{"ActiveHigh", "High"}, {"ActiveLow", "Low"}}); const Reg BoardVetoPolarity ("BoardVetoPolarity", RW::ReadWrite, TYPE::DIG, {{"ActiveHigh", "High"}, {"ActiveLow", "Low"}});
const Reg RunDelay ("RunDelay", RW::ReadWrite, TYPE::DIG, {{"0", ""}, {"524280", ""}, {"1", ""}}, ANSTYPE::NUM, "ns"); const Reg RunDelay ("RunDelay", RW::ReadWrite, TYPE::DIG, {{"0", ""}, {"524280", ""}, {"1", ""}}, ANSTYPE::INTEGER, "ns");
const Reg EnableAutoDisarmACQ ("EnAutoDisarmAcq", RW::ReadWrite, TYPE::DIG, {{"True", "Enabled"}, {"False", "Disabled"}}); const Reg EnableAutoDisarmACQ ("EnAutoDisarmAcq", RW::ReadWrite, TYPE::DIG, {{"True", "Enabled"}, {"False", "Disabled"}});
const Reg EnableDataReduction ("EnDataReduction", RW::ReadWrite, TYPE::DIG, {{"False", "Disabled"}, {"True", "Enabled"}}); const Reg EnableDataReduction ("EnDataReduction", RW::ReadWrite, TYPE::DIG, {{"False", "Disabled"}, {"True", "Enabled"}});
const Reg EnableStatisticEvents ("EnStatEvents", RW::ReadWrite, TYPE::DIG, {{"False", "Disabled"}, {"True", "Enabled"}}); const Reg EnableStatisticEvents ("EnStatEvents", RW::ReadWrite, TYPE::DIG, {{"False", "Disabled"}, {"True", "Enabled"}});
const Reg VolatileClockOutDelay ("VolatileClockOutDelay", RW::ReadWrite, TYPE::DIG, {{"-18888.888", ""}, {"18888.888", ""}, {"74.074", ""}}, ANSTYPE::NUM, "ps"); const Reg VolatileClockOutDelay ("VolatileClockOutDelay", RW::ReadWrite, TYPE::DIG, {{"-18888.888", ""}, {"18888.888", ""}, {"74.074", ""}}, ANSTYPE::FLOAT, "ps");
const Reg PermanentClockOutDelay ("PermanentClockOutDelay", RW::ReadWrite, TYPE::DIG, {{"-18888.888", ""}, {"18888.888", ""}, {"74.074", ""}}, ANSTYPE::NUM, "ps"); 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::NUM, "ns"); 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::NUM, "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::NUM, "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::NUM, "ns"); const Reg TestPulseHighLevel ("TestPulseHighLevel", RW::ReadWrite, TYPE::DIG, {{"0", ""},{"65535", ""}, {"1", ""}}, ANSTYPE::INTEGER, "ns");
const Reg ErrorFlagMask ("ErrorFlagMask", RW::ReadWrite, TYPE::DIG); const Reg ErrorFlagMask ("ErrorFlagMask", RW::ReadWrite, TYPE::DIG, {}, ANSTYPE::STR);
const Reg ErrorFlagDataMask ("ErrorFlagDataMask", RW::ReadWrite, TYPE::DIG); const Reg ErrorFlagDataMask ("ErrorFlagDataMask", RW::ReadWrite, TYPE::DIG, {}, ANSTYPE::STR);
const Reg DACoutMode ("DACoutMode", RW::ReadWrite, TYPE::DIG, {{"Static", "DAC fixed level"}, const Reg DACoutMode ("DACoutMode", RW::ReadWrite, TYPE::DIG, {{"Static", "DAC fixed level"},
{"ChInput", "From Channel"}, {"ChInput", "From Channel"},
{"ChSum", "Sum of all Channels"}, {"ChSum", "Sum of all Channels"},
@ -247,8 +247,8 @@ namespace DIGIPARA{
{"Ramp", "14-bit counter"}, {"Ramp", "14-bit counter"},
{"Sin5MHz", "5 MHz Sin wave"}, {"Sin5MHz", "5 MHz Sin wave"},
{"Square", "Test Pulse"}}); {"Square", "Test Pulse"}});
const Reg DACoutStaticLevel ("DACoutStaticLevel", RW::ReadWrite, TYPE::DIG, {{"0", ""}, {"16383", ""}, {"1",""}}, ANSTYPE::NUM, "units"); 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::NUM); const Reg DACoutChSelect ("DACoutChSelect", RW::ReadWrite, TYPE::DIG, {{"0", ""}, {"64", ""}, {"1",""}}, ANSTYPE::INTEGER);
const Reg EnableOffsetCalibration ("EnOffsetCalibration", RW::ReadWrite, TYPE::DIG, {{"True", "Applied Cali."}, {"False", "No Cali."}}); const Reg EnableOffsetCalibration ("EnOffsetCalibration", RW::ReadWrite, TYPE::DIG, {{"True", "Applied Cali."}, {"False", "No Cali."}});
/// ========== command /// ========== command
@ -348,27 +348,27 @@ namespace DIGIPARA{
} }
namespace VGA{ namespace VGA{
const Reg VGAGain ("VGAGain", RW::ReadWrite, TYPE::VGA, {{"0", ""},{"40", ""}, {"0.5",""}}, ANSTYPE::NUM, "dB"); // VX2745 only const Reg VGAGain ("VGAGain", RW::ReadWrite, TYPE::VGA, {{"0", ""},{"40", ""}, {"0.5",""}}, ANSTYPE::INTEGER, "dB"); // VX2745 only
} }
namespace CH{ namespace CH{
/// ========= red only /// ========= red only
const Reg SelfTrgRate ("SelfTrgRate", RW::ReadOnly, TYPE::CH, {}, ANSTYPE::NUM, "Hz"); const Reg SelfTrgRate ("SelfTrgRate", RW::ReadOnly, TYPE::CH, {}, ANSTYPE::INTEGER, "Hz");
const Reg ChannelStatus ("ChStatus", RW::ReadOnly); const Reg ChannelStatus ("ChStatus", RW::ReadOnly, TYPE::CH, {}, ANSTYPE::STR);
const Reg GainFactor ("GainFactor", RW::ReadOnly); const Reg GainFactor ("GainFactor", RW::ReadOnly, TYPE::CH, {}, ANSTYPE::FLOAT);
const Reg ADCToVolts ("ADCToVolts", RW::ReadOnly); const Reg ADCToVolts ("ADCToVolts", RW::ReadOnly, TYPE::CH, {}, ANSTYPE::FLOAT);
const Reg Energy_Nbit ("Energy_Nbit", RW::ReadOnly); const Reg Energy_Nbit ("Energy_Nbit", RW::ReadOnly, TYPE::CH, {}, ANSTYPE::STR);
const Reg ChannelRealtime ("ChRealtimeMonitor", RW::ReadOnly); // when called, update DeadTime, TriggerCount, SaveCount, and WaveCount const Reg ChannelRealtime ("ChRealtimeMonitor", RW::ReadOnly, TYPE::CH, {}, ANSTYPE::STR); // when called, update DeadTime, TriggerCount, SaveCount, and WaveCount
const Reg ChannelDeadtime ("ChDeadtimeMonitor", RW::ReadOnly); const Reg ChannelDeadtime ("ChDeadtimeMonitor", RW::ReadOnly, TYPE::CH, {}, ANSTYPE::STR);
const Reg ChannelTriggerCount ("ChTriggerCnt", RW::ReadOnly); const Reg ChannelTriggerCount ("ChTriggerCnt", RW::ReadOnly, TYPE::CH, {}, ANSTYPE::STR);
const Reg ChannelSavedCount ("ChSavedEventCnt", RW::ReadOnly); const Reg ChannelSavedCount ("ChSavedEventCnt", RW::ReadOnly, TYPE::CH, {}, ANSTYPE::STR);
const Reg ChannelWaveCount ("ChWaveCnt", RW::ReadOnly); const Reg ChannelWaveCount ("ChWaveCnt", RW::ReadOnly, TYPE::CH, {}, ANSTYPE::STR);
/// ======= read write /// ======= read write
const Reg ChannelEnable ("ChEnable", RW::ReadWrite, TYPE::CH, {{"True", "Enabled"}, {"False", "Disabled"}}); const Reg ChannelEnable ("ChEnable", RW::ReadWrite, TYPE::CH, {{"True", "Enabled"}, {"False", "Disabled"}});
const Reg DC_Offset ("DCOffset", RW::ReadWrite, TYPE::CH, {{"0", ""}, {"100", ""}, {"1",""}}, ANSTYPE::NUM, "%"); const Reg DC_Offset ("DCOffset", RW::ReadWrite, TYPE::CH, {{"0", ""}, {"100", ""}, {"1",""}}, ANSTYPE::INTEGER, "%");
const Reg TriggerThreshold ("TriggerThr", RW::ReadWrite, TYPE::CH, {{"0", ""},{"8191", ""}, {"1",""}}, ANSTYPE::NUM); const Reg TriggerThreshold ("TriggerThr", RW::ReadWrite, TYPE::CH, {{"0", ""},{"8191", ""}, {"1",""}}, ANSTYPE::INTEGER);
const Reg Polarity ("PulsePolarity", RW::ReadWrite, TYPE::CH, {{"Positive", "Pos. +"},{"Negative", "Neg. -"}}); const Reg Polarity ("PulsePolarity", RW::ReadWrite, TYPE::CH, {{"Positive", "Pos. +"},{"Negative", "Neg. -"}});
const Reg WaveDataSource ("WaveDataSource", RW::ReadWrite, TYPE::CH, {{"ADC_DATA", "Input ADC"}, const Reg WaveDataSource ("WaveDataSource", RW::ReadWrite, TYPE::CH, {{"ADC_DATA", "Input ADC"},
@ -377,19 +377,19 @@ namespace DIGIPARA{
{"ADC_TEST_SIN", "ADC produce SIN signal"}, {"ADC_TEST_SIN", "ADC produce SIN signal"},
{"Ramp", "Ramp generator"}, {"Ramp", "Ramp generator"},
{"SquareWave", "Test Pusle (Square Wave)"} }); {"SquareWave", "Test Pusle (Square Wave)"} });
const Reg RecordLength ("ChRecordLengthT", RW::ReadWrite, TYPE::CH, {{"32", ""}, {"64800", ""}, {"8",""}}, ANSTYPE::NUM, "ns"); 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::NUM, "ns"); const Reg PreTrigger ("ChPreTriggerT", RW::ReadWrite, TYPE::CH, {{"32", ""}, {"32000", ""}, {"8",""}}, ANSTYPE::INTEGER, "ns");
const Reg WaveSaving ("WaveSaving", RW::ReadWrite, TYPE::CH, {{"Always", "Always"}, {"OnRequest", "On Request"}}); const Reg WaveSaving ("WaveSaving", RW::ReadWrite, TYPE::CH, {{"Always", "Always"}, {"OnRequest", "On Request"}});
const Reg WaveResolution ("WaveResolution", RW::ReadWrite, TYPE::CH, {{"RES8", " 8 ns"}, const Reg WaveResolution ("WaveResolution", RW::ReadWrite, TYPE::CH, {{"RES8", " 8 ns"},
{"RES16","16 ns"}, {"RES16","16 ns"},
{"RES32","32 ns"}, {"RES32","32 ns"},
{"RES64","64 ns"}}); {"RES64","64 ns"}});
const Reg TimeFilterRiseTime ("TimeFilterRiseTimeT", RW::ReadWrite, TYPE::CH, {{"32", ""},{"2000", ""}, {"8",""}}, ANSTYPE::NUM, "ns"); const Reg TimeFilterRiseTime ("TimeFilterRiseTimeT", RW::ReadWrite, TYPE::CH, {{"32", ""},{"2000", ""}, {"8",""}}, ANSTYPE::INTEGER, "ns");
const Reg TimeFilterRetriggerGuard ("TimeFilterRetriggerGuardT", RW::ReadWrite, TYPE::CH, {{"0", ""},{"8000", ""}, {"8",""}}, ANSTYPE::NUM, "ns"); const Reg TimeFilterRetriggerGuard ("TimeFilterRetriggerGuardT", RW::ReadWrite, TYPE::CH, {{"0", ""},{"8000", ""}, {"8",""}}, ANSTYPE::INTEGER, "ns");
const Reg EnergyFilterRiseTime ("EnergyFilterRiseTimeT", RW::ReadWrite, TYPE::CH, {{"32", ""},{"13000", ""}, {"8",""}}, ANSTYPE::NUM, "ns"); const Reg EnergyFilterRiseTime ("EnergyFilterRiseTimeT", RW::ReadWrite, TYPE::CH, {{"32", ""},{"13000", ""}, {"8",""}}, ANSTYPE::INTEGER, "ns");
const Reg EnergyFilterFlatTop ("EnergyFilterFlatTopT", RW::ReadWrite, TYPE::CH, {{"32", ""},{"3000", ""}, {"8",""}}, ANSTYPE::NUM, "ns"); const Reg EnergyFilterFlatTop ("EnergyFilterFlatTopT", RW::ReadWrite, TYPE::CH, {{"32", ""},{"3000", ""}, {"8",""}}, ANSTYPE::INTEGER, "ns");
const Reg EnergyFilterPoleZero ("EnergyFilterPoleZeroT", RW::ReadWrite, TYPE::CH, {{"32", ""},{"524000", ""}, {"8",""}}, ANSTYPE::NUM, "ns"); const Reg EnergyFilterPoleZero ("EnergyFilterPoleZeroT", RW::ReadWrite, TYPE::CH, {{"32", ""},{"524000", ""}, {"8",""}}, ANSTYPE::INTEGER, "ns");
const Reg EnergyFilterPeakingPosition ("EnergyFilterPeakingPosition", RW::ReadWrite, TYPE::CH, {{"0", ""},{"100", ""}, {"1",""}}, ANSTYPE::NUM, "%"); const Reg EnergyFilterPeakingPosition ("EnergyFilterPeakingPosition", RW::ReadWrite, TYPE::CH, {{"0", ""},{"100", ""}, {"1",""}}, ANSTYPE::INTEGER, "%");
const Reg EnergyFilterPeakingAvg ("EnergyFilterPeakingAvg", RW::ReadWrite, TYPE::CH, {{"OneShot", "1 sample"}, const Reg EnergyFilterPeakingAvg ("EnergyFilterPeakingAvg", RW::ReadWrite, TYPE::CH, {{"OneShot", "1 sample"},
{"LowAVG", "4 samples"}, {"LowAVG", "4 samples"},
{"MediumAVG", "16 samples"}, {"MediumAVG", "16 samples"},
@ -401,9 +401,9 @@ namespace DIGIPARA{
{"Medium", "1024 samples"}, {"Medium", "1024 samples"},
{"MediumHigh","4096 samples"}, {"MediumHigh","4096 samples"},
{"High", "16384 samples"}}); {"High", "16384 samples"}});
const Reg EnergyFilterBaselineGuard ("EnergyFilterBaselineGuardT", RW::ReadWrite, TYPE::CH, {{"0", ""},{"8000", ""}, {"8",""}}, ANSTYPE::NUM, "ns"); const Reg EnergyFilterBaselineGuard ("EnergyFilterBaselineGuardT", RW::ReadWrite, TYPE::CH, {{"0", ""},{"8000", ""}, {"8",""}}, ANSTYPE::INTEGER, "ns");
const Reg EnergyFilterFineGain ("EnergyFilterFineGain", RW::ReadWrite, TYPE::CH, {{"0", ""},{"10", ""}, {"0.001",""}}, ANSTYPE::NUM); const Reg EnergyFilterFineGain ("EnergyFilterFineGain", RW::ReadWrite, TYPE::CH, {{"0", ""},{"10", ""}, {"0.001",""}}, ANSTYPE::FLOAT);
const Reg EnergyFilterPileUpGuard ("EnergyFilterPileUpGuardT", RW::ReadWrite, TYPE::CH, {{"0", ""},{"64000", ""}, {"8",""}}, ANSTYPE::NUM); const Reg EnergyFilterPileUpGuard ("EnergyFilterPileUpGuardT", RW::ReadWrite, TYPE::CH, {{"0", ""},{"64000", ""}, {"8",""}}, ANSTYPE::INTEGER, "ns");
const Reg EnergyFilterLowFreqFilter ("EnergyFilterLFLimitation", RW::ReadWrite, TYPE::CH, {{"Off", "Disabled"}, {"On", "Enabled"}}); const Reg EnergyFilterLowFreqFilter ("EnergyFilterLFLimitation", RW::ReadWrite, TYPE::CH, {{"Off", "Disabled"}, {"On", "Enabled"}});
const Reg WaveAnalogProbe0 ("WaveAnalogProbe0", RW::ReadWrite, TYPE::CH, {{"ADCInput", "ADC Input"}, const Reg WaveAnalogProbe0 ("WaveAnalogProbe0", RW::ReadWrite, TYPE::CH, {{"ADCInput", "ADC Input"},
{"TimeFilter", "Time Filter"}, {"TimeFilter", "Time Filter"},
@ -511,23 +511,23 @@ namespace DIGIPARA{
{"GlobalTriggerSource", "Global Trigger"}, {"GlobalTriggerSource", "Global Trigger"},
{"ITLA", "ITLA"}, {"ITLA", "ITLA"},
{"ITLB", "ITLB"}}); {"ITLB", "ITLB"}});
const Reg CoincidenceLength ("CoincidenceLengthT", RW::ReadWrite, TYPE::CH, {{"8", ""},{"524280", ""}, {"8", ""}}, ANSTYPE::NUM, "ns"); const Reg CoincidenceLength ("CoincidenceLengthT", RW::ReadWrite, TYPE::CH, {{"8", ""},{"524280", ""}, {"8", ""}}, ANSTYPE::INTEGER, "ns");
const Reg CoincidenceLengthSample ("CoincidenceLengthS", RW::ReadWrite); const Reg CoincidenceLengthSample ("CoincidenceLengthS", RW::ReadWrite, TYPE::CH, {{"1", ""},{"65535", ""}, {"1", ""}}, ANSTYPE::INTEGER, "sample");
const Reg ADCVetoWidth ("ADCVetoWidth", RW::ReadWrite, TYPE::CH, {{"0", ""}, {"524280", ""}, {"1", ""}}, ANSTYPE::NONE, "ns"); const Reg ADCVetoWidth ("ADCVetoWidth", RW::ReadWrite, TYPE::CH, {{"0", ""}, {"524280", ""}, {"1", ""}}, ANSTYPE::INTEGER, "ns");
const Reg EnergySkimLowDiscriminator ("EnergySkimLowDiscriminator", RW::ReadWrite, TYPE::CH, {{"0", ""}, {"65534", ""}, {"1", ""}}, ANSTYPE::NUM); const Reg EnergySkimLowDiscriminator ("EnergySkimLowDiscriminator", RW::ReadWrite, TYPE::CH, {{"0", ""}, {"65534", ""}, {"1", ""}}, ANSTYPE::INTEGER);
const Reg EnergySkimHighDiscriminator ("EnergySkimHighDiscriminator", RW::ReadWrite, TYPE::CH, {{"0", ""}, {"65534", ""}, {"1", ""}}, ANSTYPE::NUM); const Reg EnergySkimHighDiscriminator ("EnergySkimHighDiscriminator", RW::ReadWrite, TYPE::CH, {{"0", ""}, {"65534", ""}, {"1", ""}}, ANSTYPE::INTEGER);
const Reg RecordLengthSample ("ChRecordLengthS", RW::ReadWrite); const Reg RecordLengthSample ("ChRecordLengthS", RW::ReadWrite, TYPE::CH, {{"4", ""},{"8100", ""}, {"1", ""}}, ANSTYPE::INTEGER, "sample");
const Reg PreTriggerSample ("ChPreTriggerS", RW::ReadWrite); const Reg PreTriggerSample ("ChPreTriggerS", RW::ReadWrite, TYPE::CH, {{"4", ""},{"4000", ""}, {"1", ""}}, ANSTYPE::INTEGER, "sample");
const Reg TimeFilterRiseTimeSample ("TimeFilterRiseTimeS", RW::ReadWrite); const Reg TimeFilterRiseTimeSample ("TimeFilterRiseTimeS", RW::ReadWrite, TYPE::CH, {{"4", ""},{"250", ""}, {"1", ""}}, ANSTYPE::INTEGER, "sample");
const Reg TimeFilterRetriggerGuardSample ("TimeFilterRetriggerGuardS", RW::ReadWrite); const Reg TimeFilterRetriggerGuardSample ("TimeFilterRetriggerGuardS", RW::ReadWrite, TYPE::CH, {{"0", ""},{"1000", ""}, {"1", ""}}, ANSTYPE::INTEGER, "sample");
const Reg EnergyFilterRiseTimeSample ("EnergyFilterRiseTimeS", RW::ReadWrite); const Reg EnergyFilterRiseTimeSample ("EnergyFilterRiseTimeS", RW::ReadWrite, TYPE::CH, {{"4", ""},{"1625", ""}, {"1", ""}}, ANSTYPE::INTEGER, "sample");
const Reg EnergyFilterFlatTopSample ("EnergyFilterFlatTopS", RW::ReadWrite); const Reg EnergyFilterFlatTopSample ("EnergyFilterFlatTopS", RW::ReadWrite, TYPE::CH, {{"4", ""},{"375", ""}, {"1", ""}}, ANSTYPE::INTEGER, "sample");
const Reg EnergyFilterPoleZeroSample ("EnergyFilterPoleZeroS", RW::ReadWrite); const Reg EnergyFilterPoleZeroSample ("EnergyFilterPoleZeroS", RW::ReadWrite, TYPE::CH, {{"4", ""},{"65500", ""}, {"1", ""}}, ANSTYPE::INTEGER, "sample");
const Reg EnergyFilterBaselineGuardSample ("EnergyFilterBaselineGuardS", RW::ReadWrite); const Reg EnergyFilterBaselineGuardSample ("EnergyFilterBaselineGuardS", RW::ReadWrite, TYPE::CH, {{"0", ""},{"1000", ""}, {"1", ""}}, ANSTYPE::INTEGER, "sample");
const Reg EnergyFilterPileUpGuardSample ("EnergyFilterPileUpGuardS", RW::ReadWrite); const Reg EnergyFilterPileUpGuardSample ("EnergyFilterPileUpGuardS", RW::ReadWrite, TYPE::CH, {{"0", ""},{"8000", ""}, {"1", ""}}, ANSTYPE::INTEGER, "sample");
const std::vector<Reg> AllSettings = { const std::vector<Reg> AllSettings = {
SelfTrgRate , SelfTrgRate ,

View File

@ -525,13 +525,30 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
{//@.......... All Settings tab {//@.......... All Settings tab
QWidget * tab_All = new QWidget(tab); QWidget * tab_All = new QWidget(tab);
//tab_All->setStyleSheet("background-color: #EEEEEE"); //tab_All->setStyleSheet("background-color: #EEEEEE");
chTabWidget->addTab(tab_All, "All Settings"); chTabWidget->addTab(tab_All, "All/Single Ch.");
QGridLayout * allLayout = new QGridLayout(tab_All); QGridLayout * allLayout = new QGridLayout(tab_All);
allLayout->setAlignment(Qt::AlignTop); allLayout->setAlignment(Qt::AlignTop);
unsigned short ch = digi[iDigi]->GetNChannels(); unsigned short ch = digi[iDigi]->GetNChannels();
{//*--------- Group 0
box0 = new QGroupBox("Channel Selection", tab);
allLayout->addWidget(box0);
QGridLayout * layout0 = new QGridLayout(box0);
layout0->setAlignment(Qt::AlignLeft);
QLabel * lbCh = new QLabel("Channel :", tab);
lbCh->setAlignment(Qt::AlignCenter | Qt::AlignRight);
layout0->addWidget(lbCh, 0, 0);
cbChPick[iDigi] = new RComboBox(tab);
cbChPick[iDigi]->addItem("All", -1);
layout0->addWidget(cbChPick[iDigi], 0, 1);
//TODO================
cbChPick[iDigi]->setEnabled(false);
}
int rowID = 0; int rowID = 0;
{//*--------- Group 1 {//*--------- Group 1
box1 = new QGroupBox("Input Settings", tab); box1 = new QGroupBox("Input Settings", tab);
@ -918,8 +935,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
} //=== end of tab } //=== end of tab
//^============================================== {//^============================================== Inquiry / Copy Tab
{
ICTab = new QTabWidget(this); ICTab = new QTabWidget(this);
tabWidget->addTab(ICTab, "Inquiry / Copy"); tabWidget->addTab(ICTab, "Inquiry / Copy");
@ -935,8 +951,11 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
//inquiryLayout->setSpacing(0); //inquiryLayout->setSpacing(0);
int rowID = 0; int rowID = 0;
QLabel * info = new QLabel("This will read from the digitizer, save the setting to memory.", icBox1); QLabel * info1 = new QLabel("This will read from the digitizer, save the setting to memory.", icBox1);
inquiryLayout->addWidget(info, rowID, 0, 1, 6); inquiryLayout->addWidget(info1, rowID, 0, 1, 6);
rowID ++;
QLabel * info2 = new QLabel("The settings from Digitizer Tab will not reflect immedinately in here.", icBox1);
inquiryLayout->addWidget(info2, rowID, 0, 1, 6);
///=========== header ///=========== header
rowID ++; rowID ++;
@ -944,116 +963,255 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
hd0->setAlignment(Qt::AlignCenter); hd0->setAlignment(Qt::AlignCenter);
inquiryLayout->addWidget(hd0, rowID, 3); inquiryLayout->addWidget(hd0, rowID, 3);
QLabel * hd1 = new QLabel("<----------- Set Value ---------->", icBox1); QLabel * hd1 = new QLabel("Unit", icBox1);
hd1->setAlignment(Qt::AlignCenter); hd1->setAlignment(Qt::AlignCenter);
inquiryLayout->addWidget(hd1, rowID, 5, 1, 2); inquiryLayout->addWidget(hd1, rowID, 4);
QLabel * hd2 = new QLabel("<---------------------- Set Value ---------------------->", icBox1);
hd2->setAlignment(Qt::AlignCenter);
inquiryLayout->addWidget(hd2, rowID, 6, 1, 3);
///----------- board settings ///========================== board settings
rowID ++; rowID ++;
RComboBox * cbIQDigi = new RComboBox(ICTab); cbIQDigi = new RComboBox(ICTab);
for( int i = 0; i < nDigi; i++) cbIQDigi->addItem("Digi-" + QString::number(digi[i]->GetSerialNumber()), i); for( int i = 0; i < nDigi; i++) cbIQDigi->addItem("Digi-" + QString::number(digi[i]->GetSerialNumber()), i);
inquiryLayout->addWidget(cbIQDigi, rowID, 0); inquiryLayout->addWidget(cbIQDigi, rowID, 0);
connect( cbIQDigi, &RComboBox::currentIndexChanged, this, [=](int index){
enableSignalSlot = false;
ID = index;
cbIQCh->clear();
for( int i = 0; i < digi[index]->GetNChannels() ; i++ ) cbIQCh->addItem( "Ch-" + QString::number(i), i);
enableSignalSlot = true;
});
RComboBox * cbBdSettings = new RComboBox(ICTab); cbBdSettings = new RComboBox(ICTab);
for( int i = 0; i < (int) DIGIPARA::DIG::AllSettings.size(); i++ ){ for( int i = 0; i < (int) DIGIPARA::DIG::AllSettings.size(); i++ ){
cbBdSettings->addItem( QString::fromStdString( DIGIPARA::DIG::AllSettings[i].GetPara() ), i); cbBdSettings->addItem( QString::fromStdString( DIGIPARA::DIG::AllSettings[i].GetPara() ), i);
} }
inquiryLayout->addWidget(cbBdSettings, rowID, 1); inquiryLayout->addWidget(cbBdSettings, rowID, 1);
connect(cbBdSettings, &RComboBox::currentIndexChanged, this, [=](int index){ connect(cbBdSettings, &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::ReadBoardSetting);
QString type;
switch (DIGIPARA::DIG::AllSettings[index].ReadWrite()) {
case RW::ReadOnly : type ="Read Only"; break;
case RW::WriteOnly : type ="Write Only"; break;
case RW::ReadWrite : type ="Read/Write"; break;
}
leBdSettingsType->setText(type);
if( DIGIPARA::DIG::AllSettings[index].ReadWrite() != RW::ReadOnly ){
switch (DIGIPARA::DIG::AllSettings[index].GetAnswerType()){
case ANSTYPE::STR : {
cbBdAns->setEnabled(true);
cbBdAns->clear();
for( int i = 0; i < (int) DIGIPARA::DIG::AllSettings[index].GetAnswers().size(); i++){
cbBdAns->addItem(QString::fromStdString(DIGIPARA::DIG::AllSettings[index].GetAnswers()[i].second),
QString::fromStdString(DIGIPARA::DIG::AllSettings[index].GetAnswers()[i].first));
}
sbBdSettingsWrite->setEnabled(false);
}; break;
case ANSTYPE::NUM : {
cbBdAns->clear();
cbBdAns->setEnabled(false);
sbBdSettingsWrite->setEnabled(true);
sbBdSettingsWrite->setMinimum(atof(DIGIPARA::DIG::AllSettings[index].GetAnswers()[0].first.c_str()));
sbBdSettingsWrite->setMaximum(atof(DIGIPARA::DIG::AllSettings[index].GetAnswers()[1].first.c_str()));
sbBdSettingsWrite->setSingleStep(atof(DIGIPARA::DIG::AllSettings[index].GetAnswers()[2].first.c_str()));
sbBdSettingsWrite->setValue(0);
}; break;
case ANSTYPE::NONE: {
cbBdAns->clear();
cbBdAns->setEnabled(false);
sbBdSettingsWrite->setEnabled(false);
sbBdSettingsWrite->cleanText();
}
}
}
});
cbBdSettings->setCurrentIndex(0);
leBdSettingsType = new QLineEdit("Read Only",ICTab); leBdSettingsType = new QLineEdit("Read Only",ICTab);
leBdSettingsType->setAlignment(Qt::AlignHCenter);
leBdSettingsType->setFixedWidth(150); leBdSettingsType->setFixedWidth(150);
leBdSettingsType->setReadOnly(true); leBdSettingsType->setReadOnly(true);
inquiryLayout->addWidget(leBdSettingsType, rowID, 2); inquiryLayout->addWidget(leBdSettingsType, rowID, 2);
leBdSettingsRead = new QLineEdit(ICTab); leBdSettingsRead = new QLineEdit(ICTab);
leBdSettingsRead->setAlignment(Qt::AlignRight);
leBdSettingsRead->setFixedWidth(200); leBdSettingsRead->setFixedWidth(200);
leBdSettingsRead->setReadOnly(true); leBdSettingsRead->setReadOnly(true);
inquiryLayout->addWidget(leBdSettingsRead, rowID, 3); inquiryLayout->addWidget(leBdSettingsRead, rowID, 3);
QPushButton * pbRead = new QPushButton("Read", ICTab); leBdSettingsUnit = new QLineEdit("", ICTab);
inquiryLayout->addWidget(pbRead, rowID, 4, 2, 1); leBdSettingsUnit->setAlignment(Qt::AlignHCenter);
leBdSettingsUnit->setFixedWidth(50);
leBdSettingsUnit->setReadOnly(true);
inquiryLayout->addWidget(leBdSettingsUnit, rowID, 4);
QPushButton * bnRead = new QPushButton("Read", ICTab);
inquiryLayout->addWidget(bnRead, rowID, 5, 2, 1);
connect(bnRead, &QPushButton::clicked, this, [=](){ ReadBoardSetting(cbBdSettings->currentIndex()); ReadChannelSetting(cbChSettings->currentIndex()); });
cbBdAns = new RComboBox(ICTab); cbBdAns = new RComboBox(ICTab);
cbBdAns->setFixedWidth(200); cbBdAns->setFixedWidth(200);
inquiryLayout->addWidget(cbBdAns, rowID, 5); inquiryLayout->addWidget(cbBdAns, rowID, 6);
connect(cbBdAns, &RComboBox::currentIndexChanged, this, [=](){
if( !enableSignalSlot ) return;
std::string value = cbBdAns->currentData().toString().toStdString();
leBdSettingsWrite->setText(QString::fromStdString(value));
leBdSettingsWrite->setStyleSheet("");
Reg para = DIGIPARA::DIG::AllSettings[cbBdSettings->currentIndex()];
ID = cbIQDigi->currentIndex();
QString msg;
msg = QString::fromStdString(para.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber());
msg += " = " + cbBdAns->currentData().toString();
if( digi[ID]->WriteValue(para, value) ){
leBdSettingsRead->setText( QString::fromStdString(digi[ID]->GetSettingValue(para)));
SendLogMsg(msg + "|OK.");
cbBdAns->setStyleSheet("");
ShowSettingsToPanel();
}else{
leBdSettingsRead->setText("fail write value");
SendLogMsg(msg + "|Fail.");
cbBdAns->setStyleSheet("color:red;");
}
});
sbBdSettingsWrite = new RSpinBox(ICTab); sbBdSettingsWrite = new RSpinBox(ICTab);
sbBdSettingsWrite->setFixedWidth(200); sbBdSettingsWrite->setFixedWidth(200);
inquiryLayout->addWidget(sbBdSettingsWrite, rowID, 6); inquiryLayout->addWidget(sbBdSettingsWrite, rowID, 7);
connect(sbBdSettingsWrite, &RSpinBox::valueChanged, this, [=](){ sbBdSettingsWrite->setStyleSheet("color: green;");});
connect(sbBdSettingsWrite, &RSpinBox::returnPressed, this, [=](){
if( !enableSignalSlot ) return;
if( sbBdSettingsWrite->decimals() == 0 && sbBdSettingsWrite->singleStep() != 1) {
double step = sbBdSettingsWrite->singleStep();
double value = sbBdSettingsWrite->value();
sbBdSettingsWrite->setValue( (std::round(value/step) * step) );
}
QPushButton * pbWrite = new QPushButton("Write", ICTab); Reg para = DIGIPARA::DIG::AllSettings[cbBdSettings->currentIndex()];
inquiryLayout->addWidget(pbWrite, rowID, 7, 2, 1); ID = cbIQDigi->currentIndex();
QString msg;
msg = QString::fromStdString(para.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber());
msg += " = " + QString::number(sbBdSettingsWrite->value());
if( digi[ID]->WriteValue(para, std::to_string(sbBdSettingsWrite->value()))){
leBdSettingsRead->setText( QString::fromStdString(digi[ID]->GetSettingValue(para)));
SendLogMsg(msg + "|OK.");
sbBdSettingsWrite->setStyleSheet("");
ShowSettingsToPanel();
}else{
leBdSettingsRead->setText("fail write value");
SendLogMsg(msg + "|Fail.");
sbBdSettingsWrite->setStyleSheet("color:red;");
}
});
leBdSettingsWrite = new QLineEdit(ICTab);
leBdSettingsWrite->setAlignment(Qt::AlignRight);
leBdSettingsWrite->setFixedWidth(200);
inquiryLayout->addWidget(leBdSettingsWrite, rowID, 8);
connect(leBdSettingsWrite, &QLineEdit::textChanged, this, [=](){leBdSettingsWrite->setStyleSheet("color: green;");});
connect(leBdSettingsWrite, &QLineEdit::returnPressed, this, [=](){
if( !enableSignalSlot ) return;
std::string value = leBdSettingsWrite->text().toStdString();
Reg para = DIGIPARA::DIG::AllSettings[cbBdSettings->currentIndex()];
ID = cbIQDigi->currentIndex();
QString msg;
msg = QString::fromStdString(para.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber());
msg += " = " + QString::number(sbBdSettingsWrite->value());
if( digi[ID]->WriteValue(para, value)){
leBdSettingsRead->setText( QString::fromStdString(digi[ID]->GetSettingValue(para)));
SendLogMsg(msg + "|OK.");
sbBdSettingsWrite->setStyleSheet("");
ShowSettingsToPanel();
}else{
leBdSettingsRead->setText("fail write value");
SendLogMsg(msg + "|Fail.");
sbBdSettingsWrite->setStyleSheet("color:red;");
}
});
///----------- Channels settings
///========================== Channels settings
rowID ++; rowID ++;
RComboBox * cbIQCh = new RComboBox(ICTab); cbIQCh = new RComboBox(ICTab);
cbIQCh->clear();
for( int i = 0; i < digi[0]->GetNChannels() ; i++) cbIQCh->addItem("Ch-" + QString::number(i), i); for( int i = 0; i < digi[0]->GetNChannels() ; i++) cbIQCh->addItem("Ch-" + QString::number(i), i);
inquiryLayout->addWidget(cbIQCh, rowID, 0); inquiryLayout->addWidget(cbIQCh, rowID, 0);
connect(cbIQCh, &RComboBox::currentIndexChanged, this, [=](){ ReadChannelSetting(cbChSettings->currentIndex()); });
RComboBox * cbChSettings = new RComboBox(ICTab); cbChSettings = new RComboBox(ICTab);
for( int i = 0; i < (int) DIGIPARA::CH::AllSettings.size(); i++ ){ for( int i = 0; i < (int) DIGIPARA::CH::AllSettings.size(); i++ ){
cbChSettings->addItem( QString::fromStdString( DIGIPARA::CH::AllSettings[i].GetPara() ), i); cbChSettings->addItem( QString::fromStdString( DIGIPARA::CH::AllSettings[i].GetPara() ), i);
} }
inquiryLayout->addWidget(cbChSettings, rowID, 1); inquiryLayout->addWidget(cbChSettings, rowID, 1);
connect(cbChSettings, &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::ReadChannelSetting);
QLineEdit * leChSettingsType = new QLineEdit("Read Only", ICTab); leChSettingsType = new QLineEdit("Read Only", ICTab);
leChSettingsType->setAlignment(Qt::AlignHCenter);
leChSettingsType->setFixedWidth(150); leChSettingsType->setFixedWidth(150);
leChSettingsType->setReadOnly(true); leChSettingsType->setReadOnly(true);
inquiryLayout->addWidget(leChSettingsType, rowID, 2); inquiryLayout->addWidget(leChSettingsType, rowID, 2);
QLineEdit * leChSettingsRead = new QLineEdit(ICTab); leChSettingsRead = new QLineEdit(ICTab);
leChSettingsRead->setFixedWidth(100); leChSettingsRead->setAlignment(Qt::AlignRight);
leChSettingsRead->setFixedWidth(200);
leChSettingsRead->setReadOnly(true); leChSettingsRead->setReadOnly(true);
inquiryLayout->addWidget(leChSettingsRead, rowID, 3); inquiryLayout->addWidget(leChSettingsRead, rowID, 3);
leChSettingsUnit = new QLineEdit(ICTab);
leChSettingsUnit->setAlignment(Qt::AlignHCenter);
leChSettingsUnit->setFixedWidth(50);
leChSettingsUnit->setReadOnly(true);
inquiryLayout->addWidget(leChSettingsUnit, rowID, 4);
RComboBox * cbChAns = new RComboBox(ICTab); cbChAns = new RComboBox(ICTab);
cbChAns->setFixedWidth(200); cbChAns->setFixedWidth(200);
inquiryLayout->addWidget(cbChAns, rowID, 5); inquiryLayout->addWidget(cbChAns, rowID, 6);
connect(cbChAns, &RComboBox::currentIndexChanged, this, [=](){
if( !enableSignalSlot ) return;
std::string value = cbChAns->currentData().toString().toStdString();
leChSettingsWrite->setText(QString::fromStdString(value));
leChSettingsWrite->setStyleSheet("");
QLineEdit * leChSettingsWrite = new QLineEdit(ICTab); Reg para = DIGIPARA::CH::AllSettings[cbChSettings->currentIndex()];
ID = cbIQDigi->currentIndex();
int ch_index = cbIQCh->currentIndex();
QString msg;
msg = QString::fromStdString(para.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber());
msg += ",CH:" + QString::number(ch_index);
msg += " = " + cbChAns->currentData().toString();
if( digi[ID]->WriteValue(para, value, ch_index) ){
leChSettingsRead->setText( QString::fromStdString(digi[ID]->GetSettingValue(para)));
SendLogMsg(msg + "|OK.");
cbChAns->setStyleSheet("");
ShowSettingsToPanel();
}else{
leChSettingsRead->setText("fail write value");
SendLogMsg(msg + "|Fail.");
cbChAns->setStyleSheet("color:red;");
}
});
sbChSettingsWrite = new RSpinBox(ICTab);
sbChSettingsWrite->setFixedWidth(200);
inquiryLayout->addWidget(sbChSettingsWrite, rowID, 7);
connect(sbChSettingsWrite, &RSpinBox::valueChanged, this, [=](){ sbChSettingsWrite->setStyleSheet("color: green;");});
connect(sbChSettingsWrite, &RSpinBox::returnPressed, this, [=](){
if( !enableSignalSlot ) return;
if( sbChSettingsWrite->decimals() == 0 && sbChSettingsWrite->singleStep() != 1) {
double step = sbChSettingsWrite->singleStep();
double value = sbChSettingsWrite->value();
sbChSettingsWrite->setValue( (std::round(value/step) * step) );
}
Reg para = DIGIPARA::CH::AllSettings[cbBdSettings->currentIndex()];
ID = cbIQDigi->currentIndex();
int ch_index = cbIQCh->currentIndex();
QString msg;
msg = QString::fromStdString(para.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber());
msg += ",CH:" + QString::number(ch_index);
msg += " = " + QString::number(sbChSettingsWrite->value());
if( digi[ID]->WriteValue(para, std::to_string(sbChSettingsWrite->value()), ch_index)){
leChSettingsRead->setText( QString::fromStdString(digi[ID]->GetSettingValue(para)));
SendLogMsg(msg + "|OK.");
sbChSettingsWrite->setStyleSheet("");
ShowSettingsToPanel();
}else{
leChSettingsRead->setText("fail write value");
SendLogMsg(msg + "|Fail.");
sbChSettingsWrite->setStyleSheet("color:red;");
}
});
leChSettingsWrite = new QLineEdit(ICTab);
leChSettingsWrite->setFixedWidth(200); leChSettingsWrite->setFixedWidth(200);
inquiryLayout->addWidget(leChSettingsWrite, rowID, 6); inquiryLayout->addWidget(leChSettingsWrite, rowID, 8);
connect(leChSettingsWrite, &QLineEdit::textChanged, this, [=](){leChSettingsWrite->setStyleSheet("color: green;");});
connect(leChSettingsWrite, &QLineEdit::returnPressed, this, [=](){
if( !enableSignalSlot ) return;
std::string value = leChSettingsWrite->text().toStdString();
Reg para = DIGIPARA::CH::AllSettings[cbChSettings->currentIndex()];
ID = cbIQDigi->currentIndex();
int ch_index = cbIQCh->currentIndex();
QString msg;
msg = QString::fromStdString(para.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber());
msg += " = " + QString::number(sbChSettingsWrite->value());
if( digi[ID]->WriteValue(para, value, ch_index)){
leChSettingsRead->setText( QString::fromStdString(digi[ID]->GetSettingValue(para)));
SendLogMsg(msg + "|OK.");
sbChSettingsWrite->setStyleSheet("");
ShowSettingsToPanel();
}else{
leChSettingsRead->setText("fail write value");
SendLogMsg(msg + "|Fail.");
sbChSettingsWrite->setStyleSheet("color:red;");
}
});
for( int i = 0 ; i < inquiryLayout->count(); i++) inquiryLayout->setColumnStretch(i, 2); for( int i = 0 ; i < inquiryLayout->count(); i++) inquiryLayout->setColumnStretch(i, 1);
} }
@ -1099,6 +1257,9 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
EnableControl(); EnableControl();
cbBdSettings->setCurrentText("ModelName");
cbChSettings->setCurrentIndex(10);
show(); show();
enableSignalSlot = true; enableSignalSlot = true;
@ -1288,7 +1449,6 @@ void DigiSettingsPanel::ShowSettingsToPanel(){
} }
} }
result = QString::fromStdString(digi[ID]->GetSettingValue(DIGIPARA::DIG::GlobalTriggerSource)); result = QString::fromStdString(digi[ID]->GetSettingValue(DIGIPARA::DIG::GlobalTriggerSource));
resultList = result.remove(QChar(' ')).split("|"); resultList = result.remove(QChar(' ')).split("|");
testPulseBox->setEnabled(false); testPulseBox->setEnabled(false);
@ -1384,7 +1544,7 @@ void DigiSettingsPanel::ShowSettingsToPanel(){
} }
enableSignalSlot = true; enableSignalSlot = true;
SyncComboBox(cbbOnOff, -1); SyncComboBox(cbbOnOff, -1);
SyncComboBox(cbbParity, -1); SyncComboBox(cbbParity, -1);
SyncComboBox(cbbLowFilter, -1); SyncComboBox(cbbLowFilter, -1);
@ -1652,3 +1812,133 @@ void DigiSettingsPanel::FillSpinBoxValueFromMemory(RSpinBox *&spb, const Reg par
//printf("%s === %s, %d, %p\n", __func__, result.toStdString().c_str(), ID, spb); //printf("%s === %s, %d, %p\n", __func__, result.toStdString().c_str(), ID, spb);
spb->setValue(result.toDouble()); spb->setValue(result.toDouble());
} }
void DigiSettingsPanel::ReadBoardSetting(int cbIndex){
enableSignalSlot = false;
QString type;
switch (DIGIPARA::DIG::AllSettings[cbIndex].ReadWrite()) {
case RW::ReadOnly : type ="Read Only"; break;
case RW::WriteOnly : type ="Write Only"; break;
case RW::ReadWrite : type ="Read/Write"; break;
}
leBdSettingsType->setText(type);
leBdSettingsRead->setText(QString::fromStdString(digi[cbIQDigi->currentIndex()]->ReadValue(DIGIPARA::DIG::AllSettings[cbIndex])));
leBdSettingsUnit->setText(QString::fromStdString(DIGIPARA::DIG::AllSettings[cbIndex].GetUnit()));
ANSTYPE haha = DIGIPARA::DIG::AllSettings[cbIndex].GetAnswerType();
if( DIGIPARA::DIG::AllSettings[cbIndex].ReadWrite() != RW::ReadOnly && haha != ANSTYPE::NONE ){
if( haha == ANSTYPE::FLOAT || haha == ANSTYPE::INTEGER ){
cbBdAns->clear();
cbBdAns->setEnabled(false);
leBdSettingsWrite->setEnabled(false);
leBdSettingsWrite->clear();
sbBdSettingsWrite->setEnabled(true);
sbBdSettingsWrite->setMinimum(atof(DIGIPARA::DIG::AllSettings[cbIndex].GetAnswers()[0].first.c_str()));
sbBdSettingsWrite->setMaximum(atof(DIGIPARA::DIG::AllSettings[cbIndex].GetAnswers()[1].first.c_str()));
sbBdSettingsWrite->setSingleStep(atof(DIGIPARA::DIG::AllSettings[cbIndex].GetAnswers()[2].first.c_str()));
sbBdSettingsWrite->setValue(00);
sbBdSettingsWrite->setDecimals(0);
}
if( haha == ANSTYPE::FLOAT) sbBdSettingsWrite->setDecimals(3);
if( haha == ANSTYPE::LIST){
cbBdAns->setEnabled(true);
cbBdAns->clear();
for( int i = 0; i < (int) DIGIPARA::DIG::AllSettings[cbIndex].GetAnswers().size(); i++){
cbBdAns->addItem(QString::fromStdString(DIGIPARA::DIG::AllSettings[cbIndex].GetAnswers()[i].second),
QString::fromStdString(DIGIPARA::DIG::AllSettings[cbIndex].GetAnswers()[i].first));
}
sbBdSettingsWrite->setEnabled(false);
sbBdSettingsWrite->setValue(0);
leBdSettingsWrite->setEnabled(false);
leBdSettingsWrite->clear();
}
if( haha == ANSTYPE::STR){
cbBdAns->clear();
cbBdAns->setEnabled(false);
leBdSettingsWrite->setEnabled(true);
leBdSettingsWrite->clear();
sbBdSettingsWrite->setEnabled(false);
sbBdSettingsWrite->setValue(0);
}
}else{
cbBdAns->clear();
cbBdAns->setEnabled(false);
sbBdSettingsWrite->setEnabled(false);
sbBdSettingsWrite->cleanText();
leBdSettingsWrite->setEnabled(false);
leBdSettingsWrite->clear();
}
if( DIGIPARA::DIG::AllSettings[cbIndex].GetPara() == DIGIPARA::DIG::StartSource.GetPara()
|| DIGIPARA::DIG::AllSettings[cbIndex].GetPara() == DIGIPARA::DIG::GlobalTriggerSource.GetPara() ){
leBdSettingsWrite->setEnabled(true);
leBdSettingsWrite->clear();
}
enableSignalSlot = true;
}
void DigiSettingsPanel::ReadChannelSetting(int cbIndex){
enableSignalSlot = false;
QString type;
switch (DIGIPARA::CH::AllSettings[cbIndex].ReadWrite()) {
case RW::ReadOnly : type ="Read Only"; break;
case RW::WriteOnly : type ="Write Only"; break;
case RW::ReadWrite : type ="Read/Write"; break;
}
leChSettingsType->setText(type);
leChSettingsRead->setText(QString::fromStdString(digi[cbIQDigi->currentIndex()]->ReadValue(DIGIPARA::CH::AllSettings[cbIndex], cbIQCh->currentData().toInt())));
leChSettingsUnit->setText(QString::fromStdString(DIGIPARA::CH::AllSettings[cbIndex].GetUnit()));
ANSTYPE haha = DIGIPARA::CH::AllSettings[cbIndex].GetAnswerType();
if( DIGIPARA::CH::AllSettings[cbIndex].ReadWrite() != RW::ReadOnly && haha != ANSTYPE::NONE ){
if( haha == ANSTYPE::FLOAT || haha == ANSTYPE::INTEGER ){
cbChAns->clear();
cbChAns->setEnabled(false);
leChSettingsWrite->setEnabled(false);
leChSettingsWrite->clear();
sbChSettingsWrite->setEnabled(true);
sbChSettingsWrite->setMinimum(atof(DIGIPARA::CH::AllSettings[cbIndex].GetAnswers()[0].first.c_str()));
sbChSettingsWrite->setMaximum(atof(DIGIPARA::CH::AllSettings[cbIndex].GetAnswers()[1].first.c_str()));
sbChSettingsWrite->setSingleStep(atof(DIGIPARA::CH::AllSettings[cbIndex].GetAnswers()[2].first.c_str()));
sbChSettingsWrite->setValue(00);
sbChSettingsWrite->setDecimals(0);
}
if( haha == ANSTYPE::FLOAT) sbBdSettingsWrite->setDecimals(3);
if( haha == ANSTYPE::LIST){
cbChAns->setEnabled(true);
cbChAns->clear();
for( int i = 0; i < (int) DIGIPARA::CH::AllSettings[cbIndex].GetAnswers().size(); i++){
cbChAns->addItem(QString::fromStdString(DIGIPARA::CH::AllSettings[cbIndex].GetAnswers()[i].second),
QString::fromStdString(DIGIPARA::CH::AllSettings[cbIndex].GetAnswers()[i].first));
}
sbChSettingsWrite->setEnabled(false);
sbChSettingsWrite->setValue(0);
leChSettingsWrite->setEnabled(false);
leChSettingsWrite->clear();
}
if( haha == ANSTYPE::STR){
cbChAns->clear();
cbChAns->setEnabled(false);
leChSettingsWrite->setEnabled(true);
leChSettingsWrite->clear();
sbChSettingsWrite->setEnabled(false);
sbChSettingsWrite->setValue(0);
}
}else{
cbChAns->clear();
cbChAns->setEnabled(false);
sbChSettingsWrite->setEnabled(false);
sbChSettingsWrite->cleanText();
leChSettingsWrite->setEnabled(false);
leChSettingsWrite->clear();
}
enableSignalSlot = true;
}

View File

@ -59,6 +59,7 @@ private:
QGroupBox * VGABox; QGroupBox * VGABox;
QGroupBox * testPulseBox; QGroupBox * testPulseBox;
QGroupBox * box0;
QGroupBox * box1; QGroupBox * box1;
QGroupBox * box3; QGroupBox * box3;
QGroupBox * box4; QGroupBox * box4;
@ -73,13 +74,28 @@ private:
QTabWidget * triggerMapTab; QTabWidget * triggerMapTab;
QTabWidget * ICTab; // inquiry and copy QTabWidget * ICTab; // inquiry and copy
RComboBox * cbIQDigi;
RComboBox * cbBdSettings;
RComboBox * cbIQCh;
RComboBox * cbChSettings;
bool enableSignalSlot; bool enableSignalSlot;
//---------------- Inquiry and copy //---------------- Inquiry and copy
QLineEdit * leBdSettingsType; QLineEdit * leBdSettingsType;
QLineEdit * leBdSettingsRead; QLineEdit * leBdSettingsRead;
QLineEdit * leBdSettingsUnit;
RComboBox * cbBdAns; RComboBox * cbBdAns;
RSpinBox * sbBdSettingsWrite; RSpinBox * sbBdSettingsWrite;
QLineEdit * leBdSettingsWrite;
QLineEdit * leChSettingsType;
QLineEdit * leChSettingsRead;
QLineEdit * leChSettingsUnit;
RComboBox * cbChAns;
RSpinBox * sbChSettingsWrite;
QLineEdit * leChSettingsWrite;
//------------ status //------------ status
QLineEdit * leInfo[MaxNumberOfChannel][12]; QLineEdit * leInfo[MaxNumberOfChannel][12];
@ -136,6 +152,7 @@ private:
QLineEdit * chADCToVolts[MaxNumberOfDigitizer][MaxNumberOfChannel]; QLineEdit * chADCToVolts[MaxNumberOfDigitizer][MaxNumberOfChannel];
//--------------- Channel settings //--------------- Channel settings
RComboBox * cbChPick[MaxNumberOfDigitizer];
RComboBox * cbbOnOff[MaxNumberOfDigitizer][MaxNumberOfChannel + 1]; RComboBox * cbbOnOff[MaxNumberOfDigitizer][MaxNumberOfChannel + 1];
RSpinBox * spbRecordLength[MaxNumberOfDigitizer][MaxNumberOfChannel + 1]; RSpinBox * spbRecordLength[MaxNumberOfDigitizer][MaxNumberOfChannel + 1];
@ -209,6 +226,9 @@ private:
void FillComboBoxValueFromMemory(RComboBox * &cbb, const Reg para, int ch_index = -1); void FillComboBoxValueFromMemory(RComboBox * &cbb, const Reg para, int ch_index = -1);
void FillSpinBoxValueFromMemory(RSpinBox * &spb, const Reg para, int ch_index = -1 ); void FillSpinBoxValueFromMemory(RSpinBox * &spb, const Reg para, int ch_index = -1 );
void ReadBoardSetting(int cbIndex);
void ReadChannelSetting(int cbIndex);
}; };

View File

@ -499,12 +499,9 @@ void MainWindow::OpenDigitizers(){
}else{ }else{
LogMsg("<font style=\"color: red;\">Unable to found setting file <b>" + settingFile + "</b>. </font>"); LogMsg("<font style=\"color: red;\">Unable to found setting file <b>" + settingFile + "</b>. </font>");
digi[i]->SetSettingFileName(""); digi[i]->SetSettingFileName("");
LogMsg("Reset digitizer."); LogMsg("Reset digitizer And set default PHA settings.");
digi[i]->Reset(); digi[i]->Reset();
digi[i]->ProgramPHA(false);
digi[i]->WriteValue(DIGIPARA::CH::RecordLength, "4000");
digi[i]->WriteValue(DIGIPARA::CH::PreTrigger, "1000");
//digi[i]->ProgramPHA(false);
} }
digi[i]->ReadAllSettings(); digi[i]->ReadAllSettings();
@ -531,6 +528,9 @@ void MainWindow::OpenDigitizers(){
bnDigiSettings->setEnabled(true); bnDigiSettings->setEnabled(true);
bnCloseDigitizers->setEnabled(true); bnCloseDigitizers->setEnabled(true);
bnProgramSettings->setEnabled(false);
bnNewExp->setEnabled(false);
} }
void MainWindow::CloseDigitizers(){ void MainWindow::CloseDigitizers(){
@ -584,6 +584,9 @@ void MainWindow::CloseDigitizers(){
chkSaveRun->setEnabled(false); chkSaveRun->setEnabled(false);
cbAutoRun->setEnabled(false); cbAutoRun->setEnabled(false);
bnProgramSettings->setEnabled(true);
bnNewExp->setEnabled(true);
} }
//^###################################################################### Open Scope //^###################################################################### Open Scope
@ -1298,7 +1301,8 @@ void MainWindow::SetupNewExpPanel(){
layout->addWidget(button1, rowID, 3); layout->addWidget(button1, rowID, 3);
button1->setEnabled(false); button1->setEnabled(false);
connect(newExp, &QLineEdit::returnPressed, this, [=](){ if( newExp->text() != "") button1->setEnabled(true);}); connect(newExp, &QLineEdit::textChanged, this, [=](){ newExp->setStyleSheet("color : green;");});
connect(newExp, &QLineEdit::returnPressed, this, [=](){ if( newExp->text() != "") { newExp->setStyleSheet(""); button1->setEnabled(true);}});
connect(button1, &QPushButton::clicked, this, [=](){ this->CreateNewExperiment(newExp->text());}); connect(button1, &QPushButton::clicked, this, [=](){ this->CreateNewExperiment(newExp->text());});
connect(button1, &QPushButton::clicked, &dialog, &QDialog::accept); connect(button1, &QPushButton::clicked, &dialog, &QDialog::accept);