-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add events to models #22
Comments
|
|
"Regarding the Tank overflow; The real behavior of the Test bench is to stop the pump before it overflows. Would it be possible to set the voltage to 0V, if the water level reaches 0.6 meters?" Model event OnTick would enable to check for the level and adjust the parameter (which is otherwise input from the slider) accordingly. |
And what about including pre-set (empty) event, which is called on each:
This would enable initialization scripts (e.g. setting intiial dataset visibility false) and scripts observing some model value (e.g. value is over some threshold -> set input range to zero). |
This can be implemented in several ways. But backwards compatibility is gonna suffer in the future, once the model gets run in a webworker, any previous .bjp files containing JavaScript crossing the model/component boundary would break hard. Any code attached to a model method which would need to communicate with other components would have to use the web worker messaging system and message catching code would need to be written for the target component. |
Hm.. good point.. So any workaround on how to set the toggles true / false and hide datasets from graph on page load? This does not communicate with the model, at least. |
I don't believe it's going to have a large impact, since the plan for the model thread separation was to support both encapsulated and traditional model. The message layer between widgets and models should support both types of model endpoints. This decision should be documented somewhere, I will go on with the implementation of this issue. |
A JS code, run on model event (initial, start, stop, step, crash .. ?), would enable to hand-code a number of features, which are not yet introduced into the composer GUI.
The text was updated successfully, but these errors were encountered: