FemtoScan Online SDK Documentation
Home :: FsOnlineSDK :: fmutl | classes |
function eval_expression | ^ |
Evaluates expression.Expression is a text string, containing:
All unrecognized strings will be removed from expression.
- real, decimal, hexadecimal (0x[0123456789abcdef]), octal (0[01234567]) numbers
- constants:
- false
- 0 value
- true
- 1 value
- m_pi
- 3.14159265358979323846 value
- m_e
- 2.71828182845904523536 value
- parentheses '(', ')'
- comma ','
- binary algebraical operators +, -, *, /, ^ (power)
- binary boolean bitwise operators &, |, >>, <<
- binary boolean operators !=, ==, &&, ||, >=, <=, >, <
- unary operators ! (boolean not), - (negate)
- functions from the list:
- ln(x) - natural logarithm
- log(x) - decimal logarithm
- min(a,b) - minimum of two values
- max(a,b) - maximum of two values
- if(a,b,c) - if a!=0 then b else c
- sgn(x) - if x>0 then 1.0, if x<0 then -1.0, if x==0 then 0.0
- cal_tbl(double calibrating_value, string calibration_table) - returns double calibrated value, evaluated according to the calibration table. Calibration table should contain value-calibrated_value pairs, like this: "-3.0=27.0,3.0=60.0". This table will return calibrated value equal to 27.0 for -3.0 on input.
- load_caltbl(string section_name, string path) - load calibration table from the file, located at given path, from given section. The section should contain value-calibrated value pairs, for example:
function call:load_caltbl("temperature","temperature.ini")temperature.ini file contents:[temparature] -3.0=27.0; 0.0=40.0; 3.0=60.0;- call_function([parameter[,parameter]...,]"[module:]function_name[@parameters_list][*free_function_name]") - returns string as a result of function call. Parameters can be double (marked as 'd' in parameters list) or string (marked 's') values.
- interface() - has the same parameters as call_function, but when invoked, just clears the stack (i.e. performs nothing). This function should be used for custom interface implementation in SPMVarList class derivatives (for example, in fmcmnctl::CVarListCtrl class).
- hex(x) when used as display string, in SPMVarList class will display an integer value in hexadecimal representation
- strlistval(str,N) returns N's token of comma-delimiter list str
- slrlistlimit(str,N) returns str with first N tokens
- Source:
- ../fmutl/calc.h:82
- Author:
- ATC
- Version:
- 1.1
- Params:
expr string containing expression to evaluate. var result of evaluation. len length of expression string (in case expression ends before the terminating zero), -1 if all the string is expression. -1 is by default. - Returns:
- true if expression was evaluated, false if error was encountered.
- See Also:
- fmcmnctl::CVarListCtrl, SPMVarList::call_interface
(C) Advanced Technologies Center, 2002-2006
For support contact us at fsdev@nanoscopy.net