Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates #43

Merged
merged 1 commit into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions doc/dtc_gui.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#+startup:fold -*- buffer-read-only: t -*-
* ------------------------------------------------------------------------------
* DTC GUI interface: [[file:../otsdaq-mu2e-tracker/Gui/DtcGui.hh]]
* initialization
#+begin_src
.L dtc_gui.C
auto x = dtc_gui(config_name)
#+end_src
parameters:
- config_name: points to the configuration file. It is either a directory name or a file name, see below.
- locating configuration file:
- it is assumed that config_name is a located under [[file:../config][otsdaq-mu2e-tracker/config]]
- if a file='otsdaq-mu2e-tracker/config/config_name.C' exists, the configuration is taken from there
- if a directory='config/config_name' exists, the configuration is taken from config/config_name/
* CFO panel
** status : prints the CFO status
** writeR : writes to the CFO register
** readR : reads from the CFO register
** soft reset : soft reset of the CFO
** hard reset : hard reset of the CFO
** launch : launch external CFO run plan
** EnableBmOff : enable 'Beam Off' mode - (start the run)
** DisableBmOff : disable 'Beam Off' mode - (stop the run)
- assume that the Bean On mode is disabled
- then, <disable BeamOf> + <soft reset> + <Enable Beam Off> restarts executaion of the current run plan
** Extrnl CT - <External CFO Thread> - obsolete
- a run plan can be started just once, no need to have a thread for that
** DTC mask : defines the number of DTCs in each time chain
- CFO supports 8 time chains
- each hex digit of the DTC mask contains the number of DTC's in the corresponding time chain:
#+begin_src
ndtcs[i] = (DtcMask >> 4*i) & 0xf
#end_src
** init readout : reads the run plan and initializes the CFO
- that includes setting the DTC mask
- currently, it is assumed that the run plans are located in $HOME/test_stand/cfo_run_plans directory
- the directory name will be soon moved to .rootrc
* DTC panel
** status : print the DTC status (several registers)
** writeR : write the DTC register
** readR : read the DTC register
** soft reset : soft reset of the DTC
** hard reset : hard reset of the DTC
** FF temp : prints the DTC firefly temperatures
** ROC pattrn : obsolete, replaced by InitReadout
** InitReadout : initializes the DTC for a given readout mode
- the DTC readout mode is defined by the CFO mode and the ROC readout mode
- DTC may be run in a so-called 'CFO emulation mode', in which no external CFO
is needed
** EmulateCFO : set to one if the DTC is running in a CFO emulation mode
** ROC readout mode:
- 0: ROC emulated patterns
- 1: digis
- 2: do we need more , i.e. digi patterns ?
** ROC tabs : each DTC panel has 6 ROC tabs
*** status : print ROC status
*** write : write ROC register
*** read : read ROC register
*** reset : reset the ROC (write 1 to register 14)
* general panel
** clear : clear the outptu window
** exit : exit
** NEvents : N(events) per run in the CFO emulation mode
** EWLength : event window length in units of 25 ns
- EWLength=80 defines an event window length of 2000 ns
** FirstTS : first event window tag in a run for teh CFO emulation mode
** SleepUS : sleep time, in us, after a single run has been taken
in a CFO emulation mode
- used by file:../otsdaq-mu2e-tracker/EmuCfoThread
* ------------------------------------------------------------------------------
* back to [[file:otsdaq_mu2e_tracker.org]]
* ------------------------------------------------------------------------------
5 changes: 3 additions & 2 deletions doc/otsdaq_mu2e_tracker.org
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ root [2] .q
#+end_src
** after that can proceed
* ------------------------------------------------------------------------------
* [[file:root_interface.org][ROOT interface]]
* [[file:root_interface.org][ROOT interface]]
* [[file:tracker_roc_registers.org][tracker ROC registers]]
* tracker VST configurations
- all described in tfm/config
Expand Down Expand Up @@ -162,6 +162,7 @@ Also, I claim that no power cycles are needed now after a DTC_Reset.
And that no TIMEOUT should be observed on the very first event after a DTC_Reset.

