using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;

namespace SlnMesnac.Config
{
    /// <summary>
    /// 系统配置
    /// </summary>
    public sealed class DebugConfig
    {
        private static IniHelper iniHelper = new IniHelper(System.Environment.CurrentDirectory + "/config/App.InI");


        private static readonly Lazy<DebugConfig> lazy = new Lazy<DebugConfig>(() => new DebugConfig());
        public static DebugConfig Instance
        {
            get
            {
                return lazy.Value;
            }
        }

        public DebugConfig()
        {

        }

        /// <summary>
        //系统运行状态;点击一键启动按钮和急停复位，改1,点击一键停止和急停改0;1的状态下根据缓存区自动启动设备
        /// </summary>
        public string SystemStatus
        {
            get { return iniHelper.IniReadValue("system", "SystemStatus"); }
            set { iniHelper.IniWriteValue("system", "SystemStatus", value); }
        }


        /// <summary>
        ///缓存区重量 
        /// </summary>
        public string BufferWeight
        {
            get { return iniHelper.IniReadValue("system", "BufferWeight"); }
            set { iniHelper.IniWriteValue("system", "BufferWeight", value); }
        }

        /// <summary>
        ///2楼缓存区最大停机重量
        /// </summary>
        public string MaxBufferWeight
        {
            get { return iniHelper.IniReadValue("system", "MaxBufferWeight"); }
            set { iniHelper.IniWriteValue("system", "MaxBufferWeight", value); }
        }

        /// <summary>
        ///2楼缓存区最小启动重量
        /// </summary>
        public string MinBufferWeight
        {
            get { return iniHelper.IniReadValue("system", "MinBufferWeight"); }
            set { iniHelper.IniWriteValue("system", "MinBufferWeight", value); }
        }


        /// <summary>
        ///系统当前使用配方模版
        /// </summary>
        public string RecipeName
        {
            get { return iniHelper.IniReadValue("system", "RecipeName"); }
            set { iniHelper.IniWriteValue("system", "RecipeName", value); }
        }


        /// <summary>
        ///配方运行模式 
        /// </summary>
        public string RecipeMode
        {
            get { return iniHelper.IniReadValue("system", "RecipeMode"); }
            set { iniHelper.IniWriteValue("system", "RecipeMode", value); }
        }

        /// <summary>
        ///拆包机螺旋--烘干机螺旋切换间隔(单位:ms)
        /// </summary>
        public string UnpackToHotTime
        {
            get { return iniHelper.IniReadValue("system", "UnpackToHotTime"); }
            set { iniHelper.IniWriteValue("system", "UnpackToHotTime", value); }
        }

        /// <summary>
        ///烘干机螺旋--螺旋1切换间隔(单位:ms) 
        /// </summary>
        public string HotToSpiralTime
        {
            get { return iniHelper.IniReadValue("system", "HotToSpiralTime"); }
            set { iniHelper.IniWriteValue("system", "HotToSpiralTime", value); }
        }

        /// <summary>
        ///#螺旋1--螺旋2切换间隔(单位:ms) 
        /// </summary>
        public string SpiralTwoTime
        {
            get { return iniHelper.IniReadValue("system", "SpiralTwoTime"); }
            set { iniHelper.IniWriteValue("system", "SpiralTwoTime", value); }
        }

        /// <summary>
        ///3F投料生产模式，默认手动，1-手动模式；2-自动模式
        /// </summary>
        public string ProductMode
        {
            get { return iniHelper.IniReadValue("system", "ProductMode"); }
            set { iniHelper.IniWriteValue("system", "ProductMode", value); }
        }


        /// <summary>
        ///无计划时，按照无计划订单处理，MaterialId可修改
        /// </summary>
        public string MaterialId
        {
            get { return iniHelper.IniReadValue("system", "MaterialId"); }
            set { iniHelper.IniWriteValue("system", "MaterialId", value); }
        }


        /// <summary>
        ///喷码机IP
        /// </summary>
        public string BarCodeMachineIP
        {
            get { return iniHelper.IniReadValue("system", "BarCodeMachineIP"); }
            set { iniHelper.IniWriteValue("system", "BarCodeMachineIP", value); }
        }


        /// <summary>
        ///软件自动更新，当前版本号
        /// </summary>
        public string Version
        {
            get { return iniHelper.IniReadValue("system", "Version"); }
            set { iniHelper.IniWriteValue("system", "Version", value); }
        }

        /// <summary>
        ///软件自动更新，当前程序名
        /// </summary>
        public string ProcessName
        {
            get { return iniHelper.IniReadValue("system", "ProcessName"); }
            set { iniHelper.IniWriteValue("system", "ProcessName", value); }
        }


        
        /// <summary>
        ///参数配置界面密码
        /// </summary>
        public string ConfigInfoPassWprd
        {
            get { return iniHelper.IniReadValue("system", "ConfigInfoPassWprd"); }
            set { iniHelper.IniWriteValue("system", "ConfigInfoPassWprd", value); }
        }


        /// <summary>
        ///小包出口RFID人工输入备用
        ///读取不到时，人工可以手动输入
        /// </summary>
        public string MdjOutRFID
        {
            get { return iniHelper.IniReadValue("system", "MdjOutRFID"); }
            set { iniHelper.IniWriteValue("system", "MdjOutRFID", value); }
        }

    }
}
