Skip to content

Robustness of qdlscan can be improved #11

Description

@nyama8

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions