Reserved Characters: Difference between revisions

From Software Product Documentation
Jump to navigation Jump to search
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 41: Line 41:
For more: [https://www.c-motion.com/v3dwiki/index.php?title=Expressions:_Examples_of_Using_the_AMP_Operator Examples of Using the AMP Operator]
For more: [https://www.c-motion.com/v3dwiki/index.php?title=Expressions:_Examples_of_Using_the_AMP_Operator Examples of Using the AMP Operator]


==Colon==
==COLON==
COLON = :
COLON = :


==SEMICOLON==
==SEMICOLON==
Semicolon = ;
SEMICOLON = ;


==PLUS==
==PLUS==
Plus = +
PLUS = +


==FSLASH==
==FSLASH==
FSlash = /
FSLASH = /


====NAN====
==SPACE==
NAN is a reserved string used to designate "Not a Number".
SPACE=" "
Visual3D commands refer to [[DATA_NOT_FOUND|NO_DATA or DATA_NOT_FOUND]] as NAN
 
:For example, the expression 1/0 results in NAN
 
====isNAN====
isNAN(expression) tests values against NAN - If the number is NAN the result is 1, otherwise the result is 0
 
:[Set_Pipeline_Parameter_From_Expression]
:/PARAMETER_NAME= NAN_TEST
:/EXPRESSION=ISNAN(1/0)
:/AS_INTEGER=TRUE
:''';'''
 
:: ::NAN_TEST = 1
 
:[Set_Pipeline_Parameter_From_Expression]
:/PARAMETER_NAME= NAN_TEST
:/EXPRESSION=ISNAN(-999999.000000)
:/AS_INTEGER=TRUE
:''';'''
 
:: ::NAN_TEST = 1
 
Returns "1" because -999999 is equal to Data Not Found in Visual3D.
 
:[Set_Pipeline_Parameter_From_Expression]
:/PARAMETER_NAME= NAN_TEST
:/EXPRESSION=ISNAN(15)
:/AS_INTEGER=TRUE
:''';'''
 
:: ::NAN_TEST = 0
 
Example: Set negative values to NO_DATA
 
If the z-component of the LELB signal is below 0 set the frame to NO_DATA
 
::'''Evaluate_Expression'''
::/EXPRESSION=(TARGET::ORIGINAL::LELB::Z>0)/(TARGET::ORIGINAL::LELB::Z>0)*TARGET::ORIGINAL::LELB
::/RESULT_NAME=LELB
::/RESULT_TYPE=TARGET
::/RESULT_FOLDER=PROCESSED
::''';'''

Latest revision as of 15:17, 17 May 2024

Reserved Characters in Expressions

AMP

AMP = &

For example, if the desired pipeline command were as follows:

Select_Active_File
/FILE_NAME=ALL_FILES
/QUERY= TAG1 & TAG2
;

If the tags TAG1 and TAG2 exist then all files that have been assigned both tags will be active.

If, however, we want to use pipeline parameters in place of the text TAG1 and TAG2, we have a problem because there is no way to stop Visual3D from using the & character to concatenate the text. The solution was to introduce a reserved parameter ::AMP.

The following pipeline would result

Set_Pipeline_Parameter

Set_Pipeline_Parameter
/PARAMETER_NAME=A
/PARAMETER_VALUE=TAG1
;
Set_Pipeline_Parameter
/PARAMETER_NAME=B
/PARAMETER_VALUE=TAG2
;
Select_Active_File
/FILE_NAME=ALL_FILES
/QUERY= ::A&::AMP&::B
;

This would result in Visual3D interpreting the query

/QUERY=TAG1 & TAG2

For more: Examples of Using the AMP Operator

COLON

COLON = :

SEMICOLON

SEMICOLON = ;

PLUS

PLUS = +

FSLASH

FSLASH = /

SPACE

SPACE=" "

Retrieved from ""