Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Module 4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Service
Module 4
Commits
e701acd2
Commit
e701acd2
authored
10 months ago
by
DMIbragimov
Browse files
Options
Downloads
Patches
Plain Diff
Update app.py
parent
168946b5
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Add new directory
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kontur/web/app.py
+21
-5
21 additions, 5 deletions
kontur/web/app.py
with
21 additions
and
5 deletions
kontur/web/app.py
+
21
−
5
View file @
e701acd2
...
...
@@ -58,16 +58,27 @@ class MainWindow(QWidget):
layout
.
addLayout
(
input_layout
)
# Video and Map layout
video_map_layout
=
QHBoxLayout
()
video_map_layout
=
QVBoxLayout
()
video_layout
=
QHBoxLayout
()
# Video display
self
.
video_label
=
QLabel
()
self
.
video_label
.
setAlignment
(
Qt
.
AlignCenter
)
video_
map_
layout
.
addWidget
(
self
.
video_label
)
video_layout
.
addWidget
(
self
.
video_label
)
# Map display
self
.
map_view
=
QWebEngineView
()
video_map_layout
.
addWidget
(
self
.
map_view
)
video_layout
.
addWidget
(
self
.
map_view
)
video_map_layout
.
addLayout
(
video_layout
)
# Telemetry data display
self
.
telemetry_label
=
QLabel
()
self
.
telemetry_label
.
setAlignment
(
Qt
.
AlignTop
)
self
.
telemetry_label
.
setStyleSheet
(
"
background-color: #3c3c3c; padding: 10px; border: 1px solid #555555;
"
)
video_map_layout
.
addWidget
(
self
.
telemetry_label
)
layout
.
addLayout
(
video_map_layout
)
self
.
showMaximized
()
...
...
@@ -129,8 +140,11 @@ class MainWindow(QWidget):
if
msg
.
type
==
aiohttp
.
WSMsgType
.
TEXT
:
data
=
json
.
loads
(
msg
.
data
)
coords
=
data
.
get
(
'
coordinates
'
,
[])
telemetry_info
=
data
.
get
(
'
telemetry
'
,
''
)
logger
.
debug
(
f
"
Received coordinates:
{
coords
}
"
)
logger
.
debug
(
f
"
Received telemetry:
{
telemetry_info
}
"
)
self
.
update_map
(
coords
)
self
.
update_telemetry
(
telemetry_info
)
def
load_osm_map
(
self
,
osm_file
):
# Load OSM data from file
...
...
@@ -158,6 +172,10 @@ class MainWindow(QWidget):
self
.
map_view
.
setHtml
(
map_data
)
logger
.
debug
(
"
Map updated with new markers
"
)
def
update_telemetry
(
self
,
telemetry_info
):
self
.
telemetry_label
.
setText
(
f
"
Telemetry Data:
{
telemetry_info
}
"
)
logger
.
debug
(
"
Telemetry data updated
"
)
def
dark_theme_stylesheet
(
self
):
return
"""
QWidget {
...
...
@@ -188,8 +206,6 @@ class MainWindow(QWidget):
}
QWebEngineView {
border: 1px solid #555555;
background-color: #2b2b2b;
color: #ffffff;
}
"""
...
...
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