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

Revert "Merge stable to develop" #2490

Merged
merged 1 commit into from
Aug 29, 2024
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
4 changes: 3 additions & 1 deletion .github/workflows/testing-all-oses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ jobs:
# I have no idea yet on why this happens and how to fix it.
# Even a module level skip is not enough, they need to be completely ignored.
# TODO: fix those tests and drop the ignores
run: micromamba run -n ci env QT_QPA_PLATFORM=offscreen pytest -v -n logical --durations=20 --cov=mslib tests
run: micromamba run -n ci env QT_QPA_PLATFORM=offscreen pytest -v -n logical --durations=20 --cov=mslib
--ignore=tests/_test_msui/test_sideview.py --ignore=tests/_test_msui/test_topview.py --ignore=tests/_test_msui/test_wms_control.py
tests
10 changes: 0 additions & 10 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
Changelog
=========

Version 9.2.0
~~~~~~~~~~~~~

Bug fix release and minor enhancements:
We added a verification for xml data and changed the startup of the SocketsManager.

All changes:
https://github.com/Open-MSS/MSS/milestone/106?closed=1


Version 9.1.0
~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def get_tutorial_images():
html_style = 'css/mss.css'
else:
htmls_static_path = ['_static']
html_css_files = ['css/mss.css']
html_css_files = ['mss.css']
html_context = {
'display_github': False, # Add 'Edit on Bitbucket' link instead of 'View page source'
'last_updated': True,
Expand Down
2 changes: 1 addition & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
- xstatic
- defusedxml
- sphinx_rtd_theme
- sphinxcontrib-video>=0.2.1
- sphinxcontrib-video
- sphinx
- fs
- netCDF4
Expand Down
4 changes: 0 additions & 4 deletions docs/mss_theme/css/mss.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,3 @@
margin-bottom: auto;
margin-left: auto;
}

video {
max-width: 100%;
}
3 changes: 1 addition & 2 deletions docs/samples/automation/retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import io
import os
import xml
import defusedxml.minidom
import requests
from fs import open_fs
import PIL.Image
Expand Down Expand Up @@ -59,7 +58,7 @@ def load_from_ftml(filename):
_fs = open_fs(_dirname)
datasource = _fs.open(_name)
try:
doc = defusedxml.minidom.parse(datasource)
doc = xml.dom.minidom.parse(datasource)
except xml.parsers.expat.ExpatError as ex:
raise SyntaxError(str(ex))

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ a `public share <https://fz-juelich.sciebo.de/s/IzNGi24Ki68iV7t#pdfviewer>`_
Get familiar by some videos about the Mission Support System (MSS).


.. video:: videos/mp4/tutorial_waypoints.mp4
.. video:: _static/mp4/tutorial_waypoints.mp4
:autoplay:
:loop:
:alt: This is the waypoints tutorial,i.e., whenever we are going to plan
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial_hexagoncontrol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Table View and Hexagon Flight Patterns

For tomographic imaging, a hexagonal flight pattern can be integrated by a docking widget of Table View

.. video:: ../videos/mp4/tutorial_hexagoncontrol.mp4
.. video:: ../_static/mp4/tutorial_hexagoncontrol.mp4
:alt: Top View windows is opened (CTRL+H).
We select the "global (cyl)" for the world map.
Zooming in for the required region.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial_introduction_topview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Top View and Selecting of Layers

Selection and display of different data in the Top View with the help of the layer chooser.

.. video:: ../videos/mp4/tutorial_wms.mp4
.. video:: ../_static/mp4/tutorial_wms.mp4
:alt: When we open the Top View (CTRL+H) of the map, the Web Map Service is already opened by default.
It collects its data from the server: "open-mss dot org" that provides demodata for the meteorological or
atmospheric information as layer lists.
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/tutorial_kml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Top View and KML Data

es can be displayed in the Top View. Color and line width can be adjusted.

.. video:: ../videos/mp4/tutorial_kml.mp4
.. video:: ../_static/mp4/tutorial_kml.mp4
:alt: Open the TopView (CTRL+H)
After clicking on "(select to open control)", click on KML OVERLAY. The UI will look as shown.
KML files can be used to show the geographical boundary which helps in planning the WAY POINTS.
Expand All @@ -23,4 +23,4 @@ es can be displayed in the Top View. Color and line width can be adjusted.
Changing it for some time...
Now, we change line width by changing its numerical value whose range is 0 to 10.
We change it to different values to obtain different linewidths.
The top view is closed and the tutorial ends.
The top view is closed and the tutorial ends.
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial_mscolab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Using the different views of the MSUI with a fictitious flight path and demo dat
In comparison to the standalone mode of the MSUI an example setup of users is
shown on a MSColab server and the possibilities of interactions.

.. video:: ../videos/mp4/tutorial_mscolab.mp4
.. video:: ../_static/mp4/tutorial_mscolab.mp4
:alt: MSColab stores data in an online server, and can be used to access the data remotely as also working in a
team where everyone contributes his part. It is used for collaborating with the users as a team together
and working on a shared MSColab operation.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial_msui_views.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Introduction to MSUI
Using the different views of the MSUI with a fictitious flight path and demo data.


.. video:: ../videos/mp4/tutorial_views.mp4
.. video:: ../_static/mp4//tutorial_views.mp4
:alt: Lets look at the tutorial of the various views required for flight planning:
Top View (CTRL+H), Side View (CTRL+V), Linear View (CTRL+L) and Table View (CTRL+T).
At first, lets open Top View and Side View.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial_performance_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Table View and Aircraft Performance Data

The range-specific data of an aircraft can be taken into account in Tableview for flight planning.

.. video:: ../videos/mp4/tutorial_performancesettings.mp4
.. video:: ../_static/mp4/tutorial_performancesettings.mp4
:alt: This is the Performance Settings dockwidget opened in the Table View (CTRL+T) of the MSS software
where by putting and changing some parameters, we can evaluate the performance of the aircraft.
Parameters like Flight Altitude, Aviation fuel, Aircraft weight, Maximum take off weight
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial_remotesensing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Top View and Remotesensing Tools
In order to be able to take into account the viewing angle and solar level for measuring instruments, the remotesensing tools are used


.. video:: ../videos/mp4/tutorial_remotesensing.mp4
.. video:: ../_static/mp4/tutorial_remotesensing.mp4
:alt: This is the Remote Sensing Section of the Top View.
It shows the position and angle of the flight from any particular object in the sky.
Azimuth is the forward direction line of the flight. If we go above tHE AZIMUTH, angle is in positive,
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial_satellitetrack.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Top View and Satellite Overflight
To combine a flight path with a satellite overflight, the remotesensing widget is used.


.. video:: ../videos/mp4/tutorial_satellitetrack.mp4
.. video:: ../_static/mp4/tutorial_satellitetrack.mp4
:alt: This is Satellite Tracking Prediction System that can be used to check the accuracy of the path
travelled by a Satellite by the help of data collected from different space agencies and planning
a flight accordingly.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial_waypoints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Top View Drawing Waypoints

Waypoints for a flight path are defined, shifted and deleted.

.. video:: ../videos/mp4/tutorial_waypoints.mp4
.. video:: ../_static/mp4/tutorial_waypoints.mp4
:alt: This is the waypoints tutorial,i.e., whenever we are going to plan
a flight track, we have to place the waypoints in some places and,
form a flight path.
Expand Down
2 changes: 1 addition & 1 deletion localbuild/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ requirements:
- metpy
- pycountry
- websocket-client
- libtiff
- libtiff <4.5.0
- flask-wtf
- email_validator
- keyring
Expand Down
8 changes: 4 additions & 4 deletions mslib/mscolab/chat_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ class ChatManager:
def __init__(self):
pass

def add_message(self, user, text, op_id, message_type=MessageType.TEXT, reply_id=None):
def add_message(self, user, text, operation_name, message_type=MessageType.TEXT, reply_id=None):
"""
user: User object, one which emits the message
text: message to be emitted to operation and saved to db
op_id: operation id to which message is emitted,
operation_name: operation-name(op_id) to which message is emitted,
user: User object, one which emits the message
message_type: Enum of type MessageType. values: TEXT, SYSTEM_MESSAGE, IMAGE, DOCUMENT
"""
if reply_id == -1:
reply_id = None
message = Message(op_id, user.id, text, message_type, reply_id)
message = Message(operation_name, user.id, text, message_type, reply_id)
db.session.add(message)
db.session.commit()
return message
Expand Down
33 changes: 10 additions & 23 deletions mslib/mscolab/file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import mimetypes
from werkzeug.utils import secure_filename
from sqlalchemy.exc import IntegrityError
from mslib.utils.verify_waypoint_data import verify_waypoint_data
from mslib.mscolab.models import db, Operation, Permission, User, Change, Message
from mslib.mscolab.conf import mscolab_settings

