diff options
author | Arturs Artamonovs <arturs.artamonovs@protonmail.com> | 2024-06-05 09:09:36 +0100 |
---|---|---|
committer | Arturs Artamonovs <arturs.artamonovs@protonmail.com> | 2024-06-05 09:09:36 +0100 |
commit | 86c489c3c8ab1fa46fdcae022289f414f2de04cd (patch) | |
tree | fa1ec80a9b8bdbd544a5ae266c1139664d7e0cce /ADSBDecoder/Query.swift | |
parent | f400051582a005e4a64377c21866b6cc11eeaeec (diff) | |
download | ADSBDecoder-86c489c3c8ab1fa46fdcae022289f414f2de04cd.tar.gz ADSBDecoder-86c489c3c8ab1fa46fdcae022289f414f2de04cd.zip |
Decoder part
Diffstat (limited to 'ADSBDecoder/Query.swift')
-rw-r--r-- | ADSBDecoder/Query.swift | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/ADSBDecoder/Query.swift b/ADSBDecoder/Query.swift index 4906221..99d9075 100644 --- a/ADSBDecoder/Query.swift +++ b/ADSBDecoder/Query.swift @@ -6,3 +6,58 @@ // import Foundation + +class QueryDF: CustomStringConvertible { + + //max I see is 24 + var DFlist:[Int] = Array(repeating: 0, count: 30) + + init() { + + } + + func addDF(_ dataformat: UInt32) { + DFlist[Int(dataformat)] += 1 + } + + func showStat() { + print("DataFormat Count") + for i in 0...(DFlist.count)-1 { + if DFlist[i] != 0 { + print(String(format:" %02d: %05d", i, DFlist[i])) + } + } + } + + var description: String { + var description = "DataFormat Count\n" + for i in 0...(DFlist.count)-1 { + if DFlist[i] != 0 { + description += String(format:" %02d: %04d\n", i, DFlist[i]) + } + } + return description + } +} + +class QueryDF17TC: CustomStringConvertible { + var TClist:[Int] = Array(repeating: 0, count: 32) + + init() { + + } + + func addTC(_ typecode: Int) { + TClist[typecode] += 1 + } + + var description: String { + var description = "TypeCode Count\n" + for i in 0...(TClist.count-1) { + if TClist[i] != 0 { + description += String(format: " %02d: %04d\n", i, TClist[i]) + } + } + return description + } +} |