pez-globo / pufferfish-software

All software for the Pufferfish ventilator.
Apache License 2.0
0 stars 1 forks source link

Improve frontend code comments and refactor modules/app #391

Closed rohanpurohit closed 3 years ago

rohanpurohit commented 3 years ago

This PR includes:

Issue #390:

Issue #331:

Issue #361:

Misc Refactor/feature addition:

rohanpurohit commented 3 years ago

@ethanjli observations from testing on my end:

rohanpurohit commented 3 years ago

@ethanjli This PR is ready for testing/code review. I have updated the PR description with the latest changes, in terms of code quality:

ethanjli commented 3 years ago

Thanks, I will test and review. Were you able to identify the source of the behavior you reported about the backend's "firmware disconnected" alarm not causing the frontend to show it as an active alarm (with a red border)?

rohanpurohit commented 3 years ago

Thanks, I will test and review. Were you able to identify the source of the behavior you reported about the backend's "firmware disconnected" alarm not causing the frontend to show it as an active alarm (with a red border)?

sorry! I forgot about that, moreover so because we have disabled the mute button on firmware disconnection, but I realize we have to find the cause for that regression. I will do that now!

rohanpurohit commented 3 years ago

@ethanjli the behavior actually makes sense, so the mute button sends a request when it's clicked to change the active state of AlarmMute message and that certainly won't happen when the firmware is disconnected, and the red border and audio for alarms looks at the getAlarmMuteActive selector which is AlarmMute message active field, so whatever was the state before firmware was disconnected remains, that is if mute was active before disconnection, there won't be a border/audio and vice-versa. for the backend disconnection we look at just AlarmMuteRequest active therefore we can toggle the border and audio.

ethanjli commented 3 years ago

I see. From your explanation, I must have misunderstood what the behavior was. I had thought that you meant that when the firmware got disconnected, backend created an active alarm but that never triggered the red border in the frontend (even when alarms weren't muted). Instead, it looks like the behavior is as follows:

This observation is useful for informing how we should implement #372, though I haven't thought about that enough to propose any concrete approaches.

ethanjli commented 3 years ago

Observations from testing against #361: everything works as expected, except when ventilation is inactive and the firmware disconnects - the comment I made at https://github.com/pez-globo/pufferfish-software/issues/361#issuecomment-863733123 only partially specified the desirable behavior, by describing a less desirable behavior. Perhaps what we should have here is that when the backend or firmware are disconnected in standby mode, then the "Start Ventilation" is disabled and says either "Loading...", "Connecting...", or something else. Let's discuss to see if this behavior would make the most sense for usability and safety, or if we should have some other behavior.

I'm also wondering if it might make more sense to say "Loading..." instead of "Connecting...", or even to have the button label say "Starting Ventilation..." or "Pausing Ventilation..." in their corresponding situations instead of "Connecting...".

Additional observations:

rohanpurohit commented 3 years ago
  1. This project is licensed under Apache License v2.0 for any software, and Solderpad Hardware License v2.1 for any hardware - do you agree that your contributions to this project will be under these licenses, too? Yes.
  2. Were any of these contributions also part of work you did for an employer or a client? No.
  3. Does this work include, or is it based on, any third-party work which you did not create? No.