package com.bonait.bnframework.common.constant;

import android.app.Application;
import android.content.Context;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;

import com.bonait.bnframework.HBL.Unity;
import com.bonait.bnframework.R;
import com.bonait.bnframework.common.db.mode.BPA_PLCADDRESS;
import com.bonait.bnframework.common.db.mode.BPA_SILOS;
import com.bonait.bnframework.common.db.mode.BPA_USER;
import com.bonait.bnframework.common.db.mode.Res_PLCADDRESS;
import com.bonait.bnframework.common.db.res.Res_PLCADDRESS1;
import com.bonait.bnframework.common.db.res.Res_ZDSF;
import com.bonait.bnframework.common.db.res.StatusMode;
import com.bonait.bnframework.common.model.AddrType;
import com.bonait.bnframework.common.model.mode.CloudGood;
import com.bonait.bnframework.common.model.mode.DeviceInformation;
import com.bonait.bnframework.common.model.mode.OrganizeMode;
import com.bonait.bnframework.common.model.mode.ProcessT;
import com.bonait.bnframework.common.model.mode.ResALLData;
import com.bonait.bnframework.common.model.mode.ResSilosModel;
import com.bonait.bnframework.common.model.mode.VersionSelectionEnum;
import com.bonait.bnframework.common.utils.ScreenUtils;
import com.bonait.bnframework.modules.home.adapter.FragmentAdapter;
import com.bonait.bnframework.modules.home.fragment.DingDanfragment;
import com.bonait.bnframework.modules.home.fragment.GongnengFragment;
import com.bonait.bnframework.modules.home.fragment.GuanLifragment;
import com.bonait.bnframework.modules.home.fragment.JiaoYanFragment;
import com.bonait.bnframework.modules.home.fragment.MakeGoodFragment;
import com.bonait.bnframework.modules.home.fragment.SheZhifragment;
import com.bonait.bnframework.modules.mine.fragment.MyFragment;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


/**
 * 配置文件
 */
public class ConfigName {
    public static final boolean TEST = true;
    //region 单例模式
    private static ConfigName mInstance; //实例变量设置私有，防止直接通过类名访问

    private ConfigName() { //默认构造函数私有，防止类外直接new创建对象
    }

    public static synchronized ConfigName getInstance() { //静态同步方法作为唯一的实例对象获取方式
        if (mInstance == null) {
            mInstance = new ConfigName();
        }
        return mInstance;
    }
    //endregion

    //region 程序进入界面
    public Context dishesCon;
    public Application app;
    public boolean IsPortraitScreen = true;//是否竖屏
    //endregion

    //region SD卡路径设置
    /**
     * SD卡路径
     */
    public String sdCardPath;
    /**
     * 应用程序 Res 根路径
     */
    public String appResRoot;
    /**
     * Db文件路径
     */
    public static String dbPath = "";
    //endregion

    //region 店铺配置
    /**
     * 店铺名称
     */
    public String Shop_Name = "黑菠萝奶茶机";
    /**
     * 门店Id
     */
    public String ClientAutoKey = "79";
    /**
     * 店铺设备号
     */
    public String DeviceAutoKey = "159";
    /**
     * 设备id
     */
    public String DeviceId = "未知";
    //endregion

    //region MQTT配置中心
    /**
     * 用户名
     */
    public String mqtt_userName = "emqx_u_block";
    /**
     * 密码
     */
    public String mqtt_passWord = "emqx_p_admin8765490789";
    /**
     * ip地址
     */
    public String mqtt_ip = "10.2.1.21";
    /**
     * post端口
     */
    public int mqtt_post = 1883;
    /**
     * 订阅主题
     */
    public String mqtt_topic = "DOWN/MORKT/BUSINESS/";
    public String mqtt_hearttopic = "UP/MORKT/HEARTBEAT";
    //endregion

    //region 环境配置
    /**
     * 环境配置
     */
    public String Environment = "开发环境";
    //endregion

    //region 登录信息
    /**
     * 用户信息
     */
    public BPA_USER user = new BPA_USER();
    //endregion

    //region 组织信息
    /**
     * 组织信息
     */
    public OrganizeMode organizeMode = null;
    /**
     * 设备信息
     */
    public DeviceInformation deviceInformation = null;
    //endregion

    //region 版本信息
    /**
     * 版本更新，当前版本
     */
    public String Version = "1.0";
    //endregion


    //region 是否手动下单
    /**
     * 是否手动下单
     */
    public Boolean IsUserDownOrder = false;
    //endregion

    //region PlC连接参数
    /**
     * Plc是否连接
     */
    public boolean PlcIsConnect = false;
    /**
     * Plc地址
     */
    public String Address = "192.168.1.100";
    /**
     * Plc端口
     */
    public int Post = 502;
    //endregion

    //region URL
    //Sass地址
    public String SaasAddress = "http://order.test1.com";
    //public String SaasAddress="https://bpa.black-pa.com:21527";
    //public String SaasAddress="https://witt.black-pa.com";
    //获取店铺详细信息 Get
    public String GetStore = "kitchen/api/StoreHelper/GetStoreInfoById?storeId=";
    //获取设备信息分页 Get
    public String GetDeviceInformation = "kitchen/api/CommInteface/GetDeviceInfo?storeId=%s&autoKey=%s";


    //获取 获取基础信息（所有物料信息、设备工序模型、菜谱列表、商品小类、商品大类、单位数据
    public String GetBaseDataModel = "kitchen/api/CommInteface/GetBaseDataModel?storeId=%s&autoKey=%s";
    //获取 商品
    public String GetGoods = "kitchen/api/CommInteface/GetDeviceGood?storeId=%s&deviceId=%s";
    //获取商品配方信息
    public String GetGoodsBom = "kitchen/api/CommInteface/GetDeviceGoodBomTechnology?goodsId=%s";
    //上传商品
    public String UpdateGoods = "kitchen/api/CommInteface/SendGoodsInfo";
    //版本更新
    public String UpdateVersion = "http://111.9.47.105:18097/api/Version/GetLatest";
    //endregion

    //region PLC地址配置
    /**
     * PLC地址，从数据库-->内存
     */
    public static ConcurrentHashMap<String, BPA_PLCADDRESS> PLC_Address = new ConcurrentHashMap<String, BPA_PLCADDRESS>();

    /**
     * 奶茶机基础PLC模型
     */
    public List<Res_PLCADDRESS> PlcAddress_味魔方 = new ArrayList<Res_PLCADDRESS>() {{

        //通道校准
        add(new Res_PLCADDRESS("基础控制", "-------------", 0, 0));
        add(new Res_PLCADDRESS("料仓1", "M5.0", 1, 1));
        add(new Res_PLCADDRESS("料仓2", "M5.0", 1, 1));
        add(new Res_PLCADDRESS("料仓3", "M5.0", 1, 1));
        add(new Res_PLCADDRESS("料仓4", "M5.0", 1, 1));
        add(new Res_PLCADDRESS("料仓5", "M5.0", 1, 1));
        add(new Res_PLCADDRESS("料仓6", "M5.0", 1, 1));
        add(new Res_PLCADDRESS("料仓7", "M5.0", 1, 1));
        add(new Res_PLCADDRESS("料仓8", "M5.0", 1, 1));
        add(new Res_PLCADDRESS("料仓9", "M5.0", 1, 1));
        add(new Res_PLCADDRESS("料仓10", "M5.0", 1, 1));
        add(new Res_PLCADDRESS("料仓11", "M5.0", 1, 1));
        add(new Res_PLCADDRESS("料仓12", "M5.0", 1, 1));
        add(new Res_PLCADDRESS("料仓13", "M5.0", 1, 1));
        add(new Res_PLCADDRESS("料仓14", "M5.0", 1, 1));
    }};
    /**
     * 奶茶机料仓模型
     */
    public List<ResSilosModel> Silos_味魔方 = new ArrayList<ResSilosModel>() {{
        add(new ResSilosModel("粉料仓",1 , 1  ));
        add(new ResSilosModel("粉料仓",2 , 2  ));
        add(new ResSilosModel("粉料仓",3 , 3  ));
        add(new ResSilosModel("粉料仓",4 , 4  ));
        add(new ResSilosModel("粉料仓",5 , 5  ));
        add(new ResSilosModel("粉料仓",6 , 6  ));
        add(new ResSilosModel("外置仓",7 , 7  ));
        add(new ResSilosModel("外置仓",8 , 8  ));
        add(new ResSilosModel("外置仓",9 , 9  ));
        add(new ResSilosModel("外置仓",10, 10));
        add(new ResSilosModel("外置仓",11, 11));
        add(new ResSilosModel("外置仓",12, 12));
        add(new ResSilosModel("外置仓",13, 13));
        add(new ResSilosModel("外置仓",14, 14));

    }};


    /**
     * 奶茶机基础PLC模型
     */
    public List<Res_PLCADDRESS> PlcAddress_奶茶机 = new ArrayList<Res_PLCADDRESS>() {{

        //通道校准
        add(new Res_PLCADDRESS("通道校准", "-------------", 0, 0));
        add(new Res_PLCADDRESS("校准值1", "VW0", 1, 1));
        add(new Res_PLCADDRESS("校准值2", "VW2", 1, 1));
        add(new Res_PLCADDRESS("校准值3", "VW4", 1, 1));
        add(new Res_PLCADDRESS("校准值4", "VW6", 1, 1));
        add(new Res_PLCADDRESS("校准值5", "VW8", 1, 1));
        add(new Res_PLCADDRESS("校准值6", "VW10", 1, 1));
        add(new Res_PLCADDRESS("校准值7", "VW12", 1, 1));
        add(new Res_PLCADDRESS("校准值8", "VW14", 1, 1));
        add(new Res_PLCADDRESS("校准值9", "VW16", 1, 1));
        add(new Res_PLCADDRESS("校准值10", "VW18", 1, 1));
        add(new Res_PLCADDRESS("校准值11", "VW20", 1, 1));
        add(new Res_PLCADDRESS("校准值12", "VW22", 1, 1));
        add(new Res_PLCADDRESS("校准值13", "VW24", 1, 1));
        add(new Res_PLCADDRESS("校准值14", "VW26", 1, 1));
        add(new Res_PLCADDRESS("校准值15", "VW28", 1, 1));
        add(new Res_PLCADDRESS("校准值16", "VW30", 1, 1));
        add(new Res_PLCADDRESS("校准值17", "VW32", 1, 1));
        add(new Res_PLCADDRESS("校准值18", "VW34", 1, 1));
        add(new Res_PLCADDRESS("校准值19", "VW36", 1, 1));
        add(new Res_PLCADDRESS("校准值20", "VW38", 1, 1));

        add(new Res_PLCADDRESS("通道1校准开关", "M2.0", 1, 1));
        add(new Res_PLCADDRESS("通道2校准开关", "M2.1", 1, 1));
        add(new Res_PLCADDRESS("通道3校准开关", "M2.2", 1, 1));
        add(new Res_PLCADDRESS("通道4校准开关", "M2.3", 1, 1));
        add(new Res_PLCADDRESS("通道5校准开关", "M2.4", 1, 1));
        add(new Res_PLCADDRESS("通道6校准开关", "M2.5", 1, 1));
        add(new Res_PLCADDRESS("通道7校准开关", "M2.6", 1, 1));
        add(new Res_PLCADDRESS("通道8校准开关", "M2.7", 1, 1));
        add(new Res_PLCADDRESS("通道9校准开关", "M3.0", 1, 1));
        add(new Res_PLCADDRESS("通道10校准开关", "M3.1", 1, 1));
        add(new Res_PLCADDRESS("通道11校准开关", "M3.2", 1, 1));
        add(new Res_PLCADDRESS("通道12校准开关", "M3.3", 1, 1));
        add(new Res_PLCADDRESS("通道13校准开关", "M3.4", 1, 1));
        add(new Res_PLCADDRESS("通道14校准开关", "M3.5", 1, 1));
        add(new Res_PLCADDRESS("通道15校准开关", "M3.6", 1, 1));
        add(new Res_PLCADDRESS("通道16校准开关", "M3.7", 1, 1));
        add(new Res_PLCADDRESS("通道17校准开关", "M4.0", 1, 1));
        add(new Res_PLCADDRESS("通道18校准开关", "M4.1", 1, 1));
        add(new Res_PLCADDRESS("通道19校准开关", "M4.2", 1, 1));
        add(new Res_PLCADDRESS("通道20校准开关", "M4.3", 1, 1));

        add(new Res_PLCADDRESS("配料次数", "VD90", 1, 1));
        //add(new Res_PLCADDRESS("反转时间", "VW94", 1, 1));//pl
        add(new Res_PLCADDRESS("基准时间", "VW96", 1, 1));
        //add(new Res_PLCADDRESS("基准时间", "VW98", 1, 1));

        add(new Res_PLCADDRESS("通道校准", "M0.0", 0, 1));
        add(new Res_PLCADDRESS("校准完成", "M0.7", 1, 0));

//        add(new Res_PLCADDRESS("出料系数1", "VR400", 1, 1));
//        add(new Res_PLCADDRESS("出料系数2", "VR404", 1, 1));
//        add(new Res_PLCADDRESS("出料系数3", "VR408", 1, 1));
//        add(new Res_PLCADDRESS("出料系数4", "VR412", 1, 1));
//        add(new Res_PLCADDRESS("出料系数5", "VR416", 1, 1));
//        add(new Res_PLCADDRESS("出料系数6", "VR420", 1, 1));
//        add(new Res_PLCADDRESS("出料系数7", "VR424", 1, 1));
//        add(new Res_PLCADDRESS("出料系数8", "VR428", 1, 1));
//        add(new Res_PLCADDRESS("出料系数9", "VR432", 1, 1));
//        add(new Res_PLCADDRESS("出料系数10", "VR436", 1, 1));
//        add(new Res_PLCADDRESS("出料系数11", "VR440", 1, 1));
//        add(new Res_PLCADDRESS("出料系数12", "VR444", 1, 1));
//        add(new Res_PLCADDRESS("出料系数13", "VR448", 1, 1));
//        add(new Res_PLCADDRESS("出料系数14", "VR452", 1, 1));
//        add(new Res_PLCADDRESS("出料系数15", "VR456", 1, 1));
//        add(new Res_PLCADDRESS("出料系数16", "VR460", 1, 1));
//        add(new Res_PLCADDRESS("出料系数17", "VR464", 1, 1));
//        add(new Res_PLCADDRESS("出料系数18", "VR468", 1, 1));
//        add(new Res_PLCADDRESS("出料系数19", "VR472", 1, 1));
//        add(new Res_PLCADDRESS("出料系数20", "VR476", 1, 1));

        //模拟出料
        add(new Res_PLCADDRESS("模拟出料", "-------------", 0, 0));
        add(new Res_PLCADDRESS("需求值1", "VW100", 1, 1));
        add(new Res_PLCADDRESS("需求值2", "VW102", 1, 1));
        add(new Res_PLCADDRESS("需求值3", "VW104", 1, 1));
        add(new Res_PLCADDRESS("需求值4", "VW106", 1, 1));
        add(new Res_PLCADDRESS("需求值5", "VW108", 1, 1));
        add(new Res_PLCADDRESS("需求值6", "VW110", 1, 1));
        add(new Res_PLCADDRESS("需求值7", "VW112", 1, 1));
        add(new Res_PLCADDRESS("需求值8", "VW114", 1, 1));
        add(new Res_PLCADDRESS("需求值9", "VW116", 1, 1));
        add(new Res_PLCADDRESS("需求值10", "VW118", 1, 1));
        add(new Res_PLCADDRESS("需求值11", "VW120", 1, 1));
        add(new Res_PLCADDRESS("需求值12", "VW122", 1, 1));
        add(new Res_PLCADDRESS("需求值13", "VW124", 1, 1));
        add(new Res_PLCADDRESS("需求值14", "VW126", 1, 1));
        add(new Res_PLCADDRESS("需求值15", "VW128", 1, 1));
        add(new Res_PLCADDRESS("需求值16", "VW130", 1, 1));
        add(new Res_PLCADDRESS("需求值17", "VW132", 1, 1));
        add(new Res_PLCADDRESS("需求值18", "VW134", 1, 1));
        add(new Res_PLCADDRESS("需求值19", "VW136", 1, 1));
        add(new Res_PLCADDRESS("需求值20", "VW138", 1, 1));
        add(new Res_PLCADDRESS("配料启动", "M0.1", 0, 1));
        add(new Res_PLCADDRESS("手自切换", "M0.2", 1, 1));
        add(new Res_PLCADDRESS("配料完成", "M0.3", 1, 0));
        add(new Res_PLCADDRESS("按钮启动", "M0.5", 1, 0));

        //出料算法补偿
        add(new Res_PLCADDRESS("出料算法补偿", "-------------", 0, 0));
        add(new Res_PLCADDRESS("低系数1", "VW44", 1, 1));
        add(new Res_PLCADDRESS("低系数2", "VW46", 1, 1));
        add(new Res_PLCADDRESS("低系数3", "VW48", 1, 1));
        add(new Res_PLCADDRESS("低系数4", "VW50", 1, 1));
        add(new Res_PLCADDRESS("低系数5", "VW52", 1, 1));
        add(new Res_PLCADDRESS("低系数6", "VW54", 1, 1));

        add(new Res_PLCADDRESS("高系数1", "VW144", 1, 1));
        add(new Res_PLCADDRESS("高系数2", "VW146", 1, 1));
        add(new Res_PLCADDRESS("高系数3", "VW148", 1, 1));
        add(new Res_PLCADDRESS("高系数4", "VW150", 1, 1));
        add(new Res_PLCADDRESS("高系数5", "VW152", 1, 1));
        add(new Res_PLCADDRESS("高系数6", "VW154", 1, 1));


        add(new Res_PLCADDRESS("补偿1时间", "VW168", 1, 1));
        add(new Res_PLCADDRESS("补偿2时间", "VW170", 1, 1));
        add(new Res_PLCADDRESS("补偿3时间", "VW172", 1, 1));
        add(new Res_PLCADDRESS("补偿4时间", "VW174", 1, 1));
        add(new Res_PLCADDRESS("补偿5时间", "VW176", 1, 1));
        add(new Res_PLCADDRESS("补偿6时间", "VW178", 1, 1));

        add(new Res_PLCADDRESS("通道1补偿开关", "VW194.0", 1, 1));
        add(new Res_PLCADDRESS("通道2补偿开关", "VW194.1", 1, 1));
        add(new Res_PLCADDRESS("通道3补偿开关", "VW194.2", 1, 1));
        add(new Res_PLCADDRESS("通道4补偿开关", "VW194.3", 1, 1));
        add(new Res_PLCADDRESS("通道5补偿开关", "VW194.4", 1, 1));
        add(new Res_PLCADDRESS("通道6补偿开关", "VW194.5", 1, 1));

        //电子秤校验
        add(new Res_PLCADDRESS("电子秤校验", "-------------", 0, 0));
        add(new Res_PLCADDRESS("称当前重量", "VD344", 1, 0));
        add(new Res_PLCADDRESS("砝码值", "VW94", 1, 1));
        //add(new Res_PLCADDRESS("砝码值", "VW96", 1, 1));
        add(new Res_PLCADDRESS("砝码校准模式", "M1.0", 1, 1));
        add(new Res_PLCADDRESS("重量清零", "M1.1", 0, 1));
        add(new Res_PLCADDRESS("关闭写保护", "M1.2", 0, 1));
        add(new Res_PLCADDRESS("零点校准", "M1.3", 0, 1));
        add(new Res_PLCADDRESS("砝码值写入", "M1.4", 0, 1));
        add(new Res_PLCADDRESS("打开写保护", "M1.5", 0, 1));

        //温度监控
        add(new Res_PLCADDRESS("温度控制", "-------------", 0, 0));
        add(new Res_PLCADDRESS("果糖左温度", "VD354", 1, 0));
        add(new Res_PLCADDRESS("果糖左温度设置", "VD378", 1, 1));
        add(new Res_PLCADDRESS("果糖左温度加热", "M103.7", 1, 0));

        add(new Res_PLCADDRESS("果糖右温度", "VD358", 1, 0));
        add(new Res_PLCADDRESS("果糖右温度设置", "VD382", 1, 1));
        add(new Res_PLCADDRESS("果糖右温度加热", "M104.0", 1, 0));

        add(new Res_PLCADDRESS("水池温度", "VD362", 1, 0));
        add(new Res_PLCADDRESS("水池温度设置", "VD386", 1, 1));
        add(new Res_PLCADDRESS("水池温度加热", "M104.1", 1, 0));

//        add(new Res_PLCADDRESS("水池温度", "VD352", 1, 0));
//        add(new Res_PLCADDRESS("水池温度设置", "VD360", 1, 1));
//        add(new Res_PLCADDRESS("水池温度加热", "M104.0", 1, 0));

        //自动清洗
        add(new Res_PLCADDRESS("自动清洗", "-------------", 0, 0));
        add(new Res_PLCADDRESS("排水阀排水时间", "VW244", 1, 1));
        add(new Res_PLCADDRESS("循环清洗时间", "VW246", 1, 1));
        add(new Res_PLCADDRESS("加热时间", "VW248", 1, 1));
        add(new Res_PLCADDRESS("自动补水延迟时间", "VW250", 1, 1));


        add(new Res_PLCADDRESS("清洗模式", "M0.4", 1, 1));
        add(new Res_PLCADDRESS("自动清洗开始", "M0.5", 1, 1));
        add(new Res_PLCADDRESS("自动清洗完成", "M0.6", 1, 1));
        add(new Res_PLCADDRESS("清洗状态", "M1.6", 1, 0));


        //手动控制
        add(new Res_PLCADDRESS("手动控制", "-------------", 0, 0));
        add(new Res_PLCADDRESS("手动控制1", "M50.0", 1, 1));
        add(new Res_PLCADDRESS("手动控制2", "M50.1", 1, 1));
        add(new Res_PLCADDRESS("手动控制3", "M50.2", 1, 1));
        add(new Res_PLCADDRESS("手动控制4", "M50.3", 1, 1));
        add(new Res_PLCADDRESS("手动控制5", "M50.4", 1, 1));
        add(new Res_PLCADDRESS("手动控制6", "M50.5", 1, 1));
        add(new Res_PLCADDRESS("手动控制7", "M50.6", 1, 1));
        add(new Res_PLCADDRESS("手动控制8", "M50.7", 1, 1));
        add(new Res_PLCADDRESS("手动控制9", "M51.0", 1, 1));
        add(new Res_PLCADDRESS("手动控制10", "M51.1", 1, 1));
        add(new Res_PLCADDRESS("手动控制11", "M51.2", 1, 1));
        add(new Res_PLCADDRESS("手动控制12", "M51.3", 1, 1));
        add(new Res_PLCADDRESS("M_清洗液泵", "M51.4", 1, 1));

        add(new Res_PLCADDRESS("M_排水阀开", "M53.4", 1, 1));
        add(new Res_PLCADDRESS("M_排水阀关", "M53.5", 1, 1));
        add(new Res_PLCADDRESS("M_进水开关", "M53.6", 1, 1));
        add(new Res_PLCADDRESS("M_果糖1加热", "M53.7", 1, 1));
        add(new Res_PLCADDRESS("M_果糖2加热", "M54.0", 1, 1));
        add(new Res_PLCADDRESS("M_清洗加热", "M54.1", 1, 1));

//        add(new Res_PLCADDRESS("M_外置仓1正转", "M50.0", 1, 1));
//        add(new Res_PLCADDRESS("M_外置仓2正转", "M50.1", 1, 1));
//        add(new Res_PLCADDRESS("M_外置仓3正转", "M50.2", 1, 1));
//        add(new Res_PLCADDRESS("M_外置仓4正转", "M50.3", 1, 1));
//        add(new Res_PLCADDRESS("M_外置仓5正转", "M50.4", 1, 1));
//        add(new Res_PLCADDRESS("M_外置仓6正转", "M50.5", 1, 1));
//        add(new Res_PLCADDRESS("M_外置仓1反转", "M50.6", 1, 1));
//        add(new Res_PLCADDRESS("M_外置仓2反转", "M50.7", 1, 1));
//        add(new Res_PLCADDRESS("M_外置仓3反转", "M51.0", 1, 1));
//        add(new Res_PLCADDRESS("M_外置仓4反转", "M51.1", 1, 1));
//        add(new Res_PLCADDRESS("M_外置仓5反转", "M51.2", 1, 1));
//        add(new Res_PLCADDRESS("M_外置仓6反转", "M51.3", 1, 1));
//        add(new Res_PLCADDRESS("M_粉料通道1", "M51.4", 1, 1));
//        add(new Res_PLCADDRESS("M_粉料通道2", "M51.5", 1, 1));
//        add(new Res_PLCADDRESS("M_粉料通道3", "M51.6", 1, 1));
//        add(new Res_PLCADDRESS("M_酱油通道", "M51.7", 1, 1));
//        add(new Res_PLCADDRESS("M_醋通道", "M52.0", 1, 1));
//        add(new Res_PLCADDRESS("M_猪油通道", "M52.1", 1, 1));
//        add(new Res_PLCADDRESS("M_牛油通道", "M52.2", 1, 1));
//
//        add(new Res_PLCADDRESS("M_保温池进水阀", "M53.4", 1, 1));
//        add(new Res_PLCADDRESS("M_保温池排水阀", "M53.5", 1, 1));
//        add(new Res_PLCADDRESS("M_猪油管道保温", "M53.6", 1, 1));
//        add(new Res_PLCADDRESS("M_牛油管道保温", "M53.7", 1, 1));
//        add(new Res_PLCADDRESS("M_保温池加热", "M54.0", 1, 1));
//        add(new Res_PLCADDRESS("M_三色灯-绿", "M54.1", 1, 1));
//        add(new Res_PLCADDRESS("M_三色灯-红", "M54.2", 1, 1));

        add(new Res_PLCADDRESS("扫码数据读取", "-------------", 0, 0));
        add(new Res_PLCADDRESS("扫码数据", "VW702", 1, 0));

        add(new Res_PLCADDRESS("实时状态读取", "-------------", 0, 0));
        add(new Res_PLCADDRESS("实时状态", "VW500", 1, 0));

        add(new Res_PLCADDRESS("水池液位检测", "M5.2", 1, 0));
        add(new Res_PLCADDRESS("出料口检测", "M5.3", 1, 0));

        add(new Res_PLCADDRESS("水池进水阀", "M103.6", 1, 1));
        add(new Res_PLCADDRESS("水池排水阀-开", "M103.4", 1, 1));
        add(new Res_PLCADDRESS("水池排水阀-关", "M103.5", 1, 1));

        add(new Res_PLCADDRESS("管道自动排水", "M5.4", 1, 1));
        add(new Res_PLCADDRESS("管道自动排水完成", "M5.5", 1, 1));
    }};
    /**
     * 奶茶机料仓模型
     */
    public List<ResSilosModel> Silos_奶茶机 = new ArrayList<ResSilosModel>() {{
        add(new ResSilosModel("液体仓",1 , 1  ));
        add(new ResSilosModel("液体仓",2 , 2  ));
        add(new ResSilosModel("液体仓",3 , 3  ));
        add(new ResSilosModel("液体仓",4 , 4  ));
        add(new ResSilosModel("液体仓",5 , 5  ));
        add(new ResSilosModel("液体仓",6 , 6  ));
        add(new ResSilosModel("液体仓",7 , 7  ));
        add(new ResSilosModel("液体仓",8 , 8  ));
        add(new ResSilosModel("液体仓",9 , 9  ));
        add(new ResSilosModel("液体仓",10, 10));
        add(new ResSilosModel("果糖仓",11, 11));
        add(new ResSilosModel("果糖仓",12, 12));
    }};

    /**
     * 大炒基础PLC模型
     */
    public List<Res_PLCADDRESS1> PlcAddress_奶茶机_手动=new ArrayList<Res_PLCADDRESS1>(){{

        //硬件设备 初始化
        add(new Res_PLCADDRESS1("-------------","","加热开关控制",1,0));
        add(new Res_PLCADDRESS1("M53.7","M103.7","果糖仓加热(左)",1,1));
        add(new Res_PLCADDRESS1("M54.0","M104.0","果糖仓加热(右)",1,1));
        add(new Res_PLCADDRESS1("M54.1","M104.1","清洗池加热",1,1));
        add(new Res_PLCADDRESS1("-------------","","果糖仓泵/清洗池泵",1,0));
        add(new Res_PLCADDRESS1("M53.6","M103.6","进水阀",1,1));
        add(new Res_PLCADDRESS1("M53.4","M103.4","排水阀(开)",1,1));
        add(new Res_PLCADDRESS1("M53.5","M103.5","排水阀(关)",1,1));
        add(new Res_PLCADDRESS1("M51.4","M101.4","清洗池泵",1,1));
        add(new Res_PLCADDRESS1("M51.2","M101.2","果糖泵(左)",1,1));
        add(new Res_PLCADDRESS1("M51.3","M101.3","果糖泵(右)",1,1));
        add(new Res_PLCADDRESS1("-------------","","蠕动泵控制",1,0));
        add(new Res_PLCADDRESS1("M50.0","M100.0","蠕动泵(一)",1,1));
        add(new Res_PLCADDRESS1("M50.1","M100.1","蠕动泵(二)",1,1));
        add(new Res_PLCADDRESS1("M50.2","M100.2","蠕动泵(三)",1,1));
        add(new Res_PLCADDRESS1("M50.3","M100.3","蠕动泵(四)",1,1));
        add(new Res_PLCADDRESS1("M50.4","M100.4","蠕动泵(五)",1,1));
        add(new Res_PLCADDRESS1("-------------","","隔膜泵控制",1,0));
        add(new Res_PLCADDRESS1("M50.5","M100.5","隔膜泵(一)",1,1));
        add(new Res_PLCADDRESS1("M50.6","M100.6","隔膜泵(二)",1,1));
        add(new Res_PLCADDRESS1("M50.7","M100.7","隔膜泵(三)",1,1));
        add(new Res_PLCADDRESS1("M51.0","M101.0","隔膜泵(四)",1,1));
        add(new Res_PLCADDRESS1("M51.1","M101.1","隔膜泵(五)",1,1));

    }};




    /**
     * 配料吧台基础PLC模型
     */
    public List<Res_PLCADDRESS> PlcAddress_配料吧台 = new ArrayList<Res_PLCADDRESS>() {{

        add(new Res_PLCADDRESS("配料信号", "-------------", 0, 0));
        add(new Res_PLCADDRESS("配料启动", "M0.0", 0, 1));
        add(new Res_PLCADDRESS("配料完成", "M0.3", 1, 1));
        add(new Res_PLCADDRESS("按钮配料启动", "I0.0", 1, 0));
        add(new Res_PLCADDRESS("清洗模式", "M1.0", 0, 1));

        add(new Res_PLCADDRESS("外置仓", "-------------", 0, 0));
        for (int i=1;i<=5;i++){
            add(new Res_PLCADDRESS("外置仓"+i+"出料时间", "VW"+(98+(i*2)), 0, 1));
            add(new Res_PLCADDRESS("外置仓"+i+"启停控制", "M10."+(i-1), 1, 1));
        }

        add(new Res_PLCADDRESS("加热仓", "-------------", 0, 0));
        add(new Res_PLCADDRESS("加热仓16出料时间", "VW110", 0, 1));
        add(new Res_PLCADDRESS("加热仓16启停控制", "M10.5", 1, 1));
        add(new Res_PLCADDRESS("加热仓17出料时间", "VW112", 0, 1));
        add(new Res_PLCADDRESS("加热仓17启停控制", "M10.6", 1, 1));

        add(new Res_PLCADDRESS("粉料仓", "-------------", 0, 0));
        for (int i=1;i<=6;i++){
            add(new Res_PLCADDRESS("粉料仓"+(i+5)+"出料时间", "VW"+(112+(i*2)), 0, 1));
            add(new Res_PLCADDRESS("粉料仓"+(i+5)+"启停控制", Unity.GetSiemensBitSingleAdd("M",7+i,10), 1, 1));
        }

        add(new Res_PLCADDRESS("液体仓", "-------------", 0, 0));
        for (int i=1;i<=4;i++){
            add(new Res_PLCADDRESS("液体仓"+(i+11)+"出料时间", "VW"+(124+(i*2)), 0, 1));
            add(new Res_PLCADDRESS("液体仓"+(i+11)+"启停控制", Unity.GetSiemensBitSingleAdd("M",5+i,11), 1, 1));
        }

        add(new Res_PLCADDRESS("备用仓", "-------------", 0, 0));
        for (int i=1;i<=9;i++){
            add(new Res_PLCADDRESS("备用仓"+i+"出料时间", "VW"+(132+(i*2)), 0, 1));
            add(new Res_PLCADDRESS("备用仓"+i+"启停控制", Unity.GetSiemensBitSingleAdd("M",1+i,12), 1, 1));
        }

        //电子秤校验
        add(new Res_PLCADDRESS("电子秤", "-------------", 0, 0));
        add(new Res_PLCADDRESS("称当前重量", "VW82", 1, 0));
        add(new Res_PLCADDRESS("砝码值", "VW86", 1, 1));
        add(new Res_PLCADDRESS("重量清零", "M20.0", 0, 1));
        add(new Res_PLCADDRESS("校准模式", "M20.1", 0, 1));
        add(new Res_PLCADDRESS("关闭写保护", "M20.2", 0, 1));
        add(new Res_PLCADDRESS("零点校准", "M20.3", 0, 1));
        add(new Res_PLCADDRESS("砝码值写入", "M20.4", 0, 1));
        add(new Res_PLCADDRESS("打开写保护", "M20.5", 0, 1));

        add(new Res_PLCADDRESS("其它数据", "-------------", 0, 0));
        add(new Res_PLCADDRESS("扫码数据", "VW2", 1, 0));
        add(new Res_PLCADDRESS("掉线标志", "M100.0", 1, 1));
        add(new Res_PLCADDRESS("心跳", "M100.1", 1, 1));
    }};
    /**
     * 配料吧台料仓模型
     */
    public List<ResSilosModel> Silos_配料吧台 = new ArrayList<ResSilosModel>() {{

        int num=0;
        for(int i=1;i<=5;i++){
            num++;
            add(new ResSilosModel("外置仓",num , num  ));
        }

        for(int i=1;i<=6;i++){
            num++;
            add(new ResSilosModel("粉料仓",num, num  ));
        }

        for(int i=1;i<=4;i++){
            num++;
            add(new ResSilosModel("液体仓",num, num  ));
        }

        for(int i=1;i<=2;i++){
            num++;
            add(new ResSilosModel("加热仓",num, num  ));
        }
    }};

    /**
     * 配料吧台PLC模型
     */
    public List<Res_PLCADDRESS1> PlcAddress_配料吧台_手动=new ArrayList<Res_PLCADDRESS1>(){{

        //硬件设备 初始化
        add(new Res_PLCADDRESS1("-------------","","酱油仓/猪油仓",1,0));
        add(new Res_PLCADDRESS1("M51.7","M101.7","酱油仓控制",0,1));
        add(new Res_PLCADDRESS1("M52.0","M102.0","醋仓控制",0,1));
        add(new Res_PLCADDRESS1("M52.1","M102.1","猪油仓控制",0,1));
        add(new Res_PLCADDRESS1("M52.2","M102.2","牛油仓控制",0,1));
        add(new Res_PLCADDRESS1("M53.6","M103.6","猪油管道保温",1,1));
        add(new Res_PLCADDRESS1("M53.7","M103.7","牛油管道保温",1,1));
        add(new Res_PLCADDRESS1("-------------","","外置仓",1,0));
        add(new Res_PLCADDRESS1("M50.0","M100.0","外置仓正转(1)",1,1));
        add(new Res_PLCADDRESS1("M50.1","M100.1","外置仓正转(2)",1,1));
        add(new Res_PLCADDRESS1("M50.2","M100.2","外置仓正转(3)",1,1));
        add(new Res_PLCADDRESS1("M50.3","M100.3","外置仓正转(4)",1,1));
        add(new Res_PLCADDRESS1("M50.4","M100.4","外置仓正转(5)",1,1));
        add(new Res_PLCADDRESS1("M50.5","M100.5","外置仓正转(6)",1,1));
        add(new Res_PLCADDRESS1("M50.6","M100.6","外置仓反转(1)",1,1));
        add(new Res_PLCADDRESS1("M50.7","M100.7","外置仓反转(2)",1,1));
        add(new Res_PLCADDRESS1("M51.0","M101.0","外置仓反转(3)",1,1));
        add(new Res_PLCADDRESS1("M51.1","M101.1","外置仓反转(4)",1,1));
        add(new Res_PLCADDRESS1("M51.2","M101.2","外置仓反转(5)",1,1));
        add(new Res_PLCADDRESS1("M51.3","M101.3","外置仓反转(6)",1,1));
        add(new Res_PLCADDRESS1("-------------","","粉料仓",0,0));
        add(new Res_PLCADDRESS1("M51.4","M101.4","粉料仓控制(1)",0,1));
        add(new Res_PLCADDRESS1("M51.5","M101.5","粉料仓控制(2)",0,1));
        add(new Res_PLCADDRESS1("M51.6","M101.6","粉料仓控制(3)",0,1));
        add(new Res_PLCADDRESS1("M52.3","M102.3","粉料仓控制(4)",0,1));
        add(new Res_PLCADDRESS1("M52.4","M102.4","粉料仓控制(5)",0,1));
        add(new Res_PLCADDRESS1("M52.5","M102.5","粉料仓控制(6)",0,1));

        add(new Res_PLCADDRESS1("-------------","","水池",1,0));
        add(new Res_PLCADDRESS1("M53.4","M103.4","水池进水阀",1,1));
        add(new Res_PLCADDRESS1("M53.5","M103.5","水池排水阀",1,1));
        add(new Res_PLCADDRESS1("M54.0","M104.0","水池加热",1,1));

    }};