Expand All @@ -59,19 +58,9 @@ def _get_operation_lock(self, op_id):

def create_operation(self, path, description, user, last_used=None, content=None, category="default", active=True):
"""
Creates a new operation in the mscolab system.

:param path: The path of the operation.
:param description: The description of the operation.
:param user: The user object creating the operation.
:param last_used: The last used datetime of the operation. Default is None.
:param content: The content of the operation. Default is None.
:param category: The category of the operation. Default is 'default'.
:param active: The activity status of the operation. Default is True.
:return: True if the operation is created successfully, False otherwise.
path: path to the operation
description: description of the operation
"""
if content is not None and not verify_waypoint_data(content):
return False
# set codes on these later
if path.find("/") != -1 or path.find("\\") != -1 or (" " in path):
logging.debug("malicious request: %s", user)
Expand Down Expand Up @@ -350,14 +339,14 @@ def update_operation(self, op_id, attribute, value, user):
if value.find("/") != -1 or value.find("\\") != -1 or (" " in value):
logging.debug("malicious request: %s", user)
return False
with fs.open_fs(self.data_dir) as data:
if data.exists(value):
return False
# will be move when operations are introduced
# make a directory, else movedir
data.makedir(value)
data.movedir(operation.path, value)
# when renamed to a Group operation
data = fs.open_fs(self.data_dir)
if data.exists(value):
return False
# will be move when operations are introduced
# make a directory, else movedir
data.makedir(value)
data.movedir(operation.path, value)
# when renamed to a Group operation
if value.endswith(mscolab_settings.GROUP_POSTFIX):
# getting the category
category = value.split(mscolab_settings.GROUP_POSTFIX)[0]
Expand Down Expand Up @@ -405,8 +394,6 @@ def save_file(self, op_id, content, user, comment=""):
content: content of the file to be saved
# ToDo save change in schema
"""
if not verify_waypoint_data(content):
return False
# ToDo use comment
operation = Operation.query.filter_by(id=op_id).first()
if not operation:
Expand Down
38 changes: 19 additions & 19 deletions mslib/mscolab/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ class User(db.Model):

def __init__(self, emailid, username, password, profile_image_path=None, confirmed=False,
confirmed_on=None, authentication_backend='local'):
self.username = str(username)
self.emailid = str(emailid)
self.username = username
self.emailid = emailid
self.hash_password(password)
self.profile_image_path = profile_image_path
self.registered_on = datetime.datetime.now(tz=datetime.timezone.utc)
self.confirmed = bool(confirmed)
self.confirmed = confirmed
self.confirmed_on = confirmed_on
self.authentication_backend = str(authentication_backend)
self.authentication_backend = authentication_backend

def __repr__(self):
return f'<User {self.username}>'
Expand Down Expand Up @@ -137,9 +137,9 @@ def __init__(self, u_id, op_id, access_level):
op_id: process-id
access_level: the type of authorization to the operation
"""
self.u_id = int(u_id)
self.op_id = int(op_id)
self.access_level = str(access_level)
self.u_id = u_id
self.op_id = op_id
self.access_level = access_level

def __repr__(self):
return f'<Permission u_id: {self.u_id}, op_id:{self.op_id}, access_level: {str(self.access_level)}>'
Expand All @@ -161,10 +161,10 @@ def __init__(self, path, description, last_used=None, category="default", active
description: small description of operation
category: name of category
"""
self.path = str(path)
self.description = str(description)
self.category = str(category)
self.active = bool(active)
self.path = path
self.description = description
self.category = category
self.active = active
if self.last_used is None:
self.last_used = datetime.datetime.now(tz=datetime.timezone.utc)
else:
Expand All @@ -190,9 +190,9 @@ class Message(db.Model):
replies = db.relationship('Message', cascade='all,delete,delete-orphan', single_parent=True)

def __init__(self, op_id, u_id, text, message_type=MessageType.TEXT, reply_id=None):
self.op_id = int(op_id)
self.u_id = int(u_id)
self.text = str(text)
self.op_id = op_id
self.u_id = u_id
self.text = text
self.message_type = message_type
self.reply_id = reply_id

Expand All @@ -213,8 +213,8 @@ class Change(db.Model):
user = db.relationship('User')

def __init__(self, op_id, u_id, commit_hash, version_name=None, comment=None):
self.op_id = int(op_id)
self.u_id = int(u_id)
self.commit_hash = str(commit_hash)
self.version_name = str(version_name)
self.comment = str(comment)
self.op_id = op_id
self.u_id = u_id
self.commit_hash = commit_hash
self.version_name = version_name
self.comment = comment
8 changes: 2 additions & 6 deletions mslib/msui/flighttrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
from mslib.utils.units import units
from mslib.utils.coordinate import find_location, path_points, get_distance
from mslib.utils import thermolib
from mslib.utils.verify_waypoint_data import verify_waypoint_data
from mslib.utils.config import config_loader, save_settings_qsettings, load_settings_qsettings
from mslib.utils.config import MSUIDefaultConfig as mss_default
from mslib.utils.qt import variant_to_string, variant_to_float
Expand Down Expand Up @@ -650,11 +649,8 @@ def load_from_ftml(self, filename):

def load_from_xml_data(self, xml_content, name="Flight track"):
self.name = name
if verify_waypoint_data(xml_content):
_waypoints_list = load_from_xml_data(xml_content, name)
self.replace_waypoints(_waypoints_list)
else:
raise SyntaxError(f"Invalid flight track filename: {name}")
_waypoints_list = load_from_xml_data(xml_content, name)
self.replace_waypoints(_waypoints_list)

def get_filename(self):
return self.filename
Expand Down
8 changes: 1 addition & 7 deletions mslib/msui/mscolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@

from mslib.utils.auth import get_password_from_keyring, save_password_to_keyring
from mslib.utils.verify_user_token import verify_user_token
from mslib.utils.verify_waypoint_data import verify_waypoint_data
from mslib.utils.qt import get_open_filename, get_save_filename, dropEvent, dragEnterEvent, show_popup
from mslib.msui.qt5 import ui_mscolab_help_dialog as msc_help_dialog
from mslib.msui.qt5 import ui_add_operation_dialog as add_operation_ui
Expand Down Expand Up @@ -2048,12 +2047,10 @@ def handle_import_msc(self, file_path, extension, function, pickertype):
return
dir_path, file_name = fs.path.split(file_path)
file_name = fs.path.basename(file_path)
name, file_ext = fs.path.splitext(file_name)
if function is None:
with open_fs(dir_path) as file_dir:
xml_content = file_dir.readtext(file_name)
if not verify_waypoint_data(xml_content):
show_popup(self.ui, "Import Failed", f"The file - {file_name}, does not contain valid XML")
return
try:
model = ft.WaypointsTableModel(xml_content=xml_content)
except SyntaxError:
Expand All @@ -2065,9 +2062,6 @@ def handle_import_msc(self, file_path, extension, function, pickertype):
model = ft.WaypointsTableModel(waypoints=new_waypoints)
xml_doc = self.waypoints_model.get_xml_doc()
xml_content = xml_doc.toprettyxml(indent=" ", newl="\n")
if not verify_waypoint_data(xml_content):
show_popup(self.ui, "Import Failed", f"The file - {file_name}, was not imported!", 0)
return
self.waypoints_model.dataChanged.disconnect(self.handle_waypoints_changed)
self.waypoints_model = model
self.handle_waypoints_changed()
Expand Down
2 changes: 1 addition & 1 deletion mslib/static/docs/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ software that simplifies the process for planning a scientific flight.
# Drawing waypoints in the MSUI Topview
The example shows defining of waypoints for a flight path, moved and deleted.

![Waypoint Tutorial](https://mss.readthedocs.io/en/stable/_images/tutorial_waypoints.mp4)
![Waypoint Tutorial](https://mss.readthedocs.io/en/stable/_static/mp4/tutorial_waypoints.mp4)


Further tutorials about the Mission Support System Software on:
Expand Down
Loading