1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-12 17:48:31 +00:00

Added the correct model-description for asus-mainboards, added PrimeX370-Pro-Layout

This commit is contained in:
Darth Affe 2017-12-30 21:05:41 +01:00
parent dbdf95e06f
commit 4c32eedee0
8 changed files with 101 additions and 5 deletions

View File

@ -45,12 +45,12 @@ namespace RGB.NET.Devices.Asus
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
/// <param name="manufacturer">The manufacturer-name of the <see cref="IRGBDevice"/>.</param>
/// <param name="model">The model-name of the <see cref="IRGBDevice"/>.</param>
internal AsusRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle, string manufacturer = "Asus", string model = "Generic Asus-Device")
internal AsusRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle, string model = "Generic Asus-Device", string manufacturer = "Asus")
{
this.DeviceType = deviceType;
this.Handle = handle;
this.Manufacturer = manufacturer;
this.Model = model;
this.Manufacturer = manufacturer;
}
#endregion

View File

@ -0,0 +1,31 @@
using System.Management;
namespace RGB.NET.Devices.Asus
{
// ReSharper disable once InconsistentNaming
internal static class WMIHelper
{
#region Properties & Fields
private static ManagementObjectSearcher _mainboardSearcher = new ManagementObjectSearcher(@"root\CIMV2", "SELECT * FROM Win32_BaseBoard");
private static (string manufacturer, string model)? _mainboardInfo;
#endregion
#region Methods
internal static (string manufacturer, string model)? GetMainboardInfo()
{
if (!_mainboardInfo.HasValue)
foreach (ManagementBaseObject managementBaseObject in _mainboardSearcher.Get())
{
_mainboardInfo = (managementBaseObject["Manufacturer"]?.ToString(), managementBaseObject["Product"]?.ToString());
break;
}
return _mainboardInfo;
}
#endregion
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 773 KiB

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<Device xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Name>Asus Prime X370-PRO</Name>
<Description>Asus Prime X370-PRO Mainboard</Description>
<Author>Darth Affe</Author>
<Type>Mainboard</Type>
<Lighting>Key</Lighting>
<Vendor>Asus</Vendor>
<Model>Prime X370-PRO</Model>
<Width>252</Width>
<Height>305</Height>
<Leds>
<Led Id="Mainboard1">
<X>0</X>
<Y>131</Y>
<Width>35mm</Width>
<Height>57mm</Height>
<Shape>M 0,0 L 0,1 L 0.325,1 L 0.325,0 Z M 0.862,0 L 0.822,0.06 L 0.904,0.11 L 0.91,0.505 L 0.86,0.532 L 0.74,0.532 L 0.6575,0.485 L 0.54,0.485 L 0.425,0.55 L 0.425,0.64 L0.44,0.66 L0.44,0.755 L 0.4,0.78 L 0.4,1 L 0.5,1 L 0.5,0.805 L 0.53,0.785 L 0.53,0.6325 L 0.515,0.6225 L 0.515,0.575 L 0.575,0.543 L 0.6225,0.543 L 0.705,0.59 L 0.9,0.59 L 1,0.525 L 1,0.08 Z</Shape>
</Led>
<Led Id="Mainboard2">
<X>0</X>
<Y>+</Y>
<Width>17mm</Width>
<Height>40mm</Height>
<Shape>M 0.83,0 L 0.83,1 L1,1 L 1,0 Z M 0,0 L 0,1 L 0.6691,1 L 0.6691,0 Z</Shape>
</Led>
<Led Id="Mainboard3">
<X>0</X>
<Y>+</Y>
<Width>44mm</Width>
<Height>41mm</Height>
<Shape>
M 0,0 L 0,1 L 0.26,1 L 0.26,0 Z M 0.32,0 L 0.32,0.29 L 0.365,0.325 L 0.395,0.325 L 0.395,0.36 L 0.455,0.41 L 0.49,0.345 L 0.4675,0.32 L 0.455,0.2475 L 0.4675,0.26 L 0.395,0.2475 L 0.395,0 Z
M 0.935,0.715 L 0.935,0.84 L 0.865,0.915 L 0.865,1 L 0.9375,1 L 0.9375,0.95 L 1,0.88 L 1,0.715 Z
</Shape>
</Led>
<Led Id="Mainboard4">
<X>0</X>
<Y>+</Y>
<Width>68mm</Width>
<Height>35mm</Height>
<Shape>M 0,0 L 0,1 L 0.94,1 L 0.94,0.95 L 0.206,0.95 Q 0.168,0.95 0.165,0.875 L 0.165,0 Z M 0.55,0.019 L 0.55,0.132 L 0.578,0.19 L 0.578,0.2078 L 0.612,0.271 L 0.612,0.6625 L 0.635,0.7125 L0.735,0.7125 L0.755,0.75 L 0.915,0.75 L 0.92,0.76 L 0.942,0.76 L 0.94,1 L 0.99,1 L 0.99,0.72 L 0.965,0.67 L 0.935,0.67 L 0.93,0.66 L 0.772,0.66 L 0.752,0.62 L 0.66,0.62 L 0.66,0.237 L 0.622,0.16 L 0.622,0.145 L 0.5975,0.095 L 0.5975,0.019 Z</Shape>
</Led>
<Led Id="Mainboard5">
<X>80</X>
<Y>132</Y>
<Width>5mm</Width>
<Height>13mm</Height>
</Led>
</Leds>
</Device>

View File

@ -25,7 +25,7 @@ namespace RGB.NET.Devices.Asus
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
internal AsusMainboardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
: base(deviceType, handle)
: base(deviceType, handle, WMIHelper.GetMainboardInfo()?.model ?? "Generic Asus-Device")
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Asus\Mainboards\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}

View File

@ -34,6 +34,7 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Management" />
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
@ -55,6 +56,7 @@
<Compile Include="Generic\IAsusRGBDevice.cs" />
<Compile Include="GraphicsCard\AsusGraphicsCardRGBDevice.cs" />
<Compile Include="GraphicsCard\AsusGraphicsCardRGBDeviceInfo.cs" />
<Compile Include="Helper\WMIHelper.cs" />
<Compile Include="Keyboard\AsusKeyboardRGBDevice.cs" />
<Compile Include="Keyboard\AsusKeyboardRGBDeviceInfo.cs" />
<Compile Include="Mainboard\AsusMainboardRGBDevice.cs" />
@ -72,6 +74,10 @@
<None Include="targets\RGB.NET.Devices.Asus.targets" />
</ItemGroup>
<ItemGroup>
<None Include="Images\Asus\Mainboards\PRIMEX370-PRO.png" />
<Content Include="Layouts\Asus\Mainboards\PRIMEX370-PRO.xml">
<SubType>Designer</SubType>
</Content>
<Content Include="libs\x86\AURA_SDK.dll" />
<Content Include="libs\x86\ClaymoreProtocol.dll" />
<Content Include="libs\x86\EVOLVE SYNC Dll.dll" />
@ -83,8 +89,6 @@
<Content Include="libs\x86\VGA_Extra.dll" />
</ItemGroup>
<ItemGroup>
<Folder Include="Images\Asus\" />
<Folder Include="Layouts\Asus\" />
<Folder Include="libs\x64\" />
</ItemGroup>
<ItemGroup>

View File

@ -4,6 +4,7 @@
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=generic/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=generic_005Cupdate/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=graphicscard/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=helper/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=keyboard/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=mainboard/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=mouse/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@ -212,9 +212,13 @@
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INDENT_NESTED_USINGS_STMT/@EntryValue">True</s:Boolean>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_EXISTING_EMBEDDED_BLOCK_ARRANGEMENT/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/LINE_FEED_AT_FILE_END/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_CONSTRUCTOR_INITIALIZER_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/REDUNDANT_THIS_QUALIFIER_STYLE/@EntryValue">ALWAYS_USE</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SIMPLE_EMBEDDED_BLOCK_STYLE/@EntryValue">DO_NOT_CHANGE</s:String>
@ -331,7 +335,12 @@
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=NAMESPACE_005FALIAS/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FRESOURCE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpRenamePlacementToArrangementMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsCodeFormatterSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>