UltraScan III
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions
US_Model Class Reference

A class to define a model and provide Disk/DB IO for models. More...

#include "us_model.h"

Classes

class  Association
 Reversible association class The chemical constants associated with a reaction. More...
 
class  MfemInitial
 
class  SimulationComponent
 Simulation component (solute/analyte) class Each analyte in the model is a component. A sedimenting solute can also be a component. More...
 

Public Types

enum  ShapeType { SPHERE, PROLATE, OBLATE, ROD }
 Enumeration of the general shapes of molecules. More...
 
enum  OpticsType { ABSORBANCE, INTERFERENCE, FLUORESCENCE }
 The type of optics used to acquire data for the current model. More...
 
enum  AnalysisType {
  MANUAL, TWODSA, TWODSA_MW, GA,
  GA_MW, PCSA, COFS, FE,
  CUSTOMGRID, DMGA, DMGA_CONSTR
}
 The type of analysis used with the model. More...
 
enum  GlobalType { NONE, MENISCUS, GLOBAL, SUPERGLOBAL }
 The type of global analysis used with the model. More...
 

Public Member Functions

 US_Model ()
 Constructor for the US_Model class. More...
 
int load (bool, const QString &, US_DB2 *=0)
 Read a model from the disk or database. More...
 
int load (const QString &, US_DB2 *)
 An overloaded function to read a model from a database. More...
 
int load (const QString &)
 An overloaded function to read a model from the disk. More...
 
int load_string (const QString &)
 A function to load a model from an XML string. More...
 
bool operator== (const US_Model &) const
 A test for model equality. More...
 
bool operator!= (const US_Model &m) const
 A test for model inequality. More...
 
int write (bool, const QString &, US_DB2 *=0)
 Write a model to the disk or database. More...
 
int write (US_DB2 *)
 An overloaded function to write a model to the DB. More...
 
int write (const QString &)
 An overloaded function to write a model to a file on disk. More...
 
bool update_coefficients (void)
 Update any missing analyte coefficient values. More...
 
QString typeText (int=0)
 Model type text. More...
 
bool constant_ff0 (void)
 Flag constant f/f0. More...
 
bool constant_vbar (void)
 Flag constant vbar. More...
 
bool is_reactant (const int compx)
 Flag if a specified component is a reactant. More...
 
bool is_product (const int compx)
 Flag if a specified component is a product of a reaction. More...
 
int mc_iter_xmls (QStringList &)
 Get count and list of MonteCarlo iteration xml contents. More...
 
void debug (void)
 Dump model data for debugging. More...
 

Static Public Member Functions

static bool calc_coefficients (SimulationComponent &)
 Calculate any missing coefficient values in an analyte component. More...
 
static bool model_path (QString &, bool=true)
 Model directory path existence test and creation. More...
 
static QString get_filename (const QString &, const QString &, bool &)
 Find a model file on the disk. More...
 
static QString composite_mc_file (QStringList &, const bool)
 Create or append to a composite MC model file. More...
 

Public Attributes

bool monteCarlo
 Model was generated by MC Analysis. More...
 
double wavelength
 Wavelength of the data acquisition. More...
 
double variance
 Variance of model fit. More...
 
double meniscus
 Meniscus value for model meniscus fit. More...
 
double alphaRP
 Alpha (Regularization Parameter) value. More...
 
QString description
 Text description of the model. More...
 
QString modelGUID
 Identifier of the model. More...
 
QString editGUID
 Identifier of the edit data. More...
 
QString requestGUID
 Identifier of the LIMS request. More...
 
QString dataDescrip
 Raw data triple description string. More...
 
OpticsType optics
 The optics used for the data acquisition. More...
 
AnalysisType analysis
 The analysis used with this model. More...
 
GlobalType global
 Global params used for model generation. More...
 
QStringList mcixmls
 Component MC iteration XML contents. More...
 
int nmcixs
 Number of MC component xmls (iterations) More...
 
int subGrids
 
int coSedSolute
 
QVector< SimulationComponentcomponents
 The components being analyzed. More...
 
QVector< Associationassociations
 The association constants for interacting solutes. More...
 
QString message
 Used internally for communication. More...
 

Private Member Functions

int load_db (const QString &, US_DB2 *)
 Load a model from the database. More...
 
int load_disk (const QString &)
 Load a model from a local disk file. More...
 
void mfem_scans (QXmlStreamReader &, SimulationComponent &)
 Parse and load an initial concentration vector. More...
 
void get_associations (QXmlStreamReader &, Association &)
 Parse the associations part of a model XML. More...
 
int load_stream (QXmlStreamReader &)
 Load a model from an XML stream. More...
 
int load_multi_model (QTextStream &)
 Load a multi-iteration model from a text stream. More...
 
void write_stream (QXmlStreamWriter &)
 Write to an XML stream. More...
 
void write_mm_stream (QTextStream &)
 Write to a multiple model text stream. More...
 

Detailed Description

A class to define a model and provide Disk/DB IO for models.

Definition at line 9 of file us_model.h.

Member Enumeration Documentation

The type of analysis used with the model.

Enumerator
MANUAL 
TWODSA 
TWODSA_MW 
GA 
GA_MW 
PCSA 
COFS 
FE 
CUSTOMGRID 
DMGA 
DMGA_CONSTR 

Definition at line 27 of file us_model.h.

The type of global analysis used with the model.

Enumerator
NONE 
MENISCUS 
GLOBAL 
SUPERGLOBAL 

Definition at line 31 of file us_model.h.

The type of optics used to acquire data for the current model.

Enumerator
ABSORBANCE 
INTERFERENCE 
FLUORESCENCE 

Definition at line 24 of file us_model.h.

Enumeration of the general shapes of molecules.

Enumerator
SPHERE 
PROLATE 
OBLATE 
ROD 

Definition at line 21 of file us_model.h.

Constructor & Destructor Documentation

US_Model::US_Model ( )

Constructor for the US_Model class.

Definition at line 78 of file us_model.cpp.

Member Function Documentation

bool US_Model::calc_coefficients ( SimulationComponent component)
static

Calculate any missing coefficient values in an analyte component.

Returns
- Success if values already existed or were successfully filled in by calculations.

Definition at line 146 of file us_model.cpp.

QString US_Model::composite_mc_file ( QStringList &  mcfiles,
const bool  rmvi 
)
static

Create or append to a composite MC model file.

Parameters
mcfilesA list of MC iteration files to concatenate
rmviFlag to remove iteration files
Returns
The file name of the created/appended model.

Definition at line 1294 of file us_model.cpp.

bool US_Model::constant_ff0 ( void  )

Flag constant f/f0.

Returns
- A boolean flag of whether component f/f0's are constant

Definition at line 446 of file us_model.cpp.

bool US_Model::constant_vbar ( void  )

Flag constant vbar.

Returns
- A boolean flag of whether component vbar's are constant

Definition at line 461 of file us_model.cpp.

void US_Model::debug ( void  )

Dump model data for debugging.

Definition at line 1596 of file us_model.cpp.

void US_Model::get_associations ( QXmlStreamReader &  xml,
Association as 
)
private

Parse the associations part of a model XML.

Definition at line 898 of file us_model.cpp.

QString US_Model::get_filename ( const QString &  path,
const QString &  guid,
bool &  newFile 
)
static

Find a model file on the disk.

Parameters
pathThe full path of the directory to search
guidThe GUID of the desired model
newFileA reference to a boolean variable. Sets false if the model exist, true otherwise.
Returns
The file name of the model. If newFile is true, the name is the next in the M????????.xml numeric sequence but does not yet exist.

Definition at line 1230 of file us_model.cpp.

bool US_Model::is_product ( const int  compx)

Flag if a specified component is a product of a reaction.

Parameters
compxIndex of component to interrogate
Returns
A boolean flag whether specified component is a product

Definition at line 496 of file us_model.cpp.

bool US_Model::is_reactant ( const int  compx)

Flag if a specified component is a reactant.

Parameters
compxIndex of component to interrogate
Returns
A boolean flag whether specified component is a reactant

Definition at line 476 of file us_model.cpp.

int US_Model::load ( bool  db_access,
const QString &  guid,
US_DB2 db = 0 
)

Read a model from the disk or database.

Parameters
db_access- A flag to indicate if the DB (true) or disk (false) should be searched for the model
guid- The guid of the model to be loaded
db- For DB access, pointer to open database connection
Returns
- The US_DB2 return code for the operation

Definition at line 516 of file us_model.cpp.

int US_Model::load ( const QString &  id,
US_DB2 db 
)

An overloaded function to read a model from a database.

Parameters
id- Database ModelID
db- For DB access, pointer to open database connection
Returns
- The US_DB2 return code for the operation

Definition at line 956 of file us_model.cpp.

int US_Model::load ( const QString &  filename)

An overloaded function to read a model from the disk.

Parameters
filenameThe name, including full path, of the analyte file
Returns
- The US_DB2 return code for the operation

Definition at line 577 of file us_model.cpp.

int US_Model::load_db ( const QString &  guid,
US_DB2 db 
)
private

Load a model from the database.

Definition at line 941 of file us_model.cpp.

int US_Model::load_disk ( const QString &  guid)
private

Load a model from a local disk file.

Definition at line 523 of file us_model.cpp.

int US_Model::load_multi_model ( QTextStream &  tsi)
private

Load a multi-iteration model from a text stream.

Definition at line 736 of file us_model.cpp.

int US_Model::load_stream ( QXmlStreamReader &  xml)
private

Load a model from an XML stream.

Definition at line 611 of file us_model.cpp.

int US_Model::load_string ( const QString &  mcont)

A function to load a model from an XML string.

Parameters
mcontThe XML string model contents
Returns
- The US_DB2 return code for the operation

Definition at line 603 of file us_model.cpp.

int US_Model::mc_iter_xmls ( QStringList &  mcixs)

Get count and list of MonteCarlo iteration xml contents.

Parameters
mcixsReference for return of MC xml contents
Returns
Count of MC iteration xml content strings

Definition at line 1588 of file us_model.cpp.

void US_Model::mfem_scans ( QXmlStreamReader &  xml,
SimulationComponent sc 
)
private

Parse and load an initial concentration vector.

Definition at line 876 of file us_model.cpp.

bool US_Model::model_path ( QString &  path,
bool  is_perm = true 
)
static

Model directory path existence test and creation.

Parameters
path- A reference to the directory path on the disk where model files are to be written
is_perm- An optional flag if the files are non-temporary
Returns
- Success if the path is found or created and failure if the path cannot be created

Definition at line 338 of file us_model.cpp.

bool US_Model::operator!= ( const US_Model m) const
inline

A test for model inequality.

Definition at line 95 of file us_model.h.

bool US_Model::operator== ( const US_Model m) const

A test for model equality.

Definition at line 103 of file us_model.cpp.

QString US_Model::typeText ( int  subtype = 0)

Model type text.

Parameters
subtypeOptional PCSA subtype (1,2,4...->SL,IS,DS...)
Returns
- A short text string describing the type of model

Definition at line 360 of file us_model.cpp.

bool US_Model::update_coefficients ( void  )

Update any missing analyte coefficient values.

Returns
- Success if values already existed or were successfully filled in by calculations.

Definition at line 134 of file us_model.cpp.

int US_Model::write ( bool  db_access,
const QString &  filename,
US_DB2 db = 0 
)

Write a model to the disk or database.

Parameters
db_access- A flag to indicate if the DB (true) or disk (false) should be used to save the model
filename- The filename (with path) where the xml file be written if disk access is specified
db- For DB access, pointer to open database connection
Returns
- The US_DB2 return code for the operation

Definition at line 984 of file us_model.cpp.

int US_Model::write ( US_DB2 db)

An overloaded function to write a model to the DB.

Parameters
db- A pointer to an open database connection
Returns
- The US_DB2 return code for the operation

Definition at line 991 of file us_model.cpp.

int US_Model::write ( const QString &  filename)

An overloaded function to write a model to a file on disk.

Parameters
filename- The filename to write
Returns
- The US_DB2 return code for the operation

Definition at line 1055 of file us_model.cpp.

void US_Model::write_mm_stream ( QTextStream &  tso)
private

Write to a multiple model text stream.

Definition at line 856 of file us_model.cpp.

void US_Model::write_stream ( QXmlStreamWriter &  xml)
private

Write to an XML stream.

Definition at line 1080 of file us_model.cpp.

Member Data Documentation

double US_Model::alphaRP

Alpha (Regularization Parameter) value.

Definition at line 38 of file us_model.h.

AnalysisType US_Model::analysis

The analysis used with this model.

Definition at line 45 of file us_model.h.

QVector< Association > US_Model::associations

The association constants for interacting solutes.

Definition at line 62 of file us_model.h.

QVector< SimulationComponent > US_Model::components

The components being analyzed.

Definition at line 59 of file us_model.h.

int US_Model::coSedSolute

An index into components (-1 means none). Generally buffer data in the form of a component that affects the data readings.

Definition at line 56 of file us_model.h.

QString US_Model::dataDescrip

Raw data triple description string.

Definition at line 43 of file us_model.h.

QString US_Model::description

Text description of the model.

Definition at line 39 of file us_model.h.

QString US_Model::editGUID

Identifier of the edit data.

Definition at line 41 of file us_model.h.

GlobalType US_Model::global

Global params used for model generation.

Definition at line 46 of file us_model.h.

QStringList US_Model::mcixmls

Component MC iteration XML contents.

Definition at line 47 of file us_model.h.

double US_Model::meniscus

Meniscus value for model meniscus fit.

Definition at line 37 of file us_model.h.

QString US_Model::message

Used internally for communication.

Definition at line 64 of file us_model.h.

QString US_Model::modelGUID

Identifier of the model.

Definition at line 40 of file us_model.h.

bool US_Model::monteCarlo

Model was generated by MC Analysis.

Definition at line 34 of file us_model.h.

int US_Model::nmcixs

Number of MC component xmls (iterations)

Definition at line 48 of file us_model.h.

OpticsType US_Model::optics

The optics used for the data acquisition.

Definition at line 44 of file us_model.h.

QString US_Model::requestGUID

Identifier of the LIMS request.

Definition at line 42 of file us_model.h.

int US_Model::subGrids

An integer to define the number of subgrids for a CUSTOMGRID needed for the 2DSA initialization or output components for DISCRETEGA

Definition at line 52 of file us_model.h.

double US_Model::variance

Variance of model fit.

Definition at line 36 of file us_model.h.

double US_Model::wavelength

Wavelength of the data acquisition.

Definition at line 35 of file us_model.h.


The documentation for this class was generated from the following files: