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
9ec2d5f2
Commit
9ec2d5f2
authored
3 years ago
by
Maximilian Betz
Browse files
Options
Downloads
Patches
Plain Diff
beautified add event ui
parent
beec4161
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+11
-4
11 additions, 4 deletions
README.md
lib/addevent.dart
+48
-42
48 additions, 42 deletions
lib/addevent.dart
with
59 additions
and
46 deletions
README.md
+
11
−
4
View file @
9ec2d5f2
...
...
@@ -22,9 +22,16 @@ A cross plattform project for android and ios to log events offline everywhere a
-
This "base data" is required to provide the dropdown menu options on the addevent.dart page.
-
This "base data" needs to be stored persistently, so that it is available also offline!
## Local Data Event Storage
-
Events added on the addevent.dart page have to be stored locally persistently. At least until the
are exported to sensor.awi.de
## Add Event Widget
-
Usw Switch for automatic GNSS and Time update.
-
Show "now" time button only if GNSS is disabled. This button shall fill the timestamp with the current utc time.
## View Events Widget
-
Events added on the addevent.dart page have to be stored locally persistently. They can be displayed in the view
events widget. Each event has a flag which shows if the event is already exported to sensor.
Shall exported events be displayed here? Slide switch to also show exported events?
-
Functionality to export events locally for backup in the field!
## Configuration Page
-
Dropdown "Collection" to select a collection
...
...
@@ -32,7 +39,7 @@ A cross plattform project for android and ios to log events offline everywhere a
-
Button "get Collection devices from Sensor"
-
Button "store Collection devices locally"
-
Select a Mission from the new Sensor-Mission-Management to get a set of devices.
-
Also input username und passwort on this page. "Test login on store even if not required here"
## GNSS
...
...
This diff is collapsed.
Click to expand it.
lib/addevent.dart
+
48
−
42
View file @
9ec2d5f2
...
...
@@ -5,9 +5,6 @@ import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import
'datamodel.dart'
;
import
'dart:async'
;
import
'package:geolocator/geolocator.dart'
;
import
'package:intl/intl.dart'
;
import
'package:datetime_picker_formfield/datetime_picker_formfield.dart'
;
class
AddEvent
extends
StatefulWidget
{
const
AddEvent
({
Key
?
key
})
:
super
(
key:
key
);
...
...
@@ -18,7 +15,6 @@ class AddEvent extends StatefulWidget {
class
_AddEventPageState
extends
State
<
AddEvent
>
{
bool
syncGNSSData
=
true
;
final
List
<
bool
>
_isGNSSSelected
=
[
true
];
late
LocationPermission
permission
;
late
Position
position
;
late
String
long
=
""
;
...
...
@@ -135,6 +131,10 @@ class _AddEventPageState extends State<AddEvent> {
eventsStore
.
currentEvent
.
longitude
=
long
;
eventsStore
.
currentEvent
.
elevation
=
alt
;
var
date
=
DateTime
.
now
()
.
toUtc
();
eventsStore
.
currentEvent
.
startDate
=
'
$date
'
;
eventsStore
.
currentEvent
.
endDate
=
'
$date
'
;
if
(
accuracy
==
0.0
){
gnssStatusText
=
"No-Fix"
;
}
...
...
@@ -214,39 +214,47 @@ class _AddEventPageState extends State<AddEvent> {
eventsStore
.
currentEvent
.
description
=
value
;
},
),
TextFormField
(
controller:
TextEditingController
(
text:
eventsStore
.
currentEvent
.
startDate
),
readOnly:
true
,
decoration:
const
InputDecoration
(
labelText:
'Timestamp'
,
//helperText: '', //Adds some space below field
border:
OutlineInputBorder
(),
),
onTap:
()
{
DatePicker
.
showDateTimePicker
(
context
,
showTitleActions:
true
,
onConfirm:
(
date
)
{
//Only one field for start and end date.
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
Flexible
(
child:
TextFormField
(
controller:
TextEditingController
(
text:
eventsStore
.
currentEvent
.
startDate
),
readOnly:
true
,
decoration:
const
InputDecoration
(
labelText:
'Timestamp'
,
//helperText: '', //Adds some space below field
border:
OutlineInputBorder
(),
),
onTap:
()
{
DatePicker
.
showDateTimePicker
(
context
,
showTitleActions:
true
,
onConfirm:
(
date
)
{
//Only one field for start and end date.
eventsStore
.
currentEvent
.
startDate
=
'
$date
'
;
eventsStore
.
currentEvent
.
endDate
=
'
$date
'
;
debugPrint
(
'Date set to :
$date
'
);
setState
(()
{
});
},
currentTime:
DateTime
.
now
()
.
toUtc
(),
locale:
LocaleType
.
en
);
},
),
),
ElevatedButton
(
onPressed:
()
{
var
date
=
DateTime
.
now
()
.
toUtc
();
eventsStore
.
currentEvent
.
startDate
=
'
$date
'
;
eventsStore
.
currentEvent
.
endDate
=
'
$date
'
;
debugPrint
(
'Date set to :
$date
'
);
debugPrint
(
'Date set to :
'
+
eventsStore
.
currentEvent
.
endDate
.
toString
()
);
setState
(()
{
});
},
currentTime:
DateTime
.
now
()
.
toUtc
(),
locale:
LocaleType
.
en
);
},
),
ElevatedButton
(
onPressed:
()
{
var
date
=
DateTime
.
now
()
.
toUtc
();
eventsStore
.
currentEvent
.
startDate
=
'
$date
'
;
eventsStore
.
currentEvent
.
endDate
=
'
$date
'
;
debugPrint
(
'Date set to : '
+
eventsStore
.
currentEvent
.
endDate
.
toString
());
setState
(()
{
});
},
child:
Text
(
'Now'
),
child:
Text
(
'Now'
),
),
]
),
TextFormField
(
readOnly:
false
,
...
...
@@ -290,17 +298,15 @@ class _AddEventPageState extends State<AddEvent> {
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
[
Text
(
gnssStatusText
),
const
SizedBox
(
width:
5
0
),
ToggleButtons
(
children:
const
<
Widget
>[
Icon
(
Icons
.
my_location
),
],
isSelected:
_isGNSSSelected
,
onPressed:
(
int
index
)
{
const
SizedBox
(
width:
1
0
),
Switch
(
value:
syncGNSSData
,
onChanged:
(
value
)
{
syncGNSSData
=
value
;
debugPrint
(
'Switched to:'
+
syncGNSSData
.
toString
());
setState
(()
{
_isGNSSSelected
[
index
]
=
!
_isGNSSSelected
[
index
];
syncGNSSData
=
_isGNSSSelected
[
index
];
//TODO: cancel position stream if GNSS sync disabled here!
//refresh the UI
});
},
),
...
...
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