16 #include <QFileDialog> 17 #include <QCloseEvent> 71 if (strcmp(linkname,
"Status") == 0) {
72 parentWidget()->raise();
73 parentWidget()->show();
74 if (parentWidget()->isMinimized()) parentWidget()->showNormal();
77 auto anl = GetLinkedCast<TGo4ServerProxy>(
"Analysis");
79 anl->RefreshNamesList();
107 QWidget *w =
nullptr;
109 w = TabSteps->currentWidget();
111 TabSteps->removeTab(TabSteps->indexOf(w));
119 auto status = GetLinkedCast<TGo4AnalysisStatus>(
"Status");
120 auto anl = GetLinkedCast<TGo4ServerProxy>(
"Analysis");
122 if (!status || !anl)
return;
124 SubmitPushButton->setEnabled(anl->CanSubmitObjects());
125 SubmitAndStartButton->setEnabled(anl->CanSubmitObjects());
129 QWidget *w =
nullptr;
131 w = TabSteps->currentWidget();
133 TabSteps->removeTab(TabSteps->indexOf(w));
138 for (
int i = 0; i < status->GetNumberOfSteps(); i++) {
140 if (!stepstatus)
continue;
141 QString StepName = stepstatus->GetName();
143 NewStep->
SetStepStatus(
this, stepstatus, status->GetNumberOfSteps() > 1 ? i : -1);
144 TabSteps->insertTab(i, NewStep, NewStep->
GetTabTitle());
147 TabSteps->setCurrentIndex(0);
148 TabSteps->adjustSize();
151 status->GetAutoSaveInterval(),
152 status->GetAutoSaveCompression(),
153 status->IsAutoSaveOn(),
154 status->IsAutoSaveOverwrite());
158 parentWidget()->showNormal();
159 parentWidget()->adjustSize();
193 auto anl = GetLinkedCast<TGo4ServerProxy>(
"Analysis");
195 anl->RequestAnalysisSettings();
201 "Select a configuration file",
203 " Configuration file (*.root)");
204 fd.setFileMode( QFileDialog::AnyFile);
205 if (fd.exec() != QDialog::Accepted)
return;
206 QStringList flst = fd.selectedFiles();
207 QString fileName = flst.isEmpty() ? QString() : flst[0];
209 if(!fileName.endsWith(
".root")) fileName.append(
".root");
210 ConfigFileName->setText(fileName);
215 QFileDialog fd(
this,
216 "Select file name for autosaving",
218 "Auto Save File (*.root)");
219 fd.setFileMode(QFileDialog::AnyFile);
220 fd.setAcceptMode(QFileDialog::AcceptSave);
221 if (fd.exec() != QDialog::Accepted)
return;
223 QStringList flst = fd.selectedFiles();
224 if (flst.isEmpty())
return;
226 QString fileName = flst[0];
228 if(!fileName.endsWith(
".root")) fileName.append(
".root");
229 AutoSaveFileName->setText(fileName);
235 QString fname = AutoSaveFileName->text().trimmed();
236 auto status = GetLinkedCast<TGo4AnalysisStatus>(
"Status");
238 status->SetAutoFileName(fname.toLatin1().constData());
243 auto status = GetLinkedCast<TGo4AnalysisStatus>(
"Status");
245 status->SetAutoSaveCompression(t);
250 QString fname = ConfigFileName->text().trimmed();
251 auto anl = GetLinkedCast<TGo4ServerProxy>(
"Analysis");
253 anl->LoadConfigFile(fname.toLatin1().constData());
259 QString fname = ConfigFileName->text().trimmed();
260 auto anl = GetLinkedCast<TGo4ServerProxy>(
"Analysis");
262 anl->SaveConfigFile(fname.toLatin1().constData());
273 parentWidget()->hide();
283 auto status = GetLinkedCast<TGo4AnalysisStatus>(
"Status");
285 status->SetAutoSaveInterval(t);
290 auto status = GetLinkedCast<TGo4AnalysisStatus>(
"Status");
292 status->SetAutoSaveOverwrite(overwrite);
297 auto status = GetLinkedCast<TGo4AnalysisStatus>(
"Status");
298 auto anl = GetLinkedCast<TGo4ServerProxy>(
"Analysis");
301 anl->WriteAutoSave(status->GetAutoFileName(),
302 status->GetAutoSaveCompression(),
303 status->IsAutoSaveOverwrite());
308 auto status = GetLinkedCast<TGo4AnalysisStatus>(
"Status");
310 status->SetAutoSaveOn(enabled);
311 AutoSaveInterval->setEnabled(enabled);
316 return TabSteps->count();
321 if ((n<0) || (n>=TabSteps->count()))
return nullptr;
342 AutoSaveFileName->setText(filename);
343 AutoSaveInterval->setValue(interval);
344 CompLevel->setValue(compression);
346 AutoSaveOverwrite->setChecked(overwrite);
347 AutoSaveEnable->setChecked(enabled);
349 AutoSaveInterval->setEnabled(enabled);
358 filename = AutoSaveFileName->text();
359 interval = AutoSaveInterval->value();
360 compression = CompLevel->value();
362 overwrite = AutoSaveOverwrite->isChecked();
363 enabled = AutoSaveEnable->isChecked();
368 ConfigFileName->setText(filename);
373 filename = ConfigFileName->text();
378 ServiceCall(
"DisplayMbsMonitor", (
void *) mbsname.toLatin1().constData());
384 QWidget *mdi = parentWidget();
virtual void FileDialog_AutoSave()
virtual void SetStepStatus(TGo4AnalysisConfiguration *panel, TGo4AnalysisStepStatus *StepStatus, int number=-1)
virtual void LineEdit_AutoSaveFile(const QString &)
virtual void GetAnalysisConfigFile(QString &filename)
virtual void WriteAutoSave()
void linkedObjectUpdated(const char *linkname, TObject *obj) override
virtual QString GetTabTitle()
virtual void SetAutoSaveConfig(QString filename, int interval, int compression, bool enbaled, bool overwrite)
TGo4ConfigStep * GetStepConfig(int n)
virtual void SetSourcePath(const QString &v)
virtual void SetAutoSaveOverwrite(bool overwrite)
void closeEvent(QCloseEvent *e) override
void linkedObjectRemoved(const char *linkname) override
virtual void SetAutoSaveInterval(int t)
void DropItem(const char *itemname, TClass *cl, int kind) override
virtual void RequestAnalysisStatus()
virtual void SaveConfiguration()
TGo4AnalysisConfiguration(QWidget *parent=nullptr, const char *name=nullptr)
bool IsAcceptDrag(const char *itemname, TClass *cl, int kind) override
virtual void GetAutoSaveConfig(QString &filename, int &interval, int &compression, bool &enbaled, bool &overwrite)
TGo4Slot * SettingsSlot()
virtual void LoadConfiguration()
virtual QString GetStepName()
virtual void RefreshWidget()
virtual void SubmitAndStart()
virtual QString GetSourcePath()
void ResetWidget() override
virtual void SetCompressionLevel(int t)
virtual void FileDialog_ConfFile()
virtual QString GetStorePath()
virtual void CloseAnalysis()
TGo4ConfigStep * FindStepConfig(QString name)
virtual void SetStorePath(const QString &v)
virtual void EnableAutoSaveSlot(bool disabled)
virtual void WorkWithAnalysis(TGo4ServerProxy *anal)
virtual void SubmitConfiguration()
virtual void DisplayMbsMonitor(const QString &mbsname)
virtual void SetAnalysisConfigFile(QString filename)
void ChangeTabTitle(TGo4ConfigStep *step, int number)