mirror of
https://gitlab.cern.ch/wotsubo/PSBoardDataBase.git
synced 2025-07-02 01:29:25 +09:00
new(slavelog parser): parser for asdtp section
- a lot of boilerplates... - there should be smarter way
This commit is contained in:
parent
9a4a4e8952
commit
3b490cd28c
8 changed files with 8938 additions and 0 deletions
3
test/input/.gitignore
vendored
3
test/input/.gitignore
vendored
|
@ -5,3 +5,6 @@ slavelogs/main/*
|
|||
!slavelogs/main/448_103_clk.txt
|
||||
!slavelogs/main/444_103_clk.txt
|
||||
!slavelogs/main/209_51_clk.txt
|
||||
!slavelogs/main/525_244.txt
|
||||
!slavelogs/main/525_245_longrun.txt
|
||||
!slavelogs/main/430_100.txt
|
||||
|
|
2567
test/input/slavelogs/main/430_100.txt
Normal file
2567
test/input/slavelogs/main/430_100.txt
Normal file
File diff suppressed because it is too large
Load diff
2302
test/input/slavelogs/main/525_244.txt
Normal file
2302
test/input/slavelogs/main/525_244.txt
Normal file
File diff suppressed because it is too large
Load diff
3641
test/input/slavelogs/main/525_245_longrun.txt
Normal file
3641
test/input/slavelogs/main/525_245_longrun.txt
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,6 @@
|
|||
using Test
|
||||
using PSBoardDataBase
|
||||
using StaticArrays
|
||||
using CSV, DataFrames
|
||||
using SQLite, DBInterface
|
||||
using Dates
|
||||
|
@ -45,6 +46,64 @@ true || include("../src/PSBoardDataBase.jl")
|
|||
) == 22
|
||||
end
|
||||
|
||||
@testset "Slave Log parser" begin
|
||||
lines = Iterators.Stateful(
|
||||
Iterators.drop(eachline("./input/slavelogs/main/430_100.txt"), 2280),
|
||||
)
|
||||
result_asdtp = PSBoardDataBase.SlaveLogParser.parse_asdtp_section!(lines)
|
||||
# target = PSBoardDataBase.SlaveLogParser.AsdtpResult(
|
||||
# 1,
|
||||
# 0,
|
||||
# true,
|
||||
# fill(PSBoardDataBase.SlaveLogParser.AsdtpMeasurement.(fill((0, 1, 0), 32)), 8),
|
||||
# 0,
|
||||
# 1,
|
||||
# 1,
|
||||
# 0,
|
||||
# 0x1,
|
||||
# 0x1,
|
||||
# 0xff,
|
||||
# 0x0,
|
||||
# 0x0,
|
||||
# 0x0,
|
||||
# MVector((0x1001, 0x2001, 0x3001, 0x4001, 0x5001, 0x6001, 0x7001, 0x8001)),
|
||||
# )
|
||||
# @info "" target == result_asdtp zip(result_asdtp.pp_pllds, target.pp_pllds) |>
|
||||
# collect result_asdtp.pp_pllds == target.pp_pllds Iterators.filter(
|
||||
# x -> x[1] != x[2],
|
||||
# zip(result_asdtp.pp_pllds, target.pp_pllds),
|
||||
# ) |> collect
|
||||
# @info "" map(fieldnames(typeof(result_asdtp))) do field
|
||||
# (; field, diff = getfield(result_asdtp, field) == getfield(target, field))
|
||||
# end
|
||||
|
||||
@test result_asdtp == PSBoardDataBase.SlaveLogParser.AsdtpResult(
|
||||
1,
|
||||
0,
|
||||
true,
|
||||
fill(PSBoardDataBase.SlaveLogParser.AsdtpMeasurement.(fill((0, 1, 0), 32)), 8),
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0x1,
|
||||
0x1,
|
||||
0xff,
|
||||
0x0,
|
||||
0x0,
|
||||
0x0,
|
||||
MVector((0x1001, 0x2001, 0x3001, 0x4001, 0x5001, 0x6001, 0x7001, 0x8001)),
|
||||
)
|
||||
@info "pass"
|
||||
lines = Iterators.Stateful(
|
||||
Iterators.drop(eachline("./input/slavelogs/main/525_244.txt"), 2280),
|
||||
)
|
||||
PSBoardDataBase.SlaveLogParser.parse_asdtp_section!(lines)
|
||||
# PSBoardDataBase.SlaveLogParser.parse_slavelog_file(
|
||||
# "./input/slavelogs/main/525_244.txt",
|
||||
# )
|
||||
end
|
||||
|
||||
@testset "Download data csv" begin
|
||||
out = tempname()
|
||||
@test CSV.read(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue