mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Clock fix
This commit is contained in:
@@ -190,7 +190,9 @@ public class ASUSWmi
|
|||||||
byte[] args = new byte[8];
|
byte[] args = new byte[8];
|
||||||
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
||||||
byte[] status = CallMethod(DSTS, args);
|
byte[] status = CallMethod(DSTS, args);
|
||||||
|
|
||||||
return BitConverter.ToInt32(status, 0) - 65536;
|
return BitConverter.ToInt32(status, 0) - 65536;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] DeviceGetBuffer(uint DeviceID, uint Status = 0)
|
public byte[] DeviceGetBuffer(uint DeviceID, uint Status = 0)
|
||||||
@@ -198,6 +200,7 @@ public class ASUSWmi
|
|||||||
byte[] args = new byte[8];
|
byte[] args = new byte[8];
|
||||||
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
||||||
BitConverter.GetBytes((uint)Status).CopyTo(args, 4);
|
BitConverter.GetBytes((uint)Status).CopyTo(args, 4);
|
||||||
|
|
||||||
return CallMethod(DSTS, args);
|
return CallMethod(DSTS, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ using Starlight.Communication;
|
|||||||
using System.Management;
|
using System.Management;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Globalization;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace Starlight.AnimeMatrix
|
namespace Starlight.AnimeMatrix
|
||||||
{
|
{
|
||||||
@@ -359,6 +361,15 @@ namespace Starlight.AnimeMatrix
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void PresentClock()
|
||||||
|
{
|
||||||
|
int second = DateTime.Now.Second;
|
||||||
|
|
||||||
|
if (CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern.Contains("H"))
|
||||||
|
PresentText(DateTime.Now.ToString("H" + ((second % 2 == 0)?":":" ") + "mm"));
|
||||||
|
else
|
||||||
|
PresentText(DateTime.Now.ToString("h" + ((second % 2 == 0) ? ":" : " ") + "mm"), DateTime.Now.ToString("tt"));
|
||||||
|
}
|
||||||
|
|
||||||
public void PresentText(string text1, string text2 = "")
|
public void PresentText(string text1, string text2 = "")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -354,29 +354,7 @@ namespace GHelper
|
|||||||
mat.PresentNextFrame();
|
mat.PresentNextFrame();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
string format1, format2;
|
mat.PresentClock();
|
||||||
if (CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern.Contains("H"))
|
|
||||||
{
|
|
||||||
format1 = "H:mm";
|
|
||||||
format2 = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
format1 = "h:mm";
|
|
||||||
format2 = "tt";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (matrixTick > 0)
|
|
||||||
{
|
|
||||||
format1 = format1.Replace(":", " ");
|
|
||||||
matrixTick = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
matrixTick++;
|
|
||||||
}
|
|
||||||
|
|
||||||
mat.PresentText(DateTime.Now.ToString(format1), DateTime.Now.ToString(format2));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -745,7 +723,6 @@ namespace GHelper
|
|||||||
bool overdriveSetting = (Program.config.getConfig("no_overdrive") != 1);
|
bool overdriveSetting = (Program.config.getConfig("no_overdrive") != 1);
|
||||||
|
|
||||||
int overdrive = Program.wmi.DeviceGet(ASUSWmi.ScreenOverdrive);
|
int overdrive = Program.wmi.DeviceGet(ASUSWmi.ScreenOverdrive);
|
||||||
|
|
||||||
int miniled = Program.wmi.DeviceGet(ASUSWmi.ScreenMiniled);
|
int miniled = Program.wmi.DeviceGet(ASUSWmi.ScreenMiniled);
|
||||||
|
|
||||||
bool screenEnabled = (frequency >= 0);
|
bool screenEnabled = (frequency >= 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user