11-05-2021 02:48 PM
I started using maps (finally). Needing to initialize them from .ini files, I made this.
11-05-2021 03:56 PM
Malleable VI would have made your life easier I believe, not sure if there is a limitation of VIM with Maps.
11-05-2021 04:46 PM
@santo_13 wrote:
Malleable VI would have made your life easier I believe, not sure if there is a limitation of VIM with Maps.
This does seem to generally work for the writes at least. INI tokens are fairly limited in terms of acceptable data types so you might have to be careful. It doesn't accept all data types (variants and clusters break) but it will take a U64 map and write a double to INI which could cause runtime issues. Of course you could fix this with type checking but I'm not sure how much effort that would save over the existing poly VIs.
11-06-2021 04:50 AM
I haven't looked at you code, but have you considered moving away from INI format for config files? INI is great for simple things, but poor for complex config info.
11-06-2021 08:43 AM
@santo_13 wrote:
Malleable VI would have made your life easier I believe, not sure if there is a limitation of VIM with Maps.
I considered that, but most of the time I’ll be using the “read” functions, and most of the time, I won’t need to wire the map nor default inputs. So I made it polymorphic in order to have a selector.
11-06-2021 08:45 AM
@drjdpowell wrote:
I haven't looked at you code, but have you considered moving away from INI format for config files? INI is great for simple things, but poor for complex config info.
I actually have a nice OOP based config file system that handles any data type. But sometimes it’s desirable to have human-editable files.
11-06-2021 11:46 AM
I mean something like JSON. Still human editable, but capable of storing complex data.
11-07-2021 07:41 AM
@drjdpowell wrote:
I mean something like JSON. Still human editable, but capable of storing complex data.
I consider that a bad compromise. Readability is unpleasant. Try explaining to a non-tech how to change a setting in a JSON file. And from a programming standpoint, the code wouldn’t be as clean as using a binary file.
11-07-2021 10:16 AM
@paul_cardinale wrote:
I consider that a bad compromise. Readability is unpleasant. Try explaining to a non-tech how to change a setting in a JSON file.
Seems very readable to me. An example:
{
"Module_DB file":"",
"SQLite busy timeout (ms)":10000,
"Analysis Configuration":[],
"Column Widths":{
"AnalysisName":82,
"Camera":65,
"Colour":46,
"ImageIndex":21,
"InValid":42,
"Pattern":52,
"TestTime":131,
"unitID":111
},
"Overlay Options":{
"ID":true,
"Alignment":{
"Alignment Markers":"Input and Output",
"Edge Detection":false,
"Circular IG":false
}
}
}
@paul_cardinale wrote:
And from a programming standpoint, the code wouldn’t be as clean as using a binary file.
There is no way an OOP-based config system is going to be as clean to code as using a good JSON library.
11-08-2021 10:53 AM
@drjdpowell wrote:
@paul_cardinale wrote:
I consider that a bad compromise. Readability is unpleasant. Try explaining to a non-tech how to change a setting in a JSON file.Seems very readable to me. An example:
{ "Module_DB file":"", "SQLite busy timeout (ms)":10000, "Analysis Configuration":[], "Column Widths":{ "AnalysisName":82, "Camera":65, "Colour":46, "ImageIndex":21, "InValid":42, "Pattern":52, "TestTime":131, "unitID":111 }, "Overlay Options":{ "ID":true, "Alignment":{ "Alignment Markers":"Input and Output", "Edge Detection":false, "Circular IG":false } } }
@paul_cardinale wrote:
And from a programming standpoint, the code wouldn’t be as clean as using a binary file.There is no way an OOP-based config system is going to be as clean to code as using a good JSON library.
Better readability than XML for sure, more intimidating than a classic config (.ini) file for a non-tech person, though.