/// <summary> /// 预警窗口激活 /// </summary> /// <param name="MessageTable"></param> /// <param name="ShowMessageFormAlarm"></param> public static bool AlarmWinAct(DataTable MessageTable, MessageFormAlarm ShowMessageFormAlarm, frmMainFunc mdiForm) { bool showFlag = false;//是否显示标志 if (MessageTable.Rows.Count != 0) { if (ShowMessageFormAlarm == null) { ShowMessageFormAlarm = MessageFormAlarm.Instance; } ShowMessageFormAlarm.Msg = MessageTable; ShowMessageFormAlarm.MDIForm = mdiForm; int formWidth = SysAlarmParamSet.GetIntValueByID(8003); //系统预警窗口宽度 int formHeight = SysAlarmParamSet.GetIntValueByID(8004); //系统预警窗口高度 if (formWidth <= 0) { formWidth = 300; } if (formHeight <= 0) { formHeight = 600; } ShowMessageFormAlarm.WidthMax = formWidth; //窗体滚动的宽度 ShowMessageFormAlarm.HeightMax = formHeight; //窗体滚动的高度 ShowMessageFormAlarm.ScrollShow(); ShowMessageFormAlarm.ScrollShow(); showFlag = true; } return(showFlag); }
/// <summary> /// 初始化 /// </summary> public static void AlarmMsgIni(System.Windows.Forms.Timer timerAlarm) { bool useFlag = SysConvert.ToBoolean(SysAlarmParamSet.GetIntValueByID(8001)); //系统预警平台启用 if (useFlag && SysAlarmSetDt.Rows.Count != 0) //启用并且此用户有配置信息表 { int checkSecondes = SysAlarmParamSet.GetIntValueByID(8002); //系统预警平台定时监测时长(单位:秒) timerAlarm.Enabled = true; if (checkSecondes != 0) { timerAlarm.Interval = checkSecondes * 1000; } else { timerAlarm.Interval = 2000; } } else { timerAlarm.Enabled = false; } }