/// <summary> /// ��ʼ�����м�ص���ʱ���� /// </summary> private void InitAllVariables() { #region ��ʼ������ _curHightLightType = ClickLinkLabelType.None; _curFaultInfo = new MonitorErrData(); _curAlarmInfo = new MonitorErrData(); _tempStatisInfo = new TempAndHumiStatisticsInfo(); _humiStatisInfo = new TempAndHumiStatisticsInfo(); _curScanBoardIndex = -1; _totalFanSwitchCount = 0; _totalPowerSwitchCount = 0; //_scanCntOfInfoValid = 0; //_curMinTempValue = 0; //_curMaxTempValue = 0; //_curMinHumidityValue = 0; //_curMaxHumidityValue = 0; //_curTotalTemp = 0; //_curTotalHumidity = 0; //_curScreenTempList.Clear(); //_curScreenHumidityList.Clear(); _curTempMaxMinIndexInfo.MaxSBIndexList.Clear(); _curTempMaxMinIndexInfo.MinSBIndexList.Clear(); _curHumiMaxMinIndexInfo.MaxSBIndexList.Clear(); _curHumiMaxMinIndexInfo.MinSBIndexList.Clear(); #endregion }
/// <summary> /// ��ʾ��������ݹ���ؼ� --- ��������List<ILEDDisplayInfo>�仯ΪDictionary<string, List<ILEDDisplayInfo>>�� /// keyֵΪ�������ƣ����Ҹ�������Ϣʵ��Ϊ��Ҫ��ص�������Ϣ /// </summary> public MarsScreenMonitorDataViewer() { InitializeComponent(); CurrentFont = this.Font; _customToolTipFont = this.Font; _complexScreenFont = this.Font; _simpleOrStandardScreenFont = this.Font; _needUpdateFont = this.Font; _updateMonitorDataForNotUpdateDic = new Dictionary<string, Dictionary<string, ScannerMonitorData>>(); CompeleteConfigScanBoardDisplayEvent += new EventHandler(MarsScreenMonitorDataViewer_CompeleteConfigScanBoardDisplayEvent); _curMonitorConfigInfo = new MonitorConfigData(); _curAllLedScreenRectDic = new Dictionary<string, List<ScreenGridBindObj>>(); //_physicalScreenInfo = new PhysicalDisplayInfo(); _curTempMaxMinKeyInfo = new TempAndHumiInfo(); _curHumiMaxMinKeyInfo = new TempAndHumiInfo(); _tempStatisInfo = new TempAndHumiStatisticsInfo(); _humiStatisInfo = new TempAndHumiStatisticsInfo(); _curOperateStep = OperateStep.None; _indicator.BackColor = Color.White; _indicator.CircleColor = Color.Blue; _indicator.AnimationSpeed = 50; #region ��ʼ������ؼ� _complexScreenLayout = new UC_ComplexScreenLayout(); _complexScreenLayout.Parent = panel_Display; _complexScreenLayout.Dock = DockStyle.Fill; _complexScreenLayout.ClearAllMonitorInfo(); _complexScreenLayout.CurType = _curType; _statusRectangleLayout = new UC_StatusRectangleLayout(); _statusRectangleLayout.DefaultFocusStyle.BackColor = Color.White; _statusRectangleLayout.DefaultFocusStyle.BoardColor = Color.Yellow; _statusRectangleLayout.IsCanSelect = false; _statusRectangleLayout.Parent = panel_Display; _statusRectangleLayout.Dock = DockStyle.Fill; //_statusRectangleLayout.BorderStyle = BorderStyle.FixedSingle; _statusRectangleLayout.BackColor = Color.Transparent; _statusRectangleLayout.ClearAllRectangularGrid(); _statusRectangleLayout.CurType = _curType; _sbStatusInfoUC = new UC_StatusInfo(CommonStaticValue.SBStatusDisplayStr[0], CommonStaticValue.SBStatusDisplayStr[1], CommonStaticValue.SBStatusDisplayStr[2]); _sbStatusInfoUC.Parent = panel_Info; _sbStatusInfoUC.Dock = DockStyle.Fill; _fanInfoUC = new UC_SmokeFanPowerInfo(CommonStaticValue.FanDisplayStr[0], CommonStaticValue.FanDisplayStr[1]); _fanInfoUC.Parent = panel_Info; _fanInfoUC.Dock = DockStyle.Fill; _powerInfoUC = new UC_SmokeFanPowerInfo(CommonStaticValue.PowerDisplayStr[0], CommonStaticValue.PowerDisplayStr[1]); _powerInfoUC.Parent = panel_Info; _powerInfoUC.Dock = DockStyle.Fill; _smokeInfo = new UC_SmokeFanPowerInfo(CommonStaticValue.SmokeDisplayStr[0], CommonStaticValue.SmokeDisplayStr[1]); _smokeInfo.Parent = panel_Info; _smokeInfo.Dock = DockStyle.Fill; _tempInfoUC = new UC_TempAndHumiInfo(CommonStaticValue.TemperatureDisplayStr[0], CommonStaticValue.TemperatureDisplayStr[1], CommonStaticValue.TemperatureDisplayStr[2], CommonStaticValue.TemperatureDisplayStr[3], CommonStaticValue.TemperatureDisplayStr[4], CommonStaticValue.CelsiusUnit, new ClickMaxMinValueEventHandler(ClickTempMaxMinValue)); _tempInfoUC.Parent = panel_Info; _tempInfoUC.Dock = DockStyle.Fill; _humidityInfoUC = new UC_TempAndHumiInfo(CommonStaticValue.HumidityDisplayStr[0], CommonStaticValue.HumidityDisplayStr[1], CommonStaticValue.HumidityDisplayStr[2], CommonStaticValue.HumidityDisplayStr[3], CommonStaticValue.HumidityDisplayStr[4], CommonStaticValue.HUMIDITY_UNIT, new ClickMaxMinValueEventHandler(ClickHumiMaxMinValue)); _humidityInfoUC.Parent = panel_Info; _humidityInfoUC.Dock = DockStyle.Fill; _rowLineInfoUC = new UC_RowLineCabinetDoorInfo(CommonStaticValue.RowLineStr[0], CommonStaticValue.RowLineStr[1]); _rowLineInfoUC.Parent = panel_Info; _rowLineInfoUC.Dock = DockStyle.Fill; _mcStatusInfoUC = new UC_StatusInfo(CommonStaticValue.MCStatusDisplayStr[0], CommonStaticValue.MCStatusDisplayStr[1], CommonStaticValue.MCStatusDisplayStr[2]); _mcStatusInfoUC.Parent = panel_Info; _mcStatusInfoUC.Dock = DockStyle.Fill; _generalStatuInfoUC = new UC_RowLineCabinetDoorInfo(CommonStaticValue.GeneralStatusStr[0], CommonStaticValue.GeneralStatusStr[1]); _generalStatuInfoUC.Parent = panel_Info; _generalStatuInfoUC.Dock = DockStyle.Fill; _tempCorNoticeUC = new UC_TempAndHumidityCorNotice(MinTempValue, _curMonitorConfigInfo.TempAlarmThreshold, MaxTempValue, CommonStaticValue.CelsiusUnit); _tempCorNoticeUC.Parent = panel_ColorMotice; _tempCorNoticeUC.Dock = DockStyle.Fill; _humidityCorNoticeUC = new UC_TempAndHumidityCorNotice(MinHumidityValue, _curMonitorConfigInfo.HumiAlarmThreshold, MaxHumidityValue, CommonStaticValue.HUMIDITY_UNIT); _humidityCorNoticeUC.Parent = panel_ColorMotice; _humidityCorNoticeUC.Dock = DockStyle.Fill; _sbStatusCorNotice = new UC_StatusCorNotice(); _sbStatusCorNotice.Parent = panel_ColorMotice; _sbStatusCorNotice.Dock = DockStyle.Fill; _mcStatusCorNotice = new UC_StatusCorNotice(); _mcStatusCorNotice.Parent = panel_ColorMotice; _mcStatusCorNotice.Dock = DockStyle.Fill; _smokeOrPowerCorNotice = new UC_SmokeFanPowerCorNotice(MonitorDisplayType.Smoke); _smokeOrPowerCorNotice.Parent = panel_ColorMotice; _smokeOrPowerCorNotice.Dock = DockStyle.Fill; _fanCorNotice = new UC_SmokeFanPowerCorNotice(MonitorDisplayType.Fan); _fanCorNotice.Parent = panel_ColorMotice; _fanCorNotice.Dock = DockStyle.Fill; _rowLineCorNotice = new UC_RowLineCorNotice(); _rowLineCorNotice.Parent = panel_ColorMotice; _rowLineCorNotice.Dock = DockStyle.Fill; _generalStatusCorNotice = new UC_SmokeFanPowerCorNotice(MonitorDisplayType.GeneralSwitch); _generalStatusCorNotice.Parent = panel_ColorMotice; _generalStatusCorNotice.Dock = DockStyle.Fill; _statusRectangleLayout.GridMouseDoubleClick += new RectangularGridMouseEventHandler(StatusRectangleLayout_GridMouseDoubleClick); _statusRectangleLayout.GridMouseMove += new RectangularGridMouseEventHandler(StatusRectangleLayout_GridMouseMove); #endregion this.Disposed += new EventHandler(MarsScreenMonitorDataViewer_Disposed); vScrollBar_PixelLength.Value = (int)(DefaultLengthOnePixel * 100); vScrollBar_PixelLength_Scroll(null, null); _isNeedSetScaleRatio = false; _isHasValidMonitorInfo = false; //���ý����ϲ�ͬ��ʾ���Ϳؼ������� SetDisplayTypeControl(); this.CurCtrlSystemMode = _curCtrlSystemMode; }
/// <summary> /// ��ȡƽ��ֵ /// </summary> /// <param name="averageTemp"></param> /// <returns></returns> public static void GetAverageValueAndBeyondCnt(ref TempAndHumiStatisticsInfo statisticsInfo) { statisticsInfo.MaxValue = (int)statisticsInfo.MaxValue; statisticsInfo.MinValue = (int)statisticsInfo.MinValue; if (statisticsInfo.ValidScanBoardCnt > 0) { statisticsInfo.AverageValue = (int)(statisticsInfo.TotalValue / statisticsInfo.ValidScanBoardCnt); } for (int i = 0; i < statisticsInfo.AllValueList.Count; i++) { if (statisticsInfo.AllValueList[i] > statisticsInfo.AverageValue) { statisticsInfo.BeyondAverageCnt++; } } }
public object Clone() { TempAndHumiStatisticsInfo newObj = new TempAndHumiStatisticsInfo(); bool res = this.CopyTo(newObj); if (!res) { return null; } else { return newObj; } }
/// <summary> /// ��ȡ�¶ȶ�Ӧ����Ϣ /// </summary> /// <param name="monitorData"></param> /// <param name="curIndex"></param> /// <param name="backClr"></param> /// <param name="displayStr"></param> public static void CaculateTempStatisticsInfo(ScannerMonitorData monitorData, float threshold, out ValueCompareResult valueCompareRes, out MonitorInfoResult resType, ref TempAndHumiStatisticsInfo statisticsInfo) { valueCompareRes = ValueCompareResult.Unknown; resType = MonitorInfoResult.Unknown; if (monitorData != null) { if (monitorData.TemperatureOfScanCard.IsValid) { float fValue = monitorData.TemperatureOfScanCard.Value; int nValue = (int)fValue; if (nValue > threshold) { resType = MonitorInfoResult.Alarm; } else { resType = MonitorInfoResult.Ok; } if (statisticsInfo.ValidScanBoardCnt <= 0) { //��ǰɨ�迨����Ϊ0ʱ����ȡ��ǰ�¶� statisticsInfo.MinValue = nValue; statisticsInfo.MaxValue = nValue; valueCompareRes = ValueCompareResult.IsFirstValidValue; } else { //��ȡ��ǰ��С�¶Ⱥ�����¶� if (statisticsInfo.MinValue > nValue) { valueCompareRes = ValueCompareResult.BelowMinValue; statisticsInfo.MinValue = nValue; } else if (statisticsInfo.MinValue == nValue) { valueCompareRes = ValueCompareResult.EqualsMinValue; } if (statisticsInfo.MaxValue < nValue) { valueCompareRes = ValueCompareResult.AboveMaxValue; statisticsInfo.MaxValue = nValue; } else if (statisticsInfo.MaxValue == nValue) { if (valueCompareRes == ValueCompareResult.EqualsMinValue) { valueCompareRes = ValueCompareResult.EqualsBothValue; } else { valueCompareRes = ValueCompareResult.EqualsMaxValue; } } } statisticsInfo.ValidScanBoardCnt++; statisticsInfo.TotalValue += nValue; statisticsInfo.AllValueList.Add(nValue); } } }