Skip to content

[038_limit_curves_selection], issue #38, Limited selection in listbox#43

Merged
lelaus merged 2 commits into
masterfrom
038_limit_curves_selection
Jul 7, 2025
Merged

[038_limit_curves_selection], issue #38, Limited selection in listbox#43
lelaus merged 2 commits into
masterfrom
038_limit_curves_selection

Conversation

@dmanzione

@dmanzione dmanzione commented Mar 24, 2025

Copy link
Copy Markdown
Collaborator

To cope with the fact that the TuPlot executable can produce a limited number of plot files (i.e. 10), the listbox widget of the GUI, where several curves can be selected to be plotted at once, has been modified to have a limited number of selectable items.
In the PlotSettingsListBox class, the MAX_SELECTABLE_ITEMS attribute has been introduced to drive how many curves can be selected and then plotted. If more items than the admitted ones are selected, only the firstly 10 selected items will be actually shown as selected and plotted. Any attempt to select an additional item in the listbox widget will produce no changes.

The listbox widget, where several curves can be selected to be plotted at once, now has a limited number of selectable items. In the 'PlotSettingsListBox', the 'MAX_SELECTABLE_ITEMS' attribute drives how many curves can be plotted. If more items than the admitted one are selected, only the number of items indicated by 'MAX_SELECTABLE_ITEMS' are actually shown as selected and can be plotted. Any further attempt to selected another item in the listbox widget does not produce any result. This limit has been introduced to cope with the fact that the plotting executable can produce a limited number of plot files.
Comment thread tugui/plot_settings.py Outdated
self.stored_indxs = indexes[0:10]
# Get the indices of the items to be deselected
indxs = set(indexes) - set(self.stored_indxs)
if indxs:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This if statement seems useless. Actually, if you are here, the indexes in excess are at least one. You are here because lex(indexes) is greater than 10, so ... Please check whether this if statement can be removed.

Comment thread tugui/plot_settings.py
@lelaus lelaus merged commit cac9c8d into master Jul 7, 2025
2 checks passed
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.

2 participants