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
0b008843
Commit
0b008843
authored
2 years ago
by
Maximilian Betz
Browse files
Options
Downloads
Patches
Plain Diff
adding only the required parameters for the current event
parent
bd682439
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sw/lib/addeventkottaspegel.dart
+19
-7
19 additions, 7 deletions
sw/lib/addeventkottaspegel.dart
with
19 additions
and
7 deletions
sw/lib/addeventkottaspegel.dart
+
19
−
7
View file @
0b008843
...
...
@@ -334,7 +334,8 @@ class _AddEventKottasPegelPageState extends State<AddEventKottasPegel> {
);
}
Future
<
void
>
_storeCurrentMeasurementEvent
(
BuildContext
context
)
async
{
Future
<
void
>
_storeCurrentMeasurementEvent
(
BuildContext
context
,
bool
addAngle
,
bool
addOldLength
,
bool
addNewLength
)
async
{
final
EventStoreInstance
event
=
EventStoreInstance
();
final
ConfigurationStoreInstance
configuration
=
ConfigurationStoreInstance
();
...
...
@@ -347,13 +348,21 @@ class _AddEventKottasPegelPageState extends State<AddEventKottasPegel> {
//Generate Payload Measurement Data
Map
<
String
,
dynamic
>
data
=
{
'status'
:
measurementStatusItems
[
measurementStatusId
],
'angle'
:
angleStatus
,
'lengthOld'
:
lengthOld
,
'lengthNew'
:
lengthNew
,
'measurement_status'
:
measurementStatusItems
[
measurementStatusId
],
};
if
(
true
==
addAngle
){
data
[
'angle_old'
]
=
angleStatus
;
}
if
(
true
==
addOldLength
)
{
data
[
'length_old'
]
=
lengthOld
;
}
if
(
true
==
addNewLength
)
{
data
[
'length_new'
]
=
lengthNew
;
}
//TODO: extend Database and add payload field.
//NOTE: these "parameters" exist as parameters on the sensor device.
//TODO: extend Database and add payload field, but only add the fields which are required for the current event.
debugPrint
(
'Payload
$data
'
);
await
database
.
addEvent
(
event
.
currentEvent
);
...
...
@@ -379,6 +388,8 @@ class _AddEventKottasPegelPageState extends State<AddEventKottasPegel> {
lengthOld
=
0
;
lengthNew
=
0
;
await
event
.
storeToSharedPrefs
();
await
configuration
.
storeToSharedPrefs
();
...
...
@@ -386,6 +397,7 @@ class _AddEventKottasPegelPageState extends State<AddEventKottasPegel> {
_eventAdded
=
true
;
// Trigger popup in build method
setState
(()
{});
}
@override
...
...
@@ -888,7 +900,7 @@ class _AddEventKottasPegelPageState extends State<AddEventKottasPegel> {
onPressed:
()
{
if
(
_validateInput
())
{
_addButtonEnabled
=
false
;
//Disable button until event is stored
_storeCurrentMeasurementEvent
(
context
);
_storeCurrentMeasurementEvent
(
context
,
displayAngle
,
displayOldLength
,
displayNewLength
);
}
setState
(()
{});
},
...
...
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