Skip to content

Commit

Permalink
First beta release. Current version: 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
TTLC198 committed Jan 11, 2023
0 parents commit 0f4b924
Show file tree
Hide file tree
Showing 63 changed files with 2,860 additions and 0 deletions.
Binary file added .assets/Preview.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .assets/favicon.ico
Binary file not shown.
13 changes: 13 additions & 0 deletions .idea/.idea.HSMonitor/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/.idea.HSMonitor/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/.idea.HSMonitor/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions HSMonitor.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HSMonitor", "HSMonitor\HSMonitor.csproj", "{1A8EF62E-60F7-43F6-8C84-B55F4632F2E3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1A8EF62E-60F7-43F6-8C84-B55F4632F2E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A8EF62E-60F7-43F6-8C84-B55F4632F2E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A8EF62E-60F7-43F6-8C84-B55F4632F2E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A8EF62E-60F7-43F6-8C84-B55F4632F2E3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
8 changes: 8 additions & 0 deletions HSMonitor.sln.DotSettings.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue">&lt;AssemblyExplorer&gt;&#xD;
&lt;Assembly Path="C:\Users\yoreh\.nuget\packages\librehardwaremonitorlib\0.9.2-pre188\lib\net7.0\LibreHardwareMonitorLib.dll" /&gt;&#xD;
&lt;/AssemblyExplorer&gt;</s:String>
<s:Int64 x:Key="/Default/Environment/Hierarchy/Build/BuildTool/MsbuildVersion/@EntryValue">1114112</s:Int64>
<s:String x:Key="/Default/Environment/Hierarchy/Build/BuildTool/CustomBuildToolPath/@EntryValue">C:\Program Files\dotnet\sdk\7.0.101\MSBuild.dll</s:String>

<s:Boolean x:Key="/Default/ResxEditorPersonal/Initialized/@EntryValue">True</s:Boolean></wpf:ResourceDictionary>
22 changes: 22 additions & 0 deletions HSMonitor/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Application x:Class="HSMonitor.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:utils="clr-namespace:HSMonitor.Utils">
<Application.Resources>
<s:ApplicationLoader>
<!-- Bootstrapper -->
<s:ApplicationLoader.Bootstrapper>
<utils:Bootstrapper />
</s:ApplicationLoader.Bootstrapper>

<ResourceDictionary.MergedDictionaries>
<!--Main resources-->
<ResourceDictionary Source="Resources/StylesResource.xaml"/>
<!--Material Design Themes-->
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
</ResourceDictionary.MergedDictionaries>
</s:ApplicationLoader>
</Application.Resources>
</Application>
46 changes: 46 additions & 0 deletions HSMonitor/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows;
using HSMonitor.Services;
using HSMonitor.ViewModels.Settings;

namespace HSMonitor
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App
{
private static Assembly Assembly { get; } = typeof(App).Assembly;

public static string Name { get; } = Assembly.GetName().Name!;

public static Version Version { get; } = Assembly.GetName().Version!;

public static string VersionString { get; } = "v" + Version.ToString(3).Trim();

public static string ExecutableDirPath { get; } = AppDomain.CurrentDomain.BaseDirectory!;

public static string ExecutableFilePath { get; } = Path.ChangeExtension(typeof(App).Assembly.Location, "exe");

public static string GitHubProjectUrl { get; } = "https://github.com/TTLC198/HSMonitor";
}

public partial class App
{
private static IReadOnlyList<string> CommandLineArgs { get; } = Environment.GetCommandLineArgs();

public static string HiddenOnLaunchArgument { get; } = "--minimize";

public static bool IsHiddenOnLaunch { get; } = CommandLineArgs.Contains(
HiddenOnLaunchArgument,
StringComparer.OrdinalIgnoreCase
);
}
}
22 changes: 22 additions & 0 deletions HSMonitor/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Reflection;
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]

[assembly: AssemblyTitle("HSMonitor")]
[assembly: AssemblyDescription("Server part of the program for monitoring the state of computer hardware on a separate screen.")]
[assembly: AssemblyConfiguration("debug")]
[assembly: AssemblyCompany("ttlc198")]
[assembly: AssemblyProduct("HSMonitor")]
[assembly: AssemblyCopyright("ttlc198 2023")]
[assembly: AssemblyTrademark("")]

[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.5.0")]
3 changes: 3 additions & 0 deletions HSMonitor/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<PropertyChanged />
</Weavers>
74 changes: 74 additions & 0 deletions HSMonitor/FodyWeavers.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="PropertyChanged" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="InjectOnPropertyNameChanged" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the On_PropertyName_Changed feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="TriggerDependentProperties" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the Dependent properties feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EnableIsChangedProperty" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the IsChanged property feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EventInvokerNames" type="xs:string">
<xs:annotation>
<xs:documentation>Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="CheckForEquality" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if equality checks should be inserted. If false, equality checking will be disabled for the project.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="CheckForEqualityUsingBaseEquals" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if equality checks should use the Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="UseStaticEqualsFromBase" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressWarnings" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings from this weaver.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressOnPropertyNameChangedWarning" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings about mismatched On_PropertyName_Changed methods.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
69 changes: 69 additions & 0 deletions HSMonitor/HSMonitor.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<RootNamespace>HSMonitor</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<ApplicationIcon>Resources/Images/favicon.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Hardcodet.NotifyIcon.Wpf" Version="1.1.0" />
<PackageReference Include="LibreHardwareMonitorLib" Version="0.9.2-pre188" />
<PackageReference Include="MaterialDesignColors" Version="2.1.0-ci409" />
<PackageReference Include="MaterialDesignThemes" Version="4.7.0-ci409" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
<PackageReference Include="Stylet" Version="1.3.6" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\Fonts\VT323.ttf" />
<None Include="bin\Debug\net7.0-windows\appsettings.json" />
<Resource Include="Resources\Fonts\VT323.ttf" />
<Resource Include="Resources\Images\favicon.ico" />
<Resource Include="Resources\Images\MainWindowDevice.png" />
<Resource Include="Resources\Images\RamImage.png" />
<Resource Include="Resources\Images\favicon_wrong.ico" />
<None Remove="Resources\Images\favicon_light.ico" />
<Resource Include="Resources\Images\favicon_light.ico" />
</ItemGroup>

<ItemGroup>
<Folder Include="obj" />
<Folder Include="Resources\Fonts" />
</ItemGroup>

<ItemGroup>
<Page Update="Views\Settings\SettingsView.xaml">
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="Views\Settings\AppearanceSettingsTabView.xaml">
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="Views\Settings\AdvancedSettingsTabView.xaml">
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
</Page>
</ItemGroup>

<ItemGroup>
<Compile Update="Views\Settings\ConnectionSettingsTabView.xaml.cs">
<DependentUpon>ConnectionSettingsTabViewModel.xaml</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<None Remove="appsettings.json" />
<Content Include="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
28 changes: 28 additions & 0 deletions HSMonitor/Models/ApplicationSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.Text.Json.Serialization;

namespace HSMonitor.Models;

public class ApplicationSettings
{
// General

[JsonPropertyName("SerialPort")]
public string? LastSelectedPort { get; set; }

[JsonPropertyName("BaudRate")]
public int LastSelectedBaudRate { get; set; }

public int SendInterval { get; set; }

// Customization

public string? CpuCustomName { get; set; }

public string? GpuCustomName { get; set; }

public bool IsAutodetectHardwareEnabled { get; set; }

// Advanced
[JsonIgnore]
public bool IsAutoStartEnabled { get; set; }
}
54 changes: 54 additions & 0 deletions HSMonitor/Models/HardwareInformation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace HSMonitor.Models;

public class Message
{
public CpuInformation CpuInformation { get; set; }
public GpuInformation GpuInformation { get; set; }
public MemoryInformation MemoryInformation { get; set; }
}

public class CpuInformation
{
public string? Type{ get; set; }

public string? Name { get; set; }
public double Power { get; set; }
public int Clock { get; set; }
public int Temperature { get; set; }
public int Load { get; set; }
}

public class GpuInformation
{
public string? Type { get; set; }
public string? Name { get; set; }
public double Power { get; set; }
public int CoreClock { get; set; }
public int CoreTemperature { get; set; }
public int CoreLoad { get; set; }
public int VRamClock { get; set; }
public int VRamMemoryTotal { get; set; }
public int VRamMemoryUsed { get; set; }
public IEnumerable<GpuFan> GpuFans { get; set; }
}

public class GpuFan
{
public string? Name { get; set; }
public int Load { get; set; }
public int Rpm { get; set; }
}

public class MemoryInformation
{
public int Load { get; set; }
public double Available { get; set; }
public double Used { get; set; }

public double Total => Math.Round(Available + Used, MidpointRounding.AwayFromZero);
}
Binary file added HSMonitor/Resources/Fonts/VT323.ttf
Binary file not shown.
Binary file added HSMonitor/Resources/Images/MainWindowDevice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added HSMonitor/Resources/Images/RamImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added HSMonitor/Resources/Images/favicon.ico
Binary file not shown.
Binary file added HSMonitor/Resources/Images/favicon_light.ico
Binary file not shown.
Binary file added HSMonitor/Resources/Images/favicon_wrong.ico
Binary file not shown.
Loading

0 comments on commit 0f4b924

Please sign in to comment.