Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EdosL0Util
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
SIPS
EdosL0Util
Commits
828bd7ec
Commit
828bd7ec
authored
4 years ago
by
Bruce Flynn
Browse files
Options
Downloads
Patches
Plain Diff
fix and test AquaCucTimecode
parent
ffeff4f3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
edosl0util/headers.py
+3
-2
3 additions, 2 deletions
edosl0util/headers.py
tests/unit/test_headers.py
+19
-0
19 additions, 0 deletions
tests/unit/test_headers.py
with
22 additions
and
2 deletions
edosl0util/headers.py
+
3
−
2
View file @
828bd7ec
...
...
@@ -108,9 +108,10 @@ class AquaCucTimecode(Timecode):
SUB_SECOND_UNITS
=
15.2
def
day_segmented_timecode
(
self
):
days
=
self
.
seconds
/
86400
millis
=
86400
*
(
days
-
int
(
days
))
*
1e3
micros
=
self
.
SUB_SECOND_UNITS
*
self
.
sub_seconds
seconds
=
self
.
seconds
+
self
.
leap_seconds
return
((
seconds
-
self
.
leap_seconds
)
//
86400
,
micros
//
1e3
,
micros
%
1e3
)
return
int
(
days
),
int
(
millis
),
int
(
micros
)
class
DaySegmentedTimecode
(
Timecode
):
...
...
This diff is collapsed.
Click to expand it.
tests/unit/test_headers.py
0 → 100644
+
19
−
0
View file @
828bd7ec
from
datetime
import
datetime
import
pytest
from
edosl0util
import
headers
# APID 262 data from 2020-11-29 around 08:50
packet
=
b
'
\t\x06
Q
\x01\x02
c
\x00\xae
%vU
\xbd
G
\x00\x1f\x00\x0c\xe6\x12
*
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\xbe\x87
,l
\x90
VPE
\x8c
B
\\
[
\xb4
Z
\xcc
_
\x1c
b
\xde
cvr
\xec
vrv
\xd8\x87
@l
\x94
:
\x9a
3z=
\xb6
4
\xbc
W
\xca
U
\xee
a
\xe4
d
\xc4
Z$[
\xf0
_
\xcc
b
\xde
a0S
\x86
s
\x0e
H>[
\xaa\\\xa6
V
\x92\\\x16
Y
\xb0
[xT
\xfc
g
\x16
`
\x90
ap`
\xb0
^dd
\x14
Z
\xb4
]
\xec
[
\xec
X
\xf4
V
\x88
[
\xd6
e
\x8e
h
\xfe
eze
\xc2
gh[@[
\x96
[
\xa8
[
\xb8
[
\x9c\xc5
0
\x85
2
\x7f\xce\x85
2
\x7f\xce
n
\xfa
E
\x8a
B
\\
k
\xbc
y
\xa2
}x
\x82
>
\x86\x1a\x9d\xf8\xa3\xba\xa3\x80\xbc
P
\x82\xd6
n
\xf6
E
\x8c
BXk
\xb2
y
\xa4
}x
\x82
:
\x86\x10\x9d\xee\xa3\xc4\xa3
~
\xbc\x94\x82\xda\xab
R
\xa9\xf2\xa9\xf8\xad
0
\xad
B
\xaa\xce\xb1\x0e\xab\xce\xaa
`
\xa7\x1c\xa7\x0c\xa6\xf2\xa7
f
\xff\xfe\xa5\xc8\xa5\x10\xa7
p
\xa6\x18\xab\xe4
y
\xa6\x7f\x88
vlB
\xf1
h
\xa2
sFv
\xe0
'
class
TestAquaCUCTimecode
:
@pytest.mark.parametrize
(
"
dat,expected
"
,
[
[
b
"
\xae
%vU
\xbd
G
\x00\x1f
"
,
datetime
(
2020
,
11
,
29
,
8
,
41
,
43
,
471
)],
],
)
def
test
(
self
,
dat
,
expected
):
t
=
headers
.
AquaCucTimecode
.
from_buffer_copy
(
dat
)
assert
t
.
asdatetime
()
==
expected
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