Skip to content

Commit

Permalink
Autoplot - Enable mssautoplot for side and linearviews (#2563)
Browse files Browse the repository at this point in the history
----
Co-authored-by: ReimarBauer <rb.proj@gmail.com>
  • Loading branch information
Preetam-Das26 authored Nov 5, 2024
1 parent d0b1bad commit a2e4f5e
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions mslib/utils/mssautoplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = []
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,)
Expand All @@ -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"]:
Expand Down

0 comments on commit a2e4f5e

Please sign in to comment.