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

use category for selection #1988

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion mslib/msui/multiple_flightpath_dockwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class MultipleFlightpathControlWidget(QtWidgets.QWidget, ui.Ui_MultipleViewWidge
signal_parent_closes = QtCore.pyqtSignal()

def __init__(self, parent=None, view=None, listFlightTracks=None,
listOperationsMSC=None, activeFlightTrack=None, mscolab_server_url=None, token=None):
listOperationsMSC=None, category=None, activeFlightTrack=None, mscolab_server_url=None, token=None):
super().__init__(parent)
# ToDO: Remove all patches, on closing dockwidget.
self.ui = parent
Expand All @@ -122,6 +122,7 @@ def __init__(self, parent=None, view=None, listFlightTracks=None,
self.flight_path = None # flightpath object
self.dict_flighttrack = {} # Dictionary of flighttrack data: patch,color,wp_model
self.active_flight_track = activeFlightTrack
self.msc_category = category # object of active category
self.listOperationsMSC = listOperationsMSC
self.listFlightTracks = listFlightTracks
self.mscolab_server_url = mscolab_server_url
Expand Down Expand Up @@ -555,6 +556,9 @@ def get_wps_from_server(self):
if r.text != "False":
_json = json.loads(r.text)
operations = _json["operations"]
selected_category = self.parent.msc_category.currentText()
if selected_category != "*ANY*":
operations = [op for op in operations if op['category'] == selected_category]
return operations

def request_wps_from_server(self, op_id):
Expand Down
1 change: 1 addition & 0 deletions mslib/msui/topview.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ def openTool(self, index):
widget = mf.MultipleFlightpathControlWidget(parent=self, view=self.mpl.canvas,
listFlightTracks=self.ui.listFlightTracks,
listOperationsMSC=self.ui.listOperationsMSC,
category=self.ui.filterCategoryCb,
activeFlightTrack=self.active_flighttrack,
mscolab_server_url=self.mscolab_server_url,
token=self.token)
Expand Down