This is an old revision of the document!
Mumble Mumble… early thoughts of the configuration file format.
<configuration type="SmartTrack">
<job>
<cycleline name="line1">lat,lon,alt lat,lon,alt lat,lon,alt lat,lon,alt </cycleline>
<haulpath name="path1">lat,lon,alt lat,lon,alt lat,lon,alt lat,lon,alt lat,lon,alt lat,lon,alt </haulpath>\
<warningarea name="area1">lat,lon,alt lat,lon,alt lat,lon,alt lat,lon,alt lat,lon,alt </warningarea>
</job>
<ui>
<settings visible="true">
<filelist visible="true">
<gps visible="true">
<northup value="true">
<usecompass value="true">
</gps>
<preferences visible="true">
<screen visible="true">
<machine visible="true">
<login visible="true">
</preferences>
<screenblanking value="10">
<statistics visible="true">
</ui>
</configuration>
Notes:
The current thinking is that the server traffics in the XML format, while the client applications have helper objects to deal with it. A model is similar to the Bundle class in Android that lets you do things like:
boolean gpsIsVisible = config.getBoolean("ui.gps.visible", true);
double blankspeed = config.getDouble("ui.screenblanking.visible", 37.5);
Helper classes for the config object would be coded for Java and C++.
Thinking about XML points out that working with XML is a pain in the butt. The parsers are ugly to work with, and the readability of an XML fragment is not a good as desired. JSON is an alternative that is portable across systems, and much more readable. Here are some thoughts RE: using JSON for the management directive format.
{ "configuration.type": "SmartTrack",
"job" : {
"cycleline": "37.4,121.8,90.0 37.4,-121.85,91 37.5,-121.8,92",
"haulpath": "37.4,121.8,90.0 37.4,-121.85,91 37.5,-121.8,92",
"warningarea": { "name": "area1"
"line": "37.4,121.8,90.0 37.4,-121.85,91 37.5,-121.8,92"
}
}
"ui": {
"settings.visible": "true",
"filelist.visible": "true",
"gps": { "visible": "true",
"northup": "true",
"usecompass": "true"
},
"preferences": { "visible": true,
"screen.visible": "true",
"machine.visible": "true",
"login.visible": "true"
},
"screeenblanking": 10,
"statistics.visible": "true"
}
}