Compare commits
83 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
845b182b55 | ||
|
|
b7cfd04560 | ||
|
|
6ffd464ec4 | ||
|
|
e7dd3ce203 | ||
|
|
d06dae9015 | ||
|
|
1b208e1a74 | ||
|
|
6befab190b | ||
|
|
5d3eaa0055 | ||
|
|
667f1a997c | ||
|
|
4542221a58 | ||
|
|
5fd7b74519 | ||
|
|
014ee635d6 | ||
|
|
1dff60d574 | ||
|
|
7395f0be69 | ||
|
|
e3019a313a | ||
|
|
9653b81cd3 | ||
|
|
9713cb6fa4 | ||
|
|
10053eda10 | ||
|
|
ef1bbc1fce | ||
|
|
3fde8c1fa9 | ||
|
|
efd6707e61 | ||
|
|
8032ea3fc7 | ||
|
|
d0a232d888 | ||
|
|
a6bd18f019 | ||
|
|
a09c252c2e | ||
|
|
99d3c61897 | ||
|
|
4a6decb0be | ||
|
|
80b9fdb8ac | ||
|
|
e3c293942c | ||
|
|
42e910e635 | ||
|
|
18b6ae07b2 | ||
|
|
fa2875fbee | ||
|
|
f2bfb24fb4 | ||
|
|
adc81721ac | ||
|
|
9da061d621 | ||
|
|
274c04bf61 | ||
|
|
2d286ca04f | ||
|
|
2c1fa01863 | ||
|
|
0370ef7bc0 | ||
|
|
2f2ef23ee4 | ||
|
|
756ed44741 | ||
|
|
efb6a087b4 | ||
|
|
4e6f55c24d | ||
|
|
c029df357a | ||
|
|
8d19b5f89c | ||
|
|
7683e68df3 | ||
|
|
e45bcdf8a5 | ||
|
|
ab8d42c216 | ||
|
|
d248fcf384 | ||
|
|
9bb5e41a5d | ||
|
|
bc965c003d | ||
|
|
a6cfc91de2 | ||
|
|
9ca6ec657f | ||
|
|
89d7930323 | ||
|
|
e26d26b498 | ||
|
|
a6d0dde4b0 | ||
|
|
f68d53aaf4 | ||
|
|
a2ea3d18fd | ||
|
|
f77fcc940f | ||
|
|
dd4d85f254 | ||
|
|
2afbde814f | ||
|
|
b6b06a3802 | ||
|
|
4d58945688 | ||
|
|
9aaf0159e5 | ||
|
|
3cbaf1eb52 | ||
|
|
c76fbeab37 | ||
|
|
15d580bbe3 | ||
|
|
2ec64bf8b5 | ||
|
|
254be71e88 | ||
|
|
e9ec8f0e8f | ||
|
|
0ef44a0495 | ||
|
|
e725760b24 | ||
|
|
a83ab4884e | ||
|
|
7bfd10c65d | ||
|
|
67b541b145 | ||
|
|
f1ae14652f | ||
|
|
223ead2f4e | ||
|
|
a211dd412f | ||
|
|
550e9fc036 | ||
|
|
8fe01e8790 | ||
|
|
f0abe22b5d | ||
|
|
ef0993e442 | ||
|
|
62ac478761 |
128
.github/CODE_OF_CONDUCT.md
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
https://www.contributor-covenant.org/faq. Translations are available at
|
||||
https://www.contributor-covenant.org/translations.
|
||||
1
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Please, feel free to contribute. Especially if you own model differnt from G14 2022 and can offer extra features or support.
|
||||
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
10
.github/ISSUE_TEMPLATE/custom.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Custom issue template
|
||||
about: Describe this issue template's purpose here.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
16
.github/SECURITY.md
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 0.25+ | :white_check_mark: |
|
||||
| < 0.24 | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Use this section to tell people how to report a vulnerability.
|
||||
|
||||
Tell them where to go, how often they can expect to get an update on a
|
||||
reported vulnerability, what to expect if the vulnerability is accepted or
|
||||
declined, etc.
|
||||
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 Serge
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"profiles": {
|
||||
"GHelper": {
|
||||
"commandName": "Project",
|
||||
"workingDirectory": "C:\\Users\\serge\\source\\GHelper"
|
||||
}
|
||||
}
|
||||
}
|
||||
77
README.md
@@ -1,77 +0,0 @@
|
||||
# G-Helper / GHelper for Asus ROG Zephyrus G14, G15, Flow X13, Flow X16, and other models
|
||||
|
||||
A small utility that allows you do almost everyting you could do with Armory Crate but without extra bloat and unnecessary services.
|
||||
|
||||
### [Download latest release](https://github.com/seerge/g-helper/releases)
|
||||
|
||||

