[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
CAPE-OPEN • View topic - COFE Flowsheet protection

COFE Flowsheet protection

Discusses use of COCO, the process simulation and modelling software suite from AmsterCHEM, downloadable from http://www.cocosimulator.org

Moderator: jasper

COFE Flowsheet protection

Postby spertant » 15 February 2024, 11:46

Hello,

I would like to protect a COFE Flowsheet, so that the users cannot modify the Flowsheet (modify feed values and unit operations parameters, plug-unplug streams...). Is there a way to do so ?

Alternatively (it would be even better) I was thinking to put my Flowsheet in a COFE Flowsheet Unit Operation, so the users could only modify some inputs to this Unit Operation. But I would like to protect this Unit Operation, so the users cannot open it to see the details and of course cannot modify it. Is it possible to do it in COFE ?

Thanks in advance,

Savinien Pertant
spertant
 
Posts: 8
Joined: 06 January 2023, 15:54

Re: COFE Flowsheet protection

Postby jasper » 15 February 2024, 12:18

There is currently no such protection. I am also not sure what you would be looking for - just a way to prevent the user from opening the GUI and making modifications? That would be rather easy to circumvent, because the COCO .fsd file is just a zip file with an xml inside, which can be manipulated. So then one would need to put a password on the zip file as well, which means you cannot open it anymore without entering the password.

Or would you be looking for an option that says "read only" that can simply be turned off by the user, so no actual protection, but rather the ability to open a document in read-only mode to prevent making modifications by accident?
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: COFE Flowsheet protection

Postby spertant » 15 February 2024, 12:42

Thank you for your answer.

In fact I want to build a tool for non-technical people in my company. The aim is to have a user friendly tool and to prevent mistakes by preventing people from modifying the flowsheet.
The best solution would be an excel file, where the user puts some input parameters (feed conditions, some unit operations parameters) and the results of the COFE simulation would be written back in the excel file.
This would work as a black box and the user wouldn't see the COFE flowsheet.
I have started testing the COFE-in-EXCEL document which seems adapted for this, but I also would like to hide (or at least "protect") the flowsheet.
spertant
 
Posts: 8
Joined: 06 January 2023, 15:54

Re: COFE Flowsheet protection

Postby jasper » 15 February 2024, 14:56

You can embed a COFE flowsheet directly in an Excel sheet (use the Excel template to get started). Then you can simply hide the sheet on which the COFE control is I suppose.

Note that the template uses VBA macros, this may be a disadvantage. It is meant to demo automation.

You can access automation also using COM interfaces directly (there is more info here: and here ). Let me know in case you have more specific questions about this approach.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: COFE Flowsheet protection

Postby spertant » 20 February 2024, 14:44

Hi Jasper,

Thank you for your help.
With the embedded flowsheet in Excel I'm on a good way to achieve my goal.
This topic : http://cape-open-forum.org/viewtopic.php?f=5&t=443
was particularly helpful to me to understand how to modify the flowsheet using excel.
spertant
 
Posts: 8
Joined: 06 January 2023, 15:54

Re: COFE Flowsheet protection

Postby spertant » 11 March 2024, 15:15

Hi Jasper,
I have another question related to the above topic.
Using the embedded flowsheet in excel, I noticed that when I modify the input values in the excel file, run the simulation, save the excel file and close it, if I re-open the excel file, the last results obtained by the COFE simulation have not been saved (but of course the modifications of the input values directly done in the excel file have been saved).
Is there a way to save the results obtained, avoiding to run again the simulation when we open the excel file ?

Thanks
spertant
 
Posts: 8
Joined: 06 January 2023, 15:54

Re: COFE Flowsheet protection

Postby jasper » 11 March 2024, 19:52

I am not sure whether this can be done. As the flowsheet is embedded as OLE object, Excel decides whether it should be saved or not. I suppose that if you edit the flowsheet after the solution was imposed, Excel will assume the OLE object was changed and it will be saved. But I do not see an easy way to do this in an automated manner.

Alternatively you could not use an embedded flowsheet, but create it as a COM object. Then Excel will not save it for you - you are on your own for that. You could save to string and load from string, and store the string value in an Excel cell. See LoadFromString, SaveFromString here:
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: COFE Flowsheet protection

Postby jasper » 11 March 2024, 19:54

... down side is that apparently Excel can only contain 32000 or so characters in a cell: - for larger strings you need to find a different way, e.g. split it up over multiple cells.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: COFE Flowsheet protection

Postby spertant » 13 March 2024, 08:10

Ok, indeed I noticed that if I manually modify the flowsheet, the modifications are saved. But the COFE-in-EXCEL method loses of its interest...
I will have a look at the COM object. With this method, can I use all the macro that I wrote, to get and set values from/to COFE ?
spertant
 
Posts: 8
Joined: 06 January 2023, 15:54

Re: COFE Flowsheet protection

Postby spertant » 13 March 2024, 08:16

I have another question about the COFE-in-EXCEL method.
Is it possible to cancel a COFE calculation directly from EXCEL, for instance when the calculation struggles to converge ?

To run the calculation, I use the macro :

Public Sub COFE_CalculateFlowsheet()
Dim COFEDocument As COFE_Document
Set COFEDocument = COFE_GetCOFEDoc
COFEDocument.Solve
End Sub

So I would like to know if there is a similar function as COFEDocument.Solve to stop a calculation ?

Thanks a lot
spertant
 
Posts: 8
Joined: 06 January 2023, 15:54

Next

Return to COCO (AmsterCHEM)

Who is online

Users browsing this forum: Google [Bot] and 2 guests