    /**
     * 出料算法
     */
    public List<Res_ZDSF> zdsfs_出料算法=new ArrayList<Res_ZDSF>(){{
        //硬件设备 初始化
        add(new Res_ZDSF("外置通道(一)","VW194.0","VW144","VW44","VW168"));
        add(new Res_ZDSF("外置通道(二)","VW194.1","VW146","VW46","VW170"));
        add(new Res_ZDSF("外置通道(三)","VW194.2","VW148","VW48","VW172"));
        add(new Res_ZDSF("外置通道(四)","VW194.3","VW150","VW50","VW174"));
        add(new Res_ZDSF("外置通道(五)","VW194.4","VW152","VW52","VW176"));
        add(new Res_ZDSF("外置通道(六)","VW194.5","VW154","VW54","VW178"));
//        add(new Res_ZDSF("外置通道(七)","VW194.6","VW156","VW56","VW180"));
//        add(new Res_ZDSF("外置通道(八)","VW194.7","VW158","VW58","VW182"));
//        add(new Res_ZDSF("外置通道(九)","VW194.8","VW160","VW60","VW184"));
//        add(new Res_ZDSF("外置通道(十)","VW194.9","VW162","VW62","VW186"));
    }};

    /**
     * Bottom 按钮
     */
    public List<String> BottomList = new ArrayList<String>() {{
        add("初始化");
        add("停止");
        add("复位");


        add("主料");
        add("出菜");
        add("原点位");
        add("投料位");
        add("倒菜位");
        add("抽料位");
        add("清洗位");
        add("炒菜位1");
        add("炒菜位2");
        add("炒菜位3");
        add("出餐启动");
        add("出餐启动");

        add("开始校正");
        add("料仓1下料");
        add("料仓2下料");
        add("料仓3下料");


        add("平移-回原点");
        add("平移-去1号位");
        add("平移-去2号位");
        add("平移-去3号位");
        add("平移-去4号位");

        add("平移-1#位置设定");
        add("平移-2#位置设定");
        add("平移-3#位置设定");
        add("平移-4#位置设定");

        add("翻转-回原点");
        add("翻转-去1号位");
        add("翻转-去2号位");
        add("翻转-去3号位");
        add("翻转-去4号位");

        add("翻转-1#位置设定");
        add("翻转-2#位置设定");
        add("翻转-3#位置设定");
        add("翻转-4#位置设定");
        add("倒菜启动");
        //add("磁铁吸合");
    }};
    //endregion

    //region 云端数据
    /**
     * 云端数据
     */
    public ResALLData cloudData = null;
    /**
     * 云端商品
     */
    public List<CloudGood> cloudGoods = new ArrayList<>();
    //endregion

    //region 选配版本信息
    /**
     * 版本信息
     */
    public String[] versionSelectionValues = new String[]{"奶茶机", "配料吧台","味魔方"};

    /**
     * 选配版本信息
     */
    public String versionSelectionEnum = "奶茶机";
    //endregion

    //region 主页
    /**
     * 主页流
     */
    public FragmentAdapter fragmentAdapter = null;
    //endregion

    //region 是否自动加热
    /**
     * 是否自动加热(水池)
     */
    public Boolean AutomaticHeating=false;
    /**
     * 果糖1
     */
    public Boolean GT1_AutomaticHeating=false;
    /**
     * 果糖2
     */
    public Boolean GT2_AutomaticHeating=false;
    //endregion

    //region 是否自动补水
    /**
     * 是否自动补水(水池)
     */
    public Boolean AutomaticWaterRefill=false;
    /**
     * 自动补水延迟时间
     */
    public String AutomaticWaterRefillTime="0.0";
    //endregion
}
