Beispiel #1
0
 protected override void btnOK_Click(object sender, EventArgs e)
 {
     base.btnOK_Click(sender, e);
     if (!string.IsNullOrEmpty(base.sValue))
     {
         try
         {
             if (this.getParam())
             {
                 if (base.OrderCode == CmdParam.OrderCode.停止报警)
                 {
                     base.reResult = RemotingClient.StopAlarmDeal(base.ParamType, base.sValue, base.sPw, CmdParam.CommMode.未知方式, this.m_AlarmInfo, (this.m_cmd.Count > 0) ? this.m_cmd[0] : null);
                 }
                 else
                 {
                     base.reResult = RemotingClient.DownData_SimpleCmd(base.ParamType, base.sValue, base.sPw, CmdParam.CommMode.未知方式, this.m_SimpleCmd);
                 }
                 if (base.reResult.ResultCode != 0L)
                 {
                     MessageBox.Show(base.reResult.ErrorMsg);
                 }
                 else
                 {
                     if ((this._toPlatformContent.Length > 0) && (base.OrderCode == CmdParam.OrderCode.停止报警))
                     {
                         SimpleCmd cmdParameter = new SimpleCmd {
                             OrderCode = CmdParam.OrderCode.主动上报报警处理结果信息
                         };
                         RemotingClient.Car_CommandParameterInsterToDB(base.ParamType, base.sValue, base.sPw, cmdParameter, this._toPlatformContent, "上传处理结果信息");
                         foreach (string str in base.sValue.Split(new char[] { ',' }))
                         {
                             string sCarId = MainForm.myCarList.execChangeCarValue((int) base.ParamType, 1, str);
                             ThreeStateTreeNode node = MainForm.myCarList.tvList.getNodeById(sCarId);
                             if (node != null)
                             {
                                 if (node.CarStatusValue.IndexOf("平台偏离路线") >= 0)
                                 {
                                     RemotingClient.ExecNoQuery(string.Format(" update GpsJtbCarPathAlarm_Platform set stopAlarmTime = dateadd(ss, " + Variable.sStopAlarmTime + ", getdate()) where CarID = '{0}' ", sCarId));
                                 }
                                 else if (node.CarStatusValue.IndexOf("平台区域") >= 0)
                                 {
                                     RemotingClient.ExecNoQuery(string.Format(" update GpsJtbCarRegionAlarm_Platform set stopAlarmTime = dateadd(ss, " + Variable.sStopAlarmTime + ", getdate()) where CarID = '{0}' ", sCarId));
                                 }
                                 else if (node.CarStatusValue.IndexOf("平台分路段限速") >= 0)
                                 {
                                     RemotingClient.ExecNoQuery(string.Format(" update GpsJtbCarPathSegmentAlarm_Platform set stopAlarmTime = dateadd(ss, " + Variable.sStopAlarmTime + ", getdate()) where CarID = '{0}' ", sCarId));
                                 }
                             }
                         }
                     }
                     base.DialogResult = DialogResult.OK;
                 }
             }
         }
         catch (Exception exception)
         {
             Record.execFileRecord("停止报警->确定", exception.Message);
         }
     }
 }
Beispiel #2
0
 public Response Car_CommandParameterInsterToDB(Car myCar, CmdParam.ParamType paramType, string CarValues, string CarPw, SimpleCmd cmdParameter, string cmdContent, string desc)
 {
     Response response = new Response();
     string str = cmdParameter.OrderCode.ToString();
     if (!base.CheckCar(paramType, CarValues, CarPw))
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     if (!base.isStartCommon())
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     foreach (Bussiness.CarInfo info in base.carInfoList)
     {
         int num = -1;
         int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
         int num3 = SendBase.CarCmdSend.CalOrderId(base.WorkId, newOrderId);
         try
         {
             num = myCar.InsertCommandParameterToDB(info.SimNum, num3, (int) cmdParameter.CmdCode, cmdContent);
         }
         catch (Exception exception)
         {
             base.userInfo.DownCommd.AddCarNewLogData(newOrderId, (cmdParameter.OrderCode == CmdParam.OrderCode.平台查岗应答) ? "" : info.CarNum, "发送", cmdParameter.OrderCode.ToString(), "失败", "", "错误信息:" + exception.Message);
             continue;
         }
         if ((num > 0) && (cmdParameter.OrderCode != CmdParam.OrderCode.主动上报报警处理结果信息))
         {
             base.userInfo.DownCommd.AddCarNewLogData(newOrderId, (cmdParameter.OrderCode == CmdParam.OrderCode.平台查岗应答) ? "" : info.CarNum, "发送", str, "成功", "", desc);
             //将状态从等待修改为成功 huzh,2014.1.24
         }
         response.ResultCode = 0L;
     }
     return response;
 }
