- Messages
- 89
- Country

If one compares the model XML file and all the things it includes to C or C++ source code that is compiled and run, do I understand correctly:
<UseTemplate> elements are "expanded" when the XML is read into the simulator. Let's call this "compile time". From the simulator's point if view it is completely equivalent if you replace a <UseTemplate> element with the contents of the corresponding <Template> element, with parameters replaced based on the ones you would have provided as child elements to the <UseTemplate> element, and with default and override parameters provided in the <Template> itself. All the parameter handling and expansion of #PARMETERNAME# things is done at compile time. Templates are conceptually a bit like C preprocessor macros, or C++ templates, right?
The XML logical expression trees constructed from <And>, <Or>, <Greater>, <Value> etc elements are also evaluated at compile time, right? As are RPN expression in the text of parameter name elements with the Process attribute. Such RPN then obviously can't contain references to simulation variables, but only literal numbers and strings (expanded from #PARAMETERS#), and RPN operators, conditionals, and function calls.
But <UseInputEvent> elements are not the same, right? You can't replace a <UseInputEvent> element with the contents of the corresponding <InputEvent> and get it to work, can you? Is the <InputElement> element used at run time, and it isn't enough to just have the <Presets> and <Preset> elements? But what about <Extend>?
<UseTemplate> elements are "expanded" when the XML is read into the simulator. Let's call this "compile time". From the simulator's point if view it is completely equivalent if you replace a <UseTemplate> element with the contents of the corresponding <Template> element, with parameters replaced based on the ones you would have provided as child elements to the <UseTemplate> element, and with default and override parameters provided in the <Template> itself. All the parameter handling and expansion of #PARMETERNAME# things is done at compile time. Templates are conceptually a bit like C preprocessor macros, or C++ templates, right?
The XML logical expression trees constructed from <And>, <Or>, <Greater>, <Value> etc elements are also evaluated at compile time, right? As are RPN expression in the text of parameter name elements with the Process attribute. Such RPN then obviously can't contain references to simulation variables, but only literal numbers and strings (expanded from #PARAMETERS#), and RPN operators, conditionals, and function calls.
But <UseInputEvent> elements are not the same, right? You can't replace a <UseInputEvent> element with the contents of the corresponding <InputEvent> and get it to work, can you? Is the <InputElement> element used at run time, and it isn't enough to just have the <Presets> and <Preset> elements? But what about <Extend>?
Last edited:
