package com.its.vms.xnettcp.vms.process.service;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ConcurrentHashMap;

@Slf4j
public class ControlDeviceService {
    private static ControlDeviceService _instance = null;

    public static ControlDeviceService getInstance() {
        if (_instance == null) {
            synchronized (ControlDeviceService.class) {
                if (_instance == null)
                    _instance = new ControlDeviceService();
            }
        }
        return _instance;
    }
    public ConcurrentHashMap<Integer, Integer> rxSenseMap = null;
    public ConcurrentHashMap<Integer, Integer> txPowerMap = null;

    public ControlDeviceService() {
        this.rxSenseMap = new ConcurrentHashMap<>();
        this.txPowerMap = new ConcurrentHashMap<>();

        this.rxSenseMap.put(0x85, 81);
        this.rxSenseMap.put(0xA0, 80);
        this.rxSenseMap.put(0xA4, 79);
        this.rxSenseMap.put(0xA8, 78);
        this.rxSenseMap.put(0xAC, 77);
        this.rxSenseMap.put(0xAF, 76);
        this.rxSenseMap.put(0xB2, 75);
        this.rxSenseMap.put(0xB5, 74);
        this.rxSenseMap.put(0xB8, 73);
        this.rxSenseMap.put(0xBB, 72);
        this.rxSenseMap.put(0xBE, 71);
        this.rxSenseMap.put(0xC1, 70);
        this.rxSenseMap.put(0xC4, 69);
        this.rxSenseMap.put(0xC7, 68);
        this.rxSenseMap.put(0xCC, 67);
        this.rxSenseMap.put(0xCF, 66);
        this.rxSenseMap.put(0xD3, 65);
        this.rxSenseMap.put(0xD7, 64);
        this.rxSenseMap.put(0xDB, 63);
        this.rxSenseMap.put(0xDF, 62);
        this.rxSenseMap.put(0xE2, 61);
        this.rxSenseMap.put(0xE5, 60);
        this.rxSenseMap.put(0xE8, 59);

        this.txPowerMap.put(0xFF, 93);
        this.txPowerMap.put(0xDF, 93);
        this.txPowerMap.put(0xC8, 93);
        this.txPowerMap.put(0xB7, 93);
        this.txPowerMap.put(0xA7, 93);
        this.txPowerMap.put(0x9A, 93);
        this.txPowerMap.put(0x8F, 93);
        this.txPowerMap.put(0x85, 93);
        this.txPowerMap.put(0x7C, 92);
        this.txPowerMap.put(0x75, 92);
        this.txPowerMap.put(0x6E, 91);
        this.txPowerMap.put(0x68, 91);
        this.txPowerMap.put(0x62, 90);

    }

}
