#include <jdxblock.h>

Public Member Functions | |
| JcampDxBlock (const STD_string &title="Parameter List", compatMode mode=notBroken) | |
| JcampDxBlock (const JcampDxBlock &block) | |
| ~JcampDxBlock () | |
| JcampDxBlock & | operator= (const JcampDxBlock &block) |
| JcampDxBlock & | merge (JcampDxBlock &block, bool onlyUserPars=true) |
| JcampDxBlock & | unmerge (JcampDxBlock &block) |
| STD_string | printval (const STD_string ¶meterName, bool append_unit=false) const |
| bool | parseval (const STD_string ¶meterName, const STD_string &value) |
| int | parseblock (const STD_string &source) |
| unsigned int | numof_pars () const |
| JcampDxClass * | get_parameter (const STD_string &ldrlabel) |
| bool | parameter_exists (const STD_string &ldrlabel) const |
| JcampDxBlock & | set_prefix (const STD_string &prefix) |
| JcampDxBlock & | set_embedded (bool embedded) |
| bool | is_embedded () const |
| JcampDxClass & | operator[] (unsigned int i) |
| const JcampDxClass & | operator[] (unsigned int i) const |
| JcampDxClass & | get_parameter_by_id (int id) |
| JcampDxBlock & | create_copy (const JcampDxBlock &src) |
| JcampDxBlock & | append_copy (const JcampDxClass &src) |
| JcampDxBlock & | copy_ldr_vals (const JcampDxBlock &src) |
| bool | operator== (const JcampDxBlock &rhs) const |
| bool | operator< (const JcampDxBlock &rhs) const |
| bool | compare (const JcampDxBlock &rhs, const STD_list< STD_string > *exclude=0, double accuracy=0.0) const |
| STD_string | print () const |
| JcampDxClass & | set_compatmode (compatMode compat_mode) |
| JcampDxClass & | set_parmode (parameterMode parameter_mode) |
| JcampDxClass & | set_filemode (fileMode file_mode) |
| STD_string | get_parx_code (parxCodeType type, const ParxEquiv &equiv=ParxEquiv()) const |
| STD_ostream & | print2stream (STD_ostream &os) const |
| bool | parsevalstring (const STD_string &) |
| bool | parse (STD_string &parstring) |
| STD_string | printvalstring () const |
| JcampDxClass * | create_copy () const |
| const char * | get_typeInfo () const |
| int | load (const STD_string &filename) |
| int | write (const STD_string &filename) const |
Public Member Functions inherited from JcampDxClass | |
| virtual compatMode | get_compatmode () const |
| virtual double | get_minval () const |
| virtual double | get_maxval () const |
| bool | has_minmax () const |
| JcampDxClass & | set_userDefParameter (bool userDef) |
| bool | isUserDefParameter () const |
| const STD_string & | get_description () const |
| JcampDxClass & | set_description (const STD_string &descr) |
| virtual svector | get_alternatives () const |
| const STD_string & | get_unit () const |
| JcampDxClass & | set_unit (const STD_string &un) |
| virtual parameterMode | get_parmode () const |
| virtual fileMode | get_filemode () const |
| virtual GuiProps | get_gui_props () const |
| virtual JcampDxClass & | set_gui_props (const GuiProps &) |
| virtual ParxEquiv | get_parx_equiv () const |
Public Member Functions inherited from Labeled | |
| Labeled (const STD_string &label="unnamed") | |
| Labeled & | set_label (const STD_string &label) |
| const STD_string & | get_label () const |
| Labeled & | operator= (const Labeled &l) |
Public Member Functions inherited from List< I, P, R > | |
| List () | |
| ~List () | |
| List & | operator= (const List &l) |
| List & | clear () |
| List & | append (R item) |
| List & | remove (R item) |
| unsigned int | size () const |
| iter | get_begin () |
| iter | get_end () |
| constiter | get_const_begin () const |
| constiter | get_const_end () const |
Protected Member Functions | |
| JcampDxBlock & | append_member (JcampDxClass &ldr, const STD_string ldrlabel="") |
Friends | |
| class | JDXwidget |
Additional Inherited Members | |
Public Types inherited from List< I, P, R > | |
| typedef STD_list< P >::iterator | iter |
| typedef STD_list< P > ::const_iterator | constiter |
This class represents a block of parameters. Parameters can be added or removed from the list of parameters within the block. The whole block may be written to or read from a file.
Definition at line 42 of file jdxblock.h.
| JcampDxBlock::JcampDxBlock | ( | const STD_string & | title = "Parameter List", |
| compatMode | mode = notBroken |
||
| ) |
Constructs an empty block of parameters with the label 'title' and the specified mode
| JcampDxBlock::JcampDxBlock | ( | const JcampDxBlock & | block | ) |
Copy constructor
| JcampDxBlock::~JcampDxBlock | ( | ) |
Destructor
| JcampDxBlock& JcampDxBlock::append_copy | ( | const JcampDxClass & | src | ) |
Appends a deep copy of src (not a reference). This copy will be deleted automatically upon destruction.
|
protected |
Use this functions to append members of derived classes
| bool JcampDxBlock::compare | ( | const JcampDxBlock & | rhs, |
| const STD_list< STD_string > * | exclude = 0, |
||
| double | accuracy = 0.0 |
||
| ) | const |
Equivalent to operator <. In addition, a list of parameters can be given in 'exclude' which are excluded from the comparison. When comparing float or double numbers, parametrs are considered equal if they differe by no more than the given 'accuracy'.
| JcampDxBlock& JcampDxBlock::copy_ldr_vals | ( | const JcampDxBlock & | src | ) |
Copy parameter values from 'src' to the equivalent parameters in this block
| JcampDxBlock& JcampDxBlock::create_copy | ( | const JcampDxBlock & | src | ) |
Makes this become a copy of 'src', including its parameters by creating temporary objects. These temporary objects will be deleted automatically upon destruction.
|
inlinevirtual |
Returns a deep copy of the parameter
Implements JcampDxClass.
Definition at line 234 of file jdxblock.h.
| JcampDxClass* JcampDxBlock::get_parameter | ( | const STD_string & | ldrlabel | ) |
Returns a pointer to parameter 'label', or zero if not found
| JcampDxClass& JcampDxBlock::get_parameter_by_id | ( | int | id | ) |
Returns the first parameter in the block with the given 'id'
|
virtual |
Returns C code that can be used together with the PARX(Bruker) compiler.
Reimplemented from JcampDxClass.
|
inlinevirtual |
Returns a string describing the type of the parameter
Implements JcampDxClass.
Definition at line 235 of file jdxblock.h.
|
inline |
Returns whether the block's widget will be displayed in a subwidget or an 'Edit' button that will open a subdialog is generated
Definition at line 147 of file jdxblock.h.
|
virtual |
Loads the parameter(s) from a JCAMP-DX file. In case of calling this function of a single paramter, the file is searched for this parameter and the value is assigned. In case of a parameter block, all parameter values are taken from the file. The return value is the number of parameters which are successfully parsed. If an error occurs, -1 is returned.
Reimplemented from JcampDxClass.
| JcampDxBlock& JcampDxBlock::merge | ( | JcampDxBlock & | block, |
| bool | onlyUserPars = true |
||
| ) |
Merges all parameters found in the specified 'block' into this block
| unsigned int JcampDxBlock::numof_pars | ( | ) | const |
Returns the current number of parameters in the block
|
inline |
Comparison operator which
Definition at line 201 of file jdxblock.h.
| JcampDxBlock& JcampDxBlock::operator= | ( | const JcampDxBlock & | block | ) |
Assignment operator
|
inline |
Compares 'rhs' with 'this' with respect to whether all parameters with the same label mutually exist in the other block and whether these parameters have the same type, label and value.
Definition at line 191 of file jdxblock.h.
| JcampDxClass& JcampDxBlock::operator[] | ( | unsigned int | i | ) |
Returns the i'th parameter in the block
| const JcampDxClass& JcampDxBlock::operator[] | ( | unsigned int | i | ) | const |
Returns the const i'th parameter in the block
| bool JcampDxBlock::parameter_exists | ( | const STD_string & | ldrlabel | ) | const |
Returns true if a parameter with the given label already exists in the block
|
virtual |
Parses the JCAMP-DX parameter. Except for blocks, this is done by stripping the label (e.g. "##$MyParameter=" ) from the string and passing the result to the function 'parsevalstring' of the underlying data type. For blocks, a re-implemented 'parse' function is called. Returns 'true' if the parameter was parsed successfully.
Reimplemented from JcampDxClass.
| int JcampDxBlock::parseblock | ( | const STD_string & | source | ) |
Parse values of thius block from the string 'src' in JCAMP-DX format, returns the number of parameters sucessfully parsed.
| bool JcampDxBlock::parseval | ( | const STD_string & | parameterName, |
| const STD_string & | value | ||
| ) |
Set the value of the parameter that has the label 'parameterName' to 'value'. Returns 'true' if sucessful.
|
inlinevirtual |
Parses and assigns the value in the given string
Implements JcampDxClass.
Definition at line 231 of file jdxblock.h.
|
virtual |
This function returns the parameter in JcampDx-ASCII-format
Reimplemented from JcampDxClass.
|
virtual |
Passes the parameter in ASCII format to the ostream 'os'
Reimplemented from JcampDxClass.
| STD_string JcampDxBlock::printval | ( | const STD_string & | parameterName, |
| bool | append_unit = false |
||
| ) | const |
Print the value of the parameter that has the label 'parameterName' as a formated string. If applicable, append the unit of the number in case 'append_unit' is set to 'true'.
|
inlinevirtual |
Returns the value of the parameter as a string
Implements JcampDxClass.
Definition at line 233 of file jdxblock.h.
|
virtual |
Sets the compatability mode. See the documentation to 'compatMode'
Reimplemented from JcampDxClass.
|
inline |
If embedded is true, the block's widget will be displayed in a subwidget otherwise an 'Edit' button that will open a subdialog is generated
Definition at line 140 of file jdxblock.h.
|
virtual |
Sets the fileMode
Reimplemented from JcampDxClass.
|
virtual |
Sets the parameterMode
Reimplemented from JcampDxClass.
| JcampDxBlock& JcampDxBlock::set_prefix | ( | const STD_string & | prefix | ) |
Prefixes all parameters labels with the given string. If the prefix is already at the beginning of the label, it is not added again.
| JcampDxBlock& JcampDxBlock::unmerge | ( | JcampDxBlock & | block | ) |
Removes all parameters found in the specified 'block' from this block
|
virtual |
Writes the parameter(s) to a JCAMP-DX file. In case of calling this function of a single paramter, the file will consist of only this parameter. In case of a parameter block, all parameter values are written to the file. If an error occurs, -1 is returned.
Reimplemented from JcampDxClass.
Reimplemented in OdinPulse.
1.8.1.2