Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC TDC 1ns 5cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC TDC 1ns 5cha
Commits
b193a4f9
Commit
b193a4f9
authored
Oct 15, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py: implement __float__ for FmcTdcTime
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
a17498f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
PyFmcTdc.py
lib/PyFmcTdc/PyFmcTdc/PyFmcTdc.py
+5
-1
No files found.
lib/PyFmcTdc/PyFmcTdc/PyFmcTdc.py
View file @
b193a4f9
...
...
@@ -22,10 +22,14 @@ class FmcTdcTime(ctypes.Structure):
]
def
__str__
(
self
):
return
"seq: {:d} timestamp: {:f} raw: {:08x}:{:08x}:{:08x}, debug: {:08x}"
.
format
(
self
.
seq_id
,
float
(
self
),
self
.
seconds
,
self
.
coarse
,
self
.
frac
,
self
.
debug
)
def
__float__
(
self
):
ts
=
self
.
seconds
ts
=
ts
+
(
self
.
coarse
/
1000000000.0
*
8
)
ts
=
ts
+
((
self
.
frac
*
7.999
)
/
4095
)
/
1000000000
return
"seq: {:d} timestamp: {:f} raw: {:08x}:{:08x}:{:08x}, debug: {:08x}"
.
format
(
self
.
seq_id
,
ts
,
self
.
seconds
,
self
.
coarse
,
self
.
frac
,
self
.
debug
)
return
ts
def
libfmctdc_create
():
...
...
Write
Preview
Markdown
is supported
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