Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nicolas Richard Walter Boeckh
LogAir_Application_XOS
Commits
08e19243
Commit
08e19243
authored
Feb 26, 2020
by
Nicolas Richard Walter Boeckh
💬
Browse files
Header mapping init.
parent
b1ec93cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/handlers/data_handler.dart
View file @
08e19243
...
...
@@ -20,11 +20,13 @@ class DataHandler {
// Index of the packet termination symbol in ASCII.
int
index
=
_data
.
indexWhere
((
e
)
=>
e
==
36
);
if
(
index
>=
0
&&
_data
.
length
>
index
+
1
&&
_data
[
index
+
1
]
==
13
&&
_data
[
index
+
2
]
==
10
)
{
// TODO if starts with `{` then use data header comparison, else use DataPacket constructor
_sortedData
.
add
(
_data
.
getRange
(
0
,
index
+
1
).
where
((
e
)
=>
e
!=
10
&&
e
!=
13
).
toList
());
_data
.
removeRange
(
0
,
index
+
2
);
}
}
@Deprecated
(
"USED FOR DEBUG"
)
doPrint
()
{
print
(
""
);
_sortedData
.
map
((
x
)
=>
String
.
fromCharCodes
(
x
)).
forEach
(
print
);
...
...
lib/logic/data_header.dart
View file @
08e19243
...
...
@@ -24,4 +24,8 @@ class DataHeader {
bool
isEqual
(
List
<
int
>
that
)
=>
ListEquality
().
equals
(
_headerData
,
that
);
double
_confidence
()
=>
_detection
/
_total
;
Map
<
dynamic
,
dynamic
>
getJson
()
{
return
{};
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment