Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SOHViewer
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Public
PASSOFT
SOHViewer
Commits
6e7a64d8
Commit
6e7a64d8
authored
2 years ago
by
Kien Le
Browse files
Options
Downloads
Patches
Plain Diff
Implement exporting GPS data to file
parent
0824792e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sohstationviewer/view/plotting/gps_dialog.py
+30
-5
30 additions, 5 deletions
sohstationviewer/view/plotting/gps_dialog.py
with
30 additions
and
5 deletions
sohstationviewer/view/plotting/gps_dialog.py
+
30
−
5
View file @
6e7a64d8
import
sys
from
pathlib
import
Path
from
typing
import
List
from
model.gps_point
import
GPSPoint
from
model.mseed.mseed
import
MSeed
from
view.plotting.plotting_widget.plotting_widget
import
PlottingWidget
from
PySide2
import
QtWidgets
,
QtCore
...
...
@@ -15,10 +19,11 @@ class GPSWidget(PlottingWidget):
class
GPSDialog
(
QtWidgets
.
QWidget
):
def
__init__
(
self
,
parent
,
gps_points
):
def
__init__
(
self
,
parent
,
gps_points
:
List
[
GPSPoint
]
):
super
().
__init__
()
self
.
parent
=
parent
self
.
gps_points
=
gps_points
self
.
data_path
=
None
self
.
info_text_browser
=
QtWidgets
.
QTextBrowser
(
self
)
self
.
setGeometry
(
300
,
300
,
400
,
500
)
...
...
@@ -62,11 +67,31 @@ class GPSDialog(QtWidgets.QWidget):
main_layout
.
addLayout
(
bottom_layout
)
def
export_gps_points
(
self
):
pass
folder_name
=
self
.
data_path
.
name
outside_folder
=
self
.
data_path
.
parent
with
open
(
outside_folder
/
f
'
{
folder_name
}
.gps.dat
'
,
'
w+
'
)
as
outfile
:
outfile
.
write
(
f
'
# GPS data points for
{
folder_name
}
\n
'
)
for
point
in
self
.
gps_points
:
is_bad_point
=
(
point
.
height
==
0
and
point
.
longitude
==
0
and
point
.
longitude
==
0
and
point
.
num_satellite_used
==
0
)
if
is_bad_point
:
continue
line
=
(
f
'
{
point
.
last_timemark
}
\t
{
point
.
fix_type
}
\t
'
f
'
{
point
.
num_satellite_used
}
\t
{
point
.
latitude
:
+
.
6
f
}
\t
'
f
'
{
point
.
longitude
:
+
.
6
f
}
\t
{
point
.
height
:
.
6
f
}
\n
'
)
outfile
.
write
(
line
)
if
__name__
==
'
__main__
'
:
import
os
os
.
chdir
(
'
/Users/kle/PycharmProjects/sohstationviewer
'
)
app
=
QtWidgets
.
QApplication
(
sys
.
argv
)
wnd
=
GPSDialog
(
None
,
[])
wnd
.
show
()
sys
.
exit
(
app
.
exec_
())
data
=
MSeed
(
QtWidgets
.
QTextBrowser
(),
'
/Users/kle/Documents/SOHView data/Q330/Q330_5281.sdr
'
)
wnd
=
GPSDialog
(
None
,
data
.
gps_points
)
wnd
.
data_path
=
Path
(
'
/Users/kle/Documents/SOHView data/Q330/Q330_5281.sdr
'
)
wnd
.
export_button
.
click
()
# wnd.show()
# sys.exit(app.exec_())
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment