Skip to content
Snippets Groups Projects
Verified Commit b2c2f52e authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Even more DAQ tools (UDP stuff etc.)

parent a9a01301
No related branches found
No related tags found
1 merge request!15DAQ tools
......@@ -28,7 +28,8 @@ export Waveform, AcousticSignal, AcousticsTriggerParameter, piezoenabled, hydrop
# Online dataformat
export DAQEvent, pmtrate, pmtrates, hrvstatus, tdcstatus, wrstatus, fifostatus, hasudptrailer,
count_active_channels, count_fifostatus, count_hrvstatus
count_active_channels, count_fifostatus, count_hrvstatus, status,
maximal_udp_sequence_number, number_of_udp_packets_received
# Offline dataformat
export Evt, Hit, TriggeredHit, Trk, CalibratedHit, XCalibratedHit, MCTrk, CalibratedMCHit
......
......@@ -128,3 +128,25 @@ function count_hrvstatus(f::SummaryFrame)
end
n
end
"""
Return `true` if TDC and White Rabbit status are OK.
"""
status(f::SummaryFrame) = wrstatus(f) && tdcstatus(f)
"""
Maximal sequence number of all received UDP packets.
"""
maximal_udp_sequence_number(f::SummaryFrame) = signed(f.daq >> 16)
"""
Number of received UDP packets (excluding the trailer).
"""
number_of_udp_packets_received(f::SummaryFrame) = signed(f.daq & 0x0000FFFF)
......@@ -243,10 +243,16 @@ end
@test tdcstatus(s[1].frames[4])
@test !tdcstatus(s[1].frames[5])
@test status(s[1].frames[1])
@test !status(s[1].frames[5])
@test 15 == count_active_channels(frame)
@test 0 == count_fifostatus(frame)
@test 16 == count_hrvstatus(frame)
@test 34 == maximaul_udp_sequence_number(frame)
@test 35 == number_of_udp_packets_received(frame)
# Test sample via Jpp from the first summary slice (Frame #23) in ONLINEFILE
# DOM ID: 808951460
# UDP max sequence number: 36
......@@ -307,5 +313,8 @@ end
@test 6 == count_fifostatus(frame)
@test 16 == count_hrvstatus(frame)
@test 36 == maximaul_udp_sequence_number(frame)
@test 37 == number_of_udp_packets_received(frame)
close(f)
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment