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
9e6e1d47
Commit
9e6e1d47
authored
3 years ago
by
Maximilian Betz
Browse files
Options
Downloads
Patches
Plain Diff
updated date time format to sensor format
parent
60a02b5f
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+13
-11
13 additions, 11 deletions
README.md
lib/addevent.dart
+15
-9
15 additions, 9 deletions
lib/addevent.dart
lib/datamodel.dart
+13
-13
13 additions, 13 deletions
lib/datamodel.dart
lib/viewevents.dart
+7
-7
7 additions, 7 deletions
lib/viewevents.dart
with
48 additions
and
40 deletions
README.md
+
13
−
11
View file @
9e6e1d47
...
...
@@ -14,7 +14,6 @@ A cross plattform project for android and ios to log events offline everywhere a
-
How to store not uploaded events locally? Dumping jsons to a file?, ObjectBox, SharedPreferences,
## Local Base Data Concept
-
The configuration.dart age widget is used to get the online available information for available
devices and event creation.
...
...
@@ -22,37 +21,40 @@ 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!
## Add Event
Wid
ge
t
## Add Event
Pa
ge
-
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
## View
& Sync Page
-
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 c
ollection
-
Textfield to show current locally selected and offline available
collection
-
Switch to select if Mission or C
ollection
based.
-
Dropdown "Collection" to select a
collection
/ mission
-
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 u
sername und passwort
on this page.
"Test login on store even if not required here"
-
U
sername und passwort
.
"Test login on store even if not required here"
## GNSS
-
Checkbox
on add event page which activates GNSS locationing. A field shall signal "no fix" or presision in meter.
The fields lat, long, elevation are updated automatically if checkbox is checked.
-
Switch
on add event page which activates GNSS locationing. A field shall signal "no fix" or presision in meter.
The fields lat, long, elevation
and timestamp
are updated automatically if checkbox is checked.
# Input validation
a-z , A-Z , _ , 0-9 , ,(Comma) , ( , ) , + , - , . , :
-90 => Latitude <= +90
-180 => Longitude <= +180
Elevation: any numer
## TODOs
-
FlutterSecureStorage for user password?
This diff is collapsed.
Click to expand it.
lib/addevent.dart
+
15
−
9
View file @
9e6e1d47
...
...
@@ -189,8 +189,9 @@ class _AddEventPageState extends State<AddEvent> {
eventsStore
.
currentEvent
.
elevation
=
alt
;
var
date
=
DateTime
.
now
()
.
toUtc
();
eventsStore
.
currentEvent
.
startDate
=
'
$date
'
;
eventsStore
.
currentEvent
.
endDate
=
'
$date
'
;
var
isoDate
=
date
.
toIso8601String
();
eventsStore
.
currentEvent
.
startDate
=
isoDate
;
eventsStore
.
currentEvent
.
endDate
=
isoDate
;
if
(
accuracy
==
0.0
){
gnssStatusText
=
"No-Fix"
;
...
...
@@ -315,9 +316,10 @@ class _AddEventPageState extends State<AddEvent> {
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
'
);
var
isoDate
=
date
.
toIso8601String
();
eventsStore
.
currentEvent
.
startDate
=
isoDate
;
eventsStore
.
currentEvent
.
endDate
=
isoDate
;
debugPrint
(
'Date set to :
$isoDate
'
);
setState
(()
{});
},
currentTime:
DateTime
.
now
()
.
toUtc
(),
...
...
@@ -328,8 +330,9 @@ class _AddEventPageState extends State<AddEvent> {
ElevatedButton
(
onPressed:
()
{
var
date
=
DateTime
.
now
()
.
toUtc
();
eventsStore
.
currentEvent
.
startDate
=
'
$date
'
;
eventsStore
.
currentEvent
.
endDate
=
'
$date
'
;
var
isoDate
=
date
.
toIso8601String
();
eventsStore
.
currentEvent
.
startDate
=
isoDate
;
eventsStore
.
currentEvent
.
endDate
=
isoDate
;
debugPrint
(
'Date set to : '
+
eventsStore
.
currentEvent
.
endDate
.
toString
());
setState
(()
{});
...
...
@@ -468,8 +471,11 @@ class _AddEventPageState extends State<AddEvent> {
//Update time for next event
var
date
=
DateTime
.
now
()
.
toUtc
();
eventsStore
.
currentEvent
.
startDate
=
'
$date
'
;
eventsStore
.
currentEvent
.
endDate
=
'
$date
'
;
var
isoDate
=
date
.
toIso8601String
();
eventsStore
.
currentEvent
.
startDate
=
isoDate
;
eventsStore
.
currentEvent
.
endDate
=
isoDate
;
debugPrint
(
date
.
toIso8601String
());
}
setState
(()
{});
},
...
...
This diff is collapsed.
Click to expand it.
lib/datamodel.dart
+
13
−
13
View file @
9e6e1d47
...
...
@@ -88,19 +88,19 @@ class Event{
}
Map
<
String
,
dynamic
>
toSensorJson
()
=
>
{
'
itemID
'
:
id
,
'
inheritToAllChildren
'
:
'
false
'
,
'
inheritToChildren
'
:
[],
'
event
'
:
{
'
startDate
'
:
startDate
,
'
endDate
'
:
endDate
,
'
label
'
:
label
,
'
description
'
:
description
,
'
eventType
'
:
type
,
'
latitude
'
:
latitude
,
'
longitude
'
:
longitude
,
'
elevationInMeter
'
:
elevation
,
'id'
:
0
"
\"
itemID
\"
"
:
"
\"
$id
\"
"
,
"
\"
inheritToAllChildren
\"
"
:
"
\"
false
\"
"
,
"
\"
inheritToChildren
\"
"
:
[],
"
\"
event
\"
"
:
{
"
\"
startDate
\"
"
:
"
\"
$
startDate
\"
"
,
"
\"
endDate
\"
"
:
"
\"
$
endDate
\"
"
,
"
\"
label
\"
"
:
"
\"
$
label
\"
"
,
"
\"
description
\"
"
:
"
\"
$
description
\"
"
,
"
\"
eventType
\"
"
:
"
\"
$
type
\"
"
,
"
\"
latitude
\"
"
:
"
\"
$
latitude
\"
"
,
"
\"
longitude
\"
"
:
"
\"
$
longitude
\"
"
,
"
\"
elevationInMeter
\"
"
:
"
\"
$
elevation
\"
"
,
"
\"
id
\"
"
:
"
\"
0
\"
"
}
};
...
...
This diff is collapsed.
Click to expand it.
lib/viewevents.dart
+
7
−
7
View file @
9e6e1d47
...
...
@@ -22,7 +22,12 @@ Future<bool> syncEvents() async {
url
=
base_url
+
event
.
id
.
toString
()
+
'?createVersion=false'
;
debugPrint
(
'XXX '
+
Uri
.
parse
(
url
)
.
toString
());
final
response
=
await
http
.
put
(
Uri
.
parse
(
url
),
headers:
{
"Accept"
:
"application/json"
},
headers:
{
"Content-Type"
:
"application/json"
,
"Cookie"
:
"x-auth-token=72d9d4d20a33f87edca7e1ba01ce8db8"
},
body:
event
.
toSensorJson
()
.
toString
(),
encoding:
Encoding
.
getByName
(
"utf-8"
),
);
...
...
@@ -39,13 +44,8 @@ Future<bool> syncEvents() async {
debugPrint
(
'Header: '
+
response
.
headers
.
toString
());
debugPrint
(
'Body: '
+
response
.
body
.
toString
());
debugPrint
(
'StatusCode: '
+
response
.
statusCode
.
toString
());
throw
Exception
(
'Failed to
login
'
);
throw
Exception
(
'Failed to
put.
'
);
}
}
}
...
...
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