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
15be6cd1
Commit
15be6cd1
authored
3 years ago
by
Maximilian Betz
Browse files
Options
Downloads
Patches
Plain Diff
some progress
parent
35104c2b
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
+12
-1
12 additions, 1 deletion
README.md
lib/addevent.dart
+6
-2
6 additions, 2 deletions
lib/addevent.dart
lib/configuration.dart
+15
-14
15 additions, 14 deletions
lib/configuration.dart
lib/viewevents.dart
+2
-0
2 additions, 0 deletions
lib/viewevents.dart
with
35 additions
and
17 deletions
README.md
+
12
−
1
View file @
15be6cd1
...
@@ -37,4 +37,15 @@ A cross plattform project for android and ios to log events offline everywhere a
...
@@ -37,4 +37,15 @@ A cross plattform project for android and ios to log events offline everywhere a
## GNSS
## GNSS
-
Checkbox on add event page which activates GNSS locationing. A field shall signal "no fix" or presision in meter.
-
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.
The fields lat, long, elevation are updated automatically if checkbox is checked.
\ No newline at end of file
# Input validation
a-z , A-Z , _ , 0-9 , ,(Comma) , ( , ) , + , - , . , :
-90 => Latitude <= +90
-180 => Latitude <= +180
Elevation: any numer
This diff is collapsed.
Click to expand it.
lib/addevent.dart
+
6
−
2
View file @
15be6cd1
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'datamodel.dart'
;
import
'datamodel.dart'
;
import
'dart:async'
;
import
'dart:async'
;
import
'package:geolocator/geolocator.dart'
;
import
'package:geolocator/geolocator.dart'
;
...
@@ -255,9 +256,12 @@ class _AddEventPageState extends State<AddEvent> {
...
@@ -255,9 +256,12 @@ class _AddEventPageState extends State<AddEvent> {
const
SizedBox
(
width:
50
),
const
SizedBox
(
width:
50
),
FloatingActionButton
(
FloatingActionButton
(
heroTag:
null
,
heroTag:
null
,
onPressed:
_storeCurrentEvent
,
onPressed:
()
{
_storeCurrentEvent
();
HapticFeedback
.
vibrate
();
},
tooltip:
'Add Event'
,
tooltip:
'Add Event'
,
child:
const
Icon
(
Icons
.
add
),
child:
const
Icon
(
Icons
.
check
),
),
),
const
SizedBox
(
width:
20
),
const
SizedBox
(
width:
20
),
],
],
...
...
This diff is collapsed.
Click to expand it.
lib/configuration.dart
+
15
−
14
View file @
15be6cd1
...
@@ -6,7 +6,7 @@ import 'datamodel.dart';
...
@@ -6,7 +6,7 @@ import 'datamodel.dart';
Future
<
Collection
>
fetchCollection
()
async
{
Future
<
Collection
>
fetchCollection
()
async
{
p
rint
(
"Start HTTP GET++##"
);
debugP
rint
(
"Start HTTP GET++##"
);
final
response
=
await
http
final
response
=
await
http
.
get
(
Uri
.
parse
(
'https://sensor.awi.de/rest/sensors/collections/getCollection/22'
));
.
get
(
Uri
.
parse
(
'https://sensor.awi.de/rest/sensors/collections/getCollection/22'
));
...
@@ -23,13 +23,12 @@ Future<Collection> fetchCollection() async {
...
@@ -23,13 +23,12 @@ Future<Collection> fetchCollection() async {
}
}
Future
<
List
<
Collection
>>
fetchCollections
()
async
{
Future
<
List
<
Collection
>>
fetchCollections
()
async
{
p
rint
(
"Fetching Collections..."
);
debugP
rint
(
"Fetching Collections..."
);
List
<
Collection
>
collectionList
=
[];
final
response
=
await
http
final
response
=
await
http
.
get
(
Uri
.
parse
(
'https://sensor.awi.de/rest/sensors/collections/getAllCollections?pointInTime=2018-07-03T12%3A30%3A55.389Z'
));
.
get
(
Uri
.
parse
(
'https://sensor.awi.de/rest/sensors/collections/getAllCollections?pointInTime=2018-07-03T12%3A30%3A55.389Z'
));
if
(
response
.
statusCode
==
200
)
{
if
(
response
.
statusCode
==
200
)
{
List
<
Collection
>
collectionList
;
return
(
json
.
decode
(
response
.
body
)
as
List
)
return
(
json
.
decode
(
response
.
body
)
as
List
)
.
map
((
i
)
=
>
Collection
.
fromJson
(
i
))
.
map
((
i
)
=
>
Collection
.
fromJson
(
i
))
.
toList
();
.
toList
();
...
@@ -37,12 +36,16 @@ Future<List<Collection>> fetchCollections() async {
...
@@ -37,12 +36,16 @@ Future<List<Collection>> fetchCollections() async {
}
else
{
}
else
{
// If the server did not return a 200 OK response,
// If the server did not return a 200 OK response,
// then throw an exception.
// then throw an exception.
throw
Exception
(
'Failed to load Collection'
);
//throw Exception('Failed to load Collection');
debugPrint
(
'Failed to load Collection'
);
return
collectionList
;
}
}
}
}
class
Configuration
extends
StatefulWidget
{
class
Configuration
extends
StatefulWidget
{
const
Configuration
({
Key
?
key
})
:
super
(
key:
key
);
@override
@override
State
<
Configuration
>
createState
()
=
>
_MyHomePageState
();
State
<
Configuration
>
createState
()
=
>
_MyHomePageState
();
}
}
...
@@ -57,7 +60,6 @@ class _MyHomePageState extends State<Configuration> {
...
@@ -57,7 +60,6 @@ class _MyHomePageState extends State<Configuration> {
super
.
initState
();
super
.
initState
();
futureCollection
=
fetchCollection
();
futureCollection
=
fetchCollection
();
futureCollections
=
fetchCollections
();
futureCollections
=
fetchCollections
();
}
}
late
Future
<
String
>
eventTypes
;
late
Future
<
String
>
eventTypes
;
...
@@ -69,7 +71,7 @@ class _MyHomePageState extends State<Configuration> {
...
@@ -69,7 +71,7 @@ class _MyHomePageState extends State<Configuration> {
return
Scaffold
(
return
Scaffold
(
appBar:
AppBar
(
appBar:
AppBar
(
title:
Text
(
'Configuration'
),
title:
const
Text
(
'Configuration'
),
),
),
body:
Center
(
body:
Center
(
child:
Column
(
child:
Column
(
...
@@ -80,12 +82,11 @@ class _MyHomePageState extends State<Configuration> {
...
@@ -80,12 +82,11 @@ class _MyHomePageState extends State<Configuration> {
builder:
(
context
,
snapshot
){
builder:
(
context
,
snapshot
){
if
(
snapshot
.
hasData
)
if
(
snapshot
.
hasData
)
{
{
print
(
snapshot
.
data
);
debugPrint
(
'Got collections:'
);
snapshot
.
data
?.
forEach
((
element
)
{
debugPrint
(
element
.
id
.
toString
()
+
' '
+
element
.
toString
()
+
' #'
+
element
.
description
.
toString
());
});
print
(
futureCollections
);
//storedCollections.store = snapshot.data!; // Store data locally
//var listlen = storedCollections.store.length();
//print('Length ###: ' + storedCollections.store.length().toString());
return
DropdownButtonFormField
(
return
DropdownButtonFormField
(
value:
currentCollection
.
store
.
collectionName
,
value:
currentCollection
.
store
.
collectionName
,
...
@@ -105,7 +106,7 @@ class _MyHomePageState extends State<Configuration> {
...
@@ -105,7 +106,7 @@ class _MyHomePageState extends State<Configuration> {
);
);
}
}
else
{
else
{
return
CircularProgressIndicator
();
return
const
CircularProgressIndicator
();
}
}
}
}
),
),
...
@@ -117,7 +118,7 @@ class _MyHomePageState extends State<Configuration> {
...
@@ -117,7 +118,7 @@ class _MyHomePageState extends State<Configuration> {
return
Text
(
snapshot
.
data
!.
collectionName
);
return
Text
(
snapshot
.
data
!.
collectionName
);
}
}
else
{
else
{
return
CircularProgressIndicator
();
return
const
CircularProgressIndicator
();
}
}
}
}
),
),
...
...
This diff is collapsed.
Click to expand it.
lib/viewevents.dart
+
2
−
0
View file @
15be6cd1
...
@@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
...
@@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
import
'datamodel.dart'
;
import
'datamodel.dart'
;
class
ViewEvents
extends
StatelessWidget
{
class
ViewEvents
extends
StatelessWidget
{
const
ViewEvents
({
Key
?
key
})
:
super
(
key:
key
);
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
// Get singleton to access locally stored events:
// Get singleton to access locally stored events:
...
...
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