Skip to content

Commit

Permalink
ensure controller updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mprib committed Oct 23, 2024
1 parent 67a4604 commit 672ebb3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions caliscope/gui/charuco_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,13 @@ def build_charuco(self):
# Clear any previous error message
self.charuco_display.setStyleSheet("")
self.charuco_display.setToolTip("")
self.controller.update_charuco(self.charuco)
except Exception as e:
logger.error(f"Failed to create charuco board: {str(e)}")
error_msg = "Unable to create board with current dimensions.\nThe aspect ratio may be too extreme."
error_msg = """Unable to create board with current dimensions.\n
The default dictionary may by too small (can be configured in config.toml file).
Alternatively, the aspect ratio may be too extreme.
"""
self.charuco_display.setPixmap(QPixmap()) # Clear the pixmap
self.charuco_display.setText(error_msg)
# Optional: Add some styling to make the error message stand out
Expand All @@ -186,7 +190,6 @@ def build_charuco(self):
charuco_img = self.charuco.board_pixmap(charuco_width, charuco_height)
self.charuco_display.setPixmap(charuco_img)

self.controller.update_charuco(self.charuco)


class CharucoConfigGroup(QWidget):
Expand Down

0 comments on commit 672ebb3

Please sign in to comment.