diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-04-16 09:27:48 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-04-16 09:27:48 +0300 |
| commit | eafb576fe1bf76898b9cc17671a89d1585e2c8e4 (patch) | |
| tree | d833a983eb84c53b35b19a45af475aa3e88953c0 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views | |
| parent | cf441513c1010eb4363e985b3b7af61a8503456e (diff) | |
| parent | 53f93d7fd2d2aa4571bad6e93e0c519fce242753 (diff) | |
| download | Tango-eafb576fe1bf76898b9cc17671a89d1585e2c8e4.tar.gz Tango-eafb576fe1bf76898b9cc17671a89d1585e2c8e4.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views')
4 files changed, 145 insertions, 1 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml new file mode 100644 index 000000000..797d4dcb0 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml @@ -0,0 +1,111 @@ +<UserControl x:Class="Tango.MachineStudio.UI.Views.ConnectedMachineView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:integration="clr-namespace:Tango.Integration.Services;assembly=Tango.Integration" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300" Width="600" Height="400" Background="White" DataContext="{Binding ConnectedMachineViewVM, Source={StaticResource Locator}}"> + + <UserControl.Resources> + <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></converters:BooleanToVisibilityConverter> + <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter"></converters:BooleanToVisibilityInverseConverter> + <converters:BooleanInverseConverter x:Key="BooleanInverseConverter"></converters:BooleanInverseConverter> + <converters:ByteArrayToFileSizeConverter x:Key="ByteArrayToFileSizeConverter" /> + </UserControl.Resources> + + <Grid> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="80"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + + <Grid> + <StackPanel Orientation="Horizontal" Margin="10"> + <ContentControl Content="{Binding ApplicationManager.ConnectedMachine}"> + <ContentControl.Resources> + <DataTemplate DataType="{x:Type integration:ExternalBridgeTcpClient}"> + <Image Source="/Images/external-bridge-tcp.png" Width="48" Height="48" RenderOptions.BitmapScalingMode="Fant"></Image> + </DataTemplate> + + <DataTemplate DataType="{x:Type integration:ExternalBridgeUsbClient}"> + <Image Source="/Images/external-bridge-usb.png" Width="48" Height="48" RenderOptions.BitmapScalingMode="Fant"></Image> + </DataTemplate> + </ContentControl.Resources> + </ContentControl> + + <TextBlock Text="Machine Connection" VerticalAlignment="Center" Margin="10 0 0 0" FontSize="20"></TextBlock> + </StackPanel> + </Grid> + + <Grid Grid.Row="1" Margin="10 0 10 10"> + <Grid.RowDefinitions> + <RowDefinition Height="1*"/> + <RowDefinition Height="50"/> + </Grid.RowDefinitions> + + <Grid> + <ContentControl Content="{Binding ApplicationManager.ConnectedMachine}"> + <ContentControl.Resources> + <DataTemplate DataType="{x:Type integration:ExternalBridgeTcpClient}"> + <controls:TableGrid RowHeight="30"> + <TextBlock FontWeight="SemiBold" Text="Serial Number:" /> + <TextBlock Text="{Binding SerialNumber}" /> + <TextBlock FontWeight="SemiBold" Text="Name:" /> + <TextBlock Text="{Binding Machine.Name}" /> + <TextBlock FontWeight="SemiBold" Text="Organization:" /> + <TextBlock Text="{Binding Machine.Organization.Name}" /> + <TextBlock FontWeight="SemiBold" Text="IP Address:" /> + <TextBlock Text="{Binding IPAddress}" /> + <TextBlock FontWeight="SemiBold" Text="Total Bytes Sent:" /> + <TextBlock Text="{Binding Adapter.TotalBytesSent,Converter={StaticResource ByteArrayToFileSizeConverter},Mode=OneWay}" /> + <TextBlock FontWeight="SemiBold" Text="Total Bytes Received:" /> + <TextBlock Text="{Binding Adapter.TotalBytesReceived,Converter={StaticResource ByteArrayToFileSizeConverter},Mode=OneWay}" /> + <TextBlock FontWeight="SemiBold" Text="Transfer Rate:" /> + <TextBlock> + <Run Text="{Binding Adapter.TransferRate,Converter={StaticResource ByteArrayToFileSizeConverter},Mode=OneWay}"></Run> + <Run Text="/ second"></Run> + </TextBlock> + </controls:TableGrid> + </DataTemplate> + + <DataTemplate DataType="{x:Type integration:ExternalBridgeUsbClient}"> + <controls:TableGrid RowHeight="30"> + <TextBlock FontWeight="SemiBold" Text="Serial Number:" /> + <TextBlock Text="{Binding SerialNumber}" /> + <TextBlock FontWeight="SemiBold" Text="Name:" /> + <TextBlock Text="{Binding Machine.Name}" /> + <TextBlock FontWeight="SemiBold" Text="Organization:" /> + <TextBlock Text="{Binding Machine.Organization.Name}" /> + <TextBlock FontWeight="SemiBold" Text="COM Port:" /> + <TextBlock Text="{Binding ComPort}" /> + <TextBlock FontWeight="SemiBold" Text="Device:" /> + <TextBlock Text="{Binding Device}" /> + <TextBlock FontWeight="SemiBold" Text="Total Bytes Sent:" /> + <TextBlock Text="{Binding Adapter.TotalBytesSent,Converter={StaticResource ByteArrayToFileSizeConverter},Mode=OneWay}" /> + <TextBlock FontWeight="SemiBold" Text="Total Bytes Received:" /> + <TextBlock Text="{Binding Adapter.TotalBytesReceived,Converter={StaticResource ByteArrayToFileSizeConverter},Mode=OneWay}" /> + <TextBlock FontWeight="SemiBold" Text="Transfer Rate:" /> + <TextBlock> + <Run Text="{Binding Adapter.TransferRate,Converter={StaticResource ByteArrayToFileSizeConverter},Mode=OneWay}"></Run> + <Run Text="/ second"></Run> + </TextBlock> + </controls:TableGrid> + </DataTemplate> + </ContentControl.Resources> + </ContentControl> + </Grid> + + <Grid Grid.Row="1"> + <Button HorizontalAlignment="Right" Width="140" Command="{Binding DisconnectCommand}">DISCONNECT</Button> + </Grid> + </Grid> + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml.cs new file mode 100644 index 000000000..cc8ac2237 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.UI.Views +{ + /// <summary> + /// Interaction logic for ConnectedMachineView.xaml + /// </summary> + public partial class ConnectedMachineView : UserControl + { + public ConnectedMachineView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml index 1626e67ef..6f0a74805 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml @@ -70,7 +70,7 @@ <Run FontWeight="Bold">IP Address:</Run> <Run Text="{Binding IPAddress,Mode=OneWay}"></Run> </TextBlock> <TextBlock FontSize="11"> - <Run FontWeight="Bold">Organization:</Run> <Run Text="{Binding Organization,Mode=OneWay}"></Run> + <Run FontWeight="Bold">Organization:</Run> <Run Text="{Binding Machine.Organization.Name,Mode=OneWay}"></Run> </TextBlock> </StackPanel> </StackPanel> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs index e0ae60b87..442d11cdd 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs @@ -25,6 +25,7 @@ using Tango.MachineStudio.Common; using System.Threading; using Tango.Core.Helpers; using Tango.SharedUI.Helpers; +using Tango.Logging; namespace Tango.MachineStudio.UI.Views { @@ -54,6 +55,8 @@ namespace Tango.MachineStudio.UI.Views Task.Factory.StartNew(() => { + LogManager.Default.Log("Loading modules views..."); + var item = ServiceLocator.Current.GetInstance<INotificationProvider>().PushTaskItem("Loading Modules..."); var modules = _loader.UserModules.ToList(); @@ -67,6 +70,8 @@ namespace Tango.MachineStudio.UI.Views foreach (var module in modules) { + LogManager.Default.Log("Loading module view '" + module.Name + "'..."); + ThreadsHelper.InvokeUI(() => { Grid grid = new Grid(); |
