mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-31 17:53:32 +00:00
Merge branch 'development'
This commit is contained in:
commit
b27803b8c0
@ -21,16 +21,20 @@ Artemis 1 is no longer supported and Artemis 2 is in active development. This en
|
|||||||
1. Create a central folder like ```C:\Repos```
|
1. Create a central folder like ```C:\Repos```
|
||||||
2. Clone RGB.NET's [development branch](https://github.com/DarthAffe/RGB.NET/tree/Development) into ```<central folder>\RGB.NET```
|
2. Clone RGB.NET's [development branch](https://github.com/DarthAffe/RGB.NET/tree/Development) into ```<central folder>\RGB.NET```
|
||||||
3. Clone Artemis into ```<central folder>\Artemis```
|
3. Clone Artemis into ```<central folder>\Artemis```
|
||||||
|
4. Clone Artemis.Plugins [master branch](https://github.com/Artemis-RGB/Artemis.Plugins/tree/master) into ```<central folder>\Artemis.Plugins```
|
||||||
5. Open ```<central folder>\RGB.NET\RGB.NET.sln``` and build with the default config
|
5. Open ```<central folder>\RGB.NET\RGB.NET.sln``` and build with the default config
|
||||||
4. Open ```<central folder>\Artemis\src\Artemis.sln```
|
6. Open ```<central folder>\Artemis\src\Artemis.sln``` and build as Debug
|
||||||
5. Restore Nuget packages
|
7. Open ```<central folder>\Artemis.Plugins\src\Artemis.Plugins.sln``` and build as Debug
|
||||||
|
8. Restore Nuget packages
|
||||||
|
|
||||||
##### Alternatively in PowerShell
|
##### Alternatively in PowerShell
|
||||||
```powershell
|
```powershell
|
||||||
git clone https://github.com/DarthAffe/RGB.NET -b Development RGB.NET
|
git clone https://github.com/DarthAffe/RGB.NET -b Development RGB.NET
|
||||||
git clone https://github.com/Artemis-RGB/Artemis Artemis
|
git clone https://github.com/Artemis-RGB/Artemis Artemis
|
||||||
|
git clone https://github.com/Artemis-RGB/Artemis.Plugins Artemis.Plugins
|
||||||
dotnet build .\RGB.NET\RGB.NET.sln
|
dotnet build .\RGB.NET\RGB.NET.sln
|
||||||
dotnet build .\Artemis\src\Artemis.sln
|
dotnet build .\Artemis\src\Artemis.sln
|
||||||
|
dotnet build .\Artemis.Plugins\src\Artemis.Plugins.sln
|
||||||
```
|
```
|
||||||
|
|
||||||
For an up-to-date overview of what's currently being worked on, see the [Projects](https://github.com/SpoinkyNL/Artemis/projects) page
|
For an up-to-date overview of what's currently being worked on, see the [Projects](https://github.com/SpoinkyNL/Artemis/projects) page
|
||||||
|
|||||||
@ -213,9 +213,25 @@ namespace Artemis.Core
|
|||||||
Expression? expression = Expression.Convert(parameter, Target.GetType());
|
Expression? expression = Expression.Convert(parameter, Target.GetType());
|
||||||
Expression? nullCondition = null;
|
Expression? nullCondition = null;
|
||||||
|
|
||||||
|
MethodInfo equals = typeof(object).GetMethod("Equals", BindingFlags.Static | BindingFlags.Public)!;
|
||||||
foreach (DataModelPathSegment segment in _segments)
|
foreach (DataModelPathSegment segment in _segments)
|
||||||
{
|
{
|
||||||
BinaryExpression notNull = Expression.NotEqual(expression, Expression.Default(expression.Type));
|
BinaryExpression notNull;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
notNull = Expression.NotEqual(expression, Expression.Default(expression.Type));
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException)
|
||||||
|
{
|
||||||
|
notNull = Expression.NotEqual(
|
||||||
|
Expression.Call(
|
||||||
|
null,
|
||||||
|
equals,
|
||||||
|
Expression.Convert(expression, typeof(object)),
|
||||||
|
Expression.Convert(Expression.Default(expression.Type), typeof(object))),
|
||||||
|
Expression.Constant(true));
|
||||||
|
}
|
||||||
|
|
||||||
nullCondition = nullCondition != null ? Expression.AndAlso(nullCondition, notNull) : notNull;
|
nullCondition = nullCondition != null ? Expression.AndAlso(nullCondition, notNull) : notNull;
|
||||||
expression = segment.Initialize(parameter, expression, nullCondition);
|
expression = segment.Initialize(parameter, expression, nullCondition);
|
||||||
if (expression == null)
|
if (expression == null)
|
||||||
|
|||||||
@ -6,10 +6,10 @@
|
|||||||
xmlns:local="clr-namespace:Artemis.UI.Screens.Settings.Debug.Tabs"
|
xmlns:local="clr-namespace:Artemis.UI.Screens.Settings.Debug.Tabs"
|
||||||
xmlns:s="https://github.com/canton7/Stylet"
|
xmlns:s="https://github.com/canton7/Stylet"
|
||||||
xmlns:wpf="http://materialdesigninxaml.net/winfx/xaml/themes"
|
xmlns:wpf="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
xmlns:modules="clr-namespace:Artemis.Core.Modules;assembly=Artemis.Core"
|
|
||||||
xmlns:dataModel="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
xmlns:dataModel="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance local:DataModelDebugViewModel}">
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
|
d:DataContext="{d:DesignInstance local:DataModelDebugViewModel}">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<dataModel:TypeToStringConverter x:Key="TypeToStringConverter" />
|
<dataModel:TypeToStringConverter x:Key="TypeToStringConverter" />
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
@ -19,6 +19,10 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid Grid.Row="0" Margin="0 0 0 5">
|
<Grid Grid.Row="0" Margin="0 0 0 5">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
@ -29,16 +33,18 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<!-- Property searching (nyi) -->
|
<!-- Property searching (nyi) -->
|
||||||
<wpf:PackIcon Grid.Column="0" Kind="Search" VerticalAlignment="Center" />
|
<wpf:PackIcon Grid.Column="0" Kind="Search" VerticalAlignment="Center" />
|
||||||
<TextBox Grid.Column="1" wpf:HintAssist.Hint="Search property" VerticalAlignment="Center" Margin="5 0" IsEnabled="False" />
|
<TextBox Grid.Row="0" Grid.Column="1" wpf:HintAssist.Hint="Search property" VerticalAlignment="Center" Margin="5 0" IsEnabled="False" />
|
||||||
|
|
||||||
<!-- Module filtering -->
|
<!-- Module filtering -->
|
||||||
<TextBlock Grid.Column="3" VerticalAlignment="Center">Filter module</TextBlock>
|
<TextBlock Grid.Row="0" Grid.Column="3" VerticalAlignment="Center">Filter module</TextBlock>
|
||||||
<ToggleButton Grid.Column="4"
|
<ToggleButton Grid.Row="0"
|
||||||
|
Grid.Column="4"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Margin="5 0"
|
Margin="5 0"
|
||||||
Style="{StaticResource MaterialDesignSwitchToggleButton}"
|
Style="{StaticResource MaterialDesignSwitchToggleButton}"
|
||||||
IsChecked="{Binding IsModuleFilterEnabled}" />
|
IsChecked="{Binding IsModuleFilterEnabled}" />
|
||||||
<ComboBox Grid.Column="5"
|
<ComboBox Grid.Row="0"
|
||||||
|
Grid.Column="5"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
wpf:HintAssist.Hint="Select a module"
|
wpf:HintAssist.Hint="Select a module"
|
||||||
IsEditable="True"
|
IsEditable="True"
|
||||||
@ -48,6 +54,17 @@
|
|||||||
IsEnabled="{Binding IsModuleFilterEnabled}"
|
IsEnabled="{Binding IsModuleFilterEnabled}"
|
||||||
SelectedItem="{Binding SelectedModule}"
|
SelectedItem="{Binding SelectedModule}"
|
||||||
ItemsSource="{Binding Modules}" />
|
ItemsSource="{Binding Modules}" />
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Margin="0 10 0 0"
|
||||||
|
ToolTip="Check to update values every half second instead of realtime">
|
||||||
|
<TextBlock VerticalAlignment="Center">Slow updates</TextBlock>
|
||||||
|
<ToggleButton VerticalAlignment="Center" Margin="5 0" Style="{StaticResource MaterialDesignSwitchToggleButton}" IsChecked="{Binding SlowUpdates}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<TreeView Grid.Row="1" ItemsSource="{Binding MainDataModel.Children}" HorizontalContentAlignment="Stretch">
|
<TreeView Grid.Row="1" ItemsSource="{Binding MainDataModel.Children}" HorizontalContentAlignment="Stretch">
|
||||||
<TreeView.Resources>
|
<TreeView.Resources>
|
||||||
|
|||||||
@ -20,12 +20,13 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs
|
|||||||
private DataModelPropertiesViewModel _mainDataModel;
|
private DataModelPropertiesViewModel _mainDataModel;
|
||||||
private string _propertySearch;
|
private string _propertySearch;
|
||||||
private Module _selectedModule;
|
private Module _selectedModule;
|
||||||
|
private bool _slowUpdates;
|
||||||
|
|
||||||
public DataModelDebugViewModel(IDataModelUIService dataModelUIService, IPluginManagementService pluginManagementService)
|
public DataModelDebugViewModel(IDataModelUIService dataModelUIService, IPluginManagementService pluginManagementService)
|
||||||
{
|
{
|
||||||
_dataModelUIService = dataModelUIService;
|
_dataModelUIService = dataModelUIService;
|
||||||
_pluginManagementService = pluginManagementService;
|
_pluginManagementService = pluginManagementService;
|
||||||
_updateTimer = new Timer(500);
|
_updateTimer = new Timer(25);
|
||||||
|
|
||||||
DisplayName = "Data model";
|
DisplayName = "Data model";
|
||||||
Modules = new BindableCollection<Module>();
|
Modules = new BindableCollection<Module>();
|
||||||
@ -43,6 +44,16 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs
|
|||||||
set => SetAndNotify(ref _propertySearch, value);
|
set => SetAndNotify(ref _propertySearch, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool SlowUpdates
|
||||||
|
{
|
||||||
|
get => _slowUpdates;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetAndNotify(ref _slowUpdates, value);
|
||||||
|
_updateTimer.Interval = _slowUpdates ? 500 : 25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public BindableCollection<Module> Modules { get; }
|
public BindableCollection<Module> Modules { get; }
|
||||||
|
|
||||||
public Module SelectedModule
|
public Module SelectedModule
|
||||||
|
|||||||
@ -16,7 +16,6 @@ using Artemis.UI.Shared.Services;
|
|||||||
using Flurl;
|
using Flurl;
|
||||||
using Flurl.Http;
|
using Flurl.Http;
|
||||||
using MaterialDesignThemes.Wpf;
|
using MaterialDesignThemes.Wpf;
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using File = System.IO.File;
|
using File = System.IO.File;
|
||||||
|
|
||||||
@ -27,8 +26,8 @@ namespace Artemis.UI.Services
|
|||||||
private const string ApiUrl = "https://dev.azure.com/artemis-rgb/Artemis/_apis/";
|
private const string ApiUrl = "https://dev.azure.com/artemis-rgb/Artemis/_apis/";
|
||||||
private readonly PluginSetting<bool> _autoInstallUpdates;
|
private readonly PluginSetting<bool> _autoInstallUpdates;
|
||||||
private readonly PluginSetting<bool> _checkForUpdates;
|
private readonly PluginSetting<bool> _checkForUpdates;
|
||||||
private readonly ILogger _logger;
|
|
||||||
private readonly IDialogService _dialogService;
|
private readonly IDialogService _dialogService;
|
||||||
|
private readonly ILogger _logger;
|
||||||
private readonly IMessageService _messageService;
|
private readonly IMessageService _messageService;
|
||||||
private readonly IWindowService _windowService;
|
private readonly IWindowService _windowService;
|
||||||
|
|
||||||
@ -46,6 +45,32 @@ namespace Artemis.UI.Services
|
|||||||
_checkForUpdates.SettingChanged += CheckForUpdatesOnSettingChanged;
|
_checkForUpdates.SettingChanged += CheckForUpdatesOnSettingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task OfferUpdate(DevOpsBuild buildInfo)
|
||||||
|
{
|
||||||
|
await _dialogService.ShowDialog<UpdateDialogViewModel>(new Dictionary<string, object> {{"buildInfo", buildInfo}});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task UpdateInstaller()
|
||||||
|
{
|
||||||
|
string downloadUrl = "https://builds.artemis-rgb.com/binaries/Artemis.Installer.exe";
|
||||||
|
string installerDirectory = Path.Combine(Constants.ApplicationFolder, "Installer");
|
||||||
|
string installerPath = Path.Combine(installerDirectory, "Artemis.Installer.exe");
|
||||||
|
|
||||||
|
_logger.Information("UpdateInstaller: Downloading installer from {downloadUrl}", downloadUrl);
|
||||||
|
using HttpClient client = new();
|
||||||
|
HttpResponseMessage httpResponseMessage = await client.GetAsync(downloadUrl);
|
||||||
|
if (!httpResponseMessage.IsSuccessStatusCode)
|
||||||
|
throw new ArtemisUIException($"Failed to download installer, status code {httpResponseMessage.StatusCode}");
|
||||||
|
|
||||||
|
_logger.Information("UpdateInstaller: Writing installer file to {installerPath}", installerPath);
|
||||||
|
if (File.Exists(installerPath))
|
||||||
|
File.Delete(installerPath);
|
||||||
|
|
||||||
|
Core.Utilities.CreateAccessibleDirectory(installerDirectory);
|
||||||
|
await using FileStream fs = new(installerPath, FileMode.Create, FileAccess.Write, FileShare.None);
|
||||||
|
await httpResponseMessage.Content.CopyToAsync(fs);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<bool> AutoUpdate()
|
public async Task<bool> AutoUpdate()
|
||||||
{
|
{
|
||||||
if (!_checkForUpdates.Value)
|
if (!_checkForUpdates.Value)
|
||||||
@ -68,7 +93,9 @@ namespace Artemis.UI.Services
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (_windowService.IsMainWindowOpen)
|
if (_windowService.IsMainWindowOpen)
|
||||||
|
{
|
||||||
await OfferUpdate(buildInfo);
|
await OfferUpdate(buildInfo);
|
||||||
|
}
|
||||||
else if (_autoInstallUpdates.Value)
|
else if (_autoInstallUpdates.Value)
|
||||||
{
|
{
|
||||||
// Lets go
|
// Lets go
|
||||||
@ -92,11 +119,6 @@ namespace Artemis.UI.Services
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OfferUpdate(DevOpsBuild buildInfo)
|
|
||||||
{
|
|
||||||
await _dialogService.ShowDialog<UpdateDialogViewModel>(new Dictionary<string, object> {{"buildInfo", buildInfo}});
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<bool> IsUpdateAvailable()
|
public async Task<bool> IsUpdateAvailable()
|
||||||
{
|
{
|
||||||
DevOpsBuild buildInfo = await GetBuildInfo(1);
|
DevOpsBuild buildInfo = await GetBuildInfo(1);
|
||||||
@ -114,7 +136,9 @@ namespace Artemis.UI.Services
|
|||||||
|
|
||||||
// Always update installer if it is missing ^^
|
// Always update installer if it is missing ^^
|
||||||
if (!File.Exists(installerPath))
|
if (!File.Exists(installerPath))
|
||||||
|
{
|
||||||
await UpdateInstaller();
|
await UpdateInstaller();
|
||||||
|
}
|
||||||
// Compare the creation date of the installer with the build date and update if needed
|
// Compare the creation date of the installer with the build date and update if needed
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -182,27 +206,6 @@ namespace Artemis.UI.Services
|
|||||||
.GetJsonAsync<GitHubDifference>();
|
.GetJsonAsync<GitHubDifference>();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task UpdateInstaller()
|
|
||||||
{
|
|
||||||
string downloadUrl = "https://builds.artemis-rgb.com/binaries/Artemis.Installer.exe";
|
|
||||||
string installerDirectory = Path.Combine(Constants.ApplicationFolder, "Installer");
|
|
||||||
string installerPath = Path.Combine(installerDirectory, "Artemis.Installer.exe");
|
|
||||||
|
|
||||||
_logger.Information("UpdateInstaller: Downloading installer from {downloadUrl}", downloadUrl);
|
|
||||||
using HttpClient client = new();
|
|
||||||
HttpResponseMessage httpResponseMessage = await client.GetAsync(downloadUrl);
|
|
||||||
if (!httpResponseMessage.IsSuccessStatusCode)
|
|
||||||
throw new ArtemisUIException($"Failed to download installer, status code {httpResponseMessage.StatusCode}");
|
|
||||||
|
|
||||||
_logger.Information("UpdateInstaller: Writing installer file to {installerPath}", installerPath);
|
|
||||||
if (File.Exists(installerPath))
|
|
||||||
File.Delete(installerPath);
|
|
||||||
else if (!Directory.Exists(installerDirectory))
|
|
||||||
Directory.CreateDirectory(installerDirectory);
|
|
||||||
await using FileStream fs = new(installerPath, FileMode.Create, FileAccess.Write, FileShare.None);
|
|
||||||
await httpResponseMessage.Content.CopyToAsync(fs);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Event handlers
|
#region Event handlers
|
||||||
|
|
||||||
private void CheckForUpdatesOnSettingChanged(object sender, EventArgs e)
|
private void CheckForUpdatesOnSettingChanged(object sender, EventArgs e)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user