Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
P
PI2 View
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PI2
PI2 View
Commits
4fd021f2
Commit
4fd021f2
authored
Feb 02, 2019
by
Martin Kröning
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework interface
Move the infoBox to the left
parent
a0e73151
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
128 deletions
+90
-128
pi2-view/data/pi2-view.glade
pi2-view/data/pi2-view.glade
+81
-119
pi2-view/src/MapApp.cpp
pi2-view/src/MapApp.cpp
+9
-9
No files found.
pi2-view/data/pi2-view.glade
View file @
4fd021f2
...
...
@@ -11,29 +11,6 @@
<object
class=
"GtkBox"
id=
"box"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<child>
<object
class=
"GtkScrolledWindow"
id=
"scrolledWindow"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"shadow_type"
>
in
</property>
<property
name=
"propagate_natural_width"
>
True
</property>
<property
name=
"propagate_natural_height"
>
True
</property>
<child>
<object
class=
"GtkViewport"
id=
"viewport"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<packing>
<property
name=
"expand"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkBox"
>
<property
name=
"visible"
>
True
</property>
...
...
@@ -47,109 +24,98 @@
<property
name=
"margin_right"
>
5
</property>
<property
name=
"margin_top"
>
5
</property>
<property
name=
"margin_bottom"
>
5
</property>
<property
name=
"row_spacing"
>
5
</property>
<property
name=
"column_spacing"
>
5
</property>
<child>
<object
class=
"GtkLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"label"
translatable=
"yes"
>
Time:
</property>
<property
name=
"halign"
>
start
</property>
<property
name=
"label"
translatable=
"yes"
>
Scale:
</property>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
1
</property>
<property
name=
"top_attach"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"Gtk
Label"
id=
"timeLabel
"
>
<object
class=
"Gtk
ComboBoxText"
id=
"zoomComboBoxText
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"label"
translatable=
"yes"
>
00:00
</property>
<attributes>
<attribute
name=
"font-desc"
value=
"Monospace 10"
/>
</attributes>
<property
name=
"has_entry"
>
True
</property>
<child
internal-child=
"entry"
>
<object
class=
"GtkEntry"
>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"width_chars"
>
5
</property>
<property
name=
"input_purpose"
>
digits
</property>
</object>
</child>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"top_attach"
>
1
</property>
<property
name=
"width"
>
2
</property>
<property
name=
"top_attach"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"label"
translatable=
"yes"
>
Remaining fuel:
</property>
<property
name=
"halign"
>
start
</property>
<property
name=
"label"
translatable=
"yes"
>
Time:
</property>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
6
</property>
<property
name=
"top_attach"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"
remainingFuel
Label"
>
<object
class=
"GtkLabel"
id=
"
time
Label"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"label"
translatable=
"yes"
>
0
.
00
</property>
<property
name=
"halign"
>
start
</property>
<property
name=
"label"
translatable=
"yes"
>
0
0:
00
</property>
<attributes>
<attribute
name=
"font-desc"
value=
"Monospace 10"
/>
</attributes>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"top_attach"
>
6
</property>
<property
name=
"top_attach"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"Gtk
Label
"
>
<object
class=
"Gtk
Separator
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
start
</property>
<property
name=
"label"
translatable=
"yes"
>
l
</property>
</object>
<packing>
<property
name=
"left_attach"
>
2
</property>
<property
name=
"top_attach"
>
6
</property>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
2
</property>
<property
name=
"width"
>
2
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"label"
translatable=
"yes"
>
Speed
:
</property>
<property
name=
"halign"
>
start
</property>
<property
name=
"label"
translatable=
"yes"
>
Drives on
:
</property>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
5
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"speedLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"label"
translatable=
"yes"
>
0.00
</property>
<attributes>
<attribute
name=
"font-desc"
value=
"Monospace 10"
/>
</attributes>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"top_attach"
>
5
</property>
<property
name=
"top_attach"
>
3
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
>
<object
class=
"GtkLabel"
id=
"laneLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
start
</property>
<property
name=
"label"
translatable=
"yes"
>
km/h
</property>
<property
name=
"label"
translatable=
"yes"
>
lane
</property>
</object>
<packing>
<property
name=
"left_attach"
>
2
</property>
<property
name=
"top_attach"
>
5
</property>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"top_attach"
>
3
</property>
</packing>
</child>
<child>
...
...
@@ -157,10 +123,10 @@
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
start
</property>
<property
name=
"label"
translatable=
"yes"
>
%
</property>
<property
name=
"label"
translatable=
"yes"
>
Position on Lane:
</property>
</object>
<packing>
<property
name=
"left_attach"
>
2
</property>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
4
</property>
</packing>
</child>
...
...
@@ -168,8 +134,8 @@
<object
class=
"GtkLabel"
id=
"lanePositionPercentageLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"label"
translatable=
"yes"
>
00
</property>
<property
name=
"halign"
>
start
</property>
<property
name=
"label"
translatable=
"yes"
>
0 %
</property>
<attributes>
<attribute
name=
"font-desc"
value=
"Monospace 10"
/>
</attributes>
...
...
@@ -183,81 +149,54 @@
<object
class=
"GtkLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"label"
translatable=
"yes"
>
Position on Lane:
</property>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
4
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"label"
translatable=
"yes"
>
Drives on:
</property>
<property
name=
"halign"
>
start
</property>
<property
name=
"label"
translatable=
"yes"
>
Speed:
</property>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
3
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"laneLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"label"
translatable=
"yes"
>
lane
</property>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"top_attach"
>
3
</property>
<property
name=
"width"
>
2
</property>
<property
name=
"top_attach"
>
5
</property>
</packing>
</child>
<child>
<object
class=
"Gtk
ComboBoxText"
id=
"zoomComboBoxText
"
>
<object
class=
"Gtk
Label"
id=
"speedLabel
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"margin_left"
>
5
</property>
<property
name=
"margin_right"
>
5
</property>
<property
name=
"margin_top"
>
5
</property>
<property
name=
"margin_bottom"
>
5
</property>
<property
name=
"has_entry"
>
True
</property>
<child
internal-child=
"entry"
>
<object
class=
"GtkEntry"
>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"width_chars"
>
5
</property>
</object>
</child>
<property
name=
"halign"
>
start
</property>
<property
name=
"label"
translatable=
"yes"
>
0.00 km/h
</property>
<attributes>
<attribute
name=
"font-desc"
value=
"Monospace 10"
/>
</attributes>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"top_attach"
>
0
</property>
<property
name=
"width"
>
2
</property>
<property
name=
"top_attach"
>
5
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"label"
translatable=
"yes"
>
Scale:
</property>
<property
name=
"halign"
>
start
</property>
<property
name=
"label"
translatable=
"yes"
>
Remaining fuel:
</property>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
0
</property>
<property
name=
"top_attach"
>
6
</property>
</packing>
</child>
<child>
<object
class=
"Gtk
Separator
"
>
<object
class=
"Gtk
Label"
id=
"remainingFuelLabel
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
start
</property>
<property
name=
"label"
translatable=
"yes"
>
0.00 l
</property>
<attributes>
<attribute
name=
"font-desc"
value=
"Monospace 10"
/>
</attributes>
</object>
<packing>
<property
name=
"left_attach"
>
0
</property>
<property
name=
"top_attach"
>
2
</property>
<property
name=
"width"
>
3
</property>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"top_attach"
>
6
</property>
</packing>
</child>
</object>
...
...
@@ -282,6 +221,29 @@
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkScrolledWindow"
id=
"scrolledWindow"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"shadow_type"
>
in
</property>
<property
name=
"propagate_natural_width"
>
True
</property>
<property
name=
"propagate_natural_height"
>
True
</property>
<child>
<object
class=
"GtkViewport"
id=
"viewport"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<packing>
<property
name=
"expand"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
...
...
pi2-view/src/MapApp.cpp
View file @
4fd021f2
...
...
@@ -131,26 +131,26 @@ void MapApp::refreshVehicleLabels(const DrawableVehicle &vehicle) {
laneLabel
->
set_text
(
vehicle
.
getLaneName
());
std
::
ostringstream
lanePisitionPercentageBuffer
;
lanePisitionPercentageBuffer
<<
std
::
setfill
(
'0'
)
<<
std
::
setw
(
2
)
<<
std
::
round
(
vehicle
.
getPositionOnLane
()
*
100
)
;
lanePisitionPercentageBuffer
<<
std
::
setw
(
3
)
<<
std
::
round
(
vehicle
.
getPositionOnLane
()
*
100
)
<<
" %"
;
lanePositionPercentageLabel
->
set_text
(
lanePisitionPercentageBuffer
.
str
());
std
::
ostringstream
speedBuffer
;
speedBuffer
<<
std
::
setprecision
(
3
)
<<
vehicle
.
getSpeed
();
speedBuffer
<<
std
::
fixed
<<
std
::
setprecision
(
1
)
<<
vehicle
.
getSpeed
()
<<
" km/h"
;
speedLabel
->
set_text
(
speedBuffer
.
str
());
std
::
ostringstream
remainingFuelBuffer
;
remainingFuelBuffer
<<
std
::
showpoint
<<
std
::
setprecision
(
3
)
<<
vehicle
.
getRemainingFuel
();
remainingFuelBuffer
<<
std
::
fixed
<<
std
::
setprecision
(
1
)
<<
vehicle
.
getRemainingFuel
()
<<
" l"
;
remainingFuelLabel
->
set_text
(
remainingFuelBuffer
.
str
());
}
void
MapApp
::
setTimeLabel
(
const
std
::
chrono
::
minutes
minutes
)
{
std
::
ostringstream
timeBuffer
;
timeBuffer
<<
std
::
setfill
(
'0'
)
<<
std
::
setw
(
2
)
<<
std
::
chrono
::
duration_cast
<
std
::
chrono
::
hours
>
(
minutes
).
count
()
<<
':'
<<
std
::
setw
(
2
)
<<
minutes
.
count
()
%
60
;
timeBuffer
<<
std
::
setfill
(
'0'
)
<<
std
::
setw
(
2
)
<<
std
::
chrono
::
duration_cast
<
std
::
chrono
::
hours
>
(
minutes
).
count
()
<<
':'
<<
std
::
setw
(
2
)
<<
minutes
.
count
()
%
60
;
Glib
::
signal_idle
().
connect_once
(
[
this
,
timeString
=
timeBuffer
.
str
()]()
mutable
{
timeLabel
->
set_text
(
std
::
move
(
timeString
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment