// // Query.swift // ADSBDecoder // // Created by Jacky Jack on 31/05/2024. // 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 } }