SPF-OST / pytrnsys

Package that provides functionality to run and process, plot and report TRNSYS simulations
https://pytrnsys.readthedocs.io
GNU General Public License v3.0
10 stars 8 forks source link

Improve functionality related to online plotter #194

Open ahobeost opened 1 month ago

ahobeost commented 1 month ago

Currently, online plotters are commented out entirely to turn them off. This doesn't make any sense, as the subprocess already stops it from being displayed in the first place.

Additionally, online plotters can simply be turned off by using the 9th parameter. grafik

Making this easy to interact with (e.g. with a corresponding variable) would also allow the User to easily choose which 10 plotters to use in larger simulations.

`EQUATIONS 1 :useOnlinePlotter = -1

UNIT 4 TYPE 65 Type65d PARAMETERS 12 4 ! 1 Nb. of left-axis variables 2 ! 2 Nb. of right-axis variables -2 ! 3 Left axis minimum 3 ! 4 Left axis maximum -2 ! 5 Right axis minimum 3 ! 6 Right axis maximum 1 ! 7 Number of plots per simulation 20 ! 8 X-axis gridpoints :useOnlinePlotter ! 9 Shut off Online w/o removing`

Which could then be activated in the config file using: deck snk60_useOnlinePlotter 1

zuckerruebe commented 1 month ago

Can the way you suggest to use the 9th parameter not already be used as things are ATM? Plus, in addition you can decided to switch all of them off/comment all of them out?

I didn't understand what you meant by "the subprocess stops it from being displayed".

zuckerruebe commented 1 month ago

Ah, I should have pointed out, there's a flag, ignoreOnlinePlotter (https://pytrnsys.readthedocs.io/en/latest/guide/run_simulation.html#simulation-control), to en/disable commenting out of online plotters.

ahobeost commented 1 month ago

https://github.com/SPF-OST/pytrnsys/blob/master/pytrnsys/rsim/executeTrnsys.py grafik

This code causes the subprocess to suppress all popupwindows when using "ignoreOnlinePlotter".

As we both say, the 9th parameter can already be used now. We can thus cut out the code related to commenting things out and make use to the 9th parameter automatically instead.

zuckerruebe commented 1 month ago

Ah, yes, you're probalby right. With the one caveat that maybe, if we don't comment out the plottes and only use the /N or /H flag, TRNSYS might still complain about there being too many online plotters. But I guess that's fine.