How to use the @signalk/signalk-schema.getAISShipTypeName function in @signalk/signalk-schema

To help you get started, we’ve selected a few @signalk/signalk-schema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SignalK / signalk-server-node / src / serverroutes.js View on Github external
}
    if (newVessel.beam) {
      set('design.beam.value', Number(newVessel.beam))
    }
    if (newVessel.height) {
      set('design.airHeight.value', Number(newVessel.height))
    }
    if (newVessel.gpsFromBow) {
      set('sensors.gps.fromBow.value', Number(newVessel.gpsFromBow))
    }
    if (newVessel.gpsFromCenter) {
      set('sensors.gps.fromCenter.value', Number(newVessel.gpsFromCenter))
    }
    if (newVessel.aisShipType) {
      set('design.aisShipType.value', {
        name: getAISShipTypeName(newVessel.aisShipType),
        id: Number(newVessel.aisShipType)
      })
    }

    skConfig.writeDefaultsFile(app, data, err => {
      if (err) {
        res.status(500).send('Unable to save to defaults file')
      } else {
        res.send('Vessel changed')
      }
    })
  })

@signalk/signalk-schema

SignalK specification schema as an npm module with tests

CC-BY-SA-2.0
Latest version published 10 months ago

Package Health Score

65 / 100
Full package analysis