Beispiel #3
0
 public SimpleCmd GetDutyEntity()
 {
     SimpleCmd cmd = new SimpleCmd();
     int num = 0;
     int num2 = 0;
     int num3 = 0;
     if (this.chkOnDuty.Checked)
     {
         num = 1;
     }
     if (this.chkStopGSM.Checked)
     {
         num2 = 16384;
     }
     if (this.chkStopDataCall.Checked)
     {
         num3 = 16384;
     }
     cmd.OrderCode = CmdParam.OrderCode.设置车台参数;
     cmd.OnDuty = num;
     cmd.CloseGSM = num2;
     cmd.CloseDail = num3;
     return cmd;
 }
Beispiel #4
0
        public Response icar_SimpleCmd(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, SimpleCmd simpleCmd)
        {
            Response response = new Response();
            string paramDisc = simpleCmd.GetParamDisc();
            base.WriteLog(ParamType.ToString(), CarValues + paramDisc);
            if (!base.CheckCar(ParamType, CarValues, CarPw))
            {
                response.ErrorMsg = base.ErrorMsg;
                return response;
            }
            string strErrorMsg = string.Empty;
            if (simpleCmd.CheckData(out strErrorMsg) != 0)
            {
                response.ErrorMsg = strErrorMsg;
                return response;
            }
            if (!base.isStartCommon())
            {
                response.ErrorMsg = base.ErrorMsg;
                return response;
            }
            object pvArg = null;
            int newOrderId = -1;
            foreach (Bussiness.CarInfo info in base.carInfoList)
            {
                try
                {
                    if (simpleCmd.OrderCode == CmdParam.OrderCode.设置车台参数)
                    {
                        response.ResultCode = new Car().UpdateCarconfigOnDuty(info.CarId, simpleCmd.OnDuty, simpleCmd.CloseGSM, simpleCmd.CloseDail);
                    }
                    newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                    base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                    string orderIDParam = response.OrderIDParam;
                    response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                    base.AddUpDataLog(newOrderId, info.CarNum, simpleCmd.OrderCode.ToString(), paramDisc);
                    switch (simpleCmd.CmdCode)
                    {
                        case CmdParam.CmdCode.取消区域报警:
                            new Car().InsertRegionIdsIntoGisCar(info.CarId, base.WorkId.ToString(), newOrderId.ToString(), simpleCmd.RegionIds);
                            break;

                        case CmdParam.CmdCode.取消路线报警:
                            new Car().InsertPathIdsIntoGisCar(info.CarId, base.WorkId.ToString(), newOrderId.ToString(), simpleCmd.RegionIds.Trim(new char[] { '\\' }).Equals("0") ? "" : simpleCmd.RegionIds);
                            break;

                        case CmdParam.CmdCode.配置串口参数:
                            if (response.ResultCode == 0L)
                            {
                                new Car().InsertGpsCarDeviceParam(info.CarId, base.WorkId, newOrderId, simpleCmd.Com1Device, simpleCmd.Com2Device);
                            }
                            break;
                    }
                    if (info.ProtocolName == SendBase.m_ProtocolName)
                    {
                        int orderID = base.CalOrderId(base.WorkId, newOrderId);
                        string conntent = string.Empty;
                        simpleCmd.TransformCode = CmdParam.TrafficProtocolCodeExchange2((int) simpleCmd.OrderCode);
                        string str4 = string.Empty;
                        if (simpleCmd.CmdCode == CmdParam.CmdCode.取消区域报警)
                        {
                            try
                            {
                                string[] strArray = simpleCmd.RegionIds.Split(@"\".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                                string[] strArray2 = simpleCmd.RegionTypes.Split(@"\".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                                if (strArray2.Length <= 0)
                                {
                                    throw new Exception();
                                }
                                List<string> list = new List<string>();
                                List<string> list2 = new List<string>();
                                for (int i = 1; i <= 3; i++)
                                {
                                    for (int j = 0; j < strArray2.Length; j++)
                                    {
                                        if (strArray2[j].Equals(i.ToString()))
                                        {
                                            list.Add(strArray[j]);
                                            list2.Add(i.ToString());
                                        }
                                    }
                                    if (list.Count != 0)
                                    {
                                        simpleCmd.RegionIds = string.Join(@"\", list.ToArray());
                                        simpleCmd.RegionTypes = string.Join(@"\", list2.ToArray());
                                        str4 = simpleCmd.ToXmlString(orderID, info.SimNum, SendBase.m_ProtocolName, (int) CommMode, "SimpleCmd", ref conntent);
                                        list.Clear();
                                        list2.Clear();
                                        response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, simpleCmd.TransformCode, (int) CommMode, str4);
                                    }
                                }
                            }
                            catch (Exception)
                            {
                                base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", simpleCmd.OrderCode.ToString(), "失败", "", "终端不支持该命令");
                                response.ErrorMsg = "终端不支持该命令";
                            }
                        }
                        else if ((simpleCmd.OrderCode != CmdParam.OrderCode.取消出入口分段超速报警) && (simpleCmd.OrderCode != CmdParam.OrderCode.取消所有关键区域))
                        {
                            if ((simpleCmd.OrderCode == CmdParam.OrderCode.取消偏移路线报警) && simpleCmd.RegionIds.Trim(new char[] { '\\' }).Equals("0"))
                            {
                                simpleCmd.RegionIds = "";
                            }
                            str4 = simpleCmd.ToXmlString(orderID, info.SimNum, SendBase.m_ProtocolName, (int) CommMode, "SimpleCmd", ref conntent);
                            response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, simpleCmd.TransformCode, (int) CommMode, str4);
                        }
                        else
                        {
                            TrafficRawPackage package = new TrafficRawPackage {
                                OrderCode = CmdParam.OrderCode.命令透传,
                                SubOrderCode = simpleCmd.OrderCode,
                                strText = ""
                            };
                            str4 = package.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, -1, "SendRawPackage", ref conntent);
                            response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) package.OrderCode, -1, str4);
                        }
                    }
                    else
                    {
                        pvArg = simpleCmd.pvArg;
                        response.ResultCode = SendBase.CarCmdSend.icar_SimpleCmd(base.WorkId, newOrderId, info.SimNum, simpleCmd.CmdCode, ref pvArg);
                    }
                    if (response.ResultCode != 0L)
                    {
                        base.WriteError(base.WorkId.ToString(), info.SimNum, simpleCmd.OrderCode.ToString());
                    }
                    response.ResultCode = 0L;
                }
                catch (Exception exception)
                {
                    response.ErrorMsg = "下发消息指令时发生错误,错误详细信息:" + exception.Message;
                }
            }
            return response;
        }
Beispiel #5
0
 public static Response Car_CommandParameterInsterToDB(CmdParam.ParamType ParamType, string CarVals, string sPwd, SimpleCmd cmdParameter, string cmdContent, string discription)
 {
     Response dB;
     if (RemotingClient.app == null)
     {
         return RemotingClient.reResult;
     }
     try
     {
         dB = RemotingClient.app.Car_CommandParameterInsterToDB(ParamType, CarVals, sPwd, cmdParameter, cmdContent, discription);
     }
     catch (SocketException socketException)
     {
         Record.execFileRecord("交通部协议指令", socketException.Message);
         dB = RemotingClient.reResult;
     }
     catch (RemotingException remotingException)
     {
         Record.execFileRecord("交通部协议指令", remotingException.Message);
         dB = RemotingClient.reResult;
     }
     catch (Exception exception)
     {
         Record.execFileRecord("交通部协议指令", exception.ToString());
         dB = RemotingClient.reResult;
     }
     return dB;
 }
Beispiel #6
0
 public static Response DownData_SimpleCmd(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, SimpleCmd simpleCmd)
 {
     Response response;
     if (RemotingClient.app == null)
     {
         return RemotingClient.reResult;
     }
     try
     {
         response = RemotingClient.app.DownData_SimpleCmd(ParamType, CarValues, CarPw, CommMode, simpleCmd);
     }
     catch (Exception exception)
     {
         Record.execFileRecord("简单车台命令", exception.Message);
         response = RemotingClient.reResult;
     }
     return response;
 }
