SignalK / signalk-derived-data

Generates deltas for values derived from signalk values
Apache License 2.0
18 stars 31 forks source link

Tankcalibration (WIP) #8

Closed joabakk closed 7 years ago

joabakk commented 7 years ago

Still experimental, but should show the basics. Thanks for the PR to the node server (https://github.com/SignalK/signalk-server-node/pull/285). The example code

plugin.schema = function() {
    var tank_instances = _.keys(app.signalk.self.tanks)
    return  {
      type: "object",
      required: [
      ],
      properties: {
        alarmState: {
          title: "Tank",
          type: "string",
          default: "alarm",
          "enum": tank_instances
        }
      }
    }
  }

would probably fit in index.js, not the calcs/file.js. That sort of messes up the split.

sbender9 commented 7 years ago

I should be able to make the new stuff work in the split files...

sbender9 commented 7 years ago

Hmm. Take a look at calcs/batteryPower.js, that may actually be the way to do this?

joabakk commented 7 years ago

Oops, that was a quick pull. I just made calculations actually use the input calibration values... Next is to make units friendlier. Not many of us boaters use m3 when filling...

joabakk commented 7 years ago

I can't find calcs/batteryPower.js...