added all reading in BoardSetting, not tested. next, add change setting

This commit is contained in:
carina@hades 2022-09-20 15:15:52 -04:00
parent 3fc64c86cd
commit 92fe99dd48
8 changed files with 742 additions and 504 deletions

View File

@ -535,11 +535,11 @@ uint32_t Digitizer::PrintRegister(uint32_t address, std::string msg){
uint32_t * value = new uint32_t[1];
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 | | | | | | | | |\n", msg.length(), "");
printf(" %*s", msg.length(), "");
printf(" %*s 32 28 24 20 16 12 8 4 0\n", (int) msg.length(), "");
printf(" %*s | | | | | | | | |\n", (int) msg.length(), "");
printf(" %*s", (int) msg.length(), "");
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];

View File

@ -90,6 +90,8 @@ class Digitizer{
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);}
bool isACQRunning() {return AcqRun;}
uint32_t PrintRegister(uint32_t address, std::string msg);
void PrintBoard();

View File

@ -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::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::BufferOccupancyGain_4bit: input = value; WriteRegister(Register::DPP::BufferOccupancyGain, input); break;
}
ErrorMsg("PHA-" + std::to_string(settingName) );
}
double DigitizerPHA::GetSetting(Setting::PHA settingName, int ch){
double value = 0;
@ -312,7 +311,27 @@ 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::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::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;
}
return value;

View File

@ -21,7 +21,7 @@ class DigitizerPHA : public Digitizer {
///=================== Get settings
double GetSetting(Setting::PHA settingName, int ch = -1);
void PrintBoardConfiguration();
void PrintACQControl();
void PrintGlobalTriggerMask();

View File

@ -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)");
fMenuBar->AddPopup("&Digitizers", fMenuDigitizers, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
fMenuDigitizers->DisableEntry( M_TRIGGER_SUMMARY);
fMenuDigitizers->DisableEntry( M_BOARD_SETTINGS);
fMenuDigitizers->DisableEntry( M_CH_SETTING);
//fMenuDigitizers->DisableEntry( M_TRIGGER_SUMMARY);
//fMenuDigitizers->DisableEntry( M_BOARD_SETTINGS);
//fMenuDigitizers->DisableEntry( M_CH_SETTING);
fMenuUtility = new TGPopupMenu(gClient->GetRoot());
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_BOARD_SETTINGS);
HandleMenu(M_BOARD_SETTINGS);
//HandleMenu(M_CH_SETTING);
}

View File

@ -190,7 +190,7 @@ namespace Register {
namespace Setting{
enum PHA{
/// board setting
/// board configuration
AutoDataFlush_board_bool,
DecimateWaveForm_board_bool,
TriggerPropapation_board_bool,
@ -261,11 +261,12 @@ namespace Setting{
TriggerValidationSoftwareTrigger_bool,
/// Readout Control
//ReadoutCtrl_VMEInterruptLevel_3bit,
//ReadoutCtrl_OpticalLinkInterrupt_bool,
//ReadoutCtrl_VMEBusError_bool,
ReadoutCtrl_VMEInterruptLevel_3bit,
ReadoutCtrl_OpticalLinkInterrupt_bool,
ReadoutCtrl_VMEBusError_bool,
ReadoutCtrl_VMEAlign64_bool,
/// Registers
/// Registers for channel
RecordLength_G_ns,
PreTriggerLength_ns,
InputDynamicRange_bool,
@ -277,8 +278,8 @@ namespace Setting{
TriggerThreshold_LSD,
TriggerHoldOffWidth_ns,
TriggerSmoothingFactor_5bit,
TriggerOutputWidth_ns,
TriggerSmoothingFactor_5bit, /// RC-CR2 Smoothing Factor
TriggerOutputWidth_ns, /// Shaped Trigger Width
InputRiseTime_ns,
TrapezoidRiseTime_ns,
@ -289,16 +290,60 @@ namespace Setting{
EnergyFineGain_16bit,
RiseTimeValidationWindow_ns,
ADCTemperature_8bit,
/// Others
FanSpeedControl_bool,
RunStartStopDelay_8bit,
DisableExternalTrigger_bool,
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

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,7 @@
#include <TGNumberEntry.h>
#include <TGButton.h>
#include <TGComboBox.h>
#include <TThread.h>
#include <TGLabel.h>
#include "DigitizerPHA.h"
#include "DigitizerPSD.h"
@ -18,16 +19,16 @@ class BoardSetting{
private:
TGMainFrame * fMain;
Pixel_t red, blue;
static Pixel_t red, blue;
TGNumberEntry * boardIDEntry;
static TGNumberEntry * boardIDEntry;
TGTextEntry * entry[NUM_BOARD_INFO];
int nDigi;
Digitizer ** digi;
DigitizerPHA * pha;
DigitizerPSD * psd;
static Digitizer ** digi;
static DigitizerPHA * pha;
static DigitizerPSD * psd;
/// board failure status
TGTextEntry * enPLLStatus;
@ -57,6 +58,21 @@ class BoardSetting{
TGTextButton * bSWClockSync;
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
TGCheckButton * cbGbTRGMskCh[8];
TGCheckButton * cbTRGValMskCh[8];
@ -90,12 +106,25 @@ class BoardSetting{
TGComboBox * cbLEMOIO;
TGComboBox * cbTRGOUTmode;
TGCheckButton * bTRGOUTImp;
TGComboBox * cbTRGINCtrl;
TGComboBox * cbTRGINMezzanines;
TGComboBox * cbAnaMonitor;
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:
BoardSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** digi, int nBoard);
@ -108,6 +137,8 @@ class BoardSetting{
}
void ChangeBoard();
static void * ReadStatus(void * ptr); /// thread.
///=== Board Configure
void SetAutoDataFlush();
void SetDecimateWF();