From 505b23afc68ecbb63b8f0a7d44c0b0ad063d5cfd Mon Sep 17 00:00:00 2001 From: Arturs Artamonovs Date: Thu, 24 Sep 2026 11:02:35 +0100 Subject: rearrange source, move common parts to framework --- ADSBDecoder/Query.swift | 126 ------------------------------------------------ 1 file changed, 126 deletions(-) delete mode 100644 ADSBDecoder/Query.swift (limited to 'ADSBDecoder/Query.swift') diff --git a/ADSBDecoder/Query.swift b/ADSBDecoder/Query.swift deleted file mode 100644 index a92d919..0000000 --- a/ADSBDecoder/Query.swift +++ /dev/null @@ -1,126 +0,0 @@ -// -// 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 = "DF17 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 - } -} - -class QueryDecodedMessages: CustomStringConvertible { - - var decoded:Int = 0 - var total:Int = 0 - - init() { - - } - - func addDecoded() { - decoded += 1 - total += 1 - } - - func addUndecoded() { - total = total + 1 - } - - var description: String { - var description = "Total messages:\n" - description += "Decoded:\(decoded)\n" - description += "Total :\(total) \(String(format:"%02.01f",Float(Float(decoded)/Float(total)*100.0)))%\n" - return description - } - -} - - -class QueryDF17TC_decoded: CustomStringConvertible { - var TClist_decoded:[Int] = Array(repeating: 0, count: 32) - var TClist_total:[Int] = Array(repeating: 0, count: 32) - - init() { - - } - - func addDecoded(_ typecode: Int) { - TClist_decoded[typecode] += 1 - TClist_total[typecode] += 1 - } - - func addUndecode(_ typecode: Int) { - TClist_total[typecode] += 1 - } - - var description: String { - var description = "" - var decoded:Int = 0 - var total:Int = 0 - for i in 0...(TClist_decoded.count-1) { - total += TClist_total[i] - decoded += TClist_decoded[i] - if TClist_total[i] != 0 { - description += String(format: " %02d: %04d\n", i, TClist_decoded[i]) - } - } - description += String(format:"Total %d/%d %.1f",decoded,total,Double(Double(decoded)/Double(total))*100) - description += "%\n" - return description - } -} - -- cgit v1.2.3