FSUDAQ/channelSetting.cpp

468 lines
25 KiB
C++
Raw Normal View History

2022-08-23 13:43:05 -04:00
#include <TApplication.h>
#include <TGClient.h>
#include <TCanvas.h>
#include <TF1.h>
#include <TRandom.h>
#include <TGButton.h>
#include <TRootEmbeddedCanvas.h>
#include <TGTableContainer.h>
#include <TGFileDialog.h>
#include "channelSetting.h"
2022-08-23 13:43:05 -04:00
ChannelSetting::ChannelSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** digi, int nDigi){
this->digi = digi;
Pixel_t red, green;
gClient->GetColorByName("red", red);
gClient->GetColorByName("green", green);
2022-08-23 13:43:05 -04:00
fMain = new TGMainFrame(p,w,h);
fMain->SetWindowName("Channel Settings ");
fMain->Connect("CloseWindow()", "ChannelSetting", this, "CloseWindow()");
TGLayoutHints * layoutHintsR = new TGLayoutHints(kLHintsRight, 5,5,3,2); /// left, right, top, bottom
TGLayoutHints * layoutHints = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5,5,0,0); /// left, right, top, bottom
2022-08-23 13:43:05 -04:00
TGVerticalFrame * vframe = new TGVerticalFrame(fMain);
fMain->AddFrame(vframe, new TGLayoutHints(kLHintsCenterX, 2,2,2,2));
TGHorizontalFrame *hframe0 = new TGHorizontalFrame(vframe, w, 50 ); vframe->AddFrame(hframe0, new TGLayoutHints(kLHintsCenterX, 2,2,2,2));
2022-08-23 13:43:05 -04:00
///==========Board choose
TGLabel * lb0 = new TGLabel(hframe0, "Module ID :"); hframe0->AddFrame(lb0, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
boardIDEntry = new TGNumberEntry(hframe0, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); hframe0->AddFrame(boardIDEntry, new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
2022-08-23 13:43:05 -04:00
boardIDEntry->SetWidth(50);
boardIDEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, nDigi);
boardIDEntry->Connect("Modified()", "ChannelSetting", this, "ChangeBoard()");
if( nDigi <= 1 ) boardIDEntry->SetState(false);
NChannel = 16 ;// digi[0]->GetNChannel();
TGLabel * lb1 = new TGLabel(hframe0, "Channel :"); hframe0->AddFrame(lb1, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
2022-08-23 13:43:05 -04:00
chIDEntry = new TGNumberEntry(hframe0, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);
chIDEntry->SetWidth(50);
chIDEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, NChannel-1);
chIDEntry->Connect("Modified()", "ChannelSetting", this, "ChangeCh()");
hframe0->AddFrame(chIDEntry, new TGLayoutHints(kLHintsCenterX , 5, 5, 3, 4));
///const uint32_t ChannelADCTemperature = 0x10A8; /// R
TGLabel * lbTemp = new TGLabel(hframe0, "Temperature [C] :"); hframe0->AddFrame(lbTemp, new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 5, 5, 3, 4));
TGTextEntry * eTemp = new TGTextEntry(hframe0, new TGTextBuffer(1)); hframe0->AddFrame(eTemp, new TGLayoutHints(kLHintsRight, 5,5,3,4));
eTemp->SetEnabled(false);
eTemp->SetText( "0" );
eTemp->Resize(50,20);
2022-08-23 13:43:05 -04:00
int boardID = boardIDEntry->GetNumber();
int ch = chIDEntry->GetNumber();
int width = 80;
TGHorizontalFrame *hframe1 = new TGHorizontalFrame(vframe, w, 50 ); vframe->AddFrame(hframe1, new TGLayoutHints(kLHintsCenterX, 2,2,2,2));
{///================== Input Setting
TGGroupFrame * gfInput = new TGGroupFrame(hframe1, "Input / Misc.", kHorizontalFrame); hframe1->AddFrame(gfInput, new TGLayoutHints(kLHintsExpandY));
TGHorizontalFrame * hfInput = new TGHorizontalFrame(gfInput); gfInput->AddFrame(hfInput);
TGVerticalFrame * vfInput1 = new TGVerticalFrame(hfInput); hfInput->AddFrame(vfInput1);
TGVerticalFrame * vfInput2 = new TGVerticalFrame(hfInput); hfInput->AddFrame(vfInput2);
///----------- on/off
TGLabel * lbOnOff = new TGLabel(vfInput1, "On/Off"); vfInput1->AddFrame(lbOnOff, layoutHintsR);
cbOnOff = new TGComboBox(vfInput2); vfInput2->AddFrame(cbOnOff, layoutHints);
cbOnOff->AddEntry("ON", 1);
cbOnOff->AddEntry("off", 0);
cbOnOff->Resize(width, 20);
//pixie->GetChannelOnOff(boardID, ch) ? cbOnOff->Select(1) : cbOnOff->Select(0);
cbOnOff->Connect("Selected(Int_t, Int_t)", "ChannelSetting", this, "ChangeOnOff()");
///----------- Polarity
TGLabel * lbPol = new TGLabel(vfInput1, "Polarity");vfInput1->AddFrame(lbPol, layoutHintsR);
cbPolarity = new TGComboBox(vfInput2); vfInput2->AddFrame(cbPolarity, layoutHints);
cbPolarity->AddEntry("Positive +", 1);
cbPolarity->AddEntry("Negative -", 0);
cbPolarity->Resize(width, 20);
//pixie->GetChannelPolarity(boardID, ch) ? cbPolarity->Select(1) : cbPolarity->Select(0);
cbPolarity->Connect("Selected(Int_t, Int_t)", "ChannelSetting", this, "ChangeOnOff()");
///---------- Input Dynamic Range
TGLabel * lbInputDynamicRange = new TGLabel(vfInput1, "Input Range");vfInput1->AddFrame(lbInputDynamicRange, layoutHintsR);
cbInputDynamicRange = new TGComboBox(vfInput2); vfInput2->AddFrame(cbInputDynamicRange, layoutHints);
cbInputDynamicRange->AddEntry("2.0 Vpp", 0);
cbInputDynamicRange->AddEntry("0.5 Vpp", 1);
cbInputDynamicRange->Resize(width, 20);
cbInputDynamicRange->Select(0);
///---------- Record Length
TGLabel * lbRecordLength = new TGLabel(vfInput1, "Record Length [ns]"); vfInput1->AddFrame(lbRecordLength, layoutHintsR);
TGNumberEntry* numRecordLength = new TGNumberEntry(vfInput2, 20000, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfInput2->AddFrame(numRecordLength, layoutHints);
numRecordLength->Resize(width, 20);
///const uint32_t PreTrigger = 0x1038; /// R/W
TGLabel * lbPreTrigger = new TGLabel(vfInput1, "Pre trigger [ns]"); vfInput1->AddFrame(lbPreTrigger, layoutHintsR);
TGNumberEntry* numPreTrigger = new TGNumberEntry(vfInput2, 2000, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfInput2->AddFrame(numPreTrigger, layoutHints);
numPreTrigger->Resize(width, 20);
///const uint32_t NumberEventsPerAggregate_G = 0x1034; /// R/W,
TGLabel * lbEventAgg = new TGLabel(vfInput1, "Events / Aggregate"); vfInput1->AddFrame(lbEventAgg, layoutHintsR);
TGNumberEntry* numEventAgg = new TGNumberEntry(vfInput2, 512, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfInput2->AddFrame(numEventAgg, layoutHints);
numEventAgg->Resize(width, 20);
}
{///================== Trigger Settings
TGGroupFrame * gfTrigger = new TGGroupFrame(hframe1, "Trigger", kHorizontalFrame); hframe1->AddFrame(gfTrigger, new TGLayoutHints(kLHintsExpandY));
TGHorizontalFrame * hfTrigger = new TGHorizontalFrame(gfTrigger); gfTrigger->AddFrame(hfTrigger);
TGVerticalFrame * vfTrigger1 = new TGVerticalFrame(hfTrigger); hfTrigger->AddFrame(vfTrigger1);
TGVerticalFrame * vfTrigger2 = new TGVerticalFrame(hfTrigger); hfTrigger->AddFrame(vfTrigger2);
///const uint32_t TriggerThreshold = 0x106C; /// R/W
TGLabel * lbTriggerThreshold = new TGLabel(vfTrigger1, "Trigger Threshold [LSB]"); vfTrigger1->AddFrame(lbTriggerThreshold, layoutHintsR);
TGNumberEntry* numTriggerThreshold = new TGNumberEntry(vfTrigger2, 100, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numTriggerThreshold, layoutHints);
numTriggerThreshold->Resize(width, 20);
///const uint32_t TriggerHoldOffWidth = 0x1074; /// R/W
TGLabel * lbTriggerHoldOff = new TGLabel(vfTrigger1, "Trigger Holdoff [ns]"); vfTrigger1->AddFrame(lbTriggerHoldOff, layoutHintsR);
TGNumberEntry* numTriggerHoldOff = new TGNumberEntry(vfTrigger2, 20000, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numTriggerHoldOff, layoutHints);
numTriggerHoldOff->Resize(width, 20);
///const uint32_t ChannelDCOffset = 0x1098; /// R/W
TGLabel * lbDCOffset = new TGLabel(vfTrigger1, "DC offset [%]"); vfTrigger1->AddFrame(lbDCOffset, layoutHintsR);
TGNumberEntry* numDCOffset = new TGNumberEntry(vfTrigger2, 20, 0, 0, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numDCOffset, layoutHints);
numDCOffset->Resize(width, 20);
///const uint32_t RCCR2SmoothingFactor = 0x1054; /// R/W Trigger Filter smoothing, triggerSmoothingFactor
TGLabel * lbTriggerSmoothing = new TGLabel(vfTrigger1, "Trigger Smoothing"); vfTrigger1->AddFrame(lbTriggerSmoothing, layoutHintsR);
TGComboBox* cbTriggerSmoothing = new TGComboBox(vfTrigger2); vfTrigger2->AddFrame(cbTriggerSmoothing, layoutHints);
cbTriggerSmoothing->AddEntry("disable", 0);
cbTriggerSmoothing->AddEntry("2 samples", 1);
cbTriggerSmoothing->AddEntry("4 samples", 2);
cbTriggerSmoothing->AddEntry("8 samples", 4);
cbTriggerSmoothing->AddEntry("16 samples", 8);
cbTriggerSmoothing->AddEntry("32 samples", 16);
cbTriggerSmoothing->AddEntry("64 samples", 32);
cbTriggerSmoothing->AddEntry("128 samples", 0x3F);
cbTriggerSmoothing->Select(16);
cbTriggerSmoothing->Resize(width, 20);
///const uint32_t InputRiseTime = 0x1058; /// R/W OK
TGLabel * lbInputRiseTime = new TGLabel(vfTrigger1, "Input rise time [ns]"); vfTrigger1->AddFrame(lbInputRiseTime, layoutHintsR);
TGNumberEntry* numInputRiseTime = new TGNumberEntry(vfTrigger2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numInputRiseTime, layoutHints);
numInputRiseTime->Resize(width, 20);
///const uint32_t RiseTimeValidationWindow = 0x1070; /// R/W OK
TGLabel * lbRiseTimeValidWin = new TGLabel(vfTrigger1, "Rise Time Val. Win. [ns]"); vfTrigger1->AddFrame(lbRiseTimeValidWin, layoutHintsR);
TGNumberEntry* numRiseTimeValidWin = new TGNumberEntry(vfTrigger2, 20, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrigger2->AddFrame(numRiseTimeValidWin, layoutHints);
numRiseTimeValidWin->Resize(width, 20);
///const uint32_t ShapedTriggerWidth = 0x1084; /// R/W not sure
///const uint32_t VetoWidth = 0x10D4; /// R/W
///const uint32_t FineGain = 0x10C4; /// R/W OK
/// DPP1 bit[19:18]
TGLabel * lbTriggerMode = new TGLabel(vfTrigger1, "Trig. Mode"); vfTrigger1->AddFrame(lbTriggerMode, layoutHintsR);
TGComboBox * cbTriggerMode = new TGComboBox(vfTrigger2); vfTrigger2->AddFrame(cbTriggerMode, layoutHints);
cbTriggerMode->AddEntry("Normal", 0);
cbTriggerMode->AddEntry("Coin.", 1);
cbTriggerMode->AddEntry("Anti-Coin.", 3);
cbTriggerMode->Resize(width, 20);
cbTriggerMode->Select(0);
}
{///================== Trapezoid Settings
TGGroupFrame * gfTrap = new TGGroupFrame(hframe1, "Trapazoid", kHorizontalFrame); hframe1->AddFrame(gfTrap, new TGLayoutHints(kLHintsExpandY));
TGHorizontalFrame * hfTrap = new TGHorizontalFrame(gfTrap); gfTrap->AddFrame(hfTrap);
TGVerticalFrame * vfTrap1 = new TGVerticalFrame(hfTrap); hfTrap->AddFrame(vfTrap1);
TGVerticalFrame * vfTrap2 = new TGVerticalFrame(hfTrap); hfTrap->AddFrame(vfTrap2);
///const uint32_t TrapezoidRiseTime = 0x105C; /// R/W OK
TGLabel * lbTrapRiseTime = new TGLabel(vfTrap1, "Rise time [ns]"); vfTrap1->AddFrame(lbTrapRiseTime, layoutHintsR);
TGNumberEntry* numTrapRiseTime = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numTrapRiseTime, layoutHints);
numTrapRiseTime->Resize(width, 20);
///const uint32_t TrapezoidFlatTop = 0x1060; /// R/W OK
TGLabel * lbTrapFlatTop = new TGLabel(vfTrap1, "Flat Top [ns]"); vfTrap1->AddFrame(lbTrapFlatTop, layoutHintsR);
TGNumberEntry* numTrapFlatTop = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numTrapFlatTop, layoutHints);
numTrapFlatTop->Resize(width, 20);
///const uint32_t DecayTime = 0x1068; /// R/W OK
TGLabel * lbDecay = new TGLabel(vfTrap1, "Decay [ns]"); vfTrap1->AddFrame(lbDecay, layoutHintsR);
TGNumberEntry* numDecay = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numDecay, layoutHints);
numDecay->Resize(width, 20);
///const uint32_t PeakingTime = 0x1064; /// R/W OK
TGLabel * lbPeaking = new TGLabel(vfTrap1, "Peaking [ns]"); vfTrap1->AddFrame(lbPeaking, layoutHintsR);
TGNumberEntry* numPeaking = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numPeaking, layoutHints);
numPeaking->Resize(width, 20);
///const uint32_t PeakHoldOff = 0x1078; /// R/W OK
TGLabel * lbPeakHoldOff = new TGLabel(vfTrap1, "Peaking Holdoff [ns]"); vfTrap1->AddFrame(lbPeakHoldOff, layoutHintsR);
TGNumberEntry* numPeakHoldOff = new TGNumberEntry(vfTrap2, 96, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative); vfTrap2->AddFrame(numPeakHoldOff, layoutHints);
numPeakHoldOff->Resize(width, 20);
/// DPP1 bit[13:12]
TGLabel * lbPeakMean = new TGLabel(vfTrap1, "Peak Mean"); vfTrap1->AddFrame(lbPeakMean, layoutHintsR);
TGComboBox * cbPeakMean = new TGComboBox(vfTrap2); vfTrap2->AddFrame(cbPeakMean, layoutHints);
cbPeakMean->AddEntry("1 sample", 0);
cbPeakMean->AddEntry("4 samples", 1);
cbPeakMean->AddEntry("16 samples", 2);
cbPeakMean->AddEntry("64 samples", 3);
cbPeakMean->Resize(width, 20);
cbPeakMean->Select(0);
/// DPP1 bit[22:20]
TGLabel * lbBaseLineAvg = new TGLabel(vfTrap1, "Baseline avg."); vfTrap1->AddFrame(lbBaseLineAvg, layoutHintsR);
TGComboBox * cbBaseLineAvg = new TGComboBox(vfTrap2); vfTrap2->AddFrame(cbBaseLineAvg, layoutHints);
cbBaseLineAvg->AddEntry("no baseline", 0);
cbBaseLineAvg->AddEntry("16 sp.", 1);
cbBaseLineAvg->AddEntry("64 sp.", 2);
cbBaseLineAvg->AddEntry("256 sp.", 3);
cbBaseLineAvg->AddEntry("1024 sp.", 4);
cbBaseLineAvg->AddEntry("4096 sp.", 5);
cbBaseLineAvg->AddEntry("16384 sp.", 6);
cbBaseLineAvg->Resize(width, 20);
cbBaseLineAvg->Select(0);
}
{///================== const uint32_t DPPAlgorithmControl = 0x1080; /// R/W
TGGroupFrame * gfDPPCtrl = new TGGroupFrame(vframe, "DPP Algorithm Control 1 & 2", kHorizontalFrame); vframe->AddFrame(gfDPPCtrl, new TGLayoutHints(kLHintsExpandX));
TGVerticalFrame * vfDPPCtrl = new TGVerticalFrame(gfDPPCtrl); gfDPPCtrl->AddFrame(vfDPPCtrl, new TGLayoutHints(kLHintsExpandX));
TGHorizontalFrame * hfDPPCtrl1 = new TGHorizontalFrame(vfDPPCtrl); vfDPPCtrl->AddFrame(hfDPPCtrl1, new TGLayoutHints(kLHintsExpandX, 5, 5, 10, 0));
TGVerticalFrame * vfDPPCtrl11 = new TGVerticalFrame(hfDPPCtrl1); hfDPPCtrl1->AddFrame(vfDPPCtrl11, new TGLayoutHints(kLHintsExpandX, 5, 5, 0, 0));
TGLayoutHints * haha = new TGLayoutHints(kLHintsRight, 5, 5, 3, 2);
TGLabel * lbTrapScale = new TGLabel(vfDPPCtrl11, "Trap. Scaling [bit] :"); vfDPPCtrl11->AddFrame(lbTrapScale, haha);
TGLabel * lbDecimation = new TGLabel(vfDPPCtrl11, "Decimation :"); vfDPPCtrl11->AddFrame(lbDecimation, haha);
TGLabel * lbDecimationGain = new TGLabel(vfDPPCtrl11, "Decimation Gain :"); vfDPPCtrl11->AddFrame(lbDecimationGain, haha);
TGLabel * lbRollOver = new TGLabel(vfDPPCtrl11, "Roll-Over Flag :"); vfDPPCtrl11->AddFrame(lbRollOver, haha);
TGLabel * lbPileUp = new TGLabel(vfDPPCtrl11, "Pile-Up Flag :"); vfDPPCtrl11->AddFrame(lbPileUp, haha);
TGVerticalFrame * vfDPPCtrl12 = new TGVerticalFrame(hfDPPCtrl1); hfDPPCtrl1->AddFrame(vfDPPCtrl12);
TGNumberEntry * numTrapScale = new TGNumberEntry(vfDPPCtrl12, 14, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative );
vfDPPCtrl12->AddFrame(numTrapScale);
numTrapScale->Resize(width, 20);
TGComboBox * cbDecimation = new TGComboBox(vfDPPCtrl12); vfDPPCtrl12->AddFrame(cbDecimation);
cbDecimation->AddEntry("Disable", 0);
cbDecimation->AddEntry("2 samples", 1);
cbDecimation->AddEntry("4 samples", 2);
cbDecimation->AddEntry("8 samples", 3);
cbDecimation->Resize(width, 20);
cbDecimation->Select(0);
TGComboBox * cbDecimationGain = new TGComboBox(vfDPPCtrl12); vfDPPCtrl12->AddFrame(cbDecimationGain);
cbDecimationGain->AddEntry("x 1", 0);
cbDecimationGain->AddEntry("x 2", 1);
cbDecimationGain->AddEntry("x 4", 2);
cbDecimationGain->AddEntry("x 8", 3);
cbDecimationGain->Resize(width, 20);
cbDecimationGain->Select(0);
TGComboBox * cbRollOver = new TGComboBox(vfDPPCtrl12); vfDPPCtrl12->AddFrame(cbRollOver);
cbRollOver->AddEntry("Disabled", 0);
cbRollOver->AddEntry("Enabled", 1);
cbRollOver->Resize(width, 20);
cbRollOver->Select(0);
TGComboBox * cbPileUp = new TGComboBox(vfDPPCtrl12); vfDPPCtrl12->AddFrame(cbPileUp);
cbPileUp->AddEntry("Disabled", 0);
cbPileUp->AddEntry("Enabled", 1);
cbPileUp->Resize(width, 20);
cbPileUp->Select(0);
TGLabel * lbBaselineOptimize = new TGLabel(vfDPPCtrl11, "Baseline Optimaization :"); vfDPPCtrl11->AddFrame(lbBaselineOptimize, haha);
TGComboBox * cbLocalShapedTrigger = new TGComboBox(vfDPPCtrl12); vfDPPCtrl12->AddFrame(cbLocalShapedTrigger);
cbLocalShapedTrigger->AddEntry("Disabled", -1);
cbLocalShapedTrigger->AddEntry("AND", 0);
cbLocalShapedTrigger->AddEntry("Even Channel", 1);
cbLocalShapedTrigger->AddEntry("Odd Channel", 2);
cbLocalShapedTrigger->AddEntry("OR", 3);
cbLocalShapedTrigger->Resize(width, 20);
cbLocalShapedTrigger->Select(0);
TGVerticalFrame * vfDPPCtrl21 = new TGVerticalFrame(hfDPPCtrl1); hfDPPCtrl1->AddFrame(vfDPPCtrl21, new TGLayoutHints(kLHintsExpandX, 5, 5, 0, 0));
TGLabel * lbLocalShapedTrigger = new TGLabel(vfDPPCtrl21, "Local Shaped Trigger :"); vfDPPCtrl21->AddFrame(lbLocalShapedTrigger, haha);
TGLabel * lbLocalTriggerValid = new TGLabel(vfDPPCtrl21, "Local Trigger Valid. :"); vfDPPCtrl21->AddFrame(lbLocalTriggerValid, haha);
TGLabel * lbVetoSource = new TGLabel(vfDPPCtrl21, "Veto Source :"); vfDPPCtrl21->AddFrame(lbVetoSource, haha);
TGLabel * lbTriggerCounterRate = new TGLabel(vfDPPCtrl21, "Trigger Counter Rate :"); vfDPPCtrl21->AddFrame(lbTriggerCounterRate, haha);
TGLabel * lbBaselineCal = new TGLabel(vfDPPCtrl21, "Active Baseline Cal. :"); vfDPPCtrl21->AddFrame(lbBaselineCal, haha);
TGLabel * lbTagCorrelatedEvent = new TGLabel(vfDPPCtrl21, "Tag correlated events :"); vfDPPCtrl21->AddFrame(lbTagCorrelatedEvent, haha);
TGVerticalFrame * vfDPPCtrl22 = new TGVerticalFrame(hfDPPCtrl1); hfDPPCtrl1->AddFrame(vfDPPCtrl22, new TGLayoutHints(kLHintsExpandX, 5, 5, 0, 0));
TGComboBox * cbLocalTriggerValid = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbLocalTriggerValid);
cbLocalTriggerValid->AddEntry("Disabled", -1);
cbLocalTriggerValid->AddEntry("crossed", 0);
cbLocalTriggerValid->AddEntry("val0 = val1 from mother-board mask", 1);
cbLocalTriggerValid->AddEntry("AND", 3);
cbLocalTriggerValid->AddEntry("OR", 4);
cbLocalTriggerValid->Resize(width, 20);
cbLocalTriggerValid->Select(0);
TGComboBox * cbVetoSource = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbVetoSource);
cbVetoSource->AddEntry("Disabled", 0);
cbVetoSource->AddEntry("common to all channels", 1);
cbVetoSource->AddEntry("individually set for paired channel", 2);
cbVetoSource->AddEntry("negative saturation", 3);
cbVetoSource->Resize(width, 20);
cbVetoSource->Select(0);
TGComboBox * cbTriggerCounterRate = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbTriggerCounterRate);
cbTriggerCounterRate->AddEntry("1024", 0);
cbTriggerCounterRate->AddEntry(" 128", 1);
cbTriggerCounterRate->AddEntry("8192", 2);
cbTriggerCounterRate->Resize(width, 20);
cbTriggerCounterRate->Select(0);
TGComboBox * cbBaselineCal = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbBaselineCal);
cbBaselineCal->AddEntry("Enabled", 0);
cbBaselineCal->AddEntry("Disabled", 1);
cbBaselineCal->Resize(width, 20);
cbBaselineCal->Select(0);
TGComboBox * cbTagCorrelatedEvent = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbTagCorrelatedEvent);
cbTagCorrelatedEvent->AddEntry("Disabled", 0);
cbTagCorrelatedEvent->AddEntry("Enabled", 1);
cbTagCorrelatedEvent->Resize(width, 20);
cbTagCorrelatedEvent->Select(0);
TGComboBox * cbBaselineOptimize = new TGComboBox(vfDPPCtrl22); vfDPPCtrl22->AddFrame(cbBaselineOptimize);
cbBaselineOptimize->AddEntry("Disabled", 0);
cbBaselineOptimize->AddEntry("Enabled", 1);
cbBaselineOptimize->Resize(width, 20);
cbBaselineOptimize->Select(0);
TGHorizontalFrame * hfDPPCtrl2 = new TGHorizontalFrame(vfDPPCtrl); vfDPPCtrl->AddFrame(hfDPPCtrl2, new TGLayoutHints(kLHintsExpandX, 5, 5, 10, 0));
TGVerticalFrame * vfDPPCtrl_a = new TGVerticalFrame(hfDPPCtrl2); hfDPPCtrl2->AddFrame(vfDPPCtrl_a);
TGVerticalFrame * vfDPPCtrl_b = new TGVerticalFrame(hfDPPCtrl2); hfDPPCtrl2->AddFrame(vfDPPCtrl_b, new TGLayoutHints(kLHintsExpandX, 5, 5, 0, 0));
TGLabel * lbDisableSelfTrigger = new TGLabel(vfDPPCtrl_a, "Self Trigger :"); vfDPPCtrl_a->AddFrame(lbDisableSelfTrigger, haha);
TGComboBox * cbDisableSelfTrigger = new TGComboBox(vfDPPCtrl_b); vfDPPCtrl_b->AddFrame(cbDisableSelfTrigger);
cbDisableSelfTrigger->AddEntry("used to acquire and propagate to trigger logic", 0);
cbDisableSelfTrigger->AddEntry("only propagate to trigger logic", 1);
cbDisableSelfTrigger->Resize(300, 20);
cbDisableSelfTrigger->Select(0);
TGLabel * lbExtra2WordOption = new TGLabel(vfDPPCtrl_a, "Extras 2 Word Option :"); vfDPPCtrl_a->AddFrame(lbExtra2WordOption, haha);
TGComboBox * cbExtra2WordOption = new TGComboBox(vfDPPCtrl_b); vfDPPCtrl_b->AddFrame(cbExtra2WordOption);
cbExtra2WordOption->AddEntry("[31:16] Extended Time Stamp [15:0] Baseline * 4", 0);
cbExtra2WordOption->AddEntry("[31:16] Extended Time Stamp [15:0] Fine Time Stamp", 2);
cbExtra2WordOption->AddEntry("[31:16] Lost Trigger Counter [15:0] Total Trigger Counter", 4);
cbExtra2WordOption->AddEntry("[31:16] Event Before Zero Crossing [15:0] Event After Zero Crossing", 5);
cbExtra2WordOption->Resize(400, 20);
cbExtra2WordOption->Select(0);
}
/*
2022-08-23 13:43:05 -04:00
///----- all other
TGHorizontalFrame *hframe[NUM_CHANNEL_SETTING];
TGLabel * lb[NUM_CHANNEL_SETTING];
for( int i = 0 ; i < NUM_CHANNEL_SETTING; i++){
hframe[i] = new TGHorizontalFrame(vframe, 50, 50 );
vframe->AddFrame(hframe[i], new TGLayoutHints(kLHintsRight, 2,2,2,2));
double temp = 0; // pixie->GetChannelSetting(settingName[i][0].Data(), boardID, ch, false);
TGNumberFormat::EStyle digi = TGNumberFormat::kNESInteger;
if( settingName[i][1] == "0" ) digi = TGNumberFormat::kNESInteger;
if( settingName[i][1] == "1" ) digi = TGNumberFormat::kNESRealOne;
if( settingName[i][1] == "2" ) digi = TGNumberFormat::kNESRealTwo;
if( settingName[i][1] == "3" ) digi = TGNumberFormat::kNESRealThree;
entry[i] = new TGNumberEntry(hframe[i], temp, 0, 0, digi, TGNumberFormat::kNEANonNegative);
entry[i]->Resize(width, 20);
if( i >= NUM_CHANNEL_SETTING - 3 ) {
entry[i]->SetState(false);
}else{
entry[i]->Connect("Modified()", "ChannelSetting", this, Form("ChangeID(=%d)", i));
}
hframe[i]->AddFrame(entry[i], new TGLayoutHints(kLHintsRight, 5,5,3,4));
lb[i] = new TGLabel(hframe[i], settingName[i][0] + (settingName[i][2] != "" ? " [" + settingName[i][2] + "]" : ""));
hframe[i]->AddFrame(lb[i], new TGLayoutHints(kLHintsRight | kLHintsCenterY, 5, 5, 3, 4));
}
*/
2022-08-23 13:43:05 -04:00
fMain->MapSubwindows();
fMain->Resize(fMain->GetDefaultSize());
fMain->MapWindow();
isOpened = true;
}
ChannelSetting::~ChannelSetting(){
isOpened = false;
delete boardIDEntry;
delete cbOnOff;
delete cbInputDynamicRange;
2022-08-23 13:43:05 -04:00
delete cbPolarity;
/// fMain must be delete last;
fMain->Cleanup();
delete fMain;
}
void ChannelSetting::ChangeBoard(){
ChangeCh();
}
void ChannelSetting::ChangeCh(){
int boardID = boardIDEntry->GetNumber();
int ch = chIDEntry->GetNumber();
//pixie->GetChannelOnOff(boardID, ch) ? cbOnOff->Select(1) : cbOnOff->Select(0);
//pixie->GetChannelPolarity(boardID, ch) ? cbPolarity->Select(1) : cbPolarity->Select(0);
//pixie->GetChannelTraceOnOff(boardID, ch) ? cbTraceOnOff->Select(1) : cbTraceOnOff->Select(0);
}
void ChannelSetting::ChangeOnOff(){
short boardID = boardIDEntry->GetNumber();
short ch = chIDEntry->GetNumber();
int val = cbOnOff->GetSelected();
//pixie->SetChannelOnOff(val, boardID, ch);
//pixie->SaveSettings(pixie->GetSettingFile(boardIDEntry->GetNumber()));
}
void ChannelSetting::ChangePolarity(){
short boardID = boardIDEntry->GetNumber();
short ch = chIDEntry->GetNumber();
int val = cbPolarity->GetSelected();
printf("------------- testing from BoardSetting\n");
2022-08-23 13:43:05 -04:00
//pixie->SetChannelPositivePolarity(val, boardID, ch);
//pixie->SaveSettings(pixie->GetSettingFile(boardIDEntry->GetNumber()));
}
void ChannelSetting::ChangeID(int id){
short boardID = boardIDEntry->GetNumber();
short ch = chIDEntry->GetNumber();
//pixie->SetChannelSetting(settingName[id][0].Data(), val, boardID, ch, 1);
//pixie->SaveSettings(pixie->GetSettingFile(boardIDEntry->GetNumber()));
}