oss-slu / Mouser

GNU General Public License v3.0
1 stars 7 forks source link

Fix for bug #214 #218

Closed moshernoah closed 2 months ago

moshernoah commented 2 months ago

Fixes #214

What was changed?

experiment_menu_ui.py was updated to include a check upon building the screen to see if the RFID IDs were mapped to the correct number of specimens for the current experiment. If the incorrect number of specimens are mapped, all buttons except for the map RFID button are disabled. This works both after opening an existing mouser file and after creating a new one.

An important note is that existing issues from the program still exist. The OS Fixes from other current branches is required to make the program function properly during the experiment creation step.

Why was it changed?

This was changed to ensure more simple and streamlined functionality. For experimentation purposes, the RFIDs need to be mapped before any other data can be collected, so this change allows that to be the only enabled button as the others should not be pressed until afterwards anyway.

How was it changed?

In line 66, a new method is called from the init function called disable_buttons_if_needed. This ensures that when the screen is created, the check occurs. From lines 135-140, the new method is defined. It references an existing method called all_rfid_mapped already existing in the program which checks if all specimens have been mapped to an RFID. If yes, the buttons are set to normal. If no, the on screen buttons except for Map RFID are disabled.

Screenshots that show the changes:

image