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
Branches containing commit
No related tags found
Tags containing commit
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
...
@@ -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,
-
How to store not uploaded events locally? Dumping jsons to a file?, ObjectBox, SharedPreferences,
## Local Base Data Concept
## Local Base Data Concept
-
The configuration.dart age widget is used to get the online available information for available
-
The configuration.dart age widget is used to get the online available information for available
devices and event creation.
devices and event creation.
...
@@ -22,37 +21,40 @@ A cross plattform project for android and ios to log events offline everywhere a
...
@@ -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" 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!
-
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.
-
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.
-
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 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.
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?
Shall exported events be displayed here? Slide switch to also show exported events?
-
Functionality to export events locally for backup in the field!
-
Functionality to export events locally for backup in the field!
## Configuration Page
## Configuration Page
-
Dropdown "Collection" to select a c
ollection
-
Switch to select if Mission or C
ollection
based.
-
Textfield to show current locally selected and offline available
collection
-
Dropdown "Collection" to select a
collection
/ mission
-
Button "get Collection devices from Sensor"
-
Button "get Collection devices from Sensor"
-
Button "store Collection devices locally"
-
Button "store Collection devices locally"
-
Select a Mission from the new Sensor-Mission-Management to get a set of devices.
-
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
## GNSS
-
Checkbox
on add event page which activates GNSS locationing. A field shall signal "no fix" or presision in meter.
-
Switch
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.
The fields lat, long, elevation
and timestamp
are updated automatically if checkbox is checked.
# Input validation
# Input validation
a-z , A-Z , _ , 0-9 , ,(Comma) , ( , ) , + , - , . , :
a-z , A-Z , _ , 0-9 , ,(Comma) , ( , ) , + , - , . , :
-90 => Latitude <= +90
-90 => Latitude <= +90
-180 => Longitude <= +180
-180 => Longitude <= +180
Elevation: any numer
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> {
...
@@ -189,8 +189,9 @@ class _AddEventPageState extends State<AddEvent> {
eventsStore
.
currentEvent
.
elevation
=
alt
;
eventsStore
.
currentEvent
.
elevation
=
alt
;
var
date
=
DateTime
.
now
()
.
toUtc
();
var
date
=
DateTime
.
now
()
.
toUtc
();
eventsStore
.
currentEvent
.
startDate
=
'
$date
'
;
var
isoDate
=
date
.
toIso8601String
();
eventsStore
.
currentEvent
.
endDate
=
'
$date
'
;
eventsStore
.
currentEvent
.
startDate
=
isoDate
;
eventsStore
.
currentEvent
.
endDate
=
isoDate
;
if
(
accuracy
==
0.0
){
if
(
accuracy
==
0.0
){
gnssStatusText
=
"No-Fix"
;
gnssStatusText
=
"No-Fix"
;
...
@@ -315,9 +316,10 @@ class _AddEventPageState extends State<AddEvent> {
...
@@ -315,9 +316,10 @@ class _AddEventPageState extends State<AddEvent> {
showTitleActions:
true
,
showTitleActions:
true
,
onConfirm:
(
date
)
{
onConfirm:
(
date
)
{
//Only one field for start and end date.
//Only one field for start and end date.
eventsStore
.
currentEvent
.
startDate
=
'
$date
'
;
var
isoDate
=
date
.
toIso8601String
();
eventsStore
.
currentEvent
.
endDate
=
'
$date
'
;
eventsStore
.
currentEvent
.
startDate
=
isoDate
;
debugPrint
(
'Date set to :
$date
'
);
eventsStore
.
currentEvent
.
endDate
=
isoDate
;
debugPrint
(
'Date set to :
$isoDate
'
);
setState
(()
{});
setState
(()
{});
},
},
currentTime:
DateTime
.
now
()
.
toUtc
(),
currentTime:
DateTime
.
now
()
.
toUtc
(),
...
@@ -328,8 +330,9 @@ class _AddEventPageState extends State<AddEvent> {
...
@@ -328,8 +330,9 @@ class _AddEventPageState extends State<AddEvent> {
ElevatedButton
(
ElevatedButton
(
onPressed:
()
{
onPressed:
()
{
var
date
=
DateTime
.
now
()
.
toUtc
();
var
date
=
DateTime
.
now
()
.
toUtc
();
eventsStore
.
currentEvent
.
startDate
=
'
$date
'
;
var
isoDate
=
date
.
toIso8601String
();
eventsStore
.
currentEvent
.
endDate
=
'
$date
'
;
eventsStore
.
currentEvent
.
startDate
=
isoDate
;
eventsStore
.
currentEvent
.
endDate
=
isoDate
;
debugPrint
(
'Date set to : '
+
debugPrint
(
'Date set to : '
+
eventsStore
.
currentEvent
.
endDate
.
toString
());
eventsStore
.
currentEvent
.
endDate
.
toString
());
setState
(()
{});
setState
(()
{});
...
@@ -468,8 +471,11 @@ class _AddEventPageState extends State<AddEvent> {
...
@@ -468,8 +471,11 @@ class _AddEventPageState extends State<AddEvent> {
//Update time for next event
//Update time for next event
var
date
=
DateTime
.
now
()
.
toUtc
();
var
date
=
DateTime
.
now
()
.
toUtc
();
eventsStore
.
currentEvent
.
startDate
=
'
$date
'
;
var
isoDate
=
date
.
toIso8601String
();
eventsStore
.
currentEvent
.
endDate
=
'
$date
'
;
eventsStore
.
currentEvent
.
startDate
=
isoDate
;
eventsStore
.
currentEvent
.
endDate
=
isoDate
;
debugPrint
(
date
.
toIso8601String
());
}
}
setState
(()
{});
setState
(()
{});
},
},
...
...
This diff is collapsed.
Click to expand it.
lib/datamodel.dart
+
13
−
13
View file @
9e6e1d47
...
@@ -88,19 +88,19 @@ class Event{
...
@@ -88,19 +88,19 @@ class Event{
}
}
Map
<
String
,
dynamic
>
toSensorJson
()
=
>
{
Map
<
String
,
dynamic
>
toSensorJson
()
=
>
{
'
itemID
'
:
id
,
"
\"
itemID
\"
"
:
"
\"
$id
\"
"
,
'
inheritToAllChildren
'
:
'
false
'
,
"
\"
inheritToAllChildren
\"
"
:
"
\"
false
\"
"
,
'
inheritToChildren
'
:
[],
"
\"
inheritToChildren
\"
"
:
[],
'
event
'
:
{
"
\"
event
\"
"
:
{
'
startDate
'
:
startDate
,
"
\"
startDate
\"
"
:
"
\"
$
startDate
\"
"
,
'
endDate
'
:
endDate
,
"
\"
endDate
\"
"
:
"
\"
$
endDate
\"
"
,
'
label
'
:
label
,
"
\"
label
\"
"
:
"
\"
$
label
\"
"
,
'
description
'
:
description
,
"
\"
description
\"
"
:
"
\"
$
description
\"
"
,
'
eventType
'
:
type
,
"
\"
eventType
\"
"
:
"
\"
$
type
\"
"
,
'
latitude
'
:
latitude
,
"
\"
latitude
\"
"
:
"
\"
$
latitude
\"
"
,
'
longitude
'
:
longitude
,
"
\"
longitude
\"
"
:
"
\"
$
longitude
\"
"
,
'
elevationInMeter
'
:
elevation
,
"
\"
elevationInMeter
\"
"
:
"
\"
$
elevation
\"
"
,
'id'
:
0
"
\"
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 {
...
@@ -22,7 +22,12 @@ Future<bool> syncEvents() async {
url
=
base_url
+
event
.
id
.
toString
()
+
'?createVersion=false'
;
url
=
base_url
+
event
.
id
.
toString
()
+
'?createVersion=false'
;
debugPrint
(
'XXX '
+
Uri
.
parse
(
url
)
.
toString
());
debugPrint
(
'XXX '
+
Uri
.
parse
(
url
)
.
toString
());
final
response
=
await
http
.
put
(
Uri
.
parse
(
url
),
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
(),
body:
event
.
toSensorJson
()
.
toString
(),
encoding:
Encoding
.
getByName
(
"utf-8"
),
encoding:
Encoding
.
getByName
(
"utf-8"
),
);
);
...
@@ -39,13 +44,8 @@ Future<bool> syncEvents() async {
...
@@ -39,13 +44,8 @@ Future<bool> syncEvents() async {
debugPrint
(
'Header: '
+
response
.
headers
.
toString
());
debugPrint
(
'Header: '
+
response
.
headers
.
toString
());
debugPrint
(
'Body: '
+
response
.
body
.
toString
());
debugPrint
(
'Body: '
+
response
.
body
.
toString
());
debugPrint
(
'StatusCode: '
+
response
.
statusCode
.
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