diff --git a/src/Artemis.Core/Models/Surface/LayoutSelection.cs b/src/Artemis.Core/Models/Surface/LayoutSelection.cs index f64c54eb1..f88f2ac0c 100644 --- a/src/Artemis.Core/Models/Surface/LayoutSelection.cs +++ b/src/Artemis.Core/Models/Surface/LayoutSelection.cs @@ -7,6 +7,7 @@ public class LayoutSelection : CorePropertyChanged { private string? _type; private string? _parameter; + private string? _errorState; /// /// Gets or sets what kind of layout reference this is. @@ -25,4 +26,13 @@ public class LayoutSelection : CorePropertyChanged get => _parameter; set => SetAndNotify(ref _parameter, value); } + + /// + /// Gets or sets the error state of the layout reference. + /// + public string? ErrorState + { + get => _errorState; + set => SetAndNotify(ref _errorState, value); + } } \ No newline at end of file diff --git a/src/Artemis.Core/Services/DeviceService.cs b/src/Artemis.Core/Services/DeviceService.cs index da81a82a6..111594c4a 100644 --- a/src/Artemis.Core/Services/DeviceService.cs +++ b/src/Artemis.Core/Services/DeviceService.cs @@ -184,13 +184,14 @@ internal class DeviceService : IDeviceService device.ApplyLayout(null, false, false); else provider?.ApplyLayout(device, layout); + + UpdateLeds(); } catch (Exception e) { + device.LayoutSelection.ErrorState = e.Message; _logger.Error(e, "Failed to apply device layout"); } - - UpdateLeds(); } /// diff --git a/src/Artemis.UI/Screens/Device/Tabs/Layout/DeviceLayoutTabView.axaml b/src/Artemis.UI/Screens/Device/Tabs/Layout/DeviceLayoutTabView.axaml index 9dccbfef4..e741e286c 100644 --- a/src/Artemis.UI/Screens/Device/Tabs/Layout/DeviceLayoutTabView.axaml +++ b/src/Artemis.UI/Screens/Device/Tabs/Layout/DeviceLayoutTabView.axaml @@ -83,6 +83,10 @@ +