3583 fDimDNS(
"DIS_DNS/VERSION_NUMBER", 1,
int(0),
this),
3592 fDimFtmError (
"FTM_CONTROL/ERROR", (
void*)NULL, 0,
this),
3600 fDimFadRuns (
"FAD_CONTROL/RUNS", (
void*)NULL, 0,
this),
3607 fDimFadDNA (
"FAD_CONTROL/DNA", (
void*)NULL, 0,
this),
3610 fDimFadRefClock (
"FAD_CONTROL/REFERENCE_CLOCK", (
void*)NULL, 0,
this),
3611 fDimFadRoi (
"FAD_CONTROL/REGION_OF_INTEREST", (
void*)NULL, 0,
this),
3612 fDimFadDac (
"FAD_CONTROL/DAC", (
void*)NULL, 0,
this),
3619 fDimFscTemp (
"FSC_CONTROL/TEMPERATURE", (
void*)NULL, 0,
this),
3620 fDimFscVolt (
"FSC_CONTROL/VOLTAGE", (
void*)NULL, 0,
this),
3627 fDimBiasVolt (
"BIAS_CONTROL/VOLTAGE", (
void*)NULL, 0,
this),
3628 fDimBiasDac (
"BIAS_CONTROL/DAC", (
void*)NULL, 0,
this),
3641 fClockCondFreq->addItem(
"--- Hz", QVariant(-1));
3642 fClockCondFreq->addItem(
"800 MHz", QVariant(800));
3643 fClockCondFreq->addItem(
"1 GHz", QVariant(1000));
3644 fClockCondFreq->addItem(
"2 GHz", QVariant(2000));
3645 fClockCondFreq->addItem(
"3 GHz", QVariant(3000));
3646 fClockCondFreq->addItem(
"4 GHz", QVariant(4000));
3647 fClockCondFreq->addItem(
"5 GHz", QVariant(5000));
3649 cout <<
"-- run counter ---" << endl;
3650 fMcpNumEvents->addItem(
"unlimited", QVariant(0));
3651 const vector<uint32_t> runcount = conf.
Vec<uint32_t>(
"run-count");
3652 for (vector<uint32_t>::const_iterator it=runcount.begin(); it!=runcount.end(); it++)
3654 cout << *it << endl;
3657 fMcpNumEvents->addItem(str.str().c_str(), QVariant(*it));
3660 cout <<
"-- run times ---" << endl;
3661 fMcpTime->addItem(
"unlimited", QVariant(0));
3662 const vector<string> runtime = conf.
Vec<
string>(
"run-time");
3663 for (vector<string>::const_iterator it=runtime.begin(); it!=runtime.end(); it++)
3665 const pair<string,string> p =
Split(*it);
3666 cout << *it <<
"|" << p.second <<
"|" << p.first <<
"|" << endl;
3667 fMcpTime->addItem(p.second.c_str(), QVariant(stoi(p.first)));
3670 cout <<
"-- run types ---" << endl;
3671 const vector<string> runtype = conf.
Vec<
string>(
"run-type");
3672 for (vector<string>::const_iterator it=runtype.begin(); it!=runtype.end(); it++)
3674 const pair<string,string> p =
Split(*it);
3675 cout << *it <<
"|" << p.second <<
"|" << p.first <<
"|" << endl;
3676 fMcpRunType->addItem(p.second.c_str(), QVariant(p.first.c_str()));
3679 fTriggerWidget->setEnabled(
false);
3680 fFtuWidget->setEnabled(
false);
3681 fFtuGroupEnable->setEnabled(
false);
3682 fRatesControls->setEnabled(
false);
3683 fFadWidget->setEnabled(
false);
3684 fGroupEthernet->setEnabled(
false);
3685 fGroupOutput->setEnabled(
false);
3686 fLoggerWidget->setEnabled(
false);
3687 fBiasWidget->setEnabled(
false);
3688 fAuxWidget->setEnabled(
false);
3690 fChatSend->setEnabled(
false);
3691 fChatMessage->setEnabled(
false);
3700 cerr <<
"ERROR - Problems reading " << conf.
Get<
string>(
"pixel-map-file") << endl;
3706 ifstream fin3(
"PatchList.txt");
3711 while (getline(fin3, buf,
'\n'))
3717 unsigned int softid, hardid;
3719 stringstream
str(buf);
3733 cerr <<
"WARNING - Problems reading PatchList.txt" << endl;
3737 fCommentsWidget->setEnabled(
false);
3739 static const boost::regex expr(
"(([[:word:].-]+)(:(.+))?@)?([[:word:].-]+)(:([[:digit:]]+))?(/([[:word:].-]+))");
3741 const string database = conf.
Get<
string>(
"CommentDB");
3743 if (!database.empty())
3746 if (!boost::regex_match(database, what, expr, boost::match_extra))
3747 throw runtime_error(
"Couldn't parse '"+database+
"'.");
3749 if (what.size()!=10)
3750 throw runtime_error(
"Error parsing '"+database+
"'.");
3752 const string user = what[2];
3753 const string passwd = what[4];
3754 const string server = what[5];
3755 const string db = what[9];
3756 const int port = atoi(
string(what[7]).c_str());
3758 QSqlDatabase qdb = QSqlDatabase::addDatabase(
"QMYSQL");
3759 qdb.setHostName(server.c_str());
3760 qdb.setDatabaseName(db.c_str());
3761 qdb.setUserName(user.c_str());
3762 qdb.setPassword(passwd.c_str());
3764 qdb.setConnectOptions(
"CLIENT_SSL=1;MYSQL_OPT_RECONNECT=1");
3767 QSqlTableModel *model =
new QSqlTableModel(fTableComments, qdb);
3768 model->setTable(
"runcomments");
3769 model->setEditStrategy(QSqlTableModel::OnManualSubmit);
3771 const bool ok2 = model->select();
3775 fTableComments->setModel(model);
3776 fTableComments->resizeColumnsToContents();
3777 fTableComments->resizeRowsToContents();
3779 connect(fCommentSubmit, SIGNAL(clicked()), model, SLOT(submitAll()));
3780 connect(fCommentRevert, SIGNAL(clicked()), model, SLOT(revertAll()));
3781 connect(fCommentUpdateLayout, SIGNAL(clicked()), fTableComments, SLOT(resizeColumnsToContents()));
3782 connect(fCommentUpdateLayout, SIGNAL(clicked()), fTableComments, SLOT(resizeRowsToContents()));
3784 fCommentsWidget->setEnabled(
true);
3787 cout <<
"\n==> ERROR: Select on table failed.\n" << endl;
3790 cout <<
"\n==> ERROR: Connection to database failed:\n " 3791 << qdb.lastError().text().toStdString() << endl << endl;
3797 fGraphFeedbackDev.SetLineColor(
kBlue);
3798 fGraphFeedbackDev.SetMarkerColor(
kBlue);
3799 fGraphFeedbackDev.SetMarkerStyle(kFullDotMedium);
3801 fGraphFeedbackCmd.SetLineColor(
kBlue);
3802 fGraphFeedbackCmd.SetMarkerColor(
kBlue);
3803 fGraphFeedbackCmd.SetMarkerStyle(kFullDotMedium);
3807 fGraphFeedbackDev.SetName(
"ControlDev");
3808 fGraphFeedbackCmd.SetName(
"CommandVal");
3810 TCanvas *c = fFeedbackDev->GetCanvas();
3811 c->SetBorderMode(0);
3812 c->SetFrameBorderMode(0);
3814 c->SetRightMargin(0.03);
3815 c->SetTopMargin(0.03);
3818 TH1 *hf = DrawTimeFrame(
"Overvoltage [V] ");
3819 hf->GetXaxis()->SetLabelSize(0.07);
3820 hf->GetYaxis()->SetLabelSize(0.07);
3821 hf->GetYaxis()->SetTitleSize(0.08);
3822 hf->GetYaxis()->SetTitleOffset(0.55);
3823 hf->GetXaxis()->SetTitle(
"");
3824 hf->GetYaxis()->SetRangeUser(0, 1.5);
3826 c->GetListOfPrimitives()->Add(hf,
"");
3827 c->GetListOfPrimitives()->Add(&fGraphFeedbackDev,
"LP");
3829 c = fFeedbackCmd->GetCanvas();
3830 c->SetBorderMode(0);
3831 c->SetFrameBorderMode(0);
3833 c->SetRightMargin(0.03);
3834 c->SetTopMargin(0.03);
3837 hf = DrawTimeFrame(
"Command temp delta [V] ");
3838 hf->GetXaxis()->SetLabelSize(0.07);
3839 hf->GetYaxis()->SetLabelSize(0.07);
3840 hf->GetYaxis()->SetTitleSize(0.08);
3841 hf->GetYaxis()->SetTitleOffset(0.55);
3842 hf->GetXaxis()->SetTitle(
"");
3843 hf->GetYaxis()->SetRangeUser(-2, 2);
3845 c->GetListOfPrimitives()->Add(hf,
"");
3846 c->GetListOfPrimitives()->Add(&fGraphFeedbackCmd,
"LP");
3850 c = fRateScanCanv->GetCanvas();
3852 c->SetBorderMode(0);
3853 c->SetFrameBorderMode(0);
3855 c->SetRightMargin(0.03);
3856 c->SetTopMargin(0.03);
3859 TH1F *h=
new TH1F(
"Frame",
"", 1, 0, 1);
3861 h->SetBit(kCanDelete);
3862 h->SetStats(kFALSE);
3863 h->SetXTitle(
"Threshold [DAC]");
3864 h->SetYTitle(
"Rate [Hz]");
3865 h->GetXaxis()->CenterTitle();
3866 h->GetYaxis()->CenterTitle();
3867 h->GetXaxis()->SetLabelSize(0.025);
3868 h->GetYaxis()->SetLabelSize(0.025);
3869 h->GetYaxis()->SetTitleOffset(1.2);
3870 c->GetListOfPrimitives()->Add(h,
"");
3873 for (
int i=0;
i<40;
i++)
3878 for (
int i=0;
i<160;
i++)
3891 c = fFtmRateCanv->GetCanvas();
3893 c->SetBorderMode(0);
3894 c->SetFrameBorderMode(0);
3896 c->SetRightMargin(0.03);
3897 c->SetTopMargin(0.03);
3900 hf = DrawTimeFrame(
"Trigger rate [Hz]");
3901 hf->GetYaxis()->SetRangeUser(0, 1010);
3903 for (
int i=0;
i<160;
i++)
3910 for (
int i=0;
i<40;
i++)
3922 c->GetListOfPrimitives()->Add(hf,
"");
3957 c = fAdcDataCanv->GetCanvas();
3959 c->SetBorderMode(0);
3960 c->SetFrameBorderMode(0);
3962 c->SetRightMargin(0.10);
3968 fFeedbackDevCam->assignPixelMap(
fPixelMap);
3969 fFeedbackDevCam->setAutoscaleLowerLimit((fFeedbackDevMin->minimum()+0.5*fFeedbackDevMin->singleStep()));
3970 fFeedbackDevCam->SetMin(fFeedbackDevMin->value());
3971 fFeedbackDevCam->SetMax(fFeedbackDevMax->value());
3972 fFeedbackDevCam->updateCamera();
3974 fFeedbackCmdCam->assignPixelMap(
fPixelMap);
3975 fFeedbackCmdCam->setAutoscaleLowerLimit((fFeedbackCmdMin->minimum()+0.5*fFeedbackCmdMin->singleStep()));
3976 fFeedbackCmdCam->SetMin(fFeedbackCmdMin->value());
3977 fFeedbackCmdCam->SetMax(fFeedbackCmdMax->value());
3978 fFeedbackCmdCam->updateCamera();
3983 fBiasCamV->setAutoscaleLowerLimit((fBiasVoltMin->minimum()+0.5*fBiasVoltMin->singleStep()));
3984 fBiasCamV->SetMin(fBiasVoltMin->value());
3985 fBiasCamV->SetMax(fBiasVoltMax->value());
3986 fBiasCamV->updateCamera();
3989 fBiasCamA->setAutoscaleLowerLimit((fBiasCurrentMin->minimum()+0.5*fBiasCurrentMin->singleStep()));
3990 fBiasCamA->SetMin(fBiasCurrentMin->value());
3991 fBiasCamA->SetMax(fBiasCurrentMax->value());
3992 fBiasCamA->updateCamera();
3997 fRatesCanv->setAutoscaleLowerLimit((fRatesMin->minimum()+0.5*fRatesMin->singleStep())*0.001);
3998 fRatesCanv->SetMin(fRatesMin->value());
3999 fRatesCanv->SetMax(fRatesMax->value());
4000 fRatesCanv->updateCamera();
4005 fRatesCanv->setTitle(
"Patch rates");
4006 fRatesCanv->setUnits(
"Hz");
4008 fBiasCamA->setTitle(
"BIAS current");
4009 fBiasCamA->setUnits(
"uA");
4011 fBiasCamV->setTitle(
"Applied BIAS voltage");
4012 fBiasCamV->setUnits(
"V");
4014 fEventCanv1->setTitle(
"Average (all slices)");
4015 fEventCanv2->setTitle(
"RMS (all slices)");
4016 fEventCanv3->setTitle(
"Maximum (all slices)");
4017 fEventCanv4->setTitle(
"Position of maximum (all slices)");
4019 fEventCanv1->setUnits(
"mV");
4020 fEventCanv2->setUnits(
"mV");
4021 fEventCanv3->setUnits(
"mV");
4022 fEventCanv4->setUnits(
"slice");
4026 fFeedbackDevCam->setTitle(
"Control deviation (Pulser amplitude voltage)");
4027 fFeedbackCmdCam->setTitle(
"Applied voltage change (BIAS voltage)");
4029 fFeedbackDevCam->setUnits(
"mV");
4030 fFeedbackCmdCam->setUnits(
"mV");
4039 fFtmRateCanv->setMouseTracking(
true);
4040 fFtmRateCanv->EnableSignalEvents(kMouseMoveEvent);
4042 fAdcDataCanv->setMouseTracking(
true);
4043 fAdcDataCanv->EnableSignalEvents(kMouseMoveEvent);
4045 fRatesCanv->setMouseTracking(
true);
4046 fEventCanv1->setMouseTracking(
true);
4047 fEventCanv2->setMouseTracking(
true);
4048 fEventCanv3->setMouseTracking(
true);
4049 fEventCanv4->setMouseTracking(
true);
4051 fBiasCamV->setMouseTracking(
true);
4052 fBiasCamA->setMouseTracking(
true);
4054 fFeedbackDevCam->setMouseTracking(
true);
4055 fFeedbackCmdCam->setMouseTracking(
true);
4057 fEventCanv1->ShowPixelCursor(
true);
4058 fEventCanv2->ShowPixelCursor(
true);
4059 fEventCanv3->ShowPixelCursor(
true);
4060 fEventCanv4->ShowPixelCursor(
true);
4062 fEventCanv1->ShowPatchCursor(
true);
4063 fEventCanv2->ShowPatchCursor(
true);
4064 fEventCanv3->ShowPatchCursor(
true);
4065 fEventCanv4->ShowPatchCursor(
true);
4067 fFeedbackDevCam->ShowPixelCursor(
true);
4068 fFeedbackCmdCam->ShowPixelCursor(
true);
4070 fFeedbackDevCam->ShowPatchCursor(
true);
4071 fFeedbackCmdCam->ShowPatchCursor(
true);
4073 connect(fRatesCanv, SIGNAL(signalPixelMoveOver(
int)),
4075 connect(fEventCanv1, SIGNAL(signalPixelMoveOver(
int)),
4077 connect(fEventCanv2, SIGNAL(signalPixelMoveOver(
int)),
4079 connect(fEventCanv3, SIGNAL(signalPixelMoveOver(
int)),
4081 connect(fEventCanv4, SIGNAL(signalPixelMoveOver(
int)),
4084 connect(fBiasCamV, SIGNAL(signalPixelMoveOver(
int)),
4086 connect(fBiasCamA, SIGNAL(signalPixelMoveOver(
int)),
4089 connect(fFeedbackDevCam, SIGNAL(signalPixelMoveOver(
int)),
4091 connect(fFeedbackCmdCam, SIGNAL(signalPixelMoveOver(
int)),
4094 connect(fRatesCanv, SIGNAL(signalPixelDoubleClick(
int)),
4096 connect(fRatesCanv, SIGNAL(signalCurrentPixel(
int)),
4098 connect(fBiasCamV, SIGNAL(signalCurrentPixel(
int)),
4100 connect(fBiasCamA, SIGNAL(signalCurrentPixel(
int)),
4103 connect(fFtmRateCanv, SIGNAL( RootEventProcessed(TObject*,
unsigned int, TCanvas*)),
4105 connect(fAdcDataCanv, SIGNAL( RootEventProcessed(TObject*,
unsigned int, TCanvas*)),
static int sendCommand(const char *name, int data)
DimStampedInfo fDimFadDNA
DimStampedInfo fDimLoggerStats
DimStampedInfo fDimFtmStaticData
DimStampedInfo fDimFadRawData
TGraph fGraphPatchRate[160]
void slot_CameraDoubleClick(int isw)
DimStampedInfo fDimFadDrsCalibration
virtual void slot_RootEventProcessed(TObject *, unsigned int, TCanvas *)=0
DimStampedInfo fDimFeedbackCalibrated
DimStampedInfo fDimBiasVolt
T Get(const std::string &var)
void slot_ChoosePixelThreshold(int isw)
DimStampedInfo fDimFadRunNumber
pair< string, string > Split(const string &str) const
DimStampedInfo fDimFscCurrent
std::vector< T > Vec(const std::string &var)
DimStampedInfo fDimFadFileFormat
DimStampedInfo fDimFtmTriggerRates
DimStampedInfo fDimBiasDac
DimStampedInfo fDimFadStartRun
DimStampedInfo fDimFadStatistics1
DimStampedInfo fDimFtmFtuList
DimStampedInfo fDimRateScan
DimStampedInfo fDimFtmCounter
DimStampedInfo fDimBiasNominal
TGraph fGraphRateScan[201]
DimStampedInfo fDimFadWriteStats
DimStampedInfo fDimFadConnections
void slot_ChooseBiasChannel(int isw)
DimStampedInfo fDimFscTemp
DimStampedInfo fDimFadTemperature
DimStampedInfo fDimFscVolt
DimStampedInfo fDimFadRefClock
DimStampedInfo fDimFtmError
DimStampedInfo fDimBiasCurrent
DimStampedInfo fDimFadEventData
DimStampedInfo fDimFadRuns
TGraph fGraphBoardRate[40]
DimStampedInfo fDimFadFwVersion
DimStampedInfo fDimLoggerNumSubs
valarray< int8_t > fFtuStatus
vector< float > fDrsCalibration
DimStampedInfo fDimFtmDynamicData
void slot_CameraMouseMove(int isw)
DimStampedInfo fDimFscHumidity
uint64_t fFreeSpaceLogger
void on_fPixelIdx_valueChanged(int isw)
DimStampedInfo fDimMagicWeather
DimStampedInfo fDimLoggerFilenameRun
DimStampedInfo fDimFadPrescaler
DimStampedInfo fDimFadStatus
bool Read(const std::string &fname)
DimStampedInfo fDimFadDac
DimStampedInfo fDimFtmPassport
DimStampedInfo fDimFadEvents
DimStampedInfo fDimLoggerFilenameNight
virtual void slot_RootUpdate()=0
DimStampedInfo fDimFadRoi
vector< int > fPatchMapHW