[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: 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 112: 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 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
CAPE-OPEN • View topic - Value of StringParameter not saved in Pro-II
Page 1 of 3

Value of StringParameter not saved in Pro-II

PostPosted: 15 September 2022, 12:16
by SLiebschner

Re: Value of StringParameter not saved in Pro-II

PostPosted: 16 September 2022, 07:16
by jasper
The unit operation is responsible for saving and restoring the values. This should be implemented in IPersistStream(Init)::Save and IPersistStream(Init)::Load (and if IPersistPropertyBag is implemented, also in IPersistPropertyBag ::Save and IPersistPropertyBag ::Load)

Re: Value of StringParameter not saved in Pro-II

PostPosted: 19 September 2022, 21:42
by SLiebschner

Re: Value of StringParameter not saved in Pro-II

PostPosted: 20 September 2022, 15:09
by jasper
Can you perhaps check what happens in Save and Load from a debugger, by attaching it to the running PME instance?

Re: Value of StringParameter not saved in Pro-II

PostPosted: 20 September 2022, 15:10
by jasper
Does GetSizeMax return the right amount of required storage?

Re: Value of StringParameter not saved in Pro-II

PostPosted: 21 September 2022, 09:51
by SLiebschner

Re: Value of StringParameter not saved in Pro-II

PostPosted: 24 September 2022, 11:05
by jasper
As saving and loading the parameters is internal to the unit operation, the log does not help much in this case - it logs the interaction between the PME and PMC.

I think best here is to set a break point in the debugger, and check whether Save and Load to as you expect them to do.

GetSizeMax is supposed to return the amount of memory needed for storage - it should be the number of double parameters times the size of a double, plus the number of string parameters plus for each string parameter the size of the length and the size of the data.

Re: Value of StringParameter not saved in Pro-II

PostPosted: 04 October 2022, 11:14
by SLiebschner
I haven't succeeded in actual debugging, but printed values of parameters to file.

It turns out that the parameters, with which I am having problems, have a **fixed** value, e.g. nan, -83, -0.649452
when I print them to file. It is not influenced by my giving numbers to the parameters in question. However, their value is not displayed within the CAPE-OPEN Settings withn Pro-II. Again the fact: this happens only with input-parameters succeeding number 32 (start counting from 0). You don't know about a maximum size of input parameters in the parameterCollection, do you?
Btw, I check that this happens also, if all of those parameters are RealParameters, i.e. there are no StringParameters.

I changed the return value of GetSizeMax() accordingly, but it does not seem to have an influence at all.
Actually it should not matter what GetSizeMax() returns, as long as its value is larger or equal the actual required size and I have enough memory. Is that so?

Re: Value of StringParameter not saved in Pro-II

PostPosted: 04 October 2022, 13:35
by jasper
Are you using Visual Studio?

CAPE-OPEN does not define a maximum size of the parameter collection. Perhaps there is such a limitation in Pro/II although I am not aware of it - can you try whether it works in any other simulator? (e.g. COCO/COFE?)

Re: Value of StringParameter not saved in Pro-II

PostPosted: 10 October 2022, 12:24
by SLiebschner
Yes, I use Visual Studio. Why do you ask?

It works in DWSIM. So the problem seems to be Pro-II related.
I see whether I can get some help from Pro-II.