OMSimulator does not export some variables listed in resources/signalFilter.xml
Description
Some variables with non-alphanumeric characters, such as square brackets or parentheses, are not exported to the result file, even when explicitly listed in the resources/signalFilter.xml file in the SSP.
Steps to reproduce the behavior
- Create an SSP with variables containing square brackets, listen in signalFilter.xml.
- Simulate SSP in OMSimulator.
- Observe the result file contents.
- Note missing variables with special characters.
Expected behavior
All variables listed in signalFilter.xml should be present in the result file.
Version and OS
- Version: OMSimulator v2.1.2.post6-g637a1c9-win-notlm-debug
- current HEAD,
- OS: Windows 11, 64-bit
The cause is fairly evident in method oms::Model::importSignalFilter, which sends the name attribute of the oms:Variable unquoted to a function that expects a regular expression argument.
Thus a name like "x[1]" does not actually match the name "x[1]", when interpreted as a regular expression, as it only matches the name "x1".
Luckily, the dots used as separators in the names match with any character, including a dot.
@rruusu the issue is fixed with this commit https://github.com/OpenModelica/OpenModelica/commit/2a9e581976d97e97f8701a15a478da75aa73e3a4, please test it from the nightly builds tomorrow(26-10-2024)
I consider this issue resolved. @rruusu, please feel free to reopen if you encounter the same issue again.