diff options
Diffstat (limited to 'ADSBDecoderFramework/Query.swift')
| -rw-r--r-- | ADSBDecoderFramework/Query.swift | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/ADSBDecoderFramework/Query.swift b/ADSBDecoderFramework/Query.swift index a92d919..0ae6212 100644 --- a/ADSBDecoderFramework/Query.swift +++ b/ADSBDecoderFramework/Query.swift @@ -7,20 +7,20 @@ import Foundation -class QueryDF: CustomStringConvertible { - +public class QueryDF: CustomStringConvertible { + //max I see is 24 var DFlist:[Int] = Array(repeating: 0, count: 30) - - init() { + + public init() { } - func addDF(_ dataformat: UInt32) { + public func addDF(_ dataformat: UInt32) { DFlist[Int(dataformat)] += 1 } - - func showStat() { + + public func showStat() { print("DataFormat Count") for i in 0...(DFlist.count)-1 { if DFlist[i] != 0 { @@ -29,7 +29,7 @@ class QueryDF: CustomStringConvertible { } } - var description: String { + public var description: String { var description = "DataFormat Count\n" for i in 0...(DFlist.count)-1 { if DFlist[i] != 0 { @@ -40,18 +40,18 @@ class QueryDF: CustomStringConvertible { } } -class QueryDF17TC: CustomStringConvertible { +public class QueryDF17TC: CustomStringConvertible { var TClist:[Int] = Array(repeating: 0, count: 32) - - init() { - + + public init() { + } - - func addTC(_ typecode: Int) { + + public func addTC(_ typecode: Int) { TClist[typecode] += 1 } - var description: String { + public var description: String { var description = "DF17 TypeCode Count\n" for i in 0...(TClist.count-1) { if TClist[i] != 0 { @@ -62,25 +62,25 @@ class QueryDF17TC: CustomStringConvertible { } } -class QueryDecodedMessages: CustomStringConvertible { - +public class QueryDecodedMessages: CustomStringConvertible { + var decoded:Int = 0 var total:Int = 0 - - init() { - + + public init() { + } - - func addDecoded() { + + public func addDecoded() { decoded += 1 total += 1 } - - func addUndecoded() { + + public func addUndecoded() { total = total + 1 } - var description: String { + public 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" @@ -90,24 +90,24 @@ class QueryDecodedMessages: CustomStringConvertible { } -class QueryDF17TC_decoded: CustomStringConvertible { +public class QueryDF17TC_decoded: CustomStringConvertible { var TClist_decoded:[Int] = Array(repeating: 0, count: 32) var TClist_total:[Int] = Array(repeating: 0, count: 32) - - init() { - + + public init() { + } - - func addDecoded(_ typecode: Int) { + + public func addDecoded(_ typecode: Int) { TClist_decoded[typecode] += 1 TClist_total[typecode] += 1 } - - func addUndecode(_ typecode: Int) { + + public func addUndecode(_ typecode: Int) { TClist_total[typecode] += 1 } - var description: String { + public var description: String { var description = "" var decoded:Int = 0 var total:Int = 0 |
