public void saveAlarm(String disList, String pressList, String devCode, int devId, String devType) { string[] pressArray = pressList.Split(','); string[] disArray = disList.Split(','); for (int i = 0; i < pressArray.Length; i++) { if (float.Parse(pressArray[i]) > pressAlarm) { string dis = disArray[i]; string press = pressArray[i]; Model.AlarmRecordInfo alarmRecordInfo = new Model.AlarmRecordInfo(); alarmRecordInfo.ACTIVE = true; alarmRecordInfo.DEVICE_CODE = devCode; alarmRecordInfo.DEVICE_ID = devId; alarmRecordInfo.DEVICE_TYPE_NAME = devType; alarmRecordInfo.ITEMNAME = "压力:" + dis; //到时候根据这个ID号来取消 alarmRecordInfo.ITEMVALUE = dis + "," + press; alarmRecordInfo.MESSAGE_STATUS = 0; alarmRecordInfo.RECORDCODE = ""; alarmRecordInfo.RECORDDATE = System.DateTime.Now; alarmRecordInfo.MESSAGE = "光纤压力超标"; BLL.AlarmRecord nc = new BLL.AlarmRecord(); nc.saveGXPressAlarm(alarmRecordInfo); } } }
public void saveAlarm(String disList, String tempList, String devCode, int devId, String devType) { string[] tempArray = tempList.Split(','); string[] disArray = disList.Split(','); // Model.NKTemperatureCurveInfo lastCurve = Model.NKTemperatureCurveInfo cu = this.getLastTempCurve(devCode); string[] lastDisArray = cu.DISTANCE.Split(','); string[] lastTempArray = cu.TEMPERATURE.Split(','); if (cu == null) { return; } for (int i = 0; i < tempArray.Length; i++) { string dis = disArray[i]; string temp = tempArray[i]; if (Math.Abs(float.Parse(temp) - float.Parse(lastTempArray[i])) > tempAlarm) { Model.AlarmRecordInfo alarmRecordInfo = new Model.AlarmRecordInfo(); alarmRecordInfo.ACTIVE = true; alarmRecordInfo.DEVICE_CODE = devCode; alarmRecordInfo.DEVICE_ID = devId; alarmRecordInfo.DEVICE_TYPE_NAME = devType; alarmRecordInfo.ITEMNAME = "温度:" + dis; //到时候根据这个ID号来取消 alarmRecordInfo.ITEMVALUE = dis + "," + temp; alarmRecordInfo.MESSAGE_STATUS = 0; alarmRecordInfo.RECORDCODE = ""; alarmRecordInfo.RECORDDATE = System.DateTime.Now; alarmRecordInfo.MESSAGE = "光纤温度超标"; alarmRecordInfo.RECORDCODE = ""; BLL.AlarmRecord nc = new BLL.AlarmRecord(); nc.saveGXPressAlarm(alarmRecordInfo); } } }