Closed jmacias552 closed 2 years ago
@jmacias552 just to clarify some doubts I have, what is the purpose of making the flowsheet visible?
Daniel, the reason is because I'm designing a program that uses DWSIM as a Chemical Engineering simulation tool. For debugging purposes it is better to have DWSIM visible, and if there is a problem see where it was. I'm worried about convergence problems, windows screens that get blocked and so on.
My program will pass data to DWSIM, ask for solving and monitor its output. The user normally will not have to interact with the program but while running in visible if there is a problem is very straightforward to find the issue.
I have done the same thing in other software like HYSYS, UNISIM and I find it very useful to have it in visible mode. I am being able to manually modify things while being controlled by another program and the solving routine has ended. I don't know if something similar can be done with DWSIM. You have already done wonderful work.
The property (Visible) is already available in Automation but it seems that it is not implemented.
Thanks,
Jose Macías
El jue, 25 feb 2021 a las 21:33, Daniel Medeiros (notifications@github.com) escribió:
@jmacias552 https://github.com/jmacias552 just to clarify some doubts I have, what is the purpose of making the flowsheet visible?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DanWBR/dwsim6/issues/119#issuecomment-786242373, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGWYWER25HVTJL5ZWBVJFP3TA262VANCNFSM4YHGUPVA .
-- Jose Macías-Hernandez Chemical Engineering Dept. University of La Laguna Tenerife SPAIN jmacias@ull.edu.es +34649741084
@jmacias552 I don't know how to do to control a flowsheet from the outside... once you ask to display the flowsheet, the thread stops executing the subsequent code, waiting for you to close the window... I'll have to find a way of circumventing this behavior.
@DanWBR , The way I run HYSYS is using Dispatch from Win32com api.
The code is something like
from win32com.client import Dispatch
hysysApp = Dispatch("HYSYS.Application.V10.0") hysysApp.Visible = True
directorio = "C:\SimulacionesPruebas"
hysysCase = hysysApp.SimulationCases.Open(directorio + "\Crude Oil Fractionation Facility.hsc")
hysysCase.Visible = True
And then, I am able to control via COM automation
I have tried to do the same with DWSIM but I don't know the application name in the windows registry.
Probably the program has to be compiled in multiThread option.
I hope it helps
Regards,
Jose Macias
@jmacias552 the way that HYSYS does its automation is very different from DWSIM's... in HYSYS you are automating the application itself while in DWSIM you're manipulating the underlying flowsheet and its objects without the need to "open" the app.
Hello, one of the application of automation is OTS, one (or several) executable represents the dcs/plcs an an independent thread carry out the dynamic simulation, accessing the model allows representing field operator actions. I have done this with excel and hysys, and many others...
While controlling DWSIM with Automation is not possible to make it visible and do manual interaction. It will be nice to have a Visible property that will make visible or invisible DWSIM while running.
In DWSIM.Automation there is already a property called Visible but its value is False and there is no way to set to True.