source: trunk/FACT++/gui/MainWindow.cc@ 12488

Last change on this file since 12488 was 12415, checked in by tbretz, 13 years ago
Added the fFeedbackCalibrate button.
File size: 18.2 KB
Line 
1#include "MainWindow.h"
2
3#include <iostream>
4#include <sstream>
5
6#include <QTimer>
7
8#include "src/Dim.h"
9
10#include "DockWindow.h"
11#include "HtmlDelegate.h"
12#include "CheckBoxDelegate.h"
13
14using namespace std;
15
16void MainWindow::MakeLEDs(QPushButton **arr, QGridLayout *lay, const char *slot) const
17{
18 arr[0]->setToolTip("Crate 0, Board 0, Index 0");
19
20 for (int i=1; i<40; i++)
21 {
22 QPushButton *b = new QPushButton(static_cast<QWidget*>(arr[0]->parent()));
23
24 b->setEnabled(arr[0]->isEnabled());
25 b->setSizePolicy(arr[0]->sizePolicy());
26 b->setMaximumSize(arr[0]->maximumSize());
27 b->setIcon(arr[0]->icon());
28 b->setIconSize(arr[0]->iconSize());
29 b->setCheckable(arr[0]->isCheckable());
30 b->setFlat(arr[0]->isFlat());
31
32 ostringstream str;
33 str << "Crate " << i/10 << ", Board " << i%10 << ", Index " << i;
34 b->setToolTip(str.str().c_str());
35
36 lay->addWidget(b, i/10+1, i%10+1, 1, 1);
37
38 arr[i] = b;
39 }
40
41 const QString name = arr[0]->objectName();
42
43 for (int i=0; i<40; i++)
44 {
45 arr[i]->setObjectName(name+QString::number(i));
46 QObject::connect(arr[i], SIGNAL(clicked()), this, slot);
47 }
48}
49
50MainWindow::MainWindow(QWidget *p) : QMainWindow(p)
51{
52 // setupUi MUST be called before the DimNetwork is initilized
53 // In this way it can be ensured that nothing from the
54 // DimNetwork arrives before all graphical elements are
55 // initialized. This is a simple but very powerfull trick.
56 setupUi(this);
57
58 // Now here we can do further setup which should be done
59 // before the gui is finally displayed.
60 fDimCmdServers->setItemDelegate(new CheckBoxDelegate);
61 fDimCmdCommands->setItemDelegate(new CheckBoxDelegate);
62 fDimCmdDescription->setItemDelegate(new HtmlDelegate);
63
64 fDimSvcServers->setItemDelegate(new CheckBoxDelegate);
65 fDimSvcServices->setItemDelegate(new CheckBoxDelegate);
66 fDimSvcDescription->setItemDelegate(new HtmlDelegate);
67
68 // Set a default string to be displayed in a the status bar at startup
69 fStatusBar->showMessage(PACKAGE_STRING" | "PACKAGE_URL" | report bugs to <"PACKAGE_BUGREPORT">");
70
71 // Initialize the 40 FTU Leds as a copy of the prototype LED
72 fFtuLED[0] = fFtuLEDPrototype;
73 MakeLEDs(fFtuLED, fFtuLedLayout, SLOT(slot_fFtuLED_clicked()));
74
75 // Initialize the 40 FAD Leds as a copy of the prototype LED
76 fFadLED[0] = fFadLEDPrototype;
77 MakeLEDs(fFadLED, fFadLedLayout, SLOT(slot_fFadLED_clicked()));
78
79 // Initialize a timer to update the displayed UTC time
80 QTimer *timer = new QTimer(this);
81 connect(timer, SIGNAL(timeout()), this, SLOT(slot_TimeUpdate()));
82 timer->start(100);
83}
84
85void MainWindow::slot_TimeUpdate()
86{
87 // Used toUTC to support also older Qt versions
88 // toTime_t() always returns the datetime converted to UTC
89 // dateTime() unfortunately returns our UTC always as LocalTime
90 QDateTime now = QDateTime::currentDateTime().toUTC();
91 now.setTimeSpec(Qt::LocalTime);
92
93 if (now.toTime_t()==fUTC->dateTime().toTime_t())
94 return;
95
96 fUTC->setDateTime(now);
97}
98
99
100void MainWindow::SelectTab(const QString &name)
101{
102 for (int i=0; i<fTabWidget->count(); i++)
103 if (fTabWidget->tabText(i)==name)
104 {
105 fTabWidget->setCurrentIndex(i);
106 break;
107 }
108}
109
110void MainWindow::on_fNoutof4Val_valueChanged(int val)
111{
112 const uint32_t v[2] = { -1, val };
113
114 if (!fInHandler)
115 Dim::SendCommand("FTM_CONTROL/SET_N_OUT_OF_4", v);
116}
117
118void MainWindow::on_fRatesMin_valueChanged(int min)
119{
120 fRatesCanv->SetMin(min);
121}
122
123void MainWindow::on_fRatesMax_valueChanged(int max)
124{
125 fRatesCanv->SetMax(max);
126}
127
128void MainWindow::on_fShutdown_clicked()
129{
130 Dim::SendCommand("DIS_DNS/KILL_SERVERS");
131}
132
133void MainWindow::on_fShutdownAll_clicked()
134{
135 Dim::SendCommand("DIS_DNS/KILL_SERVERS");
136 Dim::SendCommand("DIS_DNS/EXIT", int(1));
137}
138
139void MainWindow::on_fTabWidget_tabCloseRequested(int which)
140{
141 // To get the correct size we have to switch to this tab
142 // An alternative would be to take the size of the current tab
143 fTabWidget->setCurrentIndex(which);
144
145 QWidget *w = fTabWidget->currentWidget(); //fTabWidget->widget(which);
146 if (!w)
147 {
148 cout << "Weird... the tab requested to be closed doesn't exist!" << endl;
149 return;
150 }
151
152 QDockWidget *d = w->findChild<QDockWidget*>();
153 if (!d)
154 {
155 cout << "Sorry, tab requested to be closed contains no QDockWidget!" << endl;
156 return;
157 }
158
159 new DockWindow(d, fTabWidget->tabText(which));
160 fTabWidget->removeTab(which);
161
162 if (fTabWidget->count()==1)
163 fTabWidget->setTabsClosable(false);
164}
165
166void MainWindow::on_fMcpStartRun_clicked()
167{
168 struct Value
169 {
170 uint64_t time;
171 uint64_t nevts;
172 char type[];
173 };
174
175 const int idx1 = fMcpRunType->currentIndex();
176 const int idx2 = fMcpTime->currentIndex();
177 const int idx3 = fMcpNumEvents->currentIndex();
178
179 const int64_t v2 = fMcpTime->itemData(idx2).toInt();
180 const int64_t v3 = fMcpNumEvents->itemData(idx3).toInt();
181
182 const QString rt = fMcpRunType->itemData(idx1).toString();
183
184 const size_t len = sizeof(Value)+rt.length()+1;
185
186 char *buf = new char[len];
187
188 Value *val = reinterpret_cast<Value*>(buf);
189
190 val->time = v2;
191 val->nevts = v3;
192
193 strcpy(val->type, rt.toStdString().c_str());
194
195 Dim::SendCommand("MCP/START", buf, len);
196
197 delete [] buf;
198
199}
200void MainWindow::on_fMcpStopRun_clicked()
201{
202 Dim::SendCommand("MCP/STOP");
203}
204
205void MainWindow::on_fMcpReset_clicked()
206{
207 Dim::SendCommand("MCP/RESET");
208}
209
210void MainWindow::on_fLoggerStart_clicked()
211{
212 Dim::SendCommand("DATA_LOGGER/START_RUN_LOGGING");
213}
214
215void MainWindow::on_fLoggerStop_clicked()
216{
217 Dim::SendCommand("DATA_LOGGER/STOP_RUN_LOGGING");
218}
219
220void MainWindow::on_fFtmStartRun_clicked()
221{
222 Dim::SendCommand("FTM_CONTROL/START_TRIGGER");
223}
224
225void MainWindow::on_fFtmStopRun_clicked()
226{
227 Dim::SendCommand("FTM_CONTROL/STOP_TRIGGER");
228}
229
230void MainWindow::on_fFadStartRun_clicked()
231{
232 Dim::SendCommand("FAD_CONTROL/START_RUN");
233}
234
235void MainWindow::on_fFadStopRun_clicked()
236{
237 Dim::SendCommand("FAD_CONTROL/STOP_RUN");
238}
239
240void MainWindow::on_fFadDrsOn_clicked()
241{
242 Dim::SendCommand("FAD_CONTROL/ENABLE_DRS", uint8_t(true));
243}
244
245void MainWindow::on_fFadDrsOff_clicked()
246{
247 Dim::SendCommand("FAD_CONTROL/ENABLE_DRS", uint8_t(false));
248}
249
250void MainWindow::on_fFadDwriteOn_clicked()
251{
252 Dim::SendCommand("FAD_CONTROL/ENABLE_DWRITE", uint8_t(true));
253}
254
255void MainWindow::on_fFadDwriteOff_clicked()
256{
257 Dim::SendCommand("FAD_CONTROL/ENABLE_DWRITE", uint8_t(false));
258}
259
260void MainWindow::on_fFadSingleTrigger_clicked()
261{
262 Dim::SendCommand("FAD_CONTROL/SEND_SINGLE_TRIGGER");
263}
264
265void MainWindow::on_fFadTriggerLineOn_clicked()
266{
267 Dim::SendCommand("FAD_CONTROL/ENABLE_TRIGGER_LINE", uint8_t(true));
268}
269
270void MainWindow::on_fFadTriggerLineOff_clicked()
271{
272 Dim::SendCommand("FAD_CONTROL/ENABLE_TRIGGER_LINE", uint8_t(false));
273}
274
275void MainWindow::on_fFadContTriggerOn_clicked()
276{
277 Dim::SendCommand("FAD_CONTROL/ENABLE_CONTINOUS_TRIGGER", uint8_t(true));
278}
279
280void MainWindow::on_fFadContTriggerOff_clicked()
281{
282 Dim::SendCommand("FAD_CONTROL/ENABLE_CONTINOUS_TRIGGER", uint8_t(false));
283}
284
285void MainWindow::on_fFadBusyOnOn_clicked()
286{
287 Dim::SendCommand("FAD_CONTROL/ENABLE_BUSY_ON", uint8_t(true));
288}
289
290void MainWindow::on_fFadBusyOnOff_clicked()
291{
292 Dim::SendCommand("FAD_CONTROL/ENABLE_BUSY_ON", uint8_t(false));
293}
294
295void MainWindow::on_fFadBusyOffOn_clicked()
296{
297 Dim::SendCommand("FAD_CONTROL/ENABLE_BUSY_OFF", uint8_t(true));
298}
299
300void MainWindow::on_fFadBusyOffOff_clicked()
301{
302 Dim::SendCommand("FAD_CONTROL/ENABLE_BUSY_OFF", uint8_t(false));
303}
304
305void MainWindow::on_fFadSocket0_clicked()
306{
307 Dim::SendCommand("FAD_CONTROL/ENABLE_COMMAND_SOCKET_MODE", uint8_t(true));
308}
309
310void MainWindow::on_fFadSocket17_clicked()
311{
312 Dim::SendCommand("FAD_CONTROL/ENABLE_COMMAND_SOCKET_MODE", uint8_t(false));
313}
314
315void MainWindow::on_fFadResetTriggerId_clicked()
316{
317 Dim::SendCommand("FAD_CONTROL/RESET_EVENT_COUNTER");
318}
319
320void MainWindow::on_fFadStart_clicked()
321{
322 Dim::SendCommand("FAD_CONTROL/START");
323}
324
325void MainWindow::on_fFadStop_clicked()
326{
327 Dim::SendCommand("FAD_CONTROL/STOP");
328}
329
330void MainWindow::on_fFadAbort_clicked()
331{
332 Dim::SendCommand("FAD_CONTROL/ABORT");
333}
334
335void MainWindow::on_fFadSoftReset_clicked()
336{
337 Dim::SendCommand("FAD_CONTROL/SOFT_RESET");
338}
339
340void MainWindow::on_fFadHardReset_clicked()
341{
342 Dim::SendCommand("FAD_CONTROL/HARD_RESET");
343}
344
345void MainWindow::slot_fFadLED_clicked()
346{
347 for (int32_t i=0; i<40; i++)
348 if (sender()==fFadLED[i])
349 {
350 Dim::SendCommand("FAD_CONTROL/TOGGLE", i);
351 break;
352 }
353}
354
355void MainWindow::on_fFadPrescalerCmd_valueChanged(int val)
356{
357 Dim::SendCommand("FAD_CONTROL/SET_TRIGGER_RATE", uint32_t(val));
358}
359
360void MainWindow::on_fFadRunNumberCmd_valueChanged(int val)
361{
362 Dim::SendCommand("FAD_CONTROL/SET_RUN_NUMBER", uint64_t(val));
363}
364
365void MainWindow::on_fFadRoiCmd_valueChanged(int)
366{
367 const int32_t vals1[2] = { -1, fFadRoiCmd->value() };
368 Dim::SendCommand("FAD_CONTROL/SET_REGION_OF_INTEREST", vals1);
369
370 for (int ch=8; ch<36; ch+=9)
371 {
372 const int32_t vals2[2] = { ch, fFadRoiCh9Cmd->value() };
373 Dim::SendCommand("FAD_CONTROL/SET_REGION_OF_INTEREST", vals2);
374 }
375}
376
377void MainWindow::FadDacCmd_valueChanged(uint16_t val, uint16_t idx)
378{
379 const uint32_t cmd[2] = { idx, val };
380 Dim::SendCommand("FAD_CONTROL/SET_DAC_VALUE", cmd);
381}
382
383void MainWindow::SetTriggerSequence()
384{
385 const uint16_t d[3] =
386 {
387 uint16_t(fTriggerSeqPed->value()),
388 uint16_t(fTriggerSeqLPext->value()),
389 uint16_t(fTriggerSeqLPint->value())
390 };
391
392 if (!fInHandler)
393 Dim::SendCommand("FTM_CONTROL/SET_TRIGGER_SEQUENCE", d);
394}
395
396void on_fEnableTrigger_clicked(bool b)
397{
398 Dim::SendCommand("FTM_CONTROL/ENABLE_TRIGGER", b);
399}
400
401void on_fEnableExt1_clicked(bool b)
402{
403 Dim::SendCommand("FTM_CONTROL/ENABLE_EXT1", b);
404}
405
406void on_fEnableExt2_clicked(bool b)
407{
408 Dim::SendCommand("FTM_CONTROL/ENABLE_EXT2", b);
409}
410
411void on_fEnableVeto_clicked(bool b)
412{
413 Dim::SendCommand("FTM_CONTROL/ENABLE_VETO", b);
414}
415
416void MainWindow::on_fPhysicsCoincidence_valueChanged(int v)
417{
418 if (!fInHandler)
419 Dim::SendCommand("FTM_CONTROL/SET_TRIGGER_MULTIPLICITY", v);
420}
421
422void MainWindow::on_fPhysicsWindow_valueChanged(int v)
423{
424 if (!fInHandler)
425 Dim::SendCommand("FTM_CONTROL/SET_TRIGGER_WINDOW", v/4-2);
426}
427
428void MainWindow::on_fCalibCoincidence_valueChanged(int v)
429{
430 if (!fInHandler)
431 Dim::SendCommand("FTM_CONTROL/SET_CALIBRATION_MULTIPLICITY", v);
432}
433
434void MainWindow::on_fCalibWindow_valueChanged(int v)
435{
436 if (!fInHandler)
437 Dim::SendCommand("FTM_CONTROL/SET_CALIBRATION_WINDOW", v/4-2);
438}
439
440void MainWindow::on_fTriggerInterval_valueChanged(int val)
441{
442 if (!fInHandler)
443 Dim::SendCommand("FTM_CONTROL/SET_TRIGGER_INTERVAL", val);
444}
445
446void MainWindow::on_fTriggerDelay_valueChanged(int val)
447{
448 if (!fInHandler)
449 Dim::SendCommand("FTM_CONTROL/SET_TRIGGER_DELAY", val/4-2);
450}
451
452void MainWindow::on_fTimeMarkerDelay_valueChanged(int val)
453{
454 if (!fInHandler)
455 Dim::SendCommand("FTM_CONTROL/SET_TIME_MARKER_DELAY", val/4-2);
456}
457
458void MainWindow::on_fDeadTime_valueChanged(int val)
459{
460 if (!fInHandler)
461 Dim::SendCommand("FTM_CONTROL/SET_DEAD_TIME", val/4-2);
462}
463
464void MainWindow::on_fPrescalingVal_valueChanged(int val)
465{
466 if (!fInHandler)
467 Dim::SendCommand("FTM_CONTROL/SET_PRESCALING", val);
468}
469
470void MainWindow::on_fPixelEnableAll_clicked()
471{
472 Dim::SendCommand("FTM_CONTROL/ENABLE_PIXEL", int16_t(-1));
473}
474
475void MainWindow::on_fPixelDisableAll_clicked()
476{
477 Dim::SendCommand("FTM_CONTROL/DISABLE_PIXEL", int16_t(-1));
478}
479
480void MainWindow::on_fEnableTrigger_stateChanged(int b)
481{
482 if (!fInHandler)
483 Dim::SendCommand("FTM_CONTROL/ENABLE_TRIGGER", b==Qt::Checked);
484}
485
486void MainWindow::on_fEnableExt1_stateChanged(int b)
487{
488 if (!fInHandler)
489 Dim::SendCommand("FTM_CONTROL/ENABLE_EXT1", b==Qt::Checked);
490}
491
492void MainWindow::on_fEnableExt2_stateChanged(int b)
493{
494 if (!fInHandler)
495 Dim::SendCommand("FTM_CONTROL/ENABLE_EXT2", b==Qt::Checked);
496}
497
498void MainWindow::on_fEnableClockCond_stateChanged(int b)
499{
500 if (!fInHandler)
501 Dim::SendCommand("FTM_CONTROL/ENABLE_CLOCK_CONDITIONER", b==Qt::Checked);
502}
503
504void MainWindow::on_fEnableVeto_stateChanged(int b)
505{
506 if (!fInHandler)
507 Dim::SendCommand("FTM_CONTROL/ENABLE_VETO", b==Qt::Checked);
508}
509
510void MainWindow::on_fClockCondFreq_activated(int idx)
511{
512 if (!fInHandler)
513 Dim::SendCommand("FTM_CONTROL/SET_CLOCK_FREQUENCY", fClockCondFreq->itemData(idx).toInt());
514}
515
516void MainWindow::slot_fFtuLED_clicked()
517{
518 for (int32_t i=0; i<40; i++)
519 if (sender()==fFtuLED[i])
520 {
521 Dim::SendCommand("FTM_CONTROL/TOGGLE_FTU", i);
522 break;
523 }
524}
525
526void MainWindow::on_fFtuPing_toggled(bool checked)
527{
528 if (checked)
529 Dim::SendCommand("FTM_CONTROL/PING");
530}
531
532void MainWindow::on_fFtuAllOn_clicked()
533{
534 static const struct Data { int32_t id; char on; } __attribute__((__packed__)) d = { -1, 1 };
535 Dim::SendCommand("FTM_CONTROL/ENABLE_FTU", &d, sizeof(d));
536}
537
538void MainWindow::on_fFtuAllOff_clicked()
539{
540 static const struct Data { int32_t id; char on; } __attribute__((__packed__)) d = { -1, 0 };
541 Dim::SendCommand("FTM_CONTROL/ENABLE_FTU", &d, sizeof(d));
542}
543
544void MainWindow::on_fLpIntIntensity_valueChanged(int val)
545{
546 if (!fInHandler)
547 Dim::SendCommand("FTM_CONTROL/SET_INTENSITY_LPINT", uint16_t(val));
548}
549
550void MainWindow::on_fLpExtIntensity_valueChanged(int val)
551{
552 if (!fInHandler)
553 Dim::SendCommand("FTM_CONTROL/SET_INTENSITY_LPEXT", uint16_t(val));
554}
555
556void MainWindow::on_fLpIntGroup1_stateChanged(int b)
557{
558 if (!fInHandler)
559 Dim::SendCommand("FTM_CONTROL/ENABLE_GROUP1_LPINT", uint8_t(b));
560}
561
562void MainWindow::on_fLpExtGroup1_stateChanged(int b)
563{
564 if (!fInHandler)
565 Dim::SendCommand("FTM_CONTROL/ENABLE_GROUP1_LPEXT", uint8_t(b));
566}
567
568void MainWindow::on_fLpIntGroup2_stateChanged(int b)
569{
570 if (!fInHandler)
571 Dim::SendCommand("FTM_CONTROL/ENABLE_GROUP2_LPINT", uint8_t(b));
572}
573
574void MainWindow::on_fLpExtGroup2_stateChanged(int b)
575{
576 if (!fInHandler)
577 Dim::SendCommand("FTM_CONTROL/ENABLE_GROUP2_LPEXT", uint8_t(b));
578}
579
580void MainWindow::on_fFeedbackDevMin_valueChanged(int min)
581{
582 fFeedbackDevCam->SetMin(min);
583 fFeedbackDevCam->updateCamera();
584}
585
586void MainWindow::on_fFeedbackDevMax_valueChanged(int max)
587{
588 fFeedbackDevCam->SetMax(max);
589 fFeedbackDevCam->updateCamera();
590}
591
592void MainWindow::on_fFeedbackCmdMin_valueChanged(int min)
593{
594 fFeedbackCmdCam->SetMin(min);
595 fFeedbackCmdCam->updateCamera();
596}
597
598void MainWindow::on_fFeedbackCmdMax_valueChanged(int max)
599{
600 fFeedbackCmdCam->SetMax(max);
601 fFeedbackCmdCam->updateCamera();
602}
603
604void MainWindow::on_fFeedbackTempStart_clicked()
605{
606 Dim::SendCommand("FEEDBACK/START_TEMP_CONTROL",
607 (float)fFeedbackTempOffset->value());
608}
609
610void MainWindow::on_fFeedbackOutputEnable_clicked()
611{
612 Dim::SendCommand("FEEDBACK/ENABLE_OUTPUT", uint8_t(1));
613}
614
615void MainWindow::on_fFeedbackOutputDisable_clicked()
616{
617 Dim::SendCommand("FEEDBACK/ENABLE_OUTPUT", uint8_t(0));
618}
619
620void MainWindow::on_fFeedbackStop_clicked()
621{
622 Dim::SendCommand("FEEDBACK/STOP");
623}
624
625void MainWindow::on_fFeedbackCalibrate_clicked()
626{
627 Dim::SendCommand("FEEDBACK/CALIBRATE_CURRENTS");
628}
629
630void MainWindow::on_fBiasVoltDac_valueChanged(int val)
631{
632 fBiasVolt->setValue(val*90./4096);
633}
634
635void MainWindow::on_fBiasOffsetDac_valueChanged(int val)
636{
637 fBiasOffsetVolt->setValue(val*90./4096);
638}
639
640/*
641void MainWindow::on_fBiasRequestStatus_clicked()
642{
643 if (!fInHandler)
644 Dim::SendCommand("BIAS_CONTROL/REQUEST_STATUS");
645}
646*/
647
648void MainWindow::on_fBiasApplyReference_clicked()
649{
650 if (!fInHandler)
651 Dim::SendCommand("BIAS_CONTROL/SET_GLOBAL_GAPD_REFERENCE_VOLTAGE");
652}
653
654void MainWindow::on_fBiasApplyReferenceCh_clicked()
655{
656 if (!fInHandler)
657 Dim::SendCommand("BIAS_CONTROL/SET_CHANNEL_GAPD_REFERENCE_VOLTAGE",
658 uint16_t(fBiasHvBoard->value()*32+fBiasHvChannel->value()));
659}
660
661void MainWindow::on_fBiasSetToZero_clicked()
662{
663 if (!fInHandler)
664 Dim::SendCommand("BIAS_CONTROL/SET_ZERO_VOLTAGE");
665}
666
667void MainWindow::on_fBiasReset_clicked()
668{
669 if (!fInHandler)
670 Dim::SendCommand("BIAS_CONTROL/RESET_OVER_CURRENT_STATUS");
671}
672
673void MainWindow::on_fBiasAddOffset_clicked()
674{
675 if (fInHandler)
676 return;
677
678 if (fBiasOffsetDac->value()<0)
679 Dim::SendCommand("BIAS_CONTROL/DECREASE_GLOBAL_DAC", uint16_t(-fBiasOffsetDac->value()));
680 else
681 Dim::SendCommand("BIAS_CONTROL/INCREASE_GLOBAL_DAC", uint16_t(fBiasOffsetDac->value()));
682}
683
684void MainWindow::on_fBiasApplyOffset_clicked()
685{
686 if (!fInHandler)
687 Dim::SendCommand("BIAS_CONTROL/SET_GAPD_REFERENCE_OFFSET", float(fBiasOffsetDac->value()*90./4096));
688}
689
690void MainWindow::on_fBiasApply_clicked()
691{
692 const uint16_t cmd[2] =
693 {
694 uint16_t(fBiasHvBoard->value()*32+fBiasHvChannel->value()),
695 uint16_t(fBiasVoltDac->value())
696 };
697
698 if (!fInHandler)
699 Dim::SendCommand("BIAS_CONTROL/SET_CHANNEL_DAC", cmd);
700}
701void MainWindow::on_fBiasApplyGlobal_clicked()
702{
703 if (!fInHandler)
704 Dim::SendCommand("BIAS_CONTROL/SET_GLOBAL_DAC", uint16_t(fBiasVoltDac->value()));
705}
706
707void MainWindow::on_fBiasVoltMin_valueChanged(int min)
708{
709 fBiasCamV->SetMin(min);
710 fBiasCamV->updateCamera();
711}
712
713void MainWindow::on_fBiasVoltMax_valueChanged(int max)
714{
715 fBiasCamV->SetMax(max);
716 fBiasCamV->updateCamera();
717}
718
719void MainWindow::on_fBiasCurrentMin_valueChanged(int min)
720{
721 fBiasCamA->SetMin(min);
722 fBiasCamA->updateCamera();
723}
724
725void MainWindow::on_fBiasCurrentMax_valueChanged(int max)
726{
727 fBiasCamA->SetMax(max);
728 fBiasCamA->updateCamera();
729}
730
731void MainWindow::on_fChatSend_clicked()
732{
733 const string msg = fChatMessage->text().toStdString();
734 if (Dim::SendCommand("CHAT/MSG", msg.c_str(), msg.length()+1))
735 fChatMessage->clear();
736}
737
738void MainWindow::on_fStatusLoggerLed_clicked()
739{
740 SelectTab("Logger");
741}
742
743void MainWindow::on_fStatusChatLed_clicked()
744{
745 SelectTab("Chat");
746}
747
748void MainWindow::on_fStatusFTMLed_clicked()
749{
750 SelectTab("Trigger");
751}
752
753void MainWindow::on_fStatusFTULed_clicked()
754{
755 SelectTab("FTUs");
756}
757
758void MainWindow::on_fStatusFADLed_clicked()
759{
760 SelectTab("FAD");
761}
Note: See TracBrowser for help on using the repository browser.