Compare commits
10 Commits
132dea051f
...
1.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7599bdf90d | ||
|
|
ae495e9c37 | ||
|
|
748ec318ad | ||
|
|
d6ee933b40 | ||
|
|
8566c0466d | ||
|
|
444fd184d3 | ||
|
|
3d6d0c81d5 | ||
|
|
cdb3e5736b | ||
|
|
45c1c30885 | ||
|
|
78eccf9f7a |
54
AsusFanControl.Application/AsusFanControl.Application.csproj
Normal file
54
AsusFanControl.Application/AsusFanControl.Application.csproj
Normal file
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>479790b8-79ce-4915-893c-d4d769fcd9b1</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AsusFanControl.Application</RootNamespace>
|
||||
<AssemblyName>AsusFanControl.Application</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System"/>
|
||||
|
||||
<Reference Include="System.Core"/>
|
||||
<Reference Include="System.Xml.Linq"/>
|
||||
<Reference Include="System.Data.DataSetExtensions"/>
|
||||
|
||||
|
||||
<Reference Include="Microsoft.CSharp"/>
|
||||
|
||||
<Reference Include="System.Data"/>
|
||||
|
||||
<Reference Include="System.Net.Http"/>
|
||||
|
||||
<Reference Include="System.Xml"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
13
AsusFanControl.Application/Class1.cs
Normal file
13
AsusFanControl.Application/Class1.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AsusFanControl.Application
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
36
AsusFanControl.Application/Properties/AssemblyInfo.cs
Normal file
36
AsusFanControl.Application/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("AsusFanControl.Application")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("AsusFanControl.Application")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2025")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("479790b8-79ce-4915-893c-d4d769fcd9b1")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
50
AsusFanControl.Domain/AsusFanControl.Domain.csproj
Normal file
50
AsusFanControl.Domain/AsusFanControl.Domain.csproj
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{27DE14F4-82B0-4D2B-B694-D2F563810BD9}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AsusFanControl.Domain</RootNamespace>
|
||||
<AssemblyName>AsusFanControl.Domain</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<LangVersion>12.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="services\FanCurve.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
36
AsusFanControl.Domain/Properties/AssemblyInfo.cs
Normal file
36
AsusFanControl.Domain/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("AsusFanControl.Domain")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("AsusFanControl.Domain")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2025")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("27de14f4-82b0-4d2b-b694-d2f563810bd9")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
78
AsusFanControl.Domain/services/FanCurve.cs
Normal file
78
AsusFanControl.Domain/services/FanCurve.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AsusFanControl.Domain.services
|
||||
{
|
||||
public class FanCurve
|
||||
{
|
||||
// private readonly Dictionary<int, Point> _fanCurvePoints = new Dictionary<int, Point>();
|
||||
|
||||
public Dictionary<int, Point>? convertStringToPointsDictionary(
|
||||
string fanCurvePointsString, int temperatureLowerBound, int temperatureUpperBound, int fanSpeedLowerBound, int fanSpeedUpperBound
|
||||
)
|
||||
{
|
||||
if (fanCurvePointsString == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Define the allowed characters
|
||||
var allowedChars = new HashSet<char>("0123456789-,");
|
||||
// Check if the string contains any invalid characters
|
||||
if (fanCurvePointsString.Any(c => !allowedChars.Contains(c)))
|
||||
{
|
||||
throw new ArgumentException($"The fan curve points string contains invalid characters. Allowed characters: {string.Join("", allowedChars)}");
|
||||
}
|
||||
|
||||
|
||||
// Parse the string
|
||||
int pointCount = 1;
|
||||
var pointsDictionary = new Dictionary<int, Point>();
|
||||
try
|
||||
{
|
||||
var pointStrings = fanCurvePointsString.Split('-');
|
||||
|
||||
foreach (var pointString in pointStrings)
|
||||
{
|
||||
// Split the point string into temperature and fan speed parts
|
||||
string[] parts = pointString.Split(',');
|
||||
|
||||
// Ensure there are exactly two parts (temperature and fan speed)
|
||||
if (parts.Length != 2)
|
||||
{
|
||||
throw new ArgumentException($"Invalid point format: '{pointString}'. Expected format: 'temperature,fanSpeed'.");
|
||||
}
|
||||
|
||||
// Parse the temperature and fan speed values
|
||||
int temperature = int.Parse(parts[0]);
|
||||
int fanSpeed = int.Parse(parts[1]);
|
||||
|
||||
// Validate temperature and fan speed ranges
|
||||
if (temperature < temperatureLowerBound || temperature > temperatureUpperBound)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(temperature), $"Temperature value {temperature} is out of range. Valid range: {temperatureLowerBound}-{temperatureUpperBound}.");
|
||||
}
|
||||
|
||||
if (fanSpeed < fanSpeedLowerBound || fanSpeed > fanSpeedUpperBound)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(fanSpeed), $"Fan speed value {fanSpeed} is out of range. Valid range: {fanSpeedLowerBound}-{fanSpeedUpperBound}.");
|
||||
}
|
||||
|
||||
// Create a new KeyValuePair with an incremented ID and the parsed Point
|
||||
pointsDictionary.Add(pointCount++, new Point(temperature, fanSpeed));
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ArgumentException("An error occurred while parsing the fan curve points string" +
|
||||
$"\n\n{ex.Message}", ex);
|
||||
}
|
||||
|
||||
return pointsDictionary;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,20 +7,50 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsusFanControl", "AsusFanCo
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsusFanControlGUI", "AsusFanControlGUI\AsusFanControlGUI.csproj", "{42CC78B6-E3BB-4092-A423-A4EC20FB3C11}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsusFanControl.Application", "AsusFanControl.Application\AsusFanControl.Application.csproj", "{479790B8-79CE-4915-893C-D4D769FCD9B1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsusFanControl.Domain", "AsusFanControl.Domain\AsusFanControl.Domain.csproj", "{27DE14F4-82B0-4D2B-B694-D2F563810BD9}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DF94635E-4107-4EE9-8675-7137E750BC86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DF94635E-4107-4EE9-8675-7137E750BC86}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DF94635E-4107-4EE9-8675-7137E750BC86}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DF94635E-4107-4EE9-8675-7137E750BC86}.Debug|x64.Build.0 = Debug|x64
|
||||
{DF94635E-4107-4EE9-8675-7137E750BC86}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DF94635E-4107-4EE9-8675-7137E750BC86}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DF94635E-4107-4EE9-8675-7137E750BC86}.Release|x64.ActiveCfg = Release|x64
|
||||
{DF94635E-4107-4EE9-8675-7137E750BC86}.Release|x64.Build.0 = Release|x64
|
||||
{42CC78B6-E3BB-4092-A423-A4EC20FB3C11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{42CC78B6-E3BB-4092-A423-A4EC20FB3C11}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{42CC78B6-E3BB-4092-A423-A4EC20FB3C11}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{42CC78B6-E3BB-4092-A423-A4EC20FB3C11}.Debug|x64.Build.0 = Debug|x64
|
||||
{42CC78B6-E3BB-4092-A423-A4EC20FB3C11}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{42CC78B6-E3BB-4092-A423-A4EC20FB3C11}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{42CC78B6-E3BB-4092-A423-A4EC20FB3C11}.Release|x64.ActiveCfg = Release|x64
|
||||
{42CC78B6-E3BB-4092-A423-A4EC20FB3C11}.Release|x64.Build.0 = Release|x64
|
||||
{479790B8-79CE-4915-893C-D4D769FCD9B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{479790B8-79CE-4915-893C-D4D769FCD9B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{479790B8-79CE-4915-893C-D4D769FCD9B1}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{479790B8-79CE-4915-893C-D4D769FCD9B1}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{479790B8-79CE-4915-893C-D4D769FCD9B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{479790B8-79CE-4915-893C-D4D769FCD9B1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{479790B8-79CE-4915-893C-D4D769FCD9B1}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{479790B8-79CE-4915-893C-D4D769FCD9B1}.Release|x64.Build.0 = Release|Any CPU
|
||||
{27DE14F4-82B0-4D2B-B694-D2F563810BD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{27DE14F4-82B0-4D2B-B694-D2F563810BD9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{27DE14F4-82B0-4D2B-B694-D2F563810BD9}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{27DE14F4-82B0-4D2B-B694-D2F563810BD9}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{27DE14F4-82B0-4D2B-B694-D2F563810BD9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{27DE14F4-82B0-4D2B-B694-D2F563810BD9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{27DE14F4-82B0-4D2B-B694-D2F563810BD9}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{27DE14F4-82B0-4D2B-B694-D2F563810BD9}.Release|x64.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
@@ -23,7 +23,7 @@
|
||||
<value>Off</value>
|
||||
</setting>
|
||||
<setting name="FanCurvePoints" serializeAs="String">
|
||||
<value>20,1-60,1-61,20-70,20-71,30-80,55</value>
|
||||
<value>20,1-60,1-61,20-70,20-71,30-100,100-105,100</value>
|
||||
</setting>
|
||||
<setting name="allowFanCurveSettingViaText" serializeAs="String">
|
||||
<value>False</value>
|
||||
@@ -46,6 +46,21 @@
|
||||
<setting name="errorMsg" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="DefaultFanCurvePoints" serializeAs="String">
|
||||
<value>20,1-60,1-61,20-70,20-71,30-100,100-105,100</value>
|
||||
</setting>
|
||||
</AsusFanControlGUI.Properties.Settings>
|
||||
</userSettings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.2" newVersion="9.0.0.2" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
|
||||
|
Before Width: | Height: | Size: 264 KiB After Width: | Height: | Size: 264 KiB |
@@ -74,7 +74,7 @@
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>3038.7-fan-icon-iconbunny_1_.ico</ApplicationIcon>
|
||||
<ApplicationIcon>AppIcon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ManifestCertificateThumbprint>3896F9A71C1385218E0E436CCCE1201230675364</ManifestCertificateThumbprint>
|
||||
@@ -92,18 +92,40 @@
|
||||
<Reference Include="Costura, Version=5.7.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Costura.Fody.5.7.0\lib\netstandard1.0\Costura.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="LibreHardwareMonitorLib, Version=0.9.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\bin\x64\Release\LibreHardwareMonitorLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=9.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.2\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=9.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.9.0.2\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=9.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.2\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="Sentry, Version=5.1.1.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Sentry.5.1.1\lib\net462\Sentry.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.AppContext, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.AppContext.4.3.0\lib\net463\System.AppContext.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections.Immutable, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Collections.Immutable.5.0.0\lib\net461\System.Collections.Immutable.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Console.4.3.0\lib\net46\System.Console.dll</HintPath>
|
||||
@@ -160,6 +182,10 @@
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@@ -171,16 +197,25 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reflection, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Reflection.Metadata, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Reflection.Metadata.5.0.0\lib\net461\System.Reflection.Metadata.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@@ -216,11 +251,23 @@
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Encodings.Web, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.6.0.0\lib\net461\System.Text.Encodings.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Json, Version=6.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.6.0.10\lib\net461\System.Text.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.RegularExpressions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.RegularExpressions.4.3.0\lib\net463\System.Text.RegularExpressions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -273,13 +320,17 @@
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AsusFanControl.Domain\AsusFanControl.Domain.csproj">
|
||||
<Project>{27DE14F4-82B0-4D2B-B694-D2F563810BD9}</Project>
|
||||
<Name>AsusFanControl.Domain</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\AsusFanControl\AsusFanControl.csproj">
|
||||
<Project>{df94635e-4107-4ee9-8675-7137e750bc86}</Project>
|
||||
<Name>AsusFanControl</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="3038.7-fan-icon-iconbunny_1_.ico" />
|
||||
<Content Include="AppIcon.ico" />
|
||||
<Content Include="propeller.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -303,6 +354,8 @@
|
||||
<Error Condition="!Exists('..\packages\Fody.6.5.5\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.5.5\build\Fody.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props'))" />
|
||||
<Error Condition="!Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Sentry.5.1.1\build\Sentry.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Sentry.5.1.1\build\Sentry.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" />
|
||||
<Import Project="..\packages\Sentry.5.1.1\build\Sentry.targets" Condition="Exists('..\packages\Sentry.5.1.1\build\Sentry.targets')" />
|
||||
</Project>
|
||||
192
AsusFanControlGUI/Form1.Designer.cs
generated
192
AsusFanControlGUI/Form1.Designer.cs
generated
@@ -34,14 +34,13 @@
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.labelValue = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.RefreshFanRPM = new System.Windows.Forms.Button();
|
||||
this.labelRPM = new System.Windows.Forms.Label();
|
||||
this.labelCPUTemp = new System.Windows.Forms.Label();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.RefreshCPUTemp = new System.Windows.Forms.Button();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItemTurnOffControlOnExit = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItemForbidUnsafeSettings = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.allowFanCurveSettingViaTextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@@ -51,15 +50,16 @@
|
||||
this.restartApplicationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.resetToDefaultsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItemCheckForUpdates = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.pictureBoxFanCurve = new System.Windows.Forms.PictureBox();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.radioButton1 = new System.Windows.Forms.RadioButton();
|
||||
this.fanControl = new System.Windows.Forms.RadioButton();
|
||||
this.fanCurve = new System.Windows.Forms.RadioButton();
|
||||
this.fanControlRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.fanCurveRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.button4 = new System.Windows.Forms.Button();
|
||||
this.ResetCurvePoints = new System.Windows.Forms.Button();
|
||||
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
|
||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@@ -73,9 +73,10 @@
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.CurvePointsTextbox = new System.Windows.Forms.TextBox();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.InvisibleLabel = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trackBarFanSpeed)).BeginInit();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxFanCurve)).BeginInit();
|
||||
@@ -95,7 +96,7 @@
|
||||
this.trackBarFanSpeed.Name = "trackBarFanSpeed";
|
||||
this.trackBarFanSpeed.Size = new System.Drawing.Size(519, 56);
|
||||
this.trackBarFanSpeed.TabIndex = 0;
|
||||
this.trackBarFanSpeed.Value = 100;
|
||||
this.trackBarFanSpeed.Value = 50;
|
||||
this.trackBarFanSpeed.ValueChanged += new System.EventHandler(this.trackBarFanSpeed_ValueChanged);
|
||||
this.trackBarFanSpeed.KeyUp += new System.Windows.Forms.KeyEventHandler(this.trackBarFanSpeed_KeyUp);
|
||||
this.trackBarFanSpeed.MouseMove += new System.Windows.Forms.MouseEventHandler(this.trackBarFanSpeed_MouseMove);
|
||||
@@ -131,16 +132,16 @@
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "Current RPM:";
|
||||
//
|
||||
// button1
|
||||
// RefreshFanRPM
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(13, 655);
|
||||
this.button1.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(29, 28);
|
||||
this.button1.TabIndex = 4;
|
||||
this.button1.Text = "↻";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
this.RefreshFanRPM.Location = new System.Drawing.Point(13, 655);
|
||||
this.RefreshFanRPM.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.RefreshFanRPM.Name = "RefreshFanRPM";
|
||||
this.RefreshFanRPM.Size = new System.Drawing.Size(29, 28);
|
||||
this.RefreshFanRPM.TabIndex = 4;
|
||||
this.RefreshFanRPM.Text = "↻";
|
||||
this.RefreshFanRPM.UseVisualStyleBackColor = true;
|
||||
this.RefreshFanRPM.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// labelRPM
|
||||
//
|
||||
@@ -162,16 +163,16 @@
|
||||
this.labelCPUTemp.TabIndex = 9;
|
||||
this.labelCPUTemp.Text = "-";
|
||||
//
|
||||
// button2
|
||||
// RefreshCPUTemp
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(13, 691);
|
||||
this.button2.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(29, 28);
|
||||
this.button2.TabIndex = 8;
|
||||
this.button2.Text = "↻";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||
this.RefreshCPUTemp.Location = new System.Drawing.Point(13, 691);
|
||||
this.RefreshCPUTemp.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.RefreshCPUTemp.Name = "RefreshCPUTemp";
|
||||
this.RefreshCPUTemp.Size = new System.Drawing.Size(29, 28);
|
||||
this.RefreshCPUTemp.TabIndex = 8;
|
||||
this.RefreshCPUTemp.Text = "↻";
|
||||
this.RefreshCPUTemp.UseVisualStyleBackColor = true;
|
||||
this.RefreshCPUTemp.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
@@ -189,31 +190,23 @@
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripMenuItem1,
|
||||
this.optionsToolStripMenuItem,
|
||||
this.toolStripMenuItemCheckForUpdates});
|
||||
this.toolStripMenuItemCheckForUpdates,
|
||||
this.aboutToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(670, 28);
|
||||
this.menuStrip1.Size = new System.Drawing.Size(685, 28);
|
||||
this.menuStrip1.TabIndex = 10;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripMenuItemTurnOffControlOnExit,
|
||||
this.toolStripMenuItemForbidUnsafeSettings,
|
||||
this.allowFanCurveSettingViaTextToolStripMenuItem});
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(89, 24);
|
||||
this.toolStripMenuItem1.Text = "Advanced";
|
||||
//
|
||||
// toolStripMenuItemTurnOffControlOnExit
|
||||
//
|
||||
this.toolStripMenuItemTurnOffControlOnExit.CheckOnClick = true;
|
||||
this.toolStripMenuItemTurnOffControlOnExit.Name = "toolStripMenuItemTurnOffControlOnExit";
|
||||
this.toolStripMenuItemTurnOffControlOnExit.Size = new System.Drawing.Size(293, 26);
|
||||
this.toolStripMenuItemTurnOffControlOnExit.Text = "Turn off control on exit";
|
||||
this.toolStripMenuItemTurnOffControlOnExit.CheckedChanged += new System.EventHandler(this.toolStripMenuItemTurnOffControlOnExit_CheckedChanged);
|
||||
//
|
||||
// toolStripMenuItemForbidUnsafeSettings
|
||||
//
|
||||
this.toolStripMenuItemForbidUnsafeSettings.CheckOnClick = true;
|
||||
@@ -287,6 +280,13 @@
|
||||
this.toolStripMenuItemCheckForUpdates.Text = "Check for updates";
|
||||
this.toolStripMenuItemCheckForUpdates.Click += new System.EventHandler(this.toolStripMenuItemCheckForUpdates_Click);
|
||||
//
|
||||
// aboutToolStripMenuItem
|
||||
//
|
||||
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
|
||||
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(64, 24);
|
||||
this.aboutToolStripMenuItem.Text = "About";
|
||||
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
@@ -313,8 +313,8 @@
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.radioButton1);
|
||||
this.groupBox1.Controls.Add(this.fanControl);
|
||||
this.groupBox1.Controls.Add(this.fanCurve);
|
||||
this.groupBox1.Controls.Add(this.fanControlRadioButton);
|
||||
this.groupBox1.Controls.Add(this.fanCurveRadioButton);
|
||||
this.groupBox1.Controls.Add(this.trackBarFanSpeed);
|
||||
this.groupBox1.Controls.Add(this.label5);
|
||||
this.groupBox1.Location = new System.Drawing.Point(12, 37);
|
||||
@@ -336,27 +336,27 @@
|
||||
this.radioButton1.UseVisualStyleBackColor = true;
|
||||
this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
|
||||
//
|
||||
// fanControl
|
||||
// fanControlRadioButton
|
||||
//
|
||||
this.fanControl.AutoSize = true;
|
||||
this.fanControl.Location = new System.Drawing.Point(17, 67);
|
||||
this.fanControl.Name = "fanControl";
|
||||
this.fanControl.Size = new System.Drawing.Size(137, 20);
|
||||
this.fanControl.TabIndex = 15;
|
||||
this.fanControl.Text = "Turn on fan control";
|
||||
this.fanControl.UseVisualStyleBackColor = true;
|
||||
this.fanControl.CheckedChanged += new System.EventHandler(this.fanControl_CheckedChanged);
|
||||
this.fanControlRadioButton.AutoSize = true;
|
||||
this.fanControlRadioButton.Location = new System.Drawing.Point(17, 67);
|
||||
this.fanControlRadioButton.Name = "fanControlRadioButton";
|
||||
this.fanControlRadioButton.Size = new System.Drawing.Size(137, 20);
|
||||
this.fanControlRadioButton.TabIndex = 15;
|
||||
this.fanControlRadioButton.Text = "Turn on fan control";
|
||||
this.fanControlRadioButton.UseVisualStyleBackColor = true;
|
||||
this.fanControlRadioButton.CheckedChanged += new System.EventHandler(this.fanControl_CheckedChanged);
|
||||
//
|
||||
// fanCurve
|
||||
// fanCurveRadioButton
|
||||
//
|
||||
this.fanCurve.AutoSize = true;
|
||||
this.fanCurve.Location = new System.Drawing.Point(17, 150);
|
||||
this.fanCurve.Name = "fanCurve";
|
||||
this.fanCurve.Size = new System.Drawing.Size(130, 20);
|
||||
this.fanCurve.TabIndex = 14;
|
||||
this.fanCurve.Text = "Turn on fan curve";
|
||||
this.fanCurve.UseVisualStyleBackColor = true;
|
||||
this.fanCurve.CheckedChanged += new System.EventHandler(this.fanCurve_CheckedChanged);
|
||||
this.fanCurveRadioButton.AutoSize = true;
|
||||
this.fanCurveRadioButton.Location = new System.Drawing.Point(17, 150);
|
||||
this.fanCurveRadioButton.Name = "fanCurveRadioButton";
|
||||
this.fanCurveRadioButton.Size = new System.Drawing.Size(130, 20);
|
||||
this.fanCurveRadioButton.TabIndex = 14;
|
||||
this.fanCurveRadioButton.Text = "Turn on fan curve";
|
||||
this.fanCurveRadioButton.UseVisualStyleBackColor = true;
|
||||
this.fanCurveRadioButton.CheckedChanged += new System.EventHandler(this.fanCurve_CheckedChanged);
|
||||
//
|
||||
// button3
|
||||
//
|
||||
@@ -369,16 +369,16 @@
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.button3_Click);
|
||||
//
|
||||
// button4
|
||||
// ResetCurvePoints
|
||||
//
|
||||
this.button4.Location = new System.Drawing.Point(13, 552);
|
||||
this.button4.Name = "button4";
|
||||
this.button4.Size = new System.Drawing.Size(35, 27);
|
||||
this.button4.TabIndex = 23;
|
||||
this.button4.Text = "R";
|
||||
this.toolTip1.SetToolTip(this.button4, "Reset");
|
||||
this.button4.UseVisualStyleBackColor = true;
|
||||
this.button4.Click += new System.EventHandler(this.button4_Click);
|
||||
this.ResetCurvePoints.Location = new System.Drawing.Point(13, 552);
|
||||
this.ResetCurvePoints.Name = "ResetCurvePoints";
|
||||
this.ResetCurvePoints.Size = new System.Drawing.Size(35, 27);
|
||||
this.ResetCurvePoints.TabIndex = 23;
|
||||
this.ResetCurvePoints.Text = "R";
|
||||
this.toolTip1.SetToolTip(this.ResetCurvePoints, "Reset");
|
||||
this.ResetCurvePoints.UseVisualStyleBackColor = true;
|
||||
this.ResetCurvePoints.Click += new System.EventHandler(this.button4_Click);
|
||||
//
|
||||
// notifyIcon1
|
||||
//
|
||||
@@ -396,6 +396,7 @@
|
||||
this.closeToolStripMenuItem});
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(115, 52);
|
||||
this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
|
||||
//
|
||||
// openToolStripMenuItem
|
||||
//
|
||||
@@ -508,6 +509,10 @@
|
||||
this.label7.TabIndex = 21;
|
||||
this.label7.Text = "Update Speed:";
|
||||
//
|
||||
// backgroundWorker1
|
||||
//
|
||||
this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Location = new System.Drawing.Point(12, 755);
|
||||
@@ -517,16 +522,16 @@
|
||||
this.label3.Text = ".";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// textBox1
|
||||
// CurvePointsTextbox
|
||||
//
|
||||
this.textBox1.Font = new System.Drawing.Font("Consolas", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.textBox1.Location = new System.Drawing.Point(53, 552);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.ReadOnly = true;
|
||||
this.textBox1.Size = new System.Drawing.Size(564, 27);
|
||||
this.textBox1.TabIndex = 21;
|
||||
this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
|
||||
this.textBox1.MouseHover += new System.EventHandler(this.textBox1_MouseHover);
|
||||
this.CurvePointsTextbox.Font = new System.Drawing.Font("Consolas", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.CurvePointsTextbox.Location = new System.Drawing.Point(53, 552);
|
||||
this.CurvePointsTextbox.Name = "CurvePointsTextbox";
|
||||
this.CurvePointsTextbox.ReadOnly = true;
|
||||
this.CurvePointsTextbox.Size = new System.Drawing.Size(564, 27);
|
||||
this.CurvePointsTextbox.TabIndex = 21;
|
||||
this.CurvePointsTextbox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
|
||||
this.CurvePointsTextbox.MouseHover += new System.EventHandler(this.textBox1_MouseHover);
|
||||
//
|
||||
// label10
|
||||
//
|
||||
@@ -544,24 +549,36 @@
|
||||
this.label11.Size = new System.Drawing.Size(645, 2);
|
||||
this.label11.TabIndex = 25;
|
||||
//
|
||||
// InvisibleLabel
|
||||
//
|
||||
this.InvisibleLabel.AutoSize = true;
|
||||
this.InvisibleLabel.Location = new System.Drawing.Point(103, 225);
|
||||
this.InvisibleLabel.Name = "InvisibleLabel";
|
||||
this.InvisibleLabel.Size = new System.Drawing.Size(56, 16);
|
||||
this.InvisibleLabel.TabIndex = 26;
|
||||
this.InvisibleLabel.Text = "Invisible";
|
||||
this.InvisibleLabel.Visible = false;
|
||||
this.InvisibleLabel.Click += new System.EventHandler(this.InvisibleLabel_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(670, 786);
|
||||
this.ClientSize = new System.Drawing.Size(685, 786);
|
||||
this.Controls.Add(this.InvisibleLabel);
|
||||
this.Controls.Add(this.label11);
|
||||
this.Controls.Add(this.label10);
|
||||
this.Controls.Add(this.button4);
|
||||
this.Controls.Add(this.ResetCurvePoints);
|
||||
this.Controls.Add(this.button3);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.CurvePointsTextbox);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.pictureBoxFanCurve);
|
||||
this.Controls.Add(this.labelCPUTemp);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.RefreshCPUTemp);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.labelRPM);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.RefreshFanRPM);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.labelValue);
|
||||
this.Controls.Add(this.label1);
|
||||
@@ -597,21 +614,20 @@
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label labelValue;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button RefreshFanRPM;
|
||||
private System.Windows.Forms.Label labelRPM;
|
||||
private System.Windows.Forms.Label labelCPUTemp;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button RefreshCPUTemp;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemTurnOffControlOnExit;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemForbidUnsafeSettings;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemCheckForUpdates;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.PictureBox pictureBoxFanCurve;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.RadioButton fanCurve;
|
||||
private System.Windows.Forms.RadioButton fanControl;
|
||||
private System.Windows.Forms.RadioButton fanCurveRadioButton;
|
||||
private System.Windows.Forms.RadioButton fanControlRadioButton;
|
||||
private System.Windows.Forms.ToolTip toolTip1;
|
||||
private System.Windows.Forms.NotifyIcon notifyIcon1;
|
||||
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
|
||||
@@ -627,9 +643,9 @@
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.NumericUpDown numericUpDown2;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.TextBox CurvePointsTextbox;
|
||||
private System.Windows.Forms.Button button3;
|
||||
private System.Windows.Forms.Button button4;
|
||||
private System.Windows.Forms.Button ResetCurvePoints;
|
||||
private System.Windows.Forms.ToolStripMenuItem allowFanCurveSettingViaTextToolStripMenuItem;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
|
||||
@@ -639,6 +655,8 @@
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.ToolStripMenuItem restartApplicationToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem resetToDefaultsToolStripMenuItem;
|
||||
private System.Windows.Forms.Label InvisibleLabel;
|
||||
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,34 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Security.AccessControl;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using AsusFanControl;
|
||||
using AsusFanControlGUI.Properties;
|
||||
using Microsoft.Win32;
|
||||
using static System.Security.Cryptography.ECCurve;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
using static AsusFanControlGUI.Form1;
|
||||
using LibreHardwareMonitor.Hardware;
|
||||
using System.Management;
|
||||
using System;
|
||||
using AsusFanControl.Domain.services;
|
||||
|
||||
namespace AsusFanControlGUI
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
// Dependency injection
|
||||
private readonly FanCurve _fanCurve;
|
||||
|
||||
private readonly Random rnd = new Random();
|
||||
readonly AsusControl asusControl = new AsusControl();
|
||||
int currentFanSpeed = 0;
|
||||
int currentFanRPM = 0;
|
||||
ulong currentTemp = 0;
|
||||
|
||||
public Form1()
|
||||
int temperatureLowerBound = 20;
|
||||
int temperatureUpperBound = 105;
|
||||
|
||||
int fanSpeedLowerBound = 1;
|
||||
int fanSpeedUpperBound = 100;
|
||||
|
||||
public Form1(
|
||||
FanCurve fanCurve
|
||||
)
|
||||
{
|
||||
_fanCurve = fanCurve;
|
||||
|
||||
InitializeComponent();
|
||||
AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnProcessExit);
|
||||
|
||||
@@ -42,94 +51,142 @@ namespace AsusFanControlGUI
|
||||
{
|
||||
if (IsHandleCreated)
|
||||
{
|
||||
startErrorHandler();
|
||||
|
||||
toolStripMenuItemTurnOffControlOnExit.Checked = Properties.Settings.Default.turnOffControlOnExit;
|
||||
// Load settings from the settings file
|
||||
//toolStripMenuItemTurnOffControlOnExit.Checked = Properties.Settings.Default.turnOffControlOnExit;
|
||||
toolStripMenuItemForbidUnsafeSettings.Checked = Properties.Settings.Default.forbidUnsafeSettings;
|
||||
startMinimisedToolStripMenuItem.Checked = Properties.Settings.Default.startMinimised;
|
||||
startWithWindowsToolStripMenuItem.Checked = Properties.Settings.Default.startWithWindows;
|
||||
//startWithWindowsToolStripMenuItem.Checked = Properties.Settings.Default.startWithWindows;
|
||||
checkIfAppIsInStartup();
|
||||
trackBarFanSpeed.Value = Properties.Settings.Default.fanSpeed;
|
||||
radioButton1.Checked = Properties.Settings.Default.fanControlState == "Off";
|
||||
fanControl.Checked = Properties.Settings.Default.fanControlState == "Manual";
|
||||
fanCurve.Checked = Properties.Settings.Default.fanControlState == "Curve";
|
||||
fanControlRadioButton.Checked = Properties.Settings.Default.fanControlState == "Manual";
|
||||
fanCurveRadioButton.Checked = Properties.Settings.Default.fanControlState == "Curve";
|
||||
allowFanCurveSettingViaTextToolStripMenuItem.Checked = Properties.Settings.Default.allowFanCurveSettingViaText;
|
||||
numericUpDown1.Value = Properties.Settings.Default.hysteresis;
|
||||
numericUpDown2.Value = Properties.Settings.Default.updateSpeed;
|
||||
// Manually trigger events
|
||||
radioButton1_CheckedChanged(radioButton1, EventArgs.Empty);
|
||||
fanCurve_CheckedChanged(fanCurve, EventArgs.Empty);
|
||||
fanControl_CheckedChanged(fanControl, EventArgs.Empty);
|
||||
fanCurve_CheckedChanged(fanCurveRadioButton, EventArgs.Empty);
|
||||
fanControl_CheckedChanged(fanControlRadioButton, EventArgs.Empty);
|
||||
allowFanCurveSettingViaTextToolStripMenuItem_Click(allowFanCurveSettingViaTextToolStripMenuItem, EventArgs.Empty);
|
||||
|
||||
Properties.Settings.Default.PropertyChanged += (sender, e) =>
|
||||
{
|
||||
if (e.PropertyName == "FanCurvePoints")
|
||||
{
|
||||
textBox1.Text = Properties.Settings.Default.FanCurvePoints;
|
||||
CurvePointsTextbox.Text = Properties.Settings.Default.FanCurvePoints;
|
||||
}
|
||||
};
|
||||
SetFanCurvePoints(null);
|
||||
//SetFanCurvePoints("20,1;60,1;61,20;70,20;71,30;80,55");
|
||||
Timer_Tick();
|
||||
SetFanCurvePoints(Properties.Settings.Default.FanCurvePoints);
|
||||
AutoRefreshStats();
|
||||
startErrorHandler(temperatureLowerBound, temperatureUpperBound);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Restart the init function after a short delay
|
||||
await System.Threading.Tasks.Task.Delay(20);
|
||||
await Task.Delay(20);
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
private async void startErrorHandler()
|
||||
public void checkForNewVersion()
|
||||
{
|
||||
int minTemp = 1;
|
||||
int maxTemp = 200;
|
||||
Console.WriteLine("Running");
|
||||
if ((fanCurve.Checked || fanControl.Checked) && (currentTemp < (ulong)minTemp || currentTemp > (ulong)maxTemp))
|
||||
{
|
||||
// Give it a second chance
|
||||
await Task.Delay(1000);
|
||||
ulong temp = await Task.Run(() => asusControl.Thermal_Read_Cpu_Temperature());
|
||||
if (temp >= (ulong)minTemp && temp < (ulong)maxTemp)
|
||||
{
|
||||
return;
|
||||
// Check for new version
|
||||
// If new version is available, show a notification
|
||||
// If the user clicks on the notification, open the download page in the default web browser
|
||||
// https://github.com/Darren80/AsusFanControlEnhanced/releases
|
||||
}
|
||||
|
||||
private async void startErrorHandler(int minTemp, int maxTemp, bool debug = false)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
// Wait for X seconds
|
||||
await Task.Delay(3000);
|
||||
|
||||
// Check if the CPU temperature is outside of the good range
|
||||
// Out of bounds values
|
||||
|
||||
Console.WriteLine($"Current temp: {currentTemp}");
|
||||
if ((currentTemp < (ulong)minTemp || currentTemp > (ulong)maxTemp) || debug)
|
||||
{
|
||||
Console.WriteLine("Error!");
|
||||
|
||||
Properties.Settings.Default.wasError = true;
|
||||
Properties.Settings.Default.errorMsg = $"CPU temprature were outside of good range at {currentTemp}°C, either something has not loaded properly or CPU sensors are faulty.";
|
||||
string errorMsg = $"CPU temprature is outside of good range at {currentTemp}°C. \n" +
|
||||
$"Maybe try restarting the application? Options -> Restart application";
|
||||
Properties.Settings.Default.errorMsg = errorMsg;
|
||||
Properties.Settings.Default.Save();
|
||||
Console.WriteLine("Restarting");
|
||||
Application.Restart();
|
||||
Environment.Exit(0);
|
||||
|
||||
Console.WriteLine(errorMsg);
|
||||
InvisibleLabel.Text = errorMsg;
|
||||
InvisibleLabel.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
InvisibleLabel.Text = "";
|
||||
InvisibleLabel.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async void Timer_Tick()
|
||||
}
|
||||
|
||||
public async Task updateFanRPMLabel()
|
||||
{
|
||||
var speeds = await Task.Run(() => asusControl.GetFanSpeeds());
|
||||
Console.WriteLine($"Fan speeds: {string.Join(" ", speeds)}");
|
||||
labelRPM.Text = string.Join(" ", speeds);
|
||||
}
|
||||
|
||||
public async Task updateCPUTempLabel()
|
||||
{
|
||||
var temp = await Task.Run(() => asusControl.Thermal_Read_Cpu_Temperature());
|
||||
Console.WriteLine($"CPU temp: {temp}");
|
||||
currentTemp = temp;
|
||||
labelCPUTemp.Text = $"{temp}";
|
||||
}
|
||||
|
||||
private async void AutoRefreshStats()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if (WindowState == FormWindowState.Minimized)
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
Timer_Tick();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
await Task.Delay(500);
|
||||
}
|
||||
|
||||
//Console.WriteLine($"Refreshing {rnd.Next(100)}");
|
||||
Console.WriteLine($"Refreshing stats");
|
||||
|
||||
// Update fan speeds and CPU temperature.
|
||||
// Run both tasks concurrently
|
||||
Task<string> fanSpeedsTask = Task.Run(() => string.Join(" ", asusControl.GetFanSpeeds()));
|
||||
Task<string> cpuTempTask = Task.Run(() => $"{asusControl.Thermal_Read_Cpu_Temperature()}");
|
||||
|
||||
// Wait for both tasks to complete
|
||||
await Task.WhenAll(fanSpeedsTask, cpuTempTask);
|
||||
await Task.WhenAll(updateFanRPMLabel(), updateCPUTempLabel());
|
||||
}
|
||||
}
|
||||
|
||||
// Get the results from the completed tasks
|
||||
labelRPM.Text = fanSpeedsTask.Result;
|
||||
labelCPUTemp.Text = cpuTempTask.Result;
|
||||
currentTemp = (ulong)Decimal.Parse(cpuTempTask.Result);
|
||||
startErrorHandler();
|
||||
private void checkIfAppIsInStartup()
|
||||
{
|
||||
string appName = Assembly.GetExecutingAssembly().GetName().Name;
|
||||
|
||||
await Task.Delay(250);
|
||||
Timer_Tick();
|
||||
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
|
||||
startWithWindowsToolStripMenuItem.Checked = registryKey.GetValue(appName) != null;
|
||||
|
||||
// If app name is in startup, but app path does not match the current app path, update the startup entry
|
||||
if (startWithWindowsToolStripMenuItem.Checked)
|
||||
{
|
||||
string appPath = Assembly.GetExecutingAssembly().Location;
|
||||
string registryValue = registryKey.GetValue(appName).ToString();
|
||||
if (registryValue != appPath)
|
||||
{
|
||||
Console.WriteLine("Updating startup entry");
|
||||
registryKey.SetValue(appName, appPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AddToStartup()
|
||||
@@ -157,8 +214,8 @@ namespace AsusFanControlGUI
|
||||
|
||||
private void toolStripMenuItemTurnOffControlOnExit_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.turnOffControlOnExit = toolStripMenuItemTurnOffControlOnExit.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
//Properties.Settings.Default.turnOffControlOnExit = toolStripMenuItemTurnOffControlOnExit.Checked;
|
||||
//Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
private void toolStripMenuItemForbidUnsafeSettings_CheckedChanged(object sender, EventArgs e)
|
||||
@@ -172,6 +229,19 @@ namespace AsusFanControlGUI
|
||||
System.Diagnostics.Process.Start("https://github.com/Darren80/AsusFanControlEnhanced/releases");
|
||||
}
|
||||
|
||||
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Get version number
|
||||
string version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
MessageBox.Show($"AsusFanControlEnhanced\n\nVersion: {version}\n\nAuthor: Darren80\n\nhttps://github.com/Darren80/AsusFanControlEnhanced", "About AsusFanControlEnhanced");
|
||||
}
|
||||
|
||||
private void setNotifyIconText(string text)
|
||||
{
|
||||
Console.WriteLine($"Setting notify icon text to: {text}");
|
||||
notifyIcon1.Text = text;
|
||||
}
|
||||
|
||||
private void radioButton1_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (radioButton1.Checked)
|
||||
@@ -179,14 +249,14 @@ namespace AsusFanControlGUI
|
||||
Properties.Settings.Default.fanControlState = "Off";
|
||||
Properties.Settings.Default.Save();
|
||||
|
||||
notifyIcon1.Text = $"AsusFanControlEnhanced - Off";
|
||||
setNotifyIconText("AsusFanControlEnhanced - Off");
|
||||
setFanSpeed(0, null);
|
||||
}
|
||||
}
|
||||
|
||||
private async void fanControl_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (fanControl.Checked)
|
||||
if (fanControlRadioButton.Checked)
|
||||
{
|
||||
Properties.Settings.Default.fanControlState = "Manual";
|
||||
Properties.Settings.Default.Save();
|
||||
@@ -206,11 +276,11 @@ namespace AsusFanControlGUI
|
||||
bool firstRun = true;
|
||||
private async void setFanSpeed(int value, bool? xyz)
|
||||
{
|
||||
if (currentFanSpeed == value)
|
||||
if (currentFanRPM == value)
|
||||
return;
|
||||
|
||||
await Task.Run(() => asusControl.SetFanSpeeds(value));
|
||||
currentFanSpeed = value;
|
||||
currentFanRPM = value;
|
||||
|
||||
if (value == 0)
|
||||
labelValue.Text = "turned off";
|
||||
@@ -220,7 +290,7 @@ namespace AsusFanControlGUI
|
||||
if (firstRun)
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
currentFanSpeed = 999999;
|
||||
currentFanRPM = 999999;
|
||||
setFanSpeed(value, null);
|
||||
firstRun = false;
|
||||
}
|
||||
@@ -243,11 +313,11 @@ namespace AsusFanControlGUI
|
||||
label5.Text = trackBarFanSpeedValue.ToString() + "% Fan";
|
||||
Console.WriteLine($"Setting speed to: {(int)trackBarFanSpeedValue}");
|
||||
label3.Text = $"Setting speed to: {(int)trackBarFanSpeedValue}%";// (Stamp: {rnd.Next(1000)})";
|
||||
notifyIcon1.Text = $"AsusFanControlEnhanced - Fan Speed: {(int)trackBarFanSpeedValue}%";
|
||||
setNotifyIconText($"Fan RPM: {(int)trackBarFanSpeedValue}% - Temp: {currentTemp}°C");
|
||||
if ((int)trackBarFanSpeedValue == 0)
|
||||
notifyIcon1.Text = $"AsusFanControlEnhanced - Off";
|
||||
setNotifyIconText("AsusFanControlEnhanced - Off");
|
||||
|
||||
setFanSpeed((int)trackBarFanSpeedValue, fanControl.Checked);
|
||||
setFanSpeed((int)trackBarFanSpeedValue, fanControlRadioButton.Checked);
|
||||
}
|
||||
|
||||
private void trackBarFanSpeed_KeyUp(object sender, KeyEventArgs e)
|
||||
@@ -269,12 +339,9 @@ namespace AsusFanControlGUI
|
||||
ulong temp = await Task.Run(() => asusControl.Thermal_Read_Cpu_Temperature());
|
||||
currentTemp = temp;
|
||||
labelCPUTemp.Text = $"{temp}";
|
||||
startErrorHandler();
|
||||
startErrorHandler(temperatureLowerBound, temperatureUpperBound);
|
||||
}
|
||||
|
||||
// My Code:
|
||||
private Point maxPoint;
|
||||
private Point minPoint;
|
||||
private Dictionary<int, Point> fanCurvePoints = new Dictionary<int, Point>()
|
||||
{
|
||||
{ 1, new Point(20, 1) },
|
||||
@@ -284,15 +351,6 @@ namespace AsusFanControlGUI
|
||||
{ 8, new Point(71, 30) },
|
||||
{ 9, new Point(80, 55) },
|
||||
};
|
||||
private Timer fanCurveTimer; // Declare the timer as a class-level variable
|
||||
|
||||
// Set up the graph dimensions
|
||||
const int padding = 40;
|
||||
|
||||
// Draw the temperature axis and labels
|
||||
const int tempMin = 20;
|
||||
const int tempMax = 100;
|
||||
const int tempInterval = 10;
|
||||
|
||||
private void pictureBoxFanCurve_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
@@ -364,8 +422,29 @@ namespace AsusFanControlGUI
|
||||
private void pictureBoxFanCurve_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
(int temperature, int fanSpeed) = mousePosition(e.Location);
|
||||
(int temperature, int fanSpeed) = convertMousePositionToTemperatureAndFanSpeed(e.Location);
|
||||
|
||||
if (temperature < temperatureLowerBound || temperature > temperatureUpperBound)
|
||||
{
|
||||
temperature = Math.Max(temperatureLowerBound, Math.Min(temperature, temperatureUpperBound));
|
||||
}
|
||||
if (fanSpeed < fanSpeedLowerBound || fanSpeed > fanSpeedUpperBound)
|
||||
{
|
||||
fanSpeed = Math.Max(fanSpeedLowerBound, Math.Min(fanSpeed, fanSpeedUpperBound));
|
||||
}
|
||||
|
||||
// If a point already exists at the same temperature, update its fan speed
|
||||
foreach (KeyValuePair<int, Point> point in fanCurvePoints)
|
||||
{
|
||||
if (point.Value.X == temperature)
|
||||
{
|
||||
fanCurvePoints[point.Key] = new Point(temperature, fanSpeed);
|
||||
pictureBoxFanCurve.Invalidate(); // Redraw the graph
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the maximum number of points has been reached
|
||||
if (fanCurvePoints.Count >= 20)
|
||||
{
|
||||
MessageBox.Show("Maximum number of points reached.");
|
||||
@@ -387,7 +466,7 @@ namespace AsusFanControlGUI
|
||||
|
||||
private int selectedPointId = 0;
|
||||
|
||||
private (int temperature, int fanSpeed) mousePosition(Point e)
|
||||
private (int temperature, int fanSpeed) convertMousePositionToTemperatureAndFanSpeed(Point e)
|
||||
{
|
||||
// Set up the graph dimensions
|
||||
int padding = 40;
|
||||
@@ -409,7 +488,7 @@ namespace AsusFanControlGUI
|
||||
private KeyValuePair<int, Point> nearestPointToMouse(MouseEventArgs e, int maxDistance)
|
||||
{
|
||||
|
||||
(int temperature, int fanSpeed) = mousePosition(e.Location);
|
||||
(int temperature, int fanSpeed) = convertMousePositionToTemperatureAndFanSpeed(e.Location);
|
||||
|
||||
|
||||
var nearestPoints = fanCurvePoints
|
||||
@@ -466,7 +545,7 @@ namespace AsusFanControlGUI
|
||||
if (selectedPointId != 0)
|
||||
{
|
||||
// Get mouse location on grid
|
||||
(int temperature, int fanSpeed) = mousePosition(e.Location);
|
||||
(int temperature, int fanSpeed) = convertMousePositionToTemperatureAndFanSpeed(e.Location);
|
||||
|
||||
if (temperature < minimumTemperature || temperature > maximumTemperature)
|
||||
{
|
||||
@@ -492,7 +571,7 @@ namespace AsusFanControlGUI
|
||||
{
|
||||
selectedPointId = 0;
|
||||
toolTip1.SetToolTip(pictureBoxFanCurve, "Fan Curve Graph");
|
||||
SaveFanCurvePoints();
|
||||
SaveFanCurvePoints(fanCurvePoints);
|
||||
runFanCurve(true, true);
|
||||
|
||||
// fanCurvePoints.ToList().ForEach(point => Console.Write($"ID: {point.Key}, X: {point.Value.X}, Y: {point.Value.Y}"));
|
||||
@@ -510,7 +589,7 @@ namespace AsusFanControlGUI
|
||||
{
|
||||
Properties.Settings.Default.fanControlState = "Curve";
|
||||
Properties.Settings.Default.Save();
|
||||
Console.WriteLine(fanCurve.Checked);
|
||||
Console.WriteLine(fanCurveRadioButton.Checked);
|
||||
runFanCurve();
|
||||
}
|
||||
|
||||
@@ -541,7 +620,7 @@ namespace AsusFanControlGUI
|
||||
// Temperature is outside the range, yield control to the system.
|
||||
label3.Text = "Control yeilded to system when temprature is outside range.";
|
||||
Console.WriteLine("Temperature is outside the range, yield control to the system.");
|
||||
notifyIcon1.Text = $"AsusFanControlEnhanced - Off";
|
||||
setNotifyIconText("AsusFanControlEnhanced - Off");
|
||||
return 0;
|
||||
}else
|
||||
{
|
||||
@@ -554,24 +633,19 @@ namespace AsusFanControlGUI
|
||||
|
||||
private async void runFanCurve(bool bypassHysteresisCheck=false, bool runOnce=false)
|
||||
{
|
||||
if (!fanCurve.Checked)
|
||||
if (!fanCurveRadioButton.Checked)
|
||||
{
|
||||
label3.Text = $"";
|
||||
return;
|
||||
}
|
||||
//Console.WriteLine("Fan Curve, " + (int)numericUpDown2.Value);
|
||||
|
||||
// Read the current temperature
|
||||
ulong temp = await Task.Run(() => asusControl.Thermal_Read_Cpu_Temperature()); // Implement the ReadTemperature method to get the current temperature
|
||||
currentTemp = temp;
|
||||
startErrorHandler();
|
||||
//Console.WriteLine("Temp, " + currentTemp);
|
||||
|
||||
double fanSpeed = CalculateFanSpeed(temp);
|
||||
double fanSpeed = CalculateFanSpeed(currentTemp);
|
||||
|
||||
// Apply hysteresis to prevent rapid fan speed changes
|
||||
int hysteresis = (int)numericUpDown1.Value; // Adjust the hysteresis value as needed
|
||||
if ((int)temp > lastTemperature + hysteresis || (int)temp < lastTemperature - hysteresis || fanSpeed < 10 || bypassHysteresisCheck)
|
||||
if ((int)currentTemp > lastTemperature + hysteresis || (int)currentTemp < lastTemperature - hysteresis || fanSpeed < 10 || bypassHysteresisCheck)
|
||||
{
|
||||
// Update the fan speed
|
||||
fanSpeed = Math.Max(0, Math.Min(100, fanSpeed));
|
||||
@@ -580,10 +654,10 @@ namespace AsusFanControlGUI
|
||||
Console.WriteLine($"Set fan speed to {(int)fanSpeed}% {rnd.Next(1000)}, last fan speed = {lastTemperature}");
|
||||
if (fanSpeed != 0)
|
||||
{
|
||||
label3.Text = $"Set fan speed to {(int)fanSpeed}%, current temp: {temp}°C";// (Stamp: {rnd.Next(1000)})";
|
||||
notifyIcon1.Text = $"AsusFanControlEnhanced - Current Temp: {(int)temp}°C - Fan Speed: {(int)fanSpeed}%";
|
||||
label3.Text = $"Set fan speed to {(int)fanSpeed}%, current temp: {currentTemp}°C";// (Stamp: {rnd.Next(1000)})";
|
||||
setNotifyIconText($"Fan RPM: {(int)fanSpeed}% - Temp: {currentTemp}°C");
|
||||
}
|
||||
lastTemperature = (int)temp;
|
||||
lastTemperature = (int)currentTemp;
|
||||
|
||||
}
|
||||
|
||||
@@ -597,8 +671,6 @@ namespace AsusFanControlGUI
|
||||
// Keep track of the last fan speed to apply hysteresis
|
||||
private int lastTemperature = 0;
|
||||
|
||||
|
||||
|
||||
private void Form1_Resize(object sender, EventArgs e)
|
||||
{
|
||||
if (WindowState == FormWindowState.Minimized)
|
||||
@@ -637,9 +709,13 @@ namespace AsusFanControlGUI
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveFanCurvePoints()
|
||||
private void SaveFanCurvePoints(Dictionary<int, Point> _fanCurvePoints)
|
||||
{
|
||||
string fanCurvePointsString = string.Join("-", fanCurvePoints.OrderBy(x => x.Value.X).Select(x => $"{x.Value.X},{x.Value.Y}"));
|
||||
// Save to state
|
||||
fanCurvePoints = _fanCurvePoints;
|
||||
|
||||
// Convert the fan curve points to a string
|
||||
string fanCurvePointsString = string.Join("-", _fanCurvePoints.OrderBy(x => x.Value.X).Select(x => $"{x.Value.X},{x.Value.Y}"));
|
||||
|
||||
Properties.Settings.Default.FanCurvePoints = fanCurvePointsString;
|
||||
Properties.Settings.Default.Save();
|
||||
@@ -647,56 +723,52 @@ namespace AsusFanControlGUI
|
||||
Console.WriteLine(fanCurvePointsString);
|
||||
}
|
||||
|
||||
private void SetFanCurvePoints(String? fanCurveString)
|
||||
private void SetFanCurvePoints(String fanCurvePointsString)
|
||||
{
|
||||
int count = 1;
|
||||
string fanCurvePointsString = fanCurveString ?? Properties.Settings.Default.FanCurvePoints;
|
||||
Console.WriteLine(fanCurvePointsString);
|
||||
|
||||
if (string.IsNullOrEmpty(fanCurvePointsString))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Parse the string
|
||||
Dictionary<int, Point> fanCurvePointsDictionaryFromString;
|
||||
try
|
||||
{
|
||||
|
||||
fanCurvePoints = fanCurvePointsString.Split('-')
|
||||
.Select(x =>
|
||||
{
|
||||
string[] parts = x.Split(',');
|
||||
return new KeyValuePair<int, Point>(count++, new Point(int.Parse(parts[0]), int.Parse(parts[1])));
|
||||
})
|
||||
.ToDictionary(x => x.Key, x => x.Value);
|
||||
|
||||
//Save
|
||||
textBox1.Text = fanCurvePointsString;
|
||||
SaveFanCurvePoints();
|
||||
fanCurvePointsDictionaryFromString = _fanCurve.convertStringToPointsDictionary(
|
||||
fanCurvePointsString, temperatureLowerBound, temperatureUpperBound, fanSpeedLowerBound, fanSpeedUpperBound
|
||||
);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Show the error message and stack trace in a MessageBox
|
||||
//MessageBox.Show($"An error occurred: {ex.Message}\n\nStack Trace:\n{ex.StackTrace}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
throw;
|
||||
}
|
||||
|
||||
//Save
|
||||
// CurvePointsTextbox.Text = fanCurvePointsString;
|
||||
SaveFanCurvePoints(fanCurvePointsDictionaryFromString);
|
||||
|
||||
pictureBoxFanCurve.Invalidate();
|
||||
}
|
||||
|
||||
private void button4_Click(object sender, EventArgs e)
|
||||
{
|
||||
textBox1.Text = Properties.Settings.Default.FanCurvePoints;
|
||||
SetFanCurvePoints(null);
|
||||
try
|
||||
{
|
||||
SetFanCurvePoints(Properties.Settings.Default.DefaultFanCurvePoints);
|
||||
CurvePointsTextbox.Text = Properties.Settings.Default.DefaultFanCurvePoints;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void button3_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
SetFanCurvePoints(textBox1.Text);
|
||||
SetFanCurvePoints(CurvePointsTextbox.Text);
|
||||
MessageBox.Show("Save successful.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("An error occurred: " + ex.Message);
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -714,12 +786,12 @@ namespace AsusFanControlGUI
|
||||
|
||||
try
|
||||
{
|
||||
SetFanCurvePoints(textBox1.Text);
|
||||
SetFanCurvePoints(CurvePointsTextbox.Text);
|
||||
MessageBox.Show("Save successful.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("An error occurred: " + ex.Message);
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -729,19 +801,19 @@ namespace AsusFanControlGUI
|
||||
{
|
||||
Properties.Settings.Default.allowFanCurveSettingViaText = true;
|
||||
Properties.Settings.Default.Save();
|
||||
button3.Enabled = true; textBox1.ReadOnly = false; button4.Enabled = true;
|
||||
button3.Enabled = true; CurvePointsTextbox.ReadOnly = false; //ResetCurvePoints.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Properties.Settings.Default.allowFanCurveSettingViaText = false;
|
||||
Properties.Settings.Default.Save();
|
||||
button3.Enabled = false; textBox1.ReadOnly = true; button4.Enabled = false;
|
||||
button3.Enabled = false; CurvePointsTextbox.ReadOnly = true; //ResetCurvePoints.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void textBox1_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
toolTip1.Show(textBox1.Text, textBox1);
|
||||
toolTip1.Show(CurvePointsTextbox.Text, CurvePointsTextbox);
|
||||
}
|
||||
|
||||
private void startWithWindowsToolStripMenuItem1_Click_1(object sender, EventArgs e)
|
||||
@@ -750,6 +822,7 @@ namespace AsusFanControlGUI
|
||||
{
|
||||
Properties.Settings.Default.startWithWindows = true;
|
||||
Properties.Settings.Default.Save();
|
||||
RemoveFromStartup();
|
||||
AddToStartup();
|
||||
}
|
||||
else
|
||||
@@ -791,7 +864,7 @@ namespace AsusFanControlGUI
|
||||
Console.WriteLine($"asdad: {Properties.Settings.Default.wasError}");
|
||||
if (Properties.Settings.Default.wasError == true)
|
||||
{
|
||||
MessageBox.Show($"An error caused the application to restart:\n\nError: {Properties.Settings.Default.errorMsg}");
|
||||
//MessageBox.Show($"An error caused the application to restart:\n\nError: {Properties.Settings.Default.errorMsg}");
|
||||
Properties.Settings.Default.wasError = false;
|
||||
Properties.Settings.Default.errorMsg = "";
|
||||
Properties.Settings.Default.Save();
|
||||
@@ -805,7 +878,6 @@ namespace AsusFanControlGUI
|
||||
|
||||
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (Properties.Settings.Default.turnOffControlOnExit)
|
||||
asusControl.SetFanSpeeds(0);
|
||||
}
|
||||
|
||||
@@ -853,6 +925,58 @@ namespace AsusFanControlGUI
|
||||
}
|
||||
}
|
||||
|
||||
public static double GetCpuTemperature()
|
||||
{
|
||||
try
|
||||
{
|
||||
// Create a ManagementObjectSearcher to query WMI
|
||||
ManagementObjectSearcher searcher = new ManagementObjectSearcher(@"root\WMI", "SELECT * FROM MSAcpi_ThermalZoneTemperature");
|
||||
|
||||
// Iterate through the results
|
||||
foreach (ManagementObject obj in searcher.Get())
|
||||
{
|
||||
// The temperature is given in tenths of Kelvin. Convert to Celsius.
|
||||
double temperature = Convert.ToDouble(obj["CurrentTemperature"].ToString());
|
||||
temperature = (temperature / 10.0) - 273.15;
|
||||
|
||||
return temperature;
|
||||
}
|
||||
}
|
||||
catch (ManagementException e)
|
||||
{
|
||||
Console.WriteLine("An error occurred while querying for WMI data: " + e.Message);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("An unexpected error occurred: " + e.Message);
|
||||
}
|
||||
|
||||
// Return 0 if no temperature data is found or an error occurs
|
||||
return 0;
|
||||
}
|
||||
|
||||
private void InvisibleLabel_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void backgroundWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void contextMenuStrip1_Opening(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void toolStripMenuItemTurnOffControlOnExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//notifyIcon1.BalloonTipText = string.Join(" ", asusControl.GetFanSpeeds()) + $" Temp: {asusControl.Thermal_Read_Cpu_Temperature()}"; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
using System;
|
||||
using AsusFanControl.Domain.services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.Threading;
|
||||
using System.Configuration;
|
||||
using System.Text;
|
||||
|
||||
namespace AsusFanControlGUI
|
||||
{
|
||||
@@ -16,7 +21,142 @@ namespace AsusFanControlGUI
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
|
||||
// Subscribe to unhandled exception events
|
||||
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
|
||||
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
|
||||
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
||||
|
||||
// Simulate an unhandled exception on the UI thread
|
||||
//throw new InvalidOperationException("Simulated UI thread exception");
|
||||
|
||||
// Configure the DI container
|
||||
var serviceProvider = ConfigureServices();
|
||||
|
||||
// Resolve the main form and run the application
|
||||
using (var form = serviceProvider.GetRequiredService<Form1>())
|
||||
{
|
||||
Application.Run(form);
|
||||
}
|
||||
}
|
||||
|
||||
private static IServiceProvider ConfigureServices()
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
|
||||
// Register domain layer
|
||||
services.AddSingleton<FanCurve>();
|
||||
|
||||
// Register application layer
|
||||
|
||||
// Register infrastructure layer
|
||||
|
||||
// Register presentation layer
|
||||
services.AddSingleton<Form1>();
|
||||
|
||||
return services.BuildServiceProvider();
|
||||
}
|
||||
|
||||
static string GetApplicationSettings()
|
||||
{
|
||||
StringBuilder settings = new StringBuilder();
|
||||
foreach (SettingsProperty property in Properties.Settings.Default.Properties)
|
||||
{
|
||||
settings.AppendLine($"{property.Name}: {Properties.Settings.Default[property.Name]}");
|
||||
}
|
||||
return settings.ToString();
|
||||
}
|
||||
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
|
||||
{
|
||||
ShowErrorDialog(e.Exception);
|
||||
}
|
||||
|
||||
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
ShowErrorDialog(e.ExceptionObject as Exception);
|
||||
}
|
||||
|
||||
static void ShowErrorDialog(Exception ex)
|
||||
{
|
||||
// Get the current state of application settings
|
||||
string settings = GetApplicationSettings();
|
||||
|
||||
// Build the message
|
||||
string message = $"An error occured, please try restarting the application.\n\n" +
|
||||
"If the error persists then create a GitHub issue at:\n" +
|
||||
"https://github.com/Darren80/AsusFanControlEnhanced/issues if one does not already exist \n\n" +
|
||||
$"Stack Trace:\n{ex.StackTrace}\n\n" +
|
||||
$"Application Settings:\n{settings}\n\n" +
|
||||
$"Error Message:\n{ex.Message}\n\n";
|
||||
|
||||
// Create a custom form to display the error message with scroll bars
|
||||
using (var form = new Form())
|
||||
{
|
||||
form.Text = "Unhandled Exception - AsusFanControlEnhanced";
|
||||
form.Size = new System.Drawing.Size(600, 400);
|
||||
form.StartPosition = FormStartPosition.CenterScreen;
|
||||
//form.Icon = Properties.Resources.ResourceManager.GetObject("AppIcon") as System.Drawing.Icon;
|
||||
|
||||
// Add a RichTextBox to display the message with scroll bars
|
||||
var textBox = new RichTextBox
|
||||
{
|
||||
Text = message,
|
||||
ReadOnly = true,
|
||||
Dock = DockStyle.Fill,
|
||||
ScrollBars = RichTextBoxScrollBars.Vertical,
|
||||
Font = new System.Drawing.Font("Consolas", 9.75f) // Use a monospaced font for better readability
|
||||
};
|
||||
|
||||
// Add Restart and Exit buttons
|
||||
var restartButton = new Button
|
||||
{
|
||||
Text = "Restart",
|
||||
DialogResult = DialogResult.Yes,
|
||||
Dock = DockStyle.Bottom
|
||||
};
|
||||
|
||||
var exitButton = new Button
|
||||
{
|
||||
Text = "Exit",
|
||||
DialogResult = DialogResult.No,
|
||||
Dock = DockStyle.Bottom
|
||||
};
|
||||
|
||||
// Add controls to the form
|
||||
form.Controls.Add(textBox);
|
||||
form.Controls.Add(restartButton);
|
||||
form.Controls.Add(exitButton);
|
||||
|
||||
// Handle button clicks
|
||||
form.AcceptButton = restartButton;
|
||||
form.CancelButton = exitButton;
|
||||
|
||||
// Show the form and handle the result
|
||||
DialogResult result = form.ShowDialog();
|
||||
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
// Restart the application
|
||||
RestartApplication();
|
||||
}
|
||||
else if (result == DialogResult.No)
|
||||
{
|
||||
// Exit the application
|
||||
Environment.Exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void RestartApplication()
|
||||
{
|
||||
// Reset application properties
|
||||
Properties.Settings.Default.Reset();
|
||||
Properties.Settings.Default.Save();
|
||||
|
||||
// Restart the application
|
||||
string applicationPath = Application.ExecutablePath;
|
||||
System.Diagnostics.Process.Start(applicationPath);
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyVersion("1.2.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.2.0.0")]
|
||||
|
||||
14
AsusFanControlGUI/Properties/Settings.Designer.cs
generated
14
AsusFanControlGUI/Properties/Settings.Designer.cs
generated
@@ -73,7 +73,7 @@ namespace AsusFanControlGUI.Properties {
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("20,1-60,1-61,20-70,20-71,30-80,55")]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("20,1-60,1-61,20-70,20-71,30-100,100-105,100")]
|
||||
public string FanCurvePoints {
|
||||
get {
|
||||
return ((string)(this["FanCurvePoints"]));
|
||||
@@ -166,5 +166,17 @@ namespace AsusFanControlGUI.Properties {
|
||||
this["errorMsg"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("20,1-60,1-61,20-70,20-71,30-100,100-105,100")]
|
||||
public string DefaultFanCurvePoints {
|
||||
get {
|
||||
return ((string)(this["DefaultFanCurvePoints"]));
|
||||
}
|
||||
set {
|
||||
this["DefaultFanCurvePoints"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<Value Profile="(Default)">Off</Value>
|
||||
</Setting>
|
||||
<Setting Name="FanCurvePoints" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">20,1-60,1-61,20-70,20-71,30-80,55</Value>
|
||||
<Value Profile="(Default)">20,1-60,1-61,20-70,20-71,30-100,100-105,100</Value>
|
||||
</Setting>
|
||||
<Setting Name="allowFanCurveSettingViaText" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
@@ -38,5 +38,8 @@
|
||||
<Setting Name="errorMsg" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="DefaultFanCurvePoints" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">20,1-60,1-61,20-70,20-71,30-100,100-105,100</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
@@ -2,12 +2,18 @@
|
||||
<packages>
|
||||
<package id="Costura.Fody" version="5.7.0" targetFramework="net472" developmentDependency="true" />
|
||||
<package id="Fody" version="6.5.5" targetFramework="net472" developmentDependency="true" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="9.0.2" targetFramework="net481" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection" version="9.0.2" targetFramework="net481" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="9.0.2" targetFramework="net481" />
|
||||
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net472" />
|
||||
<package id="NETStandard.Library" version="1.6.1" targetFramework="net472" />
|
||||
<package id="Sentry" version="5.1.1" targetFramework="net481" />
|
||||
<package id="System.AppContext" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net481" />
|
||||
<package id="System.Collections" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Collections.Immutable" version="5.0.0" targetFramework="net481" />
|
||||
<package id="System.Console" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Diagnostics.DiagnosticSource" version="4.3.0" targetFramework="net472" />
|
||||
@@ -22,15 +28,19 @@
|
||||
<package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Linq" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Linq.Expressions" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Memory" version="4.5.4" targetFramework="net481" />
|
||||
<package id="System.Net.Http" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Net.Primitives" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Net.Sockets" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net481" />
|
||||
<package id="System.ObjectModel" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Reflection" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Reflection.Metadata" version="5.0.0" targetFramework="net481" />
|
||||
<package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Runtime" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net481" />
|
||||
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.Handles" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net472" />
|
||||
@@ -42,10 +52,14 @@
|
||||
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Text.Encoding" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Text.Encodings.Web" version="6.0.0" targetFramework="net481" />
|
||||
<package id="System.Text.Json" version="6.0.10" targetFramework="net481" />
|
||||
<package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Threading" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net481" />
|
||||
<package id="System.Threading.Timer" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net481" />
|
||||
<package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Xml.XDocument" version="4.3.0" targetFramework="net472" />
|
||||
</packages>
|
||||
12
ClassLibrary1/Class1.cs
Normal file
12
ClassLibrary1/Class1.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ClassLibrary1
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
}
|
||||
}
|
||||
54
ClassLibrary1/ClassLibrary1.csproj
Normal file
54
ClassLibrary1/ClassLibrary1.csproj
Normal file
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>63918cd4-92e1-4a6b-9c3e-e1f082a167c3</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ClassLibrary1</RootNamespace>
|
||||
<AssemblyName>ClassLibrary1</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System"/>
|
||||
|
||||
<Reference Include="System.Core"/>
|
||||
<Reference Include="System.Xml.Linq"/>
|
||||
<Reference Include="System.Data.DataSetExtensions"/>
|
||||
|
||||
|
||||
<Reference Include="Microsoft.CSharp"/>
|
||||
|
||||
<Reference Include="System.Data"/>
|
||||
|
||||
<Reference Include="System.Net.Http"/>
|
||||
|
||||
<Reference Include="System.Xml"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
36
ClassLibrary1/Properties/AssemblyInfo.cs
Normal file
36
ClassLibrary1/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ClassLibrary1")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ClassLibrary1")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2025")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("63918cd4-92e1-4a6b-9c3e-e1f082a167c3")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
35
README.md
35
README.md
@@ -1,12 +1,30 @@
|
||||
# Asus Fan Control
|
||||
# Download
|
||||
Go to [releases](../../releases).<br />
|
||||
Ensure you have the latest version.
|
||||
|
||||
# If your application has stopped working.
|
||||
1. Uninstall device driver "Asus System Control Interface V3", under Device Manager -> System Devices -> Asus System Control Interface V3
|
||||
2. Reinstall an older version [ASUSSystemControlInterfaceV3_3.1.38.0.exe](https://github.com/Karmel0x/AsusFanControl/releases/download/v5/ASUSSystemControlInterfaceV3_3.1.38.0.exe)
|
||||
3. Restart your computer.
|
||||
## Help! My application is not working.
|
||||
The most recent update to Asus System Control Interface (V3.1.41.0) has broken some Asus fan control softwares [#44 (comment)](https://github.com/Karmel0x/AsusFanControl/issues/44#issuecomment-2675958931). To restore functionality, you will need to downgrade to version (V3.1.38.0).
|
||||
|
||||
### Download
|
||||
Go to [releases](../../releases)
|
||||
<ins>Temporarily disable the driver update until a permanent fix is found:</ins>
|
||||
1. Disable 'Asus Update Checker 2.0' in Task Scheduler
|
||||

|
||||
|
||||
2. Open MyAsus, go to Settings, uncheck Automatic updates.
|
||||
|
||||
3. Open Powershell as an Administrator
|
||||
4. Run command `REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /f /v ExcludeWUDriversInQualityUpdate /t REG_DWORD /d 1`
|
||||
|
||||
<ins>Revert to the last known good driver:</ins>
|
||||
1. Go to "Asus System Control Interface V3", under Device Manager -> System Devices -> Asus System Control Interface V3
|
||||
2. Right click -> Properties -> Driver tab
|
||||
3. Click "Roll Back Driver"
|
||||
4. Restart your computer.
|
||||
|
||||
<ins>If "Roll Back Driver" is unavailable:</ins>
|
||||
1. click Uninstall Device
|
||||
2. Ensure "Attempt to remove the driver for this device." is ticked.
|
||||
3. Reinstall an older version by going to [this page](https://github.com/Karmel0x/AsusFanControl/releases/) and installing driver "ASUSSystemControlInterfaceV3_3.1.38.0.exe".
|
||||
4. Restart your computer.
|
||||
|
||||
### Run
|
||||
|
||||
@@ -49,3 +67,6 @@ Confirmed compatibility:
|
||||
- ASUS TUF F15 - FX506HM
|
||||
- ASUS ZenBook 14 UM425QA-KI174W
|
||||
- ASUS ROG Strix G512LW
|
||||
|
||||
### Re-enable driver updates
|
||||
`REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /f /v ExcludeWUDriversInQualityUpdate /t REG_DWORD /d 0`
|
||||
|
||||
Reference in New Issue
Block a user