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

Autoplot - Enable mssautoplot for side and linearviews #2563

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion mslib/utils/mssautoplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@ def __init__(self, cpath, msc_url, msc_auth_password, msc_username, msc_password
self.fig.canvas.draw()
matplotlib.backends.backend_agg.FigureCanvasAgg(self.myfig.fig)
self.plotter = mpath.PathV_Plotter(self.myfig.ax)
self.username = msc_username
self.password = msc_password
self.msc_auth = msc_auth_password
self.url = msc_url

def setup(self):
self.intermediate_indexes = []
Expand Down Expand Up @@ -379,6 +383,14 @@ def update_path(self, filename=None):
highlight = [[wp[0], wp[1]] for wp in self.wps]
self.myfig.draw_vertical_lines(highlight, self.lats, self.lons)

def update_path_ops(self, filename=None):
# plot path and label
if filename != "":
self.read_operation(filename, self.url, self.msc_auth, self.username, self.password)
self.fig.canvas.draw()
self.plotter.update_from_waypoints(self.wp_model_data)
self.plotter.redraw_path(waypoints_model_data=self.wp_model_data)

def draw(self, flight, section, vertical, filename, init_time, time, url, layer, style, elevation, no_of_plots):
try:
self.update_path(filename)
Expand Down Expand Up @@ -421,12 +433,16 @@ def draw(self, flight, section, vertical, filename, init_time, time, url, layer,

class LinearViewPlotting(Plotting):
# ToDo Implement access of MSColab
def __init__(self, cpath):
def __init__(self, cpath, msc_url, msc_auth_password, msc_username, msc_password):
super(LinearViewPlotting, self).__init__(cpath)
Copy link
Member

@ReimarBauer ReimarBauer Oct 12, 2024

Choose a reason for hiding this comment

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

comparing with class TopViewPlotting(Plotting):

We have there super(TopViewPlotting, self).__init__(cpath, msc_url, msc_auth_password, msc_username, msc_password) too.

Same question also for super(SideViewPlotting, self).__init__(cpath)

Is that required? If not please look if it is in TopViewPlotting required too or could be changed to a similiar.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes that is required. Changes Done.

self.myfig = qt.LinearViewPlotter()
self.ax = self.myfig.ax
matplotlib.backends.backend_agg.FigureCanvasAgg(self.myfig.fig)
self.fig = self.myfig.fig
self.username = msc_username
self.password = msc_password
self.msc_auth = msc_auth_password
self.url = msc_url

def setup(self):
self.bbox = (self.num_interpolation_points,)
Expand All @@ -436,6 +452,14 @@ def setup(self):
self.myfig.set_settings(settings_dict)
self.myfig.setup_linear_view()

def update_path_ops(self, filename=None):
# plot path and label
if filename != "":
self.read_operation(filename, self.url, self.msc_auth, self.username, self.password)
self.fig.canvas.draw()
self.plotter.update_from_waypoints(self.wp_model_data)
self.plotter.redraw_path(waypoints_model_data=self.wp_model_data)

def draw(self):
for flight, section, vertical, filename, init_time, time in self.config["automated_plotting_flights"]:
for url, layer, style in self.config["automated_plotting_lsecs"]:
Expand Down
Loading