aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-08-30 19:38:41 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-08-30 19:38:41 +0300
commitdd6bc91bb43b70fcae954834cd03c6028f3eefa5 (patch)
tree08710978223e7bc2eedae6c7515a241e6b1c64a8 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views
parent5c9bca9cb0bbbb1c448228ef5ac5f898f17e9827 (diff)
parenta4a0d4973c8eff2bbfe2c8e753f30626c9e9076d (diff)
downloadTango-dd6bc91bb43b70fcae954834cd03c6028f3eefa5.tar.gz
Tango-dd6bc91bb43b70fcae954834cd03c6028f3eefa5.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml38
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml20
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml6
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/UpdateView.xaml74
4 files changed, 135 insertions, 3 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
index 319fa3596..26790c67d 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml
@@ -6,6 +6,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:integration="clr-namespace:Tango.Integration.ExternalBridge;assembly=Tango.Integration"
xmlns:integ="clr-namespace:Tango.Integration.Operation;assembly=Tango.Integration"
+ xmlns:emulations="clr-namespace:Tango.Emulations.ExternalBridge;assembly=Tango.Emulations"
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"
@@ -38,6 +39,10 @@
<DataTemplate DataType="{x:Type integration:ExternalBridgeUsbClient}">
<Image Source="/Images/external-bridge-usb.png" Width="48" Height="48" RenderOptions.BitmapScalingMode="Fant"></Image>
</DataTemplate>
+
+ <DataTemplate DataType="{x:Type emulations:EmulatorExternalBridge}">
+ <Image Source="/Images/external-bridge-emulator.png" Width="48" Height="48" RenderOptions.BitmapScalingMode="Fant"></Image>
+ </DataTemplate>
</ContentControl.Resources>
</ContentControl>
@@ -131,6 +136,39 @@
<ToggleButton IsChecked="{Binding EnableEventsNotification}" HorizontalAlignment="Left"></ToggleButton>
</controls:TableGrid>
</DataTemplate>
+
+ <DataTemplate DataType="{x:Type emulations:EmulatorExternalBridge}">
+ <controls:TableGrid RowHeight="22">
+ <TextBlock FontWeight="SemiBold" Text="Address:" />
+ <TextBlock Text="{Binding Adapter.Address}" />
+ <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="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="/ sec"></Run>
+ </TextBlock>
+ <TextBlock FontWeight="SemiBold" Text="Diagnostics Frame Rate:" />
+ <TextBlock>
+ <Run Text="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.DiagnosticsFrameProvider.FrameRate,Mode=OneWay,IsAsync=True}"></Run>
+ <Run Text="/ sec"></Run>
+ </TextBlock>
+ <TextBlock FontWeight="SemiBold" Text="Enable Diagnostics:" />
+ <ToggleButton IsChecked="{Binding EnableDiagnostics}" HorizontalAlignment="Left"></ToggleButton>
+ <TextBlock FontWeight="SemiBold" Text="Enable Embedded Debug Logs:" />
+ <ToggleButton IsChecked="{Binding EnableEmbeddedDebugging}" HorizontalAlignment="Left"></ToggleButton>
+ <TextBlock FontWeight="SemiBold" Text="Enable Events:" />
+ <ToggleButton IsChecked="{Binding EnableEventsNotification}" HorizontalAlignment="Left"></ToggleButton>
+ </controls:TableGrid>
+ </DataTemplate>
</ContentControl.Resources>
</ContentControl>
</Grid>
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 5f8cca8fe..180a2a8e0 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml
@@ -7,6 +7,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:integration="clr-namespace:Tango.Integration.ExternalBridge;assembly=Tango.Integration"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:emulations="clr-namespace:Tango.Emulations.ExternalBridge;assembly=Tango.Emulations"
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 MachineConnectionViewVM, Source={StaticResource Locator}}">
@@ -95,6 +96,25 @@
</StackPanel>
</DockPanel>
</DataTemplate>
+ <DataTemplate DataType="{x:Type emulations:EmulatorExternalBridge}">
+ <DockPanel>
+ <StackPanel Orientation="Vertical" VerticalAlignment="Center" DockPanel.Dock="Right" ToolTip="Allow incoming diagnostics data">
+ <ToggleButton IsChecked="{Binding EnableDiagnostics}" VerticalAlignment="Center"></ToggleButton>
+ <TextBlock VerticalAlignment="Center" FontSize="10">Diagnostics</TextBlock>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <Image Source="/Images/external-bridge-emulator.png" Width="38" Height="38" RenderOptions.BitmapScalingMode="Fant"></Image>
+ <StackPanel Margin="10 0 0 0">
+ <TextBlock FontSize="11">
+ <Run Text="External Bridge Emulator"></Run>
+ </TextBlock>
+ <TextBlock FontSize="11">
+ <Run FontWeight="Bold">Address:</Run> <Run Text="{Binding Adapter.Address,Mode=OneWay}"></Run>
+ </TextBlock>
+ </StackPanel>
+ </StackPanel>
+ </DockPanel>
+ </DataTemplate>
</ListBox.Resources>
</ListBox>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
index 9a494f862..67bdf81ed 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
@@ -15,7 +15,7 @@
xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
xmlns:commonConverters="clr-namespace:Tango.MachineStudio.Common.Converters;assembly=Tango.MachineStudio.Common"
mc:Ignorable="d"
- d:DesignHeight="720" d:DesignWidth="1270" Background="Transparent" DataContext="{Binding MainViewVM, Source={StaticResource Locator}}">
+ d:DesignHeight="720" d:DesignWidth="1270" Background="Transparent" DataContext="{Binding MainViewVM, Source={StaticResource Locator}}" x:Name="control">
<UserControl.Resources>
<converters:StringEllipsisConverter x:Key="StringEllipsisConverter" />
@@ -161,7 +161,7 @@
</StackPanel>
</Button>
<Separator/>
- <Button IsEnabled="{Binding IsModuleLoaded}" Command="{Binding OpenModuleInWindowCommand}" CommandParameter="{Binding CurrentModule}">
+ <Button IsEnabled="{Binding IsModuleLoaded}" Command="{Binding OpenModuleInWindowCommand,Mode=TwoWay}" CommandParameter="{Binding CurrentModule}">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="ArrowTopRight" Width="24" Height="24" />
<TextBlock Margin="5 0 0 0" VerticalAlignment="Center">Open Module In New Window</TextBlock>
@@ -440,7 +440,7 @@
<StackPanel Grid.Row="2" Margin="8" HorizontalAlignment="Right" Orientation="Horizontal">
<materialDesign:PopupBox Padding="2,0,2,0" Style="{StaticResource MaterialDesignToolPopupBox}">
<StackPanel>
- <Button Command="{Binding RelativeSource={RelativeSource AncestorType=local:MainView},Path=DataContext.OpenModuleInWindowCommand}" CommandParameter="{Binding}">
+ <Button Command="{Binding Source={x:Reference control},Path=DataContext.OpenModuleInWindowCommand}" CommandParameter="{Binding}">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="ArrowTopRight" Width="24" Height="24" />
<TextBlock Margin="5 0 0 0" VerticalAlignment="Center">Start in new window</TextBlock>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/UpdateView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/UpdateView.xaml
index 52ba9ee18..6818d13cc 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/UpdateView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/UpdateView.xaml
@@ -108,6 +108,13 @@
<TextBlock Margin="5 0 0 0" VerticalAlignment="Center">UPDATE</TextBlock>
</StackPanel>
</Button>
+
+ <Button Visibility="{Binding IsRollbackAvailable,Converter={StaticResource BoolToVisConverter}}" MinWidth="140" Height="40" Style="{StaticResource MaterialDesignFlatButton}" ToolTip="Restore Machine Studio to the previous version." Margin="0 40 0 0" Command="{Binding RollbackCommand}" Foreground="#FF5F5F">
+ <StackPanel Orientation="Horizontal">
+ <materialDesign:PackIcon Kind="BackupRestore" Width="24" Height="24" />
+ <TextBlock Margin="5 0 0 0" VerticalAlignment="Center">Restore previous version</TextBlock>
+ </StackPanel>
+ </Button>
</StackPanel>
</Grid>
</Setter.Value>
@@ -177,6 +184,13 @@
<StackPanel Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Margin="0 20 0 0">Your version of Machine Studio is up to date!</TextBlock>
</StackPanel>
+
+ <Button Visibility="{Binding IsRollbackAvailable,Converter={StaticResource BoolToVisConverter}}" MinWidth="140" Height="40" Style="{StaticResource MaterialDesignFlatButton}" ToolTip="Restore Machine Studio to the previous version." Margin="0 40 0 0" Command="{Binding RollbackCommand}" Foreground="#FF5F5F">
+ <StackPanel Orientation="Horizontal">
+ <materialDesign:PackIcon Kind="BackupRestore" Width="24" Height="24" />
+ <TextBlock Margin="5 0 0 0" VerticalAlignment="Center">Restore previous version</TextBlock>
+ </StackPanel>
+ </Button>
</StackPanel>
</Grid>
</Setter.Value>
@@ -205,6 +219,66 @@
</Setter.Value>
</Setter>
</DataTrigger>
+ <DataTrigger Binding="{Binding Status}" Value="{x:Static vm:UpdateStatus.RollingBack}">
+ <Setter Property="Content">
+ <Setter.Value>
+ <Grid>
+ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
+ <TextBlock HorizontalAlignment="Center">
+ <Run>Restoring previous version, please wait...</Run>
+ </TextBlock>
+ <ProgressBar Height="10" Foreground="DimGray" Margin="0 20 0 0" Maximum="100" Value="{Binding RollbackProgress}"></ProgressBar>
+ </StackPanel>
+ </Grid>
+ </Setter.Value>
+ </Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Status}" Value="{x:Static vm:UpdateStatus.RollbackError}">
+ <Setter Property="Content">
+ <Setter.Value>
+ <Grid>
+ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
+ <materialDesign:PackIcon Kind="Alert" Width="100" Height="100" Foreground="#FF5F5F" HorizontalAlignment="Center" />
+ <TextBlock VerticalAlignment="Center" Margin="0 20 0 0" HorizontalAlignment="Center">Error restoring previous version</TextBlock>
+ <TextBlock HorizontalAlignment="Center" Margin="0 10 0 0" FontSize="12" TextAlignment="Center">
+ <Run>An error occurred while restore the last version.</Run>
+ <LineBreak/>
+ <Run>press 'Try Again' to give it another try.</Run>
+ </TextBlock>
+ <Button MinWidth="140" Height="40" Margin="0 50 0 0" Width="200" Command="{Binding TryRollbackAgainCommand}">
+ <StackPanel Orientation="Horizontal">
+ <materialDesign:PackIcon Kind="BackupRestore" Width="24" Height="24" />
+ <TextBlock Margin="5 0 0 0" VerticalAlignment="Center">TRY AGAIN</TextBlock>
+ </StackPanel>
+ </Button>
+ </StackPanel>
+ </Grid>
+ </Setter.Value>
+ </Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Status}" Value="{x:Static vm:UpdateStatus.RollbackCompleted}">
+ <Setter Property="Content">
+ <Setter.Value>
+ <Grid>
+ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
+ <materialDesign:PackIcon Kind="Check" Width="100" Height="100" Foreground="#1CBB1C" HorizontalAlignment="Center" />
+ <StackPanel Orientation="Horizontal">
+ <TextBlock VerticalAlignment="Center" Margin="0 20 0 0">Machine studio has been restored to the previous version!</TextBlock>
+ </StackPanel>
+
+ <TextBlock HorizontalAlignment="Center" Margin="0 10 0 0" FontSize="12">Please restart Machine Studio in order to apply the changes.</TextBlock>
+
+ <Button MinWidth="140" Height="40" Margin="0 50 0 0" Width="200" Command="{Binding RestartCommand}">
+ <StackPanel Orientation="Horizontal">
+ <materialDesign:PackIcon Kind="BackupRestore" Width="24" Height="24" />
+ <TextBlock Margin="5 0 0 0" VerticalAlignment="Center">RESTART</TextBlock>
+ </StackPanel>
+ </Button>
+ </StackPanel>
+ </Grid>
+ </Setter.Value>
+ </Setter>
+ </DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>