예제 #1
0
        public static bool ComparePart(VulpesSMARTInfo a, VulpesSMARTInfo b)
        {
            if (a.PNPDeviceID != b.PNPDeviceID)
            {
                return(false);
            }

            return(true);
        }
예제 #2
0
        public static bool CompareFull(VulpesSMARTInfo a, VulpesSMARTInfo b, List <int> SkipAttributes)
        {
            if (a.PNPDeviceID != b.PNPDeviceID || a.Caption != b.Caption || a.FirmwareRevision != b.FirmwareRevision || a.InterfaceType != b.InterfaceType ||
                a.Model != b.Model || a.Name != b.Name || a.PredictFailure != b.PredictFailure || a.SerialNumber != b.SerialNumber || a.Size != b.Size ||
                a.Status != b.Status)
            {
                return(false);
            }
            if (a.Attributes == null && b.Attributes == null)
            {
                return(true);
            }
            if (a.Attributes == null)
            {
                return(false);
            }
            if (b.Attributes == null)
            {
                return(false);
            }
            if (a.Attributes.Count != b.Attributes.Count)
            {
                return(false);
            }
            if (SkipAttributes == null)
            {
                SkipAttributes = new List <int>();
            }
            foreach (KeyValuePair <int, VulpesSMARTAttribute> kvp in a.Attributes)
            {
                if (SkipAttributes.Contains(kvp.Key) == true)
                {
                    continue;
                }
                if (b.Attributes.ContainsKey(kvp.Key) == false)
                {
                    return(false);
                }
                if (kvp.Value.FailureImminent != b.Attributes[kvp.Key].FailureImminent ||
                    kvp.Value.Flags != b.Attributes[kvp.Key].Flags ||
                    kvp.Value.ID != b.Attributes[kvp.Key].ID ||
                    kvp.Value.Threshold != b.Attributes[kvp.Key].Threshold ||
                    kvp.Value.Value != b.Attributes[kvp.Key].Value ||
                    kvp.Value.Vendordata != b.Attributes[kvp.Key].Vendordata ||
                    kvp.Value.Worst != b.Attributes[kvp.Key].Worst)
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #3
0
 public static bool IsInError(VulpesSMARTInfo i)
 {
     if (i.PredictFailure == true)
     {
         return(true);
     }
     if (i.Attributes == null)
     {
         return(false);
     }
     foreach (KeyValuePair <int, VulpesSMARTAttribute> kvp in i.Attributes)
     {
         if (IsAttribInError(kvp.Value) == true)
         {
             return(true);
         }
     }
     return(false);
 }