UltraScan III
us_model_loader.h
Go to the documentation of this file.
1 #ifndef US_MODEL_LOAD_H
3 #define US_MODEL_LOAD_H
4 
5 #include <QtGui>
6 
7 #include "us_extern.h"
8 #include "us_widgets_dialog.h"
9 #include "us_widgets.h"
10 #include "us_dataIO.h"
11 #include "us_model.h"
12 #include "us_plot.h"
13 #include "us_help.h"
14 
18 {
19  Q_OBJECT
20 
21  public:
30  US_ModelLoader( bool, QString&, US_Model&, QString&,
31  const QString = "" );
32 
41  US_ModelLoader( bool, QString&, US_Model&, QString&,
42  QStringList& );
43 
52  US_ModelLoader( bool, QString&, QList< US_Model >&, QStringList&,
53  QStringList& );
54 
62  US_ModelLoader( bool, QString&, QList< US_Model >&, QStringList& );
63 
64  signals:
67  void changed( bool DB );
68 
69  private:
70  bool loadDB; // flag: true to load from DB; false=disk
71  QString& dsearch; // reference to search string argument
72  US_Model& omodel; // reference to model argument
73  QString& odescr; // reference to description argument
74  QList< US_Model >& omodels; // reference to model list argument
75  QStringList& odescrs; // reference to description list argument
76  QStringList& runIDs; // input runIDs list argument
77  bool multi; // flag if multiple models can be selected
78  QString editGUID; // edit GUID to possibly match
79  US_DB2* dbP; // pointer to a database connection
80 
82 
83  class ModelDesc
84  { // model description object
85  public:
86  QString description; // description string
87  QString filename; // local file name
88  QString modelGUID; // model GUID
89  QString DB_id; // database ID (-1 if local)
90  QString editGUID; // edit GUID
91  QString reqGUID; // request GUID
92  int iterations; // Monte Carlo iterations
93  int rec_index; // model record list index
94  };
95 
96  QList< ModelDesc > model_descriptions; // listed models
97  QList< ModelDesc > model_descrs_recs; // models from records
98  QList< ModelDesc > model_descrs_sings; // models with singles
99  QList< ModelDesc > model_descrs_ufilt; // models list unfiltered
100 
102  QList< US_Model > wmodels;
103 
104  QRadioButton* rb_db;
105  QRadioButton* rb_disk;
106 
107  QPushButton* pb_investigator;
108  QPushButton* pb_filtmodels;
109 
110  QLineEdit* le_investigator;
111  QLineEdit* le_mfilter;
112 
113  QCheckBox* ck_single;
114  QCheckBox* ck_edit;
115  QCheckBox* ck_unasgn;
116 
118 
120 
122  int db_id1;
123  int db_id2;
124 
125  bool singprev;
126  bool do_single;
127  bool do_run;
128  bool do_edit;
129  bool do_unasgn;
130  bool do_manual;
131  bool can_run;
132  bool can_edit;
133 
134  QString reqGUID;
135 
136  QStringList mdescrs;
137  QStringList wrunIDs;
138 
139  private slots:
145  int load_model( US_Model&, int );
146 
159  QString description( int );
160 
161  void build_dialog( void );
162  void select_diskdb( void );
163  void get_person( void );
164  void update_person( int );
165  void list_models ( void );
166  void msearch( const QString& );
167  void records_list ( void );
168  void singles_list ( void );
169  void cancelled( void );
170  void accepted( void );
171  void change_single( bool );
172  void change_edit ( bool );
173  void change_unasgn( bool );
174 
175  void help ( void )
176  { showHelp.show_help( "load_model_distrib.html" ); };
177 
178  int modelIndex( QString mdesc, QList< ModelDesc > );
179  void show_model_info( QPoint );
180 
181  protected:
188  bool eventFilter( QObject*, QEvent* );
189 };
190 #endif