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

Move line plot display layers inspector section to declarative UI #1201

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

KRLango
Copy link
Contributor

@KRLango KRLango commented Oct 10, 2024

Switching the line plot display layers section of the inspector to use the declarative UI

def remove_widget_from_content(self, widget: UserInterface.Widget) -> None:
# need to remove widget and spacing from before the widget
index = self.__section_content_column.children.index(widget)
spacing = self.__section_content_column.children[index - 1]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this guaranteed to have a spacing before the widget?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes based on the function add_widget_to_content - line 286. If I didn't do that, the space there grows every time you interact with any of the controls.

@Ion-e
Copy link

Ion-e commented Oct 14, 2024

When adding composite line plots, the second line plot fill colour appears as Blank.

line_plot_display_layer_model.data_index_model.Value = 0
line_plot_display_layer_model.data_index_model.Value = ""
line_plot_display_layer_model.data_index_model.Value = "A"
line_plot_display_layer_model.data_index_model.Value = 0
Copy link
Contributor

@lisham2000 lisham2000 Oct 14, 2024

Choose a reason for hiding this comment

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

Any reason you are testing =0 twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the particular test is test_setting_display_layer_to_no_display_data_channel_and_back, the last set to 0 is the back of that.

@Ion-e
Copy link

Ion-e commented Oct 14, 2024

When pressing the "+" button to add a layer > Current behaviour is opposite to Master > A new layer is inserted in the list (as opposed to appended in master)

@Ion-e Ion-e assigned KRLango and unassigned Ion-e Oct 14, 2024
@KRLango KRLango assigned Ion-e and unassigned KRLango Oct 14, 2024
@KRLango KRLango marked this pull request as ready for review October 15, 2024 16:30
Copy link
Collaborator

@cmeyer cmeyer left a comment

Choose a reason for hiding this comment

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

There are a few issues with this PR - but the main thing is that the list structure is being done manually rather than using a list model with a declarative column.

I'm attaching a new version of Inspector.py which switches to a cleaner structure where the column is managed by the list model; and the list model is observed from the display item. This avoids having to explicitly manage the items in the list (i.e. remove_widget_from_container and its ilk are no longer needed). This was easier to show rather than explain.

In addition, I've made a number of other minor changes to fix some, but not all, issues that came up in testing. There were things like changing the 'data index' threw a conversion error that prevented it from working. I did NOT fix the problem of the complex display type chooser not appearing in the inspector.

I'm also attaching the test procedure I was testing against.

The new version of Inspector.py requires this PR: nion-software/nionutils#30

Inspector.py.zip

test-procedure.zip

@KRLango KRLango marked this pull request as ready for review October 17, 2024 15:52
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.

5 participants