Compare commits

...

8 Commits
v0.33 ... v0.35

Author SHA1 Message Date
seerge
cdb633be04 Anime matrix fixes 2023-03-21 11:11:31 +01:00
seerge
7cb9b1f64f Mid Fan support 2023-03-21 01:24:42 +01:00
seerge
06be8c726e Improved Animatrix rendering 2023-03-20 23:27:13 +01:00
seerge
265c6ce417 - 2023-03-20 21:09:11 +01:00
seerge
add852ce5d Animatrix tweaks 2023-03-20 21:07:05 +01:00
seerge
d4a5164b16 - 2023-03-20 19:18:07 +01:00
seerge
14618ee19e Possible fix for theme switching 2023-03-20 19:04:41 +01:00
seerge
0b3a75e373 Minor tweaks 2023-03-20 18:02:38 +01:00
12 changed files with 412 additions and 122 deletions

View File

@@ -24,6 +24,7 @@ public class ASUSWmi
public const uint DevsCPUFanCurve = 0x00110024; public const uint DevsCPUFanCurve = 0x00110024;
public const uint DevsGPUFanCurve = 0x00110025; public const uint DevsGPUFanCurve = 0x00110025;
public const uint DevsMidFanCurve = 0x00110032;
public const int PPT_TotalA0 = 0x001200A0; // Total PPT on 2022 and CPU PPT on 2021 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_EDCA1 = 0x001200A1; // CPU EDC
@@ -185,12 +186,25 @@ public class ASUSWmi
if (curve.Length != 16) return; if (curve.Length != 16) return;
if (curve.All(singleByte => singleByte == 0)) return; if (curve.All(singleByte => singleByte == 0)) return;
Logger.WriteLine("Fans" + ((device == 1) ? "GPU" : "CPU") + " " + BitConverter.ToString(curve)); string name;
if (device == 1) switch (device)
DeviceSet(DevsGPUFanCurve, curve); {
else case 1:
DeviceSet(DevsCPUFanCurve, curve); DeviceSet(DevsGPUFanCurve, curve);
name = "GPU";
break;
case 2:
DeviceSet(DevsMidFanCurve, curve);
name = "Mid";
break;
default:
DeviceSet(DevsCPUFanCurve, curve);
name = "CPU";
break;
}
Logger.WriteLine("Fans" + name + " " + BitConverter.ToString(curve));
} }
public byte[] GetFanCurve(int device, int mode = 0) public byte[] GetFanCurve(int device, int mode = 0)
@@ -205,10 +219,15 @@ public class ASUSWmi
default: fan_mode = 0; break; default: fan_mode = 0; break;
} }
if (device == 1) switch (device)
return DeviceGetBuffer(DevsGPUFanCurve, fan_mode); {
else case 1:
return DeviceGetBuffer(DevsCPUFanCurve, fan_mode); return DeviceGetBuffer(DevsGPUFanCurve, fan_mode);
case 2:
return DeviceGetBuffer(DevsMidFanCurve, fan_mode);
default:
return DeviceGetBuffer(DevsCPUFanCurve, fan_mode);
}
} }

View File

@@ -2,8 +2,8 @@
using Starlight.Communication; using Starlight.Communication;
using System.Diagnostics; using System.Diagnostics;
using System.Text;
using System.Management; using System.Management;
using System.Text;
namespace Starlight.AnimeMatrix namespace Starlight.AnimeMatrix
{ {
@@ -62,41 +62,46 @@ namespace Starlight.AnimeMatrix
Off = 0, Off = 0,
Dim = 1, Dim = 1,
Medium = 2, Medium = 2,
Full = 3 Full = 3,
Super = 4, //test, doesn't work
} }
public class AnimeMatrixDevice : Device public class AnimeMatrixDevice : Device
{ {
private const int UpdatePageLength = 0x0278; int UpdatePageLength = 490;
int LedCount = 1450;
public int LedCount => 1450; byte[] _displayBuffer;
List<byte[]> frames = new List<byte[]>();
private byte[] _displayBuffer = new byte[UpdatePageLength * 3];
private List<byte[]> frames = new List<byte[]>();
private int pages = 3;
public int MaxColumns = 34; public int MaxColumns = 34;
public int MaxRows = 61; public int MaxRows = 61;
public int FullRows = 11; public int FullRows = 11;
public int EmptyFirstRow = 1;
private int frameIndex = 0; private int frameIndex = 0;
public AnimeMatrixDevice() public AnimeMatrixDevice()
: base(0x0B05, 0x193B, 640) : base(0x0B05, 0x193B, 640)
{ {
string model = GetModel(); string model = GetModel();
Debug.WriteLine(model);
if (model is not null && model.Contains("401"))
{
pages = 2;
Logger.WriteLine("Animatrix: " + model);
if (model.Contains("401"))
{
EmptyFirstRow = 1;
FullRows = 6; FullRows = 6;
MaxColumns = 33; MaxColumns = 33;
MaxRows = 55; MaxRows = 55;
LedCount = 1214;
UpdatePageLength = 410;
} }
_displayBuffer = new byte[LedCount];
} }
@@ -119,7 +124,6 @@ namespace Starlight.AnimeMatrix
public void PresentNextFrame() public void PresentNextFrame()
{ {
//Debug.WriteLine(frameIndex);
if (frameIndex >= frames.Count) frameIndex = 0; if (frameIndex >= frames.Count) frameIndex = 0;
_displayBuffer = frames[frameIndex]; _displayBuffer = frames[frameIndex];
Present(); Present();
@@ -143,27 +147,25 @@ namespace Starlight.AnimeMatrix
} }
public int EmptyColumns(int row) public int XStart(int row)
{ {
return (int)Math.Ceiling(Math.Max(0, row - FullRows) / 2.0); return (int)Math.Ceiling(Math.Max(0, row - FullRows) / 2.0);
} }
public int Columns(int row)
public int XEnd(int row)
{ {
EnsureRowInRange(row); if (row == 0) return MaxColumns - EmptyFirstRow;
return MaxColumns - EmptyColumns(row); return MaxColumns;
} }
public int RowToLinearAddress(int row) public int RowToLinearAddress(int row)
{ {
EnsureRowInRange(row); EnsureRowInRange(row);
var ret = 0; int ret = 0;
if (row > 0) for (var i = 0; i < row; i++)
{ ret += XEnd(i) - XStart(i);
for (var i = 0; i < row; i++)
ret += Columns(i);
}
return ret; return ret;
} }
@@ -175,13 +177,13 @@ namespace Starlight.AnimeMatrix
public void SetLedLinear(int address, byte value) public void SetLedLinear(int address, byte value)
{ {
EnsureAddressableLed(address); if (!IsAddressableLed(address)) return;
_displayBuffer[address] = value; _displayBuffer[address] = value;
} }
public void SetLedLinearImmediate(int address, byte value) public void SetLedLinearImmediate(int address, byte value)
{ {
EnsureAddressableLed(address); if (!IsAddressableLed(address)) return;
_displayBuffer[address] = value; _displayBuffer[address] = value;
Set(Packet<AnimeMatrixPacket>(0xC0, 0x02) Set(Packet<AnimeMatrixPacket>(0xC0, 0x02)
@@ -193,13 +195,20 @@ namespace Starlight.AnimeMatrix
Set(Packet<AnimeMatrixPacket>(0xC0, 0x03)); Set(Packet<AnimeMatrixPacket>(0xC0, 0x03));
} }
public void SetLedPlanar(int x, int y, byte value) public int SetLedPlanar(int x, int y, byte value)
{ {
EnsureRowInRange(y); EnsureRowInRange(y);
var start = RowToLinearAddress(y) - EmptyColumns(y); var start = RowToLinearAddress(y) - XStart(y);
if (x > EmptyColumns(y)) if (x >= XStart(y) && x < XEnd(y))
{
//Debug.Write((start + x).ToString("D4") + ",");
SetLedLinear(start + x, value); SetLedLinear(start + x, value);
return start + x;
}
//Debug.Write(" ");
return -1;
} }
public void Clear(bool present = false) public void Clear(bool present = false)
@@ -214,26 +223,23 @@ namespace Starlight.AnimeMatrix
public void Present() public void Present()
{ {
Set(Packet<AnimeMatrixPacket>(0xC0, 0x02) int page = 0;
.AppendData(BitConverter.GetBytes((ushort)(UpdatePageLength * 0 + 1))) int start, end;
.AppendData(BitConverter.GetBytes((ushort)UpdatePageLength))
.AppendData(_displayBuffer[(UpdatePageLength * 0)..(UpdatePageLength * 1)])
);
Set(Packet<AnimeMatrixPacket>(0xC0, 0x02) while (page * UpdatePageLength < LedCount)
.AppendData(BitConverter.GetBytes((ushort)(UpdatePageLength * 1 + 1))) {
.AppendData(BitConverter.GetBytes((ushort)UpdatePageLength)) start = page * UpdatePageLength;
.AppendData(_displayBuffer[(UpdatePageLength * 1)..(UpdatePageLength * 2)]) end = Math.Min(LedCount, (page + 1) * UpdatePageLength);
);
if (pages > 2)
Set(Packet<AnimeMatrixPacket>(0xC0, 0x02) Set(Packet<AnimeMatrixPacket>(0xC0, 0x02)
.AppendData(BitConverter.GetBytes((ushort)(UpdatePageLength * 2 + 1))) .AppendData(BitConverter.GetBytes((ushort)(start + 1)))
.AppendData(BitConverter.GetBytes((ushort)(LedCount - UpdatePageLength * 2))) .AppendData(BitConverter.GetBytes((ushort)(end - start)))
.AppendData( .AppendData(_displayBuffer[start..end])
_displayBuffer[(UpdatePageLength * 2)..(UpdatePageLength * 2 + (LedCount - UpdatePageLength * 2))])
); );
page++;
}
Set(Packet<AnimeMatrixPacket>(0xC0, 0x03)); Set(Packet<AnimeMatrixPacket>(0xC0, 0x03));
} }
@@ -270,6 +276,11 @@ namespace Starlight.AnimeMatrix
Set(Packet<AnimeMatrixPacket>(0xC5, animation.AsByte)); Set(Packet<AnimeMatrixPacket>(0xC5, animation.AsByte));
} }
static int GetColor(Bitmap bmp, int x, int y)
{
var pixel = bmp.GetPixel(Math.Max(0, Math.Min(bmp.Width - 1, x)), Math.Max(0, Math.Min(bmp.Height - 1, y)));
return (Math.Max((pixel.R + pixel.G + pixel.B) / 3 - 10, 0));
}
public void GenerateFrame(Image image) public void GenerateFrame(Image image)
{ {
@@ -289,18 +300,32 @@ namespace Starlight.AnimeMatrix
graph.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; graph.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
graph.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; graph.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
graph.DrawImage(image, ((int)width - scaleWidth), ((int)height - scaleHeight) / 2, scaleWidth, scaleHeight); graph.DrawImage(image, ((int)width - scaleWidth), 0, scaleWidth, scaleHeight);
Bitmap bmp = new Bitmap(canvas, MaxColumns, MaxRows); int addr, counter = 0;
Bitmap bmp = new Bitmap(canvas, MaxColumns * 2, MaxRows);
for (int y = 0; y < bmp.Height; y++) for (int y = 0; y < bmp.Height; y++)
{ {
for (int x = 0; x < bmp.Width; x++) for (int x = 0; x < bmp.Width; x++)
{ {
var pixel = bmp.GetPixel(x, y); if (x % 2 == y % 2)
byte color = (byte)(Math.Max((pixel.R + pixel.G + pixel.B) / 3 - 10, 0)); {
SetLedPlanar(x, y, color); var color = GetColor(bmp, x, y);
//var color2= GetColor(bmp, x+1, y);
addr = SetLedPlanar(x / 2, y, (byte)color);
if (addr != -1) {
if (addr != counter)
Debug.Write("ERROR");
counter++;
}
}
} }
//Debug.Write("\n");
} }
} }
@@ -313,12 +338,9 @@ namespace Starlight.AnimeMatrix
} }
} }
private void EnsureAddressableLed(int address) private bool IsAddressableLed(int address)
{ {
if (address < 0 || address >= LedCount) return (address >= 0 && address < LedCount);
{
throw new IndexOutOfRangeException($"Linear LED address must be in range of [0, {LedCount - 1}].");
}
} }
} }
} }

View File

@@ -6,31 +6,35 @@ public static class ControlHelper
{ {
static bool _invert = false; static bool _invert = false;
static bool _resize = false;
static float _scale = 1; static float _scale = 1;
static Color formBack; static Color formBack;
static Color backMain; static Color backMain;
static Color foreMain; static Color foreMain;
static Color foreAccent;
static Color borderMain; static Color borderMain;
static Color buttonMain; static Color buttonMain;
public static void Adjust(RForm container, float baseScale = 2, bool invert = false) public static void Adjust(RForm container, bool darkTheme = false, bool invert = false)
{ {
_scale = GetDpiScale(container).Value / baseScale;
if (container.darkTheme) if (darkTheme)
{ {
formBack = Color.FromArgb(255, 35, 35, 35); formBack = Color.FromArgb(255, 35, 35, 35);
backMain = Color.FromArgb(255, 50, 50, 50); backMain = Color.FromArgb(255, 50, 50, 50);
foreMain = Color.White; foreMain = Color.White;
foreAccent = Color.FromArgb(255, 100, 100, 100);
borderMain = Color.FromArgb(255, 50, 50, 50); borderMain = Color.FromArgb(255, 50, 50, 50);
buttonMain = Color.FromArgb(255, 100, 100, 100); buttonMain = Color.FromArgb(255, 80, 80, 80);
} }
else else
{ {
formBack = SystemColors.Control; formBack = SystemColors.Control;
backMain = SystemColors.ControlLightLight; backMain = SystemColors.ControlLightLight;
foreMain = SystemColors.ControlText; foreMain = SystemColors.ControlText;
foreAccent = Color.LightGray;
borderMain = Color.LightGray; borderMain = Color.LightGray;
buttonMain = SystemColors.ControlLight; buttonMain = SystemColors.ControlLight;
} }
@@ -43,15 +47,38 @@ public static class ControlHelper
_invert = false; _invert = false;
} }
public static void Resize(RForm container, float baseScale = 2)
{
_scale = GetDpiScale(container).Value / baseScale;
ResizeControls(container.Controls);
}
private static void ResizeControls(Control.ControlCollection controls)
{
foreach (Control control in controls)
{
var button = control as RButton;
if (button != null && button.Image is not null)
button.Image = ResizeImage(button.Image);
var pictureBox = control as PictureBox;
if (pictureBox != null && pictureBox.BackgroundImage is not null)
pictureBox.BackgroundImage = ResizeImage(pictureBox.BackgroundImage);
ResizeControls(control.Controls);
}
}
private static void AdjustControls(Control.ControlCollection controls) private static void AdjustControls(Control.ControlCollection controls)
{ {
foreach (Control control in controls) foreach (Control control in controls)
{ {
var button = control as Button; var button = control as RButton;
if (button != null) if (button != null)
{ {
button.BackColor = backMain; button.BackColor = button.Secondary ? buttonMain : backMain;
button.ForeColor = foreMain; button.ForeColor = foreMain;
button.FlatStyle = FlatStyle.Flat; button.FlatStyle = FlatStyle.Flat;
@@ -62,11 +89,9 @@ public static class ControlHelper
} }
var pictureBox = control as PictureBox; var pictureBox = control as PictureBox;
if (pictureBox != null) if (pictureBox != null && pictureBox.BackgroundImage is not null)
{ pictureBox.BackgroundImage = AdjustImage(pictureBox.BackgroundImage);
if (pictureBox.BackgroundImage is not null)
pictureBox.BackgroundImage = AdjustImage(pictureBox.BackgroundImage);
}
var combo = control as RComboBox; var combo = control as RComboBox;
if (combo != null) if (combo != null)
@@ -89,8 +114,8 @@ public static class ControlHelper
{ {
chart.BackColor = backMain; chart.BackColor = backMain;
chart.ChartAreas[0].BackColor = backMain; chart.ChartAreas[0].BackColor = backMain;
chart.ChartAreas[0].AxisX.MajorGrid.LineColor = foreMain; chart.ChartAreas[0].AxisX.MajorGrid.LineColor = foreAccent;
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = foreMain; chart.ChartAreas[0].AxisY.MajorGrid.LineColor = foreAccent;
chart.ChartAreas[0].AxisX.TitleForeColor = foreMain; chart.ChartAreas[0].AxisX.TitleForeColor = foreMain;
chart.ChartAreas[0].AxisY.TitleForeColor = foreMain; chart.ChartAreas[0].AxisY.TitleForeColor = foreMain;
@@ -101,8 +126,8 @@ public static class ControlHelper
chart.ChartAreas[0].AxisX.MajorTickMark.LineColor = foreMain; chart.ChartAreas[0].AxisX.MajorTickMark.LineColor = foreMain;
chart.ChartAreas[0].AxisY.MajorTickMark.LineColor = foreMain; chart.ChartAreas[0].AxisY.MajorTickMark.LineColor = foreMain;
chart.ChartAreas[0].AxisX.LineColor = foreMain; chart.ChartAreas[0].AxisX.LineColor = foreAccent;
chart.ChartAreas[0].AxisY.LineColor = foreMain; chart.ChartAreas[0].AxisY.LineColor = foreAccent;
chart.Titles[0].ForeColor = foreMain; chart.Titles[0].ForeColor = foreMain;
@@ -121,7 +146,7 @@ public static class ControlHelper
}); });
} }
private static Image AdjustImage(Image image) private static Image ResizeImage(Image image)
{ {
var newSize = new Size((int)(image.Width * _scale), (int)(image.Height * _scale)); var newSize = new Size((int)(image.Width * _scale), (int)(image.Height * _scale));
var pic = new Bitmap(newSize.Width, newSize.Height); var pic = new Bitmap(newSize.Width, newSize.Height);
@@ -131,6 +156,12 @@ public static class ControlHelper
g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.DrawImage(image, new Rectangle(new Point(), newSize)); g.DrawImage(image, new Rectangle(new Point(), newSize));
} }
return pic;
}
private static Image AdjustImage(Image image)
{
var pic = new Bitmap(image);
if (_invert) if (_invert)
{ {
@@ -145,6 +176,7 @@ public static class ControlHelper
} }
return pic; return pic;
} }
} }

