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

feat: New UI for option in topview & sideview #2407

Merged

Conversation

rohit2p
Copy link
Contributor

@rohit2p rohit2p commented Jun 18, 2024

Purpose of PR?:

This PR contain new UI for option in topview & sideview with more features.

Checklist:

  • New feature

@ReimarBauer
Copy link
Member

The PathPlotter needs to have your new options now.
https://github.com/Open-MSS/MSS/blob/develop/mslib/msui/mpl_pathinteractor.py#L324

@rohit2p
Copy link
Contributor Author

rohit2p commented Jun 23, 2024

@ReimarBauer @joernu76 can you take a look plz, does it seems good? can i move on to the next thing?

@ReimarBauer
Copy link
Member

@rohit2p the remote sensing bug will be fixed soon but the flake8 is yours

@rohit2p
Copy link
Contributor Author

rohit2p commented Jun 25, 2024

@ReimarBauer @joernu76 can you take a look i am implemented line thickness, transparency of lines, dashed lines option in topview option they are working but the problem is the value is getting stored in settings but when i restart the application the map plot doesn't reload according to the saved value in settings.

can you suggest me something how can fix this also does my implementation looks correct to you?

Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

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

There is a difference with the new elements. All other options are only set after the OK, the new ones immeaditly. All options should behave identical and this in all views having a flight path.
So we maybe should also have this feature in Sideview.

other_options

@@ -336,7 +336,7 @@ class PathPlotter:
def __init__(self, ax, mplpath=None,
facecolor='blue', edgecolor='yellow',
linecolor='blue', markerfacecolor='red',
Copy link
Member

@ReimarBauer ReimarBauer Jun 26, 2024

Choose a reason for hiding this comment

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

when you want to keep the stored values you need to use them here. Here you initialize the new line with a thickness of 2.

Edit: We are not using msui-core.conf currently to restore the used values. They persists only in a session. This means we have to look on redraw functionality

Copy link
Member

Choose a reason for hiding this comment

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

Have a look on redraw_path

Copy link
Member

Choose a reason for hiding this comment

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

and set_settings in mpl_qtwidget there we use the other options for initializing them on e.g. a second topview.

@joernu76
Copy link
Member

I just tried out your UI_element_in_option branch. Should it work, currently?

@rohit2p rohit2p changed the title feat: New UI for option in topview feat: New UI for option in topview & sideview Jun 27, 2024
@rohit2p rohit2p requested a review from ReimarBauer June 27, 2024 15:37
@ReimarBauer
Copy link
Member

First try

Fatal error in MSS 9.0.0 on Linux-6.5.0-10040-tuxedo-x86_64-with-glibc2.35
Python 3.11.6 | packaged by conda-forge | (main, Oct  3 2023, 10:40:35) [GCC 12.3.0]

Please report bugs in MSS to https://github.com/Open-MSS/MSS

Information about the fatal error:

Traceback (most recent call last):
  File "/home/user/PycharmProjects/2024/rohit2p/MSS/mslib/msui/msui_mainwindow.py", line 895, in create_view_handler
    self.create_view(_type, self.active_flight_track)
  File "/home/user/PycharmProjects/2024/rohit2p/MSS/mslib/msui/msui_mainwindow.py", line 913, in create_view
    view_window = topview.MSUITopViewWindow(mainwindow=self, model=model,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/PycharmProjects/2024/rohit2p/MSS/mslib/msui/topview.py", line 243, in __init__
    self.setup_top_view()
  File "/home/user/PycharmProjects/2024/rohit2p/MSS/mslib/msui/topview.py", line 331, in setup_top_view
    self.setFlightTrackModel(self.waypoints_model)
  File "/home/user/PycharmProjects/2024/rohit2p/MSS/mslib/msui/viewwindows.py", line 253, in setFlightTrackModel
    self.mpl.canvas.set_waypoints_model(model)
  File "/home/user/PycharmProjects/2024/rohit2p/MSS/mslib/msui/mpl_qtwidget.py", line 1543, in set_waypoints_model
    self.set_settings(None)
  File "/home/user/PycharmProjects/2024/rohit2p/MSS/mslib/msui/mpl_qtwidget.py", line 1670, in set_settings
    wpi_plotter.set_line_thickness(settings["line_thickness"])
                                   ~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'line_thickness'

@ReimarBauer
Copy link
Member

ReimarBauer commented Jul 1, 2024

When I open Topview or Sideview I get

example.mp4

@joernu76 joernu76 marked this pull request as ready for review July 4, 2024 12:33
def set_line_style(self, style):
"""Set the style of the line representing the flight track."""
line_style_dict = self.plotter.get_line_style_dict()
if style in line_style_dict:
Copy link
Member

Choose a reason for hiding this comment

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

Mmh. Should it happen that a style is not contained in the dict?

@joernu76 joernu76 merged commit a51c5ab into Open-MSS:GSOC2024-RohitPrasad Jul 4, 2024
6 of 9 checks passed
joernu76 pushed a commit that referenced this pull request Sep 12, 2024
* UI and line thickness

* line thickness working

* every new feature working in option

* Ui of the sideview

* topview completely done without the ok

* both topview and sideview working

* key error fixed

* key error fixed in sideview

* ATQ feedback change UI
@rohit2p rohit2p deleted the UI_element_in_option branch September 18, 2024 17:23
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.

3 participants