Beispiel #7
0
 public static Response DownData_SetCommonCmd_FJYD(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, SimpleCmd simpleCmd)
 {
     Response response;
     if (RemotingClient.app == null)
     {
         return RemotingClient.reResult;
     }
     try
     {
         if (simpleCmd.CmdParams != null)
         {
             string str = "";
             foreach (string[] cmdParam in simpleCmd.CmdParams)
             {
                 string[] strArrays = cmdParam;
                 for (int i = 0; i < (int)strArrays.Length; i++)
                 {
                     str = string.Concat(str, strArrays[i], ";");
                 }
                 char[] chrArray = new char[] { ';' };
                 str = string.Concat(str.Trim(chrArray), "|");
             }
             string str1 = simpleCmd.OrderCode.ToString();
             char[] chrArray1 = new char[] { '|' };
             Record.execFileRecord(str1, str.Trim(chrArray1));
         }
         response = RemotingClient.app.DownData_SetCommonCmd_FJYD(ParamType, CarValues, CarPw, CommMode, simpleCmd);
     }
     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 #8
0
 private void m2mSmallArea_FormClosing(object sender, FormClosingEventArgs e)
 {
     if ("发送抢答".Equals(this.sCurrentStatus) && (MessageBox.Show("正得等待抢答,确定要退出吗?", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK))
     {
         e.Cancel = true;
     }
     else
     {
         try
         {
             this.worder = null;
             this.arrCarLst.Clear();
             this.arrCarLst = null;
             this.m_SimpleCmd = null;
         }
         catch (Exception exception)
         {
             Record.execFileRecord("电召->关闭窗体", exception.Message);
         }
     }
 }
Beispiel #9
0
 public Response icar_SetTextMsg(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, TxtMsg txtMsg_0, string string_3, string string_4)
 {
     Response response = new Response();
     if (string.IsNullOrEmpty(string_1))
     {
         DataTable table = base.GetCarInfoByArea(txtMsg_0.LLon, txtMsg_0.LLat, txtMsg_0.RLon, txtMsg_0.RLat, string_3, string_4);
         if ((table != null) && (table.Rows.Count > 0))
         {
             foreach (DataRow row in table.Rows)
             {
                 string_1 = string_1 + row["telephone"].ToString() + ",";
             }
             string_1 = string_1.Trim(new char[] { ',' });
         }
         if (string.IsNullOrEmpty(string_1))
         {
             response.ErrorMsg = "没有存在下发的车辆!";
             return response;
         }
     }
     base.logMsg.FunctionName = "icar_SetTextMsg";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1 + ",指令-" + txtMsg_0.OrderCode.ToString();
     string msg = base.logMsg.Msg;
     base.log.WriteLog(base.logMsg);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     if (!base.isStartCommon())
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     new Car();
     foreach (Bussiness.CarInfo info in base.carInfoList)
     {
         try
         {
             int newOrderId = SendBase.CarCmdSend.GetNewOrderId();
             if (info.ProtocolName == SendBase.m_ProtocolName)
             {
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", txtMsg_0.OrderCode.ToString(), "等待", "", msg);
                 string orderIDParam = response.OrderIDParam;
                 response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 string conntent = "";
                 string str3 = txtMsg_0.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SetTextMsg", ref conntent);
                 response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) txtMsg_0.OrderCode, (int) commMode_0, str3);
             }
             else if ((txtMsg_0.OrderCode == CmdParam.OrderCode.电召指令) && (txtMsg_0.MsgType == CmdParam.MsgType.电召信息))
             {
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", txtMsg_0.OrderCode.ToString(), "等待", "", msg);
                 string str4 = base.WorkId.ToString() + SendBase.CarCmdSend.GetNewOrderId().ToString();
                 response.SvcContext = str4;
                 string str6 = response.OrderIDParam;
                 response.OrderIDParam = str6 + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 object obj2 = this.method_9(info.SimNum, txtMsg_0.TelNumber, txtMsg_0.strMsg, str4, txtMsg_0.Way, txtMsg_0.LLon + "," + txtMsg_0.LLat + "," + txtMsg_0.RLon + "," + txtMsg_0.RLat);
                 response.ResultCode = SendBase.CarCmdSend.icar_SetCommonCmd(base.WorkId, newOrderId, info.SimNum, CmdParam.CmdCode.电召指令, ref obj2, commMode_0);
             }
             else if (txtMsg_0.OrderCode == CmdParam.OrderCode.拨打电话号码)
             {
                 base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", txtMsg_0.OrderCode.ToString(), "等待", "", msg);
                 string str7 = response.OrderIDParam;
                 response.OrderIDParam = str7 + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                 SimpleCmd cmd = new SimpleCmd {
                     OrderCode = CmdParam.OrderCode.抢答确认指令
                 };
                 new ArrayList();
                 string[] strArray = new string[] { txtMsg_0.sPhone, txtMsg_0.TelNumber, txtMsg_0.strMsg, txtMsg_0.Orderid, txtMsg_0.sCarName };
                 object obj3 = this.method_6(strArray);
                 response.ResultCode = SendBase.CarCmdSend.icar_SetCommonCmd(base.WorkId, newOrderId, info.SimNum, cmd.CmdCode, ref obj3, commMode_0);
             }
             else
             {
                 base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", txtMsg_0.OrderCode.ToString(), "失败", "", "错误描述:该车辆终端不支持此操作。");
                 response.ErrorMsg = "终端不支持该协议";
             }
         }
         catch (Exception exception)
         {
             response.ErrorMsg = exception.Message;
             return response;
         }
     }
     return response;
 }
Beispiel #10
0
        public Response icar_SetCommonCmd(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, SimpleCmd simpleCmd_0)
        {
            Response response = new Response();
            string str = "";
            foreach (string[] strArray in simpleCmd_0.CmdParams)
            {
                string str2 = str;
                str = str2 + "命令码-" + simpleCmd_0.OrderCode.ToString() + ",参数-" + this.method_5(strArray, 0) + ";";
            }
            base.WriteLog(paramType_0.ToString(), string_1 + "," + str);
            if (!base.CheckCar(paramType_0, string_1, string_2))
            {
                response.ErrorMsg = base.ErrorMsg;
                return response;
            }
            if (!base.isStartCommon())
            {
                response.ErrorMsg = base.ErrorMsg;
                return response;
            }
            if ((simpleCmd_0.CmdParams != null) && (simpleCmd_0.CmdParams.Count > 0))
            {
                object obj2 = null;
                int newOrderId = -1;
                foreach (Bussiness.CarInfo info in base.carInfoList)
                {
                    try
                    {
                        int num2 = 0;
                        newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                        base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                        string orderIDParam = response.OrderIDParam;
                        response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                        foreach (string[] strArray2 in simpleCmd_0.CmdParams)
                        {
                            base.AddUpDataLog(newOrderId, info.CarNum, simpleCmd_0.OrderCode.ToString(), this.method_5(strArray2, (int) simpleCmd_0.OrderCode));
                            obj2 = this.method_6(strArray2);
                            switch (simpleCmd_0.CmdCode)
                            {
                                case CmdParam.CmdCode.取消区域报警:
                                    new Car().InsertRegionIdsIntoGisCar(info.CarId, base.WorkId.ToString(), newOrderId.ToString(), strArray2[0]);
                                    break;

                                case CmdParam.CmdCode.取消路线报警:
                                    new Car().InsertPathIdsIntoGisCar(info.CarId, base.WorkId.ToString(), newOrderId.ToString(), strArray2[0]);
                                    break;
                            }
                            response.ResultCode = SendBase.CarCmdSend.icar_SetCommonCmd(base.WorkId, newOrderId, info.SimNum, simpleCmd_0.CmdCode, ref obj2, commMode_0);
                            if ((simpleCmd_0.CmdParams.Count - num2) > 1)
                            {
                                Thread.Sleep(500);
                            }
                            num2++;
                            if (response.ResultCode != 0L)
                            {
                                base.WriteError(base.WorkId.ToString(), info.SimNum, simpleCmd_0.OrderCode.ToString());
                            }
                            else if (simpleCmd_0.OrderCode == CmdParam.OrderCode.实时点名查询)
                            {
                                base.userInfo.CarFilter.UpdatePosSearchFlag(simpleCmd_0.OrderCode.ToString(), newOrderId, info.CarId);
                            }
                        }
                    }
                    catch (Exception exception)
                    {
                        response.ErrorMsg = "下发消息指令时发生错误,错误详细信息:" + exception.Message;
                        base.log.WriteError(base.errMsg, exception);
                    }
                }
                return response;
            }
            response.ResultCode = -1L;
            response.ErrorMsg = "下发参数为空!";
            return response;
        }
