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

Bug: Improper handling of missing measurements #1212

Open
slspencer opened this issue Nov 17, 2024 · 2 comments
Open

Bug: Improper handling of missing measurements #1212

slspencer opened this issue Nov 17, 2024 · 2 comments

Comments

@slspencer
Copy link
Collaborator

When opening a pattern where the designated measurement file can't be found, the user can select another measurement file. If the selected measurement file doesn't contain all of the required measurements, the following error message is displayed. When the user clicks 'OK' the pattern closes.

Capture

This popup message could provide the user more error handling options.

These options could be:

  1. Select a new measurement file.
  2. Open the selected measurement file in SeamlyMe. If selected, ask the user whether to add the missing measurements, Y/N automatically.
  3. Close and return to Seamly2D.

Also, add the path and measurement file name in the error message for clarity.

@DSCaskey DSCaskey added the bug label Nov 18, 2024
@DSCaskey DSCaskey changed the title Feature: Improve handling of missing measurements Bug: Improper handling of missing measurements Nov 18, 2024
@DSCaskey DSCaskey self-assigned this Nov 18, 2024
@DSCaskey
Copy link
Contributor

DSCaskey commented Nov 19, 2024

  1. Select a new measurement file.
  2. Open the selected measurement file in SeamlyMe. If selected, ask the user whether to add the missing measurements, Y/N automatically.
  3. Close and return to Seamly2D.

Doesn't quite work that way. You have to keep in mind that Seamly2D can be running from a command line with no GUI, and you have to account for that. If Seamly is running from the command line and it can't find the measurement file it has to abort - thus the File excpetion. The problem is the loadPattern(), checkPathToMeasurments(), and checkRequiredMeasurements() methods are a mess. Since the gui/nogui modes here are coupled together, even when in gui mode it throws the file exception if there are missing measurements, rather than taking a more graceful course of action. And actually throwing the exception in no GUI mode makes no sense as there is no GUI to see the message box... just need to exit the app.

@slspencer
Copy link
Collaborator Author

per @DSCaskey - checkRequiredMeasurements() throws an exception, but it should only return whether the measurements are valid. The exception should be thrown elsewhere.
This workflow should be broken up into smaller, more fine grained functions(), but won't be handled right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants