UltraScan III
us_model.h
Go to the documentation of this file.
1 #ifndef US_MODEL_H
2 #define US_MODEL_H
3 
4 #include <QtCore>
5 #include "us_extern.h"
6 #include "us_db2.h"
7 
10 {
11  public:
13  US_Model();
14 
16  class SimulationComponent;
18  class Association;
19 
21  enum ShapeType { SPHERE, PROLATE, OBLATE, ROD };
22 
24  enum OpticsType{ ABSORBANCE, INTERFERENCE, FLUORESCENCE };
25 
27  enum AnalysisType { MANUAL, TWODSA, TWODSA_MW, GA, GA_MW, PCSA,
28  COFS, FE, CUSTOMGRID, DMGA, DMGA_CONSTR };
29 
31  enum GlobalType { NONE, MENISCUS, GLOBAL, SUPERGLOBAL };
32 
33 
34  bool monteCarlo;
35  double wavelength;
36  double variance;
37  double meniscus;
38  double alphaRP;
39  QString description;
40  QString modelGUID;
41  QString editGUID;
42  QString requestGUID;
43  QString dataDescrip;
47  QStringList mcixmls;
48  int nmcixs;
49 
52  int subGrids;
53 
57 
59  QVector< SimulationComponent > components;
60 
62  QVector< Association > associations;
63 
64  QString message;
65 
72  int load( bool, const QString&, US_DB2* = 0 );
73 
78  int load( const QString&, US_DB2* );
79 
80 
84  int load( const QString& );
85 
89  int load_string( const QString& );
90 
92  bool operator== ( const US_Model& ) const;
93 
95  inline bool operator!= ( const US_Model& m )
96  const { return ! operator==(m); }
97 
105  int write( bool, const QString&, US_DB2* = 0 );
106 
110  int write( US_DB2* );
111 
115  int write( const QString& );
116 
120  bool update_coefficients( void );
121 
125  static bool calc_coefficients( SimulationComponent& );
126 
133  static bool model_path( QString&, bool = true );
134 
143  static QString get_filename( const QString&, const QString&, bool& );
144 
149  static QString composite_mc_file( QStringList&, const bool );
150 
154  QString typeText( int = 0 );
155 
158  bool constant_ff0( void );
159 
162  bool constant_vbar( void );
163 
167  bool is_reactant( const int compx );
168 
172  bool is_product ( const int compx );
173 
177  int mc_iter_xmls( QStringList& );
178 
180  void debug( void );
181 
185  {
186  public:
187  QVector< double > radius;
188  QVector< double > concentration;
189  };
190 
195  {
196  public:
198 
200  bool operator== ( const SimulationComponent& ) const;
201 
203  inline bool operator!= ( const SimulationComponent& sc ) const
204  { return ! operator==(sc); }
205 
206  QString analyteGUID;
209  double vbar20;
210  double mw;
211  double s;
212  double D;
213  double f;
214  double f_f0;
215  double extinction;
216  double axial_ratio;
218  double sigma;
219  double delta;
220  int oligomer;
221  ShapeType shape;
223  QString name;
226  };
228 
232  {
233  public:
234  Association();
235  double k_d;
236  double k_off;
237  QVector< int > rcomps;
238  QVector< int > stoichs;
240 
244  bool operator== ( const Association& ) const;
245 
247  inline bool operator!= ( const Association& a ) const
248  { return ! operator==(a); }
249  };
250 
251  private:
252 
254  int load_db ( const QString&, US_DB2* );
256  int load_disk ( const QString& );
258  void mfem_scans ( QXmlStreamReader&, SimulationComponent& );
260  void get_associations( QXmlStreamReader&, Association& );
261 
263  int load_stream ( QXmlStreamReader& );
265  int load_multi_model( QTextStream& );
267  void write_stream ( QXmlStreamWriter& );
269  void write_mm_stream ( QTextStream& );
270 
271 };
272 #endif