GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4AnalysisWindow.h
Go to the documentation of this file.
1 // $Id$
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGO4ANALYSISWINDOW_H
15 #define TGO4ANALYSISWINDOW_H
16 
21 #include "QGo4Widget.h"
22 
23 class QProcess;
25 class QTextEdit;
26 class QHBoxLayout;
27 
29  Q_OBJECT
30 
31  public:
32  TGo4AnalysisWindow(QWidget *parent = nullptr, const char *name = nullptr, bool needoutput = false, bool needkillbtn = true);
33  virtual ~TGo4AnalysisWindow();
34 
35  void SetHistorySize(int sz);
36  void StartAnalysisShell(const char *cmd, const char *workdir = nullptr, bool aschildprocess = false);
38  void AppendOutputBuffer(const QString& value, int prio = 0);
39  void UpdateTimeStampFormat();
41  void WorkWithDebugOutput(TGo4Slot *slot);
42  void WaitForNewObject(bool isobjectforeditor);
43 
44  bool HasOutput();
45  bool HasLink() const { return fHasLink; }
46  bool TerminateOnClose() const { return fTerminateOnClose; }
47 
48  static void ExtractProgArgs(QString &prog, QStringList &args);
49 
50  public slots:
51  void readFromStdout();
52  void readFromStderr();
53  void RequestTerminate();
54  void ClearAnalysisOutput();
56  void SaveAnalysisOutput();
57  void FileDialog_Macro();
58  void PrintHistograms();
59  void PrintConditions();
60  void PrintEvent();
61  void CommandSlot();
62 
63  void updateTerminalOutput();
64 
65  protected:
66 
67  void linkedObjectUpdated(const char *linkname, TObject *obj) override;
68  void linkedObjectRemoved(const char *linkname) override;
69 
70  void resizeEvent(QResizeEvent *) override;
71  void closeEvent(QCloseEvent* e) override;
72  void CreateButtons(QHBoxLayout*, bool);
73  void CreateCmdLine(QHBoxLayout*);
74 
77  void AddTimeStamp(QString& buf, int prio = 0);
78 
79  QProcess *fAnalysisProcess{nullptr};
81  QString outputBuffer;
82  QTextEdit* fxOutput{nullptr};
83  unsigned int fiMaxOuputSize{0};
84  bool fbShowTimestamps{false};
85  QString fxTimeFormat;
86  bool fNewObjectForEditor{false};
87  bool fHasLink{false};
88  bool fTerminateOnClose{false};
89 };
90 
91 #endif // TGO4ANALYSISWINDOW_H
void StartAnalysisShell(const char *cmd, const char *workdir=nullptr, bool aschildprocess=false)
void CreateCmdLine(QHBoxLayout *)
void AddTimeStamp(QString &buf, int prio=0)
QGo4CommandsHistory * fxCmdHist
static void ExtractProgArgs(QString &prog, QStringList &args)
void linkedObjectRemoved(const char *linkname) override
void closeEvent(QCloseEvent *e) override
void resizeEvent(QResizeEvent *) override
void linkedObjectUpdated(const char *linkname, TObject *obj) override
void WorkWithDebugOutput(TGo4Slot *slot)
void WorkWithUpdateObjectCmd(TGo4Slot *slot)
TGo4AnalysisWindow(QWidget *parent=nullptr, const char *name=nullptr, bool needoutput=false, bool needkillbtn=true)
bool TerminateOnClose() const
unsigned int fiMaxOuputSize
void AppendOutputBuffer(const QString &value, int prio=0)
void CreateButtons(QHBoxLayout *, bool)
void WaitForNewObject(bool isobjectforeditor)