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

fix: provide a null delta when timeRemaining changes to unknown #74

Closed
wants to merge 1 commit into from

Conversation

sbender9
Copy link
Member

This includes the state changes from #72

I am tempted to change n2kMapper to do this null delta for all fields in all PGNs. I think that makes sense, then each pgn would not have to have code for checking state like this.

That would mean keeping state for every single value in n2k.

source: 'Time Remaining',
value: function(n2k, state) {
var val = n2k.fields['Time Remaining']
console.log("state: " + state)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log

@tkurki
Copy link
Member

tkurki commented Jul 12, 2017

So the idea of this is to send one delta with null value when the PGN no longer has the field Time Remaining.

I am not absolutely sure if this is what we should be doing.

As discussed in SignalK/specification#93 there is a case for a client receiving deltas continuously with null values to indicate that the system is operating properly end to end but for some reason there is no valid value available at this time.

The stopgap that makes the current implementation ignore PGNs that do not have the expected field is https://github.com/SignalK/n2k-signalk/blob/master/n2kMapper.js#L90. If we change that to send null values instead it changes the behavior somewhat dramatically. This would allow for example a gauge that shows timeremaining based on deltas to indicate differently the total absence of input data and not having a valid value.

@sbender9
Copy link
Member Author

So do you want to do anything with this now. I'm ok with tabling it until later. WilhelmSK ends up showing red for the "freshness" indicator anyway.

@sbender9
Copy link
Member Author

Closing for alternate implementation #77

@sbender9 sbender9 closed this Jul 16, 2017
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

Successfully merging this pull request may close these issues.

2 participants