Skip to content

Commit

Permalink
UI updates
Browse files Browse the repository at this point in the history
  • Loading branch information
irusanov committed Dec 6, 2023
1 parent b4448c8 commit a5669ed
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 21 deletions.
Binary file modified Common/ZenStates-Core.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions WPF-no-themes/Properties/BuildNumberTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

using System.Reflection;

[assembly: AssemblyVersion("1.30.1178")]
[assembly: AssemblyFileVersion("1.30.1178")]
[assembly: AssemblyVersion("1.30.1191")]
[assembly: AssemblyFileVersion("1.30.1191")]
6 changes: 4 additions & 2 deletions WPF/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,14 @@
IsEnabled="{Binding powerTable.CLDO_VDDG_IOD, Mode=OneWay, Converter={StaticResource FloatToBool}}" />

<!-- MEM Voltages -->
<TextBlock Text="" TextAlignment="Right" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR5ToBool}}" />
<!-- TextBlock Text="" TextAlignment="Right" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR5ToBool}}" /-->
<!-- DDR4 -->
<TextBlock x:Name="labelMemVddio" Text="VDIMM" TextAlignment="Right" IsEnabled="{Binding WMIPresent}" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR4ToBool}}" />
<TextBlock x:Name="labelMemVtt" Text="MEM VTT" TextAlignment="Right" IsEnabled="{Binding WMIPresent}" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR4ToBool}}" />
<!-- DDR5 -->
<TextBlock x:Name="labelMemVdd" Text="MEM VDD" IsEnabled="False" TextAlignment="Right" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR5ToBool}}" />
<TextBlock x:Name="labelMemVddq" Text="MEM VDDQ" IsEnabled="False" TextAlignment="Right" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR5ToBool}}" />
<TextBlock x:Name="labelApuVddio" Text="CPU VDDIO" IsEnabled="False" TextAlignment="Right" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR5ToBool}}" />
<TextBlock x:Name="labelMemVpp" Text="MEM VPP" IsEnabled="False" TextAlignment="Right" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR5ToBool}}" />
<TextBlock x:Name="labelVddMisc" Text="VDD MISC" IsEnabled="{Binding powerTable.VDD_MISC}" TextAlignment="Right" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR5ToBool}}" />

Expand Down Expand Up @@ -392,12 +393,13 @@
<TextBlock Text="{Binding powerTable.CLDO_VDDP, FallbackValue='N/A', Mode=OneWay, Converter={StaticResource FloatToVoltage}}" Style="{DynamicResource ValueStyles}" />
<TextBlock Text="{Binding powerTable.CLDO_VDDG_CCD, FallbackValue='N/A', Mode=OneWay, Converter={StaticResource FloatToVoltage}}" Style="{DynamicResource ValueStyles}" />
<TextBlock Text="{Binding powerTable.CLDO_VDDG_IOD, FallbackValue='N/A', Mode=OneWay, Converter={StaticResource FloatToVoltage}}" Style="{DynamicResource ValueStyles}" />
<TextBlock Text="" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR5ToBool}}" />
<!-- TextBlock Text="" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR5ToBool}}" /-->
<TextBlock x:Name="textBoxMemVddio" Text="N/A" Style="{DynamicResource ValueStyles}" />
<!-- DDR4 -->
<TextBlock x:Name="textBoxMemVtt" Text="N/A" Style="{DynamicResource ValueStyles}" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR4ToBool}}" />
<!-- DDR5 -->
<TextBlock x:Name="textBoxMemVddq" Text="N/A" Style="{DynamicResource ValueStyles}" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR5ToBool}}" />
<TextBlock x:Name="textBoxApuVddio" Text="N/A" Style="{DynamicResource ValueStyles}" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR5ToBool}}" />
<TextBlock x:Name="textBoxMemVpp" Text="N/A" Style="{DynamicResource ValueStyles}" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR5ToBool}}" />
<TextBlock x:Name="textBoxVddMisc" Text="{Binding powerTable.VDD_MISC, FallbackValue='N/A', Mode=OneWay, Converter={StaticResource FloatToVoltage}}" Style="{DynamicResource ValueStyles}" Visibility="{Binding timings.Type, Mode=OneWay, Converter={StaticResource DDR5ToBool}}" />

Expand Down
14 changes: 6 additions & 8 deletions WPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,17 @@ private BiosACPIFunction GetFunctionByIdString(string name)
private void ReadChannelsInfo()
{
int dimmIndex = 0;
int channelsPerDimm = MEMCFG.Type >= MemType.DDR5 ? 2 : 1;
uint channelsPerDimm = MEMCFG.Type >= MemType.DDR5 ? 2u : 1u;

// Get the offset by probing the IMC0 to IMC7
// It appears that offsets 0x80 and 0x84 are DIMM config registers
// When a DIMM is DR, bit 0 is set to 1
// 0x50000
// offset 0, bit 0 when set to 1 means DIMM1 is installed
// offset 8, bit 0 when set to 1 means DIMM2 is installed
for (int i = 0; i < 8 * channelsPerDimm; i += channelsPerDimm)
for (uint i = 0; i < 8u * channelsPerDimm; i += channelsPerDimm)
{
uint channelOffset = (uint)i << 20;
uint channelOffset = i << 20;
bool channel = Utils.GetBits(cpu.ReadDword(channelOffset | 0x50DF0), 19, 1) == 0;
bool dimm1 = Utils.GetBits(cpu.ReadDword(channelOffset | 0x50000), 0, 1) == 1;
bool dimm2 = Utils.GetBits(cpu.ReadDword(channelOffset | 0x50008), 0, 1) == 1;
Expand Down Expand Up @@ -525,6 +525,7 @@ private void ReadMemoryConfig()
labelMemVdd.IsEnabled = true;
labelMemVddq.IsEnabled = true;
labelMemVpp.IsEnabled = true;
labelApuVddio.IsEnabled = true;

labelProcODT.IsEnabled = true;
labelProcCaDs.IsEnabled = true;
Expand All @@ -539,6 +540,7 @@ private void ReadMemoryConfig()
textBoxMemVddio.Text = $"{Data.MemVddio / 1000.0:F4}V";
textBoxMemVddq.Text = $"{Data.MemVddq / 1000.0:F4}V";
textBoxMemVpp.Text = $"{Data.MemVpp / 1000.0:F4}V";
textBoxApuVddio.Text = $"{Data.ApuVddio / 1000.0:F4}V";

textBoxProcODT.Text = AOD.GetProcODTString(Data.ProcODT);
textBoxCadBusDrvStren.Text = AOD.GetCadBusDrvStrenString(Data.CadBusDrvStren);
Expand Down Expand Up @@ -1047,7 +1049,6 @@ private void AdonisWindow_Loaded(object sender, RoutedEventArgs e)
HwndSource source = HwndSource.FromHwnd(handle);

source?.AddHook(WndProc);

#if !DEBUG
if (!settings.NotifiedChangelog.Equals(AssemblyVersion))
{
Expand Down Expand Up @@ -1129,10 +1130,7 @@ private void SystemInfoToolstripMenuItem_Click(object sender, RoutedEventArgs e)

private void AdonisWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if (siWnd != null)
{
siWnd.Close();
}
siWnd?.Close();

if (settings.SaveWindowPosition)
{
Expand Down
4 changes: 2 additions & 2 deletions WPF/Properties/BuildNumberTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

using System.Reflection;

[assembly: AssemblyVersion("1.30.1178")]
[assembly: AssemblyFileVersion("1.30.1178")]
[assembly: AssemblyVersion("1.31.1191")]
[assembly: AssemblyFileVersion("1.31.1191")]
4 changes: 2 additions & 2 deletions WPF/Properties/BuildNumberTemplate.tt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

using System.Reflection;

[assembly: AssemblyVersion("1.30.<#= this.RevisionNumber #>")]
[assembly: AssemblyFileVersion("1.30.<#= this.RevisionNumber #>")]
[assembly: AssemblyVersion("1.31.<#= this.RevisionNumber #>")]
[assembly: AssemblyFileVersion("1.31.<#= this.RevisionNumber #>")]
<#+
int RevisionNumber = (int)(DateTime.UtcNow - new DateTime(2020,9,1)).TotalDays;
#>
11 changes: 8 additions & 3 deletions WPF/Windows/DebugDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Threading.Tasks;
using System.Windows;
using ZenStates.Core;
using static ZenTimings.MemoryConfig;
using MessageBox = AdonisUI.Controls.MessageBox;

namespace ZenTimings.Windows
Expand Down Expand Up @@ -142,8 +143,10 @@ private void AddLine(string row = "")

private void PrintChannels()
{
uint channelsPerDimm = MEMCFG.Type >= MemType.DDR5 ? 2u : 1u;
AddHeading("Memory Channels Info");
for (var i = 0u; i < 8u; i++)

for (var i = 0u; i < 8u * channelsPerDimm; i += channelsPerDimm)
{
try
{
Expand All @@ -153,7 +156,7 @@ private void PrintChannels()
var dimm2 = Utils.GetBits(CPU.ReadDword(offset | 0x50008), 0, 1) == 1;
var enabled = channel && (dimm1 || dimm2);

AddLine($"Channel{i}: {enabled}");
AddLine($"Channel{i / channelsPerDimm}: {enabled}");
if (enabled)
{
AddLine("-- UMC Registers");
Expand All @@ -169,7 +172,7 @@ private void PrintChannels()
}
catch
{
AddLine($"Channel{i}: <FAILED>");
AddLine($"Channel{i / channelsPerDimm}: <FAILED>");
}
}
AddLine();
Expand All @@ -182,6 +185,8 @@ private void Debug()
result =
$"{System.Windows.Forms.Application.ProductName} {System.Windows.Forms.Application.ProductVersion} Debug Report" +
Environment.NewLine +
$"{"Core Version: "}{CPU.Version}" +
Environment.NewLine +
Environment.NewLine;

var type = SI.GetType();
Expand Down
4 changes: 2 additions & 2 deletions WPF/Windows/SystemInfoWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ public SystemInfoWindow(SystemInfo si, MemoryConfig mc, Resistances mcConfig, Ao
else
{
type = aodData.GetType();
FieldInfo[] fields = type.GetFields();
PropertyInfo[] fields = type.GetProperties();
try
{
items = new List<GridItem>();
foreach (FieldInfo property in fields)
foreach (PropertyInfo property in fields)
items.Add(new GridItem() { Name = property.Name, Value = property.GetValue(aodData).ToString() });

MemControllerGrid.ItemsSource = items;
Expand Down

0 comments on commit a5669ed

Please sign in to comment.