Beispiel #11
0
 public Response icar_SendRawPackage(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, SimpleCmd simpleCmd_0)
 {
     Response response = new Response();
     string str = "";
     foreach (string[] strArray in simpleCmd_0.CmdParams)
     {
         string str8 = str;
         str = str8 + "命令码-" + simpleCmd_0.OrderCode.ToString() + ",参数-" + this.method_5(strArray, 0) + ";";
     }
     base.WriteLog(paramType_0.ToString(), string_1 + "," + str);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     if (!base.isStartCommon())
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     if ((simpleCmd_0.CmdParams != null) && (simpleCmd_0.CmdParams.Count > 0))
     {
         int newOrderId = -1;
         object objectArg = null;
         byte[] bytes = null;
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 foreach (string[] strArray2 in simpleCmd_0.CmdParams)
                 {
                     newOrderId = SendBase.CarCmdSend.GetNewOrderId();
                     base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
                     string orderIDParam = response.OrderIDParam;
                     response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
                     base.AddUpDataLog(newOrderId, info.CarNum, simpleCmd_0.OrderCode.ToString(), this.method_5(strArray2, (int) simpleCmd_0.OrderCode));
                     if (simpleCmd_0.OrderCode == CmdParam.OrderCode.回拔坐席电话指令)
                     {
                         bytes = Encoding.GetEncoding("gb2312").GetBytes(strArray2[0]);
                         byte[] array = new byte[15];
                         bytes.CopyTo(array, 0);
                         objectArg = array;
                     }
                     if (simpleCmd_0.OrderCode == CmdParam.OrderCode.设置油耗仪参数)
                     {
                         objectArg = new Oix().GetObjectArg(strArray2);
                     }
                     if (simpleCmd_0.OrderCode == CmdParam.OrderCode.设置出入口分段超速报警)
                     {
                         Car car = new Car();
                         string[] strArray3 = simpleCmd_0.CmdParams[0] as string[];
                         Hashtable hashtable = new Hashtable();
                         for (int i = 0; i < (strArray3.Length / 8); i++)
                         {
                             if (!hashtable.Contains(strArray3[i * 8]))
                             {
                                 car.Car_AddPassWayPathIdToTmp(info.CarId, base.WorkId, newOrderId, strArray3[i * 8], strArray3[(i * 8) + 1], (Convert.ToDouble(strArray3[(i * 8) + 6]) > 0.0) ? ((int) Convert.ToDouble(strArray3[(i * 8) + 6])) : ((int) Convert.ToDouble(strArray3[(i * 8) + 7])));
                                 hashtable[strArray3[i * 8]] = null;
                             }
                         }
                         objectArg = simpleCmd_0.pvArg;
                     }
                     if (info.ProtocolName == SendBase.m_ProtocolName)
                     {
                         if (simpleCmd_0.OrderCode == CmdParam.OrderCode.设置关键区域)
                         {
                             TrafficRawPackage package = new TrafficRawPackage {
                                 OrderCode = CmdParam.OrderCode.命令透传,
                                 SubOrderCode = simpleCmd_0.OrderCode
                             };
                             Car car2 = new Car();
                             StringBuilder builder = new StringBuilder();
                             builder.Append((strArray2.Length / 8).ToString("X4"));
                             for (int j = 0; j < strArray2.Length; j += 8)
                             {
                                 builder.Append(Convert.ToInt32(strArray2[j]).ToString("X8"));
                                 builder.Append(Convert.ToByte(strArray2[j + 1]).ToString("X2"));
                                 builder.Append(((int) (Convert.ToDouble(strArray2[j + 2]) * 1000000.0)).ToString("X8"));
                                 builder.Append(((int) (Convert.ToDouble(strArray2[j + 3]) * 1000000.0)).ToString("X8"));
                                 if (string.IsNullOrEmpty(strArray2[j + 5]))
                                 {
                                     builder.Append(Convert.ToInt32(strArray2[j + 4]).ToString("X8"));
                                     builder.Append("00000000");
                                 }
                                 else
                                 {
                                     builder.Append(((int) (Convert.ToDouble(strArray2[j + 4]) * 1000000.0)).ToString("X8"));
                                     builder.Append(((int) (Convert.ToDouble(strArray2[j + 5]) * 1000000.0)).ToString("X8"));
                                 }
                                 builder.Append(Convert.ToByte(strArray2[j + 6]).ToString("X2"));
                                 builder.Append(Convert.ToInt32(strArray2[j + 7]).ToString("X8"));
                                 if (car2.SetCriticalRegionToTmp(info.CarId, base.WorkId, newOrderId, strArray2[j], strArray2[j + 6], strArray2[j + 7]) != 0)
                                 {
                                     base.WriteError(base.WorkId.ToString(), info.SimNum, simpleCmd_0.OrderCode.ToString() + "-参数保存失败-" + strArray2[j] + "," + strArray2[j + 6] + "," + strArray2[j + 7]);
                                 }
                             }
                             package.strText = builder.ToString();
                             string conntent = "";
                             string str3 = package.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SendRawPackage", ref conntent);
                             response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) package.OrderCode, (int) commMode_0, str3);
                         }
                         else if (simpleCmd_0.OrderCode == CmdParam.OrderCode.设置出入口分段超速报警)
                         {
                             TrafficRawPackage package2 = new TrafficRawPackage {
                                 OrderCode = CmdParam.OrderCode.命令透传,
                                 SubOrderCode = simpleCmd_0.OrderCode
                             };
                             StringBuilder builder2 = new StringBuilder();
                             byte[] pvArg = (byte[]) simpleCmd_0.pvArg;
                             if (pvArg != null)
                             {
                                 for (int k = 0; k < pvArg.Length; k++)
                                 {
                                     if (((k + 1) % 0x16) == 1)
                                     {
                                         byte[] buffer4 = new byte[4];
                                         for (int m = 0; m < 4; m++)
                                         {
                                             buffer4[m] = pvArg[k + m];
                                         }
                                         k += 3;
                                         builder2.Append(BitConverter.ToInt32(buffer4, 0).ToString("X8"));
                                     }
                                     else
                                     {
                                         builder2.Append(pvArg[k].ToString("X2"));
                                     }
                                 }
                             }
                             package2.strText = builder2.ToString();
                             string str4 = "";
                             string str5 = package2.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SendRawPackage", ref str4);
                             response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) package2.OrderCode, (int) commMode_0, str5);
                         }
                         else
                         {
                             string str6 = "";
                             string str7 = simpleCmd_0.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SimpleCmd", ref str6);
                             response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) simpleCmd_0.OrderCode, (int) commMode_0, str7);
                         }
                     }
                     else
                     {
                         response.ResultCode = SendBase.CarCmdSend.icar_SendRawPackage(base.WorkId, newOrderId, info.SimNum, simpleCmd_0.CmdCode, ref objectArg, commMode_0);
                     }
                     if (response.ResultCode != 0L)
                     {
                         base.WriteError(base.WorkId.ToString(), info.SimNum, simpleCmd_0.OrderCode.ToString());
                     }
                 }
             }
             catch (Exception exception)
             {
                 response.ErrorMsg = "下发消息指令时发生错误,错误详细信息:" + exception.Message;
                 base.log.WriteError(base.errMsg, exception);
             }
         }
         return response;
     }
     response.ResultCode = -1L;
     response.ErrorMsg = "下发参数为空!";
     return response;
 }
Beispiel #12
0
 public Response icar_SetCommonCmd(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, SimpleCmd simpleCmd_0)
 {
     Response response = new Response();
     string str = "";
     if ((simpleCmd_0.CmdParams != null) && (simpleCmd_0.CmdParams.Count > 0))
     {
         foreach (string[] strArray in simpleCmd_0.CmdParams)
         {
             string str6 = str;
             str = str6 + "命令码-" + simpleCmd_0.OrderCode.ToString() + ",参数-" + this.method_5(strArray, 0) + ";";
         }
     }
     base.WriteLog(paramType_0.ToString(), string_1 + "," + str);
     if (!base.CheckCar(paramType_0, string_1, string_2))
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     if (!base.isStartCommon())
     {
         response.ErrorMsg = base.ErrorMsg;
         return response;
     }
     object obj2 = null;
     int newOrderId = -1;
     foreach (Bussiness.CarInfo info in base.carInfoList)
     {
         try
         {
             newOrderId = SendBase.CarCmdSend.GetNewOrderId();
             int num2 = 0;
             base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";");
             string orderIDParam = response.OrderIDParam;
             response.OrderIDParam = orderIDParam + newOrderId.ToString() + "|" + info.CarId.ToString() + ";";
             if ((simpleCmd_0.CmdParams != null) && (simpleCmd_0.CmdParams.Count > 0))
             {
                 if (info.ProtocolName == SendBase.m_ProtocolName)
                 {
                     string conntent = "";
                     string str5 = simpleCmd_0.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SimpleCmd", ref conntent);
                     base.AddUpDataLog(newOrderId, info.CarNum, simpleCmd_0.OrderCode.ToString(), conntent);
                     response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) simpleCmd_0.OrderCode, (int) commMode_0, str5);
                 }
                 else
                 {
                     foreach (string[] strArray2 in simpleCmd_0.CmdParams)
                     {
                         base.AddUpDataLog(newOrderId, info.CarNum, simpleCmd_0.OrderCode.ToString(), this.method_5(strArray2, (int) simpleCmd_0.OrderCode));
                         obj2 = this.method_6(strArray2);
                         response.ResultCode = SendBase.CarCmdSend.icar_SetCommonCmd(base.WorkId, newOrderId, info.SimNum, simpleCmd_0.CmdCode, ref obj2, commMode_0);
                         if ((simpleCmd_0.CmdParams.Count - num2) > 1)
                         {
                             Thread.Sleep(0x7d0);
                         }
                         num2++;
                         if (response.ResultCode != 0L)
                         {
                             base.WriteError(base.WorkId.ToString(), info.SimNum, simpleCmd_0.OrderCode.ToString());
                         }
                     }
                 }
             }
             else
             {
                 base.AddUpDataLog(newOrderId, info.CarNum, simpleCmd_0.OrderCode.ToString(), "");
                 if (info.ProtocolName == SendBase.m_ProtocolName)
                 {
                     string str2 = string.Empty;
                     string str3 = simpleCmd_0.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SimpleCmd", ref str2);
                     response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) simpleCmd_0.OrderCode, (int) commMode_0, str3);
                 }
                 else
                 {
                     response.ResultCode = SendBase.CarCmdSend.icar_SetCommonCmd(base.WorkId, newOrderId, info.SimNum, simpleCmd_0.CmdCode, ref obj2, commMode_0);
                 }
                 if (response.ResultCode != 0L)
                 {
                     base.WriteError(base.WorkId.ToString(), info.SimNum, simpleCmd_0.OrderCode.ToString());
                 }
                 else if (simpleCmd_0.OrderCode == CmdParam.OrderCode.LBS位置查询)
                 {
                     base.userInfo.CarFilter.UpdatePosSearchFlag(simpleCmd_0.OrderCode.ToString(), newOrderId, info.CarId);
                 }
             }
         }
         catch (Exception exception)
         {
             response.ErrorMsg = "下发消息指令时发生错误,错误详细信息:" + exception.Message;
             base.log.WriteError(base.errMsg, exception);
         }
     }
     return response;
 }
Beispiel #13
0
 public Response Car_CommandParameterInsterToDB(CmdParam.ParamType ParamType, string CarValues, string CarPw, SimpleCmd cmdParameter, string cmdContent, string desc)
 {
     try
     {
         return this.myDownDataYD.Car_CommandParameterInsterToDB(this.myCar, ParamType, CarValues, CarPw, cmdParameter, cmdContent, desc);
     }
     catch (Exception exception)
     {
         this.m_LogHelper.WriteError(new ErrorMsg("RemotingServer", "Car_CommandParameterInsterToDB", exception.ToString()));
         return new Response();
     }
 }
Beispiel #14
0
 public Response DownData_SimpleCmd(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, SimpleCmd simpleCmd)
 {
     try
     {
         return this.myDownData.icar_SimpleCmd(ParamType, CarValues, CarPw, CommMode, simpleCmd);
     }
     catch (Exception exception)
     {
         this.m_LogHelper.WriteError(new ErrorMsg("RemotingServer", "DownData_SimpleCmd", exception.ToString()));
         return new Response();
     }
 }
Beispiel #15
0
        /// <summary>
        /// 右键菜单事件响应
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AllMenu_Click(object sender, EventArgs e)
        {
            if (this.CheckSlectedCarCnt())
            {
                ToolStripMenuItem item = sender as ToolStripMenuItem;
                if (item.Tag != null)
                {
                    this.OpenDialog(item.Tag.ToString().Trim(), item.Text);
                }
                else
                {
                    SimpleCmd cmdParameter = new SimpleCmd();
                    string carVals = myCarList.SelectedCarId.Split(new char[] { ',' })[0];

                    //if (item.Name.Equals("MenuItemJtbLogOutLinkRout"))
                    //{
                    //    if (MessageBox.Show("是否确定注销主链路", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                    //    {
                    //        cmdParameter.OrderCode = CmdParam.OrderCode.注销主链路;
                    //        RemotingClient.Car_CommandParameterInsterToDB(CmdParam.ParamType.CarId, carVals, "", cmdParameter, "", CmdParam.OrderCode.注销主链路.ToString());
                    //    }
                    //}
                    //else if (item.Name.Equals("MenuItemMenuItemJtbResumeLinkRout"))
                    //{
                    //    if (MessageBox.Show("是否确定恢复主链路", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                    //    {
                    //        cmdParameter.OrderCode = CmdParam.OrderCode.恢复主链路;
                    //        RemotingClient.Car_CommandParameterInsterToDB(CmdParam.ParamType.CarId, carVals, "", cmdParameter, "", CmdParam.OrderCode.恢复主链路.ToString());
                    //    }
                    //}
                    //else if (item.Name.Equals("MenuItemJtbCloseLinkRout"))
                    //{
                    //    if (MessageBox.Show("是否确定主动关闭主从链路通知", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                    //    {
                    //        cmdParameter.OrderCode = CmdParam.OrderCode.主动关闭主从链路通知;
                    //        RemotingClient.Car_CommandParameterInsterToDB(CmdParam.ParamType.CarId, carVals, "", cmdParameter, "", CmdParam.OrderCode.主动关闭主从链路通知.ToString());
                    //    }
                    //}
                    //else if (item.Name.Equals("MenuItemJtbCloseMainLinkRout") && (MessageBox.Show("是否确定主动关闭主链路通知", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK))
                    //{
                    //    cmdParameter.OrderCode = CmdParam.OrderCode.主动关闭主链路通知;
                    //    RemotingClient.Car_CommandParameterInsterToDB(CmdParam.ParamType.CarId, carVals, "", cmdParameter, "", CmdParam.OrderCode.主动关闭主链路通知.ToString());
                    //}
                }
            }
        }