FSUDAQ/boardSetting.h
2022-10-26 14:55:06 -04:00

192 lines
4.7 KiB
C++

#ifndef BOARD_SETTING_H
#define BOARD_SETTING_H
#include <TQObject.h>
#include <RQ_OBJECT.h>
#include <TGNumberEntry.h>
#include <TGButton.h>
#include <TGComboBox.h>
#include <TThread.h>
#include <TGLabel.h>
#include "ClassDigitizer.h"
#include "macro.h"
#define NUM_BOARD_INFO 9
class TGWindow;
class TGMainFrame;
class BoardSetting{
RQ_OBJECT("BoardSetting")
private:
TGMainFrame * fMain;
TGNumberEntry * boardIDEntry;
TGTextEntry * entry[NUM_BOARD_INFO];
TGTextEntry * txtSettingFile;
/// board failure status
TGTextEntry * enPLLStatus;
TGTextEntry * enTempStatus;
TGTextEntry * enADCPwrStatus;
/// board settings
TGCheckButton * bAutoDataFlush;
TGCheckButton * bDecimateWF;
TGCheckButton * bWFRecord;
TGCheckButton * bTrigPropa;
TGCheckButton * bExtrac2;
TGCheckButton * bDualTrace;
TGComboBox * cbAP1;
TGComboBox * cbAP2; /// for ComboBox for analog probe 2
TGComboBox * cbDP1;
TGComboBox * cbDP2;
TGComboBox * cbAggOrg;
TGNumberEntry * numAggBLT; /// number of Agg pre Block transfer
TGComboBox * cbFanCtrl;
TGTextEntry * txtBufferSize;
/// ACQ control
TGComboBox * cbAcqMode;
TGCheckButton * bAcqArm;
TGComboBox * cbPLLref;
TGTextButton * bSWTrigger;
TGTextButton * bSWClockSync;
TGNumberEntry * numRunStartStopDelay;
/// ACQ Status
TGTextEntry * txtACQStatus;
TGTextEntry * txtACQEventReady;
TGTextEntry * txtACQEventFull;
TGTextEntry * txtACQClockSource;
TGTextEntry * txtACQPLLLock;
TGTextEntry * txtACQChDown;
TGTextEntry * txtACQSIN;
TGTextEntry * txtACQTRIGIN;
TGTextEntry * txtACQBoardReady;
TGTextEntry * txtACQTemp0;
TGTextEntry * txtACQTemp1;
TGTextEntry * txtACQTemp2;
TGTextEntry * txtACQTemp3;
/// Trigger control
TGCheckButton * cbGbTRGMskCh[8];
TGCheckButton * cbTRGOUTMsk[8];
TGNumberEntry * numMajorCoinWin;
TGComboBox * cbTRGOUTMode;
TGNumberEntry * GlbMajorLevel;
TGNumberEntry * TRGOUTMajorLevel;
TGCheckButton * bGLBExtTrigger;
TGCheckButton * bTRGOUTExtTrigger;
TGCheckButton * bGLBSoftwareTrigger;
TGCheckButton * bTRGOUTSoftwareTrigger;
//TGCheckButton * bTRGValMskLVSDGLB;
//TGCheckButton * bTRGValMskLVSDLCL;
TGCheckButton * bEnableExtTRG;
//TGNumberEntry * numExtendVetoDelay;
/// Trigger Validation Mask
TGCheckButton * cbTRGValMskCh[8][8];
TGComboBox * cbTRGValMODE[8];
TGNumberEntry * TRGValMajorLevel[8];
TGCheckButton * bTRGValExtTrigger[8];
TGCheckButton * bTRGValSoftwareTrigger[8];
/// Front Panel IO Control
TGComboBox * cbLEMOIO;
TGComboBox * cbTRGOUTMODE2;
TGComboBox * cbTRGINCtrl;
TGComboBox * cbTRGINMezzanines;
TGComboBox * cbAnaMonitor;
TGNumberEntry * numBufferOccpGain;
/// Readout Control
TGComboBox * cbVMEInterrupLevel;
TGCheckButton * bOpticalLinkInterrupt;
TGCheckButton * bEventAligned;
TGCheckButton * bVMEAlogn64Mode;
TGCheckButton * bInteruptReleaseMode;
TGCheckButton * bEnableExtendedBlockTransfer;
/// Redaout Status
TGTextEntry * txtEventReady;
TGTextEntry * txtBusError;
TGTextEntry * txtVMEFIFO;
bool isOpened;
public:
BoardSetting(const TGWindow *p, UInt_t w, UInt_t h);
virtual ~BoardSetting();
bool IsOpen() {return isOpened;}
void CloseWindow() { delete this;}
void ChangeBoard();
void DisableEdit();
void EnableEdit();
void ReadStatus();
///=== Button
void ResetSettingToDefault();
void ClearBuffer();
void OpenChannelSetting();
///=== Board Configure
void SetBoardConfiguration();
void SetAggregateOrganization();
void SetReadOutAggregate();
void SetFanSpeedControl();
///=== ACQ Control
void SetACQControl();
void SendSoftwareTriggerSignal();
void SendSoftwareClockSyncSignal();
void SetRunStartStopDelay();
///==== Trigger
void SetGlobalTriggerMask();
void SetTriggerValidMask();
void SetTRGOUTMask();
void SetEnableExternalTrigger();
void SetExtendedVetoDelay();
///==== FrontPanelIO
void SetFrontPanelIO();
void SetAnalogMonitorMode();
///==== Readout Control
void SetReadOutControl();
///==== Others
void LogMsg(TString msg); // *SIGNAL*
/// Haha is for sending signal to mainwindow to open channel setting for the board
void Haha(Int_t boardID); // *SIGNAL*
/// this send signal to MainWindows, and tell channel setting to update
//TODO to merge to LogMsg
void TellChannelSettingtoUpdate(); // *SIGNAL*
void ReadData();
void ProgramDefaultBoard();
void ProgramBoardFromFile();
void SaveSettingFile();
void CaliADC();
void FillBufferSizeTextBox();
};
#endif