Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deltas created by parser should be aware of the source if there are multiple sources that produce the value #73

Open
fabdrol opened this issue Dec 18, 2016 · 1 comment
Milestone

Comments

@fabdrol
Copy link
Member

fabdrol commented Dec 18, 2016

In the current SK spec, multiple engines reporting RPM are recorded like this:

propulsion.engine1.revolutions
propulsion.engine2.revolutions
propulsion.engine3.revolutions
etc

In the current RPM hook a delta is created with propulsion.engine1.revolutions hardcoded as the path. This is an issue, there are more than one engines. We need a way to indicate, to the hook, what source the data is coming from and how that should affect the resulting delta.

One way is to use context, and to allow the parser to be instantiated with a different context both at the global level (e.g. new Parser({ context: '...' }) and at the individual sentence-level (e.g. parser.parse(sentence, '<context>')).

@fabdrol fabdrol added this to the 2.0 milestone Dec 18, 2016
@tkurki
Copy link
Member

tkurki commented Dec 18, 2016

context is sort of loaded in Signal K, I wouldn't use that. I would go for something more sentence specific, like

new Parser({
  RPM: {
    engineId: 'starboard'
  }
})

and use sensible defaults in case there is no configuration.

@fabdrol fabdrol modified the milestones: v1, 2.0 Dec 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants