コード例 #1
0
ファイル: GridPlusControl.cs プロジェクト: mcules/cam4linux
 private void WattCheck(System.Collections.Generic.KeyValuePair <AlertType, AlertLimit> _storeItem)
 {
     try
     {
         if (_storeItem.Key == 25)
         {
             if (_storeItem.Value.IfPreviStatusInLimitArray == null)
             {
                 _storeItem.Value.IfPreviStatusInLimitArray = new bool[this._detector._aComputer.get_GridFanHub().Length];
                 this._notification.SetBoolArrayTrue(_storeItem.Value.IfPreviStatusInLimitArray);
             }
             int        num        = 0;
             GridPlus[] gridFanHub = this._detector._aComputer.get_GridFanHub();
             for (int i = 0; i < gridFanHub.Length; i++)
             {
                 GridPlus gridPlus = gridFanHub[i];
                 this._notification.UpdateAlertLimit(25, new AlertLimit
                 {
                     UpperAlertValue      = (double)gridPlus.get_WattNotifyUpperLimit(),
                     LowerAlertValue      = 0.0,
                     IfPreviStatusInLimit = true
                 });
                 string name = gridPlus.get_Name();
                 if (gridPlus.get_WattNotification() && name != null)
                 {
                     this._notification.Notifications(this, new AlertChangeArgs
                     {
                         Type  = 25,
                         Name  = name,
                         Value = gridPlus.get_Watt()[0],
                         Limit = new AlertLimit
                         {
                             UpperAlertValue      = _storeItem.Value.UpperAlertValue,
                             LowerAlertValue      = 0.0,
                             IfPreviStatusInLimit = _storeItem.Value.IfPreviStatusInLimitArray[num]
                         }
                     });
                 }
                 if (gridPlus.get_Watt()[0] < _storeItem.Value.UpperAlertValue)
                 {
                     _storeItem.Value.IfPreviStatusInLimitArray[num] = true;
                 }
                 else
                 {
                     _storeItem.Value.IfPreviStatusInLimitArray[num] = false;
                 }
                 num++;
             }
         }
     }
     catch
     {
     }
 }
コード例 #2
0
ファイル: GridPlusControl.cs プロジェクト: mcules/cam4linux
 private void FanWorkCheck(System.Collections.Generic.KeyValuePair <AlertType, AlertLimit> _storeItem)
 {
     try
     {
         if (_storeItem.Key == 26)
         {
             if (GridPlusControl.FanCheckCounter < 7)
             {
                 GridPlusControl.FanCheckCounter++;
             }
             if (GridPlusControl.FanCheckCounter > 4)
             {
                 if (_storeItem.Value.IfPreviStatusInLimitArray == null)
                 {
                     _storeItem.Value.IfPreviStatusInLimitArray = new bool[this._detector._aComputer.get_GridFanHub().Length * 6];
                     this._notification.SetBoolArrayTrue(_storeItem.Value.IfPreviStatusInLimitArray);
                 }
                 int        num        = 0;
                 GridPlus[] gridFanHub = this._detector._aComputer.get_GridFanHub();
                 for (int i = 0; i < gridFanHub.Length; i++)
                 {
                     GridPlus gridPlus = gridFanHub[i];
                     string   name     = gridPlus.get_Name();
                     int      num2     = 0;
                     int      num3     = 0;
                     int[]    rPM      = gridPlus.get_RPM();
                     for (int j = 0; j < rPM.Length; j++)
                     {
                         int num4 = rPM[j];
                         if (num2 == 0)
                         {
                             num2++;
                         }
                         else
                         {
                             if (gridPlus.get_IsChannelConnected()[num2] && gridPlus.get_ChannelFanNotification()[num2 - 1])
                             {
                                 this._notification.UpdateAlertLimit(26, new AlertLimit
                                 {
                                     UpperAlertValue      = 100000.0,
                                     LowerAlertValue      = (double)gridPlus.get_RpmNotifyLowerLimit()[num3],
                                     IfPreviStatusInLimit = true
                                 });
                                 this._notification.Notifications(this, new AlertChangeArgs
                                 {
                                     Type  = 26,
                                     Name  = name + "-Fan" + num2,
                                     Value = (double)num4,
                                     Limit = new AlertLimit
                                     {
                                         UpperAlertValue      = _storeItem.Value.UpperAlertValue,
                                         LowerAlertValue      = _storeItem.Value.LowerAlertValue,
                                         IfPreviStatusInLimit = _storeItem.Value.IfPreviStatusInLimitArray[num2 + num * 6]
                                     }
                                 });
                             }
                             if ((double)num4 > _storeItem.Value.LowerAlertValue)
                             {
                                 _storeItem.Value.IfPreviStatusInLimitArray[num2 + num * 6] = true;
                             }
                             else
                             {
                                 _storeItem.Value.IfPreviStatusInLimitArray[num2 + num * 6] = false;
                             }
                             num2++;
                             num3++;
                         }
                     }
                     num++;
                 }
             }
         }
     }
     catch
     {
     }
 }