Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MobileEventLog
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
Data-Logistics-Support
MobileEventLog
Commits
c91da2a7
Commit
c91da2a7
authored
3 years ago
by
Maximilian Betz
Browse files
Options
Downloads
Patches
Plain Diff
added lat long columns in viewevents
parent
8765d4c9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/addevent.dart
+12
-7
12 additions, 7 deletions
lib/addevent.dart
lib/viewevents.dart
+53
-13
53 additions, 13 deletions
lib/viewevents.dart
with
65 additions
and
20 deletions
lib/addevent.dart
+
12
−
7
View file @
c91da2a7
...
...
@@ -12,7 +12,7 @@ class AddEvent extends StatefulWidget {
}
class
_AddEventPageState
extends
State
<
AddEvent
>
{
bool
disableGNSSEditing
=
true
;
bool
syncGNSSData
=
true
;
final
List
<
bool
>
_isGNSSSelected
=
[
true
];
late
LocationPermission
permission
;
late
Position
position
;
...
...
@@ -39,7 +39,7 @@ class _AddEventPageState extends State<AddEvent> {
accuracy
=
position
.
accuracy
;
if
(
disableGNSSEditing
==
true
)
{
if
(
syncGNSSData
==
true
)
{
if
(
mounted
){
setState
(()
{
//refresh UI on update
...
...
@@ -96,6 +96,7 @@ class _AddEventPageState extends State<AddEvent> {
void
_storeCurrentEvent
()
{
final
EventStoreInstance
storedEvents
=
EventStoreInstance
();
final
EventCurrentInstance
currentEvent
=
EventCurrentInstance
();
currentEvent
.
store
.
status
=
"PENDING"
;
storedEvents
.
store
.
add
(
Event
(
currentEvent
.
store
.
id
,
...
...
@@ -104,6 +105,9 @@ class _AddEventPageState extends State<AddEvent> {
currentEvent
.
store
.
type
,
currentEvent
.
store
.
description
,
currentEvent
.
store
.
status
,
currentEvent
.
store
.
latitude
,
currentEvent
.
store
.
longitude
,
currentEvent
.
store
.
elevation
));
}
...
...
@@ -118,7 +122,7 @@ class _AddEventPageState extends State<AddEvent> {
final
EventCurrentInstance
currentEvent
=
EventCurrentInstance
();
String
gnssStatusText
=
""
;
if
(
true
==
disableGNSSEditing
){
if
(
true
==
syncGNSSData
){
// Update current event coordinates from GNSS stream
currentEvent
.
store
.
latitude
=
lat
;
currentEvent
.
store
.
longitude
=
long
;
...
...
@@ -194,7 +198,7 @@ class _AddEventPageState extends State<AddEvent> {
),
TextField
(
readOnly:
false
,
enabled:
!
disableGNSSEditing
,
enabled:
!
syncGNSSData
,
//controller: _controllerLat,
controller:
TextEditingController
(
text:
currentEvent
.
store
.
latitude
.
toString
()),
decoration:
const
InputDecoration
(
...
...
@@ -204,7 +208,7 @@ class _AddEventPageState extends State<AddEvent> {
),
TextField
(
readOnly:
false
,
enabled:
!
disableGNSSEditing
,
enabled:
!
syncGNSSData
,
controller:
TextEditingController
(
text:
currentEvent
.
store
.
longitude
.
toString
()),
decoration:
const
InputDecoration
(
labelText:
'Longitude'
,
...
...
@@ -213,7 +217,7 @@ class _AddEventPageState extends State<AddEvent> {
),
TextField
(
readOnly:
false
,
enabled:
!
disableGNSSEditing
,
enabled:
!
syncGNSSData
,
controller:
TextEditingController
(
text:
currentEvent
.
store
.
elevation
.
toString
()),
decoration:
const
InputDecoration
(
labelText:
'Elevation'
,
...
...
@@ -234,7 +238,8 @@ class _AddEventPageState extends State<AddEvent> {
onPressed:
(
int
index
)
{
setState
(()
{
_isGNSSSelected
[
index
]
=
!
_isGNSSSelected
[
index
];
disableGNSSEditing
=
_isGNSSSelected
[
index
];
syncGNSSData
=
_isGNSSSelected
[
index
];
//TODO: cancel position stream if GNSS sync disabled here!
});
},
),
...
...
This diff is collapsed.
Click to expand it.
lib/viewevents.dart
+
53
−
13
View file @
c91da2a7
...
...
@@ -47,6 +47,24 @@ class ViewEvents extends StatelessWidget {
style:
TextStyle
(
fontStyle:
FontStyle
.
italic
),
),
),
DataColumn
(
label:
Text
(
'Latitude'
,
style:
TextStyle
(
fontStyle:
FontStyle
.
italic
),
),
),
DataColumn
(
label:
Text
(
'Longitude'
,
style:
TextStyle
(
fontStyle:
FontStyle
.
italic
),
),
),
DataColumn
(
label:
Text
(
'Elevation'
,
style:
TextStyle
(
fontStyle:
FontStyle
.
italic
),
),
),
DataColumn
(
label:
Text
(
'Status'
,
...
...
@@ -62,6 +80,7 @@ class ViewEvents extends StatelessWidget {
DataCell
(
Text
(
event
.
urn
)),
DataCell
(
TextFormField
(
readOnly:
true
,
initialValue:
event
.
label
,
onFieldSubmitted:
(
val
)
{
event
.
label
=
val
;
//Update Database
...
...
@@ -71,6 +90,7 @@ class ViewEvents extends StatelessWidget {
DataCell
(
Text
(
event
.
type
)),
DataCell
(
TextFormField
(
readOnly:
true
,
initialValue:
event
.
description
,
onFieldSubmitted:
(
val
)
{
event
.
description
=
val
;
//Update Database
...
...
@@ -78,19 +98,39 @@ class ViewEvents extends StatelessWidget {
),
),
DataCell
(
DropdownButtonFormField
(
//value: Text('abe'),
items:
<
DropdownMenuItem
>[
DropdownMenuItem
(
child:
Text
(
'abs'
),
value:
Text
(
'1'
),
),
DropdownMenuItem
(
child:
Text
(
'abc'
),
value:
Text
(
'1'
),
),
],
onChanged:
null
,
TextFormField
(
readOnly:
true
,
initialValue:
event
.
latitude
,
onFieldSubmitted:
(
val
)
{
event
.
latitude
=
val
;
//Update Database
},
),
),
DataCell
(
TextFormField
(
readOnly:
true
,
initialValue:
event
.
longitude
,
onFieldSubmitted:
(
val
)
{
event
.
longitude
=
val
;
//Update Database
},
),
),
DataCell
(
TextFormField
(
readOnly:
true
,
initialValue:
event
.
elevation
,
onFieldSubmitted:
(
val
)
{
event
.
elevation
=
val
;
//Update Database
},
),
),
DataCell
(
TextFormField
(
readOnly:
true
,
initialValue:
event
.
status
,
onFieldSubmitted:
(
val
)
{
event
.
status
=
val
;
//Update Database
},
),
),
],
...
...
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