* [[file:control_roc.org][control_ROC.py and its commands]]
* [[file:./dtc_gui.org][DtcGui interface]]
* slow control of DTCs
** DTC_0 FPGA: 4 parameters
-- 0x9010 : temperature
Expand Down Expand Up @@ -465,7 +466,7 @@ readDeviceID
('DRAC ROC ID #', '7a7fb')
** [[file:roc_id_1b561.org][ROC ID 1b561]] : <2024-05-09 Thu> installed at TS1
** [[file:roc_id_805d6.org][ROC ID 805d6]] : <2024-02-25 Sun> installed at TS2
* test stands TS0, TS1, TS2
* test stands TS0, TS1, TS2
** last update <2024-07-15 Mon>
** powering up the test stands (Vadim):
https://docs.google.com/document/d/1theA9NIRA5XeUUPVuFGVhU7NddPljgaGznR9aMu-Fv8/edit?usp=sharing
Expand Down
4 changes: 2 additions & 2 deletions doc/tracker_roc_registers.org
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#+startup:unfold
#+startup:unfold -*- buffer-read-only: t -*-
* --------------------------------------------------------------------------------------
* TODO Tracker ROC registers

Expand All @@ -22,7 +22,7 @@
| 13 | Num skipped DATA REQ | |
| 14 | reset, write 1 to this register to reset the ROC | |
| 16 | unused | |
| 18 | unused | |
| 18 | unused ??? | |
|----------+--------------------------------------------------------------------+------|
| 23 | r24<<16+r23 : SIZE_FIFO_FULL [28]+STORE_POS[25:24]+STORE_CNT[19:0] | |
| 24 | | |
Expand Down
19 changes: 10 additions & 9 deletions otsdaq-mu2e-tracker/Gui/DtcGui.hh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// -*- buffer-read-only: t -*-
// Mainframe macro generated from application: root.exe
// By ROOT version 6.18/04 on 2020-05-11 18:09:54

Expand Down Expand Up @@ -231,8 +232,7 @@ public:
TString fIStage;
TString fTime;

int fNDtcs; // on a machine
int fNTimeChainedDtcs; // N(DTCs) in a time chain
int fNDtcs; // on a machine

DtcTabElement_t fDtcTel[2];

Expand All @@ -247,14 +247,14 @@ public:
TGNumberEntry* fNEvents; // DTC , CFO emulation
TGNumberEntry* fEWLength; // DTC , CFO emulation
TGNumberEntry* fFirstTS; // DTC , CFO emulation
TGNumberEntry* fSleepMS; // DTC , CFO emulation,
TGNumberEntry* fSleepUS; // DTC , CFO emulation, microseconds
TGNumberEntry* fPrintFreq; // DTC , CFO emulation, used by the DTC reading thread
int fCfoPrintFreq;

int fValidate;

