Ejemplo n.º 1
0
        private string method_2()
        {
            int    num         = int.Parse(this.protocolDrData_0.ContextData.Substring(2, 6));
            string bCDDataTime = NumHelper.GetBCDDataTime(this.protocolDrData_0.ContextData.Substring(8));

            return(string.Concat(new object[] { "行驶里程:", num * 0.1, "公里,时间:", bCDDataTime }));
        }
Ejemplo n.º 2
0
        private string method_1()
        {
            string str = string.Empty;
            int    num = NumHelper.Convert16To10(this.protocolDrData_0.ContextData.Substring(0, 4));

            if (num == 0)
            {
                return(str + "多媒体总数:0");
            }
            object obj2 = str;

            str = string.Concat(new object[] { obj2, "多媒体总数:", num, Environment.NewLine });
            string str2       = this.protocolDrData_0.ContextData.Substring(4);
            int    num2       = str2.Length / 70;
            int    startIndex = 0;

            for (int i = 0; i < num2; i++)
            {
                str         = str + "多媒体ID:" + NumHelper.Convert16To10ToString(str2.Substring(startIndex, 8));
                startIndex += 8;
                str         = str + ",多媒体类型:" + ((MenuDefine.MutilMediaType)NumHelper.Convert16To10(str2.Substring(startIndex, 2))).ToString();
                startIndex += 2;
                str         = str + ",通道ID:" + NumHelper.Convert16To10ToString(str2.Substring(startIndex, 2));
                startIndex += 2;
                str         = str + ",事件项编码:" + ((MenuDefine.AccidentCode)NumHelper.Convert16To10(str2.Substring(startIndex, 2))).ToString();
                startIndex += 2;
                str         = str + ",时间:" + NumHelper.GetBCDDataTime(str2.Substring(startIndex, 0x38).Substring(0x2c, 12)) + Environment.NewLine;
                startIndex += 0x38;
            }
            return(str);
        }
Ejemplo n.º 3
0
        public void Get360DistanceUpData(DataRow dataRow_0)
        {
            dataRow_0["OrderName"] = "360小时里程查询应答";
            double num         = int.Parse(this.protocolDrData_0.ContextData.Substring(2, 6)) * 0.1;
            string bCDDataTime = NumHelper.GetBCDDataTime(this.protocolDrData_0.ContextData.Substring(8));

            dataRow_0["Describe"] = "里程:" + num.ToString() + "公里,时间:" + bCDDataTime;
        }
Ejemplo n.º 4
0
        public void GetCarDoubtfulDataUpData(DataRow dataRow_0)
        {
            dataRow_0["OrderName"] = "事故疑点数据应答";
            string str = " " + Environment.NewLine;
            SortedDictionary <DateTime, string> dictionary = new SortedDictionary <DateTime, string>();
            string str2 = string.Empty;
            string str3 = string.Empty;
            string str4 = this.protocolDrData_0.ContextData.Substring(2);
            string str5 = "";

            while (str4.Length > 0)
            {
                SortedDictionary <DateTime, string> dictionary3;
                DateTime time3;
                DateTime time = Convert.ToDateTime(NumHelper.GetBCDDataTime(str4.Substring(0, 12)));
                dictionary[time] = "";
                for (string str6 = str4.Substring(12, 400); str6.Length > 0; str6 = str6.Substring(40))
                {
                    SortedDictionary <DateTime, string> dictionary2 = dictionary;
                    DateTime time2 = time;
                    string   str7  = str6.Substring(0, 40);
                    str2 = "";
                    str3 = "";
                    while (str7.Length > 0)
                    {
                        str2 = str2 + NumHelper.Convert16To10ToString(str7.Substring(0, 2)) + ",";
                        str3 = str3 + (((NumHelper.Convert16To10(str7.Substring(2, 2)) & 0x80) == 0) ? "关," : "开,");
                        str7 = str7.Substring(4);
                    }
                    string str8 = dictionary2[time2];
                    (dictionary2 = dictionary)[time2 = time] = str8 + "速度:" + str2.Trim(new char[] { ',' }) + str + "制动:" + str3.Trim(new char[] { ',' }) + str;
                }
                (dictionary3 = dictionary)[time3 = time] = dictionary3[time3] + str;
                str4 = str4.Substring(0x19c);
            }
            int num = 0;

            foreach (KeyValuePair <DateTime, string> pair in dictionary)
            {
                num++;
                object obj2 = str5;
                str5 = string.Concat(new object[] { obj2, "事故疑点", num, ":\n时间:", pair.Key.ToString(), "\n" });
                str5 = str5 + pair.Value;
            }
            dataRow_0["Describe"] = str5;
        }
Ejemplo n.º 5
0
        public void GetCar2DayOverSpeedUpData(DataRow dataRow_0)
        {
            dataRow_0["OrderName"] = "查询2个日历天内超时驾驶情况应答";
            string str  = this.protocolDrData_0.ContextData.Substring(2);
            string str2 = "";

            while (str.Length > 0)
            {
                DataRow row         = dataRow_0;
                string  str3        = NumHelper.GetStringFromBase16ASCII(str.Substring(0, 0x24));
                string  bCDDataTime = NumHelper.GetBCDDataTime(str.Substring(0x24, 10));
                string  str5        = NumHelper.GetBCDDataTime(str.Substring(0x2e, 10));
                string  str6        = str2;
                str2 = str6 + "驾驶证号:" + str3.Replace("\0", "") + ", 开始时间:" + bCDDataTime + " 结束时间:" + str5 + ";";
                object obj2 = row["Describe"];
                (row = dataRow_0)["Describe"] = string.Concat(new object[] { obj2, "驾驶证号:", str3.Replace("\0", ""), ", 开始时间:", bCDDataTime, " 结束时间:", str5, ";" });
                str = str.Substring(0x38);
            }
            dataRow_0["Describe"] = str2;
        }
Ejemplo n.º 6
0
        public void Get360SpeedUpData(DataRow dataRow_0)
        {
            dataRow_0["OrderName"] = "采集360小时行驶速度数据应答";
            string str  = "时间:";
            string str2 = "速度:";
            string str3 = "";
            string str4 = this.protocolDrData_0.ContextData.Substring(2);

            while (str4.Length > 0)
            {
                string str6 = str3;
                str3 = str6 + str + NumHelper.GetBCDDataTime(str4.Substring(0, 10)) + Environment.NewLine + str2;
                for (string str5 = str4.Substring(10, 120); str5.Length > 0; str5 = str5.Substring(2))
                {
                    str3 = str3 + NumHelper.Convert16To10(str5.Substring(0, 2)) + ",";
                }
                str4 = str4.Substring(130);
                str3 = str3.Trim(new char[] { ',' }) + Environment.NewLine;
            }
            dataRow_0["Describe"] = str3;
        }
Ejemplo n.º 7
0
 public void GetRemotingParameterUpData(DataRow dataRow_0)
 {
     dataRow_0["OrderName"] = "远程参数查看应答";
     dataRow_0["Describe"]  = NumHelper.GetBCDDataTime(this.protocolDrData_0.ContextData.Substring(2));
 }
Ejemplo n.º 8
0
        public void GetCarDriverData(DataRow dataRow_0)
        {
            string contextData = this.protocolDrData_0.ContextData;

            try
            {
                int num = NumHelper.ConvertToInt(contextData.Substring(0, 2));
                if ((num != 1) && (num != 2))
                {
                    throw new Exception();
                }
                string   str2   = (num == 1) ? "插卡" : "拔卡";
                DateTime time   = DateTime.Parse(NumHelper.GetBCDDataTime(contextData.Substring(2, 12)));
                int      num2   = 0;
                string   str3   = "";
                int      length = 0;
                string   str4   = "";
                string   str5   = "";
                int      num4   = 0;
                string   str6   = "";
                DateTime time2  = Convert.ToDateTime("1970-01-01");
                string   format = "";
                if (num == 1)
                {
                    num2 = NumHelper.ConvertToInt(contextData.Substring(14, 2));
                    if ((num2 > 3) || (num2 < 0))
                    {
                        throw new Exception();
                    }
                    switch (num2)
                    {
                    case 0:
                        str3 = "IC卡读卡成功";
                        break;

                    case 1:
                        str3 = "读卡失败,原因为卡片密钥认证未通过";
                        break;

                    case 2:
                        str3 = "读卡失败,原因为卡片已被锁定";
                        break;

                    case 3:
                        str3 = "读卡失败,原因为卡内信息为空";
                        break;
                    }
                    if (num2 == 0)
                    {
                        length = NumHelper.ConvertToInt(contextData.Substring(0x10, 2)) * 2;
                        str4   = NumHelper.GetStringFromBase16ASCII(contextData.Substring(0x12, length));
                        str5   = NumHelper.GetStringFromBase16ASCII(contextData.Substring(0x12 + length, 40));
                        num4   = NumHelper.Convert16To10(contextData.Substring(0x3a + length, 2)) * 2;
                        str6   = NumHelper.GetStringFromBase16ASCII(contextData.Substring(60 + length, num4));
                        time2  = DateTime.Parse(NumHelper.GetBCDDate(contextData.Substring((60 + length) + num4, 8)));
                        format = "驾驶员姓名:{0},状态:{6},时间:{5},IC卡读取结果:{1},从业资格证:{2},发证机构名称:{3},证件有效期:{4}";
                        format = string.Format(format, new object[] { str4, str3, str5, str6, time2.ToString("yyyy-MM-dd"), time, str2 });
                    }
                    else
                    {
                        format = "驾驶员姓名:{0},状态:{3},时间:{2},IC卡读取结果:{1}";
                        format = string.Format(format, new object[] { str4, str3, time, str2 });
                    }
                    format = format.Replace("\0", "");
                }
                else
                {
                    format = "状态:{0},时间:{1}";
                    format = string.Format(format, str2, time);
                }
                dataRow_0["OrderName"] = "驾驶员身份信息应答";
                dataRow_0["Describe"]  = format;
                int    num5 = (dataRow_0["CarId"] == DBNull.Value) ? 0 : int.Parse(dataRow_0["CarId"].ToString());
                int    num6 = UpdataInsertDBInfor.UpdateDriverInfor(num5, num, time, num2, str4.Replace("\0", ""), str5.Replace("\0", ""), str6, time2);
                string str8 = "";
                if (num == 1)
                {
                    str8 = "驾驶员登陆成功";
                    if (num2 != 0)
                    {
                        str8 = "驾驶员登录失败," + str3;
                    }
                    else if (num6 == 0)
                    {
                        str8 = "驾驶员登录失败,原因为驾驶员身份信息无效";
                    }
                }
                else
                {
                    str8 = "驾驶员取卡成功";
                }
                IODeviceTextMsg msg = new IODeviceTextMsg {
                    InfoID  = 1,
                    Message = str8,
                    SimNum  = dataRow_0["SimNum"].ToString()
                };
                this.IODeviceAttachInfo.Add(msg);
            }
            catch (Exception)
            {
                int    startIndex = 0;
                int    num8       = NumHelper.Convert16To10(contextData.Substring(0, 2)) * 2;
                string str9       = NumHelper.GetStringFromBase16ASCII(contextData.Substring(2, num8));
                string str10      = NumHelper.GetStringFromBase16ASCII(contextData.Substring(2 + num8, 40));
                startIndex = (2 + num8) + 40;
                string str11 = NumHelper.GetStringFromBase16ASCII(contextData.Substring(startIndex, 80));
                startIndex += 80;
                int num9 = NumHelper.Convert16To10(contextData.Substring(startIndex, 2)) * 2;
                startIndex += 2;
                string str12 = NumHelper.GetStringFromBase16ASCII(contextData.Substring(startIndex, num9));
                string str13 = "驾驶员姓名:{0},驾驶员身份证编码:{1},从业资格证:{2},发证机构名称:{3}";
                str13 = string.Format(str13, new object[] { str9, str10, str11, str12 }).Replace("\0", "");
                dataRow_0["OrderName"] = "驾驶员身份信息应答";
                dataRow_0["Describe"]  = str13;
                int num10 = (dataRow_0["CarId"] == DBNull.Value) ? 0 : int.Parse(dataRow_0["CarId"].ToString());
                if (UpdataInsertDBInfor.UpdateDriverInfor(num10, str10.Replace("\0", ""), str11.Replace("\0", ""), str9.Replace("\0", ""), str12.Replace("\0", "")) == 0)
                {
                    IODeviceTextMsg msg3 = new IODeviceTextMsg {
                        InfoID  = 1,
                        Message = "驾驶员身份信息无效",
                        SimNum  = dataRow_0["SimNum"].ToString()
                    };
                    this.IODeviceAttachInfo.Add(msg3);
                }
            }
        }