View File

@@ -1,4 +1,5 @@
using System.ComponentModel; using Microsoft.Win32;
using System.ComponentModel;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
@@ -18,25 +19,38 @@ namespace CustomControls
[DllImport("DwmApi")] //System.Runtime.InteropServices [DllImport("DwmApi")] //System.Runtime.InteropServices
private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, int[] attrValue, int attrSize); private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, int[] attrValue, int attrSize);
public bool darkTheme; public bool darkTheme = false;
public bool invert = false;
public void InitTheme() private static bool IsDarkTheme()
{ {
bool newDarkTheme = CheckSystemDarkModeStatus(); using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize");
invert = (darkTheme != newDarkTheme); var registryValueObject = key?.GetValue("AppsUseLightTheme");
if (registryValueObject == null) return false;
return (int)registryValueObject <= 0;
}
public void InitTheme(bool setDPI = true)
{
bool newDarkTheme = IsDarkTheme();
bool changed = (darkTheme != newDarkTheme);
darkTheme = newDarkTheme; darkTheme = newDarkTheme;
ControlHelper.Adjust(this, 2, invert); if (setDPI)
try ControlHelper.Resize(this);
{
DwmSetWindowAttribute(this.Handle, 20, new[] { darkTheme ? 1 : 0 }, 4); DwmSetWindowAttribute(this.Handle, 20, new[] { darkTheme ? 1 : 0 }, 4);
} catch { } ControlHelper.Adjust(this, darkTheme, changed);
} }
} }
public class RTrackBar : TrackBar
{
}
public class RComboBox : ComboBox public class RComboBox : ComboBox
{ {
private Color borderColor = Color.Gray; private Color borderColor = Color.Gray;
@@ -221,8 +235,11 @@ namespace CustomControls
{ {
//Fields //Fields
private int borderSize = 5; private int borderSize = 5;
private int borderRadius = 3; private int borderRadius = 5;
private bool activated = false; private bool activated = false;
private bool secondary = false;
private Color borderColor = Color.Transparent; private Color borderColor = Color.Transparent;
public Color BorderColor public Color BorderColor
@@ -247,6 +264,14 @@ namespace CustomControls
} }
} }
public bool Secondary
{
get { return secondary; }
set
{
secondary = value;
}
}
public RButton() public RButton()
{ {

120
app/CustomControls.resx Normal file
View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

59
app/Fans.Designer.cs generated
View File

@@ -31,10 +31,12 @@ namespace GHelper
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
ChartArea chartArea1 = new ChartArea();
Title title1 = new Title();
ChartArea chartArea2 = new ChartArea();
Title title2 = new Title();
ChartArea chartArea3 = new ChartArea(); ChartArea chartArea3 = new ChartArea();
Title title3 = new Title(); Title title3 = new Title();
ChartArea chartArea4 = new ChartArea();
Title title4 = new Title();
panelFans = new Panel(); panelFans = new Panel();
labelTip = new Label(); labelTip = new Label();
labelBoost = new Label(); labelBoost = new Label();
@@ -43,6 +45,7 @@ namespace GHelper
tableFanCharts = new TableLayoutPanel(); tableFanCharts = new TableLayoutPanel();
chartGPU = new Chart(); chartGPU = new Chart();
chartCPU = new Chart(); chartCPU = new Chart();
chartMid = new Chart();
labelFans = new Label(); labelFans = new Label();
checkAuto = new CheckBox(); checkAuto = new CheckBox();
buttonReset = new RButton(); buttonReset = new RButton();
@@ -68,6 +71,7 @@ namespace GHelper
tableFanCharts.SuspendLayout(); tableFanCharts.SuspendLayout();
((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit(); ((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit();
((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit(); ((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit();
((System.ComponentModel.ISupportInitialize)chartMid).BeginInit();
panelPower.SuspendLayout(); panelPower.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
panelCPU.SuspendLayout(); panelCPU.SuspendLayout();
@@ -147,44 +151,58 @@ namespace GHelper
tableFanCharts.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); tableFanCharts.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
tableFanCharts.Controls.Add(chartGPU, 0, 1); tableFanCharts.Controls.Add(chartGPU, 0, 1);
tableFanCharts.Controls.Add(chartCPU, 0, 0); tableFanCharts.Controls.Add(chartCPU, 0, 0);
tableFanCharts.Controls.Add(chartMid, 0, 2);
tableFanCharts.Location = new Point(28, 64); tableFanCharts.Location = new Point(28, 64);
tableFanCharts.Margin = new Padding(6); tableFanCharts.Margin = new Padding(6);
tableFanCharts.Name = "tableFanCharts"; tableFanCharts.Name = "tableFanCharts";
tableFanCharts.RowCount = 2; tableFanCharts.RowCount = 2;
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Absolute, 40F)); tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Absolute, 40F));
tableFanCharts.Size = new Size(764, 992); tableFanCharts.Size = new Size(764, 992);
tableFanCharts.TabIndex = 36; tableFanCharts.TabIndex = 36;
// //
// chartGPU // chartGPU
// //
chartArea3.Name = "ChartArea1"; chartArea1.Name = "ChartArea1";
chartGPU.ChartAreas.Add(chartArea3); chartGPU.ChartAreas.Add(chartArea1);
chartGPU.Dock = DockStyle.Fill; chartGPU.Dock = DockStyle.Fill;
chartGPU.Location = new Point(2, 506); chartGPU.Location = new Point(2, 340);
chartGPU.Margin = new Padding(2, 10, 2, 10); chartGPU.Margin = new Padding(2, 10, 2, 10);
chartGPU.Name = "chartGPU"; chartGPU.Name = "chartGPU";
chartGPU.Size = new Size(760, 476); chartGPU.Size = new Size(760, 310);
chartGPU.TabIndex = 17; chartGPU.TabIndex = 17;
chartGPU.Text = "chart1"; chartGPU.Text = "chartGPU";
title3.Name = "Title1"; title1.Name = "Title1";
chartGPU.Titles.Add(title3); chartGPU.Titles.Add(title1);
// //
// chartCPU // chartCPU
// //
chartArea4.Name = "ChartArea1"; chartArea2.Name = "ChartArea1";
chartCPU.ChartAreas.Add(chartArea4); chartCPU.ChartAreas.Add(chartArea2);
chartCPU.Dock = DockStyle.Fill; chartCPU.Dock = DockStyle.Fill;
chartCPU.Location = new Point(2, 10); chartCPU.Location = new Point(2, 10);
chartCPU.Margin = new Padding(2, 10, 2, 10); chartCPU.Margin = new Padding(2, 10, 2, 10);
chartCPU.Name = "chartCPU"; chartCPU.Name = "chartCPU";
chartCPU.Size = new Size(760, 476); chartCPU.Size = new Size(760, 310);
chartCPU.TabIndex = 14; chartCPU.TabIndex = 14;
chartCPU.Text = "chartCPU"; chartCPU.Text = "chartCPU";
title4.Name = "Title1"; title2.Name = "Title1";
chartCPU.Titles.Add(title4); chartCPU.Titles.Add(title2);
//
// chartMid
//
chartArea3.Name = "ChartArea3";
chartMid.ChartAreas.Add(chartArea3);
chartMid.Dock = DockStyle.Fill;
chartMid.Location = new Point(2, 670);
chartMid.Margin = new Padding(2, 10, 2, 10);
chartMid.Name = "chartMid";
chartMid.Size = new Size(760, 312);
chartMid.TabIndex = 14;
chartMid.Text = "chartMid";
title3.Name = "Title3";
chartMid.Titles.Add(title3);
// //
// labelFans // labelFans
// //
@@ -219,6 +237,7 @@ namespace GHelper
buttonReset.Location = new Point(30, 1081); buttonReset.Location = new Point(30, 1081);
buttonReset.Margin = new Padding(4, 2, 4, 2); buttonReset.Margin = new Padding(4, 2, 4, 2);
buttonReset.Name = "buttonReset"; buttonReset.Name = "buttonReset";
buttonReset.Secondary = true;
buttonReset.Size = new Size(232, 44); buttonReset.Size = new Size(232, 44);
buttonReset.TabIndex = 15; buttonReset.TabIndex = 15;
buttonReset.Text = "Factory Defaults"; buttonReset.Text = "Factory Defaults";
@@ -234,6 +253,7 @@ namespace GHelper
buttonApply.Location = new Point(542, 1081); buttonApply.Location = new Point(542, 1081);
buttonApply.Margin = new Padding(4, 2, 4, 2); buttonApply.Margin = new Padding(4, 2, 4, 2);
buttonApply.Name = "buttonApply"; buttonApply.Name = "buttonApply";
buttonApply.Secondary = true;
buttonApply.Size = new Size(248, 44); buttonApply.Size = new Size(248, 44);
buttonApply.TabIndex = 14; buttonApply.TabIndex = 14;
buttonApply.Text = "Apply Fan Curve"; buttonApply.Text = "Apply Fan Curve";
@@ -303,6 +323,7 @@ namespace GHelper
buttonApplyPower.Location = new Point(20, 1081); buttonApplyPower.Location = new Point(20, 1081);
buttonApplyPower.Margin = new Padding(4, 2, 4, 2); buttonApplyPower.Margin = new Padding(4, 2, 4, 2);
buttonApplyPower.Name = "buttonApplyPower"; buttonApplyPower.Name = "buttonApplyPower";
buttonApplyPower.Secondary = true;
buttonApplyPower.Size = new Size(324, 44); buttonApplyPower.Size = new Size(324, 44);
buttonApplyPower.TabIndex = 24; buttonApplyPower.TabIndex = 24;
buttonApplyPower.Text = "Apply Power Limits"; buttonApplyPower.Text = "Apply Power Limits";
@@ -462,6 +483,7 @@ namespace GHelper
tableFanCharts.ResumeLayout(false); tableFanCharts.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)chartGPU).EndInit(); ((System.ComponentModel.ISupportInitialize)chartGPU).EndInit();
((System.ComponentModel.ISupportInitialize)chartCPU).EndInit(); ((System.ComponentModel.ISupportInitialize)chartCPU).EndInit();
((System.ComponentModel.ISupportInitialize)chartMid).EndInit();
panelPower.ResumeLayout(false); panelPower.ResumeLayout(false);
panelPower.PerformLayout(); panelPower.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
@@ -498,6 +520,7 @@ namespace GHelper
private TableLayoutPanel tableFanCharts; private TableLayoutPanel tableFanCharts;
private System.Windows.Forms.DataVisualization.Charting.Chart chartGPU; private System.Windows.Forms.DataVisualization.Charting.Chart chartGPU;
private System.Windows.Forms.DataVisualization.Charting.Chart chartCPU; private System.Windows.Forms.DataVisualization.Charting.Chart chartCPU;
private System.Windows.Forms.DataVisualization.Charting.Chart chartMid;
private Label labelFans; private Label labelFans;
private PictureBox picturePerf; private PictureBox picturePerf;
private PictureBox pictureBox1; private PictureBox pictureBox1;

View File

@@ -10,6 +10,7 @@ namespace GHelper
DataPoint curPoint = null; DataPoint curPoint = null;
Series seriesCPU; Series seriesCPU;
Series seriesGPU; Series seriesGPU;
Series seriesMid;
static int MinRPM, MaxRPM; static int MinRPM, MaxRPM;
@@ -27,6 +28,8 @@ namespace GHelper
if (device == 1) if (device == 1)
title = "GPU Fan Profile"; title = "GPU Fan Profile";
else if (device == 2)
title = "Middle Fan Profile";
else else
title = "CPU Fan Profile"; title = "CPU Fan Profile";
@@ -35,9 +38,6 @@ namespace GHelper
chart.Titles[0].Text = title; chart.Titles[0].Text = title;
chart.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.LightGray;
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.LightGray;
chart.ChartAreas[0].AxisX.Minimum = 10; chart.ChartAreas[0].AxisX.Minimum = 10;
chart.ChartAreas[0].AxisX.Maximum = 100; chart.ChartAreas[0].AxisX.Maximum = 100;
chart.ChartAreas[0].AxisX.Interval = 10; chart.ChartAreas[0].AxisX.Interval = 10;
@@ -100,9 +100,11 @@ namespace GHelper
seriesCPU = chartCPU.Series.Add("CPU"); seriesCPU = chartCPU.Series.Add("CPU");
seriesGPU = chartGPU.Series.Add("GPU"); seriesGPU = chartGPU.Series.Add("GPU");
seriesMid = chartMid.Series.Add("Mid");
seriesCPU.Color = colorStandard; seriesCPU.Color = colorStandard;
seriesGPU.Color = colorTurbo; seriesGPU.Color = colorTurbo;
seriesMid.Color = colorEco;
chartCPU.MouseMove += ChartCPU_MouseMove; chartCPU.MouseMove += ChartCPU_MouseMove;
chartCPU.MouseUp += ChartCPU_MouseUp; chartCPU.MouseUp += ChartCPU_MouseUp;
@@ -110,6 +112,9 @@ namespace GHelper
chartGPU.MouseMove += ChartCPU_MouseMove; chartGPU.MouseMove += ChartCPU_MouseMove;
chartGPU.MouseUp += ChartCPU_MouseUp; chartGPU.MouseUp += ChartCPU_MouseUp;
chartMid.MouseMove += ChartCPU_MouseMove;
chartMid.MouseUp += ChartCPU_MouseUp;
buttonReset.Click += ButtonReset_Click; buttonReset.Click += ButtonReset_Click;
buttonApply.Click += ButtonApply_Click; buttonApply.Click += ButtonApply_Click;
@@ -267,6 +272,21 @@ namespace GHelper
public void InitFans() public void InitFans()
{ {
byte[] curve = Program.wmi.GetFanCurve(2);
if (curve.All(singleByte => singleByte == 0))
{
Program.config.setConfig("mid_fan", 0);
chartMid.Visible = false;
} else
{
Program.config.setConfig("mid_fan", 1);
SetChart(chartMid, 2);
LoadProfile(seriesMid, 2);
}
SetChart(chartCPU, 0); SetChart(chartCPU, 0);
SetChart(chartGPU, 1); SetChart(chartGPU, 1);
@@ -331,6 +351,8 @@ namespace GHelper
{ {
ApplyProfile(seriesCPU, 0); ApplyProfile(seriesCPU, 0);
ApplyProfile(seriesGPU, 1); ApplyProfile(seriesGPU, 1);
if (Program.config.getConfig("mid_fan") == 1)
ApplyProfile(seriesMid, 2);
} }
private void ButtonReset_Click(object? sender, EventArgs e) private void ButtonReset_Click(object? sender, EventArgs e)
@@ -338,6 +360,8 @@ namespace GHelper
LoadProfile(seriesCPU, 0, 1); LoadProfile(seriesCPU, 0, 1);
LoadProfile(seriesGPU, 1, 1); LoadProfile(seriesGPU, 1, 1);
if (Program.config.getConfig("mid_fan") == 1)
LoadProfile(seriesMid, 2, 1);
checkAuto.Checked = false; checkAuto.Checked = false;
checkApplyPower.Checked = false; checkApplyPower.Checked = false;

View File

@@ -16,7 +16,7 @@
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly> <ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.34</AssemblyVersion> <AssemblyVersion>0.35</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -49,7 +49,8 @@ namespace GHelper
} }
SystemEvents.UserPreferenceChanged += OnUserPreferenceChanged; SystemEvents.UserPreferenceChanged += new
UserPreferenceChangedEventHandler(SystemEvents_UserPreferenceChanged);
Application.EnableVisualStyles(); Application.EnableVisualStyles();
@@ -81,7 +82,7 @@ namespace GHelper
} }
static void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e) static void SystemEvents_UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
{ {
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastTheme) < 2000) return; if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastTheme) < 2000) return;
@@ -91,13 +92,14 @@ namespace GHelper
{ {
case UserPreferenceCategory.General: case UserPreferenceCategory.General:
Debug.WriteLine("Theme Changed"); Debug.WriteLine("Theme Changed");
settingsForm.InitTheme(); Thread.Sleep(500);
settingsForm.InitTheme(false);
if (settingsForm.fans is not null && settingsForm.fans.Text != "") if (settingsForm.fans is not null && settingsForm.fans.Text != "")
settingsForm.fans.InitTheme(); settingsForm.fans.InitTheme(false);
if (settingsForm.keyb is not null && settingsForm.keyb.Text != "") if (settingsForm.keyb is not null && settingsForm.keyb.Text != "")
settingsForm.keyb.InitTheme(); settingsForm.keyb.InitTheme(false);
break; break;
} }

View File

@@ -186,6 +186,7 @@ namespace GHelper
buttonMatrix.Location = new Point(390, 8); buttonMatrix.Location = new Point(390, 8);
buttonMatrix.Margin = new Padding(4, 8, 4, 8); buttonMatrix.Margin = new Padding(4, 8, 4, 8);
buttonMatrix.Name = "buttonMatrix"; buttonMatrix.Name = "buttonMatrix";
buttonMatrix.Secondary = true;
buttonMatrix.Size = new Size(185, 44); buttonMatrix.Size = new Size(185, 44);
buttonMatrix.TabIndex = 43; buttonMatrix.TabIndex = 43;
buttonMatrix.Text = "Picture / Gif"; buttonMatrix.Text = "Picture / Gif";
@@ -330,6 +331,7 @@ namespace GHelper
buttonQuit.Location = new Point(578, 16); buttonQuit.Location = new Point(578, 16);
buttonQuit.Margin = new Padding(8, 4, 8, 4); buttonQuit.Margin = new Padding(8, 4, 8, 4);
buttonQuit.Name = "buttonQuit"; buttonQuit.Name = "buttonQuit";
buttonQuit.Secondary = true;
buttonQuit.Size = new Size(208, 44); buttonQuit.Size = new Size(208, 44);
buttonQuit.TabIndex = 18; buttonQuit.TabIndex = 18;
buttonQuit.Text = "Quit"; buttonQuit.Text = "Quit";
@@ -434,6 +436,7 @@ namespace GHelper
buttonSilent.Location = new Point(4, 4); buttonSilent.Location = new Point(4, 4);
buttonSilent.Margin = new Padding(4); buttonSilent.Margin = new Padding(4);
buttonSilent.Name = "buttonSilent"; buttonSilent.Name = "buttonSilent";
buttonSilent.Secondary = false;
buttonSilent.Size = new Size(185, 120); buttonSilent.Size = new Size(185, 120);
buttonSilent.TabIndex = 0; buttonSilent.TabIndex = 0;
buttonSilent.Text = "Silent"; buttonSilent.Text = "Silent";
@@ -454,6 +457,7 @@ namespace GHelper
buttonBalanced.Location = new Point(197, 4); buttonBalanced.Location = new Point(197, 4);
buttonBalanced.Margin = new Padding(4); buttonBalanced.Margin = new Padding(4);
buttonBalanced.Name = "buttonBalanced"; buttonBalanced.Name = "buttonBalanced";
buttonBalanced.Secondary = false;
buttonBalanced.Size = new Size(185, 120); buttonBalanced.Size = new Size(185, 120);
buttonBalanced.TabIndex = 1; buttonBalanced.TabIndex = 1;
buttonBalanced.Text = "Balanced"; buttonBalanced.Text = "Balanced";
@@ -474,6 +478,7 @@ namespace GHelper
buttonTurbo.Location = new Point(390, 4); buttonTurbo.Location = new Point(390, 4);
buttonTurbo.Margin = new Padding(4); buttonTurbo.Margin = new Padding(4);
buttonTurbo.Name = "buttonTurbo"; buttonTurbo.Name = "buttonTurbo";
buttonTurbo.Secondary = false;
buttonTurbo.Size = new Size(185, 120); buttonTurbo.Size = new Size(185, 120);
buttonTurbo.TabIndex = 2; buttonTurbo.TabIndex = 2;
buttonTurbo.Text = "Turbo"; buttonTurbo.Text = "Turbo";
@@ -493,6 +498,7 @@ namespace GHelper
buttonFans.Location = new Point(583, 4); buttonFans.Location = new Point(583, 4);
buttonFans.Margin = new Padding(4); buttonFans.Margin = new Padding(4);
buttonFans.Name = "buttonFans"; buttonFans.Name = "buttonFans";
buttonFans.Secondary = true;
buttonFans.Size = new Size(185, 120); buttonFans.Size = new Size(185, 120);
buttonFans.TabIndex = 35; buttonFans.TabIndex = 35;
buttonFans.Text = "Fans + Power"; buttonFans.Text = "Fans + Power";
@@ -596,6 +602,7 @@ namespace GHelper
buttonEco.Location = new Point(4, 4); buttonEco.Location = new Point(4, 4);
buttonEco.Margin = new Padding(4); buttonEco.Margin = new Padding(4);
buttonEco.Name = "buttonEco"; buttonEco.Name = "buttonEco";
buttonEco.Secondary = false;
buttonEco.Size = new Size(185, 120); buttonEco.Size = new Size(185, 120);
buttonEco.TabIndex = 0; buttonEco.TabIndex = 0;
buttonEco.Text = "Eco"; buttonEco.Text = "Eco";
@@ -616,6 +623,7 @@ namespace GHelper
buttonStandard.Location = new Point(197, 4); buttonStandard.Location = new Point(197, 4);
buttonStandard.Margin = new Padding(4); buttonStandard.Margin = new Padding(4);
buttonStandard.Name = "buttonStandard"; buttonStandard.Name = "buttonStandard";
buttonStandard.Secondary = false;
buttonStandard.Size = new Size(185, 120); buttonStandard.Size = new Size(185, 120);
buttonStandard.TabIndex = 1; buttonStandard.TabIndex = 1;
buttonStandard.Text = "Standard"; buttonStandard.Text = "Standard";
@@ -636,6 +644,7 @@ namespace GHelper
buttonOptimized.Location = new Point(583, 4); buttonOptimized.Location = new Point(583, 4);
buttonOptimized.Margin = new Padding(4); buttonOptimized.Margin = new Padding(4);
buttonOptimized.Name = "buttonOptimized"; buttonOptimized.Name = "buttonOptimized";
buttonOptimized.Secondary = false;
buttonOptimized.Size = new Size(185, 120); buttonOptimized.Size = new Size(185, 120);
buttonOptimized.TabIndex = 3; buttonOptimized.TabIndex = 3;
buttonOptimized.Text = "Optimized"; buttonOptimized.Text = "Optimized";
@@ -656,6 +665,7 @@ namespace GHelper
buttonUltimate.Location = new Point(390, 4); buttonUltimate.Location = new Point(390, 4);
buttonUltimate.Margin = new Padding(4); buttonUltimate.Margin = new Padding(4);
buttonUltimate.Name = "buttonUltimate"; buttonUltimate.Name = "buttonUltimate";
buttonUltimate.Secondary = false;
buttonUltimate.Size = new Size(185, 120); buttonUltimate.Size = new Size(185, 120);
buttonUltimate.TabIndex = 2; buttonUltimate.TabIndex = 2;
buttonUltimate.Text = "Ultimate"; buttonUltimate.Text = "Ultimate";
@@ -700,6 +710,8 @@ namespace GHelper
tableScreen.Controls.Add(buttonScreenAuto, 0, 0); tableScreen.Controls.Add(buttonScreenAuto, 0, 0);
tableScreen.Controls.Add(button60Hz, 1, 0); tableScreen.Controls.Add(button60Hz, 1, 0);
tableScreen.Controls.Add(button120Hz, 2, 0); tableScreen.Controls.Add(button120Hz, 2, 0);
tableScreen.Controls.Add(buttonMiniled, 3, 0);
tableScreen.Location = new Point(16, 51); tableScreen.Location = new Point(16, 51);
tableScreen.Margin = new Padding(8, 4, 8, 4); tableScreen.Margin = new Padding(8, 4, 8, 4);
tableScreen.Name = "tableScreen"; tableScreen.Name = "tableScreen";
@@ -720,6 +732,7 @@ namespace GHelper
buttonScreenAuto.Location = new Point(4, 4); buttonScreenAuto.Location = new Point(4, 4);
buttonScreenAuto.Margin = new Padding(4); buttonScreenAuto.Margin = new Padding(4);
buttonScreenAuto.Name = "buttonScreenAuto"; buttonScreenAuto.Name = "buttonScreenAuto";
buttonScreenAuto.Secondary = false;
buttonScreenAuto.Size = new Size(185, 72); buttonScreenAuto.Size = new Size(185, 72);
buttonScreenAuto.TabIndex = 0; buttonScreenAuto.TabIndex = 0;
buttonScreenAuto.Text = "Auto"; buttonScreenAuto.Text = "Auto";
@@ -738,6 +751,7 @@ namespace GHelper
button60Hz.Location = new Point(197, 4); button60Hz.Location = new Point(197, 4);
button60Hz.Margin = new Padding(4); button60Hz.Margin = new Padding(4);
button60Hz.Name = "button60Hz"; button60Hz.Name = "button60Hz";
button60Hz.Secondary = false;
button60Hz.Size = new Size(185, 72); button60Hz.Size = new Size(185, 72);
button60Hz.TabIndex = 1; button60Hz.TabIndex = 1;
button60Hz.Text = "60Hz"; button60Hz.Text = "60Hz";
@@ -755,6 +769,7 @@ namespace GHelper
button120Hz.Location = new Point(390, 4); button120Hz.Location = new Point(390, 4);
button120Hz.Margin = new Padding(4); button120Hz.Margin = new Padding(4);
button120Hz.Name = "button120Hz"; button120Hz.Name = "button120Hz";
button120Hz.Secondary = false;
button120Hz.Size = new Size(185, 72); button120Hz.Size = new Size(185, 72);
button120Hz.TabIndex = 2; button120Hz.TabIndex = 2;
button120Hz.Text = "120Hz + OD"; button120Hz.Text = "120Hz + OD";
@@ -829,6 +844,7 @@ namespace GHelper
buttonKeyboard.Location = new Point(390, 8); buttonKeyboard.Location = new Point(390, 8);
buttonKeyboard.Margin = new Padding(4, 8, 4, 8); buttonKeyboard.Margin = new Padding(4, 8, 4, 8);
buttonKeyboard.Name = "buttonKeyboard"; buttonKeyboard.Name = "buttonKeyboard";
buttonKeyboard.Secondary = true;
buttonKeyboard.Size = new Size(185, 44); buttonKeyboard.Size = new Size(185, 44);
buttonKeyboard.TabIndex = 37; buttonKeyboard.TabIndex = 37;
buttonKeyboard.Text = "Extra"; buttonKeyboard.Text = "Extra";
@@ -895,6 +911,7 @@ namespace GHelper
buttonKeyboardColor.Location = new Point(0, 0); buttonKeyboardColor.Location = new Point(0, 0);
buttonKeyboardColor.Margin = new Padding(4, 8, 4, 8); buttonKeyboardColor.Margin = new Padding(4, 8, 4, 8);
buttonKeyboardColor.Name = "buttonKeyboardColor"; buttonKeyboardColor.Name = "buttonKeyboardColor";
buttonKeyboardColor.Secondary = false;
buttonKeyboardColor.Size = new Size(185, 44); buttonKeyboardColor.Size = new Size(185, 44);
buttonKeyboardColor.TabIndex = 39; buttonKeyboardColor.TabIndex = 39;
buttonKeyboardColor.Text = "Color "; buttonKeyboardColor.Text = "Color ";
@@ -935,6 +952,7 @@ namespace GHelper
buttonMiniled.Location = new Point(197, 4); buttonMiniled.Location = new Point(197, 4);
buttonMiniled.Margin = new Padding(4); buttonMiniled.Margin = new Padding(4);
buttonMiniled.Name = "buttonMiniled"; buttonMiniled.Name = "buttonMiniled";
buttonMiniled.Secondary = false;
buttonMiniled.Size = new Size(185, 72); buttonMiniled.Size = new Size(185, 72);
buttonMiniled.TabIndex = 3; buttonMiniled.TabIndex = 3;
buttonMiniled.Text = "Miniled"; buttonMiniled.Text = "Miniled";

View File

@@ -532,8 +532,8 @@ namespace GHelper
int brightness = Program.config.getConfig("matrix_brightness"); int brightness = Program.config.getConfig("matrix_brightness");
int running = Program.config.getConfig("matrix_running"); int running = Program.config.getConfig("matrix_running");
comboMatrix.SelectedIndex = (brightness != -1) ? brightness : 0; comboMatrix.SelectedIndex = (brightness != -1) ? Math.Min(brightness, comboMatrix.Items.Count-1) : 0;
comboMatrixRunning.SelectedIndex = (running != -1) ? running : 0; comboMatrixRunning.SelectedIndex = (running != -1) ? Math.Min(running, comboMatrixRunning.Items.Count - 1) : 0;
checkMatrix.Checked = (Program.config.getConfig("matrix_auto") == 1); checkMatrix.Checked = (Program.config.getConfig("matrix_auto") == 1);
@@ -705,9 +705,11 @@ namespace GHelper
if (miniled >= 0) if (miniled >= 0)
{ {
tableScreen.Controls.Add(buttonMiniled, 3, 0);
buttonMiniled.Activated = (miniled == 1); buttonMiniled.Activated = (miniled == 1);
Program.config.setConfig("miniled", miniled); Program.config.setConfig("miniled", miniled);
} else
{
buttonMiniled.Visible = false;
} }
Program.config.setConfig("frequency", frequency); Program.config.setConfig("frequency", frequency);
@@ -850,6 +852,9 @@ namespace GHelper
{ {
Program.wmi.SetFanCurve(0, Program.config.getFanConfig(0)); Program.wmi.SetFanCurve(0, Program.config.getFanConfig(0));
Program.wmi.SetFanCurve(1, Program.config.getFanConfig(1)); Program.wmi.SetFanCurve(1, Program.config.getFanConfig(1));
if (Program.config.getConfig("mid_fan") == 1)
Program.wmi.SetFanCurve(2, Program.config.getFanConfig(2));
} }
if (Program.config.getConfigPerf("auto_apply_power") == 1) if (Program.config.getConfigPerf("auto_apply_power") == 1)

BIN
docs/screenshot-dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB