//
//  RegisteredEca.swift
//  Sailassist
//
//  Created by 三浦薫巳 on 2023/10/27.
//

import Foundation
import CoreLocation

enum EcaState {
    case start          //ECAタスク実行開始
    case noticePass     //ECA通知円到達
    case startPass      //ECA開始円到達
    case finishPass     //ECAタスク終了円到達
    case end            //ECAタスク完了（燃料切替実施済み)
    case incomplete     //ECAタスク未完了 (燃料切替未実施で終了)
    case cancel         //ECAタスクキャンセル (タスク終了・タスク未完了前にキャンセル)
}

struct RegisteredEca {
    var id: Int = 0
    var isEnable: Bool = false      //ECA有効
    var isRunning: Bool = false     //ECA実行中
    var name: String = ""           //ECA名称
    var swNotice: Float = 6         //ECA通知[NM]
    var swStart: Float = 5          //ECA開始[NM]
    var swFinish: Float = 4         //ECA終了[NM]
    var status: EcaState = EcaState.start    //ECA状態
    var datetime: String = ""       //時刻（UTC ISO8601準拠）
    var color: String = ""          //ライン色（ARGB）
    var width: Int = 1              //ライン幅
    var points: [CLLocationCoordinate2D] = []

    init?(id: Int, ecaName: String ) {
        self.id = id
        self.name = ecaName
    }
}
