예제 #1
0
        public RAMGroup(SMBIOS smbios, ISettings settings)
        {
            // No implementation for RAM on Unix systems
            int p = (int)Environment.OSVersion.Platform;

            if ((p == 4) || (p == 128))
            {
                hardware = new Hardware[0];
                return;
            }

            string name;

            if (smbios.MemoryDevices.Length > 0)
            {
                name = smbios.MemoryDevices[0].ManufacturerName + " " +
                       smbios.MemoryDevices[0].PartNumber;
            }
            else
            {
                name = "Generic Memory";
            }

            hardware = new Hardware[] { new GenericRAM(name, settings) };
        }
예제 #2
0
파일: Mainboard.cs 프로젝트: Mauzen/LOLFan
        public Mainboard(SMBIOS smbios, ISettings settings)
        {
            this.settings = settings;
            this.smbios   = smbios;

            Manufacturer manufacturer = smbios.Board == null ? Manufacturer.Unknown :
                                        Identification.GetManufacturer(smbios.Board.ManufacturerName);

            Model model = smbios.Board == null ? Model.Unknown :
                          Identification.GetModel(smbios.Board.ProductName);

            if (smbios.Board != null)
            {
                if (!string.IsNullOrEmpty(smbios.Board.ProductName))
                {
                    if (manufacturer == Manufacturer.Unknown)
                    {
                        this.name = smbios.Board.ProductName;
                    }
                    else
                    {
                        this.name = manufacturer + " " +
                                    smbios.Board.ProductName;
                    }
                }
                else
                {
                    this.name = manufacturer.ToString();
                }
            }
            else
            {
                this.name = Manufacturer.Unknown.ToString();
            }

            this.customName = settings.GetValue(
                new Identifier(Identifier, "name").ToString(), name);

            ISuperIO[] superIO;
            int        p = (int)Environment.OSVersion.Platform;

            if ((p == 4) || (p == 128))
            {
                this.lmSensors = new LMSensors();
                superIO        = lmSensors.SuperIO;
            }
            else
            {
                this.lpcio = new LPCIO();
                superIO    = lpcio.SuperIO;
            }

            superIOHardware = new Hardware[superIO.Length];
            for (int i = 0; i < superIO.Length; i++)
            {
                superIOHardware[i] = new SuperIOHardware(this, superIO[i],
                                                         manufacturer, model, settings);
            }
        }
예제 #3
0
 public RAMGroup(SMBIOS smbios, ISettings settings)
 {
     // No implementation for RAM on Unix systems
     if (Software.OperatingSystem.IsLinux)
     {
         hardware = new Hardware[0];
         return;
     }
     hardware = new Hardware[] { new GenericRAM("Generic Memory", settings) };
 }
예제 #4
0
파일: RAMGroup.cs 프로젝트: reimashi/jotai
        public RAMGroup(SMBIOS smbios, ISettings settings)
        {
            // No implementation for RAM on Unix systems
              int p = (int)Environment.OSVersion.Platform;
              if ((p == 4) || (p == 128)) {
            hardware = new Hardware[0];
            return;
              }

              hardware = new Hardware[] { new GenericRAM("Generic Memory", settings) };
        }
예제 #5
0
        private void SetCpuClocks(GenericCPU cp, SMBIOS hwBios, CpuClocks cpuClocks)
        {
            cpuClocks.CoreSpeed = (float)(Math.Round(cp.TimeStampCounterFrequency, 2));
            cpuClocks.BusSpeed  = hwBios?.Processor.ExternalClock ?? 0;

            if (cpuClocks.BusSpeed > 0)
            {
                cpuClocks.Multiplier = Convert.ToDecimal(Math.Round(cpuClocks.CoreSpeed / cpuClocks.BusSpeed, MidpointRounding.ToEven));
                cpuClocks.BusSpeed   = (float)Math.Round(cpuClocks.CoreSpeed / (float)cpuClocks.Multiplier, 2);
            }
        }
