diff options
| author | Roy <Roy.mail.net@gmail.com> | 2023-02-19 00:13:53 +0200 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2023-02-19 00:13:53 +0200 |
| commit | a054f1ab36fe3cbe816f78fa5ea68b30cde1bd43 (patch) | |
| tree | 2cdcfb86f298ba32e28b4f29c9b31d1faa05d5da /Software/Visual_Studio/FSE/Tango.FSE.UI | |
| parent | a4cd972fd023425fa9414e56748665cb2821f412 (diff) | |
| download | Tango-a054f1ab36fe3cbe816f78fa5ea68b30cde1bd43.tar.gz Tango-a054f1ab36fe3cbe816f78fa5ea68b30cde1bd43.zip | |
FSE Eureka Design Support.
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.UI')
13 files changed, 51 insertions, 21 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs index ffc0e8e60..745211705 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs @@ -200,11 +200,11 @@ namespace Tango.FSE.UI.Connection if (machine.GetType() == typeof(ExternalBridgeUsbClient)) { - vm = await NotificationProvider.ShowDialog<MachineConnectionUsbViewVM>(); + vm = await NotificationProvider.ShowDialog(new MachineConnectionUsbViewVM() { Machine = machine }); } else if (machine.GetType() == typeof(EmulatorExternalBridge)) { - vm = await NotificationProvider.ShowDialog<MachineConnectionEmulatorViewVM>(); + vm = await NotificationProvider.ShowDialog(new MachineConnectionEmulatorViewVM() { Machine = machine }); } else if (machine is ExternalBridgeTcpClient) { diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionEmulatorView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionEmulatorView.xaml index 45be0817b..0e78e8b55 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionEmulatorView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionEmulatorView.xaml @@ -5,13 +5,14 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" xmlns:local="clr-namespace:Tango.FSE.UI.Dialogs" mc:Ignorable="d" Height="300" Width="700" d:DataContext="{d:DesignInstance Type=local:MachineConnectionEmulatorViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> <Grid> <DockPanel Margin="10"> <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="10"> - <ContentControl Height="60" Margin="-10 0 0 0" Style="{StaticResource FSE_EmulatorMachineIcon}"></ContentControl> + <controls:MachineConnectionIcon ExternalBridgeClient="{Binding Machine}" Height="60" Margin="-10 0 0 0"></controls:MachineConnectionIcon> <TextBlock Text="Machine Selection" FontWeight="SemiBold" VerticalAlignment="Center" Margin="10 0 0 0" FontSize="{StaticResource FSE_MessageBoxTitleFontSize}"></TextBlock> </StackPanel> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionLostView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionLostView.xaml index 06617885a..26fca9093 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionLostView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionLostView.xaml @@ -5,17 +5,18 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:local="clr-namespace:Tango.FSE.UI.Dialogs" + xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" mc:Ignorable="d" Height="300" Width="700" d:DataContext="{d:DesignInstance Type=local:MachineConnectionLostViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> <Grid> <DockPanel Margin="10"> <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="10"> <Grid> - <ContentControl Height="60" Margin="-10 0 0 0" Style="{StaticResource FSE_WifiMachineIcon}"> - <ContentControl.Effect> + <controls:MachineConnectionIcon ExternalBridgeClient="{Binding Machine}" Height="60" Margin="-10 0 0 0"> + <controls:MachineConnectionIcon.Effect> <BlurEffect Radius="5" /> - </ContentControl.Effect> - </ContentControl> + </controls:MachineConnectionIcon.Effect> + </controls:MachineConnectionIcon> <Canvas> <material:PackIcon Kind="Exclamation" Foreground="{StaticResource FSE_ErrorBrush}" Width="45" Height="45" Margin="-5 13 0 0" /> </Canvas> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionSignalRView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionSignalRView.xaml index b091516df..43f32d820 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionSignalRView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionSignalRView.xaml @@ -6,13 +6,14 @@ xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" xmlns:helpers="clr-namespace:Tango.SharedUI.Helpers;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" xmlns:local="clr-namespace:Tango.FSE.UI.Dialogs" mc:Ignorable="d" Height="300" Width="700" d:DataContext="{d:DesignInstance Type=local:MachineConnectionSignalRViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> <Grid> <DockPanel Margin="10"> <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="10"> - <ContentControl Height="60" Margin="-10 0 0 0" Style="{StaticResource FSE_SignalRMachineIcon}"></ContentControl> + <controls:MachineConnectionIcon ExternalBridgeClient="{Binding Machine}" Height="60" Margin="-10 0 0 0"></controls:MachineConnectionIcon> <TextBlock FontWeight="SemiBold" VerticalAlignment="Center" Margin="10 0 0 0" FontSize="{StaticResource FSE_MessageBoxTitleFontSize}"> <Run>Connect to</Run> <Run>'</Run><Run FontWeight="Normal" Foreground="{StaticResource FSE_SignalRBrush}" Text="{Binding Machine.SerialNumber}"></Run><Run>'</Run> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionUsbView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionUsbView.xaml index 6ab2414f3..c285d2ed6 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionUsbView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionUsbView.xaml @@ -5,13 +5,14 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" xmlns:local="clr-namespace:Tango.FSE.UI.Dialogs" mc:Ignorable="d" Height="300" Width="700" d:DataContext="{d:DesignInstance Type=local:MachineConnectionUsbViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> <Grid> <DockPanel Margin="10"> <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="10"> - <ContentControl Height="60" Margin="-10 0 0 0" Style="{StaticResource FSE_UsbMachineIcon}"></ContentControl> + <controls:MachineConnectionIcon ExternalBridgeClient="{Binding Machine}" Height="60" Margin="-10 0 0 0"></controls:MachineConnectionIcon> <TextBlock Text="Machine Selection" FontWeight="SemiBold" VerticalAlignment="Center" Margin="10 0 0 0" FontSize="{StaticResource FSE_MessageBoxTitleFontSize}"></TextBlock> </StackPanel> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionUsbViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionUsbViewVM.cs index e881da0ac..9056e7f4d 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionUsbViewVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionUsbViewVM.cs @@ -10,6 +10,7 @@ using Tango.Core.DI; using Tango.FSE.BL; using Tango.FSE.Common; using Tango.FSE.Common.AutoComplete; +using Tango.Integration.ExternalBridge; namespace Tango.FSE.UI.Dialogs { @@ -22,6 +23,8 @@ namespace Tango.FSE.UI.Dialogs [TangoInject] protected FSEServicesContainer Services { get; set; } + public IExternalBridgeClient Machine { get; set; } + /// <summary> /// Gets or sets the machines completion source. /// </summary> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionWifiView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionWifiView.xaml index 0d037e939..e20c474b7 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionWifiView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineConnectionWifiView.xaml @@ -3,6 +3,7 @@ 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:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" xmlns:helpers="clr-namespace:Tango.SharedUI.Helpers;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" @@ -12,7 +13,7 @@ <Grid> <DockPanel Margin="10"> <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="10"> - <ContentControl Height="60" Margin="-10 0 0 0" Style="{StaticResource FSE_WifiMachineIcon}"></ContentControl> + <controls:MachineConnectionIcon ExternalBridgeClient="{Binding Machine}" Height="60" Margin="-10 0 0 0"></controls:MachineConnectionIcon> <TextBlock FontWeight="SemiBold" VerticalAlignment="Center" Margin="10 0 0 0" FontSize="{StaticResource FSE_MessageBoxTitleFontSize}"> <Run>Connect to</Run> <Run>'</Run><Run FontWeight="Normal" Foreground="{StaticResource FSE_WifiBrush}" Text="{Binding Machine.SerialNumber}"></Run><Run>'</Run> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineWaitForConnectionView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineWaitForConnectionView.xaml index 946e2bf0d..1d9359b04 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineWaitForConnectionView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/MachineWaitForConnectionView.xaml @@ -4,6 +4,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" xmlns:local="clr-namespace:Tango.FSE.UI.Dialogs" mc:Ignorable="d" Height="300" Width="700" d:DataContext="{d:DesignInstance Type=local:MachineWaitForConnectionViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> @@ -11,11 +12,11 @@ <DockPanel Margin="10"> <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="10"> <Grid> - <ContentControl Height="60" Margin="-10 0 0 0" Style="{StaticResource FSE_WifiMachineIcon}"> - <ContentControl.Effect> + <controls:MachineConnectionIcon ExternalBridgeClient="{Binding Machine}" Height="60" Margin="-10 0 0 0"> + <controls:MachineConnectionIcon.Effect> <BlurEffect Radius="5" /> - </ContentControl.Effect> - </ContentControl> + </controls:MachineConnectionIcon.Effect> + </controls:MachineConnectionIcon> <Canvas> <ProgressBar Style="{StaticResource FSE_CircularProgressBar}" Foreground="{StaticResource FSE_GrayBrush}" Opacity="0.5" Width="24" Height="24" Margin="5 24 0 0" /> </Canvas> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPane.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPane.xaml index b4b70cffd..1c6668e2a 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPane.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Panes/MachineConnectionPane.xaml @@ -5,6 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:local="clr-namespace:Tango.FSE.UI.Panes" + xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" mc:Ignorable="d" d:DesignHeight="600" d:DesignWidth="350" d:DataContext="{d:DesignInstance Type=local:MachineConnectionPaneVM, IsDesignTimeCreatable=False}"> <Grid> @@ -34,7 +35,7 @@ <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> - <ContentControl Style="{StaticResource FSE_EmulatorMachineIcon}" Height="35"></ContentControl> + <controls:MachineConnectionIcon ExternalBridgeClient="{Binding}" Height="35"></controls:MachineConnectionIcon> <StackPanel Margin="10 0 0 0"> <TextBlock FontSize="{StaticResource FSE_SmallFontSize}" FontWeight="SemiBold">In-Memory Emulator</TextBlock> <TextBlock FontSize="{StaticResource FSE_SmallFontSize}"> @@ -55,7 +56,7 @@ <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> - <ContentControl Style="{StaticResource FSE_UsbMachineIcon}" Height="35"></ContentControl> + <controls:MachineConnectionIcon ExternalBridgeClient="{Binding}" Height="35"></controls:MachineConnectionIcon> <StackPanel Margin="10 0 0 0"> <TextBlock FontSize="{StaticResource FSE_SmallFontSize}"> <Run FontWeight="SemiBold">Port:</Run> <Run Text="{Binding ComPort,Mode=OneWay}"></Run> @@ -90,7 +91,7 @@ <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> - <ContentControl Style="{StaticResource FSE_WifiMachineIcon}" /> + <controls:MachineConnectionIcon ExternalBridgeClient="{Binding}" Height="35"></controls:MachineConnectionIcon> <StackPanel Margin="10 0 0 0"> <TextBlock FontSize="{StaticResource FSE_SmallFontSize}"> <Run FontWeight="SemiBold">S/N:</Run> <Run Text="{Binding SerialNumber,Mode=OneWay}"></Run> @@ -117,7 +118,7 @@ <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> - <ContentControl Style="{StaticResource FSE_SignalRMachineIcon}" /> + <controls:MachineConnectionIcon ExternalBridgeClient="{Binding}" Height="35"></controls:MachineConnectionIcon> <StackPanel Margin="10 0 0 0"> <TextBlock FontSize="{StaticResource FSE_SmallFontSize}"> <Run FontWeight="Bold">S/N:</Run> <Run Text="{Binding SerialNumber,Mode=OneWay}"></Run> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/Machine/MachineTile.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/Machine/MachineTile.cs index 611c4d93e..45265c636 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/Machine/MachineTile.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/Machine/MachineTile.cs @@ -5,11 +5,19 @@ using System.Text; using System.Threading.Tasks; using System.Windows; using Tango.FSE.Common; +using Tango.FSE.Common.Connection; namespace Tango.FSE.UI.Tiles.Machine { public class MachineTile : DashboardTile { + private Tango.BL.Entities.Machine _machine; + public Tango.BL.Entities.Machine Machine + { + get { return _machine; } + set { _machine = value; RaisePropertyChangedAuto(); } + } + public MachineTile() { Name = "Machine Configuration"; @@ -21,6 +29,18 @@ namespace Tango.FSE.UI.Tiles.Machine RowSpan = 6; } + public override void OnApplicationReady() + { + base.OnApplicationReady(); + + MachineProvider.MachineConnected += MachineProvider_MachineConnected; + } + + private void MachineProvider_MachineConnected(object sender, MachineConnectedEventArgs e) + { + Machine = MachineProvider.Machine; + } + public override FrameworkElement GetView() { return new MachineTileView(); diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/Machine/MachineTileView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/Machine/MachineTileView.xaml index 625f0df7d..9f1d7bd30 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/Machine/MachineTileView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/Machine/MachineTileView.xaml @@ -8,6 +8,6 @@ mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:MachineTile, IsDesignTimeCreatable=False}"> <Grid Margin="20"> - <controls:MachineView Opacity="0.6" DataContext="{Binding MachineProvider.Machine}" /> + <controls:MachineView Opacity="0.6" DataContext="{Binding Machine}" /> </Grid> </UserControl> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml index b897851fc..f1ed89aff 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml @@ -548,7 +548,7 @@ <Grid Panel.ZIndex="100"> <DockPanel> - <Image x:Name="imgHome" RenderTransformOrigin="0.5,0.5" Cursor="Hand" Source="{StaticResource FSE_Machine_Full}" Stretch="Uniform" RenderOptions.BitmapScalingMode="Fant" Margin="10"> + <Image x:Name="imgHome" RenderTransformOrigin="0.5,0.5" Cursor="Hand" Source="{StaticResource FSE_Machines_Full}" Stretch="Uniform" RenderOptions.BitmapScalingMode="Fant" Margin="10"> <i:Interaction.Triggers> <i:EventTrigger EventName="PreviewMouseUp"> <i:InvokeCommandAction Command="{Binding NavigateHomeCommand}" /> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LoginView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LoginView.xaml index 0ab9c5018..ca56e7b05 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LoginView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LoginView.xaml @@ -50,7 +50,7 @@ <Run FontSize="10">v</Run><Run Text="{Binding ApplicationVersion,Mode=OneWay,FallbackValue='1.0.0'}"></Run> </TextBlock> </StackPanel> - <Image Source="{StaticResource FSE_Machine_Full}" VerticalAlignment="Bottom" RenderOptions.BitmapScalingMode="Fant" Margin="0 0 0 150" MaxWidth="300" MinWidth="100" /> + <Image Source="{StaticResource FSE_Machines_Full}" VerticalAlignment="Bottom" RenderOptions.BitmapScalingMode="Fant" Margin="0 0 0 150" MaxWidth="300" MinWidth="100" /> <Rectangle HorizontalAlignment="Right" StrokeThickness="1" Stroke="{StaticResource FSE_BorderBrush}" StrokeDashArray="5" /> </Grid> |
