User Tools

Site Tools


projects:a4sim:jsonfileformat

Differences

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

Link to this comparison view

Next revision
Previous revision
projects:a4sim:jsonfileformat [2020/01/04 22:41]
dwheele created
projects:a4sim:jsonfileformat [2020/05/05 22:40] (current)
dwheele [I2C Block]
Line 1: Line 1:
 +====== a4simData.json File Format ======
  
 +The copy of this file located on Raspberry Pi at ''/home/pi/Documents/app/projects/XplaneA4HardwareSimAgent/a4simData.json'' is considered the official version. This copied occasionally to other places in the form of working copies.
 +
 +==== Example ====
  
 <code json> <code json>
-"name": "sim/flightmodel2/misc/AoA_angle_degrees",+
 +  "hardwareAgent":
 +    "ip": "192.168.0.8", 
 +    "port": 49200 
 +  }, 
 +  "hardwareAgentClient":
 +    "ip": "192.168.0.12", 
 +    "port": 49190 
 +  }, 
 +  "drefs":
 +    {"name": "sim/flightmodel2/misc/AoA_angle_degrees",
       "hide": true,       "hide": true,
       "datadirection": "out",       "datadirection": "out",
       "type": "float",       "type": "float",
       "units": "degrees",       "units": "degrees",
-      "notes": "Angle of attack probe. Positive means aircraft nose is above the flight path in aircraft coordinates.",+      "notes": "Angle of attack probe. Positive means aircraft nose is above  
 +        the flight path in aircraft coordinates.",
       "i2c": {       "i2c": {
         "address": 42,         "address": 42,
Line 28: Line 43:
         "register": "0x00"         "register": "0x00"
       }       }
 +    }
 </code> </code>
 +
 +==== General Dref Info ====
 +
 +^name|Actual X-Plane Dref name|
 +^hide|If "false" it is as if it is not even here. To skip processing of missing hardware, for example.|
 +^datadirection|"**in**" = this data flows in to X-Plane (e.g., Aileron input), "**inNonZero**" = flows to X-Plane **only** if not in the zero position (e.g., a trigger for speedbrake retract), "**inNonZeroPerSecond**" = flows to X-Plane **only** if not in the zero position (e.g., a momentary request to move toward a maximum), "out" = this data flows **out** from X-plane (e.g., an airpseed amount)|
 +^type|Data type of Dref, e.g., "float, int, bool"|
 +^units|e.g., knots, degrees. Ignored by simulation|
 +^notes|Reference notes, because JSON doesn't provide comments, put free-form notes here, ignored by simulation|
 +^i2c|I2C communications parameters and translation values|
 +
 +==== I2C Block ====
 +^address|I2C channel, in decimal e.g., 39|
 +^enabled|If "true" values are processed normally, if "false, the value is not processed, but place for the data in the blocks transmitted/received via I2C remains present. To deactivate the Dref, use "hide" mentioned above.|
 +^simvalue : interpolationDatapoints|Numeric array of values to be sent to or received by the simulator. Correspond to the values in hardware:interpoliationDatapoints. Need to match the quantity and order.|
 +^hardware : maptype |One of "linear, "rphtSimpleLEDIndicator", "same" - triggers type of translation|
 +^hardware : interpolationDatapoints|Numeric array of values to be sent to or received by the hardware device.|
 +^hardware : type | One of "unsigned byte", "small unsigned int" (2 bytes), "one byte bool" (a byte with value 0 or 1) , "float" - the value to be sent to or received by the hardware device.|
 +^notes|Comments, ignored by simulation|
 +^register|I2C register, currently not implemented, ignored by simulation|
 +
  
projects/a4sim/jsonfileformat.1578177665.txt.gz · Last modified: 2020/01/04 22:41 by dwheele