Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3533 closed defect (invalid)

strange behaviour of variableFilter

Reported by: cbrinkrolf@… Owned by: somebody
Priority: high Milestone: never
Component: Run-time Version:
Keywords: regex variable filter Cc: Adrian Pop, Martin Sjölund

Description

My model contains variables p1.pc_t and p1.t.
Matching only second variable does not work with filter p1\.t
In runtime, this variable filter is extended to following regex: ^(p1\.t)$
However, both variables are matched. Is it just me or is there something wrong?

Change History (10)

comment:1 by Lennart Ochel, 9 years ago

I cannot reproduce the issue. I tested it on Linux and Windows using the following script:

loadString("
model test
  block foo
    Real t = cos(time);
    Real pc_t = sin(time);
  end foo;

  foo p1;
end test;
"); getErrorString();

simulate(test, simflags="-override=outputFormat=csv,variableFilter=p1.t"); getErrorString();

The result file does only contain time and p1.t as intended.

comment:2 by Lennart Ochel, 9 years ago

I should mention that I get the same result for both p1.t and p1\.t.

comment:3 by Lennart Ochel, 9 years ago

Cc: Adrian Pop Martin Sjölund added

There is an issue with Q-idents. The following script produces different results on Linux and Windows:

loadString("
model test
  block foo
    Real t = cos(time);
    Real pc_t = sin(time);
  end foo;

  foo 'p1';
end test;
"); getErrorString();

simulate(test, simflags="-override=outputFormat=csv,variableFilter=\\'p1\\'.t"); getErrorString();

On Linux there is time and 'p1'.t in the result file, but on Windows there is only time in the result file.

comment:4 by Lennart Ochel, 9 years ago

Running the executable directly from the command prompt produces the same results on Linux and Windows again.
./test -override=outputFormat=csv,variableFilter=\'p1\'.t

comment:5 by Adrian Pop, 9 years ago

Could be an issue on how OMEdit sends these flags to the simulation executable.

in reply to:  5 ; comment:6 by Lennart Ochel, 9 years ago

Replying to adrpo:

Could be an issue on how OMEdit sends these flags to the simulation executable.

OMEdit was not used for any of the tests.

in reply to:  6 ; comment:7 by Adrian Pop, 9 years ago

Replying to lochel:

Replying to adrpo:

Could be an issue on how OMEdit sends these flags to the simulation executable.

OMEdit was not used for any of the tests.

You didn't use it, but maybe the ticket poster did.

in reply to:  7 comment:8 by Lennart Ochel, 9 years ago

Replying to adrpo:

You didn't use it, but maybe the ticket poster did.

Sorry, maybe I should have said that Christoph - the ticket poster - is my colleague and has also not used OMEdit. He run the executable from command line and used only used override flag to specify the output format and variable filter as in my example from above.

comment:9 by Lennart Ochel, 9 years ago

Resolution: invalid
Status: newclosed

I am not sure what we actually did wrong, but it seems that it is working just fine. It's just about doing the escape sequence right. The following filter matches 'p1'.t and 'p2'.t_[1] and works for Windows and Linux:
./test -override=variableFilter=\(\'p1\'\.t\|\'p2\'\.t_\\[1\\]\)

comment:10 by Dietmar Winkler, 9 years ago

Milestone: Futurenever

Sorting away the closed as invalid, won't fix and duplicate tickets from Future.

Note: See TracTickets for help on using tickets.