Skip to content

Commit

Permalink
Use enum properties to determine plot types
Browse files Browse the repository at this point in the history
  • Loading branch information
krzywon committed Dec 3, 2024
1 parent 31055cd commit 66a1a77
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/sas/qtgui/MainWindow/DataExplorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,10 +1123,8 @@ def displayData(self, data_list, id=None):

plot_name = plot_to_show.name
role = plot_to_show.plot_role
stand_alone_types = [DataRole.ROLE_RESIDUAL, DataRole.ROLE_RESIDUAL_SESANS, DataRole.ROLE_STAND_ALONE,
DataRole.ROLE_LIN_LIN, DataRole.ROLE_POLYDISPERSITY]

if (role in stand_alone_types and shown) or role == DataRole.ROLE_DELETABLE:
if (role.stand_alone and shown) or role == DataRole.ROLE_DELETABLE:
# Nothing to do if stand-alone plot already shown or plot to be deleted
continue
elif role in [DataRole.ROLE_RESIDUAL, DataRole.ROLE_RESIDUAL_SESANS] and config.DISABLE_RESIDUAL_PLOT:
Expand All @@ -1135,7 +1133,7 @@ def displayData(self, data_list, id=None):
elif role in [DataRole.ROLE_POLYDISPERSITY] and config.DISABLE_POLYDISPERSITY_PLOT:
# Nothing to do if polydispersity plot is not plotted
continue
elif role in stand_alone_types:
elif role.stand_alone:
# Stand-alone plots should always be separate
self.plotData([(plot_item, plot_to_show)])
elif append:
Expand Down

0 comments on commit 66a1a77

Please sign in to comment.