/// <summary> /// 获取语音播报文件 /// </summary> /// <param name="planId"></param> /// <param name="planTrigger"></param> /// <returns></returns> static string GetAudioFile(Guid planId, PlanTriggerSource planTrigger) { string audioFile = string.Empty; var alarmTextObj = TaskUtility.SoundlightConfigList.FirstOrDefault(t => t.AlarmTypeId.Equals(planTrigger.AlarmType.SystemOptionId)); //非哨位报警 if (alarmTextObj == null) { audioFile = "sound/警报音.wav"; } else { string alarmTypeName = planTrigger.AlarmType.SystemOptionName; if ("越狱".Equals(alarmTypeName)) { alarmTypeName = "逃跑"; } if (planId.Equals(planTrigger.EmergencyPlanId)) { audioFile = string.Format("sound/{0}处置/{1}号哨{2}处置.wav", alarmTypeName, planTrigger.AlarmSource.IPDeviceCode, alarmTypeName); } else if (planId.Equals(planTrigger.BeforePlanId)) { var alarmdesc = alarmTextObj != null ? alarmTextObj.Description : ""; audioFile = string.Format("sound/{0}一级/{1}号哨{2}.wav", alarmTypeName, planTrigger.AlarmSource.IPDeviceCode, alarmdesc); } } return(audioFile); }
/// <summary> /// led推送文字 /// </summary> /// <param name="planId"></param> /// <param name="planTrigger"></param> /// <param name="sentinelNodeName">哨位节点名称</param> /// <returns></returns> static string GetPushText(Guid planId, PlanTriggerSource planTrigger, string sentinelNodeName) { string message = string.Empty; string alarmTypeName = planTrigger.AlarmType.SystemOptionName; var alarmTextObj = TaskUtility.SoundlightConfigList.FirstOrDefault(t => t.AlarmTypeId.Equals(planTrigger.AlarmType.SystemOptionId)); var alarmdesc = alarmTextObj != null ? alarmTextObj.Description : alarmTypeName; if (planId.Equals(planTrigger.BeforePlanId)) { message = string.Format("{0}{1},各小组请注意观察!", sentinelNodeName, alarmdesc); } else if (planId.Equals(planTrigger.EmergencyPlanId)) { message = string.Format("{0}{1},各小组按预案处置!", sentinelNodeName, alarmdesc); } return(message); }