예제 #1
0
파일: DownData.cs 프로젝트: lexzh/Myproject
 public Response icar_SetAlarmFlag(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, AlarmEntity alarmEntity_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SetAlarmFlag";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1;
     string str = string.Concat(new object[] { "报警器开关标志位-", alarmEntity_0.CarAlarmSwitch.ToString(), ",报警器类型标志位-", alarmEntity_0.CarAlarmFlag.ToString(), ",扩展报警器开关标志位:", alarmEntity_0.CarAlarmSwitchEx, ",报警器类型标志位", alarmEntity_0.CarShowAlarmEx.ToString() });
     base.logMsg.Msg = base.logMsg.Msg + "," + str;
     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
             {
                 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, "发送", alarmEntity_0.OrderCode.ToString(), "等待", "", str);
                 new Car().InsertAlamFlagIntoGisCar(info.CarId, base.WorkId.ToString(), newOrderId, (int) alarmEntity_0.CarAlarmSwitch, (int) alarmEntity_0.CarAlarmFlag, (int) alarmEntity_0.CarShowAlarm, (long) alarmEntity_0.AlarmFlagType, alarmEntity_0.AlarmFlagEx, alarmEntity_0.CarAlarmSwitchEx, alarmEntity_0.CarShowAlarmEx);
                 if (info.ProtocolName == SendBase.m_ProtocolName)
                 {
                     alarmEntity_0.TransformCode = (int) alarmEntity_0.AlarmFlagType;
                     string conntent = "";
                     string str3 = alarmEntity_0.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, (int) commMode_0, "SetCommArg", ref conntent);
                     response.ResultCode = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, alarmEntity_0.TransformCode, (int) commMode_0, str3);
                 }
                 else
                 {
                     response.ResultCode = SendBase.CarCmdSend.icar_SetAlarmFlag(base.WorkId, newOrderId, info.SimNum, (int) alarmEntity_0.CarAlarmSwitch, (int) alarmEntity_0.CarAlarmFlag);
                 }
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SetAlarmFlag";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", alarmEntity_0.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 response.ResultCode = 0L;
             }
             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;
 }
예제 #2
0
파일: DownData.cs 프로젝트: lexzh/Myproject
 public Response icar_SetCustomAlarmer(CmdParam.ParamType paramType_0, string string_1, string string_2, CmdParam.CommMode commMode_0, AlarmEntity alarmEntity_0)
 {
     Response response = new Response();
     base.logMsg.FunctionName = "icar_SetCustomAlarmer";
     base.logMsg.Msg = "发送:类型-" + paramType_0.ToString() + ",车辆-" + string_1 + ",指令-" + alarmEntity_0.OrderCode.ToString();
     string str = "配置自定义报警器";
     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;
     }
     string strErrorMsg = string.Empty;
     if (alarmEntity_0.CheckData(out strErrorMsg) != 0)
     {
         response.ErrorMsg = strErrorMsg;
         return response;
     }
     if (base.isStartCommon())
     {
         foreach (Bussiness.CarInfo info in base.carInfoList)
         {
             try
             {
                 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, "发送", alarmEntity_0.OrderCode.ToString(), "等待", "", str);
                 new Car().InsertCustAlarmIntoGisCar(info.CarId, base.WorkId.ToString(), newOrderId, alarmEntity_0.CarAlarmSwitch, alarmEntity_0.CarAlarmFlag, alarmEntity_0.CarShowAlarm, alarmEntity_0.Level, alarmEntity_0.CustName);
                 response.ResultCode = SendBase.CarCmdSend.icar_SetCustomAlarmer(base.WorkId, newOrderId, info.SimNum, (uint) alarmEntity_0.CarAlarmSwitch, (uint) alarmEntity_0.CarAlarmFlag, (uint) alarmEntity_0.Level);
                 if (response.ResultCode != 0L)
                 {
                     base.alarmMsg.FunctionName = "icar_SetCustomAlarmer";
                     base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", alarmEntity_0.OrderCode });
                     base.alarmMsg.Code = response.ResultCode.ToString();
                     base.log.WriteAlarm(base.alarmMsg);
                 }
                 response.ResultCode = 0L;
             }
             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;
 }
예제 #3
0
        private AlarmEntity GetCustomArgs()
        {
            AlarmEntity entity = new AlarmEntity();
            int num = 0;
            int num2 = 0;
            int num3 = 0;
            int num4 = 0;
            string str = string.Empty;
            int num5 = 6;
            int num6 = 0;
            string str2 = "cmbCustom";
            ComBox box = null;
            ComBox box2 = null;
            TextBox box3 = null;
            for (int i = 1; i <= num5; i++)
            {
                try
                {
                    box = (ComBox) this.grpCustom.Controls[str2 + i.ToString() + "Alarm"];
                    box2 = (ComBox) this.grpCustom.Controls[str2 + i.ToString() + "Elec"];
                    box3 = (TextBox) this.grpCustom.Controls["txtCustom" + i.ToString() + "Name"];
                    if (((box == null) || (box2 == null)) || (box3 == null))
                    {
                        continue;
                    }
                    num6 = Convert.ToInt32(box.Tag.ToString());
                    switch (box.SelectedIndex)
                    {
                        case 0:
                            num |= num6;
                            num2 |= num6;
                            break;

                        case 1:
                            num |= num6;
                            break;

                        case 2:
                            num |= num6;
                            num3 |= num6;
                            break;
                    }
                    if (box2.SelectedIndex == 0)
                    {
                        num4 |= num6;
                    }
                    string text = box3.Text;
                    if (string.IsNullOrEmpty(text))
                    {
                        MessageBox.Show("请自定义名称");
                        box3.Focus();
                        return null;
                    }
                    str = str + string.Format("{0}/{1}*", num6, text.Trim());
                }
                catch
                {
                }
            }
            entity.CarAlarmFlag = num2;
            entity.CarAlarmSwitch = num;
            entity.CarShowAlarm = num3;
            entity.Level = num4;
            entity.CustName = str;
            entity.OrderCode = CmdParam.OrderCode.设置自定义报警器;
            return entity;
        }
예제 #4
0
 private AlarmEntity GetAlarmArgs(long car_AlarmSwitch, long car_AlarmFlag, long car_ShowAlarm, long car_ExpandAlarmFlag, long car_ExpandAlarmSwitch, long car_ExpandShowAlarm)
 {
     AlarmEntity entity = new AlarmEntity {
         OrderCode = CmdParam.OrderCode.设置车台报警器,
         CarAlarmFlag = car_AlarmFlag,
         CarAlarmSwitch = car_AlarmSwitch,
         CarShowAlarm = car_ShowAlarm,
         AlarmFlagEx = car_ExpandAlarmFlag,
         CarAlarmSwitchEx = car_ExpandAlarmSwitch,
         CarShowAlarmEx = car_ExpandShowAlarm
     };
     if (this.cmbAlarmType.SelectedIndex == 0)
     {
         entity.AlarmFlagType = CmdParam.CarAlarmTypeTag.配置报警标志位;
         return entity;
     }
     if (this.cmbAlarmType.SelectedIndex == 1)
     {
         entity.AlarmFlagType = CmdParam.CarAlarmTypeTag.配置终端文本SMS报警通知开关;
         return entity;
     }
     if (this.cmbAlarmType.SelectedIndex == 2)
     {
         entity.AlarmFlagType = CmdParam.CarAlarmTypeTag.配置报警拍摄开关;
         return entity;
     }
     if (this.cmbAlarmType.SelectedIndex == 3)
     {
         entity.AlarmFlagType = CmdParam.CarAlarmTypeTag.配置报警拍摄存储标志;
         return entity;
     }
     if (this.cmbAlarmType.SelectedIndex == 4)
     {
         entity.AlarmFlagType = CmdParam.CarAlarmTypeTag.配置关键报警标志;
     }
     return entity;
 }
예제 #5
0
 public static Response DownData_SetCustomAlarmer(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, AlarmEntity alarmEntity)
 {
     Response response;
     if (RemotingClient.app == null)
     {
         return RemotingClient.reResult;
     }
     try
     {
         response = RemotingClient.app.DownData_SetCustomAlarmer(ParamType, CarValues, CarPw, CommMode, alarmEntity);
     }
     catch (Exception exception)
     {
         Record.execFileRecord("配置自定义报警器", exception.Message);
         response = RemotingClient.reResult;
     }
     return response;
 }
예제 #6
0
 public static Response DownData_SetAlarmFlag(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, AlarmEntity arlamArgs)
 {
     Response response;
     if (RemotingClient.app == null)
     {
         return RemotingClient.reResult;
     }
     try
     {
         response = RemotingClient.app.DownData_SetAlarmFlag(ParamType, CarValues, CarPw, CommMode, arlamArgs);
     }
     catch (Exception exception)
     {
         Record.execFileRecord("设置车台报警器标志位命令", exception.Message);
         response = RemotingClient.reResult;
     }
     return response;
 }
예제 #7
0
 public Response DownData_SetCustomAlarmer(CmdParam.ParamType ParamType, string CarValues, string CarPw, CmdParam.CommMode CommMode, AlarmEntity alarmEntity)
 {
     try
     {
         return this.myDownData.icar_SetCustomAlarmer(ParamType, CarValues, CarPw, CommMode, alarmEntity);
     }
     catch (Exception exception)
     {
         this.m_LogHelper.WriteError(new ErrorMsg("RemotingServer", "DownData_SetCustomAlarmer", exception.ToString()));
         return new Response();
     }
 }