Skip to content

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

Merged
merged 8 commits into from
Feb 21, 2025
Merged

Conversation

fchorney
Copy link
Collaborator

Modeled off of source code, but not tested. Will need a checkbox/slider to turn panel test mode on and off

sdk/smx.ts Outdated
Comment on lines 320 to 323
this.testModeIntervalHandle = setInterval(() => {
this.events.output$.push(Uint8Array.of(API_COMMAND.SET_PANEL_TEST_MODE, mode));
Copy link
Owner

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

Copy link
Collaborator Author

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.

Copy link
Owner

@noahm noahm May 24, 2024

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
Comment on lines 323 to 326
// TODO: Do I need to call this to consume the event?
this.events.ackReports$.firstToPromise();
Copy link
Owner

@noahm noahm May 16, 2024

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.

@noahm
Copy link
Owner

noahm commented May 16, 2024

Can't test today, but added a checkbox in the UI for this

@noahm
Copy link
Owner

noahm commented Feb 2, 2025

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)

@fchorney fchorney force-pushed the fc/add-panel-test-mode branch from 9a1667b to a9440a8 Compare February 19, 2025 22:36
@fchorney
Copy link
Collaborator Author

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.

Copy link
Owner

@noahm noahm left a comment

Choose a reason for hiding this comment

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

confirmed working now!

@noahm noahm merged commit 2c76989 into main Feb 21, 2025
4 checks passed
@noahm noahm deleted the fc/add-panel-test-mode branch February 21, 2025 06:12
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