Pixel_t fGreen; // completed stage tab tip
Pixel_t fYellow; // active tab tip
Pixel_t fGreen; // completed stage tab tip
Pixel_t fYellow; // active tab tip
Pixel_t fDtcTabColor; // non-active tab tip
Pixel_t fSubmittedColor;
Pixel_t fValidatedColor;
Expand All @@ -266,11 +266,11 @@ public:
// threads
//-----------------------------------------------------------------------------
struct ThreadContext_t {
TThread* fTp; // thread pointer
TThread* fTp; // thread pointer
DtcTabElement_t* fDtel;
int fRunning; // 0: stopped 1:running
int fStop; // end marker
int fCmd; // command
int fRunning; // 0: stopped 1:running
int fStop; // end marker
int fCmd; // command
int fPrintLevel;
int fPause;
int fSleepTimeMs;
Expand Down Expand Up @@ -327,6 +327,7 @@ public:
void dtc_launch_run_plan_emulated_cfo(DtcTabElement_t* Dtel, TGTextViewostream* TextView);

void dtc_print_firefly_temp (DtcTabElement_t* Dtel, TGTextViewostream* TextView);
void dtc_print_all_rocs (DtcTabElement_t* Dtel, TGTextViewostream* TextView);
void print_dtc_status ();
void print_roc_status ();

Expand Down
17 changes: 10 additions & 7 deletions otsdaq-mu2e-tracker/Gui/DtcGui_commands.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ void DtcGui::cfo_hard_reset(DtcTabElement_t* Dtel, TGTextViewostream* TextView)
//-----------------------------------------------------------------------------
void DtcGui::clear_output() {
fTextView->Clear();
fTextView->ShowBottom();
}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -194,6 +195,12 @@ void DtcGui::dtc_print_firefly_temp(DtcTabElement_t* Dtel, TGTextViewostream* Te
catch (...) { *fTextView << Form("ERROR, BAIL OUT") << std::endl; }
}

//-----------------------------------------------------------------------------
void DtcGui::dtc_print_all_rocs(DtcTabElement_t* Dtel, TGTextViewostream* TextView) {
try { Dtel->fDTC_i->PrintRocStatus(1,-1); }
catch (...) { *fTextView << Form("ERROR, BAIL OUT") << std::endl; }
}

//-----------------------------------------------------------------------------
void DtcGui::print_roc_status() {
// TString cmd;
Expand All @@ -208,14 +215,11 @@ void DtcGui::print_roc_status() {

TDatime x1;
*fTextView << x1.AsSQLString() << "DtcGui:: : " << __func__ << ": START" << std::endl;

//-----------------------------------------------------------------------------
// CFO doesn't have ROC's
//-----------------------------------------------------------------------------
if (dtel->fData->fName == "DTC") {
try { dtel->fDTC_i->PrintRocStatus(roc); }
catch (...) { *fTextView << Form("ERROR : coudn't read ROC %i ... BAIL OUT",roc) << std::endl; }
}
try { dtel->fDTC_i->PrintRocStatus(1,1<<4*roc); }
catch (...) { *fTextView << Form("ERROR : coudn't read ROC %i ... BAIL OUT",roc) << std::endl; }

TDatime x2;
*fTextView << x2.AsSQLString() << strCout.str() << " DtcGui::" << __func__
Expand All @@ -238,7 +242,6 @@ void DtcGui::dtc_init_readout(DtcTabElement_t* Dtel, TGTextViewostream* TextView
}
catch (...) { *TextView << Form("ERROR in DtcGui::%s: failed to execute DtcInterface::InitReadout\n",__func__); }
}

}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -700,7 +703,7 @@ int DtcGui::execute_command() {

TGButton* btn = (TGButton*) gTQSender;

TString* cmd = (TString*) btn->GetUserData();
// TString* cmd = (TString*) btn->GetUserData();

DtcTabElement_t* dtel = fDtcTel+fActiveDtcID;
// int roc = dtel->fActiveRocID;
Expand Down
34 changes: 17 additions & 17 deletions otsdaq-mu2e-tracker/Gui/DtcGui_gui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,18 @@ void DtcGui::BuildGui(const TGWindow *Parent, UInt_t Width, UInt_t Height) {
tb->Connect("Pressed()", "DtcGui", this, "exit()");
tb->ChangeBackground(fValidatedColor);
//-----------------------------------------------------------------------------
// 3. launch
// 3. ...
//-----------------------------------------------------------------------------
int x3offset = 10+button_sx*2;
tb = new TGTextButton(fButtonsFrame,"launch",-1,TGTextButton::GetDefaultGC()(),
TGTextButton::GetDefaultFontStruct(),kRaisedFrame);
tb->SetTextJustify(36);
tb->SetMargins(0,0,0,0);
tb->SetWrapLength(-1);
tb->MoveResize(x3offset,y0,button_dx,button_dy);
fButtonsFrame->AddFrame(tb, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
tb->Connect("Pressed()", "DtcGui", this, "cfo_launch_run_plan()");
tb->ChangeBackground(fValidatedColor);
// tb = new TGTextButton(fButtonsFrame,"launch",-1,TGTextButton::GetDefaultGC()(),
// TGTextButton::GetDefaultFontStruct(),kRaisedFrame);
// tb->SetTextJustify(36);
// tb->SetMargins(0,0,0,0);
// tb->SetWrapLength(-1);
// tb->MoveResize(x3offset,y0,button_dx,button_dy);
// fButtonsFrame->AddFrame(tb, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
// tb->Connect("Pressed()", "DtcGui", this, "cfo_launch_run_plan()");
// tb->ChangeBackground(fValidatedColor);
//-----------------------------------------------------------------------------
// 4 "NEvents" label followed by the entry field
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -281,23 +281,23 @@ void DtcGui::BuildGui(const TGWindow *Parent, UInt_t Width, UInt_t Height) {

fButtonsFrame->AddFrame(fFirstTS, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
//-----------------------------------------------------------------------------
// 7: "SleepMS" label followed by the entry field
// 7: "SleepUS" label followed by the entry field
//-----------------------------------------------------------------------------
lab = new TGLabel(fButtonsFrame,"Sleep MS");
lab = new TGLabel(fButtonsFrame,"Sleep US");
fButtonsFrame->AddFrame(lab, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
lab->SetTextJustify(36);
lab->SetMargins(0,0,0,0);
lab->SetWrapLength(-1);

fSleepMS = new TGNumberEntry(fButtonsFrame, 2000, 9,999,
fSleepUS = new TGNumberEntry(fButtonsFrame, 2000000, 9,999,
TGNumberFormat::kNESInteger,
TGNumberFormat::kNEANonNegative,
TGNumberFormat::kNELLimitMinMax,
0, 100000);
fSleepMS->Connect("ValueSet(Long_t)", "MyMainFrame", this, "DoSetlabel()");
(fSleepMS->GetNumberEntry())->Connect("ReturnPressed()","MyMainFrame", this,"DoSetlabel()");
0, 100000000);
fSleepUS->Connect("ValueSet(Long_t)", "MyMainFrame", this, "DoSetlabel()");
(fSleepUS->GetNumberEntry())->Connect("ReturnPressed()","MyMainFrame", this,"DoSetlabel()");

fButtonsFrame->AddFrame(fSleepMS, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fButtonsFrame->AddFrame(fSleepUS, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
//-----------------------------------------------------------------------------
// 8: "ReadPrintFreq" label followed by the entry field
//-----------------------------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions otsdaq-mu2e-tracker/Gui/DtcGui_gui_DtcTab.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void DtcGui::BuildDtcTabElement(TGTab*& Tab, DtcTabElement_t& DtcTel, DtcData_t*
//-----------------------------------------------------------------------------
// column 2 raw 6 : ROC patterns - OBSOLETE
//-----------------------------------------------------------------------------
tb = new TGTextButton(group,"ROC pattrn",-1,TGTextButton::GetDefaultGC()(),
tb = new TGTextButton(group,"ROC status",-1,TGTextButton::GetDefaultGC()(),
TGTextButton::GetDefaultFontStruct(),kRaisedFrame);
group->AddFrame(tb, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));

Expand All @@ -217,9 +217,9 @@ void DtcGui::BuildDtcTabElement(TGTab*& Tab, DtcTabElement_t& DtcTel, DtcData_t*
tb->SetWrapLength(-1);

tb->MoveResize(x0+dx+10,y0+(dy+5)*4,dx2,dy);
tb->Connect("Pressed()", "DtcGui", this, "configure_roc_pattern_mode()");
tb->ChangeBackground(fValidatedColor);
tb->SetUserData(nullptr);
tb->Connect("Pressed()", "DtcGui", this, "execute_command()");
// tb->ChangeBackground(fValidatedColor);
tb->SetUserData((void*) &DtcGui::dtc_print_all_rocs);
//-----------------------------------------------------------------------------
// column 3 row 1: write value: 1. label , 2: entry field 3: label
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -265,7 +265,7 @@ void DtcGui::BuildDtcTabElement(TGTab*& Tab, DtcTabElement_t& DtcTel, DtcData_t*

tb->MoveResize(x0+dx+10+dx2+10,y0+(dy+5)*3,dx3,dy);
tb->Connect("Pressed()", "DtcGui", this, "manage_read_thread()");
// tb->ChangeBackground(fValidatedColor); // not yet
tb->ChangeBackground(fValidatedColor); // not yet
tb->SetUserData(nullptr);
//-----------------------------------------------------------------------------
// column 3 row 5: Start CT - manage_emu_cfo_thread
Expand All @@ -280,7 +280,7 @@ void DtcGui::BuildDtcTabElement(TGTab*& Tab, DtcTabElement_t& DtcTel, DtcData_t*

tb->MoveResize(x0+dx+10+dx2+10,y0+(dy+5)*4,dx3,dy);
tb->Connect("Pressed()", "DtcGui", this, "manage_emu_cfo_thread()");
// tb->ChangeBackground(fValidatedColor); // not yet
tb->ChangeBackground(fValidatedColor); // not yet
tb->SetUserData(nullptr);
//-----------------------------------------------------------------------------
// column 4 row 1: initReadout
Expand Down
Loading