Skip to content
This repository has been archived by the owner on Jan 22, 2023. It is now read-only.

Universal Data Model Notes

rob42 edited this page Mar 23, 2014 · 2 revisions

Some notes on why some values are the way they are

  1. metadata. I havent attempted to add misc stuff to each key, eg source, which may well be relevant to all keys individually.
{
  "headingMagnetic":"129.9",
  "source": {
    "type:" "n2k", 
    "id":"/dev/actisense-1",
    "timestamp":"2013-10-08-15:47:28.264",
    "src":"204",
    "pgn":"127250"
  }
}
  1. Why this:
{
  "headingMagnetic":"129.9",
}

and not this

{
  "heading":"129.9",
  "reference":"Magnetic",
}

Because there will be many background services, each which does just one thing well. In this case two processes are interesting:

  • The first looks at lat/lon values, and when it has both it updates the declination var with the current declination, but only runs every 10 minutes cos we dont move that fast :-)
  • The second looks for declination and when found fills in the missing true or magnetic heading, whenever either one is updated.

So I use two distinct vars, rather than make 'heading' an array of two values (true and magnetic). Plus its much easier to monitor for other processes, eg true wind needs headingNorth, speedOverGround, apparentWindDir, and apparentWindSpeed. eg

if(headingNorth && speedOverGround && apparentWindDir && apparentWindSpeed){
    //calc true wind
    //update trueWind*
}