UltraScan III
us_reporter.h
Go to the documentation of this file.
1 #ifndef US_REPORTER_H
2 #define US_REPORTER_H
3 
4 #include <QtGui>
5 #include <QWebView>
6 #include <QWebSettings>
7 
8 #include "us_extern.h"
9 #include "us_widgets.h"
10 #include "us_db2.h"
11 #include "us_help.h"
12 #include "us_settings.h"
13 
14 #ifndef DbgLv
15 #define DbgLv(a) if(dbg_level>=a)qDebug()
16 #endif
17 
18 class US_Reporter : public US_Widgets
19 {
20  Q_OBJECT
21 
22  public:
23  US_Reporter();
24 
25  class DataDesc
26  {
27  public:
28  int linen; // line number
29  int level; // tree level (0,...)
30  int checkState; // check state flag (0,1,2)
31  int children; // number of children
32  QString label; // entry label
33  QString type; // type of entry (Run, Data, ...)
34  QString filename; // file name
35  QString filepath; // full file path name
36  QString runid; // run ID
37  QString triple; // triple (e.g., "2/A/280")
38  QString analysis; // analysis
39  QString lastmodDate; // file last modification date/time
40  QString description; // triple data set description
41  };
42 
43  private:
44 
45  QTreeWidget* tw_recs; // tree widget
46 
47  DataDesc cdesc; // current record description
48  QVector< DataDesc > adescs; // all descriptions
49 
50  QMap< QString, QString > appmap; // applications name,label map
51  QMap< QString, QString > extmap; // applications name,label map
52  QMap< QString, QString > rptmap; // reports name,label map
53 
54  QList< int > se_rptrows; // List of selected report rows
55 
56  QStringList sl_runids; // List of existing report runIDs
57  QStringList se_runids; // List of selected runIDs
58  QStringList se_reports; // List of selected reports
59 
61 
63 
64  QWebView* prevwidg;
65  QWebSettings* websetting;
66 
67  QComboBox* cb_runids;
68 
69  QPushButton* pb_view;
70  QPushButton* pb_save;
71  QPushButton* pb_help;
72  QPushButton* pb_close;
73 
74  int ntrows;
75  int ntcols;
76  int nsrpts;
77  int nsruns;
78  int nstrips;
79  int nshtmls;
80  int nsplots;
81  int dbg_level;
82 
83  bool rbtn_click;
85  bool changed;
86  bool load_ok;
87  bool ld_wait;
88 
89  QString run_name;
90  QString investig;
91  QString pagedir;
92  QString pagepath;
93  QString ppdfpath;
94  QString hsclogo;
95  QString becklogo;
96  QString us3logo;
97  QString archdir;
98 
99 
100  private slots:
101 
102  void clickedItem ( QTreeWidgetItem* );
103  void changedItem ( QTreeWidgetItem*, int );
104  void row_context ( QTreeWidgetItem* );
105  void build_runids ( void );
106  void new_runid ( int );
107  void build_descs ( QString&, int& );
108  void build_map ( QString, QMap< QString, QString >& );
109  void build_tree ( void );
110  void count_children( DataDesc*, int&, int& );
111  void state_children( DataDesc*, int& );
112  void state_parents ( DataDesc*, int& );
113  void mark_checked ( void );
114  void view ( void );
115  void save ( void );
116  bool write_report ( void );
117  bool count_reports ( void );
118  void item_view ( void );
119  void item_show ( void );
120  void item_save ( void );
121  void load_profile ( void );
122  void save_profile ( void );
123  void sync_db ( void );
124  void copy_logos ( QString );
125  void write_pdf ( void );
126  QString pad_line ( const QString );
127 
128  void help ( void )
129  { showHelp.show_help( "reporter.html" ); };
130 
131  protected:
132  bool eventFilter( QObject*, QEvent* );
133 };
134 #endif