- Timestamp:
- 05/12/11 19:04:11 (14 years ago)
- Location:
- trunk/FACT++/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r10665 r10678 1369 1369 } 1370 1370 1371 void CallInfoHandler(void (FactGui::*handler)(const DimData&), const DimData &d) 1372 { 1373 fInHandler = true; 1374 (this->*handler)(d); 1375 fInHandler = false; 1376 } 1377 1378 /* 1379 void CallInfoHandler(const boost::function<void()> &func) 1380 { 1381 // This ensures that newly received values are not sent back to the emitter 1382 // because changing the value emits the valueChanged signal (or similar) 1383 fInHandler = true; 1384 func(); 1385 fInHandler = false; 1386 }*/ 1387 1371 1388 void PostInfoHandler(void (FactGui::*handler)(const DimData&)) 1372 1389 { 1373 QApplication::postEvent(this, 1374 new FunctionEvent(boost::bind(handler, this, DimData(getInfo())))); 1390 //const boost::function<void()> f = boost::bind(handler, this, DimData(getInfo())); 1391 1392 FunctionEvent *evt = new FunctionEvent(boost::bind(&FactGui::CallInfoHandler, this, handler, DimData(getInfo()))); 1393 // FunctionEvent *evt = new FunctionEvent(boost::bind(&FactGui::CallInfoHandler, this, f)); 1394 // FunctionEvent *evt = new FunctionEvent(boost::bind(handler, this, DimData(getInfo())))); 1395 1396 QApplication::postEvent(this, evt); 1375 1397 } 1376 1398 -
trunk/FACT++/gui/MainWindow.cc
r10657 r10678 2 2 3 3 #include <iostream> 4 #include <sstream> 4 5 5 6 #include <QTimer> … … 36 37 // Initialize the 40 FTU Leds as a copy of the prototype LED 37 38 fFtuLED[0] = fFtuLEDPrototype; 39 fFtuLED[0]->setToolTip("Crate 0, Board 0, Index 0"); 38 40 39 41 for (int i=1; i<40; i++) … … 49 51 b->setFlat(fFtuLEDPrototype->isFlat()); 50 52 53 ostringstream str; 54 str << "Crate " << i/10 << ", Board " << i%10 << ", Index " << i; 55 b->setToolTip(str.str().c_str()); 56 51 57 fFtuLedLayout->addWidget(b, i/10+1, i%10+1, 1, 1); 52 58 … … 126 132 { 127 133 uint8_t(fTriggerSeqPed->value()), 128 uint8_t(fTriggerSeqLP int->value()),129 uint8_t(fTriggerSeqLP ext->value())134 uint8_t(fTriggerSeqLPext->value()), 135 uint8_t(fTriggerSeqLPint->value()) 130 136 }; 131 137 132 Dim::SendCommand("FTM_CONTROL/SET_TRIGGER_SEQUENCE", d); 138 if (!fInHandler) 139 Dim::SendCommand("FTM_CONTROL/SET_TRIGGER_SEQUENCE", d); 133 140 } 134 141 … … 153 160 } 154 161 155 void MainWindow::SetTriggerCoincidence() 156 { 157 const uint16_t d[2] = 158 { 159 uint16_t(fPhysicsCoincidence->value()), 160 uint16_t(fPhysicsWindow->value()/4-2) 161 }; 162 163 Dim::SendCommand("FTM_CONTROL/SET_TRIGGER_COINCIDENCE", d); 164 } 165 166 void MainWindow::SetCalibCoincidence() 167 { 168 const uint16_t d[2] = 169 { 170 uint16_t(fCalibCoincidence->value()), 171 uint16_t(fCalibWindow->value()/4-2) 172 }; 173 174 Dim::SendCommand("FTM_CONTROL/SET_CALIBRATION_COINCIDENCE", d); 162 void MainWindow::on_fPhysicsCoincidence_valueChanged(int v) 163 { 164 if (!fInHandler) 165 Dim::SendCommand("FTM_CONTROL/SET_TRIGGER_COINCIDENCE", v); 166 } 167 168 void MainWindow::on_fPhysicsWindow_valueChanged(int v) 169 { 170 if (!fInHandler) 171 Dim::SendCommand("FTM_CONTROL/SET_TRIGGER_WINDOW", v/4-2); 172 } 173 174 void MainWindow::on_fCalibCoincidence_valueChanged(int v) 175 { 176 if (!fInHandler) 177 Dim::SendCommand("FTM_CONTROL/SET_CALIBRATION_COINCIDENCE", v); 178 } 179 180 void MainWindow::on_fCalibWindow_valueChanged(int v) 181 { 182 if (!fInHandler) 183 Dim::SendCommand("FTM_CONTROL/SET_CALIBRATION_WINDOW", v/4-2); 175 184 } 176 185 … … 180 189 181 190 const int32_t d[2] = { fThresholdIdx->value(), v }; 182 Dim::SendCommand("FTM_CONTROL/SET_THRESHOLD", d); 191 192 if (!fInHandler) 193 Dim::SendCommand("FTM_CONTROL/SET_THRESHOLD", d); 183 194 } 184 195 185 196 void MainWindow::on_fTriggerInterval_valueChanged(int val) 186 197 { 187 Dim::SendCommand("FTM_CONTROL/SET_TRIGGER_INTERVAL", val); 198 if (!fInHandler) 199 Dim::SendCommand("FTM_CONTROL/SET_TRIGGER_INTERVAL", val); 188 200 } 189 201 190 202 void MainWindow::on_fTriggerDelay_valueChanged(int val) 191 203 { 192 Dim::SendCommand("FTM_CONTROL/SET_TRIGGER_DELAY", val/4-2); 204 if (!fInHandler) 205 Dim::SendCommand("FTM_CONTROL/SET_TRIGGER_DELAY", val/4-2); 193 206 } 194 207 195 208 void MainWindow::on_fTimeMarkerDelay_valueChanged(int val) 196 209 { 197 Dim::SendCommand("FTM_CONTROL/SET_TIME_MARKER_DELAY", val/4-2); 210 if (!fInHandler) 211 Dim::SendCommand("FTM_CONTROL/SET_TIME_MARKER_DELAY", val/4-2); 198 212 } 199 213 200 214 void MainWindow::on_fDeadTime_valueChanged(int val) 201 215 { 202 Dim::SendCommand("FTM_CONTROL/SET_DEAD_TIME", val/4-2); 216 if (!fInHandler) 217 Dim::SendCommand("FTM_CONTROL/SET_DEAD_TIME", val/4-2); 203 218 } 204 219 205 220 void MainWindow::on_fPrescalingVal_valueChanged(int val) 206 221 { 207 Dim::SendCommand("FTM_CONTROL/SET_PRESCALING", val); 222 if (!fInHandler) 223 Dim::SendCommand("FTM_CONTROL/SET_PRESCALING", val); 208 224 } 209 225 -
trunk/FACT++/gui/MainWindow.h
r10641 r10678 20 20 protected: 21 21 QPushButton *fFtuLED[40]; 22 23 bool fInHandler; 22 24 23 25 public: … … 51 53 void on_fTriggerSeqLPext_valueChanged(int) { SetTriggerSequence(); } 52 54 53 54 void on_fPhysicsCoincidence_valueChanged(int) { SetTriggerCoincidence(); } 55 void on_fPhysicsWindow_valueChanged(int) { SetTriggerCoincidence(); } 56 57 void on_fCalibCoincidence_valueChanged(int) { SetCalibCoincidence(); } 58 void on_fCalibWindow_valueChanged(int) { SetCalibCoincidence(); } 55 void on_fPhysicsCoincidence_valueChanged(int); 56 void on_fPhysicsWindow_valueChanged(int); 57 void on_fCalibCoincidence_valueChanged(int); 58 void on_fCalibWindow_valueChanged(int); 59 59 60 60 void on_fTriggerInterval_valueChanged(int);
Note:
See TracChangeset
for help on using the changeset viewer.