Skip to content

Commit 242f1f9

Browse files
GSOC Config editor update (#1103)
* initial implementation of profile window; extended test scope * completed profile window implementation and related tests * fixed flake8 test failure * fixed http auth bugs; extended test scope * added qt-json-view to support dir; added info in NOTICE * modified qt-json-view; mentioned modifications in readme * tested qt-json-view for proper usability * Provide same test signature * fixed failing test * handled socket conn exception; cleaned up unwanted comments * started implementation of config editor window * partially implemented merging user settings with default; fixed tests * implemented merging of default and user settings * implemented remove option handler * fixed bugs in 'remove' functionality * implemented restore defaults functionality * fixed restore default bugs and added logging statements * implemented import, export, save_restart * added comments * moved import/save/export options to toolbar Co-authored-by: May <baermay98@gmail.com>
1 parent ff38534 commit 242f1f9

22 files changed

+1665
-317
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.cache/
22
.idea/
33
.vscode/
4+
.DS_Store
45
*.pyc
56
*.swp
67
*.patch

NOTICE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,12 @@ Airports Data
117117

118118
To draw airspaces on the topview we use the services provided by openaip.net
119119
Further Information: http://www.openaip.net/
120+
121+
Qt-json-view
122+
------------
123+
124+
Author: Paul Schweizer (https://github.com/PaulSchweizer)
125+
License: https://github.com/PaulSchweizer/qt-json-view/blob/master/LICENSE (MIT License)
126+
127+
Package for working with JSON files in PyQt5.
128+
Obtained from Github (https://github.com/PaulSchweizer/qt-json-view), on 23/7/2021.

mslib/_tests/test_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ def test_get_distance(self):
193193
assert int(utils.get_distance(coord1, coord2)) == distance
194194

195195
def test_find_location(self):
196-
assert utils.find_location(50.92, 6.36) == ((50.92, 6.36), 'Juelich')
197-
assert utils.find_location(50.9200002, 6.36) == ((50.92, 6.36), 'Juelich')
196+
assert utils.find_location(50.92, 6.36) == ([50.92, 6.36], 'Juelich')
197+
assert utils.find_location(50.9200002, 6.36) == ([50.92, 6.36], 'Juelich')
198198

199199

200200
class TestProjections(object):

mslib/msui/__init__.py

Lines changed: 62 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ class MissionSupportSystemDefaultConfig(object):
5757
data_dir = "~/mssdata"
5858

5959
# layout of different views, with immutable they can't resized
60-
layout = {"topview": (963, 702),
61-
"sideview": (913, 557),
62-
"linearview": (913, 557),
63-
"tableview": (1236, 424),
60+
layout = {"topview": [963, 702],
61+
"sideview": [913, 557],
62+
"linearview": [913, 557],
63+
"tableview": [1236, 424],
6464
"immutable": False}
6565

6666
# Predefined map regions to be listed in the corresponding topview combobox
@@ -97,8 +97,9 @@ class MissionSupportSystemDefaultConfig(object):
9797
# Also set the location of the image file cache and its size.
9898

9999
# URLs of default WMS servers.
100-
default_WMS = ["http://localhost:8081/",
101-
]
100+
default_WMS = [
101+
"http://localhost:8081/"
102+
]
102103

103104
default_VSEC_WMS = [
104105
"http://localhost:8081/"
@@ -119,15 +120,15 @@ class MissionSupportSystemDefaultConfig(object):
119120
# password to sign in
120121
MSCOLAB_password = ""
121122

122-
# dictionary of MSC servers {"http://www.your-mscolab-server.de" : ("youruser", "yourpassword")]
123+
# dictionary of MSC servers {"http://www.your-mscolab-server.de" : ("youruser", "yourpassword")}
123124
MSC_login = {}
124125

125126
# timeout of Url request
126127
WMS_request_timeout = 30
127128

128129
WMS_preload = []
129130

130-
# dictionary of WMS servers {"http://www.your-wms-server.de" : ("youruser", "yourpassword")]
131+
# dictionary of WMS servers {"http://www.your-wms-server.de" : ("youruser", "yourpassword")}
131132
WMS_login = {}
132133

133134
# WMS image cache settings:
@@ -147,24 +148,24 @@ class MissionSupportSystemDefaultConfig(object):
147148
}
148149

149150
locations = {
150-
"EDMO": (48.08, 11.28),
151-
"Hannover": (52.37, 9.74),
152-
"Hamburg": (53.55, 9.99),
153-
"Juelich": (50.92, 6.36),
154-
"Leipzig": (51.34, 12.37),
155-
"Muenchen": (48.14, 11.57),
156-
"Stuttgart": (48.78, 9.18),
157-
"Wien": (48.20833, 16.373064),
158-
"Zugspitze": (47.42, 10.98),
159-
"Kiruna": (67.821, 20.336),
160-
"Ny-Alesund": (78.928, 11.986),
161-
"Zhukovsky": (55.6, 38.116),
162-
"Paphos": (34.775, 32.425),
163-
"Sharjah": (25.35, 55.65),
164-
"Brindisi": (40.658, 17.947),
165-
"Nagpur": (21.15, 79.083),
166-
"Mumbai": (19.089, 72.868),
167-
"Delhi": (28.566, 77.103),
151+
"EDMO": [48.08, 11.28],
152+
"Hannover": [52.37, 9.74],
153+
"Hamburg": [53.55, 9.99],
154+
"Juelich": [50.92, 6.36],
155+
"Leipzig": [51.34, 12.37],
156+
"Muenchen": [48.14, 11.57],
157+
"Stuttgart": [48.78, 9.18],
158+
"Wien": [48.20833, 16.373064],
159+
"Zugspitze": [47.42, 10.98],
160+
"Kiruna": [67.821, 20.336],
161+
"Ny-Alesund": [78.928, 11.986],
162+
"Zhukovsky": [55.6, 38.116],
163+
"Paphos": [34.775, 32.425],
164+
"Sharjah": [25.35, 55.65],
165+
"Brindisi": [40.658, 17.947],
166+
"Nagpur": [21.15, 79.083],
167+
"Mumbai": [19.089, 72.868],
168+
"Delhi": [28.566, 77.103],
168169
}
169170

170171
# Main application: Template for new flight tracks
@@ -206,3 +207,38 @@ class MissionSupportSystemDefaultConfig(object):
206207

207208
linearview = {"plot_title_size": 10,
208209
"axes_label_size": 10}
210+
211+
config_descriptions = {
212+
"filepicker_default": "Documentation Required",
213+
"data_dir": "Documentation Required",
214+
"predefined_map_sections": "Documentation Required",
215+
"num_interpolation_points": "Documentation Required",
216+
"num_labels": "Documentation Required",
217+
"default_WMS": "Documentation Required",
218+
"default_VSEC_WMS": "Documentation Required",
219+
"default_LSEC_WMS": "Documentation Required",
220+
"default_MSCOLAB": "Documentation Required",
221+
"MSCOLAB_mailid": "Documentation Required",
222+
"MSCOLAB_password": "Documentation Required",
223+
"MSC_login": "Documentation Required",
224+
"WMS_request_timeout": "Documentation Required",
225+
"WMS_preload": "Documentation Required",
226+
"WMS_login": "Documentation Required",
227+
"wms_cache": "Documentation Required",
228+
"wms_cache_max_size_bytes": "Documentation Required",
229+
"wms_cache_max_age_seconds": "Documentation Required",
230+
"wms_prefetch": "Documentation Required",
231+
"locations": "Documentation Required",
232+
"new_flighttrack_template": "Documentation Required",
233+
"new_flighttrack_flightlevel": "Documentation Required",
234+
"proxies": "Documentation Required",
235+
"mscolab_server_url": "Documentation Required",
236+
"mss_dir": "Documentation Required",
237+
"gravatar_ids": "Documentation Required",
238+
"export_plugins": "Documentation Required",
239+
"import_plugins": "Documentation Required",
240+
"layout": "Documentation Required",
241+
"topview": "Documentation Required",
242+
"sideview": "Documentation Required",
243+
"linearview": "Documentation Required",
244+
}

mslib/msui/_tests/test_mscolab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def __init__(self, code, text):
120120
with mock.patch("PyQt5.QtWidgets.QWidget.setStyleSheet") as mockset:
121121
with mock.patch("requests.Session.post", new=ExceptionMock(requests.exceptions.ConnectionError).raise_exc):
122122
self._login()
123-
mockset.assert_has_calls([mock.call("color: red;"), mock.call("color: white;")])
123+
mockset.assert_has_calls([mock.call("color: red;"), mock.call("")])
124124

125125
# case: when the credentials are incorrect for login
126126
self._connect_to_mscolab()

0 commit comments

Comments
 (0)