예제 #6
0
        /// <inheritdoc />
        /// <summary>
        /// Initialize a new instance of the <see cref = "T:iTin.Core.Hardware.Specification.Dmi.DmiClassCollection" /> class.
        /// </summary>
        /// <param name="parent">Estructura.</param>
        internal DmiClassCollection(DmiStructure parent) : base(new List <DmiClass>())
        {
            SMBIOS smbios        = DmiHelper.Smbios;
            int    smbiosVersion = smbios.Version;
            SmbiosStructureCollection structures = smbios.Get((SmbiosStructure)(int)parent.Class);

            foreach (var structure in structures)
            {
                Items.Add(new DmiClass(DmiStructureFactory.Create(structure, smbiosVersion)));
            }
        }
예제 #7
0
파일: Computer.cs 프로젝트: houseofcat/WOLF
        public void funcPopulateSMBIOSes()
        {
            SelectQuery QuerySMBIOSes      = new SelectQuery("SELECT * FROM Win32_SMBIOSMemory");
            ManagementObjectCollection moc = new ManagementObjectSearcher(QuerySMBIOSes).Get();

            Parallel.ForEach(moc.Cast <ManagementObject>(), mo =>
            {
                SMBIOS temp = new SMBIOS(mo);

                listSMBIOS.Add(temp);
            });
        }
예제 #8
0
        /// <inheritdoc/>
        /// <summary>
        /// Initialize a new instance of the <see cref="DmiStructureCollection"/> class.
        /// </summary>
        /// <param name="context">a <see cref="SMBIOS"/> reference.</param>
        internal DmiStructureCollection(SMBIOS context) : base(new List <DmiStructure>())
        {
            if (context.Version == 0 && context.ImplementedStructures.Count == 0 && context.Lenght == 0)
            {
                return;
            }

            foreach (var smbiosStructure in context.ImplementedStructures)
            {
                Items.Add(new DmiStructure((DmiStructureClass)(int)smbiosStructure, context));
            }
        }
예제 #9
0
        public RAMGroup(SMBIOS smbios, ISettings settings)
        {
            // No implementation for RAM on Unix systems
            int p = (int)Environment.OSVersion.Platform;

            if ((p == 4) || (p == 128))
            {
                hardware = new Hardware[0];
                return;
            }

            hardware = new Hardware[] { new GenericRAM("Generic Memory", settings) };
        }
예제 #10
0
        public RAMGroup(SMBIOS smbios, ISettings settings)
        {
            // No implementation for RAM on Unix systems
              int p = (int)Environment.OSVersion.Platform;
              if ((p == 4) || (p == 128)) {
            hardware = new Hardware[0];
            return;
              }

              string name;
              if (smbios.MemoryDevices.Length > 0) {
            name = smbios.MemoryDevices[0].ManufacturerName + " " +
              smbios.MemoryDevices[0].PartNumber;
              } else {
            name = "Generic Memory";
              }

              hardware = new Hardware[] { new GenericRAM(name, settings) };
        }
예제 #11
0
 public MainboardGroup(SMBIOS smbios, ISettings settings) {
   mainboards = new Mainboard[1];
   mainboards[0] = new Mainboard(smbios, settings);
 }
예제 #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SmbiosStructureInfo"/> struct.
 /// </summary>
 /// <param name="context">The <see cref="SMBIOS"/> context.</param>
 /// <param name="structureType">Type of the structure.</param>
 public SmbiosStructureInfo(SMBIOS context, SmbiosStructure structureType)
 {
     Context       = context;
     StructureType = structureType;
     SmbiosVersion = context.Version;
 }
 public MainboardGroup(SMBIOS smbios, ISettings settings)
 {
     mainboards    = new Mainboard[1];
     mainboards[0] = new Mainboard(smbios, settings);
 }
예제 #14
0
파일: Mainboard.cs 프로젝트: reimashi/jotai
        public Mainboard(SMBIOS smbios, ISettings settings)
        {
            this.settings = settings;
            this.smbios = smbios;

            Manufacturer manufacturer = smbios.Board == null ? Manufacturer.Unknown :
              Identification.GetManufacturer(smbios.Board.ManufacturerName);

            Model model = smbios.Board == null ? Model.Unknown :
              Identification.GetModel(smbios.Board.ProductName);
            
            if (smbios.Board != null)
            {
                if (!string.IsNullOrEmpty(smbios.Board.ProductName))
                {
                    this.model = smbios.Board.ProductName;

                    if (manufacturer == Manufacturer.Unknown)
                    {
                        this.manufacturer = String.Empty;
                    }
                    else
                    {
                        this.manufacturer = manufacturer.ToString();
                    }
                }
                else
                {
                    this.manufacturer = manufacturer.ToString();
                    this.model = String.Empty;
                }
            }
            else
            {
                this.manufacturer = String.Empty;
                this.model = String.Empty;
            }

            String name;
            if (this.manufacturer == String.Empty)
                name = Manufacturer.Unknown.ToString();
            else
                name = this.manufacturer;

            if (this.model != String.Empty)
                name += " " + this.model;

            this.name = name;

            this.customName = settings.GetValue(
              new Identifier(Identifier, "name").ToString(), name);

            ISuperIO[] superIO;
            int p = (int)Environment.OSVersion.Platform;
            if ((p == 4) || (p == 128))
            {
                this.lmSensors = new LMSensors();
                superIO = lmSensors.SuperIO;
            }
            else
            {
                this.lpcio = new LPCIO();
                superIO = lpcio.SuperIO;
            }

            superIOHardware = new Hardware[superIO.Length];
            for (int i = 0; i < superIO.Length; i++)
                superIOHardware[i] = new SuperIOHardware(this, superIO[i],
                  manufacturer, model, settings);
        }
예제 #15
0
        public Mainboard(SMBIOS smbios, ISettings settings)
        {
            this.settings = settings;
            this.smbios   = smbios;

            Manufacturer manufacturer = smbios.Board == null ? Manufacturer.Unknown :
                                        Identification.GetManufacturer(smbios.Board.ManufacturerName);

            Model model = smbios.Board == null ? Model.Unknown :
                          Identification.GetModel(smbios.Board.ProductName);

            if (smbios.Board != null)
            {
                if (!string.IsNullOrEmpty(smbios.Board.ProductName))
                {
                    this.model = smbios.Board.ProductName;

                    if (manufacturer == Manufacturer.Unknown)
                    {
                        this.manufacturer = String.Empty;
                    }
                    else
                    {
                        this.manufacturer = manufacturer.ToString();
                    }
                }
                else
                {
                    this.manufacturer = manufacturer.ToString();
                    this.model        = String.Empty;
                }
            }
            else
            {
                this.manufacturer = String.Empty;
                this.model        = String.Empty;
            }

            String name;

            if (this.manufacturer == String.Empty)
            {
                name = Manufacturer.Unknown.ToString();
            }
            else
            {
                name = this.manufacturer;
            }

            if (this.model != String.Empty)
            {
                name += " " + this.model;
            }

            this.name = name;

            this.customName = settings.GetValue(
                new Identifier(Identifier, "name").ToString(), name);

            ISuperIO[] superIO;
            int        p = (int)Environment.OSVersion.Platform;

            if ((p == 4) || (p == 128))
            {
                this.lmSensors = new LMSensors();
                superIO        = lmSensors.SuperIO;
            }
            else
            {
            }
        }
예제 #16
0
 /// <summary>
 /// Initialize a new instance of the class <see cref="DmiStructure"/>.
 /// </summary>
 /// <param name="class">Structure.</param>
 /// <param name="context">a <see cref="SMBIOS"/> reference.</param>
 internal DmiStructure(DmiStructureClass @class, SMBIOS context)
 {
     Class   = @class;
     Context = context;
 }