public void Load(XmlNodeList nodes)
 {
     foreach (object obj in nodes)
     {
         XmlNode xmlNode = (XmlNode)obj;
         if (xmlNode.NodeType != XmlNodeType.Comment)
         {
             ThermalProfile thermalProfile = new ThermalProfile();
             thermalProfile.Name  = ThermalProfiles.GetValue(xmlNode, "Name");
             thermalProfile.Steps = new Dictionary <string, Step>();
             foreach (object obj2 in xmlNode.ChildNodes)
             {
                 XmlNode xmlNode2 = (XmlNode)obj2;
                 if (xmlNode2.NodeType != XmlNodeType.Comment)
                 {
                     Step step = new Step();
                     step.Id      = ThermalProfiles.GetValue(xmlNode2, "Id");
                     step.Name    = ThermalProfiles.GetValue(xmlNode2, "Name");
                     step.IsValue = ThermalProfiles.GetValue(xmlNode2, "Is");
                     step.Then    = ThermalProfiles.GetValue(xmlNode2, "Then");
                     step.Else    = ThermalProfiles.GetValue(xmlNode2, "Else");
                     step.Set     = ThermalProfiles.GetValue(xmlNode2, "Set");
                     step.Next    = ThermalProfiles.GetValue(xmlNode2, "Next");
                     step.Fail    = ThermalProfiles.GetValue(xmlNode2, "Fail");
                     try
                     {
                         thermalProfile.Steps.Add(step.Id, step);
                     }
                     catch (Exception)
                     {
                         this.SetError(string.Format("{0}: duplicate step Id={0} Name={1}", thermalProfile.Name, step.Id, step.Name));
                     }
                 }
             }
             try
             {
                 base.Add(thermalProfile.Name, thermalProfile);
             }
             catch (Exception)
             {
                 this.SetError(string.Format("{0}: duplicate Thermal Profile Name={0}", thermalProfile.Name));
             }
         }
     }
 }
Exemple #2
0
        public static string Dump()
        {
            string str  = "";
            string text = "WDC WD2009FYPX-09AAMB0";
            Range  driveTemperatureRange = SystemConfig.GetDriveTemperatureRange(text, "Warning");

            if (driveTemperatureRange != null)
            {
                str += string.Format("Model={0} Warning Min={1} Max={2}", text, driveTemperatureRange.Min, driveTemperatureRange.Max);
            }
            else
            {
                str += string.Format("Cannot find drive model: {0}", text);
            }
            str += Environment.NewLine;
            str += Drivelist.GetInstance().Dump();
            str += DriveMap.GetInstance().Dump();
            str += EthernetPortProfiles.GetInstance().Dump();
            str += CpuList.GetInstance().Dump();
            str += SystemProfiles.GetInstance().Dump();
            str += ItemProfiles.GetInstance().Dump();
            return(str + ThermalProfiles.GetInstance().Dump());
        }
 public static ThermalProfiles GetRangeProfiles()
 {
     return(ThermalProfiles.GetInstance());
 }