diff --git a/src/Artemis.Core/Services/CoreService.cs b/src/Artemis.Core/Services/CoreService.cs index 28f590376..f907bd0e8 100644 --- a/src/Artemis.Core/Services/CoreService.cs +++ b/src/Artemis.Core/Services/CoreService.cs @@ -119,11 +119,24 @@ namespace Artemis.Core.Services try { _frameStopWatch.Restart(); + + // Render all active modules + SKTexture texture = _rgbService.OpenRender(); + lock (_dataModelExpansions) { // Update all active modules, check Enabled status because it may go false before before the _dataModelExpansions list is updated foreach (BaseDataModelExpansion dataModelExpansion in _dataModelExpansions.Where(e => e.IsEnabled)) - dataModelExpansion.InternalUpdate(args.DeltaTime); + { + try + { + dataModelExpansion.InternalUpdate(args.DeltaTime); + } + catch (Exception e) + { + _updateExceptions.Add(e); + } + } } List modules; @@ -137,10 +150,16 @@ namespace Artemis.Core.Services // Update all active modules foreach (Module module in modules) - module.InternalUpdate(args.DeltaTime); - - // Render all active modules - SKTexture texture = _rgbService.OpenRender(); + { + try + { + module.InternalUpdate(args.DeltaTime); + } + catch (Exception e) + { + _updateExceptions.Add(e); + } + } SKCanvas canvas = texture.Surface.Canvas; canvas.Save(); @@ -152,7 +171,16 @@ namespace Artemis.Core.Services if (!ModuleRenderingDisabled) { foreach (Module module in modules.Where(m => m.IsActivated)) - module.InternalRender(args.DeltaTime, canvas, texture.ImageInfo); + { + try + { + module.InternalRender(args.DeltaTime, canvas, texture.ImageInfo); + } + catch (Exception e) + { + _updateExceptions.Add(e); + } + } } OnFrameRendering(new FrameRenderingEventArgs(canvas, args.DeltaTime, _rgbService.Surface)); diff --git a/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs b/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs index e3fd07f40..130cbe0c4 100644 --- a/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs +++ b/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs @@ -100,15 +100,11 @@ namespace Artemis.UI.Shared // Determine the scale required to fit the desired size of the control Size measureSize = MeasureDevice(); - double scale = Math.Min(DesiredSize.Width / measureSize.Width, DesiredSize.Height / measureSize.Height); - Rect scaledRect = new(0, 0, measureSize.Width * scale, measureSize.Height * scale); + double scale = Math.Min(RenderSize.Width / measureSize.Width, RenderSize.Height / measureSize.Height); - // Center and scale the visualization in the desired bounding box - if (DesiredSize.Width > 0 && DesiredSize.Height > 0) - { - drawingContext.PushTransform(new TranslateTransform(DesiredSize.Width / 2 - scaledRect.Width / 2, DesiredSize.Height / 2 - scaledRect.Height / 2)); + // Scale the visualization in the desired bounding box + if (RenderSize.Width > 0 && RenderSize.Height > 0) drawingContext.PushTransform(new ScaleTransform(scale, scale)); - } // Determine the offset required to rotate within bounds Rect rotationRect = new(0, 0, Device.RgbDevice.ActualSize.Width, Device.RgbDevice.ActualSize.Height); diff --git a/src/Artemis.UI/Screens/Plugins/PluginPrerequisitesInstallDialogView.xaml b/src/Artemis.UI/Screens/Plugins/PluginPrerequisitesInstallDialogView.xaml index d4c933acc..1fbb9e213 100644 --- a/src/Artemis.UI/Screens/Plugins/PluginPrerequisitesInstallDialogView.xaml +++ b/src/Artemis.UI/Screens/Plugins/PluginPrerequisitesInstallDialogView.xaml @@ -7,17 +7,20 @@ xmlns:s="https://github.com/canton7/Stylet" xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:converters="clr-namespace:Artemis.UI.Converters" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance local:PluginPrerequisitesInstallDialogViewModel}"> - + + + - - + + @@ -32,7 +35,6 @@ ItemsSource="{Binding Prerequisites}" SelectedItem="{Binding ActivePrerequisite, Mode=OneWay}" HorizontalContentAlignment="Stretch"> - @@ -75,26 +77,36 @@ HorizontalContentAlignment="Stretch" Margin="10 0" IsTabStop="False" - Visibility="{Binding ActivePrerequisite, Converter={StaticResource NullToVisibilityConverter}}"/> + Visibility="{Binding ShowProgress, Converter={x:Static s:BoolToVisibilityConverter.Instance}, Mode=OneWay}" /> - + Visibility="{Binding ShowIntro, Converter={x:Static s:BoolToVisibilityConverter.Instance}, Mode=OneWay}"> In order for this plugin/feature to function certain prerequisites must be met. On the left side you can see all prerequisites and whether they are currently met or not. Clicking install prerequisites will automatically set everything up for you. + + Installing failed. + You may try again to see if that helps, otherwise install the prerequisite manually or contact the plugin developer. + + + Visibility="{Binding ShowInstall, Converter={x:Static s:BoolToVisibilityConverter.Instance}, Mode=OneWay}">