Sotre a mapping of the local message type to the global mesg type on the reader struct
This commit is contained in:
+7
-2
@@ -55,10 +55,11 @@ mutable struct FITFileReader
|
|||||||
bytes_read::Int64
|
bytes_read::Int64
|
||||||
header::Union{FITHeader, Nothing}
|
header::Union{FITHeader, Nothing}
|
||||||
body::Union{Vector{DataRecord}, Nothing}
|
body::Union{Vector{DataRecord}, Nothing}
|
||||||
|
mesg_map::Dict{Real, AbstractString}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
blank_file(fp::AbstractString) = FITFileReader(fp, nothing, 0, nothing, nothing)
|
blank_file(fp::AbstractString) = FITFileReader(fp, nothing, 0, nothing, nothing, Dict())
|
||||||
blank_row() = DataRecord(nothing)
|
blank_row() = DataRecord(nothing)
|
||||||
blank_header_byte() = RecordHeader(false, false, 0)
|
blank_header_byte() = RecordHeader(false, false, 0)
|
||||||
|
|
||||||
@@ -140,9 +141,13 @@ function read_record_content!(f::FITFileReader, hdr::RecordHeader)::Union{Defini
|
|||||||
def_header_developer_fields = read_bytes!(f, def_header_developer_flag * 3)
|
def_header_developer_fields = read_bytes!(f, def_header_developer_flag * 3)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Associate the global message type with this local message type.
|
||||||
|
global_mesg_type = get_mesg_num_string(byte_vec_to_int(def_header_bytes[3:4]))
|
||||||
|
f.mesg_map[hdr.local_mesg_type] = global_mesg_type
|
||||||
|
|
||||||
DefinitionBody(
|
DefinitionBody(
|
||||||
def_header_bytes[2] == 0 ? "littleendian" : "bigendian",
|
def_header_bytes[2] == 0 ? "littleendian" : "bigendian",
|
||||||
get_mesg_num_string(byte_vec_to_int(def_header_bytes[3:4])),
|
global_mesg_type,
|
||||||
def_header_bytes[end]
|
def_header_bytes[end]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user