mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Removed the rest of CS Script and removed old plugin projects
This commit is contained in:
1 parent
4e565f9d76
commit
571a3fe168
47 files changed
+550
-846
No files matched your search
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{E592F239-FAA0-4840-9C85-46E5867D06D5}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Artemis.Plugins.Modules.General</RootNamespace>
|
||||
<AssemblyName>Artemis.Plugins.Modules.General</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="RGB.NET.Core, Version=0.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Core.0.1.22\lib\net45\RGB.NET.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Stylet, Version=1.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Stylet.1.1.22\lib\net45\Stylet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="GeneralDataModel.cs" />
|
||||
<Compile Include="GeneralModule.cs" />
|
||||
<Compile Include="ViewModels\GeneralViewModel.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="plugin.json" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj">
|
||||
<Project>{9b811f9b-86b9-4771-87af-72bae7078a36}</Project>
|
||||
<Name>Artemis.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="Views\GeneralView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,11 @@
|
||||
using Artemis.Core.Attributes;
|
||||
using Artemis.Core.Plugins.Interfaces;
|
||||
|
||||
namespace Artemis.Plugins.Modules.General
|
||||
{
|
||||
public class GeneralDataModel : IModuleDataModel
|
||||
{
|
||||
[DataModelProperty(DisplayName = "Unique boolean")]
|
||||
public bool PropertyUniqueToThisDm { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using Artemis.Core;
|
||||
using Artemis.Core.Plugins.Interfaces;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.Plugins.Modules.General.ViewModels;
|
||||
using RGB.NET.Core;
|
||||
using Stylet;
|
||||
using Color = System.Drawing.Color;
|
||||
using Rectangle = System.Drawing.Rectangle;
|
||||
|
||||
namespace Artemis.Plugins.Modules.General
|
||||
{
|
||||
public class GeneralModule : IModule
|
||||
{
|
||||
private readonly IRgbService _rgbService;
|
||||
private readonly RGBSurface _surface;
|
||||
private Dictionary<Led, Color> _colors;
|
||||
|
||||
public GeneralModule()
|
||||
{
|
||||
|
||||
}
|
||||
public GeneralModule(IRgbService rgbService)
|
||||
{
|
||||
_rgbService = rgbService;
|
||||
_surface = _rgbService.Surface;
|
||||
_colors = new Dictionary<Led, Color>();
|
||||
|
||||
_rgbService.FinishedLoadedDevices += (sender, args) => PopulateColors();
|
||||
}
|
||||
|
||||
// True since the main data model is all this module shows
|
||||
public bool ExpandsMainDataModel => true;
|
||||
|
||||
public void Update(double deltaTime)
|
||||
{
|
||||
if (_colors == null)
|
||||
return;
|
||||
|
||||
foreach (var surfaceLed in _surface.Leds)
|
||||
UpdateLedColor(surfaceLed, deltaTime);
|
||||
}
|
||||
|
||||
public void Render(double deltaTime, RGBSurface surface, Graphics graphics)
|
||||
{
|
||||
foreach (var surfaceLed in _surface.Leds)
|
||||
{
|
||||
if (!_colors.ContainsKey(surfaceLed))
|
||||
continue;
|
||||
|
||||
var brush = new SolidBrush(_colors[surfaceLed]);
|
||||
var rectangle = new Rectangle((int) surfaceLed.LedRectangle.X, (int) surfaceLed.LedRectangle.Y, (int) surfaceLed.LedRectangle.Width, (int) surfaceLed.LedRectangle.Height);
|
||||
graphics.FillRectangle(brush, rectangle);
|
||||
UpdateLedColor(surfaceLed, deltaTime);
|
||||
}
|
||||
}
|
||||
|
||||
public IScreen GetMainViewModel()
|
||||
{
|
||||
return new GeneralViewModel();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_colors = null;
|
||||
}
|
||||
|
||||
public void LoadPlugin()
|
||||
{
|
||||
PopulateColors();
|
||||
}
|
||||
|
||||
private void UpdateLedColor(Led led, double deltaTime)
|
||||
{
|
||||
if (_colors.ContainsKey(led))
|
||||
_colors[led] = ColorHelpers.ShiftColor(_colors[led], (int) (deltaTime * 1000));
|
||||
else
|
||||
_colors[led] = ColorHelpers.GetRandomRainbowColor();
|
||||
}
|
||||
|
||||
private void PopulateColors()
|
||||
{
|
||||
_colors = new Dictionary<Led, Color>();
|
||||
foreach (var surfaceLed in _surface.Leds)
|
||||
_colors.Add(surfaceLed, ColorHelpers.GetRandomRainbowColor());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Artemis.Plugins.Modules.General")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("HP Inc.")]
|
||||
[assembly: AssemblyProduct("Artemis.Plugins.Modules.General")]
|
||||
[assembly: AssemblyCopyright("Copyright © HP Inc. 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("e592f239-faa0-4840-9c85-46e5867d06d5")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,11 @@
|
||||
using Artemis.Core.Plugins.Interfaces;
|
||||
using Artemis.Core.Plugins.Models;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.Plugins.Modules.General.ViewModels
|
||||
{
|
||||
public class GeneralViewModel : Screen, IModuleViewModel
|
||||
{
|
||||
public PluginInfo PluginInfo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<UserControl x:Class="Artemis.Plugins.Modules.General.Views.GeneralView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Artemis.Plugins.Modules.General.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid />
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Ninject" publicKeyToken="c7192dc5380945e7" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.3.4.0" newVersion="3.3.4.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<packages>
|
||||
<package id="RGB.NET.Core" version="0.1.22" targetFramework="net461" />
|
||||
<package id="Stylet" version="1.1.22" targetFramework="net461" />
|
||||
<package id="System.ValueTuple" version="4.4.0" targetFramework="net461" />
|
||||
</packages>
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"Name": "General module",
|
||||
"Version": "1.0.0",
|
||||
"Main": "Artemis.Plugins.Modules.General.dll"
|
||||
}
|
||||
Reference in new issue
Block a user