using Common.vo.pb;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
    /// <summary>
    /// 总缓存信息 
    /// </summary>
    public class PbCache
    {
        /// <summary>
        /// 检斤类型
        /// </summary>
        public static string bussinessTypeName { get; set; }
        public static string bussinessTypeCode { get; set; }

        /// <summary>
        /// 是否显示保存按钮
        /// </summary>
        public static bool isShowBtnSave { get; set; }

        /// <summary>
        /// 是否显示保存按钮<禁止保存时的提示信息>
        /// </summary>
        public static bool isShowBtnSaveMsg { get; set; }

        /// <summary>
        /// 是否测试环境
        /// </summary>
        public static bool isTest { get; set; }

        /// <summary>
        /// 是否皮重（true=皮重；false=毛重）
        /// </summary>
        public static bool isTareWeight { get; set; }

        /// <summary>
        /// 二次资源选择是否成功（true=选择正确；false=选择错误）
        /// </summary>
        public static bool isChooseSecondResourceFail { get; set; }

        /// <summary>
        /// 是否超时报警
        /// </summary>
        public static bool isOvertimeAlarm { get; set; }


        /// <summary>
        /// 是否已经进行零点报警
        /// </summary>
        public static bool isZeroAlarm { get; set; }

        /// <summary>
        /// 系统路径
        /// </summary>
        public static readonly string path = System.Environment.CurrentDirectory;

        /// <summary>
        /// 内倒计量时使用，这个初始化默认给false
        /// 若内倒中验证存在一次计量数据，那么这个值给true
        /// </summary>
        public static bool isHaveFirst { get; set; }

        /// <summary>
        /// 计量界面锁定状态，已保存后，锁定界面等重量小于500kg后再重置该状态
        /// </summary>
        public static bool isLockFrm { get; set; }

        /// <summary>
        /// 当重量大于500时开始给值，发现有值后不再设定值
        /// 当重量小于300时发现有值则设置为null
        /// </summary>
        public static DateTime? dtStartTime { get; set; }

        /// <summary>
        /// 在客户点击了保存的时候开始锁定，保存完成后取消锁定
        /// 计量重量取值锁定  true则暂停取重信息写入到界面
        /// 此时后台仍在取重量，只是不写入到界面而已，待重量小于500kg后再重置该状态
        /// </summary>
        public static bool isLockWgt { get; set; }

        /// <summary>
        /// 锁定后的重量
        /// </summary>
        public static double lockWgt { get; set; }

        /// <summary>
        /// 附加重量
        /// </summary>
        public static double addWgt { get; set; }

        /// <summary>
        /// 锁定后的车号
        /// </summary>
        public static string lockCarNo { get; set; }

        /// <summary>
        /// 计量编号，用于后面截图后生成图片的编号使用
        /// </summary>
        public static string actualFirstNo { get; set; }
        /// <summary>
        /// 二维码代码
        /// </summary>
        public static string strQRCode { get; set; }

        /// <summary>
        /// 提示信息，用于写入到界面的ListBox中
        /// </summary>
        public static string ResultMessage { get; set; }

        /// <summary>
        /// 提示信息，用于写入到LED屏中
        /// </summary>
        public static string LEDResultMessage { get; set; }

        /// <summary>
        /// 提示信息，用于写入到监控表中
        /// </summary>
        public static string monitorResultMessage { get; set; }


        /// <summary>
        /// 业务类型 空则回复初始状态 001006003内倒计量  001006001采购进厂  001006002销售出厂    
        /// </summary>
        public static List<ComBaseInfo> businessType { get; set; }

        /// <summary>
        /// 计量点配置信息
        /// </summary>
        public static MeterBaseSpotInfo sportInfo { get; set; }
        public static List<MeterBaseSpotInfo> sportInfos { get; set; }

        public static List<MeterWorkMonitor> ltWorkMonitor { get; set; }


        /// <summary>
        /// 摄像头配置信息
        /// </summary>
        public static MeterBaseVideoinfo videoInfo { get; set; }
        public static List<MeterBaseVideoinfo> ltVideoInfo { get; set; }

        /// <summary>
        /// 摄像头配置信息拆分结果
        /// </summary>
        public static List<MeterBaseVideoChild> videoChild { get; set; }

        /// <summary>
        /// 历史皮重计算配置
        /// </summary>
        public static MeterBaseHisTareCount tareCount { get; set; }

        /// <summary>
        /// 期限皮重计算配置
        /// </summary>
        public static MeterBaseTermTareCount termTareCount { get; set; }

        /// <summary>
        /// 秤体量程配置
        /// </summary>
        public static MeterBaseScaleRange range { get; set; }
        public static List<MeterBaseScaleRange> ltRange { get; set; }

        /// <summary>
        /// 危化品限载配置表
        /// </summary>
        public static List<MeterBaseLimitChemical> limit { get; set; }

        /// <summary>
        /// 时间间隔
        /// </summary>
        public static List<MeterBaseTimeSpace> timeSpace { get; set; }

        /// <summary>
        /// 期限皮重时间
        /// </summary>
        public static List<MeterBaseTermTareTime> tareTime { get; set; }

        /// <summary>
        /// 停留超时
        /// </summary>
        public static List<MeterBaseCarHoldTime> holdTime { get; set; }

        /// <summary>
        /// 实时表采集的数据
        /// </summary>
        public static CollectModel collect { get; set; }

        /// <summary>
        /// 对应实时库的采集点编号
        /// </summary>
        public static string collect_no { get; set; }

        /// <summary>
        /// 计量监控表
        /// 每隔1秒刷新一次数据，在点击计量的时候查一次后不再验证
        /// 通过下面的isQueryMonitor来控制是否查询，直到计量点击取消则
        /// 继续验证，或者等车辆上秤重量大于500kg后开启
        /// </summary>
        public static MeterWorkMonitor monitor { get; set; }
        public static bool isQueryMonitor { get; set; }

        /// <summary>
        /// 验证结果
        /// </summary>
        public static MeterWorkMonitorResult monitorResult { get; set; }

        /// <summary>
        /// 播放前修改为false，播放完修改为true
        /// </summary>
        public static bool voiceOver = true;

        /// <summary>
        /// 读取音频信息
        /// </summary>
        public static List<string> voiceInfo { get; set; }

        /// <summary>
        /// 扫码枪扫描的信息
        /// </summary>
        public static string strCode { get; set; }


        /// <summary>
        /// 校秤基础数据
        /// </summary>
        public static List<MeterBaseCalibraRelation> relations { get; set; }

        /// <summary>
        /// 初始化一次，重量小于300kg后调用一次
        /// </summary>
        public static void Load() 
        {
            
           isHaveFirst = false;
            isLockFrm = false;
            isLockWgt = false;
            dtStartTime = null;
            lockWgt = 0;
            addWgt = 0;
            lockCarNo = "";
            actualFirstNo = "";
            ResultMessage = "";
            isShowTare = false; //是否单显示皮重
            isQueryMonitor = false;
            monitorResult = new MeterWorkMonitorResult();
            isTermTare = false;
            isAllowRecover = false; //2021年6月16日 是否需要复磅，若需要则显示复磅按钮
            carRecover = null; //复磅计量结果集
        }


        /// <summary>
        /// 是否可用期限皮重
        /// ture可以，false不可以
        /// </summary>
        public static bool isTermTare { get; set; }

        /// <summary>
        /// LED信息展示
        /// </summary>
        public static string ledInfo { get; set; }

        /// <summary>
        /// 旧LED数据
        /// </summary>
        public static string OldLedInfo { get; set; }


        /// <summary>
        /// 计量卸货时间
        /// </summary>
        public static List<MeterBaseUnloadTime> unloadTimes { get; set; }

        /// <summary>
        /// 计量车卡配置信息
        /// </summary>
        public static List<MeterBaseCarCard> ltCarCard { get; set; }

        /// <summary>
        /// 计量场景配置信息
        /// </summary>
        public static List<MeterWorkSceneRegister> ltSceneRegister { get; set; }
    
        /// <summary>
        /// 不验证
        /// </summary>
        public static bool isNotValid { get; set; }

        /// <summary>
        /// 校秤计量关联表
        /// </summary>
        public static List<MeterBaseCalibraNumRel> ltBaseCalibraNumRel { get; set; }

        /// <summary>
        /// 汽车一次计量数据过期时间
        /// </summary>
        public static double isEndHour { get; set; }

        //public static bool? bFlag { get; set; }

        /// <summary>
        /// 是否单显示皮重
        /// </summary>
        public static bool isShowTare { get; set; }

        /// <summary>
        /// 复磅计量数据
        /// </summary>
        public static MeterWorkCarRecover carRecover { get; set; }

        /// <summary>
        /// 是否允许复磅
        /// </summary>
        public static bool isAllowRecover { get; set; }

        /// <summary>
        /// 是否厂内车
        /// </summary>
        public static bool isInnerCar { get; set; }

        /// <summary>
        /// 是否一次数据
        /// </summary>
        public static bool isActual { get; set; }
    }
}
