User Tools

Site Tools


android:jobsite:smartsuiteconfiguration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
android:jobsite:smartsuiteconfiguration [2014/03/05 20:08]
mjallison [JSON Alternative]
android:jobsite:smartsuiteconfiguration [2014/04/09 17:42] (current)
mjallison
Line 1: Line 1:
 +Configuration objects are represented as a JSON object. The Access API allows you to grab the configuration object via a stream. This example shows a fully populated configuration object. The "​ui"​ object and "​job"​ object are optional. ​
  
-Mumble Mumble... early thoughts ​of the configuration file format+The "​ui"​ object will contain all the value, or noneFor the "​job"​ object, any one of the values may not be present
  
-===== XML Alternative ===== 
 <​code>​ <​code>​
-<​configuration type="​SmartTrack">​ + { 
-   <​job>​ +   "​configuration.type":​ "​SmartTrack"​
-      <​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>​ +
-</​code>​ +
- +
-Notes: +
-  * Cycleline, haulpath, and warningarea may have zero or more instances. +
-  * Other values have precisely one entry. +
- +
-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: +
- +
-<​code>​ +
-   ​boolean gpsIsVisible = config.getBoolean("​ui.gps.visible",​ true); +
-   ​double blankspeed = config.getDouble("​ui.screenblanking.visible",​ 37.5); +
-</​code>​ +
- +
-Helper classes for the config object would be coded for Java and C++. +
- +
-===== JSON Alternative ===== +
-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.  +
- +
-<​code>​ +
-+
-   "​configuration.type":​ "​SmartTrack"​+
-   "​job"​ : { +
-      "​cycleline":​ { "​name":​ "​line1"​ +
-                     "​line":​ "​lat,​lon,​alt lat,lon,alt lat,lon,alt lat,​lon,​alt"​ +
-      }, +
-      "​haulpath":​ { "​name":​ "​path1"​ +
-                     "​line":​ "​lat,​lon,​alt lat,lon,alt lat,lon,alt lat,​lon,​alt"​ +
-      }, +
-      "​warningarea":​ { "​name":​ "​area1"​ +
-                     "​line":​ "​lat,​lon,​alt lat,lon,alt lat,lon,alt lat,​lon,​alt"​ +
-      }, +
-   }, +
-   +
    "​ui":​ {    "​ui":​ {
-      "settings.visible": "true", +      "gps.northup": ​false, 
-      "filelist.visible": ​"​true"​+      ​"gps.usecompass": false
-      "gps": { "visible": ​"​true"​+      "screen.visible": ​false
-               ​"northup": ​"​true"​+      "statistics.visible": ​false
-               ​"usecompass": ​"​true"​ +      "login.visible": ​false
-      }+      "settings.visible": ​false
-      "​preferences": { "visible": ​true+      "​preferences.visible": ​false
-                       ​"screen.visible": ​"true"+      "screenblanking.on": true, 
-                       ​"machine.visible": "true", +      "units.is.metric": ​false, 
-                       ​"login.visible": ​"​true"​ +      ​"track.cycles.displayed": false
-      ​}+      "gps.visible": ​false, 
-      "screeenblanking": ​10+      ​"​screenblanking.speed":​ 5
-      "statistics.visible":​ "true"+      "cut.fill.setting": ​false
 +      "filelist.visible": ​false, 
 +      ​"machine.visible": false
    },    },
 +   "​job":​ {
 +      "​haulpath":​ "​37.69827167784122,​-121.81372338848165 37.698729396233624,​-121.81368534695918 37.69895363855252,​-121.81300747292565 37.69891010564817,​-121.81236937168113 37.6986660738121,​-121.81176326223982 37.69805798205796,​-121.8118203404538 37.697965654517965,​-121.81261579744947 37.69790578375631,​-121.81332928842612 37.698267156656364,​-121.81374629148586",​
 +      "​cyclelines":​ [
 +         "​37.69856055410253,​-121.81389631635922 37.69853417331307,​-121.8129590554174"​
 +      ],
 +      "​jobfileid":​ "​241",​
 +      "​jobfile":​ "​\/​Projects\/​Samples\/​Job Files\/City of Livermore.adf"​
 +   },
 +}
 </​code>​ </​code>​
 +
android/jobsite/smartsuiteconfiguration.1394050087.txt.gz · Last modified: 2014/03/05 20:08 by mjallison