ofxRemoteUI icon indicating copy to clipboard operation
ofxRemoteUI copied to clipboard

No parameter recall from xml (parameter "found in XML but not defined in source code!")

Open DonGuig opened this issue 5 years ago • 5 comments

Hi,

No matter what, I can't get parameters to get back to their state. I'm compiling again ofx 0.10.0 on macos 10.12.6.

The preset values get stored correctly in the .rui file (i can see it in a text editor), but when I launch the app again, for each parameter i get something like (i activated verbose output) :

[verbose] ofxRemoteUI: Param '0.3.number' found in XML but not defined in source code! Keeping it arround to save back to XML

And the parameter in the running application is back at its default value.

I tried compiling the "example-ofParameter", and it's exactly the same issue. Am I missing something or is this a bug ? Can you reproduce it using the original "example-ofParameter" example ?

DonGuig avatar Nov 12 '18 15:11 DonGuig

Hmm the ofParameter sync features have been neglected for quite a while, I'll have a look. In the mean time, can you try removing the .rui file? If you keep a .rui file across different versions weird things can happen.

armadillu avatar Nov 12 '18 17:11 armadillu

Hi,

Thank you for the reply ! Unfortunately I already tried to remove the .rui file. I also tried various other ways to try and make it work in the code, each time removing the .rui file before concluding anything. But not luck ! It's great if you can have a look.

DonGuig avatar Nov 13 '18 08:11 DonGuig

Hi,

I found a workaround : after "RUI_SETUP()" and "ruiBridge.setup(parameters);", you can add : RUI_LOAD_FROM_XML(); ruiBridge.forceRuiToOfParamSync();

You don't get rid of the error messages I mentioned but those two lines do the job.

The underlying issue is with the initialization process. The RUI_LOAD_FROM_XML() method is first called by RUI_SETUP() but at this point the parameters are not know by the server. It gets the parameters from ruiBridge.setup(parameters), which has to come after.

For some reason the additional RUI_LOAD_FROM_XML() gets the parameters to their value from the XML, but it doesn't reflect in the Gui (I'm using ofxGui to have interaction on the server). Calling ruiBridge.forceRuiToOfParamSync() deals with that.

DonGuig avatar Nov 19 '18 15:11 DonGuig

hmmm I just got around to trying this with the latest OF release (0.10.1) and it seems to work as expected. I made a couple presets from remoteUI and I have been able to load them back, across restarts as well. What was the original problem?

armadillu avatar Nov 20 '18 09:11 armadillu

That's weird. What you did is a bit different from what I did though. I just tried with of 0.10.1 (was on 0.10.0) and it's still the same.

Here is what I did : - made a xcode project out of the example-ofParameter of ofxRemoteUI - built it as it is - run it, change the size and number parameter - quit the app - i check in a text editor that the file "ofxRemoteUISettings.rui" recorded the changes to size and number : it did, no issue here - I launch the app again, but the size and number parameter are back to their default value, and the console shows these "Param '0.1.size' found in XML but not defined in source code! Keeping it arround to save back to XML" messages.

Could you try checking this ?

DonGuig avatar Nov 25 '18 16:11 DonGuig