From a2e4f5e9f12010b9a86e48615e1a95bfe8bcb40c Mon Sep 17 00:00:00 2001 From: "Jets@ps2004" <120110796+Preetam-Das26@users.noreply.github.com> Date: Tue, 5 Nov 2024 20:16:18 +0530 Subject: [PATCH] Autoplot - Enable mssautoplot for side and linearviews (#2563) ---- Co-authored-by: ReimarBauer --- mslib/utils/mssautoplot.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/mslib/utils/mssautoplot.py b/mslib/utils/mssautoplot.py index 2e60e2ad4..3ac186411 100644 --- a/mslib/utils/mssautoplot.py +++ b/mslib/utils/mssautoplot.py @@ -347,7 +347,7 @@ def draw(self, flight, section, vertical, filename, init_time, time, url, layer, class SideViewPlotting(Plotting): def __init__(self, cpath, msc_url, msc_auth_password, msc_username, msc_password, pdlg): # ToDo Implement access to MSColab - super(SideViewPlotting, self).__init__(cpath, pdlg) + super(SideViewPlotting, self).__init__(cpath, msc_url, msc_auth_password, msc_username, msc_password) self.pdlg = pdlg self.myfig = qt.SideViewPlotter() self.ax = self.myfig.ax @@ -356,6 +356,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 = [] @@ -383,6 +387,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) @@ -425,12 +437,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): - super(LinearViewPlotting, self).__init__(cpath) + def __init__(self, cpath, msc_url, msc_auth_password, msc_username, msc_password): + super(LinearViewPlotting, self).__init__(cpath, msc_url, msc_auth_password, msc_username, msc_password) 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,) @@ -440,6 +456,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"]: