Beispiel #1
0
        private object GetRegions()
        {
            byte[] speed = new byte[2048];
            int    num   = 0;

            for (int i = 0; i < this.Count; i++)
            {
                PathAlarm     item          = (PathAlarm)this[i];
                int           d             = item.ID;
                PathAlarmList pathAlarmList = this;
                pathAlarmList.AlarmPathDot = string.Concat(pathAlarmList.AlarmPathDot, d);
                byte[] numArray = this.SealData(d, item.Points);
                num = (this.OrderCode != CmdParam.OrderCode.设置分路段超速报警 ? num + (int)numArray.Length : num + (int)numArray.Length + 26);
                Array.Resize <byte>(ref speed, num);
                if (this.OrderCode != CmdParam.OrderCode.设置分路段超速报警)
                {
                    numArray.CopyTo(speed, num - (int)numArray.Length);
                }
                else
                {
                    numArray.CopyTo(speed, num - (int)numArray.Length - 26);
                }
                if (this.OrderCode == CmdParam.OrderCode.设置分路段超速报警)
                {
                    speed[num - 26] = item.Speed;
                    speed[num - 25] = item.Time;
                }
                byte[] bytes = new byte[24];
                bytes = Encoding.GetEncoding("gb2312").GetBytes(string.Concat(item.sBeginTime, item.sEndTime));
                Array.Copy(bytes, 0, speed, num - (int)bytes.Length, (int)bytes.Length);
            }
            return(speed);
        }
Beispiel #2
0
        private string GetMembersXml(ref string content)
        {
            StringBuilder stringBuilder = new StringBuilder();

            this._PointCount = 0;
            for (int i = 0; i < this.Count; i++)
            {
                PathAlarm item = this[i] as PathAlarm;
                stringBuilder.Append(item.GetMembersXml(ref content));
                PathAlarmList count = this;
                count._PointCount = count._PointCount + item.Points.Count;
            }
            return(stringBuilder.ToString());
        }
Beispiel #3
0
        private byte[] SealData(int regionId, ArrayList pointsList)
        {
            int num = 0;

            byte[] numArray = new byte[3 + pointsList.Count * 20];
            int    num1     = num;

            num            = num1 + 1;
            numArray[num1] = (byte)regionId;
            int count = pointsList.Count;
            int num2  = num;

            num            = num2 + 1;
            numArray[num2] = (byte)(count >> 8);
            int num3 = num;

            num            = num3 + 1;
            numArray[num3] = (byte)(count & 255);
            for (int i = 0; i < pointsList.Count; i++)
            {
                Point         item          = (Point)pointsList[i];
                string        tenBitData    = this.GetTenBitData(item.Longitude.ToString());
                string        str           = this.GetTenBitData(item.Latitude.ToString());
                byte[]        bytes         = Encoding.GetEncoding("gb2312").GetBytes(tenBitData);
                byte[]        bytes1        = Encoding.GetEncoding("gb2312").GetBytes(str);
                PathAlarmList pathAlarmList = this;
                string        alarmPathDot  = pathAlarmList.AlarmPathDot;
                string[]      strArrays     = new string[] { alarmPathDot, "\\", tenBitData, "\\", str };
                pathAlarmList.AlarmPathDot = string.Concat(strArrays);
                bytes.CopyTo(numArray, num);
                num = num + 10;
                bytes1.CopyTo(numArray, num);
                num = num + 10;
            }
            PathAlarmList pathAlarmList1 = this;

            pathAlarmList1.AlarmPathDot = string.Concat(pathAlarmList1.AlarmPathDot, "*");
            return(numArray);
        }
Beispiel #4
0
        public Response icar_SetMultiSegSpeedAlarm(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, PathAlarmList pathAlarmList)
        {
            Response response = new Response();
            base.logMsg.FunctionName = "icar_SetMultiSegSpeedAlarm";
            base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1;
            base.log.WriteLog(base.logMsg);
            if (!base.CheckCar(paramType_0, string_1, string_2))
            {
                response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
                base.log.WriteAlarm(base.alarmMsg);
                return response;
            }
            if (base.isStartCommon())
            {
                foreach (Bussiness.CarInfo info in base.carInfoList)
                {
                    try
                    {
                        Car car = new Car();
                        int num = -1;
                        for (int i = 0; i < pathAlarmList.Count; i++)
                        {
                            PathAlarm alarm = (PathAlarm) pathAlarmList[i];
                            DataTable table = car.GetNewPathId(info.CarId, alarm.PathName, num);
                            if (table == null)
                            {
                                response.ErrorMsg = base.errMsg.ErrorText = string.Format("\"{0}\"获取偏移路线ID失败!", info.CarNum);
                                base.log.WriteError(base.errMsg);
                                return response;

                            }
                            int num3 = int.Parse(table.Rows[0][0].ToString());
                            if (-1 == num3)
                            {
                                response.ErrorMsg = base.errMsg.ErrorText = string.Format("\"{0}\"偏移路线ID已满,请删除部分偏移路线!", info.CarNum);
                                base.log.WriteError(base.errMsg);
                                return response;
                            }
                            num = int.Parse(table.Rows[0][1].ToString());
                            alarm.ID = num3;
                        }
                        object pvRegions = pathAlarmList.pvRegions;
                        int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                        base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                        string orderIDParam = response.OrderIDParam;
                        response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                        if ((info.ProtocolName != SendBase.m_ProtocolName) && (pathAlarmList.protocolType == CarProtocolType.交通厅))
                        {
                            base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "接收", pathAlarmList.OrderCode.ToString(), "失败", "", "终端不支持该协议!");
                            base.errMsg.ErrorText = "下发消息指令时发生错误!";
                            response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                            return response;
                        }
                        base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", pathAlarmList.OrderCode.ToString(), "等待", "", "");
                        car.InsertPathIntoGisCar(info.CarId, base.WorkId, newOrderId, pathAlarmList.AlarmPathDot);
                        if (pathAlarmList.OrderCode == CmdParam.OrderCode.设置分路段超速报警)
                        {
                            for (int j = 0; j < pathAlarmList.Count; j++)
                            {
                                PathAlarm alarm2 = (PathAlarm) pathAlarmList[j];
                                if (((alarm2.PathSegmentAlarmList != null) && (alarm2.PathSegmentAlarmList.Count != 0)) || !(info.ProtocolName == SendBase.m_ProtocolName))
                                {
                                    car.UpdateTrafficPathAlarm_tmp(base.WorkId, newOrderId, info.CarId, alarm2.PathName, 1, alarm2.Speed, alarm2.Time, alarm2.ID, (alarm2.BeginTime == null) ? "" : alarm2.BeginTime.ToString(), (alarm2.EndTime == null) ? "" : alarm2.EndTime.ToString(), alarm2.PathFlag, alarm2.DriEnough, alarm2.DriNoEnough);
                                }
                            }
                        }
                        if ((info.ProtocolName == SendBase.m_ProtocolName) && (pathAlarmList.protocolType == CarProtocolType.交通厅))
                        {
                            for (int k = 0; k < pathAlarmList.Count; k++)
                            {
                                PathAlarm alarm3 = (PathAlarm) pathAlarmList[k];
                                string conntent = "";
                                alarm3.OrderCode = pathAlarmList.OrderCode;
                                string str2 = alarm3.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SetPathAlarm", ref conntent);
                                response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) alarm3.OrderCode, (int) commMode_0, str2);
                            }
                        }
                        else
                        {
                            if ((info.ProtocolName != SendBase.m_ProtocolName) && (pathAlarmList.protocolType == CarProtocolType.交通厅))
                            {
                                base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "接收", pathAlarmList.OrderCode.ToString(), "失败", "", "终端不支持该协议!");
                                response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                                response.ResultCode = 0L;
                                return response;
                            }
                            response.ResultCode = SendBase.CarCmdSend.icar_SimpleCmd(base.WorkId, newOrderId, info.SimNum, CmdParam.CmdCode.设置分段超速报警, ref pvRegions);
                        }
                        if (response.ResultCode != 0L)
                        {
                            base.alarmMsg.FunctionName = "icar_SetMultiSegSpeedAlarm";
                            base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", pathAlarmList.OrderCode });
                            base.alarmMsg.Code = response.ResultCode.ToString();
                            base.log.WriteAlarm(base.alarmMsg);
                        }
                        int num7 = 0;
                        while (true)
                        {
                            if (num7 >= pathAlarmList.Count)
                            {
                                break;
                            }
                            PathAlarm alarm4 = (PathAlarm) pathAlarmList[num7];
                            if ((pathAlarmList.OrderCode == CmdParam.OrderCode.设置分路段超速报警) && (pathAlarmList.protocolType == CarProtocolType.交通厅))
                            {
                                try
                                {
                                    if ((info.ProtocolName == SendBase.m_ProtocolName) && (pathAlarmList.protocolType == CarProtocolType.交通厅))
                                    {
                                        for (int m = 0; m < alarm4.PathSegmentAlarmList.Count; m++)
                                        {
                                            car.InsertTrafficSegmentParam(info.CarId, alarm4.ParentID, alarm4.PathSegmentAlarmList[m].PathSegmentID, alarm4.PathSegmentAlarmList[m].TopSpeed, alarm4.PathSegmentAlarmList[m].HoldTime, alarm4.PathSegmentAlarmList[m].DriEnough, alarm4.PathSegmentAlarmList[m].DriNoEnough, alarm4.PathSegmentAlarmList[m].Flag, alarm4.PathSegmentAlarmList[m].PathWidth);
                                        }
                                    }
                                }
                                catch (Exception exception)
                                {
                                    base.log.WriteError(base.errMsg, exception);
                                }
                            }
                            num7++;
                        }
                        response.ResultCode = 0L;
                        continue;
                    }
                    catch (Exception exception2)
                    {
                        base.errMsg.ErrorText = "下发消息指令时发生错误!";
                        response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                        base.log.WriteError(base.errMsg, exception2);
                    }
                }
                return response;
            }
            response.ErrorMsg = base.ErrorMsg;
            return response;
        }
