using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DotNettyFrom.config
{
    public class SystemConfig
    {
        public const int Dtu = 1;
        public const int Water2 = 2;

        //当前是哪一个设备
        public static int CurrentType;

        public static string DefaultNo = DtuConfig.DefaultDtuNo;
        public static int DefaultPort = DtuConfig.DefaulDtutPort;


        //是否打印心跳指令
        public static bool IsLogHeartBeatInfo = false;

        //心跳指令的功能码,用来判定是否是心跳
        public static int HeartbeatDownCmdCode = 4;

        //功能码的位置,长度
        public static int FunctionCodeStartPos = 9;

        public static int FunctionCodeLength = 1;

        //定时发送心中
        public static bool OpenHeartBeat = true;

        //心跳时间
        public static int ReaderIdleTimeSeconds = 5;

        public static int WriterIdleTimeSeconds = 5;
        public static int AllIdleTimeSeconds = 25;


        //测量点&消息流水
        public static int MeasurePointLen = 1;

        public static int MessageFlowLen = 2;


        //粘包-半包问题,长度
        public static int LengthFieldOffset = 10;

        public static int LengthFieldLength = 2;
        public static int LengthAdjustment = 1;
        public static int InitialBytesToStrip = 0;

        //ListBox最多显示条数
        public static int LBLogShowClearCount = 1000;

        //----------------------------------------------------------------

        //1 发送的. 0:接收的, -1.Debug.日常信息
        public static int SendType = 1;

        public static int RecType = 0;
        public static int DebugType = -1;
        public static int ReplyType = 2;

        //数据库对应
        public const int IpHisType = 1;

        public const int AddrHisType = 2;
        public const int SendHisType = 3;
        public const int CcidHisType = 4;
    }
}