Skip to content
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

Robustness of qdlscan can be improved #11

Open
nyama8 opened this issue Nov 1, 2024 · 0 comments
Open

Robustness of qdlscan can be improved #11

nyama8 opened this issue Nov 1, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@nyama8
Copy link
Contributor

nyama8 commented Nov 1, 2024

Currently the qdlscan application operates as expected and is reasonably robust to user error on it's own: utilizing a busy flag on the application controller to reject any additional queries for scans while a scan is in progress. While the busy flag is technically a public attribute (can be get/set by the standard ScanController.busy syntax), it is designed to be used as an internal attribute which is get/set only by the ScanController class itself.

The reason for the quasi-private usage is that a user could accidentally set the busy flag into an incorrect state, enabling queries for scans which fail manifestly (because the hardware is occupied). This type of usage was not initially planned and so the development of the ScanController has resulted in busy being a public variable.

At the same time, the addition of the counter, qdlscope, into the application (which is called by right click menu or the main control panel), introduces yet another way to occupy the hardware which bypasses the application controller completely. In the current version of qdlscan (implemented in pull request #10) one can cause the software to soft lock itself by (1) launching the qdlscope, starting sampling which occupies the edge counter, then (2) attempting to launch a scan in qdlscan. This forces the application controller into the busy state, but the software cannot complete the function and is then locked in the busy state, requiring a restart to become operational.

These two issues are closely linked and the following steps could be made to improve the robustness of the application:

  1. Update the ScanController.busy attribute to a local, private variable _busy and then create a getter method (e.g. is_busy(self) -> bool) which simply returns the value of _busy (which is True or False).
  2. Update all calls/checks of the old busy attribute in the remainder of the application code (primarily the main application LauncherApplication, etc.) to utilize the new getter and no longer refer to the protected variable _busy or the old busy.
  3. Route the call of qdlscope during a "open counter" command (corresponding to the method open_counter() of the LauncherApplication) through the application controller (ScanController) to enable setting of the _busy flag, protecting against the soft-locked state describe above.
@nyama8 nyama8 added bug Something isn't working good first issue Good for newcomers labels Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant