summaryrefslogtreecommitdiff
path: root/LearnMapKit/FlighState.swift
blob: f3895cbd7b659e339b1c89b59232be0b877d1518 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
//  FlighState.swift
//  LearnMapKit
//
//  Created by Jacky Jack on 30/06/2024.
//

import Foundation
import Collections

class FlightState: ObservableObject {
    @Published var name = "Some Name"
    @Published var isEnabled = false
    var timer: Timer?
    var update_postions: Deque<ADSBLocation> = []
    var fromFile: Bool = false
    init() {
        var count = 0
        
        let ADSBtask = ADSBFileRunner(filename: "")
        timer = Timer.scheduledTimer(
            withTimeInterval: 1,
            repeats: true
        ) { _ in
            
            //queue.append(MapADSBData(lat: 0.0, long: 0.0, alt: 1))
            
            //let timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { timer in
                print("Evil object \(count)")
                //ADSBtask.runFromFile()
            self.update_postions.append(ADSBLocation(address: 0, lat: 0.0, long: 0.0))
               // print(update_postions.count)
                count += 1
            //}
        }
    }
    init(filename: String) {
        
    }
    
    func loadFromFile() {
        
    }
}