#ifndef __DGFCptmPanel_h__
#define __DGFCptmPanel_h__
#include "TList.h"
#include "TGWindow.h"
#include "TGFrame.h"
#include "TGButton.h"
#include "TGMenu.h"
#include "TMrbLofNamedX.h"
#include "TMrbNamedX.h"
#include "TMrbDGF.h"
#include "TGMrbTextButton.h"
#include "TGMrbRadioButton.h"
#include "TGMrbCheckButton.h"
#include "TGMrbLabelEntry.h"
#include "TGMrbLabelCombo.h"
#include "TGMrbMacroBrowser.h"
class DGFCptmPanel : public TGCompositeFrame {
public:
enum EDGFCptmCmdId {
kDGFCptmSelectModule,
kDGFCptmGeDelayEntry,
kDGFCptmGeWidthEntry,
kDGFCptmAuxDelayEntry,
kDGFCptmAuxWidthEntry,
kDGFCptmTimeWdwEntry,
kDGFCptmMultValueEntry,
kDGFCptmMultDacEntry,
kDGFCptmAddrReadEntry,
kDGFCptmAddrWriteEntry,
kDGFCptmMaskRegisterBtns,
kDGFCptmButtonDownloadCode,
kDGFCptmButtonReset,
kDGFCptmButtonSave,
kDGFCptmButtonRestore,
kDGFCptmButtonSynchEnable,
kDGFCptmButtonSynchEnableReset,
kDGFCptmButtonShowEvent,
kDGFCptmButtonShowBuffer,
kDGFCptmButtonResetAddr,
kDGFCptmButtonUpdateAddr,
};
enum EDGFCptmMaskBits { kDGFCptmMaskE2 = BIT(0),
kDGFCptmMaskT2 = BIT(1),
kDGFCptmMaskT1 = BIT(2),
kDGFCptmMaskQ4 = BIT(3),
kDGFCptmMaskQ3 = BIT(4),
kDGFCptmMaskQ2 = BIT(5),
kDGFCptmMaskQ1 = BIT(6),
kDGFCptmMaskGe = BIT(7)
};
public:
DGFCptmPanel(TGCompositeFrame * TabFrame);
virtual ~DGFCptmPanel() {
fFocusList.Clear();
fHeap.Delete();
};
Int_t GetLofCptmModules();
inline Int_t GetNofCptmModules() { return(fLofCptmModules.GetEntriesFast()); };
void InitializeValues(Int_t ModuleIndex = -1);
void Reset(Int_t ModuleIndex = -1);
Bool_t DownloadCode(Int_t ModuleIndex = -1);
Bool_t SaveSettings(Int_t ModuleIndex = -1);
Bool_t RestoreSettings(Int_t ModuleIndex = -1);
void EnableSynch(Int_t ModuleIndex = -1, Bool_t ResetClock = kFALSE);
void ShowNextEvent(Int_t ModuleIndex);
void ShowBuffer(Int_t ModuleIndex, const Char_t * FileName = NULL);
void ResetAddrPointers(Int_t ModuleIndex);
void PerformAction(Int_t FrameId, Int_t Selection);
void EntryChanged(Int_t FrameId, Int_t Selection);
void SelectModule(Int_t FrameId, Int_t Selection);
protected:
void UpdateValue(Int_t EntryId, Int_t ModuleIndex);
void MoveFocus(Int_t EntryId);
protected:
TList fHeap;
Int_t fCptmIndex;
TGGroupFrame * fSelectFrame;
TGMrbLabelCombo * fSelectModule;
TGHorizontalFrame * fH1Frame;
TGGroupFrame * fGeFrame;
TGMrbLabelEntry * fGeDelayEntry;
TGMrbLabelEntry * fGeWidthEntry;
TGGroupFrame * fAuxFrame;
TGMrbLabelEntry * fAuxDelayEntry;
TGMrbLabelEntry * fAuxWidthEntry;
TGMrbLabelEntry * fTimeWdwEntry;
TGGroupFrame * fMultFrame;
TGMrbLabelEntry * fMultValueEntry;
TGMrbLabelEntry * fMultVoltsEntry;
TGMrbLabelEntry * fMultDacEntry;
TGHorizontalFrame * fH2Frame;
TGMrbCheckButtonGroup * fCptmMaskReg;
TGGroupFrame * fAddrFrame;
TGMrbLabelEntry * fAddrReadEntry;
TGMrbLabelEntry * fAddrWriteEntry;
TGMrbTextButtonGroup * fCptmButtonFrame;
TMrbLofNamedX fLofCptmModules;
TMrbLofNamedX fCptmActions;
TGMrbFocusList fFocusList;
ClassDef(DGFCptmPanel, 0)
};
#endif