I have created a CustomUO (IronPython script) which performs a gas membrane simulation (one feed, two output treams).
Depending on the input parameters, the actual model can fail.
In this case I return 'dummy' values in the output streams.
I would like to be able to set the color of the CustomUO object to my preference (red for instance) when my model did not run correctly.
The user of the flowsheet can then immediately see that there was an (internal) error.
I played around with SkiaSharp SKColor, but I can't get it to function.
(Expected SKColor, got SKColor...)
Can anyone help?
Thanks and greetings,
Auke Nauta
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
While I could not set the 'LineColor' property usinga new SKColor vriable (why?), I managed to change the existing 'LineColor' using the following code:
Me.GraphicObject.OverrideColors = solver_OK == 0; # override the object color when the solver fails
Me.GraphicObject.LineColor=Me.GraphicObject.LineColor.WithRed(255) # set error linecolor
Me.GraphicObject.UpdateStatus() # and update the object in the flowsheet
This sets the color of the CutomUO object to yellow in case of an internal solver calculation error...
Hi,
I have created a CustomUO (IronPython script) which performs a gas membrane simulation (one feed, two output treams).
Depending on the input parameters, the actual model can fail.
In this case I return 'dummy' values in the output streams.
I would like to be able to set the color of the CustomUO object to my preference (red for instance) when my model did not run correctly.
The user of the flowsheet can then immediately see that there was an (internal) error.
I played around with SkiaSharp SKColor, but I can't get it to function.
(Expected SKColor, got SKColor...)
Can anyone help?
Thanks and greetings,
Auke Nauta
Hi,
I (sort of!) figured it out:
While I could not set the 'LineColor' property usinga new SKColor vriable (why?), I managed to change the existing 'LineColor' using the following code:
Me.GraphicObject.OverrideColors = solver_OK == 0; # override the object color when the solver fails
Me.GraphicObject.LineColor=Me.GraphicObject.LineColor.WithRed(255) # set error linecolor
Me.GraphicObject.UpdateStatus() # and update the object in the flowsheet
This sets the color of the CutomUO object to yellow in case of an internal solver calculation error...
Greetings,
Auke Nauta
You can override the entire draw routine like this: