summaryrefslogtreecommitdiff
path: root/ADSBDecoder/Query.swift
diff options
context:
space:
mode:
Diffstat (limited to 'ADSBDecoder/Query.swift')
-rw-r--r--ADSBDecoder/Query.swift55
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
+ }
+}