-
Notifications
You must be signed in to change notification settings - Fork 0
Add PanelTestMode suppport to smx class #42
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
Conversation
sdk/smx.ts
Outdated
this.testModeIntervalHandle = setInterval(() => { | ||
this.events.output$.push(Uint8Array.of(API_COMMAND.SET_PANEL_TEST_MODE, mode)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I think there's probably a better way to do this with the BaconJS interval to generate a stream of regular events that we can use for this. I'll add the UI for this first and worry about thinking through the better version of this interval later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah interesting. Would just need a way to tell it to stop since it says indefinitely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I think you would chain the interval stream with a takeUntil
that watches another event stream (maybe a bus we can manually emit from) for a stop signal.
sdk/smx.ts
Outdated
// TODO: Do I need to call this to consume the event? | ||
this.events.ackReports$.firstToPromise(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need to worry about consuming these. I think because they are acks to unattended commands we can just let them silently discarded in the background.
Can't test today, but added a checkbox in the UI for this |
Decided to finally come back to this for some reason... (no mystery on why it took so long, PR was originally opened 4 days before my son was born 😁) Turning on test mode does turn off the lights on the pad, but I'm not actually getting any of the test mode lights in place of the idle patterns. I have to assume this is an issue with our app since my stages work as expected with the pressure test mode toggle in the SMX software (don't have a convenient way to test the windows config app right now) |
9a1667b
to
a9440a8
Compare
ok, so test mode should be working now and I've deleted some unnecessary lines. If you could give it a test at some point to confirm I'm not crazy that would be good. Unsure if we want to apply any other constraints to test mode, but I turned test mode on and also requested sensor test values at the same time and it seems you can do both. I guess the last thing would be to potentially move the interval I'm using to some kind of bacon control. I'll have to get back into that stuff as I've mostly forgotten how that all works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirmed working now!
Modeled off of source code, but not tested. Will need a checkbox/slider to turn panel test mode on and off