09-20-2019 04:51 AM
@AlexElb wrote:
For my files I just use Flattern from/to XML, which seems to work fine until now.
Just to be clear, I wasn't suggesting JSON as just a "file format"; I was suggesting using JSON strings internally to the program for all passing of configuration data between components. This is vastly simpler than a massive LVOOP architecture.
09-20-2019 05:22 AM
Just to be clear, I wasn't suggesting JSON as just a "file format"; I was suggesting using JSON strings internally to the program for all passing of configuration data between components. This is vastly simpler than a massive LVOOP architecture.
Thank you for the clarification, I indeed thought you would only use it for saving and loading, not for communication between components. While it seems very elegant for the communication aspect, I wonder how you handle it inside your components.
Let us stay in the DQMH world. So we have our Module Data Type Def in the shift register of the MHL. I expect you hold your configuration data inside there too, don't you? In a big Cluster, in a Class, how?
Do you have read/writeSettingXyFromModuleData.vi with a TypeDef to use the setting inside the module?
And last but not least: How do parse the JSON to see which settings changed? I think this is the most important question, because we have to specifically react to some setting changes, don't we? So if I use JSON and a library, like "JSON Object Serialization v2.2.0.3 by G Craftsman" I just found on VIPM, I would only shift my problems into my modules, won't I?
09-20-2019 06:11 AM - edited 09-20-2019 06:12 AM
@AlexElb wrote:
Let us stay in the DQMH world. So we have our Module Data Type Def in the shift register of the MHL. I expect you hold your configuration data inside there too, don't you? In a big Cluster, in a Class, how?
Do you have read/writeSettingXyFromModuleData.vi with a TypeDef to use the setting inside the module?
There is a variety of options, but I often have a (non-type-def) cluster in a shift register called "Config" that holds the config info. Then I just convert to/from JSON using standard JSONtext functions. Example:
If I have Objects to save, then I need to have Get/Set JSON methods to do that, but internally these just use JSONtext subVIs in a similar way. Then that JSON is combined with other config JSON, again using simple JSONtext functions.
09-23-2019 12:46 AM - edited 09-23-2019 12:47 AM
@drjdpowell wrote:
@AlexElb wrote:
For my files I just use Flattern from/to XML, which seems to work fine until now.
Just to be clear, I wasn't suggesting JSON as just a "file format"; I was suggesting using JSON strings internally to the program for all passing of configuration data between components. This is vastly simpler than a massive LVOOP architecture.
Is there an advantage over Variant?
09-23-2019 08:33 AM
@M.Lichtenheld wrote:
Is there an advantage over Variant?
Variants just wrap existing LabVIEW datatypes, none of which are as easy to work with nested tree-like data as JSON.