source: trunk/FACT++/gui/MainWindow.h@ 13827

Last change on this file since 13827 was 13237, checked in by tbretz, 13 years ago
Updated to fit the new biasctrl command and services.
File size: 10.0 KB
Line 
1#ifndef FACT_MainWindow
2#define FACT_MainWindow
3
4#include "design.h"
5
6#include <QMainWindow>
7
8class TObject;
9class TCanvas;
10
11class MainWindow : public QMainWindow, protected Ui::MainWindow
12{
13 Q_OBJECT;
14
15 void MakeLEDs(QPushButton **arr, QGridLayout *lay, const char *slot) const;
16
17 void SelectTab(const QString &name);
18 void SetTriggerSequence();
19 void SetTriggerCoincidence();
20 void SetCalibCoincidence();
21
22protected:
23 QPushButton *fFtuLED[40];
24 QPushButton *fFadLED[40];
25
26 bool fInHandler;
27
28public:
29 MainWindow(QWidget *p=0);
30
31private slots:
32 // Helper
33 void on_fFtmStartRun_clicked();
34 void on_fFtmStopRun_clicked();
35
36 void on_fFadStart_clicked();
37 void on_fFadStop_clicked();
38 void on_fFadAbort_clicked();
39 void on_fFadSoftReset_clicked();
40 void on_fFadHardReset_clicked();
41
42 void on_fLoggerStart_clicked();
43 void on_fLoggerStop_clicked();
44
45 void on_fMcpStartRun_clicked();
46 void on_fMcpStopRun_clicked();
47 void on_fMcpReset_clicked();
48
49 // Comment Sql Table
50 void on_fCommentInsertRow_clicked();
51
52 // System status
53 void on_fShutdown_clicked();
54 void on_fShutdownAll_clicked();
55
56 // Status LEDs signals
57 void on_fStatusFTULed_clicked();
58 void on_fStatusFTMLed_clicked();
59 void on_fStatusFADLed_clicked();
60 void on_fStatusLoggerLed_clicked();
61 void on_fStatusChatLed_clicked();
62 //void on_fStatusFTMEnable_stateChanged(int state);
63
64 // Tab Widget
65 void on_fTabWidget_tabCloseRequested(int which);
66 virtual void on_fTabWidget_currentChanged(int) = 0;
67
68 // Tab: FAD
69 void slot_fFadLED_clicked();
70
71// void on_fFadStartRun_clicked();
72// void on_fFadStopRun_clicked();
73 void on_fFadDrsOn_clicked();
74 void on_fFadDrsOff_clicked();
75 void on_fFadDwriteOn_clicked();
76 void on_fFadDwriteOff_clicked();
77 void on_fFadSingleTrigger_clicked();
78 void on_fFadTriggerLineOn_clicked();
79 void on_fFadTriggerLineOff_clicked();
80 void on_fFadContTriggerOn_clicked();
81 void on_fFadContTriggerOff_clicked();
82 void on_fFadBusyOnOn_clicked();
83 void on_fFadBusyOnOff_clicked();
84 void on_fFadBusyOffOn_clicked();
85 void on_fFadBusyOffOff_clicked();
86 void on_fFadResetTriggerId_clicked();
87 void on_fFadSocket0_clicked();
88 void on_fFadSocket17_clicked();
89
90 void FadSetFileFormat(uint16_t fmt);
91
92 void on_fFadButtonFileFormatNone_clicked() { FadSetFileFormat(0); }
93 void on_fFadButtonFileFormatDebug_clicked() { FadSetFileFormat(1); }
94 void on_fFadButtonFileFormatFits_clicked() { FadSetFileFormat(2); }
95 void on_fFadButtonFileFormatRaw_clicked() { FadSetFileFormat(3); }
96
97 void on_fFadPrescalerCmd_valueChanged(int);
98 void on_fFadRunNumberCmd_valueChanged(int);
99 void on_fFadRoiCmd_valueChanged(int = 0);
100 void on_fFadRoiCh9Cmd_valueChanged(int) { on_fFadRoiCmd_valueChanged(); }
101
102 void FadDacCmd_valueChanged(uint16_t, uint16_t);
103
104 void on_fFadDac0Cmd_valueChanged(int v) { FadDacCmd_valueChanged(v, 0); }
105 void on_fFadDac1Cmd_valueChanged(int v) { FadDacCmd_valueChanged(v, 1); }
106 void on_fFadDac2Cmd_valueChanged(int v) { FadDacCmd_valueChanged(v, 2); }
107 void on_fFadDac3Cmd_valueChanged(int v) { FadDacCmd_valueChanged(v, 3); }
108 void on_fFadDac4Cmd_valueChanged(int v) { FadDacCmd_valueChanged(v, 4); }
109 void on_fFadDac5Cmd_valueChanged(int v) { FadDacCmd_valueChanged(v, 5); }
110 void on_fFadDac6Cmd_valueChanged(int v) { FadDacCmd_valueChanged(v, 6); }
111 void on_fFadDac7Cmd_valueChanged(int v) { FadDacCmd_valueChanged(v, 7); }
112
113 void on_fDrsCalibStart_clicked();
114 void on_fDrsCalibReset_clicked();
115
116 void on_fDrsCalibStart2_clicked() { on_fDrsCalibStart_clicked(); }
117 void on_fDrsCalibReset2_clicked() { on_fDrsCalibReset_clicked(); }
118
119 // Tab: Adc
120 virtual void DisplayEventData() = 0;
121 void on_fAdcCrate_valueChanged(int) { DisplayEventData(); }
122 void on_fAdcBoard_valueChanged(int) { DisplayEventData(); }
123 void on_fAdcChip_valueChanged(int) { DisplayEventData(); }
124 void on_fAdcChannel_valueChanged(int) { DisplayEventData(); }
125
126 // Tab: FTM
127 void on_fEnableTrigger_stateChanged(int);
128 void on_fEnableExt1_stateChanged(int);
129 void on_fEnableExt2_stateChanged(int);
130 void on_fEnableClockCond_stateChanged(int);
131 void on_fEnableVeto_stateChanged(int);
132
133 void on_fTriggerSeqPed_valueChanged(int) { SetTriggerSequence(); }
134 void on_fTriggerSeqLPint_valueChanged(int) { SetTriggerSequence(); }
135 void on_fTriggerSeqLPext_valueChanged(int) { SetTriggerSequence(); }
136
137 void on_fPhysicsCoincidence_valueChanged(int);
138 void on_fPhysicsWindow_valueChanged(int);
139 void on_fCalibCoincidence_valueChanged(int);
140 void on_fCalibWindow_valueChanged(int);
141
142 void on_fTriggerInterval_valueChanged(int);
143 void on_fTriggerDelay_valueChanged(int);
144 void on_fTimeMarkerDelay_valueChanged(int);
145 void on_fDeadTime_valueChanged(int);
146/*
147 void on_fClockCondR0_valueChanged(int) { }
148 void on_fClockCondR1_valueChanged(int) { }
149 void on_fClockCondR8_valueChanged(int) { }
150 void on_fClockCondR9_valueChanged(int) { }
151 void on_fClockCondR11_valueChanged(int) { }
152 void on_fClockCondR13_valueChanged(int) { }
153 void on_fClockCondR14_valueChanged(int) { }
154 void on_fClockCondR15_valueChanged(int) { }
155*/
156 void on_fPrescalingVal_valueChanged(int);
157
158 void on_fClockCondFreq_activated(int);
159
160 void on_fLpIntIntensity_valueChanged(int);
161 void on_fLpExtIntensity_valueChanged(int);
162 void on_fLpIntGroup1_stateChanged(int);
163 void on_fLpExtGroup1_stateChanged(int);
164 void on_fLpIntGroup2_stateChanged(int);
165 void on_fLpExtGroup2_stateChanged(int);
166
167 // Tab: FTUs
168 void slot_fFtuLED_clicked();
169 void on_fFtuPing_toggled(bool);
170 void on_fFtuAllOn_clicked();
171 void on_fFtuAllOff_clicked();
172
173 // Tab: Feedback
174 void on_fFeedbackDevMin_valueChanged(int);
175 void on_fFeedbackDevMax_valueChanged(int);
176 void on_fFeedbackCmdMin_valueChanged(int);
177 void on_fFeedbackCmdMax_valueChanged(int);
178 void on_fFeedbackTempStart_clicked();
179 void on_fFeedbackOutputEnable_clicked();
180 void on_fFeedbackOutputDisable_clicked();
181 void on_fFeedbackStop_clicked();
182 void on_fFeedbackCalibrate_clicked();
183
184 // Tab: Bias
185 virtual void BiasHvChannelChanged() = 0;
186 virtual void BiasCamChannelChanged() = 0;
187 void on_fBiasHvBoard_valueChanged(int) { BiasHvChannelChanged(); }
188 void on_fBiasHvChannel_valueChanged(int) { BiasHvChannelChanged(); }
189 void on_fBiasCamCrate_valueChanged(int) { BiasCamChannelChanged(); }
190 void on_fBiasCamBoard_valueChanged(int) { BiasCamChannelChanged(); }
191 void on_fBiasCamPatch_valueChanged(int) { BiasCamChannelChanged(); }
192 void on_fBiasCamPixel_valueChanged(int) { BiasCamChannelChanged(); }
193
194 void on_fBiasVoltDac_valueChanged(int);
195 void on_fBiasOffsetDac_valueChanged(int);
196
197 void on_fBiasVoltMin_valueChanged(int); // FIXME: Could be set as slot in the designer
198 void on_fBiasVoltMax_valueChanged(int); // FIXME: Could be set as slot in the designer
199
200 void on_fBiasCurrentMin_valueChanged(int); // FIXME: Could be set as slot in the designer
201 void on_fBiasCurrentMax_valueChanged(int); // FIXME: Could be set as slot in the designer
202
203 void on_fBiasApplyChVolt_clicked();
204 void on_fBiasApplyChDac_clicked();
205 void on_fBiasApplyGlobalVolt_clicked();
206 void on_fBiasApplyGlobalDac_clicked();
207
208 void on_fBiasAddOffsetChVolt_clicked();
209 void on_fBiasAddOffsetChDac_clicked();
210 void on_fBiasAddOffsetGlobalVolt_clicked();
211 void on_fBiasAddOffsetGlobalDac_clicked();
212
213 void on_fBiasApplyOffsetChVolt_clicked();
214 void on_fBiasApplyOffsetGlobalVolt_clicked();
215
216 void on_fBiasApplyReference_clicked();
217 void on_fBiasSetToZero_clicked();
218 void on_fBiasReset_clicked();
219
220 virtual void on_fBiasDispRefVolt_stateChanged(int) = 0;
221
222 // Tab: Rates
223 //virtual void UpdateThresholdIdx() = 0;
224 virtual void on_fPixelIdx_valueChanged(int) = 0;
225 //void on_fThresholdCrate_valueChanged(int) { UpdateThresholdIdx() ; }
226 //void on_fThresholdBoard_valueChanged(int) { UpdateThresholdIdx() ; }
227 //void on_fThresholdPatch_valueChanged(int) { UpdateThresholdIdx() ; }
228
229 virtual void on_fPixelEnable_stateChanged(int) = 0;
230 virtual void on_fThresholdVal_valueChanged(int) = 0;
231 //virtual void on_fThresholdIdx_valueChanged(int) = 0;
232
233 virtual void on_fBoardRatesEnabled_toggled(bool) = 0;
234
235 void on_fNoutof4Val_valueChanged(int);
236
237 void on_fRatesMin_valueChanged(int); // FIXME: Could be set as slot in the designer
238 void on_fRatesMax_valueChanged(int); // FIXME: Could be set as slot in the designer
239 void on_fPixelEnableAll_clicked();
240 void on_fPixelDisableAll_clicked();
241
242 virtual void on_fPixelDisableOthers_clicked() = 0;
243 virtual void on_fThresholdDisableOthers_clicked() = 0;
244 virtual void on_fThresholdEnablePatch_clicked() = 0;
245 virtual void on_fThresholdDisablePatch_clicked() = 0;
246
247 virtual void DisplayRates() = 0;
248 void on_fRatePatch1_valueChanged(int) { DisplayRates(); }
249 void on_fRatePatch2_valueChanged(int) { DisplayRates(); }
250 void on_fRateBoard1_valueChanged(int) { DisplayRates(); }
251 void on_fRateBoard2_valueChanged(int) { DisplayRates(); }
252
253 // Tab: RateScan
254
255 virtual void DisplayRateScan() = 0;
256 void on_fRateScanPatch1_valueChanged(int) { DisplayRateScan(); }
257 void on_fRateScanPatch2_valueChanged(int) { DisplayRateScan(); }
258 void on_fRateScanBoard1_valueChanged(int) { DisplayRateScan(); }
259 void on_fRateScanBoard2_valueChanged(int) { DisplayRateScan(); }
260
261 // Tab: Chat
262 void on_fChatSend_clicked();
263
264 // Tab: Commands
265 /// Needs access to DimNetwork thus it is implemented in the derived class
266 virtual void on_fDimCmdSend_clicked() = 0;
267
268 // Main menu
269 // void on_fMenuLogSaveAs_triggered(bool)
270
271 virtual void slot_RootEventProcessed(TObject *, unsigned int, TCanvas *) = 0;
272 virtual void slot_RootUpdate() = 0;
273 virtual void slot_ChoosePixelThreshold(int) = 0;
274 virtual void slot_ChooseBiasChannel(int) = 0;
275 virtual void slot_CameraDoubleClick(int) = 0;
276 virtual void slot_CameraMouseMove(int) = 0;
277 void slot_TimeUpdate();
278};
279
280#endif
Note: See TracBrowser for help on using the repository browser.