package com.pwt.netty;


import com.pwt.netty.message2.*;
import lombok.Data;
import lombok.Getter;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 站控数据
 */
@Data
public class StationUIData {

    private SystemPower systemPower = new SystemPower();

    /**
     * 换电工作模式 1 手动 2 自动
     */
    private ExchangeWorkMode exchangeWorkMode = new ExchangeWorkMode();

    private ChangeHolderInfoMessage changeHolderInfo = new ChangeHolderInfoMessage();


    private RobotInfo robot = new RobotInfo();

    private RfidInfo rfid = new RfidInfo();

    private List<BatteryHolder> batteryHolders;

    private List<Charger> chargers = new ArrayList<>();

    private List<ChargerGun> chargerGuns = new ArrayList<>();

    private Set<BatteryInfo> batteryInfos = ConcurrentHashMap.newKeySet();
    private Set<BatteryStateInfo> batteryStates = ConcurrentHashMap.newKeySet();

    /**
     * 换电状态/步骤
     */
    private ExchangeProcess exchangeState = new ExchangeProcess();

    /**
     * 车辆状态. 0 空闲 1 进站 2 已到位 3 换电中 4 换电完成 5 出站
     */
    private VehicleState vehicleState = new VehicleState();

    /**
     * 当前车辆信息, 仅进站时有值
     */
    private VehicleInfo vehicleInfo = new VehicleInfo();

    // region 统计数据, 每秒发一次
    /**
     * 运营数据(从数据库中读取)
     */
    private OperationData operationData;

    /**
     * 按来源设备类型统计的告警数
     */
    private Set<AlarmStatistics> alarmStats = ConcurrentHashMap.newKeySet();
    private AvailableBatteryStats availableBatteryStats;

    //endregion


    @Getter
    private List<GunAlarmTemplate> gunAlarms = new ArrayList<>();

    private Set<Alarm> alarms;
}