|
||||
|
||||
## NEW (and experimental) features
|
||||
|
||||
1. Set Power limits (PPT) for Total (APU + dGPU) and CPU.
|
||||
2. Anime matrix control thanks to [Starlight](https://github.com/vddCore/Starlight) + some tweaks from my side
|
||||
|
||||
## Main features
|
||||
|
||||
1. Switch between built-in system **Performance modes** Silent / Balanced / Turbo and apply default fan curves
|
||||
2. Switch between Eco / Standard or Ultimate **GPU modes**
|
||||
3. Change laptop screen refresh rate - 60hz or your maximum (120hz, 144hz, etc depending on the model) with display overdrive (OD)
|
||||
4. View default fan profiles for every mode and **auto apply** custom ones
|
||||
5. Control keyboard backlit animation and colors
|
||||
6. Set battery charge limit to preserve battery health
|
||||
7. Monitor CPU temperature, fan speeds and battery discharge rate
|
||||
8. **Automatically switch to Eco(iGPU)/60hz on battery** and back to Standard(GPU)/120hz modes when plugged
|
||||
9. Support for FN+F5 to cycle through performance modes (with OSD notification) and FN+F4 to cycle through keeyboard animation modes
|
||||
10. Basic keybindings for M3 and M4 keys
|
||||
11. Turn cpu turbo boost on/off with one checkbox to keep temps cooler
|
||||
|
||||
Designed and developed for Asus Zephyrus G14 2022 (with AMD Radeon iGPU and dGPU). But could and should potentially work for G14 of 2021 and 2020, G15, X FLOW, and other ROG models for relevant and supported features.
|
||||
|
||||
To keep autoswitching and hotkeys work app needs to stay in running in tray. It doesn't consume any resources.
|
||||
|
||||
## Performance Profile switching
|
||||
|
||||
Profiles are **same** as in Armory Crate (as they are stored in bios), including default fan curves
|
||||
|
||||
1. Silent (minimal or no fans, 70W PPT total, up to 45W PPT to CPU)
|
||||
2. Balanced (balanced fans, 100W PPT total, up to 45W PPT to CPU)
|
||||
3. Turbo (intense fans, 125W PPT total, up to 80W PPT to CPU)
|
||||
|
||||
PPTs are shown for G14 2022, for other models PPTs will be different as they are set in bios.
|
||||
|
||||
## GPU Modes
|
||||
|
||||
1. Eco mode : only low power integrated GPU enabled, iGPU drives built in display
|
||||
2. Standard mode (Windows Hybrid) : iGPU and dGPU enabled, iGPU drives built in display
|
||||
3. Ultimate mode: iGPU and dGPU enabled, but dGPU drives built in display (supported only on G14 2022 model)
|
||||
|
||||
## How to install
|
||||
|
||||
1. Download latest release from [**Releases Page**](https://github.com/seerge/g-helper/releases)
|
||||
2. Unzip to a folder of your choice
|
||||
3. Run **GHelper.exe**
|
||||
|
||||
App requires [.NET7](https://dotnet.microsoft.com/en-us/download) to be installed. Most probably you already have it. Otherwise you can [download it](https://dotnet.microsoft.com/en-us/download).
|
||||
|
||||
I recommend to keep "Asus Optimization Service" running, as it keeps basic laptop hotkeys such as screen or keyboard brightness adjustment working. If you have (or had) MyASUS app installed, that service is most probably still up an running even after MyASUS uninstall. It's part of [Asus System Controll Interface](https://www.asus.com/support/FAQ/1047338/). You can install it, and later disable / remove unnecesarily services by running [this bat file](https://raw.githubusercontent.com/seerge/g-helper/main/stop-asus-sv.bat) as admin.
|
||||
|
||||
Note: Uses low level ASUS ACPI commands and doens't require Armory Crate to be installed at all! Doesn't need administrator privileges to run!
|
||||
|
||||
I don`t have Microsoft certificate to sign app yet, so if you get a warning from Windows Defender on launch (Windows Protected your PC), click More Info -> Run anyway. Alternatively you can compile and run project by yourself using Visual Studio :)
|
||||
|
||||
Settings file is stored at %AppData%\GHelper
|
||||
|
||||
P.S.: It's not recommended to use app in combination with Armory Crate, cause they adjust same settings.
|
||||
|
||||
------------------
|
||||
|
||||
Debloating helps to save your battery and keep laptop a bit cooler
|
||||
|
||||

|
||||
|
||||
---------
|
||||
|
||||
**Disclaimers**
|
||||
"ROG", "TUF", and "Armoury Crate" are trademarked by and belong to AsusTek Computer, Inc. I make no claims to these or any assets belonging to AsusTek Computer and use them purely for informational purposes only.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. MISUSE OF THIS SOFTWARE COULD CAUSE SYSTEM INSTABILITY OR MALFUNCTION.
|
||||
@@ -1,9 +1,6 @@
|
||||
using GHelper;
|
||||
using System.Diagnostics;
|
||||
using System.Management;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
||||
public class ASUSWmi
|
||||
{
|
||||
|
||||
@@ -27,12 +24,16 @@ public class ASUSWmi
|
||||
public const uint DevsCPUFanCurve = 0x00110024;
|
||||
public const uint DevsGPUFanCurve = 0x00110025;
|
||||
|
||||
public const int PPT_TotalA0 = 0x001200A0;
|
||||
public const int PPT_TotalA1 = 0x001200A1;
|
||||
public const int PPT_TotalA0 = 0x001200A0; // Total PPT on 2022 and CPU PPT on 2021
|
||||
public const int PPT_EDCA1 = 0x001200A1; // CPU EDC
|
||||
public const int PPT_TDCA2 = 0x001200A2; // CPU TDC
|
||||
public const int PPT_APUA3 = 0x001200A3; // APU PPT ON 2021, doesn't work on 2022
|
||||
|
||||
public const int PPT_CPUB0 = 0x001200B0;
|
||||
public const int PPT_CPUB1 = 0x001200B1;
|
||||
public const int PPT_CPUA2 = 0x001200A2;
|
||||
public const int PPT_CPUB0 = 0x001200B0; // CPU PPT on 2022
|
||||
public const int PPT_CPUB1 = 0x001200B1; // APU PPT on 2022
|
||||
|
||||
public const int PPT_APUC1 = 0x001200C1;
|
||||
public const int PPT_APUC2 = 0x001200C2;
|
||||
|
||||
public const int PerformanceBalanced = 0;
|
||||
public const int PerformanceTurbo = 1;
|
||||
@@ -44,11 +45,11 @@ public class ASUSWmi
|
||||
|
||||
|
||||
public const int MaxTotal = 150;
|
||||
public const int MinTotal = 15;
|
||||
public const int MinTotal = 5;
|
||||
public const int DefaultTotal = 125;
|
||||
|
||||
public const int MaxCPU = 90;
|
||||
public const int MinCPU = 15;
|
||||
public const int MinCPU = 5;
|
||||
public const int DefaultCPU = 80;
|
||||
|
||||
|
||||
@@ -183,7 +184,7 @@ public class ASUSWmi
|
||||
if (curve.Length != 16) return;
|
||||
if (curve.All(singleByte => singleByte == 0)) return;
|
||||
|
||||
Debug.WriteLine(BitConverter.ToString(curve));
|
||||
Logger.WriteLine("Fans" + ((device == 1) ? "GPU" : "CPU") + " " + BitConverter.ToString(curve));
|
||||
|
||||
if (device == 1)
|
||||
DeviceSet(DevsGPUFanCurve, curve);
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<System.Windows.Forms.ApplicationConfigurationSection>
|
||||
<add key="DpiAwareness" value="PerMonitorV2" />
|
||||
<add key="DpiAwareness" value="System" />
|
||||
</System.Windows.Forms.ApplicationConfigurationSection>
|
||||
<appSettings>
|
||||
<add key="EnableWindowsFormsHighDpiAutoResizing" value="true" />
|
||||
</appSettings>
|
||||
</configuration>
|
||||
|
||||
<appSettings>
|
||||
<add key="EnableWindowsFormsHighDpiAutoResizing" value="true" />
|
||||
</appSettings>
|
||||
@@ -43,7 +43,7 @@ public class Aura
|
||||
{
|
||||
|
||||
HidDevice[] HidDeviceList;
|
||||
int[] deviceIds = { 0x1854, 0x1869, 0x1866, 0x19b6 };
|
||||
int[] deviceIds = { 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0 };
|
||||
|
||||
HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
|
||||
|
||||
@@ -63,18 +63,14 @@ public class Aura
|
||||
|
||||
foreach (HidDevice device in HidDeviceList)
|
||||
{
|
||||
if (device.IsConnected)
|
||||
if (device.IsConnected && device.Description.Contains("HID"))
|
||||
{
|
||||
if (device.Description.IndexOf("HID") >= 0)
|
||||
{
|
||||
device.OpenDevice();
|
||||
byte[] msg = AuraMessage(Mode, Color1, Color2, Speed);
|
||||
device.Write(msg);
|
||||
device.Write(MESSAGE_SET);
|
||||
device.Write(MESSAGE_APPLY);
|
||||
device.CloseDevice();
|
||||
}
|
||||
|
||||
device.OpenDevice();
|
||||
byte[] msg = AuraMessage(Mode, Color1, Color2, Speed);
|
||||
device.Write(msg);
|
||||
device.Write(MESSAGE_SET);
|
||||
device.Write(MESSAGE_APPLY);
|
||||
device.CloseDevice();
|
||||
}
|
||||
}
|
||||
|
||||
57
Fans.Designer.cs → app/Fans.Designer.cs
generated
@@ -31,11 +31,12 @@
|
||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||
panelFans = new Panel();
|
||||
labelBoost = new Label();
|
||||
comboBoost = new ComboBox();
|
||||
picturePerf = new PictureBox();
|
||||
tableFanCharts = new TableLayoutPanel();
|
||||
chartGPU = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||
chartCPU = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||
checkBoost = new CheckBox();
|
||||
labelFans = new Label();
|
||||
checkAuto = new CheckBox();
|
||||
buttonReset = new Button();
|
||||
@@ -72,9 +73,10 @@
|
||||
//
|
||||
// panelFans
|
||||
//
|
||||
panelFans.Controls.Add(labelBoost);
|
||||
panelFans.Controls.Add(comboBoost);
|
||||
panelFans.Controls.Add(picturePerf);
|
||||
panelFans.Controls.Add(tableFanCharts);
|
||||
panelFans.Controls.Add(checkBoost);
|
||||
panelFans.Controls.Add(labelFans);
|
||||
panelFans.Controls.Add(checkAuto);
|
||||
panelFans.Controls.Add(buttonReset);
|
||||
@@ -87,6 +89,26 @@
|
||||
panelFans.Size = new Size(824, 1159);
|
||||
panelFans.TabIndex = 12;
|
||||
//
|
||||
// labelBoost
|
||||
//
|
||||
labelBoost.AutoSize = true;
|
||||
labelBoost.Location = new Point(397, 19);
|
||||
labelBoost.Name = "labelBoost";
|
||||
labelBoost.Size = new Size(125, 32);
|
||||
labelBoost.TabIndex = 39;
|
||||
labelBoost.Text = "CPU Boost";
|
||||
//
|
||||
// comboBoost
|
||||
//
|
||||
comboBoost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
comboBoost.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoost.FormattingEnabled = true;
|
||||
comboBoost.Items.AddRange(new object[] { "Disabled", "Enabled", "Aggressive", "Efficient Enabled", "Efficient Aggressive" });
|
||||
comboBoost.Location = new Point(526, 15);
|
||||
comboBoost.Name = "comboBoost";
|
||||
comboBoost.Size = new Size(266, 40);
|
||||
comboBoost.TabIndex = 38;
|
||||
//
|
||||
// picturePerf
|
||||
//
|
||||
picturePerf.BackgroundImage = Properties.Resources.icons8_fan_head_96;
|
||||
@@ -106,7 +128,7 @@
|
||||
tableFanCharts.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
|
||||
tableFanCharts.Controls.Add(chartGPU, 0, 1);
|
||||
tableFanCharts.Controls.Add(chartCPU, 0, 0);
|
||||
tableFanCharts.Location = new Point(28, 68);
|
||||
tableFanCharts.Location = new Point(28, 64);
|
||||
tableFanCharts.Margin = new Padding(6);
|
||||
tableFanCharts.Name = "tableFanCharts";
|
||||
tableFanCharts.RowCount = 2;
|
||||
@@ -114,7 +136,7 @@
|
||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
|
||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Absolute, 40F));
|
||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Absolute, 40F));
|
||||
tableFanCharts.Size = new Size(764, 988);
|
||||
tableFanCharts.Size = new Size(764, 992);
|
||||
tableFanCharts.TabIndex = 36;
|
||||
//
|
||||
// chartGPU
|
||||
@@ -122,10 +144,10 @@
|
||||
chartArea1.Name = "ChartArea1";
|
||||
chartGPU.ChartAreas.Add(chartArea1);
|
||||
chartGPU.Dock = DockStyle.Fill;
|
||||
chartGPU.Location = new Point(2, 504);
|
||||
chartGPU.Location = new Point(2, 506);
|
||||
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
||||
chartGPU.Name = "chartGPU";
|
||||
chartGPU.Size = new Size(760, 474);
|
||||
chartGPU.Size = new Size(760, 476);
|
||||
chartGPU.TabIndex = 17;
|
||||
chartGPU.Text = "chart1";
|
||||
//
|
||||
@@ -137,22 +159,10 @@
|
||||
chartCPU.Location = new Point(2, 10);
|
||||
chartCPU.Margin = new Padding(2, 10, 2, 10);
|
||||
chartCPU.Name = "chartCPU";
|
||||
chartCPU.Size = new Size(760, 474);
|
||||
chartCPU.Size = new Size(760, 476);
|
||||
chartCPU.TabIndex = 14;
|
||||
chartCPU.Text = "chartCPU";
|
||||
//
|
||||
// checkBoost
|
||||
//
|
||||
checkBoost.AutoSize = true;
|
||||
checkBoost.ForeColor = SystemColors.ControlText;
|
||||
checkBoost.Location = new Point(475, 18);
|
||||
checkBoost.Margin = new Padding(4, 2, 4, 2);
|
||||
checkBoost.Name = "checkBoost";
|
||||
checkBoost.Size = new Size(320, 36);
|
||||
checkBoost.TabIndex = 35;
|
||||
checkBoost.Text = "CPU Turbo Boost enabled";
|
||||
checkBoost.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// labelFans
|
||||
//
|
||||
labelFans.AutoSize = true;
|
||||
@@ -268,7 +278,7 @@
|
||||
panelCPU.Controls.Add(labelCPU);
|
||||
panelCPU.Controls.Add(label2);
|
||||
panelCPU.Controls.Add(trackCPU);
|
||||
panelCPU.Location = new Point(184, 90);
|
||||
panelCPU.Location = new Point(184, 93);
|
||||
panelCPU.Margin = new Padding(4);
|
||||
panelCPU.Name = "panelCPU";
|
||||
panelCPU.Size = new Size(160, 510);
|
||||
@@ -315,7 +325,7 @@
|
||||
panelTotal.Controls.Add(labelTotal);
|
||||
panelTotal.Controls.Add(label1);
|
||||
panelTotal.Controls.Add(trackTotal);
|
||||
panelTotal.Location = new Point(16, 90);
|
||||
panelTotal.Location = new Point(16, 93);
|
||||
panelTotal.Margin = new Padding(4);
|
||||
panelTotal.Name = "panelTotal";
|
||||
panelTotal.Size = new Size(160, 512);
|
||||
@@ -362,7 +372,7 @@
|
||||
//
|
||||
labelApplied.AutoSize = true;
|
||||
labelApplied.ForeColor = Color.Tomato;
|
||||
labelApplied.Location = new Point(56, 48);
|
||||
labelApplied.Location = new Point(56, 54);
|
||||
labelApplied.Margin = new Padding(4, 0, 4, 0);
|
||||
labelApplied.Name = "labelApplied";
|
||||
labelApplied.Size = new Size(143, 32);
|
||||
@@ -453,9 +463,10 @@
|
||||
private TableLayoutPanel tableFanCharts;
|
||||
private System.Windows.Forms.DataVisualization.Charting.Chart chartGPU;
|
||||
private System.Windows.Forms.DataVisualization.Charting.Chart chartCPU;
|
||||
private CheckBox checkBoost;
|
||||
private Label labelFans;
|
||||
private PictureBox picturePerf;
|
||||
private PictureBox pictureBox1;
|
||||
private ComboBox comboBoost;
|
||||
private Label labelBoost;
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@ namespace GHelper
|
||||
InitPower();
|
||||
InitBoost();
|
||||
|
||||
checkBoost.Click += CheckBoost_Click;
|
||||
comboBoost.SelectedIndexChanged += ComboBoost_Changed;
|
||||
|
||||
Shown += Fans_Shown;
|
||||
|
||||
@@ -125,19 +125,15 @@ namespace GHelper
|
||||
public void InitBoost()
|
||||
{
|
||||
int boost = NativeMethods.GetCPUBoost();
|
||||
checkBoost.Checked = (boost > 0);
|
||||
if (boost >= 0)
|
||||
comboBoost.SelectedIndex = boost;
|
||||
}
|
||||
|
||||
private void CheckBoost_Click(object? sender, EventArgs e)
|
||||
private void ComboBoost_Changed(object? sender, EventArgs e)
|
||||
{
|
||||
if (sender is null)
|
||||
return;
|
||||
|
||||
CheckBox chk = (CheckBox)sender;
|
||||
if (chk.Checked)
|
||||
NativeMethods.SetCPUBoost(2);
|
||||
else
|
||||
NativeMethods.SetCPUBoost(0);
|
||||
if (sender is null) return;
|
||||
ComboBox cmb = (ComboBox)sender;
|
||||
NativeMethods.SetCPUBoost(cmb.SelectedIndex);
|
||||
}
|
||||
|
||||
private void CheckApplyPower_Click(object? sender, EventArgs e)
|
||||
@@ -172,8 +168,17 @@ namespace GHelper
|
||||
public void InitPower(bool changed = false)
|
||||
{
|
||||
|
||||
panelPower.Visible = (Program.wmi.DeviceGet(ASUSWmi.PPT_TotalA0) >= 0);
|
||||
panelCPU.Visible = (Program.wmi.DeviceGet(ASUSWmi.PPT_CPUB0) >= 0);
|
||||
bool cpuBmode = (Program.wmi.DeviceGet(ASUSWmi.PPT_CPUB0) >= 0); // 2022 model +
|
||||
bool cpuAmode = (Program.wmi.DeviceGet(ASUSWmi.PPT_TotalA0) >= 0); // 2021 model +
|
||||
|
||||
panelPower.Visible = cpuAmode;
|
||||
panelCPU.Visible = cpuBmode;
|
||||
|
||||
// Yes, that's stupid, but Total slider on 2021 model actually adjusts CPU PPT
|
||||
if (!cpuBmode)
|
||||
{
|
||||
label1.Text = "CPU SPPT";
|
||||
}
|
||||
|
||||
int limit_total;
|
||||
int limit_cpu;
|
||||
@@ -16,7 +16,7 @@
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<AssemblyVersion>0.25</AssemblyVersion>
|
||||
<AssemblyVersion>0.29</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -32,13 +32,14 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="favicon.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="hidlibrary" Version="3.3.40" />
|
||||
<PackageReference Include="HidSharpCore" Version="1.2.1.1" />
|
||||
<PackageReference Include="NvAPIWrapper.Net" Version="0.8.1.101" />
|
||||
<PackageReference Include="System.Management" Version="7.0.0" />
|
||||
<PackageReference Include="TaskScheduler" Version="2.10.1" />
|
||||
<PackageReference Include="WinForms.DataVisualization" Version="1.7.0" />
|
||||
485
app/Gpu/AmdAdl2.cs
Normal file
@@ -0,0 +1,485 @@
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace AmdAdl2;
|
||||
|
||||
#region Export Struct
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ADLSingleSensorData {
|
||||
public int Supported;
|
||||
public int Value;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ADLPMLogDataOutput {
|
||||
int Size;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Adl2.ADL_PMLOG_MAX_SENSORS)]
|
||||
public ADLSingleSensorData[] Sensors;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ADLGcnInfo
|
||||
{
|
||||
public int CuCount; //Number of compute units on the ASIC.
|
||||
public int TexCount; //Number of texture mapping units.
|
||||
public int RopCount; //Number of Render backend Units.
|
||||
public int ASICFamilyId; //Such SI, VI. See /inc/asic_reg/atiid.h for family ids
|
||||
public int ASICRevisionId; //Such as Ellesmere, Fiji. For example - VI family revision ids are stored in /inc/asic_reg/vi_id.h
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum ADLAsicFamilyType {
|
||||
Undefined = 0,
|
||||
Discrete = 1 << 0,
|
||||
Integrated = 1 << 1,
|
||||
Workstation = 1 << 2,
|
||||
FireMV = 1 << 3,
|
||||
Xgp = 1 << 4,
|
||||
Fusion = 1 << 5,
|
||||
Firestream = 1 << 6,
|
||||
Embedded = 1 << 7,
|
||||
}
|
||||
|
||||
public enum ADLSensorType {
|
||||
SENSOR_MAXTYPES = 0,
|
||||
PMLOG_CLK_GFXCLK = 1, // Current graphic clock value in MHz
|
||||
PMLOG_CLK_MEMCLK = 2, // Current memory clock value in MHz
|
||||
PMLOG_CLK_SOCCLK = 3,
|
||||
PMLOG_CLK_UVDCLK1 = 4,
|
||||
PMLOG_CLK_UVDCLK2 = 5,
|
||||
PMLOG_CLK_VCECLK = 6,
|
||||
PMLOG_CLK_VCNCLK = 7,
|
||||
PMLOG_TEMPERATURE_EDGE = 8, // Current edge of the die temperature value in C
|
||||
PMLOG_TEMPERATURE_MEM = 9,
|
||||
PMLOG_TEMPERATURE_VRVDDC = 10,
|
||||
PMLOG_TEMPERATURE_VRMVDD = 11,
|
||||
PMLOG_TEMPERATURE_LIQUID = 12,
|
||||
PMLOG_TEMPERATURE_PLX = 13,
|
||||
PMLOG_FAN_RPM = 14, // Current fan RPM value
|
||||
PMLOG_FAN_PERCENTAGE = 15, // Current ratio of fan RPM and max RPM
|
||||
PMLOG_SOC_VOLTAGE = 16,
|
||||
PMLOG_SOC_POWER = 17,
|
||||
PMLOG_SOC_CURRENT = 18,
|
||||
PMLOG_INFO_ACTIVITY_GFX = 19, // Current graphic activity level in percentage
|
||||
PMLOG_INFO_ACTIVITY_MEM = 20, // Current memory activity level in percentage
|
||||
PMLOG_GFX_VOLTAGE = 21, // Current graphic voltage in mV
|
||||
PMLOG_MEM_VOLTAGE = 22,
|
||||
PMLOG_ASIC_POWER = 23, // Current ASIC power draw in Watt
|
||||
PMLOG_TEMPERATURE_VRSOC = 24,
|
||||
PMLOG_TEMPERATURE_VRMVDD0 = 25,
|
||||
PMLOG_TEMPERATURE_VRMVDD1 = 26,
|
||||
PMLOG_TEMPERATURE_HOTSPOT = 27, // Current center of the die temperature value in C
|
||||
PMLOG_TEMPERATURE_GFX = 28,
|
||||
PMLOG_TEMPERATURE_SOC = 29,
|
||||
PMLOG_GFX_POWER = 30,
|
||||
PMLOG_GFX_CURRENT = 31,
|
||||
PMLOG_TEMPERATURE_CPU = 32,
|
||||
PMLOG_CPU_POWER = 33,
|
||||
PMLOG_CLK_CPUCLK = 34,
|
||||
PMLOG_THROTTLER_STATUS = 35, // A bit map of GPU throttle information. If a bit is set, the bit represented type of thorttling occurred in the last metrics sampling period
|
||||
PMLOG_CLK_VCN1CLK1 = 36,
|
||||
PMLOG_CLK_VCN1CLK2 = 37,
|
||||
PMLOG_SMART_POWERSHIFT_CPU = 38,
|
||||
PMLOG_SMART_POWERSHIFT_DGPU = 39,
|
||||
PMLOG_BUS_SPEED = 40, // Current PCIE bus speed running
|
||||
PMLOG_BUS_LANES = 41, // Current PCIE bus lanes using
|
||||
PMLOG_TEMPERATURE_LIQUID0 = 42,
|
||||
PMLOG_TEMPERATURE_LIQUID1 = 43,
|
||||
PMLOG_CLK_FCLK = 44,
|
||||
PMLOG_THROTTLER_STATUS_CPU = 45,
|
||||
PMLOG_SSPAIRED_ASICPOWER = 46, // apuPower
|
||||
PMLOG_SSTOTAL_POWERLIMIT = 47, // Total Power limit
|
||||
PMLOG_SSAPU_POWERLIMIT = 48, // APU Power limit
|
||||
PMLOG_SSDGPU_POWERLIMIT = 49, // DGPU Power limit
|
||||
PMLOG_TEMPERATURE_HOTSPOT_GCD = 50,
|
||||
PMLOG_TEMPERATURE_HOTSPOT_MCD = 51,
|
||||
PMLOG_THROTTLER_TEMP_EDGE_PERCENTAGE = 52,
|
||||
PMLOG_THROTTLER_TEMP_HOTSPOT_PERCENTAGE = 53,
|
||||
PMLOG_THROTTLER_TEMP_HOTSPOT_GCD_PERCENTAGE = 54,
|
||||
PMLOG_THROTTLER_TEMP_HOTSPOT_MCD_PERCENTAGE = 55,
|
||||
PMLOG_THROTTLER_TEMP_MEM_PERCENTAGE = 56,
|
||||
PMLOG_THROTTLER_TEMP_VR_GFX_PERCENTAGE = 57,
|
||||
PMLOG_THROTTLER_TEMP_VR_MEM0_PERCENTAGE = 58,
|
||||
PMLOG_THROTTLER_TEMP_VR_MEM1_PERCENTAGE = 59,
|
||||
PMLOG_THROTTLER_TEMP_VR_SOC_PERCENTAGE = 60,
|
||||
PMLOG_THROTTLER_TEMP_LIQUID0_PERCENTAGE = 61,
|
||||
PMLOG_THROTTLER_TEMP_LIQUID1_PERCENTAGE = 62,
|
||||
PMLOG_THROTTLER_TEMP_PLX_PERCENTAGE = 63,
|
||||
PMLOG_THROTTLER_TDC_GFX_PERCENTAGE = 64,
|
||||
PMLOG_THROTTLER_TDC_SOC_PERCENTAGE = 65,
|
||||
PMLOG_THROTTLER_TDC_USR_PERCENTAGE = 66,
|
||||
PMLOG_THROTTLER_PPT0_PERCENTAGE = 67,
|
||||
PMLOG_THROTTLER_PPT1_PERCENTAGE = 68,
|
||||
PMLOG_THROTTLER_PPT2_PERCENTAGE = 69,
|
||||
PMLOG_THROTTLER_PPT3_PERCENTAGE = 70,
|
||||
PMLOG_THROTTLER_FIT_PERCENTAGE = 71,
|
||||
PMLOG_THROTTLER_GFX_APCC_PLUS_PERCENTAGE = 72,
|
||||
PMLOG_BOARD_POWER = 73,
|
||||
PMLOG_MAX_SENSORS_REAL
|
||||
};
|
||||
|
||||
//Throttle Status
|
||||
[Flags]
|
||||
public enum ADL_THROTTLE_NOTIFICATION {
|
||||
ADL_PMLOG_THROTTLE_POWER = 1 << 0,
|
||||
ADL_PMLOG_THROTTLE_THERMAL = 1 << 1,
|
||||
ADL_PMLOG_THROTTLE_CURRENT = 1 << 2,
|
||||
};
|
||||
|
||||
public enum ADL_PMLOG_SENSORS {
|
||||
ADL_SENSOR_MAXTYPES = 0,
|
||||
ADL_PMLOG_CLK_GFXCLK = 1,
|
||||
ADL_PMLOG_CLK_MEMCLK = 2,
|
||||
ADL_PMLOG_CLK_SOCCLK = 3,
|
||||
ADL_PMLOG_CLK_UVDCLK1 = 4,
|
||||
ADL_PMLOG_CLK_UVDCLK2 = 5,
|
||||
ADL_PMLOG_CLK_VCECLK = 6,
|
||||
ADL_PMLOG_CLK_VCNCLK = 7,
|
||||
ADL_PMLOG_TEMPERATURE_EDGE = 8,
|
||||
ADL_PMLOG_TEMPERATURE_MEM = 9,
|
||||
ADL_PMLOG_TEMPERATURE_VRVDDC = 10,
|
||||
ADL_PMLOG_TEMPERATURE_VRMVDD = 11,
|
||||
ADL_PMLOG_TEMPERATURE_LIQUID = 12,
|
||||
ADL_PMLOG_TEMPERATURE_PLX = 13,
|
||||
ADL_PMLOG_FAN_RPM = 14,
|
||||
ADL_PMLOG_FAN_PERCENTAGE = 15,
|
||||
ADL_PMLOG_SOC_VOLTAGE = 16,
|
||||
ADL_PMLOG_SOC_POWER = 17,
|
||||
ADL_PMLOG_SOC_CURRENT = 18,
|
||||
ADL_PMLOG_INFO_ACTIVITY_GFX = 19,
|
||||
ADL_PMLOG_INFO_ACTIVITY_MEM = 20,
|
||||
ADL_PMLOG_GFX_VOLTAGE = 21,
|
||||
ADL_PMLOG_MEM_VOLTAGE = 22,
|
||||
ADL_PMLOG_ASIC_POWER = 23,
|
||||
ADL_PMLOG_TEMPERATURE_VRSOC = 24,
|
||||
ADL_PMLOG_TEMPERATURE_VRMVDD0 = 25,
|
||||
ADL_PMLOG_TEMPERATURE_VRMVDD1 = 26,
|
||||
ADL_PMLOG_TEMPERATURE_HOTSPOT = 27,
|
||||
ADL_PMLOG_TEMPERATURE_GFX = 28,
|
||||
ADL_PMLOG_TEMPERATURE_SOC = 29,
|
||||
ADL_PMLOG_GFX_POWER = 30,
|
||||
ADL_PMLOG_GFX_CURRENT = 31,
|
||||
ADL_PMLOG_TEMPERATURE_CPU = 32,
|
||||
ADL_PMLOG_CPU_POWER = 33,
|
||||
ADL_PMLOG_CLK_CPUCLK = 34,
|
||||
ADL_PMLOG_THROTTLER_STATUS = 35, // GFX
|
||||
ADL_PMLOG_CLK_VCN1CLK1 = 36,
|
||||
ADL_PMLOG_CLK_VCN1CLK2 = 37,
|
||||
ADL_PMLOG_SMART_POWERSHIFT_CPU = 38,
|
||||
ADL_PMLOG_SMART_POWERSHIFT_DGPU = 39,
|
||||
ADL_PMLOG_BUS_SPEED = 40,
|
||||
ADL_PMLOG_BUS_LANES = 41,
|
||||
ADL_PMLOG_TEMPERATURE_LIQUID0 = 42,
|
||||
ADL_PMLOG_TEMPERATURE_LIQUID1 = 43,
|
||||
ADL_PMLOG_CLK_FCLK = 44,
|
||||
ADL_PMLOG_THROTTLER_STATUS_CPU = 45,
|
||||
ADL_PMLOG_SSPAIRED_ASICPOWER = 46, // apuPower
|
||||
ADL_PMLOG_SSTOTAL_POWERLIMIT = 47, // Total Power limit
|
||||
ADL_PMLOG_SSAPU_POWERLIMIT = 48, // APU Power limit
|
||||
ADL_PMLOG_SSDGPU_POWERLIMIT = 49, // DGPU Power limit
|
||||
ADL_PMLOG_TEMPERATURE_HOTSPOT_GCD = 50,
|
||||
ADL_PMLOG_TEMPERATURE_HOTSPOT_MCD = 51,
|
||||
ADL_PMLOG_THROTTLER_TEMP_EDGE_PERCENTAGE = 52,
|
||||
ADL_PMLOG_THROTTLER_TEMP_HOTSPOT_PERCENTAGE = 53,
|
||||
ADL_PMLOG_THROTTLER_TEMP_HOTSPOT_GCD_PERCENTAGE = 54,
|
||||
ADL_PMLOG_THROTTLER_TEMP_HOTSPOT_MCD_PERCENTAGE = 55,
|
||||
ADL_PMLOG_THROTTLER_TEMP_MEM_PERCENTAGE = 56,
|
||||
ADL_PMLOG_THROTTLER_TEMP_VR_GFX_PERCENTAGE = 57,
|
||||
ADL_PMLOG_THROTTLER_TEMP_VR_MEM0_PERCENTAGE = 58,
|
||||
ADL_PMLOG_THROTTLER_TEMP_VR_MEM1_PERCENTAGE = 59,
|
||||
ADL_PMLOG_THROTTLER_TEMP_VR_SOC_PERCENTAGE = 60,
|
||||
ADL_PMLOG_THROTTLER_TEMP_LIQUID0_PERCENTAGE = 61,
|
||||
ADL_PMLOG_THROTTLER_TEMP_LIQUID1_PERCENTAGE = 62,
|
||||
ADL_PMLOG_THROTTLER_TEMP_PLX_PERCENTAGE = 63,
|
||||
ADL_PMLOG_THROTTLER_TDC_GFX_PERCENTAGE = 64,
|
||||
ADL_PMLOG_THROTTLER_TDC_SOC_PERCENTAGE = 65,
|
||||
ADL_PMLOG_THROTTLER_TDC_USR_PERCENTAGE = 66,
|
||||
ADL_PMLOG_THROTTLER_PPT0_PERCENTAGE = 67,
|
||||
ADL_PMLOG_THROTTLER_PPT1_PERCENTAGE = 68,
|
||||
ADL_PMLOG_THROTTLER_PPT2_PERCENTAGE = 69,
|
||||
ADL_PMLOG_THROTTLER_PPT3_PERCENTAGE = 70,
|
||||
ADL_PMLOG_THROTTLER_FIT_PERCENTAGE = 71,
|
||||
ADL_PMLOG_THROTTLER_GFX_APCC_PLUS_PERCENTAGE = 72,
|
||||
ADL_PMLOG_BOARD_POWER = 73,
|
||||
ADL_PMLOG_MAX_SENSORS_REAL
|
||||
}
|
||||
|
||||
#region ADLAdapterInfo
|
||||
|
||||
/// <summary> ADLAdapterInfo Structure</summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ADLAdapterInfo {
|
||||
/// <summary>The size of the structure</summary>
|
||||
int Size;
|
||||
|
||||
/// <summary> Adapter Index</summary>
|
||||
public int AdapterIndex;
|
||||
|
||||
/// <summary> Adapter UDID</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Adl2.ADL_MAX_PATH)]
|
||||
public string UDID;
|
||||
|
||||
/// <summary> Adapter Bus Number</summary>
|
||||
public int BusNumber;
|
||||
|
||||
/// <summary> Adapter Driver Number</summary>
|
||||
public int DriverNumber;
|
||||
|
||||
/// <summary> Adapter Function Number</summary>
|
||||
public int FunctionNumber;
|
||||
|
||||
/// <summary> Adapter Vendor ID</summary>
|
||||
public int VendorID;
|
||||
|
||||
/// <summary> Adapter Adapter name</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Adl2.ADL_MAX_PATH)]
|
||||
public string AdapterName;
|
||||
|
||||
/// <summary> Adapter Display name</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Adl2.ADL_MAX_PATH)]
|
||||
public string DisplayName;
|
||||
|
||||
/// <summary> Adapter Present status</summary>
|
||||
public int Present;
|
||||
|
||||
/// <summary> Adapter Exist status</summary>
|
||||
public int Exist;
|
||||
|
||||
/// <summary> Adapter Driver Path</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Adl2.ADL_MAX_PATH)]
|
||||
public string DriverPath;
|
||||
|
||||
/// <summary> Adapter Driver Ext Path</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Adl2.ADL_MAX_PATH)]
|
||||
public string DriverPathExt;
|
||||
|
||||
/// <summary> Adapter PNP String</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Adl2.ADL_MAX_PATH)]
|
||||
public string PNPString;
|
||||
|
||||
/// <summary> OS Display Index</summary>
|
||||
public int OSDisplayIndex;
|
||||
}
|
||||
|
||||
/// <summary> ADLAdapterInfo Array</summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ADLAdapterInfoArray {
|
||||
/// <summary> ADLAdapterInfo Array </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Adl2.ADL_MAX_ADAPTERS)]
|
||||
public ADLAdapterInfo[] ADLAdapterInfo;
|
||||
}
|
||||
|
||||
#endregion ADLAdapterInfo
|
||||
|
||||
#region ADLDisplayInfo
|
||||
|
||||
/// <summary> ADLDisplayID Structure</summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ADLDisplayID {
|
||||
/// <summary> Display Logical Index </summary>
|
||||
public int DisplayLogicalIndex;
|
||||
|
||||
/// <summary> Display Physical Index </summary>
|
||||
public int DisplayPhysicalIndex;
|
||||
|
||||
/// <summary> Adapter Logical Index </summary>
|
||||
public int DisplayLogicalAdapterIndex;
|
||||
|
||||
/// <summary> Adapter Physical Index </summary>
|
||||
public int DisplayPhysicalAdapterIndex;
|
||||
}
|
||||
|
||||
/// <summary> ADLDisplayInfo Structure</summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ADLDisplayInfo {
|
||||
/// <summary> Display Index </summary>
|
||||
public ADLDisplayID DisplayID;
|
||||
|
||||
/// <summary> Display Controller Index </summary>
|
||||
public int DisplayControllerIndex;
|
||||
|
||||
/// <summary> Display Name </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Adl2.ADL_MAX_PATH)]
|
||||
public string DisplayName;
|
||||
|
||||
/// <summary> Display Manufacturer Name </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Adl2.ADL_MAX_PATH)]
|
||||
public string DisplayManufacturerName;
|
||||
|
||||
/// <summary> Display Type : < The Display type. CRT, TV,CV,DFP are some of display types,</summary>
|
||||
public int DisplayType;
|
||||
|
||||
/// <summary> Display output type </summary>
|
||||
public int DisplayOutputType;
|
||||
|
||||
/// <summary> Connector type</summary>
|
||||
public int DisplayConnector;
|
||||
|
||||
///<summary> Indicating the display info bits' mask.<summary>
|
||||
public int DisplayInfoMask;
|
||||
|
||||
///<summary> Indicating the display info value.<summary>
|
||||
public int DisplayInfoValue;
|
||||
}
|
||||
|
||||
#endregion ADLDisplayInfo
|
||||
|
||||
#endregion Export Struct
|
||||
|
||||
public class Adl2 {
|
||||
public const string Atiadlxx_FileName = "atiadlxx.dll";
|
||||
|
||||
#region Internal Constant
|
||||
|
||||
/// <summary> Define the maximum path</summary>
|
||||
public const int ADL_MAX_PATH = 256;
|
||||
|
||||
/// <summary> Define the maximum adapters</summary>
|
||||
public const int ADL_MAX_ADAPTERS = 40 /* 150 */;
|
||||
|
||||
/// <summary> Define the maximum displays</summary>
|
||||
public const int ADL_MAX_DISPLAYS = 40 /* 150 */;
|
||||
|
||||
/// <summary> Define the maximum device name length</summary>
|
||||
public const int ADL_MAX_DEVICENAME = 32;
|
||||
|
||||
/// <summary> Define the successful</summary>
|
||||
public const int ADL_SUCCESS = 0;
|
||||
|
||||
/// <summary> Define the failure</summary>
|
||||
public const int ADL_FAIL = -1;
|
||||
|
||||
/// <summary> Define the driver ok</summary>
|
||||
public const int ADL_DRIVER_OK = 0;
|
||||
|
||||
/// <summary> Maximum number of GL-Sync ports on the GL-Sync module </summary>
|
||||
public const int ADL_MAX_GLSYNC_PORTS = 8;
|
||||
|
||||
/// <summary> Maximum number of GL-Sync ports on the GL-Sync module </summary>
|
||||
public const int ADL_MAX_GLSYNC_PORT_LEDS = 8;
|
||||
|
||||
/// <summary> Maximum number of ADLMOdes for the adapter </summary>
|
||||
public const int ADL_MAX_NUM_DISPLAYMODES = 1024;
|
||||
|
||||
/// <summary> Performance Metrics Log max sensors number </summary>
|
||||
public const int ADL_PMLOG_MAX_SENSORS = 256;
|
||||
|
||||
#endregion Internal Constant
|
||||
|
||||
// ///// <summary> ADL Create Function to create ADL Data</summary>
|
||||
/// <param name="enumConnectedAdapters">If it is 1, then ADL will only return the physical exist adapters </param>
|
||||
///// <returns> retrun ADL Error Code</returns>
|
||||
public static int ADL2_Main_Control_Create(int enumConnectedAdapters, out IntPtr adlContextHandle) {
|
||||
return NativeMethods.ADL2_Main_Control_Create(ADL_Main_Memory_Alloc_Impl_Reference, enumConnectedAdapters, out adlContextHandle);
|
||||
}
|
||||
|
||||
public static void FreeMemory(IntPtr buffer) {
|
||||
Memory_Free_Impl(buffer);
|
||||
}
|
||||
|
||||
private static bool? isDllLoaded;
|
||||
|
||||
public static bool Load() {
|
||||
if (isDllLoaded != null)
|
||||
return isDllLoaded.Value;
|
||||
|
||||
try {
|
||||
Marshal.PrelinkAll(typeof(Adl2));
|
||||
isDllLoaded = true;
|
||||
} catch (Exception e) when (e is DllNotFoundException or EntryPointNotFoundException) {
|
||||
Debug.WriteLine(e);
|
||||
isDllLoaded = false;
|
||||
}
|
||||
|
||||
return isDllLoaded.Value;
|
||||
}
|
||||
|
||||
private static NativeMethods.ADL_Main_Memory_Alloc ADL_Main_Memory_Alloc_Impl_Reference = Memory_Alloc_Impl;
|
||||
|
||||
/// <summary> Build in memory allocation function</summary>
|
||||
/// <param name="size">input size</param>
|
||||
/// <returns>return the memory buffer</returns>
|
||||
private static IntPtr Memory_Alloc_Impl(int size) {
|
||||
return Marshal.AllocCoTaskMem(size);
|
||||
}
|
||||
|
||||
/// <summary> Build in memory free function</summary>
|
||||
/// <param name="buffer">input buffer</param>
|
||||
private static void Memory_Free_Impl(IntPtr buffer) {
|
||||
if (IntPtr.Zero != buffer) {
|
||||
Marshal.FreeCoTaskMem(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
public static class NativeMethods {
|
||||
/// <summary> ADL Memory allocation function allows ADL to callback for memory allocation</summary>
|
||||
/// <param name="size">input size</param>
|
||||
/// <returns> retrun ADL Error Code</returns>
|
||||
public delegate IntPtr ADL_Main_Memory_Alloc(int size);
|
||||
|
||||
// ///// <summary> ADL Create Function to create ADL Data</summary>
|
||||
/// <param name="callback">Call back functin pointer which is ised to allocate memeory </param>
|
||||
/// <param name="enumConnectedAdapters">If it is 1, then ADL will only retuen the physical exist adapters </param>
|
||||
///// <returns> retrun ADL Error Code</returns>
|
||||
[DllImport(Atiadlxx_FileName)]
|
||||
public static extern int ADL2_Main_Control_Create(ADL_Main_Memory_Alloc callback, int enumConnectedAdapters, out IntPtr adlContextHandle);
|
||||
|
||||
/// <summary> ADL Destroy Function to free up ADL Data</summary>
|
||||
/// <returns> retrun ADL Error Code</returns>
|
||||
[DllImport(Atiadlxx_FileName)]
|
||||
public static extern int ADL2_Main_Control_Destroy(IntPtr adlContextHandle);
|
||||
|
||||
/// <summary> ADL Function to get the number of adapters</summary>
|
||||
/// <param name="numAdapters">return number of adapters</param>
|
||||
/// <returns> retrun ADL Error Code</returns>
|
||||
[DllImport(Atiadlxx_FileName)]
|
||||
public static extern int ADL2_Adapter_NumberOfAdapters_Get(IntPtr adlContextHandle, out int numAdapters);
|
||||
|
||||
/// <summary> ADL Function to get the GPU adapter information</summary>
|
||||
/// <param name="info">return GPU adapter information</param>
|
||||
/// <param name="inputSize">the size of the GPU adapter struct</param>
|
||||
/// <returns> retrun ADL Error Code</returns>
|
||||
[DllImport(Atiadlxx_FileName)]
|
||||
public static extern int ADL2_Adapter_AdapterInfo_Get(IntPtr adlContextHandle, IntPtr info, int inputSize);
|
||||
|
||||
/// <summary> Function to determine if the adapter is active or not.</summary>
|
||||
/// <remarks>The function is used to check if the adapter associated with iAdapterIndex is active</remarks>
|
||||
/// <param name="adapterIndex"> Adapter Index.</param>
|
||||
/// <param name="status"> Status of the adapter. True: Active; False: Dsiabled</param>
|
||||
/// <returns>Non zero is successfull</returns>
|
||||
[DllImport(Atiadlxx_FileName)]
|
||||
public static extern int ADL2_Adapter_Active_Get(IntPtr adlContextHandle, int adapterIndex, out int status);
|
||||
|
||||
/// <summary>Get display information based on adapter index</summary>
|
||||
/// <param name="adapterIndex">Adapter Index</param>
|
||||
/// <param name="numDisplays">return the total number of supported displays</param>
|
||||
/// <param name="displayInfoArray">return ADLDisplayInfo Array for supported displays' information</param>
|
||||
/// <param name="forceDetect">force detect or not</param>
|
||||
/// <returns>return ADL Error Code</returns>
|
||||
[DllImport(Atiadlxx_FileName)]
|
||||
public static extern int ADL2_Display_DisplayInfo_Get(
|
||||
IntPtr adlContextHandle,
|
||||
int adapterIndex,
|
||||
out int numDisplays,
|
||||
out IntPtr displayInfoArray,
|
||||
int forceDetect
|
||||
);
|
||||
|
||||
[DllImport(Atiadlxx_FileName)]
|
||||
public static extern int ADL2_Overdrive_Caps(
|
||||
IntPtr adlContextHandle,
|
||||
int adapterIndex,
|
||||
out int supported,
|
||||
out int enabled,
|
||||
out int version
|
||||
);
|
||||
|
||||
[DllImport(Atiadlxx_FileName)]
|
||||
public static extern int ADL2_New_QueryPMLogData_Get(IntPtr adlContextHandle, int adapterIndex, out ADLPMLogDataOutput adlpmLogDataOutput);
|
||||
|
||||
[DllImport(Atiadlxx_FileName)]
|
||||
public static extern int ADL2_Adapter_ASICFamilyType_Get(IntPtr adlContextHandle, int adapterIndex, out ADLAsicFamilyType asicFamilyType, out int asicFamilyTypeValids);
|
||||
}
|
||||
}
|
||||
92
app/Gpu/AmdGpuTemperatureProvider.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using AmdAdl2;
|
||||
|
||||
namespace GHelper.Gpu;
|
||||
|
||||
// Reference: https://github.com/GPUOpen-LibrariesAndSDKs/display-library/blob/master/Sample-Managed/Program.cs
|
||||
public class AmdGpuTemperatureProvider : IGpuTemperatureProvider {
|
||||
private bool _isReady;
|
||||
private IntPtr _adlContextHandle;
|
||||
private readonly ADLAdapterInfo _internalDiscreteAdapter;
|
||||
|
||||
public AmdGpuTemperatureProvider() {
|
||||
if (!Adl2.Load())
|
||||
return;
|
||||
|
||||
if (Adl2.ADL2_Main_Control_Create(1, out _adlContextHandle) != Adl2.ADL_SUCCESS)
|
||||
return;
|
||||
|
||||
Adl2.NativeMethods.ADL2_Adapter_NumberOfAdapters_Get(_adlContextHandle, out int numberOfAdapters);
|
||||
if (numberOfAdapters <= 0)
|
||||
return;
|
||||
|
||||
ADLAdapterInfoArray osAdapterInfoData = new();
|
||||
int osAdapterInfoDataSize = Marshal.SizeOf(osAdapterInfoData);
|
||||
IntPtr AdapterBuffer = Marshal.AllocCoTaskMem(osAdapterInfoDataSize);
|
||||
Marshal.StructureToPtr(osAdapterInfoData, AdapterBuffer, false);
|
||||
if (Adl2.NativeMethods.ADL2_Adapter_AdapterInfo_Get(_adlContextHandle, AdapterBuffer, osAdapterInfoDataSize) != Adl2.ADL_SUCCESS)
|
||||
return;
|
||||
|
||||
osAdapterInfoData = (ADLAdapterInfoArray) Marshal.PtrToStructure(AdapterBuffer, osAdapterInfoData.GetType())!;
|
||||
|
||||
const int amdVendorId = 1002;
|
||||
|
||||
// Determine which GPU is internal discrete AMD GPU
|
||||
ADLAdapterInfo internalDiscreteAdapter =
|
||||
osAdapterInfoData.ADLAdapterInfo
|
||||
.FirstOrDefault(adapter => {
|
||||
if (adapter.Exist == 0 || adapter.Present == 0)
|
||||
return false;
|
||||
|
||||
if (adapter.VendorID != amdVendorId)
|
||||
return false;
|
||||
|
||||
if (Adl2.NativeMethods.ADL2_Adapter_ASICFamilyType_Get(_adlContextHandle, adapter.AdapterIndex, out ADLAsicFamilyType asicFamilyType, out int asicFamilyTypeValids) != Adl2.ADL_SUCCESS)
|
||||
return false;
|
||||
|
||||
asicFamilyType = (ADLAsicFamilyType) ((int) asicFamilyType & asicFamilyTypeValids);
|
||||
|
||||
// FIXME: is this correct for G14 2022?
|
||||
return (asicFamilyType & ADLAsicFamilyType.Discrete) != 0;
|
||||
});
|
||||
|
||||
if (internalDiscreteAdapter.Exist == 0)
|
||||
return;
|
||||
|
||||
_internalDiscreteAdapter = internalDiscreteAdapter;
|
||||
_isReady = true;
|
||||
}
|
||||
|
||||
public bool IsValid => _isReady && _adlContextHandle != IntPtr.Zero;
|
||||
|
||||
public int? GetCurrentTemperature() {
|
||||
if (!IsValid)
|
||||
return null;
|
||||
|
||||
if (Adl2.NativeMethods.ADL2_New_QueryPMLogData_Get(_adlContextHandle, _internalDiscreteAdapter.AdapterIndex, out ADLPMLogDataOutput adlpmLogDataOutput) != Adl2.ADL_SUCCESS)
|
||||
return null;
|
||||
|
||||
ADLSingleSensorData temperatureSensor = adlpmLogDataOutput.Sensors[(int) ADLSensorType.PMLOG_TEMPERATURE_EDGE];
|
||||
if (temperatureSensor.Supported == 0)
|
||||
return null;
|
||||
|
||||
return temperatureSensor.Value;
|
||||
}
|
||||
|
||||
private void ReleaseUnmanagedResources() {
|
||||
if (_adlContextHandle != IntPtr.Zero) {
|
||||
Adl2.NativeMethods.ADL2_Main_Control_Destroy(_adlContextHandle);
|
||||
_adlContextHandle = IntPtr.Zero;
|
||||
_isReady = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
ReleaseUnmanagedResources();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
~AmdGpuTemperatureProvider() {
|
||||
ReleaseUnmanagedResources();
|
||||
}
|
||||
}
|
||||
6
app/Gpu/IGpuTemperatureProvider.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace GHelper.Gpu;
|
||||
|
||||
public interface IGpuTemperatureProvider : IDisposable {
|
||||
bool IsValid { get; }
|
||||
int? GetCurrentTemperature();
|
||||
}
|
||||
42
app/Gpu/NvidiaGpuTemperatureProvider.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using NvAPIWrapper.GPU;
|
||||
using NvAPIWrapper.Native;
|
||||
using NvAPIWrapper.Native.Exceptions;
|
||||
using NvAPIWrapper.Native.GPU;
|
||||
using NvAPIWrapper.Native.Interfaces.GPU;
|
||||
|
||||
namespace GHelper.Gpu;
|
||||
|
||||
public class NvidiaGpuTemperatureProvider : IGpuTemperatureProvider {
|
||||
private readonly PhysicalGPU? _internalGpu;
|
||||
|
||||
public NvidiaGpuTemperatureProvider() {
|
||||
_internalGpu = GetInternalDiscreteGpu();
|
||||
}
|
||||
|
||||
public bool IsValid => _internalGpu != null;
|
||||
|
||||
public int? GetCurrentTemperature() {
|
||||
if (!IsValid)
|
||||
return null;
|
||||
|
||||
PhysicalGPU internalGpu = _internalGpu!;
|
||||
IThermalSensor? gpuSensor =
|
||||
GPUApi.GetThermalSettings(internalGpu.Handle).Sensors
|
||||
.FirstOrDefault(s => s.Target == ThermalSettingsTarget.GPU);
|
||||
|
||||
return gpuSensor?.CurrentTemperature;
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
}
|
||||
|
||||
private static PhysicalGPU? GetInternalDiscreteGpu() {
|
||||
try {
|
||||
return PhysicalGPU
|
||||
.GetPhysicalGPUs()
|
||||
.FirstOrDefault(gpu => gpu.SystemType == SystemType.Laptop);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
86
app/HardwareMonitor.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using System.Diagnostics;
|
||||
using GHelper.Gpu;
|
||||
|
||||
public static class HardwareMonitor
|
||||
{
|
||||
private static IGpuTemperatureProvider? GpuTemperatureProvider;
|
||||
|
||||
public static float? cpuTemp = -1;
|
||||
public static float? batteryDischarge = -1;
|
||||
public static int? gpuTemp = null;
|
||||
|
||||
public static void ReadSensors()
|
||||
{
|
||||
cpuTemp = -1;
|
||||
batteryDischarge = -1;
|
||||
|
||||
try
|
||||
{
|
||||
var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true);
|
||||
cpuTemp = ct.NextValue() - 273;
|
||||
ct.Dispose();
|
||||
} catch
|
||||
{
|
||||
Logger.WriteLine("Failed reading CPU temp");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var cb = new PerformanceCounter("Power Meter", "Power", "Power Meter (0)", true);
|
||||
batteryDischarge = cb.NextValue() / 1000;
|
||||
cb.Dispose();
|
||||
|
||||
} catch
|
||||
{
|
||||
Logger.WriteLine("Failed reading Battery discharge");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
gpuTemp = GpuTemperatureProvider?.GetCurrentTemperature();
|
||||
} catch (Exception ex) {
|
||||
gpuTemp = null;
|
||||
Logger.WriteLine("Failed reading GPU temp");
|
||||
Logger.WriteLine(ex.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void RecreateGpuTemperatureProviderWithRetry() {
|
||||
RecreateGpuTemperatureProvider();
|
||||
|
||||
// Re-enabling the discrete GPU takes a bit of time,
|
||||
// so a simple workaround is to refresh again after that happens
|
||||
Task.Run(async () => {
|
||||
await Task.Delay(TimeSpan.FromSeconds(3));
|
||||
RecreateGpuTemperatureProvider();
|
||||
});
|
||||
}
|
||||
|
||||
public static void RecreateGpuTemperatureProvider() {
|
||||
try {
|
||||
GpuTemperatureProvider?.Dispose();
|
||||
|
||||
// Detect valid GPU temperature provider.
|
||||
// We start with NVIDIA because there's always at least an integrated AMD GPU
|
||||
IGpuTemperatureProvider gpuTemperatureProvider = new NvidiaGpuTemperatureProvider();
|
||||
if (gpuTemperatureProvider.IsValid) {
|
||||
GpuTemperatureProvider = gpuTemperatureProvider;
|
||||
return;
|
||||
}
|
||||
|
||||
gpuTemperatureProvider.Dispose();
|
||||
gpuTemperatureProvider = new AmdGpuTemperatureProvider();
|
||||
if (gpuTemperatureProvider.IsValid) {
|
||||
GpuTemperatureProvider = gpuTemperatureProvider;
|
||||
return;
|
||||
}
|
||||
|
||||
gpuTemperatureProvider.Dispose();
|
||||
|
||||
GpuTemperatureProvider = null;
|
||||
} finally {
|
||||
Logger.WriteLine($"GpuTemperatureProvider: {GpuTemperatureProvider?.GetType().Name}");
|
||||
}
|
||||
}
|
||||
}
|
||||
39
app/Logger.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
public static class Logger
|
||||
{
|
||||
static string appPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\GHelper";
|
||||
static string logFile = appPath + "\\log.txt";
|
||||
|
||||
public static void WriteLine(string logMessage)
|
||||
{
|
||||
Debug.WriteLine(logMessage);
|
||||
if (!Directory.Exists(appPath)) Directory.CreateDirectory(appPath);
|
||||
|
||||
try
|
||||
{
|
||||
using (StreamWriter w = File.AppendText(logFile))
|
||||
{
|
||||
w.WriteLine($"{DateTime.Now}: {logMessage}");
|
||||
w.Close();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
if (new Random().Next(100) == 1) Cleanup();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void Cleanup()
|
||||
{
|
||||
try
|
||||
{
|
||||
var file = File.ReadAllLines(logFile);
|
||||
int skip = Math.Max(0, file.Count() - 500);
|
||||
File.WriteAllLines(logFile, file.Skip(skip).ToArray());
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +1,6 @@
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using Tools;
|
||||
using static Tools.ScreenInterrogatory;
|
||||
|
||||
namespace Tools
|
||||
@@ -310,6 +307,62 @@ namespace Tools
|
||||
public class NativeMethods
|
||||
{
|
||||
|
||||
// Monitor Power detection
|
||||
|
||||
internal const uint DEVICE_NOTIFY_WINDOW_HANDLE = 0x0;
|
||||
internal const uint DEVICE_NOTIFY_SERVICE_HANDLE = 0x1;
|
||||
internal const int WM_POWERBROADCAST = 0x0218;
|
||||
internal const int PBT_POWERSETTINGCHANGE = 0x8013;
|
||||
|
||||
[DllImport("User32.dll", SetLastError = true)]
|
||||
internal static extern IntPtr RegisterPowerSettingNotification(IntPtr hWnd, [In] Guid PowerSettingGuid, uint Flags);
|
||||
|
||||
[DllImport("User32.dll", SetLastError = true)]
|
||||
internal static extern bool UnregisterPowerSettingNotification(IntPtr hWnd);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 4)]
|
||||
internal struct POWERBROADCAST_SETTING
|
||||
{
|
||||
public Guid PowerSetting;
|
||||
public uint DataLength;
|
||||
public byte Data;
|
||||
}
|
||||
|
||||
public class PowerSettingGuid
|
||||
{
|
||||
// 0=Powered by AC, 1=Powered by Battery, 2=Powered by short-term source (UPC)
|
||||
public Guid AcdcPowerSource { get; } = new Guid("5d3e9a59-e9D5-4b00-a6bd-ff34ff516548");
|
||||
// POWERBROADCAST_SETTING.Data = 1-100
|
||||
public Guid BatteryPercentageRemaining { get; } = new Guid("a7ad8041-b45a-4cae-87a3-eecbb468a9e1");
|
||||
// Windows 8+: 0=Monitor Off, 1=Monitor On, 2=Monitor Dimmed
|
||||
public Guid ConsoleDisplayState { get; } = new Guid("6fe69556-704a-47a0-8f24-c28d936fda47");
|
||||
// Windows 8+, Session 0 enabled: 0=User providing Input, 2=User Idle
|
||||
public Guid GlobalUserPresence { get; } = new Guid("786E8A1D-B427-4344-9207-09E70BDCBEA9");
|
||||
// 0=Monitor Off, 1=Monitor On.
|
||||
public Guid MonitorPowerGuid { get; } = new Guid("02731015-4510-4526-99e6-e5a17ebd1aea");
|
||||
// 0=Battery Saver Off, 1=Battery Saver On.
|
||||
public Guid PowerSavingStatus { get; } = new Guid("E00958C0-C213-4ACE-AC77-FECCED2EEEA5");
|
||||
|
||||
// Windows 8+: 0=Off, 1=On, 2=Dimmed
|
||||
public Guid SessionDisplayStatus { get; } = new Guid("2B84C20E-AD23-4ddf-93DB-05FFBD7EFCA5");
|
||||
|
||||
// Windows 8+, no Session 0: 0=User providing Input, 2=User Idle
|
||||
public Guid SessionUserPresence { get; } = new Guid("3C0F4548-C03F-4c4d-B9F2-237EDE686376");
|
||||
// 0=Exiting away mode 1=Entering away mode
|
||||
public Guid SystemAwaymode { get; } = new Guid("98a7f580-01f7-48aa-9c0f-44352c29e5C0");
|
||||
|
||||
/* Windows 8+ */
|
||||
// POWERBROADCAST_SETTING.Data not used
|
||||
public Guid IdleBackgroundTask { get; } = new Guid(0x515C31D8, 0xF734, 0x163D, 0xA0, 0xFD, 0x11, 0xA0, 0x8C, 0x91, 0xE8, 0xF1);
|
||||
|
||||
public Guid PowerSchemePersonality { get; } = new Guid(0x245D8541, 0x3943, 0x4422, 0xB0, 0x25, 0x13, 0xA7, 0x84, 0xF6, 0x79, 0xB7);
|
||||
|
||||
// The Following 3 Guids are the POWERBROADCAST_SETTING.Data result of PowerSchemePersonality
|
||||
public Guid MinPowerSavings { get; } = new Guid("8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c");
|
||||
public Guid MaxPowerSavings { get; } = new Guid("a1841308-3541-4fab-bc81-f71556f20b4a");
|
||||
public Guid TypicalPowerSavings { get; } = new Guid("381b4222-f694-41f0-9685-ff5bb260df2e");
|
||||
}
|
||||
|
||||
|
||||
public const int KEYEVENTF_EXTENDEDKEY = 1;
|
||||
public const int KEYEVENTF_KEYUP = 2;
|
||||
@@ -402,6 +455,15 @@ public class NativeMethods
|
||||
static readonly Guid GUID_CPU = new Guid("54533251-82be-4824-96c1-47b60b740d00");
|
||||
static readonly Guid GUID_BOOST = new Guid("be337238-0d82-4146-a960-4f3749d470c7");
|
||||
|
||||
[DllImportAttribute("powrprof.dll", EntryPoint = "PowerGetActualOverlayScheme")]
|
||||
public static extern uint PowerGetActualOverlayScheme(out Guid ActualOverlayGuid);
|
||||
|
||||
[DllImportAttribute("powrprof.dll", EntryPoint = "PowerGetEffectiveOverlayScheme")]
|
||||
public static extern uint PowerGetEffectiveOverlayScheme(out Guid EffectiveOverlayGuid);
|
||||
|
||||
[DllImportAttribute("powrprof.dll", EntryPoint = "PowerSetActiveOverlayScheme")]
|
||||
public static extern uint PowerSetActiveOverlayScheme(Guid OverlaySchemeGuid);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public struct DEVMODE
|
||||
{
|
||||
@@ -490,34 +552,36 @@ public class NativeMethods
|
||||
|
||||
foreach (var device in devices)
|
||||
{
|
||||
if (device.outputTechnology == DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY.DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL)
|
||||
if (device.outputTechnology == DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY.DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL ||
|
||||
device.outputTechnology == DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY.DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DISPLAYPORT_EMBEDDED)
|
||||
{
|
||||
displayNum = count;
|
||||
}
|
||||
count++;
|
||||
//Debug.WriteLine(device.outputTechnology);
|
||||
//Debug.WriteLine(device.monitorFriendlyDeviceName);
|
||||
//Logger.WriteLine(device.outputTechnology.ToString());
|
||||
//Logger.WriteLine(device.monitorFriendlyDeviceName);
|
||||
}
|
||||
|
||||
if (Screen.AllScreens.Length != count)
|
||||
{
|
||||
Debug.WriteLine("Mismatch between enumerated and available screens");
|
||||
return null;
|
||||
}
|
||||
var screens = Screen.AllScreens;
|
||||
|
||||
if (screens.Length != count) return null;
|
||||
|
||||
count = 0;
|
||||
foreach (var screen in Screen.AllScreens)
|
||||
foreach (var screen in screens)
|
||||
{
|
||||
if (count == displayNum)
|
||||
{
|
||||
laptopScreen = screen.DeviceName;
|
||||
}
|
||||
//Debug.WriteLine(screen.DeviceName);
|
||||
//Logger.WriteLine(screen.DeviceName);
|
||||
count++;
|
||||
}
|
||||
} catch
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine("Can't find internal screen");
|
||||
Logger.WriteLine(ex.ToString());
|
||||
Logger.WriteLine("Can't detect internal screen");
|
||||
//laptopScreen = Screen.PrimaryScreen.DeviceName;
|
||||
}
|
||||
|
||||
|
||||
@@ -596,6 +660,7 @@ public class NativeMethods
|
||||
|
||||
PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid);
|
||||
|
||||
/*
|
||||
var hrDC = PowerWriteDCValueIndex(
|
||||
IntPtr.Zero,
|
||||
activeSchemeGuid,
|
||||
@@ -604,7 +669,23 @@ public class NativeMethods
|
||||
boost);
|
||||
|
||||
PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid);
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
public static void SetPowerScheme(int mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case 0: // balanced
|
||||
PowerSetActiveOverlayScheme(new Guid("00000000-0000-0000-0000-000000000000"));
|
||||
break;
|
||||
case 1: // turbo
|
||||
PowerSetActiveOverlayScheme(new Guid("ded574b5-45a0-4f42-8737-46345c09c238"));
|
||||
break;
|
||||
case 2: //silent
|
||||
PowerSetActiveOverlayScheme(new Guid("961cc777-2547-4f9d-8174-7d86181b8a7a"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,70 +1,14 @@
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Management;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text.Json;
|
||||
|
||||
public class HardwareMonitor
|
||||
{
|
||||
|
||||
public static float? cpuTemp = -1;
|
||||
public static float? batteryDischarge = -1;
|
||||
|
||||
|
||||
public static void ReadSensors()
|
||||
{
|
||||
cpuTemp = -1;
|
||||
batteryDischarge = -1;
|
||||
|
||||
try
|
||||
{
|
||||
var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true);
|
||||
cpuTemp = ct.NextValue() - 273;
|
||||
ct.Dispose();
|
||||
|
||||
var cb = new PerformanceCounter("Power Meter", "Power", "Power Meter (0)", true);
|
||||
batteryDischarge = cb.NextValue() / 1000;
|
||||
cb.Dispose();
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.WriteLine("Failed reading sensors");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace GHelper
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
|
||||
// Native methods for sleep detection
|
||||
|
||||
[DllImport("Powrprof.dll", SetLastError = true)]
|
||||
static extern uint PowerRegisterSuspendResumeNotification(uint flags, ref DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS receipient, ref IntPtr registrationHandle);
|
||||
|
||||
|
||||
private const int WM_POWERBROADCAST = 536; // (0x218)
|
||||
private const int PBT_APMPOWERSTATUSCHANGE = 10; // (0xA) - Power status has changed.
|
||||
private const int PBT_APMRESUMEAUTOMATIC = 18; // (0x12) - Operation is resuming automatically from a low-power state.This message is sent every time the system resumes.
|
||||
private const int PBT_APMRESUMESUSPEND = 7; // (0x7) - Operation is resuming from a low-power state.This message is sent after PBT_APMRESUMEAUTOMATIC if the resume is triggered by user input, such as pressing a key.
|
||||
private const int PBT_APMSUSPEND = 4; // (0x4) - System is suspending operation.
|
||||
private const int PBT_POWERSETTINGCHANGE = 32787; // (0x8013) - A power setting change event has been received.
|
||||
private const int DEVICE_NOTIFY_CALLBACK = 2;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS
|
||||
{
|
||||
public DeviceNotifyCallbackRoutine Callback;
|
||||
public IntPtr Context;
|
||||
}
|
||||
|
||||
public delegate int DeviceNotifyCallbackRoutine(IntPtr context, int type, IntPtr setting);
|
||||
|
||||
//
|
||||
|
||||
public static NotifyIcon trayIcon = new NotifyIcon
|
||||
{
|
||||
@@ -79,6 +23,11 @@ namespace GHelper
|
||||
public static SettingsForm settingsForm = new SettingsForm();
|
||||
public static ToastForm toast = new ToastForm();
|
||||
|
||||
private static IntPtr unRegPowerNotify;
|
||||
private static IntPtr ds;
|
||||
|
||||
private static long lastAuto;
|
||||
|
||||
// The main entry point for the application
|
||||
public static void Main()
|
||||
{
|
||||
@@ -101,6 +50,8 @@ namespace GHelper
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
|
||||
ds = settingsForm.Handle;
|
||||
|
||||
trayIcon.MouseClick += TrayIcon_MouseClick; ;
|
||||
|
||||
wmi.SubscribeToEvents(WatcherEventArrived);
|
||||
@@ -114,49 +65,20 @@ namespace GHelper
|
||||
settingsForm.SetStartupCheck(Startup.IsScheduled());
|
||||
|
||||
SetAutoModes();
|
||||
HardwareMonitor.RecreateGpuTemperatureProvider();
|
||||
|
||||
IntPtr registrationHandle = new IntPtr();
|
||||
DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS recipient = new DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS();
|
||||
recipient.Callback = new DeviceNotifyCallbackRoutine(DeviceNotifyCallback);
|
||||
recipient.Context = IntPtr.Zero;
|
||||
|
||||
IntPtr pRecipient = Marshal.AllocHGlobal(Marshal.SizeOf(recipient));
|
||||
Marshal.StructureToPtr(recipient, pRecipient, false);
|
||||
|
||||
uint result = PowerRegisterSuspendResumeNotification(DEVICE_NOTIFY_CALLBACK, ref recipient, ref registrationHandle);
|
||||
// Subscribing for monitor power on events
|
||||
var settingGuid = new NativeMethods.PowerSettingGuid();
|
||||
unRegPowerNotify = NativeMethods.RegisterPowerSettingNotification(ds, settingGuid.ConsoleDisplayState, NativeMethods.DEVICE_NOTIFY_WINDOW_HANDLE);
|
||||
|
||||
// Subscribing for system power change events
|
||||
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
||||
|
||||
IntPtr ds = settingsForm.Handle;
|
||||
|
||||
CheckForUpdates();
|
||||
|
||||
Application.Run();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static int DeviceNotifyCallback(IntPtr context, int type, IntPtr setting)
|
||||
{
|
||||
//Debug.WriteLine($"Power callback type: {type}");
|
||||
switch (type)
|
||||
{
|
||||
case PBT_APMRESUMEAUTOMATIC:
|
||||
settingsForm.BeginInvoke(delegate
|
||||
{
|
||||
// Fix for bugging buios on wake up
|
||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, (config.getConfig("performance_mode")+1) % 3);
|
||||
Thread.Sleep(500);
|
||||
|
||||
SetAutoModes();
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static async void CheckForUpdates()
|
||||
{
|
||||
|
||||
@@ -172,7 +94,7 @@ namespace GHelper
|
||||
var config = JsonSerializer.Deserialize<JsonElement>(json);
|
||||
var tag = config.GetProperty("tag_name").ToString().Replace("v", "");
|
||||
var url = config.GetProperty("assets")[0].GetProperty("browser_download_url").ToString();
|
||||
|
||||
|
||||
var gitVersion = new Version(tag);
|
||||
var appVersion = new Version(assembly);
|
||||
|
||||
@@ -183,30 +105,38 @@ namespace GHelper
|
||||
}
|
||||
|
||||
}
|
||||
} catch {
|
||||
Debug.WriteLine("Failed to get update");
|
||||
}
|
||||
catch
|
||||
{
|
||||
Logger.WriteLine("Failed to get update");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static void SetAutoModes()
|
||||
public static void SetAutoModes()
|
||||
{
|
||||
|
||||
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastAuto) < 1000) return;
|
||||
lastAuto = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
|
||||
PowerLineStatus isPlugged = SystemInformation.PowerStatus.PowerLineStatus;
|
||||
|
||||
Debug.WriteLine(isPlugged.ToString());
|
||||
Logger.WriteLine("AutoSetting for " + isPlugged.ToString());
|
||||
|
||||
settingsForm.SetBatteryChargeLimit(config.getConfig("charge_limit"));
|
||||
|
||||
settingsForm.AutoPerformance(isPlugged);
|
||||
settingsForm.AutoGPUMode(isPlugged);
|
||||
|
||||
bool switched = settingsForm.AutoGPUMode(isPlugged);
|
||||
if (!switched) settingsForm.AutoScreen(isPlugged);
|
||||
|
||||
settingsForm.SetMatrix(isPlugged);
|
||||
|
||||
}
|
||||
|
||||
private static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
||||
{
|
||||
Logger.WriteLine("Windows - Power Mode Changed");
|
||||
SetAutoModes();
|
||||
}
|
||||
|
||||
@@ -223,7 +153,7 @@ namespace GHelper
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.WriteLine("Failed to run " + fileName);
|
||||
Logger.WriteLine("Failed to run " + fileName);
|
||||
}
|
||||
|
||||
|
||||
@@ -300,7 +230,7 @@ namespace GHelper
|
||||
|
||||
int EventID = int.Parse(e.NewEvent["EventID"].ToString());
|
||||
|
||||
Debug.WriteLine(EventID);
|
||||
Logger.WriteLine("WMI event " + EventID);
|
||||
|
||||
switch (EventID)
|
||||
{
|
||||
@@ -348,6 +278,7 @@ namespace GHelper
|
||||
static void OnExit(object sender, EventArgs e)
|
||||
{
|
||||
trayIcon.Visible = false;
|
||||
NativeMethods.UnregisterPowerSettingNotification(unRegPowerNotify);
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
7
app/Properties/launchSettings.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"profiles": {
|
||||
"GHelper": {
|
||||
"commandName": "Project"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 220 KiB After Width: | Height: | Size: 220 KiB |
|
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 421 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 515 B After Width: | Height: | Size: 515 B |
|
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 260 B |
|
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 428 B |
|
Before Width: | Height: | Size: 710 B After Width: | Height: | Size: 710 B |
|
Before Width: | Height: | Size: 885 B After Width: | Height: | Size: 885 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 400 B After Width: | Height: | Size: 400 B |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
78
app/RoundedButton.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
using System.ComponentModel;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
namespace CustomControls
|
||||
{
|
||||
public class RoundedButton : Button
|
||||
{
|
||||
//Fields
|
||||
private int borderSize = 5;
|
||||
private int borderRadius = 5;
|
||||
private bool activated = false;
|
||||
private Color borderColor = Color.Transparent;
|
||||
|
||||
public Color BorderColor
|
||||
{
|
||||
get { return borderColor; }
|
||||
set
|
||||
{
|
||||
borderColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool Activated
|
||||
{
|
||||
get { return activated; }
|
||||
set
|
||||
{
|
||||
if (activated != value)
|
||||
this.Invalidate();
|
||||
activated = value;
|
||||
}
|
||||
}
|
||||
|
||||
public RoundedButton()
|
||||
{
|
||||
this.FlatStyle = FlatStyle.Flat;
|
||||
this.FlatAppearance.BorderSize = 0;
|
||||
}
|
||||
|
||||
private GraphicsPath GetFigurePath(Rectangle rect, int radius)
|
||||
{
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
float curveSize = radius * 2F;
|
||||
|
||||
path.StartFigure();
|
||||
path.AddArc(rect.X, rect.Y, curveSize, curveSize, 180, 90);
|
||||
path.AddArc(rect.Right - curveSize, rect.Y, curveSize, curveSize, 270, 90);
|
||||
path.AddArc(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize, 0, 90);
|
||||
path.AddArc(rect.X, rect.Bottom - curveSize, curveSize, curveSize, 90, 90);
|
||||
path.CloseFigure();
|
||||
return path;
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs pevent)
|
||||
{
|
||||
base.OnPaint(pevent);
|
||||
|
||||
Rectangle rectSurface = this.ClientRectangle;
|
||||
Rectangle rectBorder = Rectangle.Inflate(rectSurface, -borderSize, -borderSize);
|
||||
|
||||
Color borderDrawColor = activated ? borderColor : Color.Transparent;
|
||||
|
||||
using (GraphicsPath pathSurface = GetFigurePath(rectSurface, borderRadius+borderSize))
|
||||
using (GraphicsPath pathBorder = GetFigurePath(rectBorder, borderRadius))
|
||||
using (Pen penSurface = new Pen(this.Parent.BackColor, borderSize))
|
||||
using (Pen penBorder = new Pen(borderDrawColor, borderSize))
|
||||
{
|
||||
penBorder.Alignment = PenAlignment.Outset;
|
||||
pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
this.Region = new Region(pathSurface);
|
||||
pevent.Graphics.DrawPath(penSurface, pathSurface);
|
||||
pevent.Graphics.DrawPath(penBorder, pathBorder);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
117
Settings.Designer.cs → app/Settings.Designer.cs
generated
@@ -1,4 +1,6 @@
|
||||
namespace GHelper
|
||||
using CustomControls;
|
||||
|
||||
namespace GHelper
|
||||
{
|
||||
partial class SettingsForm
|
||||
{
|
||||
@@ -52,23 +54,23 @@
|
||||
labelPerf = new Label();
|
||||
labelCPUFan = new Label();
|
||||
tablePerf = new TableLayoutPanel();
|
||||
buttonTurbo = new Button();
|
||||
buttonBalanced = new Button();
|
||||
buttonSilent = new Button();
|
||||
buttonTurbo = new RoundedButton();
|
||||
buttonBalanced = new RoundedButton();
|
||||
buttonSilent = new RoundedButton();
|
||||
panelGPU = new Panel();
|
||||
checkGPU = new CheckBox();
|
||||
pictureGPU = new PictureBox();
|
||||
labelGPU = new Label();
|
||||
labelGPUFan = new Label();
|
||||
tableGPU = new TableLayoutPanel();
|
||||
buttonUltimate = new Button();
|
||||
buttonStandard = new Button();
|
||||
buttonEco = new Button();
|
||||
buttonUltimate = new RoundedButton();
|
||||
buttonStandard = new RoundedButton();
|
||||
buttonEco = new RoundedButton();
|
||||
panelScreen = new Panel();
|
||||
checkScreen = new CheckBox();
|
||||
tableScreen = new TableLayoutPanel();
|
||||
button120Hz = new Button();
|
||||
button60Hz = new Button();
|
||||
button120Hz = new RoundedButton();
|
||||
button60Hz = new RoundedButton();
|
||||
pictureScreen = new PictureBox();
|
||||
labelSreen = new Label();
|
||||
panelKeyboard = new Panel();
|
||||
@@ -112,7 +114,7 @@
|
||||
panelMatrix.Controls.Add(pictureMatrix);
|
||||
panelMatrix.Controls.Add(labelMatrix);
|
||||
panelMatrix.Dock = DockStyle.Top;
|
||||
panelMatrix.Location = new Point(16, 814);
|
||||
panelMatrix.Location = new Point(16, 806);
|
||||
panelMatrix.Margin = new Padding(4);
|
||||
panelMatrix.Name = "panelMatrix";
|
||||
panelMatrix.Size = new Size(722, 180);
|
||||
@@ -193,7 +195,7 @@
|
||||
//
|
||||
pictureMatrix.BackgroundImage = Properties.Resources.icons8_matrix_desktop_48;
|
||||
pictureMatrix.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
pictureMatrix.Location = new Point(29, 10);
|
||||
pictureMatrix.Location = new Point(25, 10);
|
||||
pictureMatrix.Margin = new Padding(4, 2, 4, 2);
|
||||
pictureMatrix.Name = "pictureMatrix";
|
||||
pictureMatrix.Size = new Size(36, 36);
|
||||
@@ -204,7 +206,7 @@
|
||||
//
|
||||
labelMatrix.AutoSize = true;
|
||||
labelMatrix.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
labelMatrix.Location = new Point(68, 12);
|
||||
labelMatrix.Location = new Point(64, 12);
|
||||
labelMatrix.Margin = new Padding(4, 0, 4, 0);
|
||||
labelMatrix.Name = "labelMatrix";
|
||||
labelMatrix.Size = new Size(170, 32);
|
||||
@@ -219,7 +221,7 @@
|
||||
panelBattery.Controls.Add(labelBatteryTitle);
|
||||
panelBattery.Controls.Add(trackBattery);
|
||||
panelBattery.Dock = DockStyle.Top;
|
||||
panelBattery.Location = new Point(16, 994);
|
||||
panelBattery.Location = new Point(16, 986);
|
||||
panelBattery.Margin = new Padding(4);
|
||||
panelBattery.Name = "panelBattery";
|
||||
panelBattery.Size = new Size(722, 148);
|
||||
@@ -252,7 +254,7 @@
|
||||
//
|
||||
pictureBattery.BackgroundImage = (Image)resources.GetObject("pictureBattery.BackgroundImage");
|
||||
pictureBattery.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
pictureBattery.Location = new Point(29, 10);
|
||||
pictureBattery.Location = new Point(25, 10);
|
||||
pictureBattery.Margin = new Padding(4, 2, 4, 2);
|
||||
pictureBattery.Name = "pictureBattery";
|
||||
pictureBattery.Size = new Size(36, 38);
|
||||
@@ -262,7 +264,7 @@
|
||||
// labelBatteryTitle
|
||||
//
|
||||
labelBatteryTitle.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
labelBatteryTitle.Location = new Point(70, 12);
|
||||
labelBatteryTitle.Location = new Point(66, 12);
|
||||
labelBatteryTitle.Margin = new Padding(4, 0, 4, 0);
|
||||
labelBatteryTitle.Name = "labelBatteryTitle";
|
||||
labelBatteryTitle.Size = new Size(408, 36);
|
||||
@@ -290,7 +292,7 @@
|
||||
panelFooter.Controls.Add(buttonQuit);
|
||||
panelFooter.Controls.Add(checkStartup);
|
||||
panelFooter.Dock = DockStyle.Top;
|
||||
panelFooter.Location = new Point(16, 1142);
|
||||
panelFooter.Location = new Point(16, 1134);
|
||||
panelFooter.Margin = new Padding(4);
|
||||
panelFooter.Name = "panelFooter";
|
||||
panelFooter.Size = new Size(722, 64);
|
||||
@@ -330,7 +332,7 @@
|
||||
panelPerformance.Location = new Point(16, 16);
|
||||
panelPerformance.Margin = new Padding(0);
|
||||
panelPerformance.Name = "panelPerformance";
|
||||
panelPerformance.Size = new Size(722, 228);
|
||||
panelPerformance.Size = new Size(722, 220);
|
||||
panelPerformance.TabIndex = 36;
|
||||
//
|
||||
// buttonFans
|
||||
@@ -351,7 +353,7 @@
|
||||
picturePerf.BackgroundImage = (Image)resources.GetObject("picturePerf.BackgroundImage");
|
||||
picturePerf.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
picturePerf.InitialImage = null;
|
||||
picturePerf.Location = new Point(29, 10);
|
||||
picturePerf.Location = new Point(25, 10);
|
||||
picturePerf.Margin = new Padding(4, 2, 4, 2);
|
||||
picturePerf.Name = "picturePerf";
|
||||
picturePerf.Size = new Size(36, 38);
|
||||
@@ -362,7 +364,7 @@
|
||||
//
|
||||
labelPerf.AutoSize = true;
|
||||
labelPerf.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
labelPerf.Location = new Point(68, 12);
|
||||
labelPerf.Location = new Point(64, 12);
|
||||
labelPerf.Margin = new Padding(4, 0, 4, 0);
|
||||
labelPerf.Name = "labelPerf";
|
||||
labelPerf.Size = new Size(234, 32);
|
||||
@@ -383,6 +385,8 @@
|
||||
// tablePerf
|
||||
//
|
||||
tablePerf.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
tablePerf.AutoScroll = true;
|
||||
tablePerf.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
tablePerf.ColumnCount = 3;
|
||||
tablePerf.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F));
|
||||
tablePerf.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F));
|
||||
@@ -400,11 +404,14 @@
|
||||
//
|
||||
// buttonTurbo
|
||||
//
|
||||
buttonTurbo.Activated = false;
|
||||
buttonTurbo.BackColor = SystemColors.ControlLightLight;
|
||||
buttonTurbo.BorderColor = Color.Transparent;
|
||||
buttonTurbo.Dock = DockStyle.Fill;
|
||||
buttonTurbo.FlatAppearance.BorderColor = Color.FromArgb(192, 0, 0);
|
||||
buttonTurbo.FlatAppearance.BorderSize = 0;
|
||||
buttonTurbo.FlatStyle = FlatStyle.Flat;
|
||||
buttonTurbo.ForeColor = SystemColors.ControlText;
|
||||
buttonTurbo.Location = new Point(464, 12);
|
||||
buttonTurbo.Margin = new Padding(8, 12, 8, 12);
|
||||
buttonTurbo.Name = "buttonTurbo";
|
||||
@@ -415,11 +422,14 @@
|
||||
//
|
||||
// buttonBalanced
|
||||
//
|
||||
buttonBalanced.Activated = false;
|
||||
buttonBalanced.BackColor = SystemColors.ControlLightLight;
|
||||
buttonBalanced.BorderColor = Color.Transparent;
|
||||
buttonBalanced.Dock = DockStyle.Fill;
|
||||
buttonBalanced.FlatAppearance.BorderColor = Color.FromArgb(0, 0, 192);
|
||||
buttonBalanced.FlatAppearance.BorderSize = 0;
|
||||
buttonBalanced.FlatStyle = FlatStyle.Flat;
|
||||
buttonBalanced.ForeColor = SystemColors.ControlText;
|
||||
buttonBalanced.Location = new Point(236, 12);
|
||||
buttonBalanced.Margin = new Padding(8, 12, 8, 12);
|
||||
buttonBalanced.Name = "buttonBalanced";
|
||||
@@ -430,12 +440,15 @@
|
||||
//
|
||||
// buttonSilent
|
||||
//
|
||||
buttonSilent.Activated = false;
|
||||
buttonSilent.BackColor = SystemColors.ControlLightLight;
|
||||
buttonSilent.BorderColor = Color.Transparent;
|
||||
buttonSilent.CausesValidation = false;
|
||||
buttonSilent.Dock = DockStyle.Fill;
|
||||
buttonSilent.FlatAppearance.BorderColor = Color.FromArgb(0, 192, 192);
|
||||
buttonSilent.FlatAppearance.BorderSize = 0;
|
||||
buttonSilent.FlatStyle = FlatStyle.Flat;
|
||||
buttonSilent.ForeColor = SystemColors.ControlText;
|
||||
buttonSilent.Location = new Point(8, 12);
|
||||
buttonSilent.Margin = new Padding(8, 12, 8, 12);
|
||||
buttonSilent.Name = "buttonSilent";
|
||||
@@ -452,7 +465,7 @@
|
||||
panelGPU.Controls.Add(labelGPUFan);
|
||||
panelGPU.Controls.Add(tableGPU);
|
||||
panelGPU.Dock = DockStyle.Top;
|
||||
panelGPU.Location = new Point(16, 244);
|
||||
panelGPU.Location = new Point(16, 236);
|
||||
panelGPU.Margin = new Padding(4);
|
||||
panelGPU.Name = "panelGPU";
|
||||
panelGPU.Size = new Size(722, 216);
|
||||
@@ -462,7 +475,7 @@
|
||||
//
|
||||
checkGPU.AutoSize = true;
|
||||
checkGPU.ForeColor = SystemColors.GrayText;
|
||||
checkGPU.Location = new Point(27, 154);
|
||||
checkGPU.Location = new Point(27, 155);
|
||||
checkGPU.Margin = new Padding(4, 2, 4, 2);
|
||||
checkGPU.Name = "checkGPU";
|
||||
checkGPU.Size = new Size(550, 36);
|
||||
@@ -474,7 +487,7 @@
|
||||
//
|
||||
pictureGPU.BackgroundImage = (Image)resources.GetObject("pictureGPU.BackgroundImage");
|
||||
pictureGPU.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
pictureGPU.Location = new Point(29, 10);
|
||||
pictureGPU.Location = new Point(25, 10);
|
||||
pictureGPU.Margin = new Padding(4, 2, 4, 2);
|
||||
pictureGPU.Name = "pictureGPU";
|
||||
pictureGPU.Size = new Size(36, 38);
|
||||
@@ -485,7 +498,7 @@
|
||||
//
|
||||
labelGPU.AutoSize = true;
|
||||
labelGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
labelGPU.Location = new Point(70, 12);
|
||||
labelGPU.Location = new Point(66, 12);
|
||||
labelGPU.Margin = new Padding(4, 0, 4, 0);
|
||||
labelGPU.Name = "labelGPU";
|
||||
labelGPU.Size = new Size(136, 32);
|
||||
@@ -506,6 +519,8 @@
|
||||
// tableGPU
|
||||
//
|
||||
tableGPU.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
tableGPU.AutoSize = true;
|
||||
tableGPU.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
tableGPU.ColumnCount = 3;
|
||||
tableGPU.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F));
|
||||
tableGPU.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F));
|
||||
@@ -523,10 +538,13 @@
|
||||
//
|
||||
// buttonUltimate
|
||||
//
|
||||
buttonUltimate.Activated = false;
|
||||
buttonUltimate.BackColor = SystemColors.ControlLightLight;
|
||||
buttonUltimate.BorderColor = Color.Transparent;
|
||||
buttonUltimate.Dock = DockStyle.Fill;
|
||||
buttonUltimate.FlatAppearance.BorderSize = 0;
|
||||
buttonUltimate.FlatStyle = FlatStyle.Flat;
|
||||
buttonUltimate.ForeColor = SystemColors.ControlText;
|
||||
buttonUltimate.Location = new Point(464, 12);
|
||||
buttonUltimate.Margin = new Padding(8, 12, 8, 12);
|
||||
buttonUltimate.Name = "buttonUltimate";
|
||||
@@ -537,10 +555,13 @@
|
||||
//
|
||||
// buttonStandard
|
||||
//
|
||||
buttonStandard.Activated = false;
|
||||
buttonStandard.BackColor = SystemColors.ControlLightLight;
|
||||
buttonStandard.BorderColor = Color.Transparent;
|
||||
buttonStandard.Dock = DockStyle.Fill;
|
||||
buttonStandard.FlatAppearance.BorderSize = 0;
|
||||
buttonStandard.FlatStyle = FlatStyle.Flat;
|
||||
buttonStandard.ForeColor = SystemColors.ControlText;
|
||||
buttonStandard.Location = new Point(236, 12);
|
||||
buttonStandard.Margin = new Padding(8, 12, 8, 12);
|
||||
buttonStandard.Name = "buttonStandard";
|
||||
@@ -551,11 +572,14 @@
|
||||
//
|
||||
// buttonEco
|
||||
//
|
||||
buttonEco.Activated = false;
|
||||
buttonEco.BackColor = SystemColors.ControlLightLight;
|
||||
buttonEco.BorderColor = Color.Transparent;
|
||||
buttonEco.CausesValidation = false;
|
||||
buttonEco.Dock = DockStyle.Fill;
|
||||
buttonEco.FlatAppearance.BorderSize = 0;
|
||||
buttonEco.FlatStyle = FlatStyle.Flat;
|
||||
buttonEco.ForeColor = SystemColors.ControlText;
|
||||
buttonEco.Location = new Point(8, 12);
|
||||
buttonEco.Margin = new Padding(8, 12, 8, 12);
|
||||
buttonEco.Name = "buttonEco";
|
||||
@@ -571,7 +595,7 @@
|
||||
panelScreen.Controls.Add(pictureScreen);
|
||||
panelScreen.Controls.Add(labelSreen);
|
||||
panelScreen.Dock = DockStyle.Top;
|
||||
panelScreen.Location = new Point(16, 460);
|
||||
panelScreen.Location = new Point(16, 452);
|
||||
panelScreen.Margin = new Padding(4);
|
||||
panelScreen.Name = "panelScreen";
|
||||
panelScreen.Size = new Size(722, 200);
|
||||
@@ -581,7 +605,7 @@
|
||||
//
|
||||
checkScreen.AutoSize = true;
|
||||
checkScreen.ForeColor = SystemColors.GrayText;
|
||||
checkScreen.Location = new Point(27, 153);
|
||||
checkScreen.Location = new Point(27, 154);
|
||||
checkScreen.Margin = new Padding(4, 2, 4, 2);
|
||||
checkScreen.Name = "checkScreen";
|
||||
checkScreen.Size = new Size(527, 36);
|
||||
@@ -592,6 +616,8 @@
|
||||
// tableScreen
|
||||
//
|
||||
tableScreen.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
tableScreen.AutoSize = true;
|
||||
tableScreen.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
tableScreen.ColumnCount = 3;
|
||||
tableScreen.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F));
|
||||
tableScreen.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F));
|
||||
@@ -608,11 +634,13 @@
|
||||
//
|
||||
// button120Hz
|
||||
//
|
||||
button120Hz.Activated = false;
|
||||
button120Hz.BackColor = SystemColors.ControlLightLight;
|
||||
button120Hz.BorderColor = Color.Transparent;
|
||||
button120Hz.Dock = DockStyle.Fill;
|
||||
button120Hz.FlatAppearance.BorderColor = SystemColors.ActiveBorder;
|
||||
button120Hz.FlatAppearance.BorderSize = 0;
|
||||
button120Hz.FlatStyle = FlatStyle.Flat;
|
||||
button120Hz.ForeColor = SystemColors.ControlText;
|
||||
button120Hz.Location = new Point(236, 12);
|
||||
button120Hz.Margin = new Padding(8, 12, 8, 12);
|
||||
button120Hz.Name = "button120Hz";
|
||||
@@ -623,10 +651,11 @@
|
||||
//
|
||||
// button60Hz
|
||||
//
|
||||
button60Hz.Activated = false;
|
||||
button60Hz.BackColor = SystemColors.ControlLightLight;
|
||||
button60Hz.BorderColor = Color.Transparent;
|
||||
button60Hz.CausesValidation = false;
|
||||
button60Hz.Dock = DockStyle.Fill;
|
||||
button60Hz.FlatAppearance.BorderColor = SystemColors.ActiveBorder;
|
||||
button60Hz.FlatAppearance.BorderSize = 0;
|
||||
button60Hz.FlatStyle = FlatStyle.Flat;
|
||||
button60Hz.ForeColor = SystemColors.ControlText;
|
||||
@@ -642,7 +671,7 @@
|
||||
//
|
||||
pictureScreen.BackgroundImage = (Image)resources.GetObject("pictureScreen.BackgroundImage");
|
||||
pictureScreen.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
pictureScreen.Location = new Point(29, 8);
|
||||
pictureScreen.Location = new Point(25, 8);
|
||||
pictureScreen.Margin = new Padding(4, 2, 4, 2);
|
||||
pictureScreen.Name = "pictureScreen";
|
||||
pictureScreen.Size = new Size(36, 38);
|
||||
@@ -653,7 +682,7 @@
|
||||
//
|
||||
labelSreen.AutoSize = true;
|
||||
labelSreen.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
labelSreen.Location = new Point(72, 10);
|
||||
labelSreen.Location = new Point(68, 10);
|
||||
labelSreen.Margin = new Padding(4, 0, 4, 0);
|
||||
labelSreen.Name = "labelSreen";
|
||||
labelSreen.Size = new Size(176, 32);
|
||||
@@ -666,7 +695,7 @@
|
||||
panelKeyboard.Controls.Add(pictureKeyboard);
|
||||
panelKeyboard.Controls.Add(label1);
|
||||
panelKeyboard.Dock = DockStyle.Top;
|
||||
panelKeyboard.Location = new Point(16, 660);
|
||||
panelKeyboard.Location = new Point(16, 652);
|
||||
panelKeyboard.Margin = new Padding(4);
|
||||
panelKeyboard.Name = "panelKeyboard";
|
||||
panelKeyboard.Size = new Size(722, 154);
|
||||
@@ -687,7 +716,7 @@
|
||||
tableLayoutKeyboard.Name = "tableLayoutKeyboard";
|
||||
tableLayoutKeyboard.RowCount = 1;
|
||||
tableLayoutKeyboard.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
||||
tableLayoutKeyboard.Size = new Size(684, 62);
|
||||
tableLayoutKeyboard.Size = new Size(684, 66);
|
||||
tableLayoutKeyboard.TabIndex = 39;
|
||||
//
|
||||
// buttonKeyboard
|
||||
@@ -726,7 +755,7 @@
|
||||
panelColor.Location = new Point(238, 10);
|
||||
panelColor.Margin = new Padding(10);
|
||||
panelColor.Name = "panelColor";
|
||||
panelColor.Size = new Size(208, 42);
|
||||
panelColor.Size = new Size(208, 46);
|
||||
panelColor.TabIndex = 36;
|
||||
//
|
||||
// pictureColor2
|
||||
@@ -768,10 +797,10 @@
|
||||
//
|
||||
pictureKeyboard.BackgroundImage = Properties.Resources.icons8_keyboard_48;
|
||||
pictureKeyboard.BackgroundImageLayout = ImageLayout.Zoom;
|
||||
pictureKeyboard.Location = new Point(29, 16);
|
||||
pictureKeyboard.Location = new Point(27, 16);
|
||||
pictureKeyboard.Margin = new Padding(4, 2, 4, 2);
|
||||
pictureKeyboard.Name = "pictureKeyboard";
|
||||
pictureKeyboard.Size = new Size(36, 36);
|
||||
pictureKeyboard.Size = new Size(32, 36);
|
||||
pictureKeyboard.TabIndex = 33;
|
||||
pictureKeyboard.TabStop = false;
|
||||
//
|
||||
@@ -779,7 +808,7 @@
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
label1.Location = new Point(72, 16);
|
||||
label1.Location = new Point(68, 16);
|
||||
label1.Margin = new Padding(4, 0, 4, 0);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(210, 32);
|
||||
@@ -792,7 +821,7 @@
|
||||
AutoScaleMode = AutoScaleMode.Dpi;
|
||||
AutoSize = true;
|
||||
AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
ClientSize = new Size(754, 1180);
|
||||
ClientSize = new Size(754, 1217);
|
||||
Controls.Add(panelFooter);
|
||||
Controls.Add(panelBattery);
|
||||
Controls.Add(panelMatrix);
|
||||
@@ -862,23 +891,23 @@
|
||||
private Label labelPerf;
|
||||
private Label labelCPUFan;
|
||||
private TableLayoutPanel tablePerf;
|
||||
private Button buttonTurbo;
|
||||
private Button buttonBalanced;
|
||||
private Button buttonSilent;
|
||||
private RoundedButton buttonTurbo;
|
||||
private RoundedButton buttonBalanced;
|
||||
private RoundedButton buttonSilent;
|
||||
private Panel panelGPU;
|
||||
private CheckBox checkGPU;
|
||||
private PictureBox pictureGPU;
|
||||
private Label labelGPU;
|
||||
private Label labelGPUFan;
|
||||
private TableLayoutPanel tableGPU;
|
||||
private Button buttonUltimate;
|
||||
private Button buttonStandard;
|
||||
private Button buttonEco;
|
||||
private RoundedButton buttonUltimate;
|
||||
private RoundedButton buttonStandard;
|
||||
private RoundedButton buttonEco;
|
||||
private Panel panelScreen;
|
||||
private CheckBox checkScreen;
|
||||
private TableLayoutPanel tableScreen;
|
||||
private Button button120Hz;
|
||||
private Button button60Hz;
|
||||
private RoundedButton button120Hz;
|
||||
private RoundedButton button60Hz;
|
||||
private PictureBox pictureScreen;
|
||||
private Label labelSreen;
|
||||
private Panel panelKeyboard;
|
||||
@@ -3,6 +3,7 @@ using System.Diagnostics;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Timers;
|
||||
|
||||
|
||||
namespace GHelper
|
||||
{
|
||||
|
||||
@@ -13,9 +14,6 @@ namespace GHelper
|
||||
static Color colorStandard = Color.FromArgb(255, 58, 174, 239);
|
||||
static Color colorTurbo = Color.FromArgb(255, 255, 32, 32);
|
||||
|
||||
static int buttonInactive = 0;
|
||||
static int buttonActive = 5;
|
||||
|
||||
static System.Timers.Timer aTimer = default!;
|
||||
static System.Timers.Timer matrixTimer = default!;
|
||||
|
||||
@@ -35,13 +33,16 @@ namespace GHelper
|
||||
|
||||
FormClosing += SettingsForm_FormClosing;
|
||||
|
||||
buttonSilent.FlatAppearance.BorderColor = colorEco;
|
||||
buttonBalanced.FlatAppearance.BorderColor = colorStandard;
|
||||
buttonTurbo.FlatAppearance.BorderColor = colorTurbo;
|
||||
buttonSilent.BorderColor = colorEco;
|
||||
buttonBalanced.BorderColor = colorStandard;
|
||||
buttonTurbo.BorderColor = colorTurbo;
|
||||
|
||||
buttonEco.FlatAppearance.BorderColor = colorEco;
|
||||
buttonStandard.FlatAppearance.BorderColor = colorStandard;
|
||||
buttonUltimate.FlatAppearance.BorderColor = colorTurbo;
|
||||
buttonEco.BorderColor = colorEco;
|
||||
buttonStandard.BorderColor = colorStandard;
|
||||
buttonUltimate.BorderColor = colorTurbo;
|
||||
|
||||
button60Hz.BorderColor = SystemColors.ActiveBorder;
|
||||
button120Hz.BorderColor = SystemColors.ActiveBorder;
|
||||
|
||||
buttonSilent.Click += ButtonSilent_Click;
|
||||
buttonBalanced.Click += ButtonBalanced_Click;
|
||||
@@ -97,6 +98,38 @@ namespace GHelper
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
switch (m.Msg)
|
||||
{
|
||||
case NativeMethods.WM_POWERBROADCAST:
|
||||
if (m.WParam == (IntPtr)NativeMethods.PBT_POWERSETTINGCHANGE)
|
||||
{
|
||||
var settings = (NativeMethods.POWERBROADCAST_SETTING)m.GetLParam(typeof(NativeMethods.POWERBROADCAST_SETTING));
|
||||
switch (settings.Data)
|
||||
{
|
||||
case 0:
|
||||
Logger.WriteLine("Monitor Power Off");
|
||||
break;
|
||||
case 1:
|
||||
Logger.WriteLine("Monitor Power On");
|
||||
Program.settingsForm.BeginInvoke(delegate
|
||||
{
|
||||
Program.SetAutoModes();
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
Logger.WriteLine("Monitor Dimmed");
|
||||
break;
|
||||
}
|
||||
}
|
||||
m.Result = (IntPtr)1;
|
||||
break;
|
||||
}
|
||||
base.WndProc(ref m);
|
||||
}
|
||||
|
||||
private void CheckGPU_CheckedChanged(object? sender, EventArgs e)
|
||||
{
|
||||
if (sender is null) return;
|
||||
@@ -508,8 +541,12 @@ namespace GHelper
|
||||
{
|
||||
|
||||
int currentFrequency = NativeMethods.GetRefreshRate();
|
||||
if (currentFrequency < 0) // Laptop screen not detected or has unknown refresh rate
|
||||
|
||||
if (currentFrequency < 0) // Laptop screen not detected or has unknown refresh rate
|
||||
{
|
||||
InitScreen();
|
||||
return;
|
||||
}
|
||||
|
||||
if (frequency >= 1000)
|
||||
{
|
||||
@@ -525,7 +562,7 @@ namespace GHelper
|
||||
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive);
|
||||
|
||||
InitScreen();
|
||||
Debug.WriteLine(frequency);
|
||||
Logger.WriteLine("Screen " + frequency.ToString() + "Hz");
|
||||
|
||||
}
|
||||
|
||||
@@ -559,15 +596,15 @@ namespace GHelper
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.WriteLine("Screen Overdrive not supported");
|
||||
Logger.WriteLine("Screen Overdrive not supported");
|
||||
}
|
||||
|
||||
button60Hz.FlatAppearance.BorderSize = buttonInactive;
|
||||
button120Hz.FlatAppearance.BorderSize = buttonInactive;
|
||||
button60Hz.Activated = false;
|
||||
button120Hz.Activated = false;
|
||||
|
||||
if (frequency == 60)
|
||||
{
|
||||
button60Hz.FlatAppearance.BorderSize = buttonActive;
|
||||
button60Hz.Activated = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -575,7 +612,7 @@ namespace GHelper
|
||||
maxFrequency = frequency;
|
||||
|
||||
Program.config.setConfig("max_frequency", maxFrequency);
|
||||
button120Hz.FlatAppearance.BorderSize = buttonActive;
|
||||
button120Hz.Activated = true;
|
||||
}
|
||||
|
||||
if (maxFrequency > 60)
|
||||
@@ -653,6 +690,11 @@ namespace GHelper
|
||||
if (HardwareMonitor.batteryDischarge > 0)
|
||||
battery = "Discharging: " + Math.Round((decimal)HardwareMonitor.batteryDischarge, 1).ToString() + "W";
|
||||
|
||||
if (HardwareMonitor.gpuTemp != null)
|
||||
{
|
||||
gpuTemp = $": {HardwareMonitor.gpuTemp}°C - ";
|
||||
}
|
||||
|
||||
Program.settingsForm.BeginInvoke(delegate
|
||||
{
|
||||
Program.settingsForm.labelCPUFan.Text = "CPU" + cpuTemp + cpuFan;
|
||||
@@ -680,6 +722,7 @@ namespace GHelper
|
||||
aTimer.Interval = 300;
|
||||
aTimer.Enabled = true;
|
||||
|
||||
//RefreshSensors();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -698,11 +741,13 @@ namespace GHelper
|
||||
if (limit_cpu > ASUSWmi.MaxCPU) return;
|
||||
if (limit_cpu < ASUSWmi.MinCPU) return;
|
||||
|
||||
Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA0, limit_total);
|
||||
Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA1, limit_total);
|
||||
Program.wmi.DeviceSet(ASUSWmi.PPT_CPUB0, limit_cpu);
|
||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_TotalA0) >= 0)
|
||||
Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA0, limit_total);
|
||||
|
||||
Debug.WriteLine(limit_total.ToString() + ", " + limit_cpu.ToString());
|
||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_CPUB0) >= 0)
|
||||
Program.wmi.DeviceSet(ASUSWmi.PPT_CPUB0, limit_cpu);
|
||||
|
||||
Logger.WriteLine("PowerLimits " + limit_total.ToString() + ", " + limit_cpu.ToString());
|
||||
|
||||
|
||||
}
|
||||
@@ -734,22 +779,23 @@ namespace GHelper
|
||||
public void SetPerformanceMode(int PerformanceMode = ASUSWmi.PerformanceBalanced, bool notify = false)
|
||||
{
|
||||
|
||||
buttonSilent.FlatAppearance.BorderSize = buttonInactive;
|
||||
buttonBalanced.FlatAppearance.BorderSize = buttonInactive;
|
||||
buttonTurbo.FlatAppearance.BorderSize = buttonInactive;
|
||||
|
||||
buttonSilent.Activated = false;
|
||||
buttonBalanced.Activated = false;
|
||||
buttonTurbo.Activated = false;
|
||||
|
||||
switch (PerformanceMode)
|
||||
{
|
||||
case ASUSWmi.PerformanceSilent:
|
||||
buttonSilent.FlatAppearance.BorderSize = buttonActive;
|
||||
buttonSilent.Activated = true;
|
||||
perfName = "Silent";
|
||||
break;
|
||||
case ASUSWmi.PerformanceTurbo:
|
||||
buttonTurbo.FlatAppearance.BorderSize = buttonActive;
|
||||
buttonTurbo.Activated = true;
|
||||
perfName = "Turbo";
|
||||
break;
|
||||
default:
|
||||
buttonBalanced.FlatAppearance.BorderSize = buttonActive;
|
||||
buttonBalanced.Activated = true;
|
||||
PerformanceMode = ASUSWmi.PerformanceBalanced;
|
||||
perfName = "Balanced";
|
||||
break;
|
||||
@@ -760,7 +806,7 @@ namespace GHelper
|
||||
Program.config.setConfig("performance_mode", PerformanceMode);
|
||||
|
||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, PerformanceMode);
|
||||
Debug.WriteLine("Perf:" + PerformanceMode);
|
||||
Logger.WriteLine("PerfMode " + perfName + " " + PerformanceMode);
|
||||
|
||||
if (notify && (oldMode != PerformanceMode))
|
||||
{
|
||||
@@ -776,6 +822,13 @@ namespace GHelper
|
||||
|
||||
AutoFansAndPower();
|
||||
|
||||
NativeMethods.SetPowerScheme(PerformanceMode);
|
||||
|
||||
if (NativeMethods.PowerGetEffectiveOverlayScheme(out Guid activeScheme) == 0)
|
||||
{
|
||||
Debug.WriteLine("Effective :" + activeScheme);
|
||||
}
|
||||
|
||||
if (fans != null && fans.Text != "")
|
||||
{
|
||||
fans.InitFans();
|
||||
@@ -815,33 +868,33 @@ namespace GHelper
|
||||
|
||||
}
|
||||
|
||||
public void AutoGPUMode(PowerLineStatus Plugged = PowerLineStatus.Online)
|
||||
public bool AutoGPUMode(PowerLineStatus Plugged = PowerLineStatus.Online)
|
||||
{
|
||||
|
||||
int GpuAuto = Program.config.getConfig("gpu_auto");
|
||||
if (GpuAuto != 1) return;
|
||||
if (GpuAuto != 1) return false;
|
||||
|
||||
int eco = Program.wmi.DeviceGet(ASUSWmi.GPUEco);
|
||||
int mux = Program.wmi.DeviceGet(ASUSWmi.GPUMux);
|
||||
|
||||
if (mux == 0) // GPU in Ultimate, ignore
|
||||
return;
|
||||
return false;
|
||||
else
|
||||
{
|
||||
if (eco == 1 && Plugged == PowerLineStatus.Online) // Eco going Standard on plugged
|
||||
{
|
||||
SetEcoGPU(0);
|
||||
return true;
|
||||
}
|
||||
else if (eco == 0 && Plugged != PowerLineStatus.Online) // Standard going Eco on plugged
|
||||
{
|
||||
SetEcoGPU(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
AutoScreen(Plugged);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public int InitGPUMode()
|
||||
@@ -888,14 +941,26 @@ namespace GHelper
|
||||
new Thread(() =>
|
||||
{
|
||||
Thread.CurrentThread.IsBackground = true;
|
||||
|
||||
if (eco == 1)
|
||||
{
|
||||
string[] tokill = { "EADesktop" };
|
||||
foreach (string kill in tokill)
|
||||
foreach (var process in Process.GetProcessesByName(kill)) process.Kill();
|
||||
}
|
||||
|
||||
Program.wmi.DeviceSet(ASUSWmi.GPUEco, eco);
|
||||
Program.settingsForm.BeginInvoke(delegate
|
||||
{
|
||||
InitGPUMode();
|
||||
HardwareMonitor.RecreateGpuTemperatureProviderWithRetry();
|
||||
Thread.Sleep(500);
|
||||
AutoScreen(SystemInformation.PowerStatus.PowerLineStatus);
|
||||
});
|
||||
}).Start();
|
||||
})
|
||||
{
|
||||
|
||||
}.Start();
|
||||
|
||||
}
|
||||
|
||||
@@ -945,8 +1010,12 @@ namespace GHelper
|
||||
}
|
||||
|
||||
if (changed)
|
||||
{
|
||||
Program.config.setConfig("gpu_mode", GPUMode);
|
||||
|
||||
HardwareMonitor.RecreateGpuTemperatureProviderWithRetry();
|
||||
}
|
||||
|
||||
if (restart)
|
||||
{
|
||||
VisualiseGPUMode(GPUMode);
|
||||
@@ -974,25 +1043,25 @@ namespace GHelper
|
||||
GPUMode = Program.config.getConfig("gpu_mode");
|
||||
}
|
||||
|
||||
buttonEco.FlatAppearance.BorderSize = buttonInactive;
|
||||
buttonStandard.FlatAppearance.BorderSize = buttonInactive;
|
||||
buttonUltimate.FlatAppearance.BorderSize = buttonInactive;
|
||||
buttonEco.Activated = false;
|
||||
buttonStandard.Activated = false;
|
||||
buttonUltimate.Activated = false;
|
||||
|
||||
switch (GPUMode)
|
||||
{
|
||||
case ASUSWmi.GPUModeEco:
|
||||
buttonEco.FlatAppearance.BorderSize = buttonActive;
|
||||
buttonEco.Activated = true;
|
||||
labelGPU.Text = "GPU Mode: iGPU only";
|
||||
Program.trayIcon.Icon = GHelper.Properties.Resources.eco;
|
||||
break;
|
||||
case ASUSWmi.GPUModeUltimate:
|
||||
buttonUltimate.FlatAppearance.BorderSize = buttonActive;
|
||||
buttonUltimate.Activated = true;
|
||||
labelGPU.Text = "GPU Mode: dGPU exclusive";
|
||||
Program.trayIcon.Icon = GHelper.Properties.Resources.ultimate;
|
||||
break;
|
||||
default:
|
||||
buttonStandard.FlatAppearance.BorderSize = buttonActive;
|
||||
labelGPU.Text = "GPU Mode: iGPU and dGPU";
|
||||
buttonStandard.Activated = true;
|
||||
labelGPU.Text = "GPU Mode: iGPU + dGPU";
|
||||
Program.trayIcon.Icon = GHelper.Properties.Resources.standard;
|
||||
break;
|
||||
}
|
||||
@@ -29,6 +29,7 @@ public class Startup
|
||||
|
||||
td.Settings.StopIfGoingOnBatteries = false;
|
||||
td.Settings.DisallowStartIfOnBatteries = false;
|
||||
td.Settings.ExecutionTimeLimit = TimeSpan.Zero;
|
||||
|
||||
Debug.WriteLine(strExeFilePath);
|
||||
Debug.WriteLine(userId);
|
||||
@@ -36,9 +37,9 @@ public class Startup
|
||||
try
|
||||
{
|
||||
TaskService.Instance.RootFolder.RegisterTaskDefinition(taskName, td);
|
||||
} catch
|
||||
} catch (Exception e)
|
||||
{
|
||||
MessageBox.Show("Can't schedule task", "Scheduler Error", MessageBoxButtons.OK);
|
||||
MessageBox.Show(e.ToString(), "Scheduler Error", MessageBoxButtons.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -55,7 +55,7 @@
|
||||
<windowsSettings>
|
||||
<!--<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor/dpiAwareness>-->
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor, System</dpiAwareness>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">System</dpiAwareness>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
|
||||
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
@@ -5,6 +5,7 @@ sc STOP ASUSSoftwareManager
|
||||
sc STOP ASUSSwitch
|
||||
sc STOP ASUSSystemAnalysis
|
||||
sc STOP ASUSSystemDiagnosis
|
||||
sc STOP ArmouryCrateControlInterface
|
||||
|
||||
sc DELETE AsusAppService
|
||||
sc DELETE ASUSLinkNear
|
||||
@@ -13,3 +14,4 @@ sc DELETE ASUSSoftwareManager
|
||||
sc DELETE ASUSSwitch
|
||||
sc DELETE ASUSSystemAnalysis
|
||||
sc DELETE ASUSSystemDiagnosis
|
||||
sc DELETE ArmouryCrateControlInterface
|
||||
108
docs/README.md
Normal file
@@ -0,0 +1,108 @@
|
||||
# [G-Helper (GHelper)](https://github.com/seerge/g-helper)
|
||||
|
||||
[](https://GitHub.com/seerge/g-helper/releases/) [](https://GitHub.com/seerge/g-helper/releases/) [](https://github.com/seerge/g-helper/blob/master/LICENSE)
|
||||
[](https://GitHub.com/seerge/g-helper/stargazers/)
|
||||
|
||||
## Open source Armory Crate alternative for Asus ROG Zephyrus G14, G15, Flow X13, Flow X16, and other models
|
||||
|
||||
A small utility that allows you to do almost everything you could do with Armory Crate but without extra bloat and unnecessary services.
|
||||
|
||||
### :gift: Main advantages
|
||||
|
||||
1. Seamless and automatic GPU switching (without asking you to close all apps, etc)
|
||||
2. All performance modes can be fully customized (with fan curves and PPTs)
|
||||
3. Very lightweight and consumes almost no resources, doesn't install any services. Just a single exe to run
|
||||
|
||||
### [:floppy_disk: Download latest release](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
|
||||
|
||||
If you like this app, please star :star: it on Github and spread a word about it!
|
||||
|
||||

|
||||
|
||||
### :zap: Main features
|
||||
|
||||
1. Built-in **Performance modes**: Silent - Balanced - Turbo (with default fan curves)
|
||||
2. **GPU modes**: Eco -Standard - Ultimate
|
||||
3. Laptop screen refresh rate 60hz or 120hz (144hz, etc depending on the model) with display overdrive (OD)
|
||||
4. Default and custom fan profiles for every performance mode
|
||||
5. Power limits (PPT) for every performance mode
|
||||
6. CPU turbo boost mode
|
||||
7. Keyboard backlit animation and colors
|
||||
8. Anime matrix control thanks to [Starlight](https://github.com/vddCore/Starlight) + some tweaks from my side (including animated GIFs)
|
||||
9. FN+F5 cycles performance modes, FN+F4 cycles keyboard animation modes
|
||||
10. Keybindings for M3 and M4 keys
|
||||
11. Battery charge limit to preserve battery health
|
||||
12. Monitor CPU / GPU temperature, fan speeds and battery discharge rate
|
||||
|
||||
### :apple: Automatic switching of modes when on battery or plugged in
|
||||
- Performance modes (app remembers last mode used on battery or when plugged)
|
||||
- GPU modes (eco on battery, stanard when plugged)
|
||||
- Screen refresh rate (60hz on battery, 120+ hz when plugged)
|
||||
|
||||
To keep auto switching and hotkeys working the app needs to stay in running in the tray. It doesn't consume any resources.
|
||||
|
||||
### :rocket: Performance Modes
|
||||
|
||||
Modes are **same** as in Armory Crate (as they are stored in bios), including default fan curves
|
||||
|
||||
1. Silent (minimal or no fans, 70W PPT total, up to 45W PPT to CPU) + Best power efficiency setting in windows
|
||||
2. Balanced (balanced fans, 100W PPT total, up to 45W PPT to CPU) + Balanced setting in windows
|
||||
3. Turbo (intense fans, 125W PPT total, up to 80W PPT to CPU) + Best performance setting in windows
|
||||
|
||||
PPTs are shown for G14 2022, for other models PPTs will be different as they are set in bios.
|
||||
|
||||
### :video_game: GPU Modes
|
||||
|
||||
1. Eco mode : only low power integrated GPU enabled, iGPU drives built in display
|
||||
2. Standard mode (Windows Hybrid) : iGPU and dGPU enabled, iGPU drives built in display
|
||||
3. Ultimate mode: iGPU and dGPU enabled, but dGPU drives built in display (supported only on G14 2022 model)
|
||||
|
||||
### :question: FAQ
|
||||
|
||||
#### How do I stop Armory Crate install popup appearing every time I press M4 / Rog key?
|
||||
Go to BIOS (F2 on boot), open Advanced Settings (F8) and disable "Armory Control Intrerface"
|
||||
|
||||
#### Why Ultimate GPU mode is not available on my laptop?
|
||||
Ultimate mode is supported (by hardware) only on G14 2022 (and possibly other models from 2022+)
|
||||
|
||||
#### App doesn't start / or crashes, what should I do ?
|
||||
Open "Event Viewer" from start menu, go to Windows Logs -> Application and check for recent Errors mentioning G-Helper. If you see one - please post a [new issue](https://github.com/seerge/g-helper/issues) with all details from this error.
|
||||
|
||||
----------------------------
|
||||
|
||||
### How to install
|
||||
|
||||
1. Download latest release from [**Releases Page**](https://github.com/seerge/g-helper/releases)
|
||||
2. Unzip to a folder of your choice
|
||||
3. Run **GHelper.exe**
|
||||
|
||||
### Dependencies
|
||||
|
||||
- App requires [.NET7](https://dotnet.microsoft.com/en-us/download) to be installed. Most probably you already have it. Otherwise you can [download it](https://dotnet.microsoft.com/en-us/download).
|
||||
|
||||
- I recommend keeping "Asus Optimization Service" running, as it keeps basic laptop hotkeys such as screen or keyboard brightness adjustment working. If you have (or had) MyASUS app installed, that service is most probably still up and running even after MyASUS uninstalls. It's part of [Asus System Control Interface](https://www.asus.com/support/FAQ/1047338/). You can install it, and later disable / remove unnecessary services by running [this bat file](https://raw.githubusercontent.com/seerge/g-helper/main/debloat.bat) as admin.
|
||||
|
||||
- It's not recommended to use an app in combination with Armory Crate, cause they adjust the same settings. You can [uninstall it using it's own uninstall tool](https://dlcdnets.asus.com/pub/ASUS/mb/14Utilities/Armoury_Crate_Uninstall_Tool.zip?model=armoury%20crate). Just in case, you can always install it back later.
|
||||
|
||||
Note: Doesn't need administrator privileges to run!
|
||||
|
||||
-------------------------------
|
||||
|
||||
Designed and developed for Asus Zephyrus G14 2022 (with AMD Radeon iGPU and dGPU). But could and should potentially work for G14 of 2021 and 2020, G15, X FLOW, and other ROG models for relevant and supported features.
|
||||
|
||||
I don't have a Microsoft certificate to sign the app yet, so if you get a warning from Windows Defender on launch (Windows Protected your PC), click More Info -> Run anyway. Alternatively you can compile and run project by yourself using Visual Studio :)
|
||||
|
||||
Settings file is stored at ``%AppData%\GHelper``
|
||||
|
||||
------------------
|
||||
|
||||
Debloating helps to save your battery and keep laptop a bit cooler
|
||||
|
||||

|
||||
|
||||
---------
|
||||
|
||||
**Disclaimers**
|
||||
"ROG", "TUF", and "Armoury Crate" are trademarked by and belong to AsusTek Computer, Inc. I make no claims to these or any assets belonging to AsusTek Computer and use them purely for informational purposes only.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. MISUSE OF THIS SOFTWARE COULD CAUSE SYSTEM INSTABILITY OR MALFUNCTION.
|
||||
4
docs/_config.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
title: G-Helper
|
||||
description: Open source Armory Crate alternative for Asus ROG Zephyrus G14, G15, Flow X13, Flow X16, and other models
|
||||
plugins:
|
||||
- jemoji
|
||||
26
docs/_layouts/default.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ page.lang | default: site.lang | default: "en-US" }}">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
{% seo %}
|
||||
<link rel="stylesheet" href="{{ "/assets/css/style.css?v=" | append: site.github.build_revision | relative_url }}">
|
||||
{% include head-custom.html %}
|
||||
</head>
|
||||
<body>
|
||||
<div class="container-lg px-3 my-5 markdown-body">
|
||||
|
||||
{{ content }}
|
||||
|
||||
{% if site.github.private != true and site.github.license %}
|
||||
<div class="footer border-top border-gray-light mt-5 pt-3 text-right text-gray">
|
||||
This site is open source. {% github_edit_link "Improve this page" %}.
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.0/anchor.min.js" integrity="sha256-lZaRhKri35AyJSypXXs4o6OPFTbTmUoltBbDCbdzegg=" crossorigin="anonymous"></script>
|
||||
<script>anchors.add();</script>
|
||||
</body>
|
||||
</html>
|
||||
BIN
docs/screenshot.png
Normal file
|
After Width: | Height: | Size: 3.6 MiB |
|
Before Width: | Height: | Size: 955 KiB After Width: | Height: | Size: 955 KiB |
BIN
screenshot.png
|
Before Width: | Height: | Size: 2.4 MiB |