コード例 #1
0
ファイル: CommonInfo.cs プロジェクト: hardborn/MonitorManager
        public static List<string> GetPowerNoticeStr(ScannerMonitorData monitorData,
                                                     ScanBdMonitoredPowerInfo mcPowerInfo,
                                                     int powerIndex,
                                                     string sbCommAddr)
        {
            List<string> noticeStrList = new List<string>();
            string valueStr = "";
            if (monitorData == null)
            {
                valueStr = CommonStaticValue.DisplayTypeStr[(int)MonitorDisplayType.Power] + ":"
                           + CommonStaticValue.StatusNoticeStr[(int)CommonStaticValue.NoticeType.Unkown];
                noticeStrList.Add(valueStr);
                return noticeStrList;
            }
            uint powerCnt = GetMonitorPowerCnt(mcPowerInfo, sbCommAddr);
            if (powerCnt == 0)
            {
                return noticeStrList;
            }

            valueStr = "";
            if (!monitorData.IsConnectMC)
            {
                valueStr = CommonStaticValue.SwitchSignStr[(int)CommonStaticValue.SwitchSignType.MCOtherPower] + ":"
                            + CommonStaticValue.StatusNoticeStr[(int)CommonStaticValue.NoticeType.Unkown]
                            + "(" + CommonStaticValue.NotConnectMC + ")";
                noticeStrList.Add(valueStr);
                return noticeStrList;
            }

            #region ��ȡ��ؿ�ÿ·�ĵ�ѹ
            if (monitorData.VoltageOfMonitorCardCollection == null)
            {
                valueStr = CommonStaticValue.SwitchSignStr[(int)CommonStaticValue.SwitchSignType.MCOtherPower] + ":"
                           + CommonStaticValue.StatusNoticeStr[(int)CommonStaticValue.NoticeType.Unkown];
                noticeStrList.Add(valueStr);

                return noticeStrList;
            }
            int powerIndexInList = 0;
            for (int i = 0; i < powerCnt; i++)
            {
                powerIndexInList = i + 1;
                if (i == powerIndex)
                {
                    valueStr = CommonStaticValue.SwitchSignStr[(int)CommonStaticValue.SwitchSignType.MCOtherPower]
                               + "(" + CommonStaticValue.SwitchName + " " + powerIndexInList.ToString() + "): ";
                    if (powerIndexInList >= monitorData.VoltageOfMonitorCardCollection.Count)
                    {
                        valueStr += CommonStaticValue.StatusNoticeStr[(int)CommonStaticValue.NoticeType.Unkown];
                    }
                    else
                    {
                        if (monitorData.VoltageOfMonitorCardCollection[powerIndexInList].IsValid)
                        {
                            valueStr += monitorData.VoltageOfMonitorCardCollection[powerIndexInList].Value.ToString("f2");
                        }
                        else
                        {
                            valueStr += CommonStaticValue.StatusNoticeStr[(int)CommonStaticValue.NoticeType.Unkown];
                        }
                    }
                    noticeStrList.Add(valueStr);
                    break;
                }
            }
            #endregion
            return noticeStrList;
        }
コード例 #2
0
ファイル: CommonInfo.cs プロジェクト: hardborn/MonitorManager
 public object Clone()
 {
     ScanBdMonitoredPowerInfo newObj = new ScanBdMonitoredPowerInfo();
     bool res = this.CopyTo(newObj);
     if (!res)
     {
         return null;
     }
     else
     {
         return newObj;
     }
 }
コード例 #3
0
ファイル: CommonInfo.cs プロジェクト: hardborn/MonitorManager
 /// <summary>
 /// ��ȡ���õ���Ҫ��صļ�ؿ��ķ��Ⱥ͵�Դ����
 /// </summary>
 /// <param name="configInfo"></param>
 /// <param name="sbCommKey"></param>
 /// <returns></returns>
 public static uint GetMonitorPowerCnt(ScanBdMonitoredPowerInfo configInfo, string sbCommKey)
 {
     if (configInfo.CountType == ScanBdMonitoredParamCountType.SameForEachScanBd)
     {
         return configInfo.SameCount;
     }
     else
     {
         if (configInfo.CountDicOfScanBd != null
             && configInfo.CountDicOfScanBd.ContainsKey(sbCommKey))
         {
             return configInfo.CountDicOfScanBd[sbCommKey];
         }
         else
         {
             return configInfo.SameCount;
         }
     }
 }
コード例 #4
0
ファイル: CommonInfo.cs プロジェクト: hardborn/MonitorManager
 public MonitorConfigData()
 {
     TempDisplayType = TemperatureType.Celsius;
     TempAlarmThreshold = 60;
     HumiAlarmThreshold = 60;
     FanSpeed = 1000;
     PowerAlarmValue = 4;
     PowerFaultValue = 3.5f;
     IsDisplayScanBoardVolt = true;
     MCFanInfo = new ScanBdMonitoredParamUpdateInfo();
     MCPowerInfo = new ScanBdMonitoredPowerInfo();
 }