added all reading in BoardSetting, not tested. next, add change setting
This commit is contained in:
parent
3fc64c86cd
commit
92fe99dd48
|
@ -535,11 +535,11 @@ uint32_t Digitizer::PrintRegister(uint32_t address, std::string msg){
|
||||||
|
|
||||||
uint32_t * value = new uint32_t[1];
|
uint32_t * value = new uint32_t[1];
|
||||||
CAEN_DGTZ_ReadRegister(handle, (uint32_t) Register::BoardConfiguration, value);
|
CAEN_DGTZ_ReadRegister(handle, (uint32_t) Register::BoardConfiguration, value);
|
||||||
printf(" %*s 32 28 24 20 16 12 8 4 0\n", msg.length(), "");
|
printf(" %*s 32 28 24 20 16 12 8 4 0\n", (int) msg.length(), "");
|
||||||
printf(" %*s | | | | | | | | |\n", msg.length(), "");
|
printf(" %*s | | | | | | | | |\n", (int) msg.length(), "");
|
||||||
printf(" %*s", msg.length(), "");
|
printf(" %*s", (int) msg.length(), "");
|
||||||
cout << " : 0b" << bitset<32>(value[0]) << endl;
|
cout << " : 0b" << bitset<32>(value[0]) << endl;
|
||||||
printf(" %*s : 0x%x\n", msg.length(), msg.c_str(), value[0]);
|
printf(" %*s : 0x%x\n", (int) msg.length(), msg.c_str(), value[0]);
|
||||||
|
|
||||||
return value[0];
|
return value[0];
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,8 @@ class Digitizer{
|
||||||
unsigned int ReadBits(uint32_t address, unsigned int bitLength, unsigned int bitSmallestPos, int ch = -1 );
|
unsigned int ReadBits(uint32_t address, unsigned int bitLength, unsigned int bitSmallestPos, int ch = -1 );
|
||||||
unsigned int GetDPPAlgorithmControl(int ch = -1) {return ReadRegister(Register::DPP::DPPAlgorithmControl, ch);}
|
unsigned int GetDPPAlgorithmControl(int ch = -1) {return ReadRegister(Register::DPP::DPPAlgorithmControl, ch);}
|
||||||
|
|
||||||
|
bool isACQRunning() {return AcqRun;}
|
||||||
|
|
||||||
uint32_t PrintRegister(uint32_t address, std::string msg);
|
uint32_t PrintRegister(uint32_t address, std::string msg);
|
||||||
|
|
||||||
void PrintBoard();
|
void PrintBoard();
|
||||||
|
|
|
@ -182,15 +182,14 @@ void DigitizerPHA::SetSetting(Setting::PHA settingName, float value, int ch){
|
||||||
case Setting::PHA::DisableExternalTrigger_bool: input = value; WriteRegister(Register::DPP::DisableExternalTrigger, input); break;
|
case Setting::PHA::DisableExternalTrigger_bool: input = value; WriteRegister(Register::DPP::DisableExternalTrigger, input); break;
|
||||||
case Setting::PHA::ExtendedVetoDelay_16bit: input = value; WriteRegister(Register::DPP::ExtendedVetoDelay, input); break;
|
case Setting::PHA::ExtendedVetoDelay_16bit: input = value; WriteRegister(Register::DPP::ExtendedVetoDelay, input); break;
|
||||||
case Setting::PHA::AnalogMonitorMode_3bit: input = value; WriteRegister(Register::DPP::AnalogMonitorMode, input); break;
|
case Setting::PHA::AnalogMonitorMode_3bit: input = value; WriteRegister(Register::DPP::AnalogMonitorMode, input); break;
|
||||||
|
case Setting::PHA::BufferOccupancyGain_4bit: input = value; WriteRegister(Register::DPP::BufferOccupancyGain, input); break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorMsg("PHA-" + std::to_string(settingName) );
|
ErrorMsg("PHA-" + std::to_string(settingName) );
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
double DigitizerPHA::GetSetting(Setting::PHA settingName, int ch){
|
double DigitizerPHA::GetSetting(Setting::PHA settingName, int ch){
|
||||||
|
|
||||||
double value = 0;
|
double value = 0;
|
||||||
|
@ -312,6 +311,26 @@ double DigitizerPHA::GetSetting(Setting::PHA settingName, int ch){
|
||||||
case Setting::PHA::DisableExternalTrigger_bool: temp = ReadRegister(Register::DPP::DisableExternalTrigger); value = temp & 0x1; break;
|
case Setting::PHA::DisableExternalTrigger_bool: temp = ReadRegister(Register::DPP::DisableExternalTrigger); value = temp & 0x1; break;
|
||||||
case Setting::PHA::ExtendedVetoDelay_16bit: temp = ReadRegister(Register::DPP::ExtendedVetoDelay); value = temp & 0xffff; break;
|
case Setting::PHA::ExtendedVetoDelay_16bit: temp = ReadRegister(Register::DPP::ExtendedVetoDelay); value = temp & 0xffff; break;
|
||||||
case Setting::PHA::AnalogMonitorMode_3bit: temp = ReadRegister(Register::DPP::AnalogMonitorMode); value = temp & 0x7; break;
|
case Setting::PHA::AnalogMonitorMode_3bit: temp = ReadRegister(Register::DPP::AnalogMonitorMode); value = temp & 0x7; break;
|
||||||
|
case Setting::PHA::BufferOccupancyGain_4bit: temp = ReadRegister(Register::DPP::BufferOccupancyGain); value = temp & 0xf; break;
|
||||||
|
|
||||||
|
/// AMC Firmware Revisiion
|
||||||
|
case Setting::PHA::AMCFirmwareNumber_readOnly_8bit: temp = ReadBits(Register::DPP::AMCFirmwareRevision, 7, 0); value = temp; break;
|
||||||
|
case Setting::PHA::AMCDPPcode_readOnly_8bit: temp = ReadBits(Register::DPP::AMCFirmwareRevision, 8, 8); value = temp; break;
|
||||||
|
case Setting::PHA::AMCBuildDay_readOnly_8bit: temp = ReadBits(Register::DPP::AMCFirmwareRevision, 8, 16); value = temp; break;
|
||||||
|
case Setting::PHA::AMCBuildMonth_readOnly_4bits: temp = ReadBits(Register::DPP::AMCFirmwareRevision, 4, 24); value = temp; break;
|
||||||
|
case Setting::PHA::AMCBuildYear_readOnly_4bits: temp = ReadBits(Register::DPP::AMCFirmwareRevision, 4, 28); value = temp; break;
|
||||||
|
|
||||||
|
/// ACQ Status
|
||||||
|
case Setting::PHA::ACQStatus_readOnly_bool: temp = ReadBits(Register::DPP::AcquisitionStatus, 1, 2); value = temp; break;
|
||||||
|
case Setting::PHA::ACQEventReady_readOnly_bool: temp = ReadBits(Register::DPP::AcquisitionStatus, 1, 3); value = temp; break;
|
||||||
|
case Setting::PHA::ACQEventFull_readOnly_bool: temp = ReadBits(Register::DPP::AcquisitionStatus, 1, 4); value = temp; break;
|
||||||
|
case Setting::PHA::ACQClockSource_readOnly_bool: temp = ReadBits(Register::DPP::AcquisitionStatus, 1, 5); value = temp; break;
|
||||||
|
case Setting::PHA::ACQPLLLock_readOnly_bool: temp = ReadBits(Register::DPP::AcquisitionStatus, 1, 7); value = temp; break;
|
||||||
|
case Setting::PHA::ACQBoardReady_readOnly_bool: temp = ReadBits(Register::DPP::AcquisitionStatus, 1, 8); value = temp; break;
|
||||||
|
case Setting::PHA::ACQ_S_IN_Statue_readOnly_bool: temp = ReadBits(Register::DPP::AcquisitionStatus, 1, 15); value = temp; break;
|
||||||
|
case Setting::PHA::ACQ_TRGIN_Status_readOnly_bool: temp = ReadBits(Register::DPP::AcquisitionStatus, 1, 16); value = temp; break;
|
||||||
|
case Setting::PHA::ACQChannelShutDownStatus_readOnly_bool: temp = ReadBits(Register::DPP::AcquisitionStatus, 1, 19); value = temp; break;
|
||||||
|
case Setting::PHA::ACQTenmperatureStatus_readOnly_4bit: temp = ReadBits(Register::DPP::AcquisitionStatus, 4, 20); value = temp; break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,9 +69,9 @@ MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
|
||||||
fMenuDigitizers->Connect("Activated(Int_t)", "MainWindow", this, "HandleMenu(Int_t)");
|
fMenuDigitizers->Connect("Activated(Int_t)", "MainWindow", this, "HandleMenu(Int_t)");
|
||||||
fMenuBar->AddPopup("&Digitizers", fMenuDigitizers, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
|
fMenuBar->AddPopup("&Digitizers", fMenuDigitizers, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
|
||||||
|
|
||||||
fMenuDigitizers->DisableEntry( M_TRIGGER_SUMMARY);
|
//fMenuDigitizers->DisableEntry( M_TRIGGER_SUMMARY);
|
||||||
fMenuDigitizers->DisableEntry( M_BOARD_SETTINGS);
|
//fMenuDigitizers->DisableEntry( M_BOARD_SETTINGS);
|
||||||
fMenuDigitizers->DisableEntry( M_CH_SETTING);
|
//fMenuDigitizers->DisableEntry( M_CH_SETTING);
|
||||||
|
|
||||||
fMenuUtility = new TGPopupMenu(gClient->GetRoot());
|
fMenuUtility = new TGPopupMenu(gClient->GetRoot());
|
||||||
fMenuUtility->AddEntry("Plot Channels Rate", M_SHOW_CHANNELS_RATE);
|
fMenuUtility->AddEntry("Plot Channels Rate", M_SHOW_CHANNELS_RATE);
|
||||||
|
@ -136,7 +136,7 @@ MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
|
||||||
|
|
||||||
//HandleMenu(M_DIGITIZER_SCAN);
|
//HandleMenu(M_DIGITIZER_SCAN);
|
||||||
//
|
//
|
||||||
//HandleMenu(M_BOARD_SETTINGS);
|
HandleMenu(M_BOARD_SETTINGS);
|
||||||
//HandleMenu(M_CH_SETTING);
|
//HandleMenu(M_CH_SETTING);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,7 @@ namespace Register {
|
||||||
namespace Setting{
|
namespace Setting{
|
||||||
|
|
||||||
enum PHA{
|
enum PHA{
|
||||||
/// board setting
|
/// board configuration
|
||||||
AutoDataFlush_board_bool,
|
AutoDataFlush_board_bool,
|
||||||
DecimateWaveForm_board_bool,
|
DecimateWaveForm_board_bool,
|
||||||
TriggerPropapation_board_bool,
|
TriggerPropapation_board_bool,
|
||||||
|
@ -261,11 +261,12 @@ namespace Setting{
|
||||||
TriggerValidationSoftwareTrigger_bool,
|
TriggerValidationSoftwareTrigger_bool,
|
||||||
|
|
||||||
/// Readout Control
|
/// Readout Control
|
||||||
//ReadoutCtrl_VMEInterruptLevel_3bit,
|
ReadoutCtrl_VMEInterruptLevel_3bit,
|
||||||
//ReadoutCtrl_OpticalLinkInterrupt_bool,
|
ReadoutCtrl_OpticalLinkInterrupt_bool,
|
||||||
//ReadoutCtrl_VMEBusError_bool,
|
ReadoutCtrl_VMEBusError_bool,
|
||||||
|
ReadoutCtrl_VMEAlign64_bool,
|
||||||
|
|
||||||
/// Registers
|
/// Registers for channel
|
||||||
RecordLength_G_ns,
|
RecordLength_G_ns,
|
||||||
PreTriggerLength_ns,
|
PreTriggerLength_ns,
|
||||||
InputDynamicRange_bool,
|
InputDynamicRange_bool,
|
||||||
|
@ -277,8 +278,8 @@ namespace Setting{
|
||||||
|
|
||||||
TriggerThreshold_LSD,
|
TriggerThreshold_LSD,
|
||||||
TriggerHoldOffWidth_ns,
|
TriggerHoldOffWidth_ns,
|
||||||
TriggerSmoothingFactor_5bit,
|
TriggerSmoothingFactor_5bit, /// RC-CR2 Smoothing Factor
|
||||||
TriggerOutputWidth_ns,
|
TriggerOutputWidth_ns, /// Shaped Trigger Width
|
||||||
InputRiseTime_ns,
|
InputRiseTime_ns,
|
||||||
|
|
||||||
TrapezoidRiseTime_ns,
|
TrapezoidRiseTime_ns,
|
||||||
|
@ -289,16 +290,60 @@ namespace Setting{
|
||||||
EnergyFineGain_16bit,
|
EnergyFineGain_16bit,
|
||||||
RiseTimeValidationWindow_ns,
|
RiseTimeValidationWindow_ns,
|
||||||
|
|
||||||
|
ADCTemperature_8bit,
|
||||||
|
|
||||||
/// Others
|
/// Others
|
||||||
FanSpeedControl_bool,
|
FanSpeedControl_bool,
|
||||||
RunStartStopDelay_8bit,
|
RunStartStopDelay_8bit,
|
||||||
DisableExternalTrigger_bool,
|
DisableExternalTrigger_bool,
|
||||||
ExtendedVetoDelay_16bit,
|
ExtendedVetoDelay_16bit,
|
||||||
AnalogMonitorMode_3bit
|
AnalogMonitorMode_3bit,
|
||||||
|
BufferOccupancyGain_4bit,
|
||||||
|
|
||||||
|
///==========read only
|
||||||
|
|
||||||
|
/// AMC Firmware Revisiion
|
||||||
|
AMCFirmwareNumber_readOnly_8bit,
|
||||||
|
AMCDPPcode_readOnly_8bit,
|
||||||
|
AMCBuildDay_readOnly_8bit,
|
||||||
|
AMCBuildMonth_readOnly_4bits,
|
||||||
|
AMCBuildYear_readOnly_4bits,
|
||||||
|
|
||||||
|
/// ACQ Status
|
||||||
|
ACQStatus_readOnly_bool,
|
||||||
|
ACQEventReady_readOnly_bool,
|
||||||
|
ACQEventFull_readOnly_bool,
|
||||||
|
ACQClockSource_readOnly_bool,
|
||||||
|
ACQPLLLock_readOnly_bool,
|
||||||
|
ACQBoardReady_readOnly_bool,
|
||||||
|
ACQ_S_IN_Statue_readOnly_bool,
|
||||||
|
ACQ_TRGIN_Status_readOnly_bool,
|
||||||
|
ACQChannelShutDownStatus_readOnly_bool,
|
||||||
|
ACQTenmperatureStatus_readOnly_4bit,
|
||||||
|
|
||||||
|
|
||||||
|
///========== not impletementd
|
||||||
|
DataFlush_writeOnly_any, /// any bit write, write only
|
||||||
|
ChannelStopAcq_bool,
|
||||||
|
ChannelSoftwareTrigger_writeOnly_any,
|
||||||
|
|
||||||
|
FineGain_16bit, /// this is complicated value
|
||||||
|
|
||||||
|
ADCCalibration_32bit,
|
||||||
|
|
||||||
|
ChannelsShutdown_bool,
|
||||||
|
|
||||||
|
SoftwareTrigger_writeOnly_any,
|
||||||
|
|
||||||
|
ChannelEnableMask_16bit,
|
||||||
|
|
||||||
|
/// ChannelStatus
|
||||||
|
ChannelStatus_SPI_bool,
|
||||||
|
ChannelStatus_ADCCalib_bool,
|
||||||
|
ChannelStatus_ADCPowerDown_bool
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
1037
boardSetting.cpp
1037
boardSetting.cpp
File diff suppressed because it is too large
Load Diff
|
@ -4,6 +4,7 @@
|
||||||
#include <TGNumberEntry.h>
|
#include <TGNumberEntry.h>
|
||||||
#include <TGButton.h>
|
#include <TGButton.h>
|
||||||
#include <TGComboBox.h>
|
#include <TGComboBox.h>
|
||||||
|
#include <TThread.h>
|
||||||
#include <TGLabel.h>
|
#include <TGLabel.h>
|
||||||
#include "DigitizerPHA.h"
|
#include "DigitizerPHA.h"
|
||||||
#include "DigitizerPSD.h"
|
#include "DigitizerPSD.h"
|
||||||
|
@ -18,16 +19,16 @@ class BoardSetting{
|
||||||
private:
|
private:
|
||||||
TGMainFrame * fMain;
|
TGMainFrame * fMain;
|
||||||
|
|
||||||
Pixel_t red, blue;
|
static Pixel_t red, blue;
|
||||||
|
|
||||||
TGNumberEntry * boardIDEntry;
|
static TGNumberEntry * boardIDEntry;
|
||||||
|
|
||||||
TGTextEntry * entry[NUM_BOARD_INFO];
|
TGTextEntry * entry[NUM_BOARD_INFO];
|
||||||
|
|
||||||
int nDigi;
|
int nDigi;
|
||||||
Digitizer ** digi;
|
static Digitizer ** digi;
|
||||||
DigitizerPHA * pha;
|
static DigitizerPHA * pha;
|
||||||
DigitizerPSD * psd;
|
static DigitizerPSD * psd;
|
||||||
|
|
||||||
/// board failure status
|
/// board failure status
|
||||||
TGTextEntry * enPLLStatus;
|
TGTextEntry * enPLLStatus;
|
||||||
|
@ -57,6 +58,21 @@ class BoardSetting{
|
||||||
TGTextButton * bSWClockSync;
|
TGTextButton * bSWClockSync;
|
||||||
TGNumberEntry * numRunStartStopDelay;
|
TGNumberEntry * numRunStartStopDelay;
|
||||||
|
|
||||||
|
/// ACQ Status
|
||||||
|
static TGTextEntry * txtACQStatus;
|
||||||
|
static TGTextEntry * txtACQEventReady;
|
||||||
|
static TGTextEntry * txtACQEventFull;
|
||||||
|
static TGTextEntry * txtACQClockSource;
|
||||||
|
static TGTextEntry * txtACQPLLLock;
|
||||||
|
static TGTextEntry * txtACQChDown;
|
||||||
|
static TGTextEntry * txtACQSIN;
|
||||||
|
static TGTextEntry * txtACQTRIGIN;
|
||||||
|
static TGTextEntry * txtACQBoardReady;
|
||||||
|
static TGTextEntry * txtACQTemp0;
|
||||||
|
static TGTextEntry * txtACQTemp1;
|
||||||
|
static TGTextEntry * txtACQTemp2;
|
||||||
|
static TGTextEntry * txtACQTemp3;
|
||||||
|
|
||||||
/// Trigger control
|
/// Trigger control
|
||||||
TGCheckButton * cbGbTRGMskCh[8];
|
TGCheckButton * cbGbTRGMskCh[8];
|
||||||
TGCheckButton * cbTRGValMskCh[8];
|
TGCheckButton * cbTRGValMskCh[8];
|
||||||
|
@ -90,13 +106,26 @@ class BoardSetting{
|
||||||
TGComboBox * cbLEMOIO;
|
TGComboBox * cbLEMOIO;
|
||||||
TGComboBox * cbTRGOUTmode;
|
TGComboBox * cbTRGOUTmode;
|
||||||
TGCheckButton * bTRGOUTImp;
|
TGCheckButton * bTRGOUTImp;
|
||||||
|
|
||||||
TGComboBox * cbTRGINCtrl;
|
TGComboBox * cbTRGINCtrl;
|
||||||
TGComboBox * cbTRGINMezzanines;
|
TGComboBox * cbTRGINMezzanines;
|
||||||
|
|
||||||
TGComboBox * cbAnaMonitor;
|
TGComboBox * cbAnaMonitor;
|
||||||
TGNumberEntry * numBufferOccpGain;
|
TGNumberEntry * numBufferOccpGain;
|
||||||
|
|
||||||
|
/// Readout Control
|
||||||
|
TGComboBox * cbVMEInterrupLevel;
|
||||||
|
TGCheckButton * bOpticalLinkInterrupt;
|
||||||
|
TGCheckButton * bEventAligned;
|
||||||
|
TGCheckButton * bVMEAlogn64Mode;
|
||||||
|
TGCheckButton * bInteruptReleaseMode;
|
||||||
|
TGCheckButton * bEnableExtendedBlockTransfer;
|
||||||
|
|
||||||
|
/// Redaout Status
|
||||||
|
static TGTextEntry * txtEventReady;
|
||||||
|
static TGTextEntry * txtBusError;
|
||||||
|
static TGTextEntry * txtVMEFIFO;
|
||||||
|
|
||||||
|
TThread * readStatusThread;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BoardSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** digi, int nBoard);
|
BoardSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** digi, int nBoard);
|
||||||
virtual ~BoardSetting();
|
virtual ~BoardSetting();
|
||||||
|
@ -108,6 +137,8 @@ class BoardSetting{
|
||||||
}
|
}
|
||||||
void ChangeBoard();
|
void ChangeBoard();
|
||||||
|
|
||||||
|
static void * ReadStatus(void * ptr); /// thread.
|
||||||
|
|
||||||
///=== Board Configure
|
///=== Board Configure
|
||||||
void SetAutoDataFlush();
|
void SetAutoDataFlush();
|
||||||
void SetDecimateWF();
|
void SetDecimateWF();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user