-
Notifications
You must be signed in to change notification settings - Fork 49
Sending data to fitting automatically plots the data (#2299) #2315
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
3ea397c
6881844
ba7e164
0d747ab
56d703b
f31f226
e368382
0b9189d
466bdb7
3b2b4ed
2c9e18c
7499b79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -778,8 +778,15 @@ def isItemReady(index): | |
| try: | ||
| if self.chkSwap.isChecked(): | ||
| self._perspective().swapData(selected_items[0]) | ||
| if self._perspective().name == 'Fitting': | ||
| if config.FITTING_PLOT_ON_SEND_DATA: | ||
| self.newPlot() #todo sort out where the plot should go. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this TODO explains why I get a separate data+model chart on Compute/plot. |
||
| else: | ||
| self._perspective().setData(data_item=selected_items, is_batch=self.chkBatch.isChecked()) | ||
| if self._perspective().name == 'Fitting': | ||
| if config.FITTING_PLOT_ON_SEND_DATA: | ||
| self.newPlot() | ||
|
|
||
| except Exception as ex: | ||
| msg = "%s perspective returned the following message: \n%s\n" % (self._perspective().name, str(ex)) | ||
| logging.error(ex, exc_info=True) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| from sas.system import config | ||
|
|
||
| from .PreferencesWidget import PreferencesWidget, config_value_setter_generator | ||
|
|
||
|
|
||
| class FittingPreferencesWidget(PreferencesWidget): | ||
| def __init__(self): | ||
| super(FittingPreferencesWidget, self).__init__("Fitting Settings") | ||
| self.addCheckBox(title="Auto-plot data when sent to fitting perspective", | ||
| callback=config_value_setter_generator('FITTING_PLOT_ON_SEND_DATA', dtype=bool), | ||
| checked=config.FITTING_PLOT_ON_SEND_DATA) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this needs porting to the new way of describing preferences |
||

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.
Using
andto concatenate the two conditionals looks slightly better as there is less levels of indentation.Here and in the other cases