-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Common entry-widget for MainGui and SFCalculatorUI
* create deadtime entry widget Signed-off-by: Jose Borreguero <[email protected]> * add default pull request template Signed-off-by: Jose Borreguero <[email protected]> * deadtime_entry for the sf_calculator Signed-off-by: Jose Borreguero <[email protected]> * deadtime options for the main GUI Signed-off-by: Jose Borreguero <[email protected]> * deadtime unit tests for DeadTimeEntryPoint Signed-off-by: Jose Borreguero <[email protected]> * deadtime unit tests for SFCalculator.apply_deadtime_update Signed-off-by: Jose Borreguero <[email protected]> * deadtime unit tests for SFCalculator.show_dead_time_dialog Signed-off-by: Jose Borreguero <[email protected]> * tyring different string to fool flake8 Signed-off-by: Jose Borreguero <[email protected]> * tyring different string to fool flake8 Signed-off-by: Jose Borreguero <[email protected]> * tyring different string to fool flake8 Signed-off-by: Jose Borreguero <[email protected]> * test for file not in the data server Signed-off-by: Jose Borreguero <[email protected]> * QtCore.Qt. instead of Qt. Signed-off-by: Jose Borreguero <[email protected]> * ignore silly errors by mypy Signed-off-by: Jose Borreguero <[email protected]> * ignore silly errors by mypy Signed-off-by: Jose Borreguero <[email protected]> * unit tests for MainGui.apply_deadtime_update and for MainGui.show_deadtime_settings Signed-off-by: Jose Borreguero <[email protected]> * ammend the pull-request template Signed-off-by: Jose Borreguero <[email protected]> --------- Signed-off-by: Jose Borreguero <[email protected]>
- Loading branch information
Showing
17 changed files
with
1,073 additions
and
287 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# References | ||
- EWM # | ||
<!-- Links to related issues or pull requests --> | ||
|
||
# Description of the changes: | ||
<!-- description here. --> | ||
|
||
# Manual test for the reviewer | ||
Before running the manual tests, install the conda environment and install the source in editable mode | ||
```bash | ||
> conda env create --solver libmamba --name refred-dev --file ./environment.yml | ||
> conda activate refred-dev | ||
(refred-dev)> pip install -e . | ||
``` | ||
Start RefRed GUI | ||
```bash | ||
(refred-dev)> PYTHONPATH=$(pwd):$PYTHONPATH ./scripts/start_refred.py | ||
``` | ||
Or run tests | ||
```bash | ||
(refred-dev)> pytest test/unit/RefRed/test_main.py | ||
``` | ||
|
||
# Check list for the reviewer | ||
- [ ] I have verified the proposed changes | ||
- [ ] Author included tests for the proposed changes | ||
- [ ] best software practices | ||
+ [ ] clearly named variables (better to be verbose in variable names) | ||
+ [ ] code comments explaining the intent of code blocks | ||
+ [ ] new functions and classes detailed docstrings, parameters documented | ||
- [ ] All tests are passing | ||
- [ ] Documentation is up to date | ||
|
||
# Check list for the author | ||
- [ ] I have added tests for my changes | ||
- [ ] I have updated the documentation accordingly | ||
- [ ] I included a link to IBM EWM Story or Defect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# third party imports | ||
from qtpy.QtWidgets import QGroupBox, QHBoxLayout, QCheckBox, QPushButton | ||
|
||
|
||
class DeadTimeEntryPoint(QGroupBox): | ||
def __init__(self, title='Dead Time Correction'): | ||
super().__init__(title) | ||
self.initUI() | ||
|
||
def initUI(self): | ||
# Set the stylesheet for the group box to have a border | ||
self.setStyleSheet( | ||
"QGroupBox {" | ||
" border: 1px solid gray;" | ||
" border-radius: 5px;" | ||
" margin-top: 1ex;" # space above the group box | ||
"} " | ||
"QGroupBox::title {" | ||
" subcontrol-origin: margin;" | ||
" subcontrol-position: top center;" # align the title to the center | ||
" padding: 0 3px;" | ||
"}" | ||
) | ||
|
||
self.applyCheckBox = QCheckBox('Apply', self) | ||
self.applyCheckBox.stateChanged.connect(self.toggleSettingsButton) | ||
self.settingsButton = QPushButton('Settings', self) | ||
self.settingsButton.setEnabled(self.applyCheckBox.isChecked()) # enabled if we use the correction | ||
|
||
# Create a horizontal layout for the checkbox and settings button | ||
hbox = QHBoxLayout() | ||
hbox.addWidget(self.applyCheckBox) | ||
hbox.addWidget(self.settingsButton) | ||
hbox.addStretch(1) # This adds a stretchable space after the button (optional) | ||
|
||
# Set the layout for the group box | ||
self.setLayout(hbox) | ||
|
||
def toggleSettingsButton(self, state): | ||
# Enable the settings button if the checkbox is checked, disable otherwise | ||
self.settingsButton.setEnabled(state) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
b1e4ae1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitLab pipeline for refred-dev has been submitted for this commit: "https://code.ornl.gov/sns-hfir-scse/deployments/conda-legacy-deploy/-/pipelines/559688"