Relacs
0.9.8
|
#include <parameter.h>
Public Types | |
enum | ValueType { NoType =0, Text =1, Number =2, Integer =4, Boolean =8, AnyNumber =14, Date =16, Time =32, Section =64 } |
Public Member Functions | |
Parameter (void) | |
Parameter (const Parameter &p) | |
Parameter (const string &name, const string &request, const string &strg, int flags=0, int style=0, Options *parentsection=0) | |
Parameter (const string &name, const string &request, const char *strg, int flags=0, int style=0, Options *parentsection=0) | |
Parameter (const string &name, const string &request, double number, double error, double minimum=-MAXDOUBLE, double maximum=MAXDOUBLE, double step=1.0, const string &internunit="", const string &outputunit="", const string &format="", int flags=0, int style=0, Options *parentsection=0) | |
Parameter (const string &name, const string &request, double number, const string &unit="", const string &format="", int flags=0, int style=0, Options *parentsection=0) | |
Parameter (const string &name, const string &request, const vector< double > &numbers, const vector< double > &errors, double minimum=-MAXDOUBLE, double maximum=MAXDOUBLE, double step=1.0, const string &internunit="", const string &outputunit="", const string &format="", int flags=0, int style=0, Options *parentsection=0) | |
Parameter (const string &name, const string &request, long number, long error=-1, long minimum=LONG_MIN, long maximum=LONG_MAX, long step=1, const string &internunit="", const string &outputunit="", int width=0, int flags=0, int style=0, Options *parentsection=0) | |
Parameter (const string &name, const string &request, bool dflt, int flags=0, int style=0, Options *parentsection=0) | |
Parameter (const string &name, const string &request, ValueType type, int yearhour, int monthminutes, int dayseconds, int flags=0, int style=0, Options *parentsection=0) | |
Parameter (const string &name, const string &request, int hour, int minutes, int seconds, int milliseconds, int flags=0, int style=0, Options *parentsection=0) | |
Parameter (const string &name, const string &value) | |
~Parameter (void) | |
Parameter & | clear (const string &name="", const string &request="", ValueType type=NoType) |
Parameter & | operator= (const Parameter &p) |
Parameter & | assign (const Parameter &p) |
Parameter & | operator= (const string &value) |
Parameter & | assign (const string &value) |
Parameter & | setValue (const Parameter &p) |
Options * | parentSection (void) |
const Options * | parentSection (void) const |
void | setParentSection (Options *parentsection) |
bool | nonDefault (void) const |
Str | warning (void) const |
Str | name (void) const |
Parameter & | setName (const string &name) |
Str | request (void) const |
Parameter & | setRequest (const string &request) |
ValueType | valueType (void) const |
bool | valueType (int mask) const |
Parameter & | setValueType (ValueType type) |
int | flags (void) const |
bool | flags (int selectflag) const |
Parameter & | setFlags (int flags) |
Parameter & | addFlags (int flags) |
Parameter & | delFlags (int flags) |
Parameter & | clearFlags (void) |
bool | changed (void) const |
int | style (void) const |
Parameter & | setStyle (int style) |
Parameter & | addStyle (int style) |
Parameter & | delStyle (int style) |
Str | format (void) const |
Parameter & | setFormat (int width, int prec=-1, char fmt='-') |
Parameter & | setFormat (const string &format="") |
int | formatWidth (void) const |
int | size (void) const |
bool | isText (void) const |
Str | text (int index, const string &format="", const string &unit="") const |
Str | text (const string &format="", const string &unit="") const |
void | texts (vector< string > &s, const string &format="", const string &unit="") const |
Str | allText (const string &format="", const string &unit="", const string &separator=", ") const |
Parameter & | setText (const string &strg) |
Parameter & | setText (const Parameter &p) |
Parameter & | addText (const string &strg, bool clear=false) |
Str | defaultText (int index, const string &format="", const string &unit="") const |
Str | defaultText (const string &format="", const string &unit="") const |
Parameter & | setDefaultText (const string &strg) |
Parameter & | addDefaultText (const string &strg) |
Parameter & | selectText (const string &strg, int add=0) |
Parameter & | selectText (int index) |
int | index (void) const |
int | index (const string &strg) const |
bool | isAnyNumber (void) const |
bool | isNumber (void) const |
double | number (const string &unit="", int index=0, double dflt=0.0) const |
double | number (int index, const string &unit="", double dflt=0.0) const |
double | number (int index, double dflt, const string &unit="") const |
void | numbers (vector< double > &n, const string &unit="") const |
double | error (const string &unit="", int index=0) const |
double | error (int index, const string &unit="") const |
void | errors (vector< double > &n, const string &unit="") const |
Parameter & | setNumber (double number, double error, const string &unit="") |
Parameter & | setNumber (double number, const string &unit="") |
Parameter & | setNumbers (const vector< double > &numbers, const vector< double > &errors, const string &unit="") |
Parameter & | setNumbers (const vector< double > &numbers, double error, const string &unit="") |
Parameter & | setNumbers (const vector< double > &numbers, const string &unit="") |
Parameter & | setNumber (const Parameter &p) |
Parameter & | addNumber (double number, double error, const string &unit="", bool clear=false) |
Parameter & | addNumber (double number, const string &unit="") |
Parameter & | addNumber (const Str &s, const string &unit="") |
bool | isInteger (void) const |
long | integer (const string &unit="", int index=0, long dflt=0) const |
long | integer (int index, const string &unit="", long dflt=0) const |
long | integer (int index, long dflt, const string &unit="") const |
void | integers (vector< long > &n, const string &unit="") const |
void | integers (vector< int > &n, const string &unit="") const |
Parameter & | setInteger (long number, long error, const string &unit="") |
Parameter & | setInteger (long number, const string &unit="") |
Parameter & | setInteger (const Parameter &p) |
Parameter & | addInteger (long number, long error, const string &unit="") |
Parameter & | addInteger (long number, const string &unit="") |
double | defaultNumber (const string &unit="", int index=0) const |
double | defaultNumber (int index, const string &unit="") const |
Parameter & | setDefaultNumber (double number, const string &unit="") |
Parameter & | addDefaultNumber (double number, const string &unit="") |
Parameter & | addDefaultNumber (const Str &s, const string &unit="") |
long | defaultInteger (const string &unit="", int index=0) const |
long | defaultInteger (int index, const string &unit="") const |
Parameter & | setDefaultInteger (long dflt, const string &unit="") |
Parameter & | addDefaultInteger (double number, const string &unit="") |
double | minimum (const string &unit="") const |
double | maximum (const string &unit="") const |
double | step (const string &unit="") const |
Parameter & | setStep (double step, const string &unit="") |
Parameter & | setStep (long step) |
Parameter & | setMinMax (double minimum=-MAXDOUBLE, double maximum=MAXDOUBLE, double step=1.0, const string &unit="") |
Parameter & | setMinMax (long minimum=LONG_MIN, long maximum=LONG_MAX, long step=1, const string &unit="") |
Parameter & | setMinMax (int minimum, int maximum, int step=1, const string &unit="") |
Str | unit (void) const |
Str | outUnit (void) const |
Parameter & | setUnit (const string &internunit, const string &outputunit="") |
Parameter & | setOutUnit (const string &outputunit) |
Parameter & | changeUnit (string internunit) |
bool | isBoolean (void) const |
bool | boolean (int index=0) const |
void | booleans (vector< bool > &n) const |
Parameter & | setBoolean (bool b) |
Parameter & | setBoolean (const Parameter &p) |
bool | defaultBoolean (int index=0) const |
Parameter & | setDefaultBoolean (bool dflt) |
bool | isDate (void) const |
int | year (int index=0) const |
int | month (int index=0) const |
int | day (int index=0) const |
void | date (int &year, int &month, int &day, int index=0) const |
Parameter & | setDate (int year, int month, int day) |
Parameter & | addDate (int year, int month, int day) |
Parameter & | setDate (const string &date) |
Parameter & | setDate (const struct tm &date) |
Parameter & | setDate (const time_t &time) |
Parameter & | setCurrentDate (void) |
Parameter & | setDate (const Parameter &p) |
int | defaultYear (int index=0) const |
int | defaultMonth (int index=0) const |
int | defaultDay (int index=0) const |
void | defaultDate (int &year, int &month, int &day, int index=0) const |
Parameter & | setDefaultDate (int year, int month, int day) |
Parameter & | addDefaultDate (int year, int month, int day) |
Parameter & | setDefaultDate (const string &date) |
bool | isTime (void) const |
int | hour (int index=0) const |
int | minutes (int index=0) const |
int | seconds (int index=0) const |
int | milliSeconds (int index=0) const |
void | time (int &hour, int &minutes, int &seconds, int &milliseconds, int index=0) const |
Parameter & | setTime (int hour, int minutes, int seconds, int milliseconds=0) |
Parameter & | addTime (int hour, int minutes, int seconds, int milliseconds=0) |
Parameter & | setTime (const string &time) |
Parameter & | setTime (const struct tm &time) |
Parameter & | setTime (const time_t &time) |
Parameter & | setCurrentTime (void) |
Parameter & | setTime (const Parameter &p) |
int | defaultHour (int index=0) const |
int | defaultMinutes (int index=0) const |
int | defaultSeconds (int index=0) const |
int | defaultMilliSeconds (int index=0) const |
void | defaultTime (int &hour, int &minutes, int &seconds, int &milliseconds, int index=0) const |
Parameter & | setDefaultTime (int hour, int minutes, int seconds, int milliseconds=0) |
Parameter & | addDefaultTime (int hour, int minutes, int seconds, int milliseconds=0) |
Parameter & | setDefaultTime (const string &time) |
bool | isNotype (void) const |
bool | empty (void) const |
Parameter & | setDefault (void) |
Parameter & | setToDefault (void) |
Parameter & | setActivation (const string &name, const string &value, bool activate=true) |
Parameter & | addActivation (const string &name, const string &value, bool activate=true) |
Parameter & | clearActivation (void) |
int | activations () const |
string | activationName (int index=0) const |
string | activationValue (int index=0) const |
string | activationValues (int index=0) const |
double | activationNumber (int index=0) const |
string | activationUnit (int index=0) const |
int | activationComparison (int index=0) const |
bool | activation (int index=0) const |
bool | testActivation (int index, const string &value) |
bool | testActivation (int index, double value, double tol=1e-8) |
string | save (int flags=0) const |
ostream & | save (ostream &str, int width=0, int flags=0) const |
ostream & | save (ostream &str, const string &textformat, const string &numberformat, const string &boolformat, const string &dateformat, const string &timeformat) const |
ostream & | saveXML (ostream &str, int level=0, int indent=4, int flags=0) const |
bool | read (const Str &s, const string &assignment=":=") |
bool | read (const Parameter &p) |
Parameter & | addSelectOption (const std::string &option) |
Parameter & | removeSelectOption (const std::string &option) |
Parameter & | clearSelectOptions () |
const std::set< std::string > & | selectOptions () const |
std::string | selectOption (int index) const |
int | selectOptionsSize () const |
Static Public Member Functions | |
static int | changedFlag (void) |
static double | floorLog10 (double v) |
static double | floor10 (double v, double scale=1.0) |
static double | ceil10 (double v, double scale=1.0) |
static double | changeUnit (double val, const Str &oldunit, const Str &newunit) |
Static Public Attributes | |
static const int | ChangedFlag = 16384 |
static const int | NonDefault = -32768 |
static const long | SelectText = 0x01000000 |
static const long | MultipleSelection = 0x00800000 |
static const int | ListAlways = 0x02000000 |
static const int | Select = 0x00400000 | MultipleSelection |
Friends | |
bool | operator== (const Parameter &p1, const Parameter &p2) |
bool | operator== (const Parameter &p, const string &name) |
ostream & | operator<< (ostream &str, const Parameter &p) |
A Parameter has a name, value and unit.
enum ValueType |
Type of the parameter's value.
Enumerator | |
---|---|
NoType |
No type specified yet. |
Text |
The parameter's value is a string. |
Number |
The parameter's value is a floating point number. |
Integer |
The parameter's value is an integer. |
Boolean |
The parameter's value is a boolean. |
AnyNumber |
The parameter's value is a floating point number, an integer, or a boolean. |
Date |
The parameter's value is a date that contains year, month, and day. |
Time |
The parameter's value is a time that contains hour, minutes, and seconds. |
Section |
A section.
|
Parameter | ( | void | ) |
Construct a single Parameter. Use setValueType() to define the type of the parameter, setRequest() to define the request string, which is used for dialogs, setName() to give the parameter a unique name. With the set*() functions, the values of the parameter can be initialized.
References Parameter::clear().
Copy constructor.
References Parameter::assign().
Parameter | ( | const string & | name, |
const string & | request, | ||
const string & | strg, | ||
int | flags = 0 , |
||
int | style = 0 , |
||
Options * | parentsection = 0 |
||
) |
Construct and initialize a single Parameter of type Text. Its value an its default value are set to strg.
References Parameter::clear(), Parameter::setDefaultText(), Parameter::setFlags(), Parameter::setStyle(), Parameter::setText(), and Parameter::Text.
Parameter | ( | const string & | name, |
const string & | request, | ||
const char * | strg, | ||
int | flags = 0 , |
||
int | style = 0 , |
||
Options * | parentsection = 0 |
||
) |
Construct and initialize a single Parameter of type Text. Its value an its default value are set to strg.
References Parameter::clear(), Parameter::setDefaultText(), Parameter::setFlags(), Parameter::setStyle(), Parameter::setText(), and Parameter::Text.
Parameter | ( | const string & | name, |
const string & | request, | ||
double | number, | ||
double | error, | ||
double | minimum = -MAXDOUBLE , |
||
double | maximum = MAXDOUBLE , |
||
double | step = 1.0 , |
||
const string & | internunit = "" , |
||
const string & | outputunit = "" , |
||
const string & | format = "" , |
||
int | flags = 0 , |
||
int | style = 0 , |
||
Options * | parentsection = 0 |
||
) |
Construct and initialize a single Parameter of type Number. Its value and its default value are set to number, its standard deviation to error. The allowed range for its value is defined by minimum and maximum. The unit of the number is interunit. For output and dialogs outputunit is used as unit.
References Parameter::clear(), Parameter::Number, Parameter::setDefaultNumber(), Parameter::setFlags(), Parameter::setFormat(), Parameter::setMinMax(), Parameter::setNumber(), Parameter::setStyle(), and Parameter::setUnit().
Parameter | ( | const string & | name, |
const string & | request, | ||
double | number, | ||
const string & | unit = "" , |
||
const string & | format = "" , |
||
int | flags = 0 , |
||
int | style = 0 , |
||
Options * | parentsection = 0 |
||
) |
Construct and initialize a single Parameter of type Number. Its value and its default value are set to number, its standard deviation to 0.0. The unit of the number is unit.
References Parameter::clear(), Parameter::Number, Parameter::setDefaultNumber(), Parameter::setFlags(), Parameter::setFormat(), Parameter::setNumber(), Parameter::setStyle(), and Parameter::setUnit().
Parameter | ( | const string & | name, |
const string & | request, | ||
const vector< double > & | numbers, | ||
const vector< double > & | errors, | ||
double | minimum = -MAXDOUBLE , |
||
double | maximum = MAXDOUBLE , |
||
double | step = 1.0 , |
||
const string & | internunit = "" , |
||
const string & | outputunit = "" , |
||
const string & | format = "" , |
||
int | flags = 0 , |
||
int | style = 0 , |
||
Options * | parentsection = 0 |
||
) |
Construct and initialize a single Parameter of type Number. Its values are set to numbers, its default value is set to numbers[0], its standard deviation to error. The allowed range for its value is defined by minimum and maximum. The unit of the number is interunit. For output and dialogs outputunit is used as unit.
References Parameter::clear(), Parameter::Number, Parameter::setDefaultNumber(), Parameter::setFlags(), Parameter::setFormat(), Parameter::setMinMax(), Parameter::setNumbers(), Parameter::setStyle(), and Parameter::setUnit().
Parameter | ( | const string & | name, |
const string & | request, | ||
long | number, | ||
long | error = -1 , |
||
long | minimum = LONG_MIN , |
||
long | maximum = LONG_MAX , |
||
long | step = 1 , |
||
const string & | internunit = "" , |
||
const string & | outputunit = "" , |
||
int | width = 0 , |
||
int | flags = 0 , |
||
int | style = 0 , |
||
Options * | parentsection = 0 |
||
) |
Construct and initialize a single Parameter of type Integer. Its value an its default value are set to number, its standard deviation to error. The allowed range for its value is defined by minimum and maximum. The unit of the number is interunit. For output and dialogs outputunit is used as unit.
References Parameter::clear(), Parameter::Integer, Parameter::setDefaultInteger(), Parameter::setFlags(), Parameter::setFormat(), Parameter::setInteger(), Parameter::setMinMax(), Parameter::setStyle(), and Parameter::setUnit().
Parameter | ( | const string & | name, |
const string & | request, | ||
bool | dflt, | ||
int | flags = 0 , |
||
int | style = 0 , |
||
Options * | parentsection = 0 |
||
) |
Construct and initialize a single Parameter of type Boolean. Its value and its default value are set to dflt.
References Parameter::Boolean, Parameter::clear(), Parameter::setBoolean(), Parameter::setDefaultBoolean(), Parameter::setFlags(), and Parameter::setStyle().
Parameter | ( | const string & | name, |
const string & | request, | ||
ValueType | type, | ||
int | yearhour, | ||
int | monthminutes, | ||
int | dayseconds, | ||
int | flags = 0 , |
||
int | style = 0 , |
||
Options * | parentsection = 0 |
||
) |
Construct and initialize a single Parameter of type Date or Time. Its value and its default value are set to yearhour, monthminutes and dayseconds.
References Parameter::clear(), Parameter::Date, Parameter::isDate(), Parameter::setDate(), Parameter::setDefaultDate(), Parameter::setDefaultTime(), Parameter::setFlags(), Parameter::setStyle(), Parameter::setTime(), and Parameter::Time.
Parameter | ( | const string & | name, |
const string & | request, | ||
int | hour, | ||
int | minutes, | ||
int | seconds, | ||
int | milliseconds, | ||
int | flags = 0 , |
||
int | style = 0 , |
||
Options * | parentsection = 0 |
||
) |
Construct and initialize a single Parameter of type Time. Its value and its default value are set to hour, minutes, seconds, and milliseconds.
References Parameter::clear(), Parameter::setDefaultTime(), Parameter::setFlags(), Parameter::setFormat(), Parameter::setStyle(), Parameter::setTime(), and Parameter::Time.
Parameter | ( | const string & | name, |
const string & | value | ||
) |
Create parameter with name name and value value. The value type is set appropriately.
References Parameter::assign(), Parameter::ChangedFlag, Parameter::clear(), Str::empty(), Str::erase(), Str::mid(), Parameter::name(), Parameter::NoType, Parameter::request(), Str::rfind(), Parameter::setToDefault(), Str::size(), Str::strip(), and Str::WhiteSpace.
Parameter & clear | ( | const string & | name = "" , |
const string & | request = "" , |
||
ValueType | type = NoType |
||
) |
Clear the parameter. Set the identity string to name, the request string to request, and the type to type. The value of the parameter and the default value is cleared. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::ChangedFlag, Parameter::clearSelectOptions(), StrQueue::empty(), Str::empty(), Parameter::name(), Parameter::request(), StrQueue::resize(), and Parameter::setFormat().
Referenced by Parameter::Parameter().
Copy content of parameter p to this. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::assign().
Copy content of parameter p to this. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::ChangedFlag, and StrQueue::empty().
Referenced by Parameter::operator=(), Parameter::Parameter(), and Parameter::read().
Parameter & operator= | ( | const string & | value | ) |
Set the value of a parameter depending on its type to the content of the string value. If the type of the parameter is Number, Integer, or Boolean, value is first splitted into a number and a unit. If the parameter has no type, it is set to Number if value contains a floating point number or a unit, Integer if value is an integer number, Boolean if value equals either "true" or "false", otherwise it is set to Text. The warning message is set if value is invalid. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::assign().
Parameter & assign | ( | const string & | value | ) |
Set the value of a parameter depending on its type to the content of the string value. If the type of the parameter is Number, Integer, or Boolean, value is first splitted into a number and a unit. If the parameter has no type, it is set to Number if value contains a floating point number or a unit, Integer if value is an integer number, Boolean if value equals either "true" or "false", otherwise it is set to Text. The warning message is set if value is invalid. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::addDate(), Parameter::addNumber(), Parameter::addSelectOption(), Parameter::addTime(), StrQueue::assign(), Parameter::Boolean, Parameter::ceil10(), Parameter::clearSelectOptions(), Parameter::Date, Str::date(), Parameter::date(), Parameter::day(), Str::Digit, Str::DoubleWhiteSpace, Str::empty(), StrQueue::erase(), Parameter::error(), StrQueue::find(), Parameter::hour(), Parameter::Integer, Parameter::integer(), Parameter::isNotype(), Parameter::isText(), relacs::max(), Parameter::minutes(), Parameter::month(), Parameter::Number, Parameter::number(), relacs::pow(), StrQueue::resize(), Parameter::seconds(), Parameter::Select, Parameter::SelectText, Parameter::selectText(), Parameter::setFormat(), Parameter::setMinMax(), Parameter::setStep(), Parameter::setText(), Parameter::setUnit(), Parameter::setValueType(), StrQueue::size(), Parameter::size(), Parameter::step(), StrQueue::strip(), Parameter::style(), Parameter::Text, Parameter::Time, Str::time(), Parameter::time(), Parameter::unit(), and Parameter::year().
Assing the value of to this, but only if they have the same type. The warning message is set if p is of different type. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::ChangedFlag, StrQueue::empty(), and Parameter::valueType().
Options * parentSection | ( | void | ) |
const Options * parentSection | ( | void | ) | const |
void setParentSection | ( | Options * | parentsection | ) |
Set the parent Options of this Parameter to parent.
Referenced by Options::insert(), and Options::load().
bool nonDefault | ( | void | ) | const |
Returns true
if the value differs from the default.
References Parameter::isAnyNumber(), Parameter::isDate(), Parameter::isText(), and Parameter::isTime().
Referenced by Parameter::flags().
Str warning | ( | void | ) | const |
Returns the warning messages of the last called Parameter member-function.
Referenced by Options::addBoolean(), Options::addDate(), Options::addInteger(), Options::addNumber(), Options::addText(), Options::addTime(), Options::insertBoolean(), Options::insertDate(), Options::insertInteger(), Options::insertNumber(), Options::insertText(), Options::insertTime(), and Options::load().
Str name | ( | void | ) | const |
Returns the identity string.
Referenced by Parameter::clear(), relacs::operator==(), Parameter::Parameter(), Parameter::read(), Options::readAppend(), Parameter::save(), Parameter::saveXML(), Parameter::setBoolean(), Parameter::setDate(), Parameter::setInteger(), Parameter::setName(), Parameter::setNumber(), MacroEditor::setRepros(), Parameter::setText(), and Parameter::setTime().
Parameter & setName | ( | const string & | name | ) |
Set identity string to name.
References Parameter::name().
Str request | ( | void | ) | const |
Returns the request string.
Referenced by Parameter::clear(), Parameter::Parameter(), Parameter::save(), Parameter::saveXML(), and Parameter::setRequest().
Parameter & setRequest | ( | const string & | request | ) |
Set request string to request.
References Parameter::request().
Parameter::ValueType valueType | ( | void | ) | const |
The type of the parameter.
Referenced by Parameter::setValue(), and Parameter::valueType().
bool valueType | ( | int | mask | ) | const |
true
if one of the bits specified by mask corresponds to the parameter's type, or mask equals zero, or mask is negative and the parameter's type is not contained in abs( mask ). References Parameter::valueType().
Set type of parameter to typex.
Referenced by Parameter::addText(), and Parameter::assign().
int flags | ( | void | ) | const |
The flags of the parameter.
Referenced by Parameter::addFlags(), Parameter::flags(), and Parameter::setFlags().
bool flags | ( | int | selectflag | ) | const |
True if one of the bits specified by selectflag is set in the parameter's flags, or selectflag equals zero, or selectflag is negative and the parameter's value differs from the default value and abs(selectflag) is set in the parameter's flags, or selectflag equals NonDefault and the parameter's values differs from the default value.
References relacs::abs(), Parameter::flags(), Parameter::NonDefault, and Parameter::nonDefault().
Parameter & setFlags | ( | int | flags | ) |
Set flags of parameter to flags.
References Parameter::flags().
Referenced by MetaDataGroup::addRecordingOptions(), and Parameter::Parameter().
Parameter & addFlags | ( | int | flags | ) |
Add the bits specified by flags to the parameter's flags.
References Parameter::flags().
Referenced by Options::read().
Parameter & delFlags | ( | int | flags | ) |
Clear the bits specified by flags of the parameter's flags.
Parameter & clearFlags | ( | void | ) |
Clear all bits of the parameter's flags.
|
static |
The flag that is used to mark options whose value has been changed. It is preset to a constant value (16384) and cannot be changed by the user.
References Parameter::ChangedFlag.
Referenced by ConfigDialog::notificationFromDialog().
bool changed | ( | void | ) | const |
Return true
if the changedFlag() is set, i.e. whose value has been changed.
References Parameter::ChangedFlag.
int style | ( | void | ) | const |
The style of the parameter.
Referenced by Parameter::addStyle(), Parameter::assign(), NumberItemDelegate::createEditor(), ComboItemDelegate::createEditor(), Parameter::read(), Parameter::save(), and Parameter::setStyle().
Parameter & setStyle | ( | int | style | ) |
Set style of parameter to style.
References Parameter::style().
Referenced by Parameter::Parameter(), and Settings::Settings().
Parameter & addStyle | ( | int | style | ) |
Add the bits specified by style to the parameter's style.
References Parameter::style().
Parameter & delStyle | ( | int | style | ) |
Clear the bits specified by style of the parameter's style.
Str format | ( | void | ) | const |
Returns the format string.
Referenced by NumberItemDelegate::createEditor(), Parameter::save(), Parameter::saveXML(), Parameter::setFormat(), and Parameter::testActivation().
Parameter & setFormat | ( | int | width, |
int | prec = -1 , |
||
char | fmt = '-' |
||
) |
Set format string for numbers to have a width of width and precision of prec. The width width can be negative to indicate left aligned output. The type is set to fmt which can be either 'f', 'g' or 'e', according to the ANSI C printf double formats or 's' for text. The default is 'g' for numbers and 's' for strings. The warning message is set if w, prec or fmt are invalid. Does nothing if the parameter is a date or time.
References Parameter::format(), Parameter::isBoolean(), Parameter::isDate(), Parameter::isInteger(), Parameter::isNumber(), and Parameter::isTime().
Referenced by TableKey::addText(), Parameter::assign(), Parameter::clear(), TableKey::insertText(), and Parameter::Parameter().
Parameter & setFormat | ( | const string & | format = "" | ) |
Set format string to format (ANSI C printf() syntax, only 'g', 'f', 'e' formats are allowed, since the number is a double). For example, "%5.1f" is an valid format string. The warning message is set if format is invalid. See text() for an detailed description of formats.
References Parameter::format(), Parameter::isBoolean(), Parameter::isDate(), Parameter::isInteger(), Parameter::isNumber(), and Parameter::isTime().
int formatWidth | ( | void | ) | const |
Returns the width of the expanded format string.
References Str::totalWidth().
int size | ( | void | ) | const |
If several values correspond to this parameter size() returns the number of values.
References Parameter::isAnyNumber(), Parameter::isDate(), Parameter::isText(), Parameter::isTime(), and StrQueue::size().
Referenced by Parameter::addDefaultText(), Parameter::addText(), Parameter::allText(), Parameter::assign(), Parameter::booleans(), ControlTabs::createControls(), Parameter::errors(), Parameter::integers(), Parameter::numbers(), Parameter::read(), RELACSWidget::RELACSWidget(), Parameter::save(), Parameter::saveXML(), Parameter::selectText(), FilterSelector::setInputTraces(), and Parameter::texts().
bool isText | ( | void | ) | const |
True if parameter is of type text.
References Parameter::Text.
Referenced by Parameter::addDefaultInteger(), Parameter::addDefaultNumber(), Parameter::addInteger(), Parameter::addNumber(), Parameter::assign(), Parameter::boolean(), Parameter::booleans(), Parameter::defaultBoolean(), Parameter::defaultInteger(), Parameter::defaultNumber(), Parameter::defaultText(), Parameter::error(), Parameter::errors(), Parameter::index(), Parameter::integer(), Parameter::integers(), Parameter::nonDefault(), Parameter::number(), Parameter::numbers(), Parameter::read(), TableKey::save(), Parameter::save(), Parameter::saveXML(), Parameter::selectText(), Parameter::setBoolean(), Parameter::setDefaultBoolean(), Parameter::setDefaultInteger(), Parameter::setDefaultNumber(), Parameter::setInteger(), Parameter::setNumber(), Parameter::setNumbers(), Parameter::setText(), Parameter::size(), and Parameter::text().
Str text | ( | int | index, |
const string & | format = "" , |
||
const string & | unit = "" |
||
) | const |
Returns the index-th value of a parameter. It is formatted as specified by the format string. s is the text string. If the text string is a file path (e.g. example/data.tar.gz), then p is the path of the file (e.g. example/), d is the full file name (e.g. data.tar.gz), n is the basename of the file name (e.g. data), and x is the extension (e.g. tar.gz). If the parameter is a number (float, integer, boolean), then f, g, e is the number value, F, G, E is the number error, and b is a boolean value expressed as true or false. If the parameter is a time, then S: second (0..59), M: minute (0..59), H: hour (0..23). If the parameter is a date, then d: day of month (1..31), m: month (1..12), y: last two digits of year (0..99), Y: year (1970...). u is the unit string, i is the name (identifier) string, and r is the request string. T is the type of the parameter as a human readable string. If format is empty, the format set by setFormat() is used. If the parameter is a number, then its value is returned in the unit specified by unit. If unit is empty, the outUnit() is used.
References Parameter::changeUnit(), Str::dir(), Str::empty(), Str::extension(), Str::format(), Parameter::index(), Parameter::isAnyNumber(), Parameter::isBoolean(), Parameter::isDate(), Parameter::isInteger(), Parameter::isNumber(), Parameter::isText(), Parameter::isTime(), Str::name(), Str::notdir(), Str::replace(), and StrQueue::size().
Referenced by Parameter::allText(), ControlTabs::createControls(), Macro::expandParameter(), Parameter::read(), RELACSWidget::RELACSWidget(), TableKey::save(), Parameter::save(), Parameter::saveXML(), FilterSelector::setInputTraces(), Parameter::text(), OptWidgetMultiText::textChanged(), and Parameter::texts().
Str text | ( | const string & | format = "" , |
const string & | unit = "" |
||
) | const |
Returns the first value of a parameter. It is formatted as specified by the format string. See text() for more details. If the parameter is a number, then its value is returned in the unit specified by unit. If unit is empty, then outUnit() is used.
References Parameter::text().
void texts | ( | vector< string > & | s, |
const string & | format = "" , |
||
const string & | unit = "" |
||
) | const |
Return in s all values of the parameter as a list of strings formatted according to format using unit. See text() for details.
References Parameter::size(), and Parameter::text().
Str allText | ( | const string & | format = "" , |
const string & | unit = "" , |
||
const string & | separator = ", " |
||
) | const |
Return all values of the parameter formatted according to format using unit, and concatenated using separator. See text() for details.
References Parameter::size(), and Parameter::text().
Parameter & setText | ( | const string & | strg | ) |
Set value of text parameter to strg. The text is splitted into several strings at each '|'. Each of the strings is also converted into numbers. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::addText().
Referenced by Parameter::assign(), Parameter::Parameter(), OptWidgetMultiText::setParameter(), TableKey::setText(), and OptWidgetText::textChanged().
Set value of text parameter to the one of p, if this and p are both of valueType() Text. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::ChangedFlag, Parameter::isText(), Parameter::name(), and StrQueue::size().
Parameter & addText | ( | const string & | strg, |
bool | clear = false |
||
) |
Add strg to values of text parameter. strg is also converted into a number. If clear is true then the current value of the parameter is erased prior to adding strg. If the value of the parameter is changing then the changedFlag() is set.
References StrQueue::add(), Parameter::addDate(), Parameter::addNumber(), Parameter::addTime(), StrQueue::assign(), Parameter::ChangedFlag, StrQueue::clear(), Parameter::day(), StrQueue::empty(), Parameter::empty(), StrQueue::erase(), Parameter::hour(), Parameter::isDate(), Parameter::isNotype(), Parameter::isTime(), Parameter::minutes(), Parameter::month(), Str::preventFirst(), Str::preventLast(), Parameter::seconds(), Parameter::setValueType(), StrQueue::size(), Parameter::size(), StrQueue::strip(), Parameter::Text, and Parameter::year().
Referenced by InputConfig::dialogClosed(), OutputConfig::dialogClosed(), SaveFiles::RelacsFiles::openStimulusFiles(), Parameter::read(), OptWidgetMultiText::setParameter(), and Parameter::setText().
Str defaultText | ( | int | index, |
const string & | format = "" , |
||
const string & | unit = "" |
||
) | const |
Returns the default text value. It is formatted as specified by the format string. See text() for details.
References Parameter::changeUnit(), Str::dir(), Str::empty(), Str::extension(), Str::format(), Parameter::index(), Parameter::isAnyNumber(), Parameter::isBoolean(), Parameter::isDate(), Parameter::isInteger(), Parameter::isNumber(), Parameter::isText(), Parameter::isTime(), Str::name(), Str::notdir(), and StrQueue::size().
Referenced by Parameter::defaultText(), and MacroEditor::setRepros().
Str defaultText | ( | const string & | format = "" , |
const string & | unit = "" |
||
) | const |
References Parameter::defaultText().
Parameter & setDefaultText | ( | const string & | strg | ) |
Set default value of text parameter to strg. The text is splitted into several strings at each '|'. Each of the strings is also converted into numbers.
References Parameter::addDefaultText(), and StrQueue::clear().
Referenced by Parameter::Parameter().
Parameter & addDefaultText | ( | const string & | strg | ) |
Add strg to default values of text parameter. strg is also converted into a number.
References StrQueue::add(), Parameter::addDefaultDate(), Parameter::addDefaultNumber(), Parameter::addDefaultTime(), StrQueue::assign(), Parameter::day(), StrQueue::empty(), Parameter::empty(), StrQueue::erase(), Parameter::hour(), Parameter::isDate(), Parameter::isTime(), Parameter::minutes(), Parameter::month(), Str::preventFirst(), Str::preventLast(), Parameter::seconds(), StrQueue::size(), Parameter::size(), StrQueue::strip(), and Parameter::year().
Referenced by Parameter::setDefaultText().
Parameter & selectText | ( | const string & | strg, |
int | add = 0 |
||
) |
If the text parameter has several values, then the value that is matched by strg is inserted as the first value. If strg does not match any of the text values strg is added to the text values and is marked as selected if add > 0, or if add == 0 and the SelectText - Bit in the Parameter's style is not set. If the value of the parameter is changing then the changedFlag() is set.
References StrQueue::add(), Parameter::addDate(), Parameter::addNumber(), Parameter::addTime(), StrQueue::assign(), Parameter::ChangedFlag, Parameter::day(), StrQueue::empty(), Parameter::empty(), StrQueue::erase(), StrQueue::find(), Parameter::hour(), StrQueue::insert(), Parameter::isDate(), Parameter::isText(), Parameter::isTime(), Parameter::minutes(), Parameter::month(), Str::preventFirst(), Str::preventLast(), Parameter::seconds(), Parameter::SelectText, StrQueue::size(), Parameter::size(), StrQueue::strip(), and Parameter::year().
Referenced by Parameter::assign(), and Parameter::read().
Parameter & selectText | ( | int | index | ) |
If the text parameter has several values, then the index-th value is selected by inserting it as the first value.
References Parameter::addDate(), Parameter::addNumber(), Parameter::addTime(), Parameter::ChangedFlag, Parameter::day(), StrQueue::find(), Parameter::hour(), StrQueue::insert(), Parameter::isDate(), Parameter::isText(), Parameter::isTime(), Parameter::minutes(), Parameter::month(), Parameter::seconds(), StrQueue::size(), and Parameter::year().
int index | ( | void | ) | const |
Returns the index of the selected value, i.e. the index minus one of the matching value with the first value.
References StrQueue::find(), and Parameter::isText().
Referenced by Parameter::activation(), Parameter::activationComparison(), Parameter::activationName(), Parameter::activationNumber(), Parameter::activationUnit(), Parameter::activationValue(), Parameter::activationValues(), Parameter::date(), Parameter::day(), Parameter::defaultDate(), Parameter::defaultDay(), Parameter::defaultHour(), Parameter::defaultMilliSeconds(), Parameter::defaultMinutes(), Parameter::defaultMonth(), Parameter::defaultSeconds(), Parameter::defaultText(), Parameter::defaultTime(), Parameter::defaultYear(), Parameter::error(), Parameter::hour(), Parameter::milliSeconds(), Parameter::minutes(), Parameter::month(), Parameter::seconds(), Parameter::testActivation(), Parameter::text(), Parameter::time(), and Parameter::year().
int index | ( | const string & | strg | ) | const |
Returns the index of the value that matches strg.
References StrQueue::find(), and Parameter::isText().
bool isAnyNumber | ( | void | ) | const |
True if the parameter is of type Number, Integer, or Boolean.
References Parameter::Boolean, Parameter::Integer, and Parameter::Number.
Referenced by Parameter::addDefaultInteger(), Parameter::addDefaultNumber(), Parameter::addInteger(), Parameter::addNumber(), Parameter::boolean(), Parameter::booleans(), Parameter::defaultBoolean(), Parameter::defaultInteger(), Parameter::defaultNumber(), Parameter::defaultText(), Parameter::error(), Parameter::errors(), Parameter::integer(), Parameter::integers(), Parameter::maximum(), Parameter::minimum(), Parameter::nonDefault(), Parameter::number(), Parameter::numbers(), Parameter::read(), Parameter::setBoolean(), Parameter::setDefaultBoolean(), Parameter::setDefaultInteger(), Parameter::setDefaultNumber(), Parameter::setInteger(), Parameter::setMinMax(), Parameter::setNumber(), Parameter::setNumbers(), Parameter::setStep(), Parameter::size(), Parameter::step(), and Parameter::text().
bool isNumber | ( | void | ) | const |
True if parameter is of type Number, i.e. its value is a floating-point number.
References Parameter::Number.
Referenced by NumberItemDelegate::createEditor(), Parameter::defaultText(), Macro::expandParameter(), Parameter::save(), Parameter::saveXML(), Parameter::setFormat(), Parameter::setNumber(), and Parameter::text().
double number | ( | const string & | unit = "" , |
int | index = 0 , |
||
double | dflt = 0.0 |
||
) | const |
Returns the index-th number value in the unit unit or in the internal standard unit, if unit is an empty string. If the Parameter is not a number, dflt is returned.
References Parameter::changeUnit(), Parameter::isAnyNumber(), and Parameter::isText().
Referenced by Parameter::assign(), Parameter::integer(), and Parameter::saveXML().
|
inline |
Returns the index-th number value in the unit unit or in the internal standard unit, if unit is an empty string. If the Parameter is not a number, dflt is returned.
|
inline |
Returns the index-th number value in the unit unit or in the internal standard unit, if unit is an empty string. If the Parameter is not a number, dflt is returned.
void numbers | ( | vector< double > & | n, |
const string & | unit = "" |
||
) | const |
Return in n all number-values of the parameter in the unit unit.
References Parameter::changeUnit(), Parameter::isAnyNumber(), Parameter::isText(), and Parameter::size().
double error | ( | const string & | unit = "" , |
int | index = 0 |
||
) | const |
Returns the standard deviation value of the index-th number in the unit unit or in the internal standard unit, if unit is an empty string. If no error value is set -1 is returned.
References Parameter::changeUnit(), Parameter::index(), Parameter::isAnyNumber(), and Parameter::isText().
Referenced by Parameter::assign(), Parameter::save(), and Parameter::saveXML().
|
inline |
Returns the standard deviation value of the index-th number in the unit unit or in the internal standard unit, if unit is an empty string. If no error value is set -1 is returned.
void errors | ( | vector< double > & | n, |
const string & | unit = "" |
||
) | const |
Return in n all error-values of the parameter in the unit unit.
References Parameter::changeUnit(), Parameter::isAnyNumber(), Parameter::isText(), and Parameter::size().
Parameter & setNumber | ( | double | number, |
double | error, | ||
const string & | unit = "" |
||
) |
Set number value to number and its standard deviation to error (only if it is non negative). The text value is set according to the specified format. The warning message is set if number is invalid. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::addNumber(), Parameter::isAnyNumber(), and Parameter::isText().
Referenced by Options::addNumber(), Parameter::Parameter(), Parameter::setBoolean(), Parameter::setInteger(), TableKey::setNumber(), Parameter::setNumbers(), and OptWidgetNumber::valueChanged().
|
inline |
Set number value to number. The text value is set according to the specified format. The warning message is set if number is invalid. If the value of the parameter is changing then the changedFlag() is set.
Parameter & setNumbers | ( | const vector< double > & | numbers, |
const vector< double > & | errors, | ||
const string & | unit = "" |
||
) |
Set values to numbers and their standard deviations to errors. The text values are set according to the specified format. The warning message is set if numbers is invalid. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::addNumber(), Parameter::isAnyNumber(), Parameter::isText(), StrQueue::resize(), and Parameter::setNumber().
Referenced by Parameter::Parameter().
|
inline |
Set values to numbers and their standard deviation to error. The text values are set according to the specified format. The warning message is set if numbers is invalid. If the value of the parameter is changing then the changedFlag() is set.
|
inline |
Set values to numbers and their standard deviation to -1.0. The text values are set according to the specified format. The warning message is set if numbers is invalid. If the value of the parameter is changing then the changedFlag() is set.
Set number value, error, and unit to the ones of p, if this and p are both of valueType() Number. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::ChangedFlag, Parameter::isNumber(), and Parameter::name().
Parameter & addNumber | ( | double | number, |
double | error, | ||
const string & | unit = "" , |
||
bool | clear = false |
||
) |
Add number to the number values and their standard deviation to error (only if it is non negative). A text value is added according to the specified format. The warning message is set if number is invalid. If the value of the parameter is changing then the changedFlag() is set. clear clears all values before adding the number (for internal use)
References Parameter::ChangedFlag, Parameter::changeUnit(), StrQueue::clear(), Str::empty(), Parameter::isAnyNumber(), Parameter::isBoolean(), Parameter::isText(), and Parameter::setUnit().
Referenced by Parameter::addInteger(), Parameter::addNumber(), Parameter::addText(), Parameter::assign(), InputConfig::dialogClosed(), OutputConfig::dialogClosed(), SaveFiles::RelacsFiles::openStimulusFiles(), Parameter::selectText(), Parameter::setNumber(), and Parameter::setNumbers().
|
inline |
Add number to the number values. A text value is added according to the specified format. The warning message is set if number is invalid. If the value of the parameter is changing then the changedFlag() is set.
Interpret s as a number and add it to the number values. The warning message is set if s is invalid. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::addNumber(), Parameter::isAnyNumber(), Parameter::isText(), Str::number(), and Parameter::unit().
bool isInteger | ( | void | ) | const |
True if parameter is of type Integer, i.e. its value is a integer number.
References Parameter::Integer.
Referenced by Parameter::defaultText(), Parameter::save(), Parameter::saveXML(), Parameter::setFormat(), Parameter::setInteger(), and Parameter::text().
long integer | ( | const string & | unit = "" , |
int | index = 0 , |
||
long | dflt = 0 |
||
) | const |
Returns the index-th integer value in the unit unit or in the internal standard unit, if unit is an empty string. If the Parameter is not a number, dflt is returned.
References Parameter::isAnyNumber(), Parameter::isText(), and Parameter::number().
Referenced by Parameter::assign().
|
inline |
Returns the index-th integer value in the unit unit or in the internal standard unit, if unit is an empty string. If the Parameter is not a number, dflt is returned.
|
inline |
Returns the index-th integer value in the unit unit or in the internal standard unit, if unit is an empty string. If the Parameter is not a number, dflt is returned.
void integers | ( | vector< long > & | n, |
const string & | unit = "" |
||
) | const |
Return in n all integer-values of the parameter in the unit unit.
References Parameter::changeUnit(), Parameter::isAnyNumber(), Parameter::isText(), and Parameter::size().
void integers | ( | vector< int > & | n, |
const string & | unit = "" |
||
) | const |
Return in n all integer-values of the parameter in the unit unit.
References Parameter::changeUnit(), Parameter::isAnyNumber(), Parameter::isText(), and Parameter::size().
Parameter & setInteger | ( | long | number, |
long | error, | ||
const string & | unit = "" |
||
) |
Set integer value to number and its standard deviation to error. The warning message is set if number is invalid. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::isAnyNumber(), Parameter::isText(), and Parameter::setNumber().
Referenced by Parameter::Parameter(), and TableKey::setInteger().
|
inline |
Set integer value to number. The warning message is set if number is invalid. If the value of the parameter is changing then the changedFlag() is set.
Set integer value, error, and unit to the ones of p, if this and p are both of valueType() Integer. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::ChangedFlag, Parameter::isInteger(), and Parameter::name().
Parameter & addInteger | ( | long | number, |
long | error, | ||
const string & | unit = "" |
||
) |
Add number and error to the integer values. The warning message is set if number is invalid.
References Parameter::addNumber(), Parameter::isAnyNumber(), and Parameter::isText().
Referenced by InputConfig::dialogClosed(), and OutputConfig::dialogClosed().
|
inline |
Add number to the integer values. The warning message is set if number is invalid.
double defaultNumber | ( | const string & | unit = "" , |
int | index = 0 |
||
) | const |
Returns the default number value in the unit unit or in the internal standard unit, if unit is an empty string.
References Parameter::changeUnit(), Parameter::isAnyNumber(), and Parameter::isText().
Referenced by Parameter::defaultInteger().
|
inline |
Parameter & setDefaultNumber | ( | double | number, |
const string & | unit = "" |
||
) |
Set default number value to number. The default text value is set according to the specified format. The warning message is set if number is invalid.
References Parameter::addDefaultNumber(), StrQueue::clear(), Parameter::isAnyNumber(), and Parameter::isText().
Referenced by Parameter::Parameter(), Parameter::setDefaultBoolean(), and Parameter::setDefaultInteger().
Parameter & addDefaultNumber | ( | double | number, |
const string & | unit = "" |
||
) |
Add number to the default number values. A text value is added according to the specified format. The warning message is set if number is invalid.
References Parameter::changeUnit(), Str::empty(), Parameter::isAnyNumber(), Parameter::isBoolean(), Parameter::isText(), and Parameter::setUnit().
Referenced by Parameter::addDefaultInteger(), Parameter::addDefaultNumber(), Parameter::addDefaultText(), and Parameter::setDefaultNumber().
Interpret s as a number and add it to the default number values. The warning message is set if s is invalid.
References Parameter::addDefaultNumber(), Str::DoubleWhiteSpace, Parameter::isAnyNumber(), Parameter::isText(), Str::number(), and Parameter::unit().
long defaultInteger | ( | const string & | unit = "" , |
int | index = 0 |
||
) | const |
Returns the default ineger value in the unit unit or in the internal standard unit, if unit is an empty string.
References Parameter::defaultNumber(), Parameter::isAnyNumber(), and Parameter::isText().
|
inline |
Parameter & setDefaultInteger | ( | long | dflt, |
const string & | unit = "" |
||
) |
Set default integer value to dflt. The default text value is also set. The warning message is set if dflt is invalid.
References Parameter::isAnyNumber(), Parameter::isText(), and Parameter::setDefaultNumber().
Referenced by Parameter::Parameter().
Parameter & addDefaultInteger | ( | double | number, |
const string & | unit = "" |
||
) |
Add number to the default integer values. A text value is added according to the specified format. The warning message is set if number is invalid.
References Parameter::addDefaultNumber(), Parameter::isAnyNumber(), and Parameter::isText().
double minimum | ( | const string & | unit = "" | ) | const |
Returns the minimum value allowed for number or integer parameter values in the unit unit or in the internal standard unit, if unit is an empty string.
References Parameter::changeUnit(), and Parameter::isAnyNumber().
Referenced by NumberItemDelegate::createEditor(), and Parameter::setMinMax().
double maximum | ( | const string & | unit = "" | ) | const |
Returns the maximum value allowed for number or integer parameter values in the unit unit or in the internal standard unit, if unit is an empty string.
References Parameter::changeUnit(), and Parameter::isAnyNumber().
Referenced by NumberItemDelegate::createEditor(), and Parameter::setMinMax().
double step | ( | const string & | unit = "" | ) | const |
Returns the step size of number or integer parameters in the unit unit or in the internal standard unit, if unit is an empty string.
References Parameter::changeUnit(), and Parameter::isAnyNumber().
Referenced by Parameter::assign(), NumberItemDelegate::createEditor(), Parameter::setMinMax(), and Parameter::setStep().
Parameter & setStep | ( | double | step, |
const string & | unit = "" |
||
) |
References Parameter::changeUnit(), Parameter::isAnyNumber(), and Parameter::step().
Referenced by Parameter::assign(), Parameter::setMinMax(), and Parameter::setStep().
Parameter & setStep | ( | long | step | ) |
References Parameter::isAnyNumber(), and Parameter::setStep().
Parameter & setMinMax | ( | double | minimum = -MAXDOUBLE , |
double | maximum = MAXDOUBLE , |
||
double | step = 1.0 , |
||
const string & | unit = "" |
||
) |
Set minimum and maximum values of a number parameter to minimum and maximum, respectively. The warning message is set if minimum or maximum is invalid.
References Parameter::changeUnit(), Parameter::isAnyNumber(), Parameter::maximum(), Parameter::minimum(), and Parameter::setStep().
Referenced by Parameter::assign(), Parameter::Parameter(), and Parameter::setMinMax().
Parameter & setMinMax | ( | long | minimum = LONG_MIN , |
long | maximum = LONG_MAX , |
||
long | step = 1 , |
||
const string & | unit = "" |
||
) |
Set minimum and maximum values of an integer parameter to minimum and maximum, respectively. The warning message is set if minimum or maximum is invalid.
References Parameter::isAnyNumber(), relacs::max(), Parameter::maximum(), relacs::min(), Parameter::minimum(), Parameter::setMinMax(), and Parameter::step().
|
inline |
Set minimum and maximum values of an integer parameter to minimum and maximum, respectively. The warning message is set if minimum or maximum is invalid.
|
static |
Returns the largest power of ten smaller or equal to v.
References relacs::floor(), relacs::log10(), and relacs::pow().
Referenced by Parameter::ceil10(), and Parameter::floor10().
|
static |
Returns the next smaller multiple of floorLog10( v ). This is flooring to the leading digit. For example: 23.7 -> 20, 1.45 -> 1. scale determines to which digit the number should be floored. For example with scale = 0.1 you get 23.7 -> 23, 1.45 -> 1.4
References relacs::floor(), and Parameter::floorLog10().
|
static |
Returns the next larger multiple of floorLog10( v ). This is ceiling to the leading digit. For example: 23.7 -> 30, 1.45 -> 2. scale determines to which digit the number should be ceiled. For example with scale = 0.1 you get 23.7 -> 24, 1.45 -> 1.5
References relacs::ceil(), and Parameter::floorLog10().
Referenced by Parameter::assign().
Str unit | ( | void | ) | const |
Returns the internal unit of the numbers.
Referenced by Parameter::addDefaultNumber(), Parameter::addNumber(), Parameter::assign(), and Parameter::saveXML().
Str outUnit | ( | void | ) | const |
Returns the unit to be used for output.
Referenced by NumberItemDelegate::createEditor(), Parameter::save(), Parameter::saveXML(), MacroEditor::setRepros(), and OptWidgetNumber::valueChanged().
Parameter & setUnit | ( | const string & | internunit, |
const string & | outputunit = "" |
||
) |
Set unit of numbers to internunit. The unit used for output and dialogs is set to outputunit. If outputunit is empty it is set to internunit.
Referenced by Parameter::addDefaultNumber(), Parameter::addNumber(), TableKey::addText(), Parameter::assign(), AudioMonitor::AudioMonitor(), TableKey::insertText(), and Parameter::Parameter().
Parameter & setOutUnit | ( | const string & | outputunit | ) |
Set the unit used for output and dialogs to outputunit.
Parameter & changeUnit | ( | string | internunit | ) |
Set the unit of numbers to internunit and convert the value of the parameter accordingly.
Referenced by Parameter::addDefaultNumber(), Parameter::addNumber(), Parameter::defaultNumber(), Parameter::defaultText(), Parameter::error(), Parameter::errors(), Parameter::integers(), Parameter::maximum(), Parameter::minimum(), Parameter::number(), Parameter::numbers(), Parameter::read(), Parameter::setMinMax(), Parameter::setStep(), Parameter::step(), Parameter::testActivation(), and Parameter::text().
bool isBoolean | ( | void | ) | const |
True if parameter is of type boolean.
References Parameter::Boolean.
Referenced by Parameter::addDefaultNumber(), Parameter::addNumber(), Parameter::defaultText(), Parameter::save(), Parameter::saveXML(), Parameter::setBoolean(), Parameter::setFormat(), and Parameter::text().
bool boolean | ( | int | index = 0 | ) | const |
Returns the index-th boolean value.
References Parameter::isAnyNumber(), and Parameter::isText().
Referenced by Parameter::save(), and Parameter::saveXML().
void booleans | ( | vector< bool > & | n | ) | const |
Return in n all boolean-values of the parameter.
References Parameter::isAnyNumber(), Parameter::isText(), and Parameter::size().
Parameter & setBoolean | ( | bool | b | ) |
Set value of boolean parameter to b. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::isAnyNumber(), Parameter::isText(), and Parameter::setNumber().
Referenced by Parameter::Parameter(), and OptWidgetBoolean::valueChanged().
Set boolean value to the one of p, if this and p are both of valueType() Boolean. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::ChangedFlag, Parameter::isBoolean(), and Parameter::name().
bool defaultBoolean | ( | int | index = 0 | ) | const |
Returns the index-th default boolean value.
References Parameter::isAnyNumber(), and Parameter::isText().
Parameter & setDefaultBoolean | ( | bool | dflt | ) |
Set default boolean value to dflt.
References Parameter::isAnyNumber(), Parameter::isText(), and Parameter::setDefaultNumber().
Referenced by Parameter::Parameter().
bool isDate | ( | void | ) | const |
True if parameter is of type date.
References Parameter::Date.
Referenced by Parameter::addDate(), Parameter::addDefaultDate(), Parameter::addDefaultText(), Parameter::addText(), Parameter::date(), Parameter::day(), Parameter::defaultDate(), Parameter::defaultDay(), Parameter::defaultMonth(), Parameter::defaultText(), Parameter::defaultTime(), Parameter::defaultYear(), Parameter::month(), Parameter::nonDefault(), Parameter::Parameter(), Parameter::read(), Parameter::save(), Parameter::saveXML(), Parameter::selectText(), Parameter::setDate(), Parameter::setDefault(), Parameter::setDefaultDate(), Parameter::setFormat(), Parameter::setToDefault(), Parameter::size(), Parameter::text(), and Parameter::year().
int year | ( | int | index = 0 | ) | const |
References Parameter::index(), and Parameter::isDate().
Referenced by Parameter::addDefaultText(), Parameter::addText(), Parameter::assign(), Parameter::selectText(), Parameter::setDate(), and Parameter::setDefaultDate().
int month | ( | int | index = 0 | ) | const |
References Parameter::index(), and Parameter::isDate().
Referenced by Parameter::addDefaultText(), Parameter::addText(), Parameter::assign(), Parameter::selectText(), Parameter::setDate(), and Parameter::setDefaultDate().
int day | ( | int | index = 0 | ) | const |
References Parameter::index(), and Parameter::isDate().
Referenced by Parameter::addDefaultText(), Parameter::addText(), Parameter::assign(), Parameter::selectText(), Parameter::setDate(), and Parameter::setDefaultDate().
void date | ( | int & | year, |
int & | month, | ||
int & | day, | ||
int | index = 0 |
||
) | const |
Returns the index-th date.
[out] | year | If Parameter is not a Date or index is invalid, 0 is returned. |
[out] | month | If Parameter is not a Date or index is invalid, 0 is returned. |
[out] | day | If Parameter is not a Date or index is invalid, 0 is returned. |
[in] | index | determines which one of the size() stored date values is returned in year, month, and day. |
References Parameter::index(), and Parameter::isDate().
Referenced by Parameter::assign().
Parameter & setDate | ( | int | year, |
int | month, | ||
int | day | ||
) |
Set date of date parameter to year, month, and day. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::ChangedFlag, StrQueue::clear(), Parameter::day(), and Parameter::isDate().
Referenced by Parameter::Parameter(), Parameter::setCurrentDate(), Parameter::setDate(), and OptWidgetDate::valueChanged().
Parameter & addDate | ( | int | year, |
int | month, | ||
int | day | ||
) |
Add date year, month, and day to date parameter. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::ChangedFlag, and Parameter::isDate().
Referenced by Parameter::addText(), Parameter::assign(), and Parameter::selectText().
Parameter & setDate | ( | const string & | date | ) |
Set date of date parameter to date. See Str::date() for valid date strings. If the value of the parameter is changing then the changedFlag() is set.
References Str::date(), Parameter::day(), Parameter::month(), Parameter::setDate(), and Parameter::year().
Parameter & setDate | ( | const struct tm & | date | ) |
Set date of date parameter to date. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::day(), Parameter::month(), Parameter::setDate(), and Parameter::year().
Parameter & setDate | ( | const time_t & | time | ) |
Set date of date parameter to the date of time. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::setDate().
Parameter & setCurrentDate | ( | void | ) |
Set date of date parameter to the current date. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::setDate(), and Parameter::time().
Set date value to the one of p, if this and p are both of valueType() Date. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::ChangedFlag, Parameter::isDate(), and Parameter::name().
int defaultYear | ( | int | index = 0 | ) | const |
References Parameter::index(), and Parameter::isDate().
int defaultMonth | ( | int | index = 0 | ) | const |
References Parameter::index(), and Parameter::isDate().
int defaultDay | ( | int | index = 0 | ) | const |
References Parameter::index(), and Parameter::isDate().
void defaultDate | ( | int & | year, |
int & | month, | ||
int & | day, | ||
int | index = 0 |
||
) | const |
Returns the index-th default date.
[out] | year | If Parameter is not a Date or index is invalid, 0 is returned. |
[out] | month | If Parameter is not a Date or index is invalid, 0 is returned. |
[out] | day | If Parameter is not a Date or index is invalid, 0 is returned. |
[in] | index | determines which one of the size() stored default date values is returned in year, month, and day. |
References Parameter::index(), and Parameter::isDate().
Parameter & setDefaultDate | ( | int | year, |
int | month, | ||
int | day | ||
) |
Set default date of date parameter to year, month, and day.
References StrQueue::clear(), and Parameter::isDate().
Referenced by Parameter::Parameter(), and Parameter::setDefaultDate().
Parameter & addDefaultDate | ( | int | year, |
int | month, | ||
int | day | ||
) |
Add year, month, and day to default date of date parameter.
References Parameter::isDate().
Referenced by Parameter::addDefaultText().
Parameter & setDefaultDate | ( | const string & | date | ) |
Set default date of date parameter to date. See Str::date() for valid date strings.
References Str::date(), Parameter::day(), Parameter::month(), Parameter::setDefaultDate(), and Parameter::year().
bool isTime | ( | void | ) | const |
True if parameter is of type time.
References Parameter::Time.
Referenced by Parameter::addDefaultText(), Parameter::addDefaultTime(), Parameter::addText(), Parameter::addTime(), Parameter::defaultHour(), Parameter::defaultMilliSeconds(), Parameter::defaultMinutes(), Parameter::defaultSeconds(), Parameter::defaultText(), Parameter::hour(), Parameter::milliSeconds(), Parameter::minutes(), Parameter::nonDefault(), Parameter::read(), Parameter::save(), Parameter::saveXML(), Parameter::seconds(), Parameter::selectText(), Parameter::setDefault(), Parameter::setDefaultTime(), Parameter::setFormat(), Parameter::setTime(), Parameter::setToDefault(), Parameter::size(), Parameter::text(), and Parameter::time().
int hour | ( | int | index = 0 | ) | const |
References Parameter::index(), and Parameter::isTime().
Referenced by Parameter::addDefaultText(), Parameter::addText(), Parameter::assign(), Parameter::selectText(), Parameter::setDefaultTime(), and Parameter::setTime().
int minutes | ( | int | index = 0 | ) | const |
References Parameter::index(), and Parameter::isTime().
Referenced by Parameter::addDefaultText(), Parameter::addText(), Parameter::assign(), Parameter::selectText(), Parameter::setDefaultTime(), and Parameter::setTime().
int seconds | ( | int | index = 0 | ) | const |
References Parameter::index(), and Parameter::isTime().
Referenced by Parameter::addDefaultText(), Parameter::addText(), Parameter::assign(), Parameter::selectText(), Parameter::setDefaultTime(), and Parameter::setTime().
int milliSeconds | ( | int | index = 0 | ) | const |
References Parameter::index(), and Parameter::isTime().
void time | ( | int & | hour, |
int & | minutes, | ||
int & | seconds, | ||
int & | milliseconds, | ||
int | index = 0 |
||
) | const |
Returns the index-th time.
[out] | hour | If Parameter is not a Time or index is invalid, 0 is returned. |
[out] | minutes | If Parameter is not a Time or index is invalid, 0 is returned. |
[out] | seconds | If Parameter is not a Time or index is invalid, 0 is returned. |
[out] | milliseconds | If Parameter is not a Time or index is invalid, 0 is returned. |
[in] | index | determines which one of the size() stored time values is returned in hour, minutes, and seconds. |
References Parameter::index(), and Parameter::isTime().
Referenced by Parameter::assign(), Parameter::setCurrentDate(), and Parameter::setCurrentTime().
Parameter & setTime | ( | int | hour, |
int | minutes, | ||
int | seconds, | ||
int | milliseconds = 0 |
||
) |
Set time of time parameter to hour, minutes, seconds, and milliseconds. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::ChangedFlag, StrQueue::clear(), and Parameter::isTime().
Referenced by Parameter::Parameter(), Parameter::setCurrentTime(), Parameter::setTime(), and OptWidgetTime::valueChanged().
Parameter & addTime | ( | int | hour, |
int | minutes, | ||
int | seconds, | ||
int | milliseconds = 0 |
||
) |
Add time hour, minutes, seconds, and milliseconds to time parameter. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::ChangedFlag, and Parameter::isTime().
Referenced by Parameter::addText(), Parameter::assign(), and Parameter::selectText().
Parameter & setTime | ( | const string & | time | ) |
Set time of time parameter to time. See Str::time() for valid date strings. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::hour(), Parameter::minutes(), Parameter::seconds(), Parameter::setTime(), and Str::time().
Parameter & setTime | ( | const struct tm & | time | ) |
Set time of time parameter to time. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::hour(), Parameter::minutes(), Parameter::seconds(), and Parameter::setTime().
Parameter & setTime | ( | const time_t & | time | ) |
Set time of time parameter to time. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::setTime().
Parameter & setCurrentTime | ( | void | ) |
Set time of time parameter to the current time. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::setTime(), and Parameter::time().
Set time value to the one of p, if this and p are both of valueType() Time. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::ChangedFlag, Parameter::isTime(), and Parameter::name().
int defaultHour | ( | int | index = 0 | ) | const |
References Parameter::index(), and Parameter::isTime().
int defaultMinutes | ( | int | index = 0 | ) | const |
References Parameter::index(), and Parameter::isTime().
int defaultSeconds | ( | int | index = 0 | ) | const |
References Parameter::index(), and Parameter::isTime().
int defaultMilliSeconds | ( | int | index = 0 | ) | const |
References Parameter::index(), and Parameter::isTime().
void defaultTime | ( | int & | hour, |
int & | minutes, | ||
int & | seconds, | ||
int & | milliseconds, | ||
int | index = 0 |
||
) | const |
Returns the index-th default time.
[out] | hour | If Parameter is not a Time or index is invalid, 0 is returned. |
[out] | minutes | If Parameter is not a Time or index is invalid, 0 is returned. |
[out] | seconds | If Parameter is not a Time or index is invalid, 0 is returned. |
[out] | milliseconds | If Parameter is not a Time or index is invalid, 0 is returned. |
[in] | index | determines which one of the size() stored default time values is returned in hour, minutes, seconds, and milliseconds. |
References Parameter::index(), and Parameter::isDate().
Parameter & setDefaultTime | ( | int | hour, |
int | minutes, | ||
int | seconds, | ||
int | milliseconds = 0 |
||
) |
Set default time of time parameter to hour, minutes, milliseconds, and seconds.
References StrQueue::clear(), and Parameter::isTime().
Referenced by Parameter::Parameter(), and Parameter::setDefaultTime().
Parameter & addDefaultTime | ( | int | hour, |
int | minutes, | ||
int | seconds, | ||
int | milliseconds = 0 |
||
) |
Add time hour, minutes, seconds, and milliseconds to default of time parameter to.
References Parameter::isTime().
Referenced by Parameter::addDefaultText().
Parameter & setDefaultTime | ( | const string & | time | ) |
Set default time of time parameter to time. See Str::time() for valid date strings.
References Parameter::hour(), Parameter::minutes(), Parameter::seconds(), Parameter::setDefaultTime(), and Str::time().
bool isNotype | ( | void | ) | const |
True if parameter is of no type.
References Parameter::NoType.
Referenced by Parameter::addText(), Parameter::assign(), Macro::expandParameter(), and Parameter::save().
bool empty | ( | void | ) | const |
True if parameter is of no type and has no name.
References Str::empty(), and Parameter::NoType.
Referenced by Parameter::addDefaultText(), Parameter::addText(), Parameter::saveXML(), and Parameter::selectText().
Parameter & setDefault | ( | void | ) |
Set value of parameter to its default.
References Parameter::ChangedFlag, Parameter::isDate(), Parameter::isTime(), and StrQueue::size().
Parameter & setToDefault | ( | void | ) |
Set default of parameter to its value.
References Parameter::isDate(), and Parameter::isTime().
Referenced by Parameter::Parameter().
Parameter & setActivation | ( | const string & | name, |
const string & | value, | ||
bool | activate = true |
||
) |
Connect this Parameter to another Parameter with identifyer name. Such that in a dialog (like OptWidget) setting the value of the parameter name to value will activate (activate = true
) or inactivate (activate = false
) this Parameter. Several values can be supplied by seperating them by '|'. A numerical value can be preceeded by '=', '>', '>=', '<', '<=', '<>' to determine the way of a numerical comparison. Numerical values can be supplied with a unit. If no unit is given, then the internally used unit is assumed.
References Parameter::addActivation(), and Parameter::clearActivation().
Parameter & addActivation | ( | const string & | name, |
const string & | value, | ||
bool | activate = true |
||
) |
Connect this Parameter to an additional Parameter with identifyer name. Such that in a dialog (like OptWidget) setting the value of the parameter name to value will activate (activate = true
) or inactivate (activate = false
) this Parameter. Several values can be supplied by seperating them by '|'. A numerical value can be preceeded by '=', '>', '>=', '<', '<=', '<>' to determine the way of a numerical comparison. Numerical values can be supplied with a unit. If no unit is given, then the internally used unit is assumed.
References Str::number(), and Str::unit().
Referenced by Parameter::setActivation().
Parameter & clearActivation | ( | void | ) |
Disconnect this Parameter from other Parameters that can activate or inactivate it.
Referenced by Parameter::setActivation().
int activations | ( | void | ) | const |
The number of defined activation patterns.
string activationName | ( | int | index = 0 | ) | const |
The name of the index-th Parameter that might activate or inactivate this Parameter.
References Parameter::index().
string activationValue | ( | int | index = 0 | ) | const |
The first value of the index-th Parameter on which this Parameter is activated or inactivated.
References Parameter::index().
string activationValues | ( | int | index = 0 | ) | const |
All values of the index-th Parameter on which this Parameter is activated or inactivated separated by '|'.
References Parameter::index().
double activationNumber | ( | int | index = 0 | ) | const |
The numerical value of the index-th Parameter on which this Parameter is activated or inactivated according to activationComparison( index ).
References Parameter::index().
string activationUnit | ( | int | index = 0 | ) | const |
The unit corresponding to the numerical value of the index-th Parameter on which this Parameter is activated or inactivated according to activationComparison( index ).
References Parameter::index().
int activationComparison | ( | int | index = 0 | ) | const |
The type of numerical comparison used for activating or inactivating this Parameter by the index-th Parameter.
References Parameter::index().
bool activation | ( | int | index = 0 | ) | const |
If true
, this Parameter is activated, otherwise inactivated, whenever the Parameter with identifier activationName( index ) takes on the value activationValue( index).
References Parameter::index().
bool testActivation | ( | int | index, |
const string & | value | ||
) |
Set the status of comparisopn index to true
if value matches one of the activation values activationValues( index ).
References Parameter::index().
Referenced by Parameter::testActivation().
bool testActivation | ( | int | index, |
double | value, | ||
double | tol = 1e-8 |
||
) |
Set the status of comparisopn index to true
true if value matches the activation number and type of comparison within the given tolerance tol.
References Parameter::changeUnit(), Parameter::format(), Str::format(), Parameter::index(), and Parameter::testActivation().
string save | ( | int | flags = 0 | ) | const |
Return string in the format "name: value". Use for flags values from Options::SaveFlags to modify the way how the Parameter is written to the string.
Referenced by relacs::operator<<().
ostream & save | ( | ostream & | str, |
int | width = 0 , |
||
int | flags = 0 |
||
) | const |
Write parameter to stream str in the format "name: value". Use for flags values from Options::SaveFlags to modify the way how the Parameter is written to the string.
References Options::AlwaysQuote, Parameter::boolean(), Parameter::error(), Options::EscapeQuotes, Options::FirstOnly, Parameter::format(), Parameter::isBoolean(), Parameter::isDate(), Parameter::isInteger(), Parameter::isNotype(), Parameter::isNumber(), Parameter::isText(), Parameter::isTime(), Parameter::ListAlways, Parameter::name(), Parameter::outUnit(), Options::PrintRequest, Parameter::request(), Parameter::Select, Parameter::selectOption(), StrQueue::size(), Parameter::size(), Parameter::style(), Parameter::text(), and Str::up().
ostream & save | ( | ostream & | str, |
const string & | textformat, | ||
const string & | numberformat, | ||
const string & | boolformat, | ||
const string & | dateformat, | ||
const string & | timeformat | ||
) | const |
Write parameter to stream str according to the formats textformat, numberformat, boolformat, dateformat, and timeformat.
References Parameter::isBoolean(), Parameter::isDate(), Parameter::isInteger(), Parameter::isNotype(), Parameter::isNumber(), Parameter::isText(), Parameter::isTime(), and Parameter::text().
ostream & saveXML | ( | ostream & | str, |
int | level = 0 , |
||
int | indent = 4 , |
||
int | flags = 0 |
||
) | const |
Write parameter in XML format to output stream.
[in] | str | the output stream |
[in] | level | the level of indentation |
[in] | indent | the indentation depth, i.e. number of white space characters per level |
[in] | flags | modify the way how the Parameter is written to the stream. See Options::SaveFlags for possible values |
References Parameter::boolean(), Parameter::empty(), Parameter::error(), Options::FirstOnly, Parameter::format(), Parameter::isBoolean(), Parameter::isDate(), Parameter::isInteger(), Parameter::isNumber(), Parameter::isText(), Parameter::isTime(), Parameter::ListAlways, Parameter::name(), Parameter::number(), Parameter::outUnit(), Options::PrintRequest, Options::PrintType, Parameter::request(), Parameter::size(), Str::strip(), Parameter::text(), and Parameter::unit().
Referenced by SaveFiles::ODMLFiles::close(), and SaveFiles::ODMLFiles::writeRePro().
bool read | ( | const Str & | s, |
const string & | assignment = ":=" |
||
) |
Read parameter value from string s if it has the same name. Uses assign() to assign the value of the parameter. Returns true if a value was assigned. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::assign(), Str::ident(), and Str::value().
bool read | ( | const Parameter & | p | ) |
Read parameter value from p if it has the same name. Numbers and Errors are converted from p's unit to the internal unit of the parameter. Returns true if a value was assigned. If the value of the parameter is changing then the changedFlag() is set.
References Parameter::addText(), Parameter::ChangedFlag, Parameter::changeUnit(), StrQueue::clear(), StrQueue::empty(), Parameter::isAnyNumber(), Parameter::isDate(), Parameter::isText(), Parameter::isTime(), Parameter::name(), Parameter::SelectText, Parameter::selectText(), Parameter::size(), Parameter::style(), and Parameter::text().
Returns the value of val given in oldunit in the unit newunit. oldunit and newunit both are strings containing an optional number and an unit. if oldUnit or newUnit does not contain an unit, it is assumed that the units are both the same.
References Str::number(), relacs::NUnits, relacs::pow(), Str::unit(), relacs::UnitFac, and relacs::UnitPref.
Parameter & addSelectOption | ( | const std::string & | option | ) |
Adds a selectable option
Referenced by Parameter::assign().
Parameter & removeSelectOption | ( | const std::string & | option | ) |
Removes a selectable option
Parameter & clearSelectOptions | ( | ) |
Clears selectable option list
Referenced by Parameter::assign(), and Parameter::clear().
const std::set< std::string > & selectOptions | ( | ) | const |
Returns list of all selectable options
Referenced by ComboItemDelegate::createEditor().
std::string selectOption | ( | int | index | ) | const |
Returns the selectable option at a cetain index
Referenced by Parameter::save().
int selectOptionsSize | ( | ) | const |
Returns number of selectable options
Returns true if the two Parameters p1 and p2 are equal, i.e. they have the same name.
|
friend |
Returns true if the Parameter p has an name equal to name.
|
friend |
Write parameter to stream str using save()
|
static |
This flag is set whenever the value of the Parameter is changed.
Referenced by Parameter::addDate(), Parameter::addNumber(), Parameter::addText(), Parameter::addTime(), Parameter::assign(), Parameter::changed(), Parameter::changedFlag(), Parameter::clear(), Parameter::Parameter(), Parameter::read(), Parameter::selectText(), Parameter::setBoolean(), Parameter::setDate(), Parameter::setDefault(), Parameter::setInteger(), Parameter::setNumber(), Parameter::setText(), Parameter::setTime(), and Parameter::setValue().
|
static |
Use this flag to select Parameter whose value differs from their default value.
Referenced by Parameter::flags().
|
static |
If this bit is set in the Parameter's style you can only select from text options with multiple values, but not add new values.
Referenced by Options::addSelection(), Parameter::assign(), Options::insertSelection(), Parameter::read(), and Parameter::selectText().
|
static |
If this bit is set in the Parameter's style you can select multiple values.
|
static |
If this bit is set in the Parameter's style all values of the parameter get saved even if only the first value is requested to be saved.
Referenced by SaveFiles::addFile(), Parameter::save(), and Parameter::saveXML().
|
static |
If this bit is set in the Parameter's style it acts like a combo box in combination with MultipleSelection bit
Referenced by Parameter::assign(), OptWidgetMultipleValues::OptWidgetMultipleValues(), and Parameter::save().