Additional Threading on Data Collection + Related #329
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #319
What was changed?
The Data Collection screen has been modified to always be listening to both the serial input device as well as the RFID reader, each on their own thread, while leaving the main thread open for user input. Related files and methods were also updated to ensure thread safety throughout the program.
Why was it changed?
This was changed for several reasons. First, the client would like to be able to scan multiple animals without having to do extra steps while on the data collection screen. In addition, it ensures threads are only running for the things they need to be and, with the addition of the extra thread safe methods, keeps the program in a much more overall stable state with (hopefully) less crashes.
How was it changed?
Data_collection has been changed to have two always running continuous threads- one for the RFID device and one for the serial device. These threads interact with the main program in safe ways, ensuring they are not accessing the same pieces of information at the same time. In addition, other files such as the experiment database, flash overlay, and serial device controller have been changed to support the new thread safe methods of access.