1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 21:38:38 +00:00

Merge branch 'development' into feature/updating

This commit is contained in:
Robert 2023-02-26 16:04:03 +01:00
commit d15244f330
18 changed files with 129 additions and 23 deletions

View File

@ -42,9 +42,9 @@
<PackageReference Include="LiteDB" Version="5.0.12" />
<PackageReference Include="McMaster.NETCore.Plugins" Version="1.4.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="RGB.NET.Core" Version="1.0.0" />
<PackageReference Include="RGB.NET.Layout" Version="1.0.0" />
<PackageReference Include="RGB.NET.Presets" Version="1.0.0" />
<PackageReference Include="RGB.NET.Core" Version="2.0.0-prerelease.12" />
<PackageReference Include="RGB.NET.Layout" Version="2.0.0-prerelease.12" />
<PackageReference Include="RGB.NET.Presets" Version="2.0.0-prerelease.12" />
<PackageReference Include="Serilog" Version="2.11.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />

View File

@ -13,7 +13,7 @@ namespace Artemis.Core.DryIoc;
/// <summary>
/// Provides an extension method to register services onto a DryIoc <see cref="IContainer"/>.
/// </summary>
public static class CoreContainerExtensions
public static class ContainerExtensions
{
/// <summary>
/// Registers core services into the container.

View File

@ -20,7 +20,7 @@
<PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" />
<PackageReference Include="ReactiveUI" Version="17.1.50" />
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1" />
<PackageReference Include="RGB.NET.Core" Version="1.0.0" />
<PackageReference Include="RGB.NET.Core" Version="2.0.0-prerelease.12" />
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.108" />
</ItemGroup>
<ItemGroup>

View File

@ -7,7 +7,7 @@ namespace Artemis.UI.Shared.DryIoc;
/// <summary>
/// Provides an extension method to register services onto a DryIoc <see cref="IContainer"/>.
/// </summary>
public static class UIContainerExtensions
public static class ContainerExtensions
{
/// <summary>
/// Registers shared UI services into the container.

View File

@ -56,7 +56,7 @@ public class DuplicateNode : INodeEditorCommand, IDisposable
if (targetCollection == null)
continue;
while (targetCollection.Count() < sourceCollection.Count())
targetCollection.CreatePin();
targetCollection.Add(targetCollection.CreatePin());
}
// Copy the storage

View File

@ -70,7 +70,9 @@ public class WindowsUpdateNotificationProvider : IUpdateNotificationProvider
Dispatcher.UIThread.Post(() =>
{
_mainWindowService.OpenMainWindow();
if (_mainWindowService.HostScreen == null)
return;
// TODO: When proper routing has been implemented, use that here
// Create a settings VM to navigate to
SettingsViewModel settingsViewModel = _getSettingsViewModel(_mainWindowService.HostScreen);

View File

@ -34,8 +34,8 @@
<PackageReference Include="Octopus.Octodiff" Version="2.0.100" />
<PackageReference Include="ReactiveUI" Version="17.1.50" />
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1" />
<PackageReference Include="RGB.NET.Core" Version="1.0.0" />
<PackageReference Include="RGB.NET.Layout" Version="1.0.0" />
<PackageReference Include="RGB.NET.Core" Version="2.0.0-prerelease.12" />
<PackageReference Include="RGB.NET.Layout" Version="2.0.0-prerelease.12" />
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.108" />
<PackageReference Include="Splat.DryIoc" Version="14.6.1" />
</ItemGroup>

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Reactive;
@ -42,7 +42,6 @@ public static class ArtemisBootstrapper
_container.RegisterCore();
_container.RegisterUI();
_container.RegisterSharedUI();
_container.RegisterUpdatingClient();
_container.RegisterNoStringEvaluating();
configureServices?.Invoke(_container);

View File

@ -17,7 +17,7 @@ namespace Artemis.UI.DryIoc;
/// <summary>
/// Provides an extension method to register services onto a DryIoc <see cref="IContainer"/>.
/// </summary>
public static class UIContainerExtensions
public static class ContainerExtensions
{
/// <summary>
/// Registers UI services into the container.
@ -25,7 +25,7 @@ public static class UIContainerExtensions
/// <param name="container">The builder building the current container</param>
public static void RegisterUI(this IContainer container)
{
Assembly[] thisAssembly = {typeof(UIContainerExtensions).Assembly};
Assembly[] thisAssembly = {typeof(ContainerExtensions).Assembly};
container.RegisterInstance(new AssetLoader(), IfAlreadyRegistered.Throw);
container.Register<IAssetLoader, AssetLoader>(Reuse.Singleton);

View File

@ -14,7 +14,7 @@ namespace Artemis.UI.Screens.Debugger.Logs;
public class LogsDebugView : ReactiveUserControl<LogsDebugViewModel>
{
private int _lineCount;
private TextEditor _textEditor;
private TextEditor? _textEditor;
public LogsDebugView()
{
@ -31,7 +31,7 @@ public class LogsDebugView : ReactiveUserControl<LogsDebugViewModel>
protected override void OnInitialized()
{
base.OnInitialized();
Dispatcher.UIThread.Post(() => _textEditor.ScrollToEnd(), DispatcherPriority.ApplicationIdle);
Dispatcher.UIThread.Post(() => _textEditor?.ScrollToEnd(), DispatcherPriority.ApplicationIdle);
}
private void OnTextChanged(object? sender, EventArgs e)
@ -49,7 +49,7 @@ public class LogsDebugView : ReactiveUserControl<LogsDebugViewModel>
//we need this help distance because of rounding.
//if we scroll slightly above the end, we still want it
//to scroll down to the new lines.
const double graceDistance = 1d;
const double GRACE_DISTANCE = 1d;
//if we were at the bottom of the log and
//if the last log event was 5 lines long
@ -59,7 +59,7 @@ public class LogsDebugView : ReactiveUserControl<LogsDebugViewModel>
//if we are more than that out of sync,
//the user scrolled up and we should not
//mess with anything.
if (_lineCount == 0 || linesAdded + graceDistance > outOfScreenLines)
if (_lineCount == 0 || linesAdded + GRACE_DISTANCE > outOfScreenLines)
{
Dispatcher.UIThread.Post(() => _textEditor.ScrollToEnd(), DispatcherPriority.ApplicationIdle);
_lineCount = _textEditor.LineCount;

View File

@ -23,6 +23,7 @@ public class SettingsViewModel : MainScreenViewModel
releasesTabViewModel,
aboutTabViewModel
};
_selectedTab = generalTabViewModel;
}
public ObservableCollection<ActivatableViewModelBase> SettingTabs { get; }

View File

@ -30,7 +30,7 @@ public class ReleaseInstaller : CorePropertyChanged
private readonly IUpdatingClient _updatingClient;
private readonly Progress<float> _progress = new();
private Progress<float> _stepProgress = new();
private string _status;
private string _status = string.Empty;
private float _progress1;
public ReleaseInstaller(string releaseId, ILogger logger, IUpdatingClient updatingClient, HttpClient httpClient)

View File

@ -13,7 +13,7 @@ namespace Artemis.VisualScripting.DryIoc;
/// <summary>
/// Provides an extension method to register services onto a DryIoc <see cref="IContainer"/>.
/// </summary>
public static class UIContainerExtensions
public static class ContainerExtensions
{
/// <summary>
/// Registers NoStringEvaluating services into the container.

View File

@ -3,7 +3,7 @@ using SkiaSharp;
namespace Artemis.VisualScripting.Nodes.Color;
[Node("HSL Color", "Creates a color from hue, saturation and lightness values", "Color", InputType = typeof(Numeric), OutputType = typeof(SKColor))]
[Node("HSL Color", "Creates a color from hue, saturation and lightness numbers", "Color", InputType = typeof(Numeric), OutputType = typeof(SKColor))]
public class HslSKColorNode : Node
{
public HslSKColorNode()

View File

@ -0,0 +1,31 @@
using Artemis.Core;
using SkiaSharp;
namespace Artemis.VisualScripting.Nodes.Color;
[Node("HSV Color", "Creates a color from hue, saturation and value numbers", "Color", InputType = typeof(Numeric), OutputType = typeof(SKColor))]
public class HsvSKColorNode : Node
{
public HsvSKColorNode()
{
H = CreateInputPin<Numeric>("H");
S = CreateInputPin<Numeric>("S");
V = CreateInputPin<Numeric>("V");
Output = CreateOutputPin<SKColor>();
}
public InputPin<Numeric> H { get; set; }
public InputPin<Numeric> S { get; set; }
public InputPin<Numeric> V { get; set; }
public OutputPin<SKColor> Output { get; }
#region Overrides of Node
/// <inheritdoc />
public override void Evaluate()
{
Output.Value = SKColor.FromHsv(H.Value, S.Value, V.Value);
}
#endregion
}

View File

@ -0,0 +1,36 @@
using Artemis.Core;
using SkiaSharp;
namespace Artemis.VisualScripting.Nodes.Color;
[Node("Color to HSL", "Outputs H, S and L values from a color", "Color", InputType = typeof(SKColor), OutputType = typeof(Numeric))]
public class SkColorHsl : Node
{
public SkColorHsl()
{
Input = CreateInputPin<SKColor>();
H = CreateOutputPin<Numeric>("H");
S = CreateOutputPin<Numeric>("S");
L = CreateOutputPin<Numeric>("L");
}
public InputPin<SKColor> Input { get; }
public OutputPin<Numeric> H { get; }
public OutputPin<Numeric> S { get; }
public OutputPin<Numeric> L { get; }
#region Overrides of Node
/// <inheritdoc />
public override void Evaluate()
{
Input.Value.ToHsl(out float h, out float s, out float l);
H.Value = h;
S.Value = s;
L.Value = l;
}
#endregion
}

View File

@ -0,0 +1,36 @@
using Artemis.Core;
using SkiaSharp;
namespace Artemis.VisualScripting.Nodes.Color;
[Node("Color to HSV", "Outputs H, S and L values from a color", "Color", InputType = typeof(SKColor), OutputType = typeof(Numeric))]
public class SkColorHsv : Node
{
public SkColorHsv()
{
Input = CreateInputPin<SKColor>();
H = CreateOutputPin<Numeric>("H");
S = CreateOutputPin<Numeric>("S");
V = CreateOutputPin<Numeric>("V");
}
public InputPin<SKColor> Input { get; }
public OutputPin<Numeric> H { get; }
public OutputPin<Numeric> S { get; }
public OutputPin<Numeric> V { get; }
#region Overrides of Node
/// <inheritdoc />
public override void Evaluate()
{
Input.Value.ToHsv(out float h, out float s, out float v);
H.Value = h;
S.Value = s;
V.Value = v;
}
#endregion
}

View File

@ -1,4 +1,4 @@
using Artemis.Core;
using Artemis.Core;
namespace Artemis.VisualScripting.Nodes.Conversion;
@ -33,6 +33,7 @@ public class ConvertToNumericNode : Node
double input => new Numeric(input),
float input => new Numeric(input),
byte input => new Numeric(input),
bool input => new Numeric(input ? 1 : 0),
_ => TryParse(Input.Value)
};
}
@ -44,4 +45,4 @@ public class ConvertToNumericNode : Node
}
#endregion
}
}