Beispiel #5
0
 public Response icar_SelMultiPathAlarm(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, PathAlarmList pathAlarmList_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SelMultiPathAlarm";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.alarmMsg.AlarmText = base.ErrorMsg;
         base.log.WriteAlarm(base.alarmMsg);
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 Car car = new Car();
                 int num = -1;
                 for (int i = 0; i < pathAlarmList_0.Count; i++)
                 {
                     PathAlarm alarm = (PathAlarm) pathAlarmList_0[i];
                     DataTable table = car.GetNewPathId(info.CarId, alarm.PathName, num);
                     if (table == null)
                     {
                         goto Label_035B;
                     }
                     int num3 = int.Parse(table.Rows[0][0].ToString());
                     if (-1 == num3)
                     {
                         goto Label_039A;
                     }
                     num = int.Parse(table.Rows[0][1].ToString());
                     alarm.ID = num3;
                 }
                 object pvRegions = pathAlarmList_0.pvRegions;
                 int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", pathAlarmList_0.OrderCode.ToString(), "等待", "", "");
                 car.InsertPathIntoGisCar(info.CarId, base.WorkId, newOrderId, pathAlarmList_0.AlarmPathDot);
                 response.ResultCode = SendBase.CarCmdSend.icar_SelMultiPathAlarm(base.WorkId, newOrderId, info.SimNum, ref pvRegions);
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SelMultiPathAlarm";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", pathAlarmList_0.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 for (int j = 0; j < pathAlarmList_0.Count; j++)
                 {
                     PathAlarm alarm2 = (PathAlarm) pathAlarmList_0[j];
                     car.UpdatePathAlarm(info.CarId, alarm2.PathName, 1, 0, 0, alarm2.ID, "", "", 0, 0, 0);
                 }
                 response.ResultCode = 0L;
                 continue;
             Label_035B:
                 response.ErrorMsg = base.errMsg.ErrorText = string.Format("\"{0}\"获取偏移路线ID失败!", info.CarNum);
                 base.log.WriteError(base.errMsg);
                 return response;
             Label_039A:
                 response.ErrorMsg = base.errMsg.ErrorText = string.Format("\"{0}\"偏移路线ID已满,请删除部分偏移路线!", info.CarNum);
                 base.log.WriteError(base.errMsg);
                 return response;
             }
             catch (Exception exception)
             {
                 base.errMsg.ErrorText = "下发消息指令时发生错误!";
                 response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ErrorMsg = base.ErrorMsg;
     return response;
 }
Beispiel #6
0
 public static Response DownData_SelMultiPathAlarm_FJYD(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode commMode, PathAlarmList pathAlarmList)
 {
     Response response;
     if (RemotingClient.app == null)
     {
         return RemotingClient.reResult;
     }
     try
     {
         response = RemotingClient.app.DownData_SelMultiPathAlarm_FJYD(ParamType, CarValues, CarPw, commMode, pathAlarmList);
     }
     catch (SocketException socketException)
     {
         Record.execFileRecord("设置偏航报警(福建移动)", socketException.Message);
         response = RemotingClient.reResult;
     }
     catch (RemotingException remotingException)
     {
         Record.execFileRecord("设置偏航报警(福建移动)", remotingException.Message);
         response = RemotingClient.reResult;
     }
     catch (Exception exception)
     {
         Record.execFileRecord("设置偏航报警(福建移动)", exception.ToString());
         response = RemotingClient.reResult;
     }
     return response;
 }
Beispiel #7
0
 public static Response DownData_SetMultiSegSpeedAlarm(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, PathAlarmList pathAlarmList)
 {
     Response response;
     if (RemotingClient.app == null)
     {
         return RemotingClient.reResult;
     }
     try
     {
         response = RemotingClient.app.DownData_SetMultiSegSpeedAlarm(ParamType, CarValues, CarPw, CommMode, pathAlarmList);
     }
     catch (Exception exception)
     {
         Record.execFileRecord("设置多路线超速报警", exception.Message);
         response = RemotingClient.reResult;
     }
     return response;
 }
Beispiel #8
0
 public GpsResponse iSetPathAlarm(int ParamType, string sCarValue, string sPw, string[] PathList)
 {
     GpsResponse response = new GpsResponse(-1L);
     try
     {
         PathAlarmList pathAlarmList = new PathAlarmList();
         if (PathList.Length <= 0)
         {
             response.ErrorMsg = "没有选择预设路线!";
             Record.execFileRecord("插件操作->设置区域报警", response.ErrorMsg);
             return response;
         }
         StringBuilder builder = new StringBuilder();
         foreach (string str in PathList)
         {
             builder.Append(str + ",");
         }
         DataTable table = RemotingClient.Car_GetPathRouteByPathName(builder.ToString().Trim(new char[] { ',' }));
         if ((table == null) || (table.Rows.Count <= 0))
         {
             response.ErrorMsg = "没有读取到偏移路线数据,请重新设置";
             Record.execFileRecord("插件操作->设置区域报警", response.ErrorMsg);
             return response;
         }
         foreach (DataRow row in table.Rows)
         {
             PathAlarm alarm = new PathAlarm();
             ArrayList list2 = new ArrayList();
             string str2 = row["PathName"] as string;
             string str3 = row["alarmPathDot"] as string;
             if (string.IsNullOrEmpty(str3))
             {
                 response.ErrorMsg = "解析行驶线路失败!";
                 Record.execFileRecord("插件操作->设置区域报警", response.ErrorMsg);
                 return response;
             }
             string[] strArray = str3.Split(new char[] { '/' });
             alarm.PointCount = strArray.Length;
             for (int i = 0; i < (strArray.Length - 1); i++)
             {
                 if (string.IsNullOrEmpty(strArray[i]))
                 {
                     response.ErrorMsg = "解析行驶线路失败!";
                     Record.execFileRecord("插件操作->设置区域报警", response.ErrorMsg);
                     return response;
                 }
                 string[] strArray2 = strArray[i].Split(new char[] { '*' });
                 if (strArray2.Length != 2)
                 {
                     response.ErrorMsg = "解析行驶线路失败!";
                     Record.execFileRecord("插件操作->设置区域报警", response.ErrorMsg);
                     return response;
                 }
                 Point point = new Point {
                     Longitude = double.Parse(strArray2[0]),
                     Latitude = double.Parse(strArray2[1])
                 };
                 list2.Add(point);
             }
             alarm.Points = list2;
             alarm.PathName = str2;
             pathAlarmList.Add(alarm);
         }
         if ((pathAlarmList == null) || (pathAlarmList.Count < 0))
         {
             response.ErrorMsg = "路线信息集合为空!";
             Record.execFileRecord("插件操作->设置区域报警", response.ErrorMsg);
             return response;
         }
         pathAlarmList.OrderCode = CmdParam.OrderCode.设置偏移路线报警;
         Response result = RemotingClient.DownData_SelMultiPathAlarm((CmdParam.ParamType) ParamType, sCarValue, sPw, CmdParam.CommMode.未知方式, pathAlarmList);
         return this.execToResponse(result);
     }
     catch (Exception exception)
     {
         Record.execFileRecord("插件操作->设置偏移路线报警", exception.Message);
         response.ErrorMsg = exception.Message;
         return response;
     }
 }
Beispiel #9
0
 private bool getParam()
 {
     if (base.OrderCode != CmdParam.OrderCode.下载兴趣点)
     {
         this.m_PathAlarmList = new PathAlarmList();
         this.dataFilter("");
         string str2 = this.getCheckPathName();
         if (string.IsNullOrEmpty(str2))
         {
             MessageBox.Show("没有选择预设路线!");
             return false;
         }
         DataTable table4 = RemotingClient.Car_GetPathRouteByPathName(str2);
         if ((table4 == null) || (table4.Rows.Count <= 0))
         {
             MessageBox.Show("没有读取到偏移路线数据,请重新设置");
             return false;
         }
         foreach (DataRow row2 in table4.Rows)
         {
             PathAlarm alarm = new PathAlarm();
             ArrayList list = new ArrayList();
             string str3 = row2["PathName"] as string;
             string str4 = row2["alarmPathDot"] as string;
             if (string.IsNullOrEmpty(str4))
             {
                 MessageBox.Show(ERRORPATHAlARM);
                 return false;
             }
             string[] strArray = str4.Split(new char[] { '/' });
             alarm.PointCount = strArray.Length;
             for (int i = 0; i < (strArray.Length - 1); i++)
             {
                 if (string.IsNullOrEmpty(strArray[i]))
                 {
                     MessageBox.Show(ERRORPATHAlARM);
                     return false;
                 }
                 string[] strArray2 = strArray[i].Split(new char[] { '*' });
                 if (strArray2.Length != 2)
                 {
                     MessageBox.Show(ERRORPATHAlARM);
                     return false;
                 }
                 ParamLibrary.CmdParamInfo.Point point = new ParamLibrary.CmdParamInfo.Point {
                     Longitude = double.Parse(strArray2[0]),
                     Latitude = double.Parse(strArray2[1])
                 };
                 list.Add(point);
             }
             alarm.Points = list;
             alarm.PathName = str3;
             this.m_PathAlarmList.Add(alarm);
         }
         if ((this.m_PathAlarmList == null) || (this.m_PathAlarmList.Count < 0))
         {
             return false;
         }
     }
     else
     {
         int iPoiAutn = 0;
         string str = this.getCheckPathName().Replace("'", "").Replace(",", "/");
         if (string.IsNullOrEmpty(str))
         {
             MessageBox.Show("请选择预下载兴趣点的类别!");
             return false;
         }
         DataTable table = RemotingClient.Car_GetPOIAuth();
         if (((table != null) && (table.Rows.Count > 0)) && (table.Rows[0]["POIAuth"] != DBNull.Value))
         {
             iPoiAutn = int.Parse(table.Rows[0]["POIAuth"].ToString());
         }
         DataTable table2 = RemotingClient.Area_GetUserAreaInfo();
         DataTable table3 = null;
         if ((table2 != null) && (table2.Rows.Count > 0))
         {
             foreach (DataRow row in table2.Rows)
             {
                 if (row["AreaCode"] != DBNull.Value)
                 {
                     table3 = RemotingClient.Car_GetInterestPointMulti(str, iPoiAutn);
                     break;
                 }
             }
         }
         else
         {
             table3 = RemotingClient.Car_GetInterestPointSingle(str, iPoiAutn);
         }
         if ((table3 == null) || (table3.Rows.Count <= 0))
         {
             MessageBox.Show("没有兴趣点,请检查是否设置!");
             return false;
         }
         this.m_SimpleCmd.MapTypes = str;
         this.m_SimpleCmd.InsterestPoints = table3;
     }
     this.m_PathAlarmList.OrderCode = base.OrderCode;
     this.m_SimpleCmd.OrderCode = base.OrderCode;
     return true;
 }
Beispiel #10
0
 public Response icar_SelMultiPathAlarm(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, PathAlarmList pathAlarmList_0)
 {
     Response response = new Response();
     base.WriteLog(paramType_0.ToString(), string_1);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     if (!base.isStartCommon())
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     Car car = new Car();
     int num = -1;
     int newOrderId = -1;
     DataTable table = null;
     object obj2 = null;
     PathAlarm alarm = null;
     object[] objArray = new object[4];
     foreach (Bussiness.CarInfo info in base.carInfoList)
     {
         try
         {
             int num3 = -1;
             newOrderId = SendBase.CarCmdSend.GetNewOrderId();
             base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
             string orderIDParam = response.OrderIDParam;
             response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
             for (int i = 0; i < pathAlarmList_0.Count; i++)
             {
                 alarm = (PathAlarm) pathAlarmList_0[i];
                 table = car.GetNewPathId(info.CarId, alarm.PathName, num3);
                 if ((table == null) || (table.Rows.Count <= 0))
                 {
                     goto Label_037E;
                 }
                 num = int.Parse(table.Rows[0][0].ToString());
                 alarm.ID = num;
                 if (-1 == num)
                 {
                     goto Label_033E;
                 }
                 num3 = int.Parse(table.Rows[0][1].ToString());
                 objArray[0] = num.ToString();
                 objArray[1] = alarm.PointCount.ToString();
                 objArray[2] = this.method_7(alarm.Points);
                 objArray[3] = alarm.PathDif;
                 obj2 = objArray;
                 base.AddUpDataLog(newOrderId, info.CarNum, RespCodeParam.GetRespName(((int) pathAlarmList_0.OrderCode) + 0x80), "");
                 car.InsertPathIdsIntoPathParam(info.CarId, base.WorkId.ToString(), newOrderId.ToString(), alarm.ID.ToString(), num.ToString());
                 if (i == (pathAlarmList_0.Count - 1))
                 {
                     object pvRegions = pathAlarmList_0.pvRegions;
                     car.InsertPathIntoGisCar(info.CarId, base.WorkId, newOrderId, pathAlarmList_0.AlarmPathDot);
                 }
                 response.ResultCode = SendBase.CarCmdSend.icar_SetCommonCmd(base.WorkId, newOrderId, info.SimNum, (CmdParam.CmdCode) pathAlarmList_0.OrderCode, ref obj2, commMode_0);
                 if ((pathAlarmList_0.Count - i) > 1)
                 {
                     Thread.Sleep(300);
                 }
                 if (response.ResultCode != 0L)
                 {
                     base.WriteError(base.WorkId.ToString(), info.SimNum, pathAlarmList_0.OrderCode.ToString());
                 }
                 car.UpdatePathAlarm(info.CarId, alarm.PathName, 1, 0, 0, alarm.ID, "", "", alarm.PathFlag, alarm.DriEnough, alarm.DriNoEnough);
             }
             continue;
         Label_033E:
             response.ErrorMsg = base.errMsg.ErrorText = string.Format("\"{0}\"偏移路线ID已满,请删除部分偏移路线!", info.CarNum);
             base.log.WriteError(base.errMsg);
             return response;
         Label_037E:
             response.ErrorMsg = base.errMsg.ErrorText = string.Format("\"{0}\"获取偏移路线ID失败!", info.CarNum);
             base.log.WriteError(base.errMsg);
             return response;
         }
         catch (Exception exception)
         {
             response.ErrorMsg = base.ErrorMsg = base.errMsg.ErrorText = "下发消息指令时发生错误!";
             base.log.WriteError(base.errMsg, exception);
         }
     }
     return response;
 }
Beispiel #11
0
 public Response DownData_SetMultiSegSpeedAlarm(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, PathAlarmList pathAlarmList)
 {
     try
     {
         return this.myDownData.icar_SetMultiSegSpeedAlarm(ParamType, CarValues, CarPw, CommMode, pathAlarmList);
     }
     catch (Exception exception)
     {
         this.m_LogHelper.WriteError(new ErrorMsg("RemotingServer", "DownData_SetMultiSegSpeedAlarm", exception.ToString()));
         return new Response();
     }
 }
Beispiel #12
0
 private bool getParam()
 {
     DataTable dataSource = this.dgvPath.DataSource as DataTable;
     foreach (DataRow row in dataSource.Rows)
     {
         PathAlarmList item = new PathAlarmList {
             OrderCode = base.OrderCode
         };
         string str = row["pathname"].ToString();
         DataTable table2 = this.datalist[str];
         int num = 1;
         foreach (DataRow row2 in table2.Rows)
         {
             PathAlarm alarm = new PathAlarm();
             ArrayList list2 = new ArrayList();
             alarm.Points = list2;
             alarm.PathName = str;
             alarm.ID = num;
             foreach (string str2 in row2["lanlon"].ToString().Split(new char[] { ';' }))
             {
                 ParamLibrary.CmdParamInfo.Point point = new ParamLibrary.CmdParamInfo.Point();
                 string[] strArray2 = str2.Split(new char[] { ',' });
                 if (strArray2.Length == 2)
                 {
                     point.Latitude = Convert.ToDouble(strArray2[1]);
                     point.Longitude = Convert.ToDouble(strArray2[0]);
                     list2.Add(point);
                 }
             }
             string pStrNum = row2["MaxSpeed"].ToString();
             string str4 = row2["MaxSpeedTm"].ToString();
             if (!Check.isNumeric(pStrNum, Check.NumType.sByte))
             {
                 MessageBox.Show("路线\"" + str + "\"最高时速必须为0-255的数字!");
                 return false;
             }
             alarm.Speed = byte.Parse(pStrNum);
             if (!Check.isNumeric(str4, Check.NumType.sByte) || ((int.Parse(str4) % 5) != 0))
             {
                 MessageBox.Show("路线\"" + str + "\"持续时长必须为0-255之间5的倍数!");
                 return false;
             }
             alarm.Time = byte.Parse(str4);
             alarm.DriEnough = Convert.ToInt32(row2["maxtm"].ToString());
             alarm.DriNoEnough = Convert.ToInt32(row2["mintm"].ToString());
             item.Add(alarm);
             num++;
         }
         string str5 = row["Begintm"].ToString();
         string str6 = row["Endtm"].ToString();
         item.BeginTime = str5;
         item.EndTime = str6;
         item.PathFlag = this.GeneralValue(this.GeneralDomainText(row["pathattr"].ToString()));
         this.sendlist.Add(item);
     }
     return true;
 }