pez-globo / pufferfish-software

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

Debounce patient alarms #378

Closed ethanjli closed 3 years ago

ethanjli commented 3 years ago

This PR fixes #322 by:

This PR also does some refactoring in the firmware:

This PR also reorganizes some files in the firmware:

Due to the file reorganization:

ethanjli commented 3 years ago

@rohanpurohit This PR is now ready for testing. Since it refactors/touches a lot of modules, it would be helpful if you could exercise as many functionalities of the firmware as possible during testing. I've tagged you and Raavi in the PR description for items where certain changes may impact how you implement things in the firmware.

For records-keeping:

  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
ethanjli commented 3 years ago

without commenting out the initializables array, ventilation cannot be started and shows that the connection to the MCU is lost, also fixes the bug where it takes straight to dashboard sometimes

Hmm, I'm not sure I understand what you mean. I personally am able to run the firmware and start ventilation with the following in main.cpp:

auto initializables = PF::Driver::make_initializables(sfm3019_air, sfm3019_o2, /*fdo2,*/ nonin_oem);

(I comment out fdo2 because I don't have a working hardware unit for it). If you comment out the elements in the array for the sensors you're missing, are you able to run the firmware and start ventilation? I would expect that if you comment out the entire line declaring/defining the initializables object, the firmware shouldn't compile (because main() uses the variable).

rohanpurohit commented 3 years ago

without commenting out the initializables array, ventilation cannot be started and shows that the connection to the MCU is lost, also fixes the bug where it takes straight to dashboard sometimes

Hmm, I'm not sure I understand what you mean. I personally am able to run the firmware and start ventilation with the following in main.cpp:

auto initializables = PF::Driver::make_initializables(sfm3019_air, sfm3019_o2, /*fdo2,*/ nonin_oem);

Oh! so to clarify i don't have any of those sensors with me currently, i plan to get them soon, so i remember facing a situation where if i DONT do this

 auto initializables = PF::Driver::make_initializables(/*sfm3019_air, sfm3019_o2, fdo2, nonin_oem*/);

it would take me straight to the dashboard instead of what I'm seeing currently where it says lost connection to the mcu, n i see the same on develop so maybe I'm confusing it with some other bug that was not fixed in this PR.

(I comment out fdo2 because I don't have a working hardware unit for it). If you comment out the elements in the array for the sensors you're missing, are you able to run the firmware and start ventilation?

Yes, I'm able to. sorry for the confusion

ethanjli commented 3 years ago

Ah, that's good to know. Currently, if the firmware fails setup, the frontend's landing page still allows us to press "Start" and "Start Ventilation", but it also reports that it has lost its connection to the hardware controller; if I press "Start Ventilation", the button doesn't do anything (should be fixed with #361). We should ensure that the microcontroller is connected and active before we enable the "Start" button from the landing page (which requires #371).