├── .appveyor.yml ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ └── stale.yml ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── Common ├── CommonAssemblyInfo.cs └── CommonAssemblyVersion.cs ├── Configs ├── ASUS Vivobook X580VD.xml ├── Acer Aspire 1410.xml ├── Acer Aspire 1810T.xml ├── Acer Aspire 1810TZ.xml ├── Acer Aspire 1825PTZ.xml ├── Acer Aspire 5738G.xml ├── Acer Aspire 5745G.xml ├── Acer Aspire 5749.xml ├── Acer Aspire 5930.xml ├── Acer Aspire 7551G.xml ├── Acer Aspire 7735.xml ├── Acer Aspire 7740G.xml ├── Acer Aspire 7741G.xml ├── Acer Aspire E1-522.xml ├── Acer Aspire E1-772.xml ├── Acer Aspire E5-471G.xml ├── Acer Aspire E5-475G.xml ├── Acer Aspire E5-575G.xml ├── Acer Aspire E5-731.xml ├── Acer Aspire LT-10Q.xml ├── Acer Aspire One AO531h.xml ├── Acer Aspire One AO751h.xml ├── Acer Aspire One AOA110.xml ├── Acer Aspire One AOA150.xml ├── Acer Aspire S3.xml ├── Acer Aspire S7-191.xml ├── Acer Aspire S7-391.xml ├── Acer Aspire V13.xml ├── Acer Aspire V3-371.xml ├── Acer Aspire V3-571G.xml ├── Acer Aspire V5-551.xml ├── Acer Aspire V5-572G.xml ├── Acer Aspire VN7-572G V15 Nitro BE.xml ├── Acer Aspire VN7-572G V15 Nitro.xml ├── Acer Aspire VN7-591G V15 Nitro BE.xml ├── Acer Aspire VN7-791G V17 Nitro BE.xml ├── Acer Aspire VN7-792G V17 Nitro BE.xml ├── Acer Aspire VN7-793G V17 Nitro BE.xml ├── Acer Extensa 5220.xml ├── Acer Extensa 5630Z.xml ├── Acer LT-10Q.xml ├── Acer Predator 17 G9-793-782K.xml ├── Acer Predator G3-572.xml ├── Acer TravelMate 7730G.xml ├── Asus F5SR.xml ├── Asus G53SX.xml ├── Asus K43SD.xml ├── Asus K43U.xml ├── Asus K46C.xml ├── Asus K501LX.xml ├── Asus K501UX.xml ├── Asus M52VA.xml ├── Asus N550JV.xml ├── Asus N550JX.xml ├── Asus N551JB.xml ├── Asus N56JR.xml ├── Asus N56VZ.xml ├── Asus ROG G501JW.xml ├── Asus ROG G751JL.xml ├── Asus ROG G751JT.xml ├── Asus ROG G751JY.xml ├── Asus ROG G752VS.xml ├── Asus ROG G752VT.xml ├── Asus ROG G752VY.xml ├── Asus ROG G75VX.xml ├── Asus ROG GL702VM.xml ├── Asus ROG GL702ZC.xml ├── Asus Transformer 3 Pro.xml ├── Asus Vivobook S400CA.xml ├── Asus Vivobook TP301UA.xml ├── Asus X301A1.xml ├── Asus X540LA.xml ├── Asus Zenbook Flip UX360UAK.xml ├── Asus Zenbook Pro UX550VE.xml ├── Asus Zenbook UX21E.xml ├── Asus Zenbook UX301LA.xml ├── Asus Zenbook UX302LA.xml ├── Asus Zenbook UX310UA.xml ├── Asus Zenbook UX310UAK.xml ├── Asus Zenbook UX31A.xml ├── Asus Zenbook UX32A.xml ├── Asus Zenbook UX32LN.xml ├── Asus Zenbook UX32VD.xml ├── Asus Zenbook UX330UA.xml ├── Asus Zenbook UX410UQ.xml ├── Asus Zenbook UX430UA.xml ├── Asus Zenbook UX430UQ.xml ├── Asus Zenbook UX51VZA.xml ├── Asus Zenbook UX530U.xml ├── Dell Inspiron 7348.xml ├── Dell Inspiron 7375.xml ├── Dell Vostro 3350.xml ├── Dell XPS M1530.xml ├── Fujitsu ESPRIMO Mobile V5505.xml ├── Gateway AOA110.xml ├── Gateway AOA150.xml ├── Gateway LT31.xml ├── Gigabyte AERO 14KV8.xml ├── Gigabyte p35w v3.xml ├── HP 15-BW00x.xml ├── HP Compaq 15-s103tx.xml ├── HP Compaq 615.xml ├── HP Compaq 625.xml ├── HP Compaq 6530b.xml ├── HP Compaq 6735s Turion X2 RM-72.xml ├── HP Compaq 8710p.xml ├── HP Compaq Presario CQ40 Turion X2 RM-74.xml ├── HP Compaq nw9440.xml ├── HP ENVY m6 1206dx.xml ├── HP ENVY m6 Sleekbook.xml ├── HP ENVY m6-1254eo.xml ├── HP ENVY x360 Convertible 13-ag0xxx.xml ├── HP ENVY x360 Convertible 15-cn0xxx.xml ├── HP EliteBook 2560p.xml ├── HP EliteBook 2570p.xml ├── HP EliteBook 2760p.xml ├── HP EliteBook 840 G2.xml ├── HP EliteBook 8560p.xml ├── HP EliteBook 8560w.xml ├── HP EliteBook 8760w.xml ├── HP EliteBook Folio 1040 G1.xml ├── HP EliteBook Folio 9470m.xml ├── HP EliteBook Folio 9470m_i5-3427u_bios-F.66.xml ├── HP Laptop 14-cm0xxx.xml ├── HP Laptop 14-dk0xxx.xml ├── HP Laptop 17-by1xxx.xml ├── HP Laptop 17-ca1xxx.xml ├── HP Notebook 15-ba010ng.xml ├── HP OMEN Notebook PC 15.xml ├── HP Pavilion 14-v066br.xml ├── HP Pavilion 17-ab240nd.xml ├── HP Pavilion HDX18.xml ├── HP Pavilion dv6 6190.xml ├── HP Pavilion dv6.xml ├── HP Pavilion x360 Convertible 14-dh1xxx.xml ├── HP Pavilion x360 Convertible 15-br0xx.xml ├── HP ProBook 430 G1.xml ├── HP ProBook 440 G3.xml ├── HP ProBook 450 G1.xml ├── HP ProBook 4520s.xml ├── HP ProBook 4530s.xml ├── HP ProBook 4535s.xml ├── HP ProBook 4540s.xml ├── HP ProBook 4710s.xml ├── HP ProBook 4720s.xml ├── HP ProBook 5330m.xml ├── HP ProBook 6455b.xml ├── HP ProBook 6460b.xml ├── HP ProBook 6465b.xml ├── HP ProBook 650 G1.xml ├── HP ProBook 650 G2.xml ├── HP ProBook 6550b.xml ├── HP ProBook 6560b.xml ├── HP Spectre x360 Convertible 13-ae0xx.xml ├── HP Spectre x360 Convertible 15-ch0xx.xml ├── HP ZBook 15 G3.xml ├── HP ZBook 15.xml ├── HP ZBook Studio G3.xml ├── Lenovo IdeaPad Y580.xml ├── Lenovo Ideapad 500S-13ISK.xml ├── Lenovo Ideapad 500S-14ISK.xml ├── Lenovo Ideapad 510s.xml ├── Lenovo Ideapad 710S.xml ├── Lenovo Ideapad U160.xml ├── Lenovo Ideapad U330p.xml ├── Lenovo Ideapad U430p.xml ├── Lenovo ThinkPad 13.xml ├── Lenovo ThinkPad Edge E520.xml ├── Lenovo ThinkPad Helix.xml ├── Lenovo ThinkPad L380 Yoga.xml ├── Lenovo ThinkPad L390 i7-8565U.xml ├── Lenovo ThinkPad T430s.xml ├── Lenovo ThinkPad T440s.xml ├── Lenovo ThinkPad T540p.xml ├── Lenovo ThinkPad x121e.xml ├── Lenovo ThinkPad x220i.xml ├── Lenovo ThinkPad x230.xml ├── Lenovo Thinkpad L530.xml ├── Lenovo U31-70.xml ├── Lenovo U41-70.xml ├── Lenovo V330-IKB(81AX).xml ├── Lenovo V580.xml ├── Lenovo Yoga 11s.xml ├── Lenovo Yoga 13 2191.xml ├── Lenovo Yoga 2 13.xml ├── Lenovo Yoga 3 14.xml ├── Lenovo Yoga 510.xml ├── Lenovo Yoga 710.xml ├── Medion Akoya P6612.xml ├── Medion Akoya P6630.xml ├── Packard Bell AOA110.xml ├── Packard Bell AOA150.xml ├── Packard Bell DOA150.xml ├── Packard Bell DOTMA.xml ├── Packard Bell DOTMU.xml ├── Packard Bell DOTVR46.xml ├── Packard Bell ENBFT.xml ├── Packard Bell Easynote TJ65.xml ├── Razer Blade 14 2017.xml ├── RedmiBook 14 (TM1814).xml ├── Sony Vaio SVE1711.xml ├── Sony Vaio SVE1713Y1E.xml ├── Sony Vaio SVF13N190X.xml ├── Sony Vaio SVF14N1C5E.xml ├── Sony Vaio SVT1312M1ES.xml ├── Sony Vaio VPCF12S1E.xml ├── Toshiba Satellite L740.xml ├── Toshiba Satellite L745.xml ├── Vestel Smartboard Series-14XXXX.xml └── Xiaomi Mi Book (TM1613, TM1703).xml ├── Core ├── NbfcCli │ ├── App.Linux.config │ ├── App.Windows.config │ ├── App.manifest │ ├── CommandLineOptions │ │ ├── ConfigVerb.cs │ │ ├── HelpGenerator.cs │ │ ├── SetVerb.cs │ │ ├── StartVerb.cs │ │ ├── StatusVerb.cs │ │ ├── StopVerb.cs │ │ └── Verbs.cs │ ├── NbfcCli.csproj │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Service References │ │ └── NbfcService │ │ │ ├── Arrays.xsd │ │ │ ├── NbfcCli.NbfcService.FanControlInfo.datasource │ │ │ ├── Reference.cs │ │ │ ├── Reference.svcmap │ │ │ ├── StagWare.FanControl.Service.xsd │ │ │ ├── configuration.svcinfo │ │ │ ├── configuration91.svcinfo │ │ │ ├── service.wsdl │ │ │ ├── service.xsd │ │ │ └── service1.xsd │ └── packages.config ├── NbfcProbe │ ├── App.manifest │ ├── CommandLineOptions │ │ ├── ECDumpVerb.cs │ │ ├── ECMonitorVerb.cs │ │ ├── ECReadVerb.cs │ │ ├── ECWriteVerb.cs │ │ └── Verbs.cs │ ├── NbfcProbe.csproj │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── app.config │ └── packages.config ├── NbfcService │ ├── App.Linux.config │ ├── App.Windows.config │ ├── App.manifest │ ├── NbfcService.Designer.cs │ ├── NbfcService.cs │ ├── NbfcService.csproj │ ├── NbfcService.resx │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── Plugins │ ├── OpenHardwareMonitor │ │ ├── Collections │ │ │ ├── IReadOnlyArray.cs │ │ │ ├── ListSet.cs │ │ │ ├── Pair.cs │ │ │ ├── ReadOnlyArray.cs │ │ │ └── RingCollection.cs │ │ ├── Hardware │ │ │ ├── ATI │ │ │ │ ├── ADL.cs │ │ │ │ ├── ATIGPU.cs │ │ │ │ └── ATIGroup.cs │ │ │ ├── CPU │ │ │ │ ├── AMD0FCPU.cs │ │ │ │ ├── AMD10CPU.cs │ │ │ │ ├── AMD17CPU.cs │ │ │ │ ├── AMDCPU.cs │ │ │ │ ├── CPUGroup.cs │ │ │ │ ├── CPUID.cs │ │ │ │ ├── CPULoad.cs │ │ │ │ ├── GenericCPU.cs │ │ │ │ └── IntelCPU.cs │ │ │ ├── Computer.cs │ │ │ ├── Control.cs │ │ │ ├── FirmwareTable.cs │ │ │ ├── HDD │ │ │ │ ├── AbstractHarddrive.cs │ │ │ │ ├── DebugSmart.cs │ │ │ │ ├── DriveAttributeValue.cs │ │ │ │ ├── DriveThresholdValue.cs │ │ │ │ ├── HDDGeneric.cs │ │ │ │ ├── HarddriveGroup.cs │ │ │ │ ├── ISmart.cs │ │ │ │ ├── NamePrefixAttribute.cs │ │ │ │ ├── RequireSmartAttribute.cs │ │ │ │ ├── SSDIndilinx.cs │ │ │ │ ├── SSDIntel.cs │ │ │ │ ├── SSDMicron.cs │ │ │ │ ├── SSDPlextor.cs │ │ │ │ ├── SSDSamsung.cs │ │ │ │ ├── SSDSandforce.cs │ │ │ │ ├── SmartAttribute.cs │ │ │ │ ├── SmartNames.cs │ │ │ │ └── WindowsSmart.cs │ │ │ ├── Hardware.cs │ │ │ ├── Heatmaster │ │ │ │ ├── Heatmaster.cs │ │ │ │ └── HeatmasterGroup.cs │ │ │ ├── HexStringArray.cs │ │ │ ├── IComputer.cs │ │ │ ├── IControl.cs │ │ │ ├── IElement.cs │ │ │ ├── IGroup.cs │ │ │ ├── IHardware.cs │ │ │ ├── IOControlCode.cs │ │ │ ├── IParameter.cs │ │ │ ├── ISensor.cs │ │ │ ├── ISettings.cs │ │ │ ├── IVisitor.cs │ │ │ ├── Identifier.cs │ │ │ ├── KernelDriver.cs │ │ │ ├── LPC │ │ │ │ ├── Chip.cs │ │ │ │ ├── F718XX.cs │ │ │ │ ├── ISuperIO.cs │ │ │ │ ├── IT87XX.cs │ │ │ │ ├── LMSensors.cs │ │ │ │ ├── LPCIO.cs │ │ │ │ ├── LPCPort.cs │ │ │ │ ├── NCT677X.cs │ │ │ │ └── W836XX.cs │ │ │ ├── Mainboard │ │ │ │ ├── GigabyteTAMG.cs │ │ │ │ ├── Identification.cs │ │ │ │ ├── Mainboard.cs │ │ │ │ ├── MainboardGroup.cs │ │ │ │ ├── Manufacturer.cs │ │ │ │ ├── Model.cs │ │ │ │ └── SuperIOHardware.cs │ │ │ ├── Nvidia │ │ │ │ ├── NVAPI.cs │ │ │ │ ├── NvidiaGPU.cs │ │ │ │ └── NvidiaGroup.cs │ │ │ ├── Opcode.cs │ │ │ ├── OperatingSystem.cs │ │ │ ├── PInvokeDelegateFactory.cs │ │ │ ├── Parameter.cs │ │ │ ├── RAM │ │ │ │ ├── GenericRAM.cs │ │ │ │ └── RAMGroup.cs │ │ │ ├── Ring0.cs │ │ │ ├── SMBIOS.cs │ │ │ ├── Sensor.cs │ │ │ ├── SensorVisitor.cs │ │ │ ├── TBalancer │ │ │ │ ├── FTD2XX.cs │ │ │ │ ├── TBalancer.cs │ │ │ │ └── TBalancerGroup.cs │ │ │ ├── ThreadAffinity.cs │ │ │ ├── WinRing0.sys │ │ │ └── WinRing0x64.sys │ │ ├── Licenses │ │ │ └── License.html │ │ ├── OpenHardwareMonitorLib.csproj │ │ ├── Properties │ │ │ ├── AssemblyInfo.cs │ │ │ ├── AssemblyLibInfo.cs │ │ │ └── AssemblyVersion.cs │ │ └── Software │ │ │ └── OperatingSystem.cs │ ├── StagWare.Hardware.LPC │ │ ├── EmbeddedControllerBase.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── StagWare.Hardware.LPC.csproj │ ├── StagWare.Hardware │ │ ├── HardwareMonitor.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── StagWare.Hardware.csproj │ ├── StagWare.Plugins.CpuTemperatureMonitor │ │ ├── CpuTemperatureMonitor.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── StagWare.Plugins.CpuTemperatureMonitor.csproj │ ├── StagWare.Plugins.ECLinux │ │ ├── ECLinux.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── StagWare.Plugins.ECLinux.csproj │ ├── StagWare.Plugins.ECSysLinux │ │ ├── ECSysLinux.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── StagWare.Plugins.ECSysLinux.csproj │ ├── StagWare.Plugins.ECWindows │ │ ├── ECWindows.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── StagWare.Plugins.ECWindows.csproj │ └── StagWare.Plugins.FSTemperatureMonitor │ │ ├── FSTemperatureMonitor.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── StagWare.Plugins.FSTemperatureMonitor.csproj │ │ └── TemperatureSource.cs ├── StagWare.BiosInfo │ ├── BiosInfo.cs │ ├── BiosInfoLinux.cs │ ├── BiosInfoWindows.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── StagWare.BiosInfo.csproj ├── StagWare.Configurations │ ├── ConfigManager.cs │ ├── ExtensionMethods │ │ └── StringExtensionMethods.cs │ ├── FanConfiguration.cs │ ├── FanControlConfig.cs │ ├── FanControlConfigManager.cs │ ├── FanControlConfigV2.cs │ ├── FanSpeedPercentageOverride.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── RegisterWriteConfiguration.cs │ ├── RegisterWriteRequest.cs │ ├── StagWare.FanControl.Configurations.csproj │ ├── TemperatureThreshold.cs │ ├── Validation │ │ ├── FanControlConfigValidator.cs │ │ ├── IValidationRule.cs │ │ ├── Rules │ │ │ ├── FanConfigurationsNotEmtpy.cs │ │ │ ├── MaxFanSpeedThresholdRequired.cs │ │ │ ├── NoDuplicateTemperatureUpThresholds.cs │ │ │ ├── UpThresholdMayNotBeLowerThanDownThreshold.cs │ │ │ ├── UpThresholdsMustBeLowerThanCriticalTemperature.cs │ │ │ └── ZeroFanSpeedThresholdRecommended.cs │ │ ├── Validation.cs │ │ ├── ValidationSummary.cs │ │ └── Validator.cs │ └── packages.config ├── StagWare.FanControl.Service │ ├── App.config │ ├── FanControlInfo.cs │ ├── FanControlService.cs │ ├── FanStatus.cs │ ├── IFanControlService.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ServiceSettings.cs │ ├── StagWare.FanControl.Service.csproj │ └── packages.config ├── StagWare.FanControl │ ├── ArithmeticMeanTemperatureFilter.cs │ ├── Fan.cs │ ├── FanControl.cs │ ├── FanInformation.cs │ ├── ITemperatureFilter.cs │ ├── Plugins │ │ ├── FanControlMetadataAttribute.cs │ │ ├── FanControlPluginLoader.cs │ │ ├── IEmbeddedController.cs │ │ ├── IFanControlPlugin.cs │ │ ├── IFanControlPluginMetadata.cs │ │ ├── ITemperatureMonitor.cs │ │ └── PluginInitializationException.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── StagWare.FanControl.csproj │ ├── TemperatureThresholdManager.cs │ └── packages.config └── StagWare.Settings │ ├── DefaultValueAttribute.cs │ ├── LoadSettingsFailedEventArgs.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── RestoreDefaultsIgnoreAttribute.cs │ ├── SettingsBase.cs │ ├── SettingsService.cs │ ├── StagWare.Settings.csproj │ └── XmlWrapper.cs ├── LICENSE.md ├── Linux ├── nbfc-sleep.service ├── nbfc.service └── nbfcservice.sh ├── NoteBookFanControl.sln ├── README.md ├── Tests ├── StagWare.FanControl.Configurations.Tests │ ├── ConfigManagerTests.cs │ ├── ConfigsTests.cs │ ├── ExtensionMethods │ │ └── StringExtensionMethodsTests.cs │ ├── FanControlConfigManagerTests.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── StagWare.FanControl.Configurations.Tests.csproj │ └── packages.config └── StagWare.FanControl.Tests │ ├── ArithmeticMeanTemperatureFilterTests.cs │ ├── FanControlTests.cs │ ├── FanTests.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── StagWare.FanControl.Tests.csproj │ └── packages.config ├── Windows ├── ConfigEditor │ ├── App.xaml │ ├── App.xaml.cs │ ├── Behaviors │ │ └── SelectionChangedBehavior.cs │ ├── Commands │ │ └── RelayCommand.cs │ ├── ConfigEditor.csproj │ ├── ExtensionMethods │ │ ├── CollectionExtensionMethods.cs │ │ ├── IconExtensionMethods.cs │ │ └── MouseDeviceExtensionMethods.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── ValueConverters │ │ ├── BooleanToBrushConverter.cs │ │ ├── BooleanToButtonTextConverter.cs │ │ ├── InvertBooleanConverter.cs │ │ ├── ReadWriteWordsToMaximumConverter.cs │ │ └── SelectedItemToBooleanConverter.cs │ ├── ViewModels │ │ ├── EventArgs │ │ │ ├── CommandCompletedEventArgs.cs │ │ │ └── DialogEventArgs.cs │ │ ├── FanConfigViewModel.cs │ │ ├── FanSpeedOverrideViewModel.cs │ │ ├── MainViewModel.cs │ │ ├── RegisterWriteConfigViewModel.cs │ │ ├── RequestConfigNameViewModel.cs │ │ ├── RequestConfigPathViewModel.cs │ │ ├── TemperatureThresholdViewModel.cs │ │ └── ViewModelBase.cs │ ├── Windows │ │ ├── FanConfigWindow.xaml │ │ ├── FanConfigWindow.xaml.cs │ │ ├── FanSpeedOverrideWindow.xaml │ │ ├── FanSpeedOverrideWindow.xaml.cs │ │ ├── MainWindow.xaml │ │ ├── MainWindow.xaml.cs │ │ ├── NonModalDialogWindow.cs │ │ ├── RegisterWriteConfigWindow.xaml │ │ ├── RegisterWriteConfigWindow.xaml.cs │ │ ├── RequestConfigNameWindow.xaml │ │ ├── RequestConfigNameWindow.xaml.cs │ │ ├── TemperatureThresholdWindow.xaml │ │ └── TemperatureThresholdWindow.xaml.cs │ ├── app.config │ ├── app.manifest │ ├── fan.ico │ └── packages.config ├── NbfcClient │ ├── App.xaml │ ├── App.xaml.cs │ ├── AppSettings.cs │ ├── AutorunEntry.cs │ ├── DesignData │ │ ├── FanControllerCollection.xaml │ │ ├── FanControllerViewModelCollection.cs │ │ ├── FanControllerViewModelData.xaml │ │ └── MainWindowViewModelData.xaml │ ├── Messages │ │ ├── CloseSelectConfigDialogMessage.cs │ │ ├── OpenSelectConfigDialogMessage.cs │ │ ├── OpenSettingsDialogMessage.cs │ │ └── ReloadFanControlInfoMessage.cs │ ├── NbfcClient.csproj │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ └── Resources.resx │ ├── Service References │ │ └── NbfcService │ │ │ ├── Arrays.xsd │ │ │ ├── NbfcClient.NbfcService.FanControlInfo.datasource │ │ │ ├── Reference.cs │ │ │ ├── Reference.svcmap │ │ │ ├── StagWare.FanControl.Service.xsd │ │ │ ├── configuration.svcinfo │ │ │ ├── configuration91.svcinfo │ │ │ ├── service.wsdl │ │ │ ├── service.xsd │ │ │ └── service1.xsd │ ├── Services │ │ ├── FanControlClient.cs │ │ ├── FanControlStatusChangedEventArgs.cs │ │ └── IFanControlClient.cs │ ├── TrayIconRenderer.cs │ ├── UserControls │ │ ├── BindableTaskbarIcon.cs │ │ ├── FanController.xaml │ │ ├── FanController.xaml.cs │ │ ├── ToolTipFanInfo.xaml │ │ ├── ToolTipFanInfo.xaml.cs │ │ ├── TrayToolTip.xaml │ │ └── TrayToolTip.xaml.cs │ ├── ValueConverters │ │ ├── AddOneConverter.cs │ │ ├── BooleanToInverseConverter.cs │ │ ├── BooleanToVisibilityConverter.cs │ │ ├── ColorToBrushConverter.cs │ │ ├── ColorToContrastingBrushConverter.cs │ │ ├── ColorToStringConverter.cs │ │ ├── FanSpeedSliderValueToTextConverter.cs │ │ ├── TargetFanSpeedToTextConverter.cs │ │ └── TemperatureToTextConverter.cs │ ├── ViewModels │ │ ├── FanControllerViewModel.cs │ │ ├── MainViewModel.cs │ │ ├── SelectConfigViewModel.cs │ │ ├── SettingsViewModel.cs │ │ └── ViewModelLocator.cs │ ├── Views │ │ ├── ComboBoxItemTemplateSelector.cs │ │ ├── MainWindow.xaml │ │ ├── MainWindow.xaml.cs │ │ ├── SelectConfigWindow.xaml │ │ ├── SelectConfigWindow.xaml.cs │ │ ├── SettingsWindow.xaml │ │ └── SettingsWindow.xaml.cs │ ├── app.config │ ├── app.manifest │ ├── fan.ico │ └── packages.config └── Setup │ ├── DriverSetupWixAction │ ├── CustomAction.config │ ├── CustomAction.cs │ ├── DriverSetupWixAction.csproj │ └── Properties │ │ └── AssemblyInfo.cs │ ├── NbfcBootstrapper │ ├── Bootstrapper.wxs │ ├── NbfcBootstrapper.wixproj │ └── Resources │ │ ├── Bundle2Theme.xml │ │ ├── HyperlinkTheme.wxl │ │ ├── logo.png │ │ └── logoside.png │ └── NbfcSetup │ ├── Application.wxs │ ├── Configs.wxs │ ├── Constants.wxi │ ├── Directories.wxs │ ├── NbfcSetup.wixproj │ ├── Plugins.wxs │ └── Product.wxs ├── build.ps1 └── build.sh /.appveyor.yml: -------------------------------------------------------------------------------- 1 | version: '{build}' 2 | clone_depth: 5 3 | image: Visual Studio 2017 4 | configuration: ReleaseWindows 5 | platform: Any CPU 6 | 7 | before_build: 8 | - nuget restore 9 | 10 | build: 11 | project: NoteBookFanControl.sln 12 | 13 | artifacts: 14 | - path: Windows\Setup\NbfcBootstrapper\bin\Release\NoteBookFanControl.setup.exe 15 | name: NbfcSetup 16 | type: file 17 | 18 | deploy: 19 | description: 'This is a BETA build which may not be stable. If you fear bugs or crashes, stick to the stable releases. You have been warned :)' 20 | provider: GitHub 21 | auth_token: 22 | secure: 8dxxTcoE0H9PMhzDiaxoioUv7IfYKwUxd0J890zTAkkKab8YLQN/09IKPCw+BJZo 23 | artifact: NbfcSetup 24 | draft: true 25 | prerelease: true 26 | on: 27 | # deploy on tag push only 28 | appveyor_repo_tag: true 29 | 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help improve NBFC 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **To Reproduce** 11 | Steps to reproduce the behavior. 12 | 13 | **Expected behavior** 14 | A clear and concise description of what you expected to happen. 15 | 16 | **System information** 17 | - operating system 18 | - NBFC version 19 | - log files (see [NBFC files and directories overview](https://github.com/hirschmann/nbfc/wiki/Files-and-directories-overview)) 20 | 21 | **Additional context** 22 | Add any other context about the problem here. 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for NBFC 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. 9 | If you're about to request a config for a specific notebook model, please follow these steps before creating a new issue: [**Config requests**](https://github.com/hirschmann/nbfc/blob/master/CONTRIBUTING.md#config-requests) 10 | 11 | **Describe the solution you'd like** 12 | A clear and concise description of what you want to happen. 13 | 14 | **Additional context** 15 | Add any other context or screenshots about the feature request here. 16 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: "Close stale issues" 2 | 3 | on: 4 | schedule: 5 | - cron: "0 0 * * *" 6 | 7 | jobs: 8 | stale: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/stale@v1 14 | with: 15 | repo-token: ${{ secrets.GITHUB_TOKEN }} 16 | stale-issue-message: 'This issue is stale because it has been open more than 180 days with no activity. If nobody comments within 7 days, this issue will be closed' 17 | days-before-stale: 181 18 | days-before-close: 7 19 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: csharp 2 | solution: NoteBookFanControl.sln 3 | script: 4 | - msbuild /t:Clean,Build /p:Configuration=ReleaseLinux NoteBookFanControl.sln 5 | -------------------------------------------------------------------------------- /Common/CommonAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | 4 | [assembly: AssemblyCompany("StagWare")] 5 | [assembly: AssemblyCopyright("Copyright © 2012-2019 Stefan Hirschmann")] 6 | [assembly: AssemblyTrademark("")] 7 | [assembly: NeutralResourcesLanguage("en")] 8 | -------------------------------------------------------------------------------- /Common/CommonAssemblyVersion.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | [assembly: AssemblyVersion("1.6.3")] 4 | [assembly: AssemblyFileVersion("1.6.3")] 5 | [assembly: AssemblyInformationalVersion("1.6.3")] -------------------------------------------------------------------------------- /Configs/Acer Aspire 1410.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Aspire 1410 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 158 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Acer Aspire 1810T.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Aspire 1810T 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 158 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Acer Aspire 1810TZ.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Aspire 1810TZ 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 158 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Acer Aspire 1825PTZ.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Aspire 1825PTZ 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 158 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Acer Aspire 5738G.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Aspire 5738G 4 | 3000 5 | false 6 | 75 7 | 8 | 9 | 149 10 | 148 11 | 250 12 | 98 13 | true 14 | 255 15 | 16 | 17 | 18 | 19 | 20 | 21 | Set 22 | OnInitialization 23 | 147 24 | 20 25 | true 26 | 4 27 | Set 28 | Set EC to manual control 29 | 30 | 31 | -------------------------------------------------------------------------------- /Configs/Acer Aspire 7551G.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Aspire S3 4 | 3000 5 | false 6 | 75 7 | 8 | 9 | 149 10 | 148 11 | 250 12 | 98 13 | true 14 | 255 15 | 16 | 17 | 18 | 19 | 20 | 21 | Set 22 | OnInitialization 23 | 147 24 | 20 25 | true 26 | 4 27 | Set 28 | Set EC to manual control 29 | 30 | 31 | -------------------------------------------------------------------------------- /Configs/Acer Aspire 7735.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Aspire 7735 4 | 3000 5 | false 6 | 75 7 | 8 | 9 | 149 10 | 148 11 | 255 12 | 102 13 | true 14 | 196 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Set 23 | OnInitialization 24 | 147 25 | 20 26 | true 27 | 4 28 | Set EC to manual control 29 | 30 | 31 | -------------------------------------------------------------------------------- /Configs/Acer Aspire 7740G.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Aspire 7740G 4 | 3000 5 | false 6 | 75 7 | 8 | 9 | 149 10 | 148 11 | 250 12 | 98 13 | true 14 | 255 15 | 16 | 17 | 18 | 19 | 20 | 21 | Set 22 | OnInitialization 23 | 147 24 | 20 25 | true 26 | 4 27 | Set 28 | Set EC to manual control 29 | 30 | 31 | -------------------------------------------------------------------------------- /Configs/Acer Aspire 7741G.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Aspire 7741G 4 | 3000 5 | false 6 | 75 7 | 8 | 9 | 149 10 | 148 11 | 250 12 | 98 13 | true 14 | 255 15 | 16 | 17 | 18 | 19 | 20 | 21 | Set 22 | OnInitialization 23 | 147 24 | 20 25 | true 26 | 4 27 | Set 28 | Set EC to manual control 29 | 30 | 31 | -------------------------------------------------------------------------------- /Configs/Acer Aspire LT-10Q.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | LT-10Q 4 | 3000 5 | false 6 | 75 7 | 8 | 9 | 85 10 | 85 11 | 32 12 | 255 13 | true 14 | 0 15 | 16 | 17 | 18 | 19 | 20 | 21 | Set 22 | OnInitialization 23 | 147 24 | 20 25 | true 26 | 4 27 | Set EC to manual control 28 | 29 | 30 | -------------------------------------------------------------------------------- /Configs/Acer Aspire One AO531h.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AO531h 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 32 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Acer Aspire One AO751h.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AO751h 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 33 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Acer Aspire One AOA110.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AOA110 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 33 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Acer Aspire One AOA150.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AOA150 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 32 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Acer Aspire S3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Aspire S3 4 | 3000 5 | false 6 | 75 7 | Phreaker 8 | 9 | 10 | 149 11 | 148 12 | 250 13 | 98 14 | true 15 | 255 16 | 17 | 18 | 19 | 20 | 21 | 22 | Set 23 | OnInitialization 24 | 147 25 | 20 26 | true 27 | 4 28 | Set EC to manual control 29 | 30 | 31 | -------------------------------------------------------------------------------- /Configs/Acer Extensa 5220.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Extensa 5220 4 | 3000 5 | false 6 | 75 7 | 8 | 9 | 149 10 | 148 11 | 250 12 | 98 13 | true 14 | 255 15 | 16 | 17 | 18 | 19 | 20 | 21 | Set 22 | OnInitialization 23 | 147 24 | 20 25 | true 26 | 4 27 | Set 28 | Set EC to manual control 29 | 30 | 31 | -------------------------------------------------------------------------------- /Configs/Acer LT-10Q.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | LT-10Q 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 32 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Acer TravelMate 7730G.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | TravelMate 7730G 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 175 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Asus F5SR.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | F5SR 4 | 150 5 | false 6 | 75 7 | 8 | 9 | 151 10 | 151 11 | 0 12 | 8 13 | true 14 | 9 15 | 16 | 17 | 18 | 19 | 20 | 21 | Set 22 | OnWriteFanSpeed 23 | 160 24 | 10 25 | true 26 | 10 27 | 28 | 29 | Set 30 | OnWriteFanSpeed 31 | 166 32 | 10 33 | true 34 | 10 35 | 36 | 37 | -------------------------------------------------------------------------------- /Configs/Fujitsu ESPRIMO Mobile V5505.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ESPRIMO Mobile V5505 4 | 3000 5 | false 6 | 75 7 | 8 | 9 | 149 10 | 148 11 | 250 12 | 98 13 | true 14 | 255 15 | 16 | 17 | 18 | 19 | 20 | 21 | Set 22 | OnInitialization 23 | 147 24 | 20 25 | true 26 | 4 27 | Set EC to manual control 28 | 29 | 30 | -------------------------------------------------------------------------------- /Configs/Gateway AOA110.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AOA110 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 33 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Gateway AOA150.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AOA150 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 32 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Gateway LT31.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | LT31 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 158 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Gigabyte p35w v3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Gigabyte p35w v3 4 | false 5 | 6 | 7 | 96 8 | 176 9 | 80 10 | 221 11 | true 12 | 100 13 | CPU fan 14 | 15 | 16 | 96 17 | 177 18 | 80 19 | 221 20 | true 21 | 100 22 | GPU fan 23 | 24 | 25 | 26 | 27 | Set 28 | OnInitialization 29 | 1 30 | 163 31 | Set EC to manual control 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Configs/HP Compaq 615.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Compaq 615 4 | 3000 5 | false 6 | 75 7 | Ltownwriter 8 | 9 | 10 | 214 11 | 215 12 | 14 13 | 99 14 | true 15 | 255 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Configs/HP Compaq 625.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Compaq 625 4 | 3000 5 | false 6 | 75 7 | Ltownwriter 8 | 9 | 10 | 214 11 | 215 12 | 14 13 | 99 14 | true 15 | 255 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Configs/HP Compaq 6530b.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | HP Compaq 6530b 4 | Wojciech Berdowski 5 | 3000 6 | false 7 | 75 8 | 9 | 10 | 214 11 | 215 12 | 0 13 | 100 14 | false 15 | 0 16 | 0 17 | true 18 | 255 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Configs/HP Compaq 8710p.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | HP Compaq 8710p (GC102EA#ABD) 4 | 3000 5 | false 6 | 75 7 | 8 | 9 | 215 10 | 215 11 | 0 12 | 100 13 | true 14 | 30 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Configs/HP Pavilion 14-v066br.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | HP Pavilion 14-v066br 4 | 5 | 290 6 | false 7 | 89 8 | 9 | 10 | 0 11 | 183 12 | 50 13 | 100 14 | false 15 | 0 16 | 0 17 | false 18 | 0 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Configs/HP ProBook 4710s.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | HP ProBook 4710s 4 | 3000 5 | false 6 | 75 7 | Marcin 8 | 9 | 10 | 214 11 | 215 12 | 1 13 | 100 14 | true 15 | 255 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Configs/HP Spectre x360 Convertible 13-ae0xx.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | HP Spectre x360 Convertible 13-ae0xx 4 | Marius A 5 | 3000 6 | false 7 | 75 8 | 9 | 10 | 244 11 | 244 12 | 2 13 | 0 14 | false 15 | 0 16 | 0 17 | true 18 | 0 19 | CPU fan 20 | 21 | 22 | 60 23 | 60 24 | 100 25 | 26 | 27 | 59 28 | 0 29 | 0 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Lenovo Yoga 2 13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20344 4 | AndreyL 5 | 3000 6 | false 7 | 75 8 | 9 | 10 | 171 11 | 171 12 | 0 13 | 8 14 | true 15 | 8 16 | 17 | 18 | 57 19 | 50 20 | 100 21 | 22 | 23 | 0 24 | 0 25 | 0 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Configs/Lenovo Yoga 3 14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 80JH 4 | 5 | 1000 6 | false 7 | 75 8 | 9 | 10 | 6 11 | 86 12 | 0 13 | 80 14 | true 15 | 0 16 | Fan1 17 | 18 | 19 | 20 | 100 21 | 50 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Configs/Medion Akoya P6612.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | P6612 4 | 3000 5 | false 6 | 75 7 | messmega 8 | 9 | 10 | 149 11 | 148 12 | 250 13 | 98 14 | true 15 | 255 16 | 17 | 18 | 19 | 20 | 21 | 22 | Set 23 | OnInitialization 24 | 147 25 | 20 26 | true 27 | 4 28 | Set EC to manual control 29 | 30 | 31 | -------------------------------------------------------------------------------- /Configs/Medion Akoya P6630.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | P6630 4 | 3000 5 | false 6 | 75 7 | messmega 8 | 9 | 10 | 149 11 | 148 12 | 250 13 | 98 14 | true 15 | 255 16 | 17 | 18 | 19 | 20 | 21 | 22 | Set 23 | OnInitialization 24 | 147 25 | 20 26 | true 27 | 4 28 | Set EC to manual control 29 | 30 | 31 | -------------------------------------------------------------------------------- /Configs/Packard Bell AOA110.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AOA110 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 33 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Packard Bell AOA150.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AOA150 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 32 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Packard Bell DOA150.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | DOA150 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 32 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Packard Bell DOTMA.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | DOTMA 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 158 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Packard Bell DOTMU.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | DOTMU 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 158 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Packard Bell DOTVR46.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | DOTVR46 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 158 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Packard Bell ENBFT.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ENBFT 4 | 3000 5 | false 6 | 70 7 | 8 | 9 | 85 10 | 85 11 | 1 12 | 0 13 | true 14 | 0 15 | 16 | 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 56 23 | 46 24 | 100 25 | 26 | 27 | 28 | 29 | 0 30 | 158 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Configs/Packard Bell Easynote TJ65.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Easynote TJ65 4 | 3000 5 | false 6 | 75 7 | 8 | 9 | 149 10 | 148 11 | 255 12 | 102 13 | false 14 | 0 15 | 0 16 | true 17 | 196 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Set 26 | OnInitialization 27 | 147 28 | 20 29 | true 30 | 4 31 | Set 32 | Set EC to manual control 33 | 34 | 35 | -------------------------------------------------------------------------------- /Configs/Sony Vaio SVE1711.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | SVE1711C5E 4 | 3000 5 | false 6 | 75 7 | Dozz 8 | 9 | 10 | 149 11 | 148 12 | 255 13 | 102 14 | true 15 | 196 16 | 17 | 18 | 19 | 20 | 21 | 22 | Set 23 | OnInitialization 24 | 147 25 | 20 26 | true 27 | 4 28 | Set EC to manual control 29 | 30 | 31 | -------------------------------------------------------------------------------- /Core/NbfcCli/App.Linux.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Core/NbfcCli/App.Windows.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Core/NbfcCli/App.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Core/NbfcCli/CommandLineOptions/ConfigVerb.cs: -------------------------------------------------------------------------------- 1 | using clipr; 2 | 3 | namespace NbfcCli.CommandLineOptions 4 | { 5 | public class ConfigVerb 6 | { 7 | [MutuallyExclusiveGroup("option")] 8 | [NamedArgument( 9 | 'l', 10 | "list", 11 | Action = ParseAction.StoreTrue, 12 | Description = "List all available configs (default)")] 13 | public bool List { get; set; } 14 | 15 | [MutuallyExclusiveGroup("option")] 16 | [NamedArgument( 17 | 's', 18 | "set", 19 | MetaVar = "cfg-name", 20 | Action = ParseAction.Store, 21 | Description = "Set a config")] 22 | public string Set { get; set; } 23 | 24 | [MutuallyExclusiveGroup("option")] 25 | [NamedArgument( 26 | 'a', 27 | "apply", 28 | MetaVar = "cfg-name", 29 | Action = ParseAction.Store, 30 | Description = "Set a config and enable fan control")] 31 | public string Apply { get; set; } 32 | 33 | [MutuallyExclusiveGroup("option")] 34 | [NamedArgument( 35 | 'r', 36 | "recommend", 37 | Action = ParseAction.StoreTrue, 38 | Description = "List configs which may work for your device")] 39 | public bool Recommend { get; set; } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Core/NbfcCli/CommandLineOptions/SetVerb.cs: -------------------------------------------------------------------------------- 1 | using clipr; 2 | using System.Collections.Generic; 3 | 4 | namespace NbfcCli.CommandLineOptions 5 | { 6 | public class SetVerb 7 | { 8 | [MutuallyExclusiveGroup("speed")] 9 | [NamedArgument( 10 | 'a', 11 | "auto", 12 | Action = ParseAction.StoreTrue, 13 | Description = "Set fan speed to 'auto'")] 14 | public bool Auto { get; set; } 15 | 16 | [MutuallyExclusiveGroup("speed")] 17 | [NamedArgument( 18 | 's', 19 | "speed", 20 | MetaVar = "value", 21 | Action = ParseAction.Store, 22 | Description = "Set fan speed to ")] 23 | public string Speed { get; set; } 24 | 25 | [NamedArgument( 26 | 'f', 27 | "fan", 28 | MetaVar = "index", 29 | Action = ParseAction.Append, 30 | Description = "Fan index (zero based)")] 31 | public List Fan { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Core/NbfcCli/CommandLineOptions/StartVerb.cs: -------------------------------------------------------------------------------- 1 | using clipr; 2 | 3 | namespace NbfcCli.CommandLineOptions 4 | { 5 | public class StartVerb 6 | { 7 | [MutuallyExclusiveGroup("option")] 8 | [NamedArgument( 9 | 'e', 10 | "enabled", 11 | Action = ParseAction.StoreTrue, 12 | Description = "Start in enabled mode (default)")] 13 | public bool Enabled { get; set; } 14 | 15 | [MutuallyExclusiveGroup("option")] 16 | [NamedArgument( 17 | 'r', 18 | "readonly", 19 | Action = ParseAction.StoreTrue, 20 | Description = "Start in read-only mode")] 21 | public bool ReadOnly { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Core/NbfcCli/CommandLineOptions/StatusVerb.cs: -------------------------------------------------------------------------------- 1 | using clipr; 2 | using System.Collections.Generic; 3 | 4 | namespace NbfcCli.CommandLineOptions 5 | { 6 | public class StatusVerb 7 | { 8 | [MutuallyExclusiveGroup("fan")] 9 | [MutuallyExclusiveGroup("service")] 10 | [NamedArgument( 11 | 'a', 12 | "all", 13 | Action = ParseAction.StoreTrue, 14 | Description = "Show service and fan status (default)")] 15 | public bool All { get; set; } 16 | 17 | [MutuallyExclusiveGroup("service")] 18 | [NamedArgument( 19 | 's', 20 | "service", 21 | Action = ParseAction.StoreTrue, 22 | Description = "Show service status")] 23 | public bool Service { get; set; } 24 | 25 | [MutuallyExclusiveGroup("fan")] 26 | [NamedArgument( 27 | 'f', 28 | "fan", 29 | MetaVar = "index", 30 | Action = ParseAction.Append, 31 | NumArgs = 0, 32 | Constraint = NumArgsConstraint.AtLeast, 33 | Description = "Show fan status")] 34 | public List Fan { get; set; } 35 | } 36 | } -------------------------------------------------------------------------------- /Core/NbfcCli/CommandLineOptions/StopVerb.cs: -------------------------------------------------------------------------------- 1 | using clipr; 2 | 3 | namespace NbfcCli.CommandLineOptions 4 | { 5 | public class StopVerb 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /Core/NbfcCli/CommandLineOptions/Verbs.cs: -------------------------------------------------------------------------------- 1 | using clipr; 2 | 3 | namespace NbfcCli.CommandLineOptions 4 | { 5 | [ApplicationInfo(Name = "nbfc.exe", Description = "NoteBook FanControl CLI client")] 6 | public class Verbs 7 | { 8 | [Verb("start", "Start the service")] 9 | public StartVerb Start { get; set; } 10 | 11 | [Verb("stop", "Stop the service")] 12 | public StopVerb Stop { get; set; } 13 | 14 | [Verb("status", "Show the service status")] 15 | public StatusVerb Status { get; set; } 16 | 17 | [Verb("config", "List or apply configs")] 18 | public ConfigVerb Config { get; set; } 19 | 20 | [Verb("set", "Control fans")] 21 | public SetVerb Set { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Core/NbfcCli/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("NbfcCli")] 8 | [assembly: AssemblyDescription("CLI client for the NoteBook FanControl service.")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("NbfcCli")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Setting ComVisible to false makes the types in this assembly not visible 14 | // to COM components. If you need to access a type in this assembly from 15 | // COM, set the ComVisible attribute to true on that type. 16 | [assembly: ComVisible(false)] 17 | 18 | // The following GUID is for the ID of the typelib if this project is exposed to COM 19 | [assembly: Guid("e594b8e6-c58b-4669-b51e-2e96b32e24f7")] 20 | -------------------------------------------------------------------------------- /Core/NbfcCli/Service References/NbfcService/Arrays.xsd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Core/NbfcCli/Service References/NbfcService/NbfcCli.NbfcService.FanControlInfo.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | NbfcCli.NbfcService.FanControlInfo, Service References.NbfcService.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /Core/NbfcCli/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Core/NbfcProbe/App.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Core/NbfcProbe/CommandLineOptions/ECDumpVerb.cs: -------------------------------------------------------------------------------- 1 | namespace NbfcProbe.CommandLineOptions 2 | { 3 | public class ECDumpVerb 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Core/NbfcProbe/CommandLineOptions/ECReadVerb.cs: -------------------------------------------------------------------------------- 1 | using clipr; 2 | 3 | namespace NbfcProbe.CommandLineOptions 4 | { 5 | public class ECReadVerb 6 | { 7 | [PositionalArgument( 8 | 0, 9 | Action = ParseAction.Store, 10 | Constraint = NumArgsConstraint.Exactly, 11 | NumArgs = 1, 12 | MetaVar = "register")] 13 | public byte Register { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Core/NbfcProbe/CommandLineOptions/ECWriteVerb.cs: -------------------------------------------------------------------------------- 1 | using clipr; 2 | 3 | namespace NbfcProbe.CommandLineOptions 4 | { 5 | public class ECWriteVerb 6 | { 7 | [PositionalArgument( 8 | 0, 9 | Action = ParseAction.Store, 10 | Constraint = NumArgsConstraint.Exactly, 11 | NumArgs = 1, 12 | MetaVar = "register")] 13 | public byte Register { get; set; } 14 | 15 | [PositionalArgument( 16 | 1, 17 | Action = ParseAction.Store, 18 | Constraint = NumArgsConstraint.Exactly, 19 | NumArgs = 1, 20 | MetaVar = "value")] 21 | public byte Value { get; set; } 22 | 23 | [NamedArgument( 24 | 'v', 25 | "verbose", 26 | Action = ParseAction.StoreTrue, 27 | Description = "Be verbose")] 28 | public bool Verbose { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Core/NbfcProbe/CommandLineOptions/Verbs.cs: -------------------------------------------------------------------------------- 1 | using clipr; 2 | 3 | namespace NbfcProbe.CommandLineOptions 4 | { 5 | [ApplicationInfo(Name = "ec-probe.exe", Description = "NoteBook FanControl EC probing tool")] 6 | public class Verbs 7 | { 8 | [Verb("dump", "Dump all EC registers")] 9 | public ECDumpVerb ECDump { get; set; } 10 | 11 | [Verb("read", "Read a byte from a EC register")] 12 | public ECReadVerb ECRead { get; set; } 13 | 14 | [Verb("write", "Write a byte to a EC register")] 15 | public ECWriteVerb ECWrite { get; set; } 16 | 17 | [Verb("monitor", "Monitor all EC registers for changes")] 18 | public ECMonitorVerb ECMonitor { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Core/NbfcProbe/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | [assembly: AssemblyTitle("NbfcProbe")] 7 | [assembly: AssemblyDescription("Command line EC-RAM probing tool.")] 8 | [assembly: AssemblyConfiguration("")] 9 | [assembly: AssemblyProduct("NbfcProbe")] 10 | [assembly: AssemblyCulture("")] 11 | 12 | // Setting ComVisible to false makes the types in this assembly not visible 13 | // to COM components. If you need to access a type in this assembly from 14 | // COM, set the ComVisible attribute to true on that type. 15 | [assembly: ComVisible(false)] 16 | 17 | // The following GUID is for the ID of the typelib if this project is exposed to COM 18 | [assembly: Guid("c7e7cd6a-71f9-4489-8a59-55756d6d6de4")] 19 | -------------------------------------------------------------------------------- /Core/NbfcProbe/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Core/NbfcProbe/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Core/NbfcService/App.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Core/NbfcService/NbfcService.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace NbfcService 2 | { 3 | partial class NoteBookFanControlService 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | // 32 | // NoteBookFanControlService 33 | // 34 | this.CanHandlePowerEvent = true; 35 | this.CanPauseAndContinue = true; 36 | this.CanShutdown = true; 37 | this.ServiceName = "NoteBookFanControlService"; 38 | 39 | } 40 | 41 | #endregion 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Core/NbfcService/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.ServiceProcess; 5 | using System.Text; 6 | 7 | namespace NbfcService 8 | { 9 | public static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | public static void Main() 15 | { 16 | ServiceBase.Run(new NoteBookFanControlService()); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Core/NbfcService/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("NoteBook FanControl Service")] 8 | [assembly: AssemblyDescription("Config based fan control service for notebooks.")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("NoteBook FanControl Service")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Setting ComVisible to false makes the types in this assembly not visible 14 | // to COM components. If you need to access a type in this assembly from 15 | // COM, set the ComVisible attribute to true on that type. 16 | [assembly: ComVisible(false)] 17 | 18 | // The following GUID is for the ID of the typelib if this project is exposed to COM 19 | [assembly: Guid("00f4eb12-95eb-45fa-8488-455c388f3b49")] 20 | -------------------------------------------------------------------------------- /Core/NbfcService/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Collections/IReadOnlyArray.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2010 Michael Möller 8 | 9 | */ 10 | 11 | using System; 12 | using System.Collections.Generic; 13 | 14 | namespace OpenHardwareMonitor.Collections { 15 | 16 | public interface IReadOnlyArray : IEnumerable { 17 | 18 | T this[int index] { get; } 19 | 20 | int Length { get; } 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Collections/ListSet.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2013 Michael Möller 8 | 9 | */ 10 | 11 | using System.Collections; 12 | using System.Collections.Generic; 13 | 14 | namespace OpenHardwareMonitor.Collections { 15 | 16 | public class ListSet : IEnumerable { 17 | 18 | private readonly List list = new List(); 19 | 20 | public bool Add(T item) { 21 | if (list.Contains(item)) 22 | return false; 23 | 24 | list.Add(item); 25 | return true; 26 | } 27 | 28 | public bool Remove(T item) { 29 | if (!list.Contains(item)) 30 | return false; 31 | 32 | list.Remove(item); 33 | return true; 34 | } 35 | 36 | public bool Contains(T item) { 37 | return list.Contains(item); 38 | } 39 | 40 | public T[] ToArray() { 41 | return list.ToArray(); 42 | } 43 | 44 | public IEnumerator GetEnumerator() { 45 | return list.GetEnumerator(); 46 | } 47 | 48 | IEnumerator IEnumerable.GetEnumerator() { 49 | return list.GetEnumerator(); 50 | } 51 | 52 | public int Count { 53 | get { 54 | return list.Count; 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Collections/Pair.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2011 Michael Möller 8 | 9 | */ 10 | 11 | using System; 12 | using System.Collections.Generic; 13 | 14 | namespace OpenHardwareMonitor.Collections { 15 | 16 | public struct Pair { 17 | private F first; 18 | private S second; 19 | 20 | public Pair(F first, S second) { 21 | this.first = first; 22 | this.second = second; 23 | } 24 | 25 | public F First { 26 | get { return first; } 27 | set { first = value; } 28 | } 29 | 30 | public S Second { 31 | get { return second; } 32 | set { second = value; } 33 | } 34 | 35 | public override int GetHashCode() { 36 | return (first != null ? first.GetHashCode() : 0) ^ 37 | (second != null ? second.GetHashCode() : 0); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Collections/ReadOnlyArray.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2010 Michael Möller 8 | 9 | */ 10 | 11 | using System.Collections; 12 | using System.Collections.Generic; 13 | 14 | namespace OpenHardwareMonitor.Collections { 15 | 16 | public class ReadOnlyArray : IReadOnlyArray { 17 | 18 | private readonly T[] array; 19 | 20 | public ReadOnlyArray(T[] array) { 21 | this.array = array; 22 | } 23 | 24 | public T this[int index] { 25 | get { return array[index]; } 26 | } 27 | 28 | public int Length { get { return array.Length; } } 29 | 30 | public IEnumerator GetEnumerator() { 31 | return ((IEnumerable)array).GetEnumerator(); 32 | } 33 | 34 | IEnumerator IEnumerable.GetEnumerator() { 35 | return array.GetEnumerator(); 36 | } 37 | 38 | public static implicit operator ReadOnlyArray(T[] array) { 39 | return new ReadOnlyArray(array); 40 | } 41 | 42 | public T[] ToArray() { 43 | return (T[])array.Clone(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/ATI/ATIGroup.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirschmann/nbfc/fc9fb970155607d9ebc994f9e99c8ee09121e628/Core/Plugins/OpenHardwareMonitor/Hardware/ATI/ATIGroup.cs -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/CPU/AMDCPU.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2010 Michael Möller 8 | 9 | */ 10 | 11 | namespace OpenHardwareMonitor.Hardware.CPU { 12 | 13 | internal abstract class AMDCPU : GenericCPU { 14 | 15 | private const byte PCI_BUS = 0; 16 | private const byte PCI_BASE_DEVICE = 0x18; 17 | private const byte DEVICE_VENDOR_ID_REGISTER = 0; 18 | private const ushort AMD_VENDOR_ID = 0x1022; 19 | 20 | public AMDCPU(int processorIndex, CPUID[][] cpuid, ISettings settings) 21 | : base(processorIndex, cpuid, settings) { } 22 | 23 | protected uint GetPciAddress(byte function, ushort deviceId) { 24 | 25 | // assemble the pci address 26 | uint address = Ring0.GetPciAddress(PCI_BUS, 27 | (byte)(PCI_BASE_DEVICE + processorIndex), function); 28 | 29 | // verify that we have the correct bus, device and function 30 | uint deviceVendor; 31 | if (!Ring0.ReadPciConfig( 32 | address, DEVICE_VENDOR_ID_REGISTER, out deviceVendor)) 33 | return Ring0.InvalidPciAddress; 34 | 35 | if (deviceVendor != (deviceId << 16 | AMD_VENDOR_ID)) 36 | return Ring0.InvalidPciAddress; 37 | 38 | return address; 39 | } 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/HDD/DriveAttributeValue.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2011-2012 Michael Möller 8 | 9 | */ 10 | 11 | using System; 12 | using System.Collections.Generic; 13 | using System.Runtime.InteropServices; 14 | 15 | namespace OpenHardwareMonitor.Hardware.HDD { 16 | 17 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 18 | internal struct DriveAttributeValue { 19 | public byte Identifier; 20 | public short StatusFlags; 21 | public byte AttrValue; 22 | public byte WorstValue; 23 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] 24 | public byte[] RawValue; 25 | public byte Reserved; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/HDD/DriveThresholdValue.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2011-2012 Michael Möller 8 | 9 | */ 10 | 11 | using System; 12 | using System.Collections.Generic; 13 | using System.Runtime.InteropServices; 14 | namespace OpenHardwareMonitor.Hardware.HDD { 15 | 16 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 17 | internal struct DriveThresholdValue { 18 | public byte Identifier; 19 | public byte Threshold; 20 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] 21 | public byte[] Unknown; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/HDD/ISmart.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2011-2012 Michael Möller 8 | 9 | */ 10 | 11 | using System; 12 | using System.Collections.Generic; 13 | 14 | 15 | namespace OpenHardwareMonitor.Hardware.HDD { 16 | 17 | internal interface ISmart { 18 | 19 | IntPtr OpenDrive(int driveNumber); 20 | 21 | bool EnableSmart(IntPtr handle, int driveNumber); 22 | 23 | DriveAttributeValue[] ReadSmartData(IntPtr handle, int driveNumber); 24 | 25 | DriveThresholdValue[] ReadSmartThresholds(IntPtr handle, int driveNumber); 26 | 27 | bool ReadNameAndFirmwareRevision(IntPtr handle, int driveNumber, 28 | out string name, out string firmwareRevision); 29 | 30 | void CloseHandle(IntPtr handle); 31 | 32 | IntPtr InvalidHandle { get; } 33 | 34 | string[] GetLogicalDrives(int driveIndex); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/HDD/NamePrefixAttribute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2011 Michael Möller 8 | 9 | */ 10 | 11 | using System; 12 | using System.Collections.Generic; 13 | 14 | namespace OpenHardwareMonitor.Hardware.HDD { 15 | 16 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] 17 | internal class NamePrefixAttribute : Attribute { 18 | 19 | public NamePrefixAttribute(string namePrefix) { 20 | Prefix = namePrefix; 21 | } 22 | 23 | public string Prefix { get; private set; } 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/HDD/RequireSmartAttribute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2011 Michael Möller 8 | 9 | */ 10 | 11 | using System; 12 | using System.Collections.Generic; 13 | 14 | namespace OpenHardwareMonitor.Hardware.HDD { 15 | 16 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] 17 | internal class RequireSmartAttribute : Attribute { 18 | 19 | public RequireSmartAttribute(byte attributeId) { 20 | AttributeId = attributeId; 21 | } 22 | 23 | public byte AttributeId { get; private set; } 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/HDD/SSDPlextor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2011-2012 Michael Möller 8 | 9 | */ 10 | 11 | namespace OpenHardwareMonitor.Hardware.HDD { 12 | using System.Collections.Generic; 13 | using OpenHardwareMonitor.Collections; 14 | 15 | [NamePrefix("PLEXTOR")] 16 | internal class SSDPlextor : AbstractHarddrive { 17 | 18 | private static readonly IEnumerable smartAttributes = 19 | new List { 20 | new SmartAttribute(0x09, SmartNames.PowerOnHours, RawToInt), 21 | new SmartAttribute(0x0C, SmartNames.PowerCycleCount, RawToInt), 22 | new SmartAttribute(0xF1, SmartNames.HostWrites, RawToGb, SensorType.Data, 23 | 0, SmartNames.HostWrites), 24 | new SmartAttribute(0xF2, SmartNames.HostReads, RawToGb, SensorType.Data, 25 | 1, SmartNames.HostReads), 26 | }; 27 | 28 | public SSDPlextor(ISmart smart, string name, string firmwareRevision, 29 | int index, ISettings settings) 30 | : base(smart, name, firmwareRevision, index, smartAttributes, settings) {} 31 | 32 | private static float RawToGb(byte[] rawvalue, byte value, 33 | IReadOnlyArray parameters) 34 | { 35 | return RawToInt(rawvalue, value, parameters) / 32; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/HexStringArray.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2011 Michael Möller 8 | 9 | */ 10 | 11 | using System; 12 | using System.Collections.Generic; 13 | 14 | namespace OpenHardwareMonitor.Hardware { 15 | internal static class HexStringArray { 16 | 17 | public static byte Read(string s, ushort address) { 18 | string[] lines = s.Split(new[] { '\r', '\n' }, 19 | StringSplitOptions.RemoveEmptyEntries); 20 | 21 | foreach (string line in lines) { 22 | string[] array = line.Split(new[] { ' ', '\t' }, 23 | StringSplitOptions.RemoveEmptyEntries); 24 | if (array.Length == 0) 25 | continue; 26 | if (Convert.ToInt32(array[0], 16) == (address & 0xFFF0)) 27 | return Convert.ToByte(array[(address & 0x0F) + 1], 16); 28 | } 29 | 30 | throw new ArgumentException(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/IComputer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2010 Michael Möller 8 | 9 | */ 10 | 11 | namespace OpenHardwareMonitor.Hardware { 12 | 13 | public delegate void HardwareEventHandler(IHardware hardware); 14 | 15 | public interface IComputer : IElement { 16 | 17 | IHardware[] Hardware { get; } 18 | 19 | bool MainboardEnabled { get; } 20 | bool CPUEnabled { get; } 21 | bool RAMEnabled { get; } 22 | bool GPUEnabled { get; } 23 | bool FanControllerEnabled { get; } 24 | bool HDDEnabled { get; } 25 | 26 | 27 | string GetReport(); 28 | 29 | event HardwareEventHandler HardwareAdded; 30 | event HardwareEventHandler HardwareRemoved; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/IControl.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2010-2014 Michael Möller 8 | 9 | */ 10 | 11 | namespace OpenHardwareMonitor.Hardware { 12 | 13 | public enum ControlMode { 14 | Undefined, 15 | Software, 16 | Default 17 | } 18 | 19 | public interface IControl { 20 | 21 | Identifier Identifier { get; } 22 | 23 | ControlMode ControlMode { get; } 24 | 25 | float SoftwareValue { get; } 26 | 27 | void SetDefault(); 28 | 29 | float MinSoftwareValue { get; } 30 | float MaxSoftwareValue { get; } 31 | 32 | void SetSoftware(float value); 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/IElement.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2010 Michael Möller 8 | 9 | */ 10 | 11 | namespace OpenHardwareMonitor.Hardware { 12 | 13 | public interface IElement { 14 | // accept visitor on this element 15 | void Accept(IVisitor visitor); 16 | 17 | // call accept(visitor) on all child elements (called only from visitors) 18 | void Traverse(IVisitor visitor); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/IGroup.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2010 Michael Möller 8 | 9 | */ 10 | 11 | namespace OpenHardwareMonitor.Hardware { 12 | 13 | internal interface IGroup { 14 | 15 | IHardware[] Hardware { get; } 16 | 17 | string GetReport(); 18 | 19 | void Close(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/IHardware.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2011 Michael Möller 8 | 9 | */ 10 | 11 | namespace OpenHardwareMonitor.Hardware { 12 | 13 | public delegate void SensorEventHandler(ISensor sensor); 14 | 15 | public enum HardwareType { 16 | Mainboard, 17 | SuperIO, 18 | CPU, 19 | RAM, 20 | GpuNvidia, 21 | GpuAti, 22 | TBalancer, 23 | Heatmaster, 24 | HDD 25 | } 26 | 27 | public interface IHardware : IElement { 28 | 29 | string Name { get; set; } 30 | Identifier Identifier { get; } 31 | 32 | HardwareType HardwareType { get; } 33 | 34 | string GetReport(); 35 | 36 | void Update(); 37 | 38 | IHardware[] SubHardware { get; } 39 | 40 | IHardware Parent { get; } 41 | 42 | ISensor[] Sensors { get; } 43 | 44 | event SensorEventHandler SensorAdded; 45 | event SensorEventHandler SensorRemoved; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/IOControlCode.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2010 Michael Möller 8 | 9 | */ 10 | 11 | using System; 12 | using System.Runtime.InteropServices; 13 | 14 | namespace OpenHardwareMonitor.Hardware { 15 | 16 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 17 | internal struct IOControlCode { 18 | private uint code; 19 | 20 | public IOControlCode(uint deviceType, uint function, Access access) : 21 | this(deviceType, function, Method.Buffered, access) { } 22 | 23 | public IOControlCode(uint deviceType, uint function, Method method, 24 | Access access) 25 | { 26 | code = (deviceType << 16) | 27 | ((uint)access << 14) | (function << 2) | (uint)method; 28 | } 29 | 30 | public enum Method : uint { 31 | Buffered = 0, 32 | InDirect = 1, 33 | OutDirect = 2, 34 | Neither = 3 35 | } 36 | 37 | public enum Access : uint { 38 | Any = 0, 39 | Read = 1, 40 | Write = 2 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/IParameter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2010 Michael Möller 8 | 9 | */ 10 | 11 | namespace OpenHardwareMonitor.Hardware { 12 | 13 | public interface IParameter : IElement { 14 | 15 | ISensor Sensor { get; } 16 | Identifier Identifier { get; } 17 | 18 | string Name { get; } 19 | string Description { get; } 20 | float Value { get; set; } 21 | float DefaultValue { get; } 22 | bool IsDefault { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/ISettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2010 Michael Möller 8 | 9 | */ 10 | 11 | namespace OpenHardwareMonitor.Hardware { 12 | public interface ISettings { 13 | 14 | bool Contains(string name); 15 | 16 | void SetValue(string name, string value); 17 | 18 | string GetValue(string name, string value); 19 | 20 | void Remove(string name); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/IVisitor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2010 Michael Möller 8 | 9 | */ 10 | 11 | namespace OpenHardwareMonitor.Hardware { 12 | 13 | public interface IVisitor { 14 | void VisitComputer(IComputer computer); 15 | void VisitHardware(IHardware hardware); 16 | void VisitSensor(ISensor sensor); 17 | void VisitParameter(IParameter parameter); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/LPC/ISuperIO.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2011 Michael Möller 8 | 9 | */ 10 | 11 | namespace OpenHardwareMonitor.Hardware.LPC { 12 | internal interface ISuperIO { 13 | 14 | Chip Chip { get; } 15 | 16 | // get voltage, temperature, fan and control channel values 17 | float?[] Voltages { get; } 18 | float?[] Temperatures { get; } 19 | float?[] Fans { get; } 20 | float?[] Controls { get; } 21 | 22 | // set control value, null = auto 23 | void SetControl(int index, byte? value); 24 | 25 | // read and write GPIO 26 | byte? ReadGPIO(int index); 27 | void WriteGPIO(int index, byte value); 28 | 29 | string GetReport(); 30 | 31 | void Update(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/Mainboard/MainboardGroup.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2010 Michael Möller 8 | 9 | */ 10 | 11 | namespace OpenHardwareMonitor.Hardware.Mainboard { 12 | internal class MainboardGroup : IGroup { 13 | 14 | private readonly Mainboard[] mainboards; 15 | 16 | public MainboardGroup(SMBIOS smbios, ISettings settings) { 17 | mainboards = new Mainboard[1]; 18 | mainboards[0] = new Mainboard(smbios, settings); 19 | } 20 | 21 | public void Close() { 22 | foreach (Mainboard mainboard in mainboards) 23 | mainboard.Close(); 24 | } 25 | 26 | public string GetReport() { 27 | return null; 28 | } 29 | 30 | public IHardware[] Hardware { 31 | get { return mainboards; } 32 | 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/Mainboard/Manufacturer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2010 Michael Möller 8 | 9 | */ 10 | 11 | namespace OpenHardwareMonitor.Hardware.Mainboard { 12 | 13 | internal enum Manufacturer { 14 | Alienware, 15 | Apple, 16 | ASRock, 17 | ASUS, 18 | Dell, 19 | DFI, 20 | ECS, 21 | EPoX, 22 | EVGA, 23 | FIC, 24 | Fujitsu, 25 | Gigabyte, 26 | HP, 27 | IBM, 28 | Intel, 29 | Lenovo, 30 | MSI, 31 | Shuttle, 32 | Supermicro, 33 | Toshiba, 34 | XFX, 35 | Unknown 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/OperatingSystem.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2012 Michael Möller 8 | 9 | */ 10 | 11 | using System; 12 | using System.Diagnostics; 13 | using System.Runtime.InteropServices; 14 | 15 | namespace OpenHardwareMonitor.Hardware { 16 | internal static class OperatingSystem { 17 | 18 | public static bool Is64BitOperatingSystem() { 19 | if (IntPtr.Size == 8) 20 | return true; 21 | 22 | try { 23 | bool wow64Process; 24 | bool result = IsWow64Process( 25 | Process.GetCurrentProcess().Handle, out wow64Process); 26 | 27 | return result && wow64Process; 28 | } catch (EntryPointNotFoundException) { 29 | return false; 30 | } 31 | } 32 | 33 | [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] 34 | [return: MarshalAs(UnmanagedType.Bool)] 35 | private static extern bool IsWow64Process(IntPtr hProcess, 36 | out bool wow64Process); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/PInvokeDelegateFactory.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirschmann/nbfc/fc9fb970155607d9ebc994f9e99c8ee09121e628/Core/Plugins/OpenHardwareMonitor/Hardware/PInvokeDelegateFactory.cs -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/RAM/RAMGroup.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2012-2013 Michael Möller 8 | 9 | */ 10 | 11 | using System; 12 | 13 | namespace OpenHardwareMonitor.Hardware.RAM { 14 | internal class RAMGroup : IGroup { 15 | 16 | private Hardware[] hardware; 17 | 18 | public RAMGroup(SMBIOS smbios, ISettings settings) { 19 | 20 | // No implementation for RAM on Unix systems 21 | int p = (int)Environment.OSVersion.Platform; 22 | if ((p == 4) || (p == 128)) { 23 | hardware = new Hardware[0]; 24 | return; 25 | } 26 | 27 | hardware = new Hardware[] { new GenericRAM("Generic Memory", settings) }; 28 | } 29 | 30 | public string GetReport() { 31 | return null; 32 | } 33 | 34 | public IHardware[] Hardware { 35 | get { 36 | return hardware; 37 | } 38 | } 39 | 40 | public void Close() { 41 | foreach (Hardware ram in hardware) 42 | ram.Close(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/SensorVisitor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2010 Michael Möller 8 | 9 | */ 10 | 11 | using System; 12 | using System.Collections.Generic; 13 | 14 | namespace OpenHardwareMonitor.Hardware { 15 | 16 | public class SensorVisitor : IVisitor { 17 | private readonly SensorEventHandler handler; 18 | 19 | public SensorVisitor(SensorEventHandler handler) { 20 | if (handler == null) 21 | throw new ArgumentNullException("handler"); 22 | this.handler = handler; 23 | } 24 | 25 | public void VisitComputer(IComputer computer) { 26 | if (computer == null) 27 | throw new ArgumentNullException("computer"); 28 | computer.Traverse(this); 29 | } 30 | 31 | public void VisitHardware(IHardware hardware) { 32 | if (hardware == null) 33 | throw new ArgumentNullException("hardware"); 34 | hardware.Traverse(this); 35 | } 36 | 37 | public void VisitSensor(ISensor sensor) { 38 | handler(sensor); 39 | } 40 | 41 | public void VisitParameter(IParameter parameter) { } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/TBalancer/TBalancerGroup.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirschmann/nbfc/fc9fb970155607d9ebc994f9e99c8ee09121e628/Core/Plugins/OpenHardwareMonitor/Hardware/TBalancer/TBalancerGroup.cs -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/WinRing0.sys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirschmann/nbfc/fc9fb970155607d9ebc994f9e99c8ee09121e628/Core/Plugins/OpenHardwareMonitor/Hardware/WinRing0.sys -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Hardware/WinRing0x64.sys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirschmann/nbfc/fc9fb970155607d9ebc994f9e99c8ee09121e628/Core/Plugins/OpenHardwareMonitor/Hardware/WinRing0x64.sys -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2017 Michael Möller 8 | 9 | */ 10 | 11 | using System; 12 | using System.Reflection; 13 | using System.Runtime.CompilerServices; 14 | using System.Runtime.InteropServices; 15 | 16 | [assembly: AssemblyTitle("Open Hardware Monitor")] 17 | [assembly: AssemblyDescription("")] 18 | [assembly: AssemblyConfiguration("")] 19 | [assembly: AssemblyCompany("")] 20 | [assembly: AssemblyProduct("Open Hardware Monitor")] 21 | [assembly: AssemblyCopyright("Copyright © 2009-2017 Michael Möller")] 22 | [assembly: AssemblyTrademark("")] 23 | [assembly: AssemblyCulture("")] 24 | 25 | [assembly: ComVisible(false)] 26 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Properties/AssemblyLibInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2017 Michael Möller 8 | 9 | */ 10 | 11 | using System; 12 | using System.Reflection; 13 | using System.Runtime.InteropServices; 14 | 15 | [assembly: AssemblyTitle("Open Hardware Monitor Library")] 16 | [assembly: AssemblyDescription("")] 17 | [assembly: AssemblyConfiguration("")] 18 | [assembly: AssemblyCompany("")] 19 | [assembly: AssemblyProduct("Open Hardware Monitor Library")] 20 | [assembly: AssemblyCopyright("Copyright © 2009-2017 Michael Möller")] 21 | [assembly: AssemblyTrademark("")] 22 | [assembly: AssemblyCulture("")] 23 | 24 | [assembly: ComVisible(false)] 25 | [assembly: CLSCompliant(false)] 26 | 27 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Properties/AssemblyVersion.cs: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public 4 | License, v. 2.0. If a copy of the MPL was not distributed with this 5 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | Copyright (C) 2009-2017 Michael Möller 8 | 9 | */ 10 | 11 | using System.Reflection; 12 | 13 | [assembly: AssemblyVersion("0.8.0.210")] 14 | [assembly: AssemblyInformationalVersion("0.8.0.210 NBFC")] 15 | -------------------------------------------------------------------------------- /Core/Plugins/OpenHardwareMonitor/Software/OperatingSystem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace OpenHardwareMonitor.Software { 6 | public static class OperatingSystem { 7 | static OperatingSystem() { 8 | // The operating system doesn't change during execution so let's query it just one time. 9 | var platform = Environment.OSVersion.Platform; 10 | IsLinux = platform == PlatformID.Unix || platform == PlatformID.MacOSX; 11 | 12 | 13 | if (IntPtr.Size == 8) { 14 | Is64Bit = true; 15 | } else if (!IsLinux) { 16 | try { 17 | var result = IsWow64Process(Process.GetCurrentProcess().Handle, out bool wow64Process); 18 | // If we are still here, this is a 64bit windows; 32bit windows does 19 | // not provide IsWow64Process. 20 | Is64Bit = true; 21 | } 22 | catch (EntryPointNotFoundException) { 23 | // IsWow64Process is not present on 32 bit: 24 | Is64Bit = false; 25 | } 26 | } 27 | } 28 | 29 | public static bool Is64Bit { get; } 30 | 31 | public static bool IsLinux { get; } 32 | 33 | [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] 34 | [return: MarshalAs(UnmanagedType.Bool)] 35 | private static extern bool IsWow64Process(IntPtr hProcess, out bool wow64Process); 36 | } 37 | } -------------------------------------------------------------------------------- /Core/Plugins/StagWare.Hardware.LPC/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("StagWare.Hardware.LPC")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("StagWare.Hardware.LPC")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Setting ComVisible to false makes the types in this assembly not visible 14 | // to COM components. If you need to access a type in this assembly from 15 | // COM, set the ComVisible attribute to true on that type. 16 | [assembly: ComVisible(false)] 17 | 18 | // The following GUID is for the ID of the typelib if this project is exposed to COM 19 | [assembly: Guid("a615a483-0e43-4097-88a1-47f4558d8ca4")] 20 | -------------------------------------------------------------------------------- /Core/Plugins/StagWare.Hardware/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("StagWare.Hardware")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("StagWare.Hardware")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Setting ComVisible to false makes the types in this assembly not visible 14 | // to COM components. If you need to access a type in this assembly from 15 | // COM, set the ComVisible attribute to true on that type. 16 | [assembly: ComVisible(false)] 17 | 18 | // The following GUID is for the ID of the typelib if this project is exposed to COM 19 | [assembly: Guid("e7705930-6a0a-46ac-a75f-6e2ed73965da")] -------------------------------------------------------------------------------- /Core/Plugins/StagWare.Plugins.CpuTemperatureMonitor/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("StagWare.Plugins.CpuTemperatureMonitor")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("StagWare.Plugins.CpuTemperatureMonitor")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Setting ComVisible to false makes the types in this assembly not visible 14 | // to COM components. If you need to access a type in this assembly from 15 | // COM, set the ComVisible attribute to true on that type. 16 | [assembly: ComVisible(false)] 17 | 18 | // The following GUID is for the ID of the typelib if this project is exposed to COM 19 | [assembly: Guid("3712b354-87bd-4921-9697-171d646d3c49")] -------------------------------------------------------------------------------- /Core/Plugins/StagWare.Plugins.ECLinux/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("StagWare.Plugins.ECLinux")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("StagWare.Plugins.ECLinux")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Setting ComVisible to false makes the types in this assembly not visible 14 | // to COM components. If you need to access a type in this assembly from 15 | // COM, set the ComVisible attribute to true on that type. 16 | [assembly: ComVisible(false)] 17 | 18 | // The following GUID is for the ID of the typelib if this project is exposed to COM 19 | [assembly: Guid("63708e38-2071-446e-b33a-5ef9ef93e52b")] -------------------------------------------------------------------------------- /Core/Plugins/StagWare.Plugins.ECSysLinux/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("StagWare.Plugins.ECSysLinux")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("StagWare.Plugins.ECSysLinux")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Setting ComVisible to false makes the types in this assembly not visible 14 | // to COM components. If you need to access a type in this assembly from 15 | // COM, set the ComVisible attribute to true on that type. 16 | [assembly: ComVisible(false)] 17 | 18 | // The following GUID is for the ID of the typelib if this project is exposed to COM 19 | [assembly: Guid("62c829d6-7338-4d44-87fc-00b8d01d8157")] -------------------------------------------------------------------------------- /Core/Plugins/StagWare.Plugins.ECWindows/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("StagWare.Plugins.ECWindows")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("StagWare.Plugins.ECWindows")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Setting ComVisible to false makes the types in this assembly not visible 14 | // to COM components. If you need to access a type in this assembly from 15 | // COM, set the ComVisible attribute to true on that type. 16 | [assembly: ComVisible(false)] 17 | 18 | // The following GUID is for the ID of the typelib if this project is exposed to COM 19 | [assembly: Guid("22834e87-0fce-4972-a43c-f2e2be371cb5")] -------------------------------------------------------------------------------- /Core/Plugins/StagWare.Plugins.FSTemperatureMonitor/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("StagWare.Plugins.FSTemperatureMonitor")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("StagWare.Plugins.FSTemperatureMonitor")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Setting ComVisible to false makes the types in this assembly not visible 14 | // to COM components. If you need to access a type in this assembly from 15 | // COM, set the ComVisible attribute to true on that type. 16 | [assembly: ComVisible(false)] 17 | 18 | // The following GUID is for the ID of the typelib if this project is exposed to COM 19 | [assembly: Guid("41f261e4-7256-480a-ae5e-3ebdf75742ab")] -------------------------------------------------------------------------------- /Core/Plugins/StagWare.Plugins.FSTemperatureMonitor/TemperatureSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace StagWare.Plugins 7 | { 8 | public class TemperatureSource 9 | { 10 | public TemperatureSource() 11 | { 12 | } 13 | 14 | public TemperatureSource(string filePath, double multiplier) 15 | { 16 | this.FilePath = filePath; 17 | this.Multiplier = multiplier; 18 | } 19 | 20 | public string FilePath { get; set; } 21 | public double Multiplier { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Core/StagWare.BiosInfo/BiosInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StagWare.BiosInfo 4 | { 5 | public abstract class BiosInfo 6 | { 7 | public abstract string BIOSReleaseDate { get; } 8 | public abstract string BIOSVendor { get; } 9 | public abstract string BIOSVersion { get; } 10 | public abstract string BoardVendor { get; } 11 | public abstract string BoardName { get; } 12 | public abstract string BoardVersion { get; } 13 | public abstract string SystemName { get; } 14 | public abstract string SystemVendor { get; } 15 | public abstract string SystemVersion { get; } 16 | 17 | public static BiosInfo Create() 18 | { 19 | switch (Environment.OSVersion.Platform) 20 | { 21 | case PlatformID.Win32NT: 22 | return new BiosInfoWindows(); 23 | 24 | case PlatformID.Unix: 25 | return new BiosInfoLinux(); 26 | 27 | default: 28 | return null; 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Core/StagWare.BiosInfo/BiosInfoLinux.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace StagWare.BiosInfo 4 | { 5 | internal class BiosInfoLinux : BiosInfo 6 | { 7 | #region Constants 8 | 9 | const string DmiIdDirectoryPath = "/sys/devices/virtual/dmi/id"; 10 | 11 | #endregion 12 | 13 | #region BiosInfo implementation 14 | 15 | public override string BIOSReleaseDate => GetValue("bios_date"); 16 | public override string BIOSVendor => GetValue("bios_vendor"); 17 | public override string BIOSVersion => GetValue("bios_version"); 18 | public override string BoardName => GetValue("board_name"); 19 | public override string BoardVendor => GetValue("board_vendor"); 20 | public override string BoardVersion => GetValue("board_version"); 21 | public override string SystemName => GetValue("product_name"); 22 | public override string SystemVendor => GetValue("sys_vendor"); 23 | public override string SystemVersion => GetValue("product_version"); 24 | 25 | #endregion 26 | 27 | #region Private Methods 28 | 29 | private string GetValue(string valueName) 30 | { 31 | string path = Path.Combine(DmiIdDirectoryPath, valueName); 32 | 33 | try 34 | { 35 | return File.ReadAllText(path); 36 | } 37 | catch 38 | { 39 | return null; 40 | } 41 | } 42 | 43 | #endregion 44 | } 45 | } -------------------------------------------------------------------------------- /Core/StagWare.BiosInfo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("StagWare.BiosInfo")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("StagWare.BiosInfo")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Version 14 | [assembly: AssemblyVersion("2.0.1.0")] 15 | [assembly: AssemblyFileVersion("2.0.1.0")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("977639b2-c46a-473d-a0bc-5a8aa124adec")] 24 | -------------------------------------------------------------------------------- /Core/StagWare.Configurations/FanSpeedPercentageOverride.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StagWare.FanControl.Configurations 4 | { 5 | [Flags] 6 | public enum OverrideTargetOperation 7 | { 8 | Read = 1, 9 | Write = 2, 10 | ReadWrite = Read | Write 11 | } 12 | 13 | public class FanSpeedPercentageOverride : ICloneable 14 | { 15 | public float FanSpeedPercentage { get; set; } 16 | public int FanSpeedValue { get; set; } 17 | public OverrideTargetOperation TargetOperation { get; set; } 18 | 19 | public FanSpeedPercentageOverride() 20 | { 21 | this.TargetOperation = OverrideTargetOperation.ReadWrite; 22 | } 23 | 24 | #region ICloneable implementation 25 | 26 | public object Clone() 27 | { 28 | return new FanSpeedPercentageOverride() 29 | { 30 | FanSpeedPercentage = this.FanSpeedPercentage, 31 | FanSpeedValue = this.FanSpeedValue, 32 | TargetOperation = this.TargetOperation 33 | }; 34 | } 35 | 36 | #endregion 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Core/StagWare.Configurations/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("StagWare.FanControl.Configurations")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("StagWare.FanControl.Configurations")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Version 14 | [assembly: AssemblyVersion("2.5.1.0")] 15 | [assembly: AssemblyFileVersion("2.5.1.0")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("dff325d3-8910-41e1-89da-458d874fbb39")] -------------------------------------------------------------------------------- /Core/StagWare.Configurations/RegisterWriteRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StagWare.FanControl.Configurations 4 | { 5 | public class RegisterWriteRequest : ICloneable 6 | { 7 | #region Properties 8 | 9 | public RegisterWriteMode WriteMode { get; set; } 10 | public int Register { get; set; } 11 | public int Value { get; set; } 12 | 13 | #endregion 14 | 15 | #region ICloneable implementation 16 | 17 | public object Clone() 18 | { 19 | return new RegisterWriteRequest() 20 | { 21 | Register = this.Register, 22 | Value = this.Value, 23 | WriteMode = this.WriteMode 24 | }; 25 | } 26 | 27 | #endregion 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Core/StagWare.Configurations/Validation/FanControlConfigValidator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace StagWare.FanControl.Configurations.Validation 5 | { 6 | public class FanControlConfigValidator : Validator 7 | { 8 | public FanControlConfigValidator() 9 | { 10 | var rules = typeof(IValidationRule)?.Assembly 11 | .GetTypes() 12 | .Where(x => x.IsClass && typeof(IValidationRule).IsAssignableFrom(x)) 13 | .Select(x => (IValidationRule )Activator.CreateInstance(x)); 14 | 15 | Rules.AddRange(rules); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Core/StagWare.Configurations/Validation/IValidationRule.cs: -------------------------------------------------------------------------------- 1 | namespace StagWare.FanControl.Configurations.Validation 2 | { 3 | public enum ValidationResult 4 | { 5 | Success, 6 | Warning, 7 | Error 8 | } 9 | 10 | public interface IValidationRule 11 | { 12 | string Description { get; } 13 | Validation Validate(T item); 14 | } 15 | } -------------------------------------------------------------------------------- /Core/StagWare.Configurations/Validation/Rules/FanConfigurationsNotEmtpy.cs: -------------------------------------------------------------------------------- 1 | namespace StagWare.FanControl.Configurations.Validation.Rules 2 | { 3 | public class FanConfigurationsNotEmtpy : IValidationRule 4 | { 5 | public string Description => "At least one fan configuration must exist"; 6 | 7 | public Validation Validate(FanControlConfigV2 item) 8 | { 9 | var v = new Validation() 10 | { 11 | RuleDescription = this.Description, 12 | Result = ValidationResult.Success 13 | }; 14 | 15 | if (item.FanConfigurations == null || item.FanConfigurations.Count == 0) 16 | { 17 | v.Result = ValidationResult.Error; 18 | return v; 19 | } 20 | else 21 | { 22 | return v; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Core/StagWare.Configurations/Validation/Rules/UpThresholdMayNotBeLowerThanDownThreshold.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | namespace StagWare.FanControl.Configurations.Validation.Rules 4 | { 5 | public class UpThresholdMayNotBeLowerThanDownThreshold : IValidationRule 6 | { 7 | public string Description => "Each threshold's, up-threshold may not be lower than its corresponding down-threshold"; 8 | 9 | public Validation Validate(FanControlConfigV2 item) 10 | { 11 | var v = new Validation() 12 | { 13 | RuleDescription = this.Description, 14 | Result = ValidationResult.Success 15 | }; 16 | 17 | if (item.FanConfigurations == null) 18 | { 19 | return v; 20 | } 21 | 22 | foreach (var t in item.FanConfigurations.SelectMany(x => x.TemperatureThresholds)) 23 | { 24 | if (t.UpThreshold < t.DownThreshold) 25 | { 26 | v.Result = ValidationResult.Error; 27 | v.Reason = $"At least one up-threshold ({t.UpThreshold}) is less than its corresponding down-threshold ({t.DownThreshold})"; 28 | return v; 29 | } 30 | } 31 | 32 | return v; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/StagWare.Configurations/Validation/Validation.cs: -------------------------------------------------------------------------------- 1 | namespace StagWare.FanControl.Configurations.Validation 2 | { 3 | public class Validation 4 | { 5 | public string RuleDescription { get; set; } 6 | public ValidationResult Result { get; set; } 7 | public string Reason { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Core/StagWare.Configurations/Validation/ValidationSummary.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace StagWare.FanControl.Configurations.Validation 5 | { 6 | public class ValidationSummary 7 | { 8 | public bool Success { get; set; } 9 | public List Passed { get; set; } = new List(); 10 | public List Warnings { get; set; } = new List(); 11 | public List Failed { get; set; } = new List(); 12 | } 13 | } -------------------------------------------------------------------------------- /Core/StagWare.Configurations/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Core/StagWare.FanControl.Service/FanControlInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace StagWare.FanControl.Service 4 | { 5 | [DataContract] 6 | public class FanControlInfo 7 | { 8 | [DataMember] 9 | public bool Enabled { get; set; } 10 | 11 | [DataMember] 12 | public bool ReadOnly { get; set; } 13 | 14 | [DataMember] 15 | public FanStatus[] FanStatus { get; set; } 16 | 17 | [DataMember] 18 | public int Temperature { get; set; } 19 | 20 | [DataMember] 21 | public string TemperatureSourceDisplayName { get; set; } 22 | 23 | [DataMember] 24 | public string SelectedConfig { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Core/StagWare.FanControl.Service/FanStatus.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace StagWare.FanControl.Service 4 | { 5 | [DataContract] 6 | public class FanStatus 7 | { 8 | [DataMember] 9 | public string FanDisplayName { get; set; } 10 | 11 | [DataMember] 12 | public bool AutoControlEnabled { get; set; } 13 | 14 | [DataMember] 15 | public bool CriticalModeEnabled { get; set; } 16 | 17 | [DataMember] 18 | public float CurrentFanSpeed { get; set; } 19 | 20 | [DataMember] 21 | public float TargetFanSpeed { get; set; } 22 | 23 | [DataMember] 24 | public int FanSpeedSteps { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Core/StagWare.FanControl.Service/IFanControlService.cs: -------------------------------------------------------------------------------- 1 | using System.ServiceModel; 2 | 3 | namespace StagWare.FanControl.Service 4 | { 5 | [ServiceContract] 6 | public interface IFanControlService 7 | { 8 | [OperationContract] 9 | void SetTargetFanSpeed(float value, int fanIndex); 10 | 11 | [OperationContract] 12 | FanControlInfo GetFanControlInfo(); 13 | 14 | [OperationContract] 15 | void Start(bool readOnly); 16 | 17 | [OperationContract] 18 | void Stop(); 19 | 20 | [OperationContract] 21 | void SetConfig(string uniqueConfigId); 22 | 23 | [OperationContract] 24 | string[] GetConfigNames(); 25 | 26 | [OperationContract] 27 | string[] GetRecommendedConfigs(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Core/StagWare.FanControl.Service/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("StagWare.FanControl.Service")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("StagWare.FanControl.Service")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Setting ComVisible to false makes the types in this assembly not visible 14 | // to COM components. If you need to access a type in this assembly from 15 | // COM, set the ComVisible attribute to true on that type. 16 | [assembly: ComVisible(false)] 17 | 18 | // The following GUID is for the ID of the typelib if this project is exposed to COM 19 | [assembly: Guid("a2e92c07-5eb0-4d6d-b57d-312ccec683db")] -------------------------------------------------------------------------------- /Core/StagWare.FanControl.Service/ServiceSettings.cs: -------------------------------------------------------------------------------- 1 | using StagWare.Settings; 2 | 3 | namespace StagWare 4 | { 5 | public class ServiceSettings : SettingsBase 6 | { 7 | public ServiceSettings() 8 | { 9 | SettingsVersion = 0; 10 | } 11 | 12 | public string SelectedConfigId { get; set; } 13 | public bool Autostart { get; set; } 14 | public bool ReadOnly { get; set; } 15 | public float[] TargetFanSpeeds { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Core/StagWare.FanControl.Service/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Core/StagWare.FanControl/FanInformation.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace StagWare.FanControl 3 | { 4 | public class FanInformation 5 | { 6 | public float TargetFanSpeed { get; private set; } 7 | public float CurrentFanSpeed { get; private set; } 8 | public bool AutoFanControlEnabled { get; private set; } 9 | public bool CriticalModeEnabled { get; private set; } 10 | public string FanDisplayName { get; private set; } 11 | 12 | public FanInformation( 13 | float targetFanSpeed, 14 | float currentFanSpeed, 15 | bool autoControlEnabled, 16 | bool criticalModeEnabled, 17 | string fanDisplayName) 18 | { 19 | this.TargetFanSpeed = targetFanSpeed; 20 | this.CurrentFanSpeed = currentFanSpeed; 21 | this.AutoFanControlEnabled = autoControlEnabled; 22 | this.CriticalModeEnabled = criticalModeEnabled; 23 | this.FanDisplayName = fanDisplayName; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Core/StagWare.FanControl/ITemperatureFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace StagWare.FanControl 7 | { 8 | public interface ITemperatureFilter 9 | { 10 | double FilterTemperature(double temperature); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Core/StagWare.FanControl/Plugins/IEmbeddedController.cs: -------------------------------------------------------------------------------- 1 | namespace StagWare.FanControl.Plugins 2 | { 3 | public interface IEmbeddedController : IFanControlPlugin 4 | { 5 | void WriteByte(byte register, byte value); 6 | void WriteWord(byte register, ushort value); 7 | byte ReadByte(byte register); 8 | ushort ReadWord(byte register); 9 | bool AcquireLock(int timeout); 10 | void ReleaseLock(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Core/StagWare.FanControl/Plugins/IFanControlPlugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StagWare.FanControl.Plugins 4 | { 5 | public interface IFanControlPlugin : IDisposable 6 | { 7 | bool IsInitialized { get; } 8 | void Initialize(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Core/StagWare.FanControl/Plugins/IFanControlPluginMetadata.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StagWare.FanControl.Plugins 4 | { 5 | [Flags] 6 | public enum SupportedPlatforms 7 | { 8 | None = 0, 9 | Windows = 1, 10 | Unix = 2, 11 | MacOSX = 4 12 | } 13 | 14 | [Flags] 15 | public enum SupportedCpuArchitectures 16 | { 17 | None = 0, 18 | x86 = 1, 19 | x64 = 2 20 | } 21 | 22 | public interface IFanControlPluginMetadata 23 | { 24 | string UniqueId { get; } 25 | string MinOSVersion { get; } 26 | string MaxOSVersion { get; } 27 | SupportedPlatforms SupportedPlatforms { get; } 28 | SupportedCpuArchitectures SupportedCpuArchitectures { get; } 29 | int Priority { get; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Core/StagWare.FanControl/Plugins/ITemperatureMonitor.cs: -------------------------------------------------------------------------------- 1 | namespace StagWare.FanControl.Plugins 2 | { 3 | public interface ITemperatureMonitor : IFanControlPlugin 4 | { 5 | string TemperatureSourceDisplayName { get; } 6 | double GetTemperature(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Core/StagWare.FanControl/Plugins/PluginInitializationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StagWare.FanControl.Plugins 4 | { 5 | public class PluginInitializationException : Exception 6 | { 7 | public PluginInitializationException() 8 | { 9 | } 10 | 11 | public PluginInitializationException(string message) : base(message) 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Core/StagWare.FanControl/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("StagWare.FanControl")] 10 | [assembly: AssemblyDescription("Fan control library for notebooks")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyProduct("StagWare.FanControl")] 13 | [assembly: AssemblyCulture("")] 14 | 15 | // Version 16 | [assembly: AssemblyVersion("2.5.2.0")] 17 | [assembly: AssemblyFileVersion("2.5.2.0")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // The following GUID is for the ID of the typelib if this project is exposed to COM 25 | [assembly: Guid("6cf02004-dd78-4a26-90df-ee085099e80c")] 26 | 27 | // Internals should be visible to unit test project. 28 | [assembly: InternalsVisibleTo("StagWare.FanControl.Tests")] 29 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] 30 | -------------------------------------------------------------------------------- /Core/StagWare.FanControl/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Core/StagWare.Settings/LoadSettingsFailedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StagWare.Settings 4 | { 5 | public class LoadSettingsFailedEventArgs : EventArgs 6 | { 7 | public LoadSettingsFailedEventArgs(Exception e) 8 | { 9 | this.Exception = e; 10 | } 11 | 12 | public Exception Exception { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Core/StagWare.Settings/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // Allgemeine Informationen über eine Assembly werden über die folgenden 5 | // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, 6 | // die einer Assembly zugeordnet sind. 7 | [assembly: AssemblyTitle("StagWare.Settings")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("StagWare.Settings")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly 14 | // für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von 15 | // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. 16 | [assembly: ComVisible(false)] 17 | 18 | // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird 19 | [assembly: Guid("44c3959a-3565-4fb6-9bf6-694b146cd032")] -------------------------------------------------------------------------------- /Core/StagWare.Settings/RestoreDefaultsIgnoreAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StagWare.Settings 4 | { 5 | [AttributeUsage(AttributeTargets.Property)] 6 | public sealed class RestoreDefaultsIgnoreAttribute : Attribute 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Core/StagWare.Settings/SettingsBase.cs: -------------------------------------------------------------------------------- 1 | namespace StagWare.Settings 2 | { 3 | public abstract class SettingsBase 4 | { 5 | [RestoreDefaultsIgnore] 6 | public int SettingsVersion { get; set; } 7 | 8 | public virtual void UpgradeSettings(int fileVersion, int settingsVersion) 9 | { 10 | SettingsVersion = settingsVersion; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Linux/nbfc-sleep.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=NoteBook FanControl service sleep hook 3 | Before=sleep.target 4 | StopWhenUnneeded=yes 5 | 6 | [Service] 7 | Type=oneshot 8 | RemainAfterExit=yes 9 | ExecStart=-/opt/nbfc/nbfcservice.sh pause 10 | ExecStop=-/opt/nbfc/nbfcservice.sh continue 11 | 12 | [Install] 13 | WantedBy=sleep.target 14 | -------------------------------------------------------------------------------- /Linux/nbfc.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=NoteBook FanControl service 3 | 4 | [Service] 5 | ExecStart=/opt/nbfc/nbfcservice.sh start 6 | ExecStop=-/opt/nbfc/nbfcservice.sh stop 7 | Type=forking 8 | PIDFile=/run/nbfc.pid 9 | TimeoutStopSec=20 10 | Restart=on-failure 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | 15 | -------------------------------------------------------------------------------- /Linux/nbfcservice.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LOCK_FILE="/run/nbfc.pid" 4 | 5 | case $1 in 6 | "start") 7 | DIR=$(dirname -- $0) 8 | mono-service -l:$LOCK_FILE -m:NbfcService "$DIR/NbfcService.exe" 9 | ;; 10 | "stop") 11 | kill -SIGTERM $(cat $LOCK_FILE) 12 | ;; 13 | "pause") 14 | kill -SIGUSR1 $(cat $LOCK_FILE) 15 | ;; 16 | "continue") 17 | kill -SIGUSR2 $(cat $LOCK_FILE) 18 | ;; 19 | *) 20 | echo "$0 (start|stop|pause|continue)" 21 | exit 1 22 | esac 23 | -------------------------------------------------------------------------------- /Tests/StagWare.FanControl.Configurations.Tests/ExtensionMethods/StringExtensionMethodsTests.cs: -------------------------------------------------------------------------------- 1 | using StagWare.ExtensionMethods; 2 | using System; 3 | using Xunit; 4 | 5 | namespace StagWare.FanControl.Configurations.Tests.ExtensionMethods 6 | { 7 | public class StringExtensionMethodsTests 8 | { 9 | public class GetLongestCommonSubstring 10 | { 11 | [Theory] 12 | [InlineData("1234567#-34fm", "uue4567sdfof", "4567")] 13 | [InlineData("kdgbdg1234567mgm", "1234567", "1234567")] 14 | [InlineData("1234567", "12345", "12345")] 15 | [InlineData("123456789", "123456789", "123456789")] 16 | [InlineData("", "", "")] 17 | [InlineData("", "123", "")] 18 | [InlineData("123", "", "")] 19 | [InlineData("123", "2", "2")] 20 | public static void FindsLongestSubstring(string s1, string s2, string result) 21 | { 22 | Assert.Equal(result, s1.GetLongestCommonSubstring(s2)); 23 | } 24 | 25 | [Fact] 26 | public static void ThrowsIfStringIsNull() 27 | { 28 | Assert.Throws(() => "".GetLongestCommonSubstring(null)); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Tests/StagWare.FanControl.Configurations.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // Allgemeine Informationen über eine Assembly werden über die folgenden 5 | // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, 6 | // die einer Assembly zugeordnet sind. 7 | [assembly: AssemblyTitle("StagWare.FanControl.Configurations.Tests")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("StagWare.FanControl.Configurations.Tests")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly 14 | // für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von 15 | // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. 16 | [assembly: ComVisible(false)] 17 | 18 | // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird 19 | [assembly: Guid("f25ef457-99fb-448e-bb9b-b618acaad51a")] -------------------------------------------------------------------------------- /Tests/StagWare.FanControl.Configurations.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Tests/StagWare.FanControl.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("StagWare.FanControl.Tests")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyProduct("StagWare.FanControl.Tests")] 11 | [assembly: AssemblyCulture("")] 12 | 13 | // Setting ComVisible to false makes the types in this assembly not visible 14 | // to COM components. If you need to access a type in this assembly from 15 | // COM, set the ComVisible attribute to true on that type. 16 | [assembly: ComVisible(false)] 17 | 18 | // The following GUID is for the ID of the typelib if this project is exposed to COM 19 | [assembly: Guid("75f46626-9b87-497e-8565-51a5c8798ed4")] -------------------------------------------------------------------------------- /Tests/StagWare.FanControl.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Windows; 7 | using ConfigEditor.ValueConverters; 8 | 9 | namespace ConfigEditor 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/Commands/RelayCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Input; 6 | 7 | namespace ConfigEditor.Commands 8 | { 9 | public class RelayCommand : ICommand 10 | { 11 | #region Events 12 | 13 | public event EventHandler CanExecuteChanged; 14 | 15 | #endregion 16 | 17 | #region Fields 18 | 19 | private readonly Action execute; 20 | private readonly Predicate canExecute; 21 | 22 | #endregion 23 | 24 | #region Constructors 25 | 26 | public RelayCommand(Action execute) 27 | : this(execute, null) 28 | { 29 | } 30 | 31 | public RelayCommand(Action execute, Predicate canExecute) 32 | { 33 | this.execute = execute; 34 | this.canExecute = canExecute; 35 | } 36 | 37 | #endregion 38 | 39 | #region ICommand Members 40 | 41 | public bool CanExecute(object parameter) 42 | { 43 | return canExecute == null ? true : canExecute(parameter); 44 | } 45 | 46 | public void RaiseCanExecuteChanged() 47 | { 48 | if (CanExecuteChanged != null) 49 | { 50 | CanExecuteChanged(this, EventArgs.Empty); 51 | } 52 | } 53 | 54 | public void Execute(object parameter) 55 | { 56 | execute(parameter); 57 | } 58 | 59 | #endregion 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/ExtensionMethods/CollectionExtensionMethods.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace ConfigEditor 8 | { 9 | public static class CollectionExtensionMethods 10 | { 11 | public static int Replace(this Collection oc, TSource oldItem, TSource newItem) 12 | { 13 | int idx = oc.IndexOf(oldItem); 14 | 15 | if (idx >= 0) 16 | { 17 | oc[idx] = newItem; 18 | return idx; 19 | } 20 | else 21 | { 22 | throw new InvalidOperationException("The collection does not contain oldItem"); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/ExtensionMethods/IconExtensionMethods.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Windows; 3 | using System.Windows.Interop; 4 | using System.Windows.Media; 5 | using System.Windows.Media.Imaging; 6 | 7 | namespace ConfigEditor 8 | { 9 | public static class IconExtensionMethods 10 | { 11 | public static ImageSource ToImageSource(this Icon icon) 12 | { 13 | ImageSource imageSource = Imaging.CreateBitmapSourceFromHIcon( 14 | icon.Handle, 15 | Int32Rect.Empty, 16 | BitmapSizeOptions.FromEmptyOptions()); 17 | 18 | return imageSource; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/ExtensionMethods/MouseDeviceExtensionMethods.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Input; 7 | 8 | namespace ConfigEditor 9 | { 10 | public static class MouseDeviceExtensionMethods 11 | { 12 | public static bool IsMouseOverElement(this MouseDevice device, Type elementType) 13 | { 14 | var element = device.DirectlyOver as FrameworkElement; 15 | 16 | return element != null 17 | && element.Parent != null 18 | && element.Parent.GetType().IsAssignableFrom(elementType); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ConfigEditor.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/ValueConverters/BooleanToBrushConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using System.Windows.Data; 4 | using System.Windows.Media; 5 | 6 | namespace ConfigEditor.ValueConverters 7 | { 8 | public class BooleanToBrushConverter : IMultiValueConverter 9 | { 10 | public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) 11 | { 12 | if (!(bool)values[1]) 13 | { 14 | return Brushes.Tomato; 15 | } 16 | else if (!(bool)values[0]) 17 | { 18 | return Brushes.Gold; 19 | } 20 | else 21 | { 22 | return SystemColors.ControlLightLightBrush; 23 | } 24 | } 25 | 26 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) 27 | { 28 | throw new NotImplementedException(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/ValueConverters/BooleanToButtonTextConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Data; 6 | 7 | namespace ConfigEditor.ValueConverters 8 | { 9 | [ValueConversion(typeof(bool), typeof(string))] 10 | public class BooleanToButtonTextConverter : IValueConverter 11 | { 12 | #region Constants 13 | 14 | private const string ButtonTextOK = "OK"; 15 | private const string ButtonTextOverwrite = "Overwrite"; 16 | 17 | #endregion 18 | 19 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 20 | { 21 | return (bool)value ? ButtonTextOK : ButtonTextOverwrite; 22 | } 23 | 24 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 25 | { 26 | throw new NotImplementedException(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/ValueConverters/InvertBooleanConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Data; 6 | 7 | namespace ConfigEditor.ValueConverters 8 | { 9 | [ValueConversion(typeof(bool), typeof(bool))] 10 | public class InvertBooleanConverter : IValueConverter 11 | { 12 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 13 | { 14 | return !(bool)value; 15 | } 16 | 17 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 18 | { 19 | return Convert(value, targetType, parameter, culture); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/ValueConverters/ReadWriteWordsToMaximumConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Data; 6 | 7 | namespace ConfigEditor.ValueConverters 8 | { 9 | [ValueConversion(typeof(bool), typeof(int))] 10 | public class ReadWriteWordsToMaximumConverter : IValueConverter 11 | { 12 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 13 | { 14 | return (bool)value ? ushort.MaxValue : byte.MaxValue; 15 | } 16 | 17 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/ValueConverters/SelectedItemToBooleanConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Data; 6 | 7 | namespace ConfigEditor.ValueConverters 8 | { 9 | [ValueConversion(typeof(object), typeof(bool))] 10 | public class SelectedItemToBooleanConverter : IValueConverter 11 | { 12 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 13 | { 14 | return value != null; 15 | } 16 | 17 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/ViewModels/EventArgs/CommandCompletedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ConfigEditor.ViewModels 4 | { 5 | public class CommandExecutedEventArgs : EventArgs 6 | { 7 | public bool Success { get; set; } 8 | public Exception Exception { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/ViewModels/EventArgs/DialogEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ConfigEditor.ViewModels 7 | { 8 | public class DialogEventArgs : EventArgs 9 | { 10 | public bool Update { get; set; } 11 | public T ViewModel { get; private set; } 12 | 13 | public DialogEventArgs(T viewModel) 14 | { 15 | this.ViewModel = viewModel; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/ViewModels/RequestConfigPathViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace ConfigEditor.ViewModels 8 | { 9 | public class RequestConfigPathViewModel 10 | { 11 | public static string ConfigV1FileExtension => "config"; 12 | public static string ConfigV2FileExtension => "xml"; 13 | 14 | public bool IsPathValid 15 | { 16 | get 17 | { 18 | return File.Exists(this.ConfigFilePath); 19 | } 20 | } 21 | 22 | public string ConfigFilePath { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/ViewModels/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace ConfigEditor.ViewModels 8 | { 9 | public abstract class ViewModelBase : INotifyPropertyChanged 10 | { 11 | #region INotifyPropertyChanged implementation 12 | 13 | public event PropertyChangedEventHandler PropertyChanged; 14 | 15 | protected void OnPropertyChanged(string propertyName) 16 | { 17 | if (this.PropertyChanged != null) 18 | { 19 | PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 20 | } 21 | } 22 | 23 | #endregion 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/Windows/FanSpeedOverrideWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Shapes; 13 | 14 | namespace ConfigEditor.Windows 15 | { 16 | /// 17 | /// Interaction logic for FanSpeedPercentageOverrideWindow.xaml 18 | /// 19 | public partial class FanSpeedOverrideWindow : Window 20 | { 21 | public FanSpeedOverrideWindow() 22 | { 23 | InitializeComponent(); 24 | } 25 | 26 | private void OK_Click(object sender, RoutedEventArgs e) 27 | { 28 | this.DialogResult = true; 29 | this.Close(); 30 | } 31 | 32 | private void Cancel_Click(object sender, RoutedEventArgs e) 33 | { 34 | this.DialogResult = false; 35 | this.Close(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/Windows/NonModalDialogWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | 7 | namespace ConfigEditor.Windows 8 | { 9 | public abstract class NonModalDialogWindow : Window 10 | { 11 | public bool ApplyChanges { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/Windows/RegisterWriteConfigWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Shapes; 13 | 14 | namespace ConfigEditor.Windows 15 | { 16 | /// 17 | /// Interaction logic for RegisterWriteConfigWindow.xaml 18 | /// 19 | public partial class RegisterWriteConfigWindow : NonModalDialogWindow 20 | { 21 | #region Constructor 22 | 23 | public RegisterWriteConfigWindow() 24 | { 25 | InitializeComponent(); 26 | } 27 | 28 | #endregion 29 | 30 | #region Event Handlers 31 | 32 | private void OK_Click(object sender, RoutedEventArgs e) 33 | { 34 | this.ApplyChanges = true; 35 | this.Close(); 36 | } 37 | 38 | private void Cancel_Click(object sender, RoutedEventArgs e) 39 | { 40 | this.ApplyChanges = false; 41 | this.Close(); 42 | } 43 | 44 | #endregion 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/Windows/RequestConfigNameWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Shapes; 13 | 14 | namespace ConfigEditor.Windows 15 | { 16 | /// 17 | /// Interaction logic for RequestConfigNameWindow.xaml 18 | /// 19 | public partial class RequestConfigNameWindow : Window 20 | { 21 | public RequestConfigNameWindow() 22 | { 23 | InitializeComponent(); 24 | } 25 | 26 | private void Accept_Click(object sender, RoutedEventArgs e) 27 | { 28 | this.DialogResult = true; 29 | Close(); 30 | } 31 | 32 | private void Cancel_Click(object sender, RoutedEventArgs e) 33 | { 34 | this.DialogResult = false; 35 | Close(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/Windows/TemperatureThresholdWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Shapes; 13 | 14 | namespace ConfigEditor.Windows 15 | { 16 | /// 17 | /// Interaction logic for TemperatureThresholdindow.xaml 18 | /// 19 | public partial class TemperatureThresholdWindow : Window 20 | { 21 | public TemperatureThresholdWindow() 22 | { 23 | InitializeComponent(); 24 | } 25 | 26 | private void OK_Click(object sender, RoutedEventArgs e) 27 | { 28 | this.DialogResult = true; 29 | this.Close(); 30 | } 31 | 32 | private void Cancel_Click(object sender, RoutedEventArgs e) 33 | { 34 | this.DialogResult = false; 35 | this.Close(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Windows/ConfigEditor/fan.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirschmann/nbfc/fc9fb970155607d9ebc994f9e99c8ee09121e628/Windows/ConfigEditor/fan.ico -------------------------------------------------------------------------------- /Windows/ConfigEditor/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Windows/NbfcClient/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using NbfcClient.Properties; 2 | using NLog; 3 | using System; 4 | using System.Globalization; 5 | using System.Windows; 6 | using System.Windows.Markup; 7 | 8 | namespace NbfcClient 9 | { 10 | /// 11 | /// Interaction logic for App.xaml 12 | /// 13 | public partial class App : Application 14 | { 15 | private static readonly Logger logger = LogManager.GetCurrentClassLogger(); 16 | 17 | public App() 18 | { 19 | logger.Info("App start"); 20 | 21 | AppDomain.CurrentDomain.UnhandledException += (sender, args) => 22 | { 23 | logger.Fatal(args.ExceptionObject as Exception, "An unhandled exception occurred"); 24 | }; 25 | 26 | AppDomain.CurrentDomain.FirstChanceException += (sender, args) => 27 | { 28 | logger.Debug(args.Exception, "A first chance exception occurred"); 29 | }; 30 | 31 | this.Exit += (sender, args) => 32 | { 33 | logger.Info("App exit"); 34 | }; 35 | 36 | FrameworkElement.LanguageProperty.OverrideMetadata( 37 | typeof(FrameworkElement), 38 | new FrameworkPropertyMetadata( 39 | XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Windows/NbfcClient/AppSettings.cs: -------------------------------------------------------------------------------- 1 | using StagWare.Settings; 2 | using System.Windows.Media; 3 | 4 | namespace NbfcClient 5 | { 6 | public class AppSettings : SettingsBase 7 | { 8 | public AppSettings() 9 | { 10 | SettingsVersion = 0; 11 | } 12 | 13 | [DefaultValue(typeof(XmlWrapper), "White")] 14 | public XmlWrapper TrayIconForegroundColor { get; set; } 15 | 16 | [DefaultValue(false)] 17 | public bool CloseToTray { get; set; } 18 | 19 | [DefaultValue(350.0)] 20 | public double WindowHeight { get; set; } 21 | 22 | [DefaultValue(430.0)] 23 | public double WindowWidth { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Windows/NbfcClient/DesignData/FanControllerCollection.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 12 | 13 | 20 | 21 | -------------------------------------------------------------------------------- /Windows/NbfcClient/DesignData/FanControllerViewModelCollection.cs: -------------------------------------------------------------------------------- 1 | using NbfcClient.ViewModels; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Collections.ObjectModel; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Windows.Markup; 8 | 9 | namespace NbfcClient.DesignData 10 | { 11 | public class FanControllerViewModelCollection : ObservableCollection 12 | { 13 | public FanControllerViewModelCollection() 14 | : base() 15 | { 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Windows/NbfcClient/DesignData/FanControllerViewModelData.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | -------------------------------------------------------------------------------- /Windows/NbfcClient/DesignData/MainWindowViewModelData.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | -------------------------------------------------------------------------------- /Windows/NbfcClient/Messages/CloseSelectConfigDialogMessage.cs: -------------------------------------------------------------------------------- 1 | using GalaSoft.MvvmLight.Messaging; 2 | 3 | namespace NbfcClient.Messages 4 | { 5 | public class CloseSelectConfigDialogMessage : MessageBase 6 | { 7 | public CloseSelectConfigDialogMessage() 8 | { 9 | } 10 | 11 | public CloseSelectConfigDialogMessage(bool dialogResult, string selectedConfig) 12 | { 13 | DialogResult = dialogResult; 14 | SelectedConfig = selectedConfig; 15 | } 16 | 17 | public bool DialogResult { get; set; } 18 | public string SelectedConfig { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Windows/NbfcClient/Messages/OpenSelectConfigDialogMessage.cs: -------------------------------------------------------------------------------- 1 | using GalaSoft.MvvmLight.Messaging; 2 | 3 | namespace NbfcClient.Messages 4 | { 5 | public class OpenSelectConfigDialogMessage : MessageBase 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Windows/NbfcClient/Messages/OpenSettingsDialogMessage.cs: -------------------------------------------------------------------------------- 1 | using GalaSoft.MvvmLight.Messaging; 2 | 3 | namespace NbfcClient.Messages 4 | { 5 | public class OpenSettingsDialogMessage : MessageBase 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Windows/NbfcClient/Messages/ReloadFanControlInfoMessage.cs: -------------------------------------------------------------------------------- 1 | using GalaSoft.MvvmLight.Messaging; 2 | 3 | namespace NbfcClient.Messages 4 | { 5 | public class ReloadFanControlInfoMessage : MessageBase 6 | { 7 | public ReloadFanControlInfoMessage() 8 | { 9 | } 10 | 11 | public ReloadFanControlInfoMessage(bool ignoreCache) 12 | { 13 | IgnoreCache = ignoreCache; 14 | } 15 | 16 | public bool IgnoreCache { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Windows/NbfcClient/Service References/NbfcService/Arrays.xsd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Windows/NbfcClient/Service References/NbfcService/NbfcClient.NbfcService.FanControlInfo.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | NbfcClient.NbfcService.FanControlInfo, Service References.NbfcService.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /Windows/NbfcClient/Services/FanControlStatusChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using NbfcClient.NbfcService; 2 | using System; 3 | 4 | namespace NbfcClient.Services 5 | { 6 | public class FanControlStatusChangedEventArgs : EventArgs 7 | { 8 | #region Constructors 9 | 10 | public FanControlStatusChangedEventArgs() 11 | { 12 | } 13 | 14 | public FanControlStatusChangedEventArgs(FanControlInfo info) 15 | { 16 | Status = info; 17 | } 18 | 19 | #endregion 20 | 21 | #region Properties 22 | 23 | public FanControlInfo Status { get; set; } 24 | 25 | #endregion 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Windows/NbfcClient/Services/IFanControlClient.cs: -------------------------------------------------------------------------------- 1 | using NbfcClient.NbfcService; 2 | using System; 3 | 4 | namespace NbfcClient.Services 5 | { 6 | public interface IFanControlClient : IFanControlService 7 | { 8 | event EventHandler FanControlStatusChanged; 9 | FanControlInfo FanControlInfo { get; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Windows/NbfcClient/UserControls/FanController.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace NbfcClient.UserControls 16 | { 17 | /// 18 | /// Interaction logic for FanController.xaml 19 | /// 20 | public partial class FanController : UserControl 21 | { 22 | public FanController() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Windows/NbfcClient/UserControls/ToolTipFanInfo.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace NbfcClient.UserControls 16 | { 17 | /// 18 | /// Interaction logic for ToolTipFanInfo.xaml 19 | /// 20 | public partial class ToolTipFanInfo : UserControl 21 | { 22 | public ToolTipFanInfo() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Windows/NbfcClient/UserControls/TrayToolTip.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace NbfcClient.UserControls 16 | { 17 | /// 18 | /// Interaction logic for TrayToolTip.xaml 19 | /// 20 | public partial class TrayToolTip : UserControl 21 | { 22 | public TrayToolTip() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Windows/NbfcClient/ValueConverters/AddOneConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows.Data; 4 | 5 | namespace NbfcClient.ValueConverters 6 | { 7 | [ValueConversion(typeof(int), typeof(int))] 8 | public class AddOneConverter : IValueConverter 9 | { 10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 11 | { 12 | return (int)value + 1; 13 | } 14 | 15 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 16 | { 17 | return (int)value - 1; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Windows/NbfcClient/ValueConverters/BooleanToInverseConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Data; 3 | 4 | namespace NbfcClient.ValueConverters 5 | { 6 | [ValueConversion(typeof(bool), typeof(bool))] 7 | public class BooleanToInverseConverter:IValueConverter 8 | { 9 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 10 | { 11 | return !(bool)value; 12 | } 13 | 14 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 15 | { 16 | return Convert(value, targetType, parameter, culture); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Windows/NbfcClient/ValueConverters/BooleanToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Data; 5 | 6 | namespace NbfcClient.ValueConverters 7 | { 8 | [ValueConversion(typeof(bool), typeof(Visibility))] 9 | public class BooleanToVisibilityConverter : IValueConverter 10 | { 11 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 12 | { 13 | bool invert = (bool)parameter; 14 | bool isVisible = (bool)value; 15 | 16 | if (invert) 17 | { 18 | isVisible = !isVisible; 19 | } 20 | 21 | return isVisible ? Visibility.Visible : Visibility.Collapsed; 22 | } 23 | 24 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 25 | { 26 | bool invert = (bool)parameter; 27 | Visibility vis = (Visibility)value; 28 | bool result = false; 29 | 30 | if (vis == Visibility.Visible) 31 | { 32 | result = true; 33 | } 34 | 35 | if (invert) 36 | { 37 | result = !result; 38 | } 39 | 40 | return result; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Windows/NbfcClient/ValueConverters/ColorToBrushConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows.Data; 4 | using System.Windows.Media; 5 | 6 | namespace NbfcClient.ValueConverters 7 | { 8 | [ValueConversion(typeof(Color), typeof(Brush))] 9 | public class ColorToBrushConverter : IValueConverter 10 | { 11 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 12 | { 13 | return new SolidColorBrush((Color)value); 14 | } 15 | 16 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 17 | { 18 | var brush = value as SolidColorBrush; 19 | return brush.Color; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Windows/NbfcClient/ValueConverters/ColorToStringConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Reflection; 5 | using System.Windows; 6 | using System.Windows.Data; 7 | using System.Windows.Media; 8 | 9 | namespace NbfcClient.ValueConverters 10 | { 11 | [ValueConversion(typeof(Color), typeof(string))] 12 | public class ColorToStringConverter : IValueConverter 13 | { 14 | static readonly IReadOnlyDictionary colorNames; 15 | 16 | static ColorToStringConverter() 17 | { 18 | var dict = new Dictionary(); 19 | 20 | foreach (PropertyInfo info in typeof(Colors).GetProperties()) 21 | { 22 | var color = (Color)info.GetValue(null); 23 | 24 | if (!dict.ContainsKey(color)) 25 | { 26 | dict[color] = info.Name; 27 | } 28 | 29 | colorNames = dict; 30 | } 31 | } 32 | 33 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 34 | { 35 | var c = (Color)value; 36 | 37 | if (colorNames.ContainsKey(c)) 38 | { 39 | return colorNames[c]; 40 | } 41 | 42 | return c.ToString(); 43 | } 44 | 45 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 46 | { 47 | return DependencyProperty.UnsetValue; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Windows/NbfcClient/ValueConverters/FanSpeedSliderValueToTextConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Data; 5 | 6 | namespace NbfcClient.ValueConverters 7 | { 8 | public class FanSpeedSliderValueToTextConverter : IMultiValueConverter 9 | { 10 | #region Constants 11 | 12 | private const string StringFormat = "{0:0.0}%"; 13 | private const string AutoControlledText = "Auto"; 14 | 15 | #endregion 16 | 17 | #region IMultiValueConverter implementation 18 | 19 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 20 | { 21 | double sliderValue = (double)values[0]; 22 | int fanSpeedSteps = (int)values[1]; 23 | 24 | double speed = 0; 25 | 26 | if (fanSpeedSteps != 0) 27 | { 28 | speed = (sliderValue / fanSpeedSteps) * 100; 29 | } 30 | 31 | return (speed >= 0 && speed <= 100) 32 | ? string.Format(StringFormat, speed) 33 | : AutoControlledText; 34 | } 35 | 36 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 37 | { 38 | return new object[] { DependencyProperty.UnsetValue, DependencyProperty.UnsetValue }; 39 | } 40 | 41 | #endregion 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Windows/NbfcClient/ValueConverters/TemperatureToTextConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using System.Windows.Data; 4 | 5 | namespace NbfcClient.ValueConverters 6 | { 7 | public class TemperatureToTextConverter : IMultiValueConverter 8 | { 9 | #region Constants 10 | 11 | private const string StringFormat = "Temperature{0}: {1}°C"; 12 | 13 | #endregion 14 | 15 | #region IMultiValueConverter implementation 16 | 17 | public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) 18 | { 19 | int temperature = (int)values[0]; 20 | string displayName = values[1] as string; 21 | 22 | if (string.IsNullOrWhiteSpace(displayName)) 23 | { 24 | displayName = ""; 25 | } 26 | else 27 | { 28 | displayName = " (" + displayName + ")"; 29 | } 30 | 31 | return string.Format(StringFormat, displayName, temperature); 32 | } 33 | 34 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) 35 | { 36 | return new object[] { DependencyProperty.UnsetValue, DependencyProperty.UnsetValue }; 37 | } 38 | 39 | #endregion 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Windows/NbfcClient/ViewModels/ViewModelLocator.cs: -------------------------------------------------------------------------------- 1 | using CommonServiceLocator; 2 | using GalaSoft.MvvmLight; 3 | using GalaSoft.MvvmLight.Ioc; 4 | using NbfcClient.Services; 5 | 6 | namespace NbfcClient.ViewModels 7 | { 8 | public class ViewModelLocator 9 | { 10 | static ViewModelLocator() 11 | { 12 | ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); 13 | 14 | if (ViewModelBase.IsInDesignModeStatic) 15 | { 16 | } 17 | else 18 | { 19 | SimpleIoc.Default.Register(true); 20 | } 21 | 22 | SimpleIoc.Default.Register(true); 23 | SimpleIoc.Default.Register(); 24 | SimpleIoc.Default.Register(); 25 | } 26 | 27 | public MainViewModel Main 28 | { 29 | get 30 | { 31 | return ServiceLocator.Current.GetInstance(); 32 | } 33 | } 34 | 35 | public SelectConfigViewModel SelectConfig 36 | { 37 | get 38 | { 39 | return ServiceLocator.Current.GetInstance(); 40 | } 41 | } 42 | 43 | public SettingsViewModel Settings 44 | { 45 | get 46 | { 47 | return ServiceLocator.Current.GetInstance(); 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Windows/NbfcClient/Views/ComboBoxItemTemplateSelector.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Controls; 3 | using System.Windows.Media; 4 | 5 | namespace NbfcClient.Views 6 | { 7 | public class ComboBoxItemTemplateSelector : DataTemplateSelector 8 | { 9 | public DataTemplate SelectedTemplate { get; set; } 10 | public DataTemplate DropDownTemplate { get; set; } 11 | 12 | public override DataTemplate SelectTemplate(object item, DependencyObject container) 13 | { 14 | ComboBoxItem comboBoxItem = GetVisualParent(container); 15 | 16 | return (comboBoxItem == null) 17 | ? SelectedTemplate 18 | : DropDownTemplate; 19 | } 20 | 21 | static T GetVisualParent(DependencyObject child) where T : Visual 22 | { 23 | Visual visual = (Visual)VisualTreeHelper.GetParent(child); 24 | 25 | if (visual == null) 26 | { 27 | return null; 28 | } 29 | 30 | var parent = visual as T; 31 | 32 | if (parent == null) 33 | { 34 | parent = GetVisualParent(visual); 35 | } 36 | 37 | return parent; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Windows/NbfcClient/Views/SelectConfigWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using GalaSoft.MvvmLight.Messaging; 2 | using NbfcClient.Messages; 3 | using System.Windows; 4 | 5 | namespace NbfcClient.Windows 6 | { 7 | /// 8 | /// Interaction logic for SelectConfigWindow.xaml 9 | /// 10 | public partial class SelectConfigWindow : Window 11 | { 12 | public SelectConfigWindow() 13 | { 14 | InitializeComponent(); 15 | Messenger.Default.Register(this, Close); 16 | } 17 | 18 | private void Close(CloseSelectConfigDialogMessage msg) 19 | { 20 | this.Close(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Windows/NbfcClient/Views/SettingsWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace NbfcClient.Windows 4 | { 5 | /// 6 | /// Interaction logic for SettingsWindow.xaml 7 | /// 8 | public partial class SettingsWindow : Window 9 | { 10 | public SettingsWindow() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Windows/NbfcClient/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Windows/NbfcClient/fan.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirschmann/nbfc/fc9fb970155607d9ebc994f9e99c8ee09121e628/Windows/NbfcClient/fan.ico -------------------------------------------------------------------------------- /Windows/NbfcClient/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Windows/Setup/DriverSetupWixAction/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("DriverSetupWixAction")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyProduct("DriverSetupWixAction")] 10 | [assembly: AssemblyCulture("")] 11 | 12 | // Setting ComVisible to false makes the types in this assembly not visible 13 | // to COM components. If you need to access a type in this assembly from 14 | // COM, set the ComVisible attribute to true on that type. 15 | [assembly: ComVisible(false)] 16 | 17 | // The following GUID is for the ID of the typelib if this project is exposed to COM 18 | [assembly: Guid("e08970ca-c254-4eae-baf4-35fb2ff91e77")] -------------------------------------------------------------------------------- /Windows/Setup/NbfcBootstrapper/Bootstrapper.wxs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 33 | -------------------------------------------------------------------------------- /Windows/Setup/NbfcBootstrapper/Resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirschmann/nbfc/fc9fb970155607d9ebc994f9e99c8ee09121e628/Windows/Setup/NbfcBootstrapper/Resources/logo.png -------------------------------------------------------------------------------- /Windows/Setup/NbfcBootstrapper/Resources/logoside.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirschmann/nbfc/fc9fb970155607d9ebc994f9e99c8ee09121e628/Windows/Setup/NbfcBootstrapper/Resources/logoside.png -------------------------------------------------------------------------------- /Windows/Setup/NbfcSetup/Constants.wxi: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /build.ps1: -------------------------------------------------------------------------------- 1 | $workingDir = split-path $MyInvocation.MyCommand.Path 2 | $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" 3 | $nugeturl = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" 4 | 5 | function download-nuget { 6 | $client = New-Object System.Net.WebClient 7 | 8 | # Set proxy to null to prevent the web client from trying to retrieve 9 | # proxy settings from IE (which is incredibly slow) 10 | $client.Proxy = $null 11 | $client.DownloadFile($nugeturl, "$workingDir\nuget.exe") 12 | } 13 | 14 | push-location $workingDir 15 | 16 | # download nuget if necessary 17 | if(!(test-path .\nuget.exe)) { 18 | write-output "NuGet could not be found. Downloading latest recommended version." 19 | download-nuget 20 | } 21 | 22 | # restore nuget packages for solution 23 | & .\nuget.exe restore 24 | 25 | # re-download nuget and retry on error 26 | if($LASTEXITCODE -ne 0) { 27 | write-output "Packages could not be restored. Updating NuGet." 28 | remove-item .\nuget.exe 29 | download-nuget 30 | & .\nuget.exe restore 31 | } 32 | 33 | # get msbuild path 34 | $path = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath 35 | $msbuild = join-path $path 'MSBuild\15.0\Bin\MSBuild.exe' 36 | 37 | # build solution 38 | & $msbuild /t:Clean,Build /p:Configuration=ReleaseWindows NoteBookFanControl.sln 39 | 40 | pop-location 41 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | NUGET_URL="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" 4 | 5 | function download-nuget { 6 | curl -O $NUGET_URL 7 | 8 | # import Mozilla trusted root certificates into mono certificates store 9 | 10 | # Debian / Ubuntu / Arch 11 | cert-sync "/etc/ssl/certs/ca-certificates.crt" 12 | 13 | # Fedora / CentOS 14 | cert-sync "/etc/pki/tls/certs/ca-bundle.crt" 15 | } 16 | 17 | 18 | pushd $(dirname "${0}") 19 | 20 | # download nuget if necessary 21 | if [ ! -f ./nuget.exe ] 22 | then 23 | echo "NuGet could not be found. Downloading latest recommended version." 24 | download-nuget 25 | fi 26 | 27 | mono nuget.exe restore 28 | 29 | # restore nuget packages for solution 30 | if [ "$?" != 0 ] 31 | then 32 | echo "Packages could not be restored. Updating NuGet." 33 | rm ./nuget.exe 34 | download-nuget 35 | mono nuget.exe restore 36 | fi 37 | 38 | # build solution 39 | xbuild /t:Clean /p:Configuration=ReleaseLinux NoteBookFanControl.sln 40 | xbuild /t:Build /p:Configuration=ReleaseLinux NoteBookFanControl.sln 41 | 42 | popd 43 | --------------------------------------------------------------------------------