Store and recall all appdesigner GUI data.
조회 수: 9 (최근 30일)
이전 댓글 표시
Hi,
I have a larger GUI designed with Appdesigner (.mlapp) with many components such as text fields, sliders, tables, graphs, edit fields... I need to store the whole state of the GUI when selected by the user (Save state to file) and restore later (Load state from file). I found a lot of workarounds where they basically iterate through every object and one by one save it to a .mat file and later reload the whole data, but since the GUI will be growing and its already hundreds of values, I'd love to know if there is any way to store it all at once. Something like save(app) and load(app). Basically a copy of all the internal variables.
Best would be to have it in a human readable file like XML, but that would be just the cherry to the icecream.
댓글 수: 5
Jan Kappen
2023년 11월 30일
편집: Jan Kappen
2023년 11월 30일
Our company does have a NDA signed with Mathworks. Who would I have to contact for such kinds of information?
I see the workaround, but I'm hoping for a more straight forward way. Iterating manually through all ui elements does not feel right. Maybe there's a way using findall and iterate through the different ui component types - but even then we'd need to know which properties have to be saved. We would need to create a list for each component type which properties are important.
Or the full component gets just saved to mat. I just tried that out using a button. It loses its Parent property, but after reassigning it, it works again. Not sure if that works for all UI elements of course.
Rik
2023년 11월 30일
I would personally just store the value property, but whatever works for you.
As for who to contact: you should either open a support ticket, or contact the Mathworks representative who was involved with the NDA.
답변 (1개)
Dinesh
2023년 4월 5일
Hi Marcel.
No, MATLAB doesn't support saving/loading the app state to/from an XML file.
If you are considering using JSON format to save and retreive data, the following toolbox might help you:
You can write a custom script along with this JSONLab toolbox to achieve what you wanted. JSONLab toolbox provides savejson() and loadjson() functions. But, you would need to write your own functions to retrieve all the properties in your app and then create a JSON object out of it for the "save" functionality and the vice-versa for the "load" functionality.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Dialog Boxes에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!