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

Adds a controls widget #16

Merged
merged 43 commits into from
Sep 4, 2024
Merged

Conversation

alexhroom
Copy link
Collaborator

@alexhroom alexhroom commented Aug 14, 2024

This PR fixes #7 by adding a Controls widget to the MDI. In particular:

  • adds an editControls command for undoable edits to the Controls object
  • adds controls getters and setters for the MainWindowPresenter
  • adds a ControlsWidget and FitSettingsWidget subwidget for the controls interface
  • creates EnumDelegate and BoolDelegate, unused item delegates which will be used later for the Project tab
  • creates a ValidatedInputWidget which generates a value input field from Pydantic field info
  • adds an AdaptiveDoubleSpinBox featuring adaptive decimal places and scientific notation

Note there is currently one workaround in here - resampleParams is not listed in the widget until we have decided on what to do about RascalSoftware/python-RAT#69

See below screenshots of the widget when running and not running. When running, the areas to edit the Controls object are greyed out so that it cannot be edited during a run. If there are invalid fit settings, trying to run will produce an error message telling the user which fit settings are invalid.

Screenshot from 2024-08-19 15-18-36
Screenshot from 2024-08-19 15-18-53
Screenshot from 2024-08-19 15-19-12

@alexhroom alexhroom requested a review from StephenNneji August 14, 2024 13:49
rascal2/dialogs/error_dialog.py Outdated Show resolved Hide resolved
rascal2/ui/view.py Show resolved Hide resolved
rascal2/ui/view.py Outdated Show resolved Hide resolved
rascal2/widgets/controls/view.py Outdated Show resolved Hide resolved
rascal2/widgets/controls/view.py Outdated Show resolved Hide resolved
rascal2/widgets/controls/model.py Outdated Show resolved Hide resolved
@alexhroom alexhroom requested a review from StephenNneji August 19, 2024 14:25
Copy link
Contributor

@StephenNneji StephenNneji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there, please see comments

rascal2/widgets/controls/view.py Outdated Show resolved Hide resolved
rascal2/widgets/controls/view.py Outdated Show resolved Hide resolved
rascal2/widgets/controls/view.py Outdated Show resolved Hide resolved
rascal2/ui/presenter.py Show resolved Hide resolved
rascal2/widgets/controls/model.py Outdated Show resolved Hide resolved
rascal2/ui/presenter.py Show resolved Hide resolved
rascal2/widgets/controls/view.py Outdated Show resolved Hide resolved
rascal2/widgets/controls/model.py Outdated Show resolved Hide resolved
rascal2/widgets/controls/model.py Outdated Show resolved Hide resolved
@alexhroom alexhroom requested a review from StephenNneji August 22, 2024 12:27
rascal2/dialogs/__init__.py Outdated Show resolved Hide resolved
rascal2/ui/presenter.py Show resolved Hide resolved
rascal2/ui/presenter.py Outdated Show resolved Hide resolved
tests/test_presenter.py Outdated Show resolved Hide resolved
rascal2/ui/presenter.py Outdated Show resolved Hide resolved
tests/test_controls_view.py Outdated Show resolved Hide resolved
@alexhroom alexhroom requested a review from StephenNneji August 28, 2024 10:42
rascal2/ui/view.py Outdated Show resolved Hide resolved
@alexhroom alexhroom mentioned this pull request Sep 2, 2024
@alexhroom alexhroom force-pushed the 7-control-widget branch 2 times, most recently from 2f6fdb6 to b7788a6 Compare September 4, 2024 06:39
@alexhroom alexhroom merged commit ebffd99 into RascalSoftware:main Sep 4, 2024
4 checks passed
@alexhroom alexhroom deleted the 7-control-widget branch September 4, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a control widget
2 participants