diff options
| author | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
| commit | 00a491d93733d4625ad329b2ba8237f445364b3f (patch) | |
| tree | 4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician | |
| parent | 124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff) | |
| download | Tango-00a491d9.tar.gz Tango-00a491d9.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician')
37 files changed, 176 insertions, 1833 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/EmbeddedLogItemDetailsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/EmbeddedLogItemDetailsView.xaml deleted file mode 100644 index 25227fc60..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/EmbeddedLogItemDetailsView.xaml +++ /dev/null @@ -1,80 +0,0 @@ -<UserControl x:Class="Tango.PPC.Technician.Dialogs.EmbeddedLogItemDetailsView" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" - xmlns:local="clr-namespace:Tango.PPC.Technician.Dialogs" - xmlns:converters="clr-namespace:Tango.PPC.Technician.Converters" - xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" - mc:Ignorable="d" - Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="560" Height="700" d:DataContext="{d:DesignInstance Type=local:EmbeddedLogItemDetailsViewVM, IsDesignTimeCreatable=False}"> - - <UserControl.Resources> - <converters:LogItemToStringConverter x:Key="LogItemToStringConverter" /> - </UserControl.Resources> - - <Grid Margin="5"> - <Grid Grid.RowSpan="2"> - <Grid.RowDefinitions> - <RowDefinition Height="60"/> - <RowDefinition Height="31*"/> - <RowDefinition Height="60"/> - </Grid.RowDefinitions> - - <StackPanel Orientation="Horizontal"> - <touch:TouchIcon Width="42" Height="42" VerticalAlignment="Center"> - <touch:TouchIcon.Style> - <Style TargetType="touch:TouchIcon"> - <Setter Property="Icon" Value="InformationOutline"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Log.Category}" Value="Warning"> - <Setter Property="Icon" Value="ExclamationTriangleSolid"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Log.Category}" Value="Error"> - <Setter Property="Icon" Value="Alert"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Log.Category}" Value="Critical"> - <Setter Property="Icon" Value="Alert"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </touch:TouchIcon.Style> - </touch:TouchIcon> - <TextBlock VerticalAlignment="Center" Text="{Binding Log.Message}" TextWrapping="NoWrap" Height="22" TextTrimming="CharacterEllipsis" Width="500" Margin="10 0 0 0" FontSize="16"></TextBlock> - </StackPanel> - - <Grid Grid.Row="1"> - <DockPanel> - <Grid DockPanel.Dock="Top"> - <controls:TableGrid RowHeight="30"> - <TextBlock Text="Time Stamp:" FontWeight="SemiBold" /> - <TextBlock Text="{Binding Log.TimeStamp,Converter={StaticResource DateTimeUTCToStringConverter},ConverterParameter='MM/dd/yyyy HH:mm:ss.fff'}"></TextBlock> - <TextBlock Text="Category:" FontWeight="SemiBold" /> - <TextBlock Text="{Binding Log.Category}"></TextBlock> - <TextBlock Text="File:" FontWeight="SemiBold" /> - <TextBlock Text="{Binding Log.DebugLogResponse.FileName}"></TextBlock> - <TextBlock Text="Line:" FontWeight="SemiBold" /> - <TextBlock Text="{Binding Log.DebugLogResponse.LineNumber}"></TextBlock> - <TextBlock Text="Module:" FontWeight="SemiBold" /> - <TextBlock Text="{Binding Log.DebugLogResponse.ModuleId}"></TextBlock> - <TextBlock Text="Filter:" FontWeight="SemiBold" /> - <TextBlock Text="{Binding Log.DebugLogResponse.Filter}"></TextBlock> - </controls:TableGrid> - </Grid> - - <Border Padding="5" BorderThickness="1" BorderBrush="{StaticResource TangoLightBorderBrush}"> - <TextBox BorderThickness="0" Text="{Binding Log,Converter={StaticResource LogItemToStringConverter}}" Style="{x:Null}" TextWrapping="Wrap" IsReadOnly="True" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden" Background="Transparent" /> - </Border> - </DockPanel> - </Grid> - - <Grid Grid.Row="2"> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" HorizontalAlignment="Right" Width="170" VerticalAlignment="Bottom" CornerRadius="25" Height="50" Command="{Binding CloseCommand}">CLOSE</touch:TouchButton> - </Grid> - </Grid> - </Grid> -</UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/EmbeddedLogItemDetailsView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/EmbeddedLogItemDetailsView.xaml.cs deleted file mode 100644 index 83ec6d362..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/EmbeddedLogItemDetailsView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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.PPC.Technician.Dialogs -{ - /// <summary> - /// Interaction logic for LogItemDetailsView.xaml - /// </summary> - public partial class EmbeddedLogItemDetailsView : UserControl - { - public EmbeddedLogItemDetailsView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/EmbeddedLogItemDetailsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/EmbeddedLogItemDetailsViewVM.cs deleted file mode 100644 index 8dc745263..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/EmbeddedLogItemDetailsViewVM.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Integration.Logging; -using Tango.Logging; -using Tango.SharedUI; - -namespace Tango.PPC.Technician.Dialogs -{ - public class EmbeddedLogItemDetailsViewVM : DialogViewVM - { - private EmbeddedLogItem _log; - public EmbeddedLogItem Log - { - get { return _log; } - set { _log = value; RaisePropertyChangedAuto(); } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/SynchronizationDetailsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/SynchronizationDetailsView.xaml deleted file mode 100644 index 37fa8b05c..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/SynchronizationDetailsView.xaml +++ /dev/null @@ -1,74 +0,0 @@ -<UserControl x:Class="Tango.PPC.Technician.Dialogs.SynchronizationDetailsView" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" - xmlns:local="clr-namespace:Tango.PPC.Technician.Dialogs" - xmlns:converters="clr-namespace:Tango.PPC.Technician.Converters" - xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" - mc:Ignorable="d" - Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="560" Height="700" d:DataContext="{d:DesignInstance Type=local:SynchronizationDetailsViewVM, IsDesignTimeCreatable=False}"> - - <Grid Margin="5"> - <Grid Grid.RowSpan="2"> - <Grid.RowDefinitions> - <RowDefinition Height="60"/> - <RowDefinition Height="31*"/> - <RowDefinition Height="60"/> - </Grid.RowDefinitions> - - <StackPanel Orientation="Horizontal" DataContext="{Binding Status}"> - <touch:TouchIcon Width="42" Height="42" VerticalAlignment="Center"> - <touch:TouchIcon.Style> - <Style TargetType="touch:TouchIcon"> - <Setter Property="Icon" Value="Information"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding State}" Value="Pending"> - <Setter Property="Icon" Value="Pause"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoGrayBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding State}" Value="Synchronizing"> - <Setter Property="Icon" Value="CloudSync"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding State}" Value="Failed"> - <Setter Property="Icon" Value="Alert"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding State}" Value="Completed"> - <Setter Property="Icon" Value="Check"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoGreenBrush}"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </touch:TouchIcon.Style> - </touch:TouchIcon> - <TextBlock VerticalAlignment="Center" Text="{Binding Message}" TextWrapping="NoWrap" Height="22" TextTrimming="CharacterEllipsis" Width="500" Margin="10 0 0 0" FontSize="16"></TextBlock> - </StackPanel> - - <Grid Grid.Row="1"> - <DockPanel> - <Grid DockPanel.Dock="Top"> - <controls:TableGrid RowHeight="30"> - <TextBlock Text="Status:" FontWeight="SemiBold" /> - <TextBlock Text="{Binding Status.State,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock> - <TextBlock Text="Start Time:" FontWeight="SemiBold" /> - <TextBlock Text="{Binding Status.StartDateTime,Converter={StaticResource DateTimeUTCToStringConverter},ConverterParameter='MM/dd/yyyy HH:mm:ss'}"></TextBlock> - <TextBlock Text="Duration:" FontWeight="SemiBold" /> - <TextBlock Text="{Binding Status.Duration,StringFormat='hh\\:mm\\:ss\\.fff'}"></TextBlock> - </controls:TableGrid> - </Grid> - - <Border Padding="5" BorderThickness="1" BorderBrush="{StaticResource TangoLightBorderBrush}"> - <TextBox BorderThickness="0" Text="{Binding Status.ErrorReason,TargetNullValue='No further Information available.'}" Style="{x:Null}" TextWrapping="Wrap" IsReadOnly="True" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden" Background="Transparent" /> - </Border> - </DockPanel> - </Grid> - - <Grid Grid.Row="2"> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" HorizontalAlignment="Right" Width="170" VerticalAlignment="Bottom" CornerRadius="25" Height="50" Command="{Binding CloseCommand}">CLOSE</touch:TouchButton> - </Grid> - </Grid> - </Grid> -</UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/SynchronizationDetailsView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/SynchronizationDetailsView.xaml.cs deleted file mode 100644 index 40f7a536c..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/SynchronizationDetailsView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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.PPC.Technician.Dialogs -{ - /// <summary> - /// Interaction logic for LogItemDetailsView.xaml - /// </summary> - public partial class SynchronizationDetailsView : UserControl - { - public SynchronizationDetailsView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/SynchronizationDetailsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/SynchronizationDetailsViewVM.cs deleted file mode 100644 index 392c8dd3a..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/SynchronizationDetailsViewVM.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.Entities; -using Tango.Logging; -using Tango.PPC.Common.Synchronization; -using Tango.SharedUI; - -namespace Tango.PPC.Technician.Dialogs -{ - public class SynchronizationDetailsViewVM : DialogViewVM - { - private SynchronizationStatus _status; - public SynchronizationStatus Status - { - get { return _status; } - set { _status = value; RaisePropertyChangedAuto(); } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/UpdateDetailsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/UpdateDetailsView.xaml deleted file mode 100644 index ccf2062c1..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/UpdateDetailsView.xaml +++ /dev/null @@ -1,87 +0,0 @@ -<UserControl x:Class="Tango.PPC.Technician.Dialogs.UpdateDetailsView" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" - xmlns:local="clr-namespace:Tango.PPC.Technician.Dialogs" - xmlns:converters="clr-namespace:Tango.PPC.Technician.Converters" - xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" - mc:Ignorable="d" - Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="560" Height="700" d:DataContext="{d:DesignInstance Type=local:UpdateDetailsViewVM, IsDesignTimeCreatable=False}"> - - <Grid Margin="5"> - <Grid Grid.RowSpan="2"> - <Grid.RowDefinitions> - <RowDefinition Height="60"/> - <RowDefinition Height="31*"/> - <RowDefinition Height="60"/> - </Grid.RowDefinitions> - - <StackPanel Orientation="Horizontal" DataContext="{Binding Update}"> - <touch:TouchIcon Width="42" Height="42" VerticalAlignment="Center"> - <touch:TouchIcon.Style> - <Style TargetType="touch:TouchIcon"> - <Setter Property="Icon" Value="Information"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsSetup}" Value="True"> - <Setter Property="Icon" Value="Settings"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsUpdate}" Value="True"> - <Setter Property="Icon" Value="CloudDownload"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsDataBase}" Value="True"> - <Setter Property="Icon" Value="Database"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsSynchronization}" Value="True"> - <Setter Property="Icon" Value="Sync"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsOfflineUpdate}" Value="True"> - <Setter Property="Icon" Value="Sd"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsOfflineFirmwareUpgrade}" Value="True"> - <Setter Property="Icon" Value="Chip"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsStarted}" Value="True"> - <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsCompleted}" Value="True"> - <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsFailed}" Value="True"> - <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </touch:TouchIcon.Style> - </touch:TouchIcon> - <TextBlock VerticalAlignment="Center" Text="{Binding UpdateStatus,Converter={StaticResource EnumToDescriptionConverter}}" TextWrapping="NoWrap" Height="22" TextTrimming="CharacterEllipsis" Width="500" Margin="10 0 0 0" FontSize="16"></TextBlock> - </StackPanel> - - <Grid Grid.Row="1"> - <DockPanel> - <Grid DockPanel.Dock="Top"> - <controls:TableGrid RowHeight="30"> - <TextBlock Text="Started On:" FontWeight="SemiBold" /> - <TextBlock Text="{Binding Update.StartDate,Converter={StaticResource DateTimeUTCToStringConverter},ConverterParameter='MM/dd/yyyy HH:mm:ss'}"></TextBlock> - <TextBlock Text="Application:" FontWeight="SemiBold" /> - <TextBlock Text="{Binding Update.ApplicationVersion}"></TextBlock> - <TextBlock Text="Firmware:" FontWeight="SemiBold" /> - <TextBlock Text="{Binding Update.FirmwareVersion}"></TextBlock> - <TextBlock Text="Ended:" FontWeight="SemiBold" /> - <TextBlock Text="{Binding Update.EndDate,TargetNullValue='Never',FallbackValue='Never',Converter={StaticResource DateTimeUTCToStringConverter},ConverterParameter='MM/dd/yyyy HH:mm:ss'}"></TextBlock> - </controls:TableGrid> - </Grid> - - <Border Padding="5" BorderThickness="1" BorderBrush="{StaticResource TangoLightBorderBrush}"> - <TextBox BorderThickness="0" Text="{Binding Update.FailedLog,TargetNullValue='No further Information available.'}" Style="{x:Null}" TextWrapping="Wrap" IsReadOnly="True" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden" Background="Transparent" /> - </Border> - </DockPanel> - </Grid> - - <Grid Grid.Row="2"> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" HorizontalAlignment="Right" Width="170" VerticalAlignment="Bottom" CornerRadius="25" Height="50" Command="{Binding CloseCommand}">CLOSE</touch:TouchButton> - </Grid> - </Grid> - </Grid> -</UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/UpdateDetailsView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/UpdateDetailsView.xaml.cs deleted file mode 100644 index f2a06aedf..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/UpdateDetailsView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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.PPC.Technician.Dialogs -{ - /// <summary> - /// Interaction logic for LogItemDetailsView.xaml - /// </summary> - public partial class UpdateDetailsView : UserControl - { - public UpdateDetailsView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/UpdateDetailsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/UpdateDetailsViewVM.cs deleted file mode 100644 index 36c0fc6d7..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Dialogs/UpdateDetailsViewVM.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.Entities; -using Tango.Logging; -using Tango.SharedUI; - -namespace Tango.PPC.Technician.Dialogs -{ - public class UpdateDetailsViewVM : DialogViewVM - { - private TangoUpdate _update; - public TangoUpdate Update - { - get { return _update; } - set { _update = value; RaisePropertyChangedAuto(); } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/browser.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/browser.png Binary files differdeleted file mode 100644 index ebb975b6f..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/browser.png +++ /dev/null diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/circuit-board.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/circuit-board.png Binary files differdeleted file mode 100644 index 28b535f54..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/circuit-board.png +++ /dev/null diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/conveyor.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/conveyor.png Binary files differdeleted file mode 100644 index 1cd649a88..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/conveyor.png +++ /dev/null diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/exit.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/exit.png Binary files differdeleted file mode 100644 index e05db36d4..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/exit.png +++ /dev/null diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/mobile-phone.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/mobile-phone.png Binary files differdeleted file mode 100644 index ea4e685dc..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/mobile-phone.png +++ /dev/null diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/packages.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/packages.png Binary files differdeleted file mode 100644 index cf0e936d8..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/packages.png +++ /dev/null diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/remote_connections.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/remote_connections.png Binary files differdeleted file mode 100644 index d9d4a1d45..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/remote_connections.png +++ /dev/null diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/shutdown.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/shutdown.png Binary files differdeleted file mode 100644 index abc4d1a1a..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/shutdown.png +++ /dev/null diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/sync.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/sync.png Binary files differdeleted file mode 100644 index 46059c5c0..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Images/sync.png +++ /dev/null diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj index fc00f83d4..d135142c4 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Tango.PPC.Technician.csproj @@ -69,21 +69,9 @@ </Compile> <Compile Include="Converters\LogItemMessageToOneLineConverter.cs" /> <Compile Include="Converters\LogItemToStringConverter.cs" /> - <Compile Include="Dialogs\EmbeddedLogItemDetailsView.xaml.cs"> - <DependentUpon>EmbeddedLogItemDetailsView.xaml</DependentUpon> - </Compile> - <Compile Include="Dialogs\SynchronizationDetailsView.xaml.cs"> - <DependentUpon>SynchronizationDetailsView.xaml</DependentUpon> - </Compile> - <Compile Include="Dialogs\UpdateDetailsView.xaml.cs"> - <DependentUpon>UpdateDetailsView.xaml</DependentUpon> - </Compile> <Compile Include="Dialogs\LogItemDetailsView.xaml.cs"> <DependentUpon>LogItemDetailsView.xaml</DependentUpon> </Compile> - <Compile Include="Dialogs\EmbeddedLogItemDetailsViewVM.cs" /> - <Compile Include="Dialogs\SynchronizationDetailsViewVM.cs" /> - <Compile Include="Dialogs\UpdateDetailsViewVM.cs" /> <Compile Include="Dialogs\LogItemDetailsViewVM.cs" /> <Compile Include="Models\DispenserController.cs" /> <Compile Include="TechnicianModule.cs" /> @@ -105,22 +93,10 @@ <Compile Include="ViewModels\DispensersViewVM.cs" /> <Compile Include="ViewModels\LoggingViewVM.cs" /> <Compile Include="ViewModels\MainViewVM.cs" /> - <Compile Include="ViewModels\PackagesViewVM.cs" /> - <Compile Include="ViewModels\RemoteConnectionsViewVM.cs" /> - <Compile Include="ViewModels\UpdatesViewVM.cs" /> <Compile Include="ViewModels\SystemViewVM.cs" /> <Compile Include="Views\CatalogView.xaml.cs"> <DependentUpon>CatalogView.xaml</DependentUpon> </Compile> - <Compile Include="Views\RemoteConnectionsView.xaml.cs"> - <DependentUpon>RemoteConnectionsView.xaml</DependentUpon> - </Compile> - <Compile Include="Views\UpdatesView.xaml.cs"> - <DependentUpon>UpdatesView.xaml</DependentUpon> - </Compile> - <Compile Include="Views\PackagesView.xaml.cs"> - <DependentUpon>PackagesView.xaml</DependentUpon> - </Compile> <Compile Include="Views\DispensersView.xaml.cs"> <DependentUpon>DispensersView.xaml</DependentUpon> </Compile> @@ -185,10 +161,6 @@ <Project>{0BE74EEE-22CB-4DBA-B896-793B9E1A3AC0}</Project> <Name>Tango.PPC.Common</Name> </ProjectReference> - <ProjectReference Include="..\..\Tango.PPC.Shared\Tango.PPC.Shared.csproj"> - <Project>{208C8BD8-72C6-4E3C-ACAA-351091A2ACC7}</Project> - <Name>Tango.PPC.Shared</Name> - </ProjectReference> </ItemGroup> <ItemGroup> <Page Include="App.xaml"> @@ -199,18 +171,6 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> - <Page Include="Dialogs\EmbeddedLogItemDetailsView.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="Dialogs\SynchronizationDetailsView.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="Dialogs\UpdateDetailsView.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> <Page Include="Dialogs\LogItemDetailsView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -219,18 +179,6 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> - <Page Include="Views\RemoteConnectionsView.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:Compile</Generator> - </Page> - <Page Include="Views\UpdatesView.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="Views\PackagesView.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> <Page Include="Views\DispensersView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -260,24 +208,5 @@ <ItemGroup> <Resource Include="Images\dispensers.png" /> </ItemGroup> - <ItemGroup> - <Resource Include="Images\circuit-board.png" /> - <Resource Include="Images\conveyor.png" /> - <Resource Include="Images\exit.png" /> - <Resource Include="Images\mobile-phone.png" /> - <Resource Include="Images\shutdown.png" /> - </ItemGroup> - <ItemGroup> - <Resource Include="Images\packages.png" /> - </ItemGroup> - <ItemGroup> - <Resource Include="Images\sync.png" /> - </ItemGroup> - <ItemGroup> - <Resource Include="Images\browser.png" /> - </ItemGroup> - <ItemGroup> - <Resource Include="Images\remote_connections.png" /> - </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModelLocator.cs index 9a8b63c91..ae4678e60 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModelLocator.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModelLocator.cs @@ -20,9 +20,6 @@ namespace Tango.PPC.Technician TangoIOC.Default.Register<CatalogViewVM>(); TangoIOC.Default.Register<DispensersViewVM>(); TangoIOC.Default.Register<SystemViewVM>(); - TangoIOC.Default.Register<PackagesViewVM>(); - TangoIOC.Default.Register<UpdatesViewVM>(); - TangoIOC.Default.Register<RemoteConnectionsViewVM>(); } /// <summary> @@ -79,38 +76,5 @@ namespace Tango.PPC.Technician return TangoIOC.Default.GetInstance<SystemViewVM>(); } } - - /// <summary> - /// Gets the system view VM. - /// </summary> - public static PackagesViewVM PackagesViewVM - { - get - { - return TangoIOC.Default.GetInstance<PackagesViewVM>(); - } - } - - /// <summary> - /// Gets the synchronization view vm. - /// </summary> - public static UpdatesViewVM UpdatesViewVM - { - get - { - return TangoIOC.Default.GetInstance<UpdatesViewVM>(); - } - } - - /// <summary> - /// Gets the remote connections view vm. - /// </summary> - public static RemoteConnectionsViewVM RemoteConnectionsViewVM - { - get - { - return TangoIOC.Default.GetInstance<RemoteConnectionsViewVM>(); - } - } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/CatalogViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/CatalogViewVM.cs index dbc99fa87..97bae6f5b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/CatalogViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/CatalogViewVM.cs @@ -4,9 +4,6 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Core.Commands; -//using Tango.PPC.Browser; -//using Tango.PPC.Browser.Navigation; -//using Tango.PPC.Browser.Views; using Tango.PPC.Common; namespace Tango.PPC.Technician.ViewModels @@ -19,22 +16,16 @@ namespace Tango.PPC.Technician.ViewModels public RelayCommand<String> NavigationCommand { get; set; } /// <summary> - /// Gets or sets the browser command. - /// </summary> - public RelayCommand BrowserCommand { get; set; } - - /// <summary> /// Initializes a new instance of the <see cref="CatalogViewVM"/> class. /// </summary> public CatalogViewVM() { NavigationCommand = new RelayCommand<string>(NavigateToView); - BrowserCommand = new RelayCommand(OpenBrowserModule); } public override void OnApplicationStarted() { - + } /// <summary> @@ -45,17 +36,5 @@ namespace Tango.PPC.Technician.ViewModels { NavigationManager.NavigateTo<TechnicianModule>(view); } - - /// <summary> - /// Opens the browser module. - /// </summary> - private void OpenBrowserModule() - { - //NavigationManager.NavigateWithObject<BrowserModule, BrowserView, BrowserNavigationRequest>(new BrowserNavigationRequest() - //{ - // Address = "https://twine-s.com/", - // DisplayAddressBar = true, - //}, true); - } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/LoggingViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/LoggingViewVM.cs index 2aee7f561..6ca693af6 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/LoggingViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/LoggingViewVM.cs @@ -8,11 +8,8 @@ using System.Threading.Tasks; using System.Windows.Data; using Tango.Core; using Tango.Core.Commands; -using Tango.Integration.Logging; -using Tango.Integration.Operation; using Tango.Logging; using Tango.PPC.Common; -using Tango.PPC.Common.Helpers; using Tango.PPC.Technician.Dialogs; namespace Tango.PPC.Technician.ViewModels @@ -20,28 +17,12 @@ namespace Tango.PPC.Technician.ViewModels public class LoggingViewVM : PPCViewModel { private const int MAX_LOGS = 1000; - private List<LogItemBase> paused_logs; - private List<LogItemBase> paused_embedded_logs; public SynchronizedObservableCollection<LogItemBase> ApplicationLogs { get; set; } public SynchronizedObservableCollection<LogItemBase> EmbeddedLogs { get; set; } - private ICollectionView _applicationLogsViewSource; - public ICollectionView ApplicationLogsViewSource - { - get { return _applicationLogsViewSource; } - set { _applicationLogsViewSource = value; RaisePropertyChangedAuto(); } - } - - private ICollectionView _embeddedLogsViewSource; - public ICollectionView EmbeddedLogsViewSource - { - get { return _embeddedLogsViewSource; } - set { _embeddedLogsViewSource = value; RaisePropertyChangedAuto(); } - } - private LogItemBase _selectedLog; public LogItemBase SelectedLog { @@ -49,6 +30,13 @@ namespace Tango.PPC.Technician.ViewModels set { _selectedLog = value; RaisePropertyChangedAuto(); OnSelectedLogChanged(); } } + private ICollectionView _applicationLogsViewSource; + public ICollectionView ApplicationLogsViewSource + { + get { return _applicationLogsViewSource; } + set { _applicationLogsViewSource = value; RaisePropertyChangedAuto(); } + } + private String _filter; public String Filter { @@ -58,7 +46,6 @@ namespace Tango.PPC.Technician.ViewModels _filter = value; RaisePropertyChangedAuto(); ApplicationLogsViewSource.Refresh(); - EmbeddedLogsViewSource.Refresh(); } } @@ -69,13 +56,6 @@ namespace Tango.PPC.Technician.ViewModels set { _isPaused = value; RaisePropertyChangedAuto(); OnIsPausedChanged(); } } - private bool _processDebugLogs; - public bool ProcessDebugLogs - { - get { return _processDebugLogs; } - set { _processDebugLogs = value; RaisePropertyChangedAuto(); OnProcessDebugLogsChanged(); } - } - public RelayCommand ClearCommand { get; set; } public LoggingViewVM() @@ -83,19 +63,8 @@ namespace Tango.PPC.Technician.ViewModels ApplicationLogs = new SynchronizedObservableCollection<LogItemBase>(); EmbeddedLogs = new SynchronizedObservableCollection<LogItemBase>(); ApplicationLogsViewSource = CollectionViewSource.GetDefaultView(ApplicationLogs); - EmbeddedLogsViewSource = CollectionViewSource.GetDefaultView(EmbeddedLogs); paused_logs = new List<LogItemBase>(); - paused_embedded_logs = new List<LogItemBase>(); - - var appStartLogs = LogsHelper.GetLogSafe().EmptyAndDispose(); - - foreach (var log in appStartLogs) - { - ApplicationLogs.Insert(0, log); - } - LogManager.NewLog += LogManager_NewLog; - MachineOperator.EmbeddedLogManager.NewLog += EmbeddedLogManager_NewLog; ClearCommand = new RelayCommand(ClearLogs); Filter = "error"; @@ -112,31 +81,6 @@ namespace Tango.PPC.Technician.ViewModels return false; } }; - - EmbeddedLogsViewSource.Filter = (x) => - { - try - { - LogItemBase log = x as LogItemBase; - return String.IsNullOrWhiteSpace(Filter) || log.Category.ToString().ToLower().Contains(Filter.ToLower()) || log.Message.ToLower().Contains(Filter.ToLower()); - } - catch - { - return false; - } - }; - } - - private void OnProcessDebugLogsChanged() - { - if (ProcessDebugLogs) - { - LogManager.Categories.Add(LogCategory.Debug); - } - else - { - LogManager.Categories.RemoveAll(x => x == LogCategory.Debug); - } } private void OnIsPausedChanged() @@ -147,14 +91,6 @@ namespace Tango.PPC.Technician.ViewModels } paused_logs.Clear(); - - - foreach (var log in paused_embedded_logs) - { - EmbeddedLogManager_NewLog(this, log); - } - - paused_embedded_logs.Clear(); } private void LogManager_NewLog(object sender, LogItemBase log) @@ -184,59 +120,22 @@ namespace Tango.PPC.Technician.ViewModels } } - private void EmbeddedLogManager_NewLog(object sender, LogItemBase log) - { - if (!IsPaused) - { - InvokeUI(() => - { - EmbeddedLogs.Insert(0, log); - - try - { - if (EmbeddedLogs.Count > MAX_LOGS) - { - EmbeddedLogs.Remove(EmbeddedLogs.Last()); - } - } - catch - { - //I don't know if this will cause an exception but I'm tired. - } - }); - } - else - { - paused_embedded_logs.Add(log); - } - } - private void ClearLogs() { ApplicationLogs.Clear(); - EmbeddedLogs.Clear(); paused_logs.Clear(); - paused_embedded_logs.Clear(); } private async void OnSelectedLogChanged() { if (SelectedLog != null) { - if (SelectedLog.GetType() == typeof(EmbeddedLogItem)) - { - await NotificationProvider.ShowDialog<EmbeddedLogItemDetailsViewVM>(new EmbeddedLogItemDetailsViewVM() - { - Log = SelectedLog as EmbeddedLogItem, - }); - } - else + await NotificationProvider.ShowDialog<LogItemDetailsViewVM>(new LogItemDetailsViewVM() { - await NotificationProvider.ShowDialog<LogItemDetailsViewVM>(new LogItemDetailsViewVM() - { - Log = SelectedLog, - }); - } + Log = SelectedLog, + }); + + SelectedLog = null; } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/MainViewVM.cs index 4f8aba952..d63a89f3b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/MainViewVM.cs @@ -12,13 +12,13 @@ namespace Tango.PPC.Technician.ViewModels { public override void OnApplicationStarted() { - + } public override void OnNavigatedTo() { base.OnNavigatedTo(); - NavigationManager.NavigateTo<TechnicianModule>(nameof(CatalogView), false); + NavigationManager.NavigateTo<TechnicianModule>(nameof(CatalogView)); } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/PackagesViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/PackagesViewVM.cs deleted file mode 100644 index 1d7e1780a..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/PackagesViewVM.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core.DI; -using Tango.PPC.Common; -using Tango.PPC.Common.UpdatePackages; -using Tango.PPC.Shared.Updates; - -namespace Tango.PPC.Technician.ViewModels -{ - public class PackagesViewVM : PPCViewModel - { - [TangoInject(TangoInjectMode.WhenAvailable)] - public IPackageRunner PackageRunner { get; set; } - - private List<PackageInstallation> _packages; - public List<PackageInstallation> Packages - { - get { return _packages; } - set { _packages = value; RaisePropertyChangedAuto(); } - } - - public override void OnApplicationStarted() - { - - } - - public async override void OnApplicationReady() - { - base.OnApplicationReady(); - - try - { - Packages = (await PackageRunner.GetPackagesFile()).PackageInstallations; - } - catch (Exception ex) - { - LogManager.Log(ex, "An error occurred while trying to list the installed update packages."); - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/RemoteConnectionsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/RemoteConnectionsViewVM.cs deleted file mode 100644 index 2d8857329..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/RemoteConnectionsViewVM.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core.Commands; -using Tango.Integration.ExternalBridge; -using Tango.PPC.Common; - -namespace Tango.PPC.Technician.ViewModels -{ - public class RemoteConnectionsViewVM : PPCViewModel - { - public RelayCommand DisconnectCommand { get; set; } - - private ExternalBridgeReceiver _selectedReceiver; - public ExternalBridgeReceiver SelectedReceiver - { - get { return _selectedReceiver; } - set - { - if (value != null) - { - _selectedReceiver = value; - InvalidateRelayCommands(); - } - } - } - - public RemoteConnectionsViewVM() - { - DisconnectCommand = new RelayCommand(DisconnectReceiver, () => SelectedReceiver != null); - } - - private async void DisconnectReceiver() - { - if (SelectedReceiver != null) - { - try - { - await Task.Factory.StartNew(() => - { - SelectedReceiver.Disconnect().Wait(); - }); - } - catch (Exception ex) - { - LogManager.Log(ex, "Error disconnecting the specified receiver."); - } - finally - { - _selectedReceiver = null; - RaisePropertyChanged(nameof(SelectedReceiver)); - InvalidateRelayCommands(); - } - } - } - - public override void OnApplicationStarted() - { - - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs index 452907366..444c1d09e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/SystemViewVM.cs @@ -8,20 +8,16 @@ using System.Net.Sockets; using System.Text; using System.Threading.Tasks; using System.Timers; -using Tango.BL; using Tango.Core.Commands; using Tango.PPC.Common; using Tango.PPC.Common.OS; using Tango.Settings; -using System.Data.Entity; -using Tango.PPC.Common.UWF; namespace Tango.PPC.Technician.ViewModels { public class SystemViewVM : PPCViewModel { private IOperationSystemManager _os; - private IUnifiedWriteFilterManager _uwf; private Timer _statsTimer; private bool _resettingDevice; @@ -60,20 +56,6 @@ namespace Tango.PPC.Technician.ViewModels set { _ipAddress = value; RaisePropertyChangedAuto(); } } - private String _totalDyeTime; - public String TotalDyeTime - { - get { return _totalDyeTime; } - set { _totalDyeTime = value; RaisePropertyChangedAuto(); } - } - - private String _totalDyeMeters; - public String TotalDyeMeters - { - get { return _totalDyeMeters; } - set { _totalDyeMeters = value; RaisePropertyChangedAuto(); } - } - public RelayCommand ResetDeviceCommand { get; set; } public RelayCommand RestartCommand { get; set; } @@ -84,10 +66,9 @@ namespace Tango.PPC.Technician.ViewModels public RelayCommand ExitToExplorerCommand { get; set; } - public SystemViewVM(IOperationSystemManager os, IUnifiedWriteFilterManager uwf) + public SystemViewVM(IOperationSystemManager os) { _os = os; - _uwf = uwf; CPU = 0; RAM = 0; @@ -105,7 +86,7 @@ namespace Tango.PPC.Technician.ViewModels { _resettingDevice = true; ResetDeviceCommand.RaiseCanExecuteChanged(); - await MachineProvider.MachineOperator.Reset(); + await MachineProvider.MachineOperator.ResetDFU(); await NotificationProvider.ShowInfo("Embedded device has been reset successfully."); } catch (Exception ex) @@ -121,30 +102,11 @@ namespace Tango.PPC.Technician.ViewModels private async void FactoryReset() { - if (await NotificationProvider.ShowQuestion("Are you sure you want to reset this device back to factory settings?")) + if (await NotificationProvider.ShowQuestion("Are you sure you want to reset this device and back to factory settings?")) { Settings.ApplicationState = ApplicationStates.FactoryRestore; Settings.Save(); - try - { - NotificationProvider.SetGlobalBusyMessage("Disabling write filter protection..."); - await _uwf.Disable(); - await Task.Delay(2000); - NotificationProvider.ReleaseGlobalBusyMessage(); - await NavigationManager.NavigateTo(Common.Navigation.NavigationView.RestartingSystemView); - await Task.Delay(4000); - _os.Restart(); - } - catch (Exception ex) - { - LogManager.Log(ex, "Error executing factory reset."); - NotificationProvider.ReleaseGlobalBusyMessage(); - await NotificationProvider.ShowError($"Error executing factory reset.\n{ex.FlattenMessage()}"); - } - finally - { - NotificationProvider.ReleaseGlobalBusyMessage(); - } + ApplicationManager.Restart(); } } @@ -160,8 +122,6 @@ namespace Tango.PPC.Technician.ViewModels { if (await NotificationProvider.ShowQuestion("Are you sure you want to restart the device?")) { - await NavigationManager.NavigateTo(Common.Navigation.NavigationView.RestartingSystemView); - await Task.Delay(4000); _os.Restart(); } } @@ -170,7 +130,12 @@ namespace Tango.PPC.Technician.ViewModels { if (await NotificationProvider.ShowQuestion("Close the application and start OS shell?")) { - _os.OpenShell(); + Process.Start(new ProcessStartInfo() + { + UseShellExecute = true, + FileName = "explorer.exe", + }); + ApplicationManager.ShutDown(); } } @@ -183,6 +148,12 @@ namespace Tango.PPC.Technician.ViewModels _statsTimer.Start(); } + public override void OnApplicationReady() + { + base.OnApplicationReady(); + IPAddress = GetIpv4Address(); + } + private void _statsTimer_Elapsed(object sender, ElapsedEventArgs e) { if (IsVisible) @@ -273,31 +244,5 @@ namespace Tango.PPC.Technician.ViewModels return "N/A"; } } - - public async override void OnNavigatedTo() - { - base.OnNavigatedTo(); - - IPAddress = GetIpv4Address(); - - try - { - using (ObservablesContext db = ObservablesContext.CreateDefault()) - { - var jobRuns = await db.JobRuns.Select(x => new { x.StartDate, x.EndDate, x.EndPosition }).ToListAsync(); - - TotalDyeTime = TimeSpan.FromHours(jobRuns.Select(x => x.EndDate - x.StartDate).Sum(x => x.TotalHours)).ToStringUnlimitedHours(); - - int meters = (int)jobRuns.Select(x => x.EndPosition).Sum(); - TotalDyeMeters = $"{meters.ToString("N0")} meters"; - } - } - catch (Exception ex) - { - LogManager.Log(ex, "Error loading machine counters."); - TotalDyeTime = "error!"; - TotalDyeMeters = "error!"; - } - } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/UpdatesViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/UpdatesViewVM.cs deleted file mode 100644 index 3f4232252..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/ViewModels/UpdatesViewVM.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL; -using Tango.BL.Entities; -using Tango.BL.Enumerations; -using Tango.Core.Commands; -using Tango.PPC.Common; -using System.Data.Entity; -using Tango.PPC.Technician.Dialogs; -using Tango.PPC.Common.Synchronization; - -namespace Tango.PPC.Technician.ViewModels -{ - public class UpdatesViewVM : PPCViewModel - { - public RelayCommand SynchronizeCommand { get; set; } - - private List<TangoUpdate> _updates; - public List<TangoUpdate> Updates - { - get { return _updates; } - set { _updates = value; RaisePropertyChangedAuto(); } - } - - private TangoUpdate _selectedUpdate; - public TangoUpdate SelectedUpdate - { - get { return _selectedUpdate; } - set { _selectedUpdate = value; OnSelectedUpdateChanged(); } - } - - private SynchronizationStatus _selectedSynchronization; - public SynchronizationStatus SelectedSynchronization - { - get { return _selectedSynchronization; } - set { _selectedSynchronization = value; OnSelectedSynchronizationChanged(); } - } - - public UpdatesViewVM() - { - Updates = new List<TangoUpdate>(); - SynchronizeCommand = new RelayCommand(Synchronize, () => !MachineDataSynchronizer.IsSynchronizing); - } - - public override void OnApplicationStarted() - { - - } - - public override void OnApplicationReady() - { - base.OnApplicationReady(); - MachineDataSynchronizer.SynchronizationStarted += (_, __) => InvalidateRelayCommands(); - MachineDataSynchronizer.SynchronizationEnded += (_, __) => InvalidateRelayCommands(); - } - - private async void Synchronize() - { - try - { - await MachineDataSynchronizer.Synchronize(); - } - catch { } - } - - public async override void OnNavigatedTo() - { - base.OnNavigatedTo(); - - try - { - using (ObservablesContext db = ObservablesContext.CreateDefault()) - { - Updates = await db.TangoUpdates.Where(x => - x.Status != (int)TangoUpdateStatuses.SynchronizationCompleted && - x.Status != (int)TangoUpdateStatuses.SynchronizationFailed && - x.Status != (int)TangoUpdateStatuses.SynchronizationStarted - ).OrderByDescending(x => x.StartDate).ToListAsync(); - } - } - catch (Exception ex) - { - LogManager.Log(ex, "Error loading update history."); - } - } - - private async void OnSelectedUpdateChanged() - { - if (SelectedUpdate != null) - { - await NotificationProvider.ShowDialog<UpdateDetailsViewVM>(new UpdateDetailsViewVM() { Update = SelectedUpdate }); - } - } - - private async void OnSelectedSynchronizationChanged() - { - if (SelectedSynchronization != null) - { - await NotificationProvider.ShowDialog<SynchronizationDetailsViewVM>(new SynchronizationDetailsViewVM() { Status = SelectedSynchronization }); - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/CatalogView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/CatalogView.xaml index 78fa17979..58c88324f 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/CatalogView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/CatalogView.xaml @@ -20,116 +20,32 @@ <Border.Effect> <DropShadowEffect Color="Silver" ShadowDepth="0" BlurRadius="20" Opacity="1" /> </Border.Effect> - <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Technician</TextBlock> + <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Technician Mode</TextBlock> </Border> - <touch:LightTouchScrollViewer Grid.Row="1"> - <Grid Grid.Row="1" VerticalAlignment="Top" Margin="20"> - <StackPanel Margin="30 0 30 0" DockPanel.Dock="Bottom" VerticalAlignment="Center"> + <Grid Grid.Row="1" VerticalAlignment="Top" Margin="20"> + <UniformGrid Columns="2"> + <touch:TouchButton Command="{Binding NavigationCommand}" CommandParameter="LoggingView" Width="250" Height="250" Style="{StaticResource TangoHollowButton}" Padding="20"> + <DockPanel> + <TextBlock Margin="0 10 0 0" DockPanel.Dock="Bottom" HorizontalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Logging</TextBlock> + <Image Width="128" Source="../Images/logging.png" /> + </DockPanel> + </touch:TouchButton> - <StackPanel.Resources> - <Style TargetType="touch:TouchButton" x:Key="ButtonMenu"> - <Setter Property="Padding" Value="10"></Setter> - <Setter Property="HorizontalContentAlignment" Value="Left"></Setter> - <Setter Property="Height" Value="140"></Setter> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="BorderBrush" Value="{StaticResource TangoDarkForegroundBrush}"></Setter> - <Setter Property="BorderThickness" Value="1"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoDarkForegroundBrush}"></Setter> - <Setter Property="EnableDropShadow" Value="False"></Setter> - <Setter Property="CornerRadius" Value="5"></Setter> - <Setter Property="Margin" Value="0 0 0 20"></Setter> - <Setter Property="RippleBrush" Value="#4BB8B8B8"></Setter> - </Style> - </StackPanel.Resources> + <touch:TouchButton Command="{Binding NavigationCommand}" CommandParameter="SystemView" Width="250" Height="250" Style="{StaticResource TangoHollowButton}" Padding="20"> + <DockPanel> + <TextBlock Margin="0 10 0 0" DockPanel.Dock="Bottom" HorizontalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">System</TextBlock> + <Image Width="128" Source="../Images/system.png" /> + </DockPanel> + </touch:TouchButton> - <TextBlock Margin="0 20 0 40" Foreground="{StaticResource TangoGrayTextBrush}">The technician module enables additional diagnostic tools.</TextBlock> - - <touch:TouchButton Command="{Binding NavigationCommand}" CommandParameter="LoggingView" Style="{StaticResource ButtonMenu}"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="../Images/logging.png" Width="80" Height="80" /> - <StackPanel Margin="10 0 0 0"> - <TextBlock FontSize="{StaticResource TangoButtonFontSize}">Logging</TextBlock> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" TextWrapping="Wrap" Width="580"> - Display and investigate issues using application and embedded device logs. - </TextBlock> - </StackPanel> - </StackPanel> - </touch:TouchButton> - - <touch:TouchButton Command="{Binding NavigationCommand}" CommandParameter="SystemView" Style="{StaticResource ButtonMenu}"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="../Images/system.png" Width="80" Height="80" /> - <StackPanel Margin="10 0 0 0"> - <TextBlock FontSize="{StaticResource TangoTitleFontSize}">System</TextBlock> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" TextWrapping="Wrap" Width="580"> - Display system properties, perform system actions, reset, shutdown etc... - </TextBlock> - </StackPanel> - </StackPanel> - </touch:TouchButton> - - <touch:TouchButton Command="{Binding NavigationCommand}" CommandParameter="DispensersView" Style="{StaticResource ButtonMenu}"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="../Images/dispensers.png" Width="80" Height="80" /> - <StackPanel Margin="10 0 0 0"> - <TextBlock FontSize="{StaticResource TangoButtonFontSize}">Dispensers</TextBlock> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" TextWrapping="Wrap" Width="580"> - Perform manual dispensers homing priming. - </TextBlock> - </StackPanel> - </StackPanel> - </touch:TouchButton> - - <touch:TouchButton Command="{Binding NavigationCommand}" CommandParameter="PackagesView" Style="{StaticResource ButtonMenu}"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="../Images/packages.png" Width="80" Height="80" /> - <StackPanel Margin="10 0 0 0"> - <TextBlock FontSize="{StaticResource TangoButtonFontSize}">Installed Packages</TextBlock> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" TextWrapping="Wrap" Width="580"> - View the history of update packages installation. - </TextBlock> - </StackPanel> - </StackPanel> - </touch:TouchButton> - - <touch:TouchButton Command="{Binding NavigationCommand}" CommandParameter="UpdatesView" Style="{StaticResource ButtonMenu}"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="../Images/sync.png" Width="80" Height="80" /> - <StackPanel Margin="10 0 0 0"> - <TextBlock FontSize="{StaticResource TangoButtonFontSize}">Updates & Synchronization</TextBlock> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" TextWrapping="Wrap" Width="580"> - View the current status and history of update and synchronization operations. - </TextBlock> - </StackPanel> - </StackPanel> - </touch:TouchButton> - - <touch:TouchButton Command="{Binding NavigationCommand}" CommandParameter="RemoteConnectionsView" Style="{StaticResource ButtonMenu}"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="../Images/remote_connections.png" Width="80" Height="80" /> - <StackPanel Margin="10 0 0 0"> - <TextBlock FontSize="{StaticResource TangoButtonFontSize}">Remote Connections</TextBlock> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" TextWrapping="Wrap" Width="580"> - View the current status of remote connections to this machine. - </TextBlock> - </StackPanel> - </StackPanel> - </touch:TouchButton> - - <!--<touch:TouchButton Command="{Binding BrowserCommand}" Style="{StaticResource ButtonMenu}"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="../Images/browser.png" RenderOptions.BitmapScalingMode="Fant" Width="80" Height="80" /> - <StackPanel Margin="10 0 0 0"> - <TextBlock FontSize="{StaticResource TangoButtonFontSize}">Browser</TextBlock> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" TextWrapping="Wrap" Width="580"> - Open the browser module and navigate the web. - </TextBlock> - </StackPanel> - </StackPanel> - </touch:TouchButton>--> - </StackPanel> - </Grid> - </touch:LightTouchScrollViewer> + <touch:TouchButton Command="{Binding NavigationCommand}" CommandParameter="DispensersView" Margin="0 60 0 0" Width="250" Height="250" Style="{StaticResource TangoHollowButton}" Padding="20"> + <DockPanel> + <TextBlock Margin="0 10 0 0" DockPanel.Dock="Bottom" HorizontalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Dispensers</TextBlock> + <Image Width="128" Source="../Images/dispensers.png" /> + </DockPanel> + </touch:TouchButton> + </UniformGrid> + </Grid> </Grid> </UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml index 8393349ea..39353c286 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml @@ -34,7 +34,7 @@ <DockPanel> <DockPanel DockPanel.Dock="Top"> <StackPanel Orientation="Horizontal"> - <touch:TouchNavigationLinks x:Name="nav" Margin="20" FontSize="{StaticResource TangoNavigationLinksFontSize}"> + <touch:TouchNavigationLinks Margin="20" FontSize="{StaticResource TangoNavigationLinksFontSize}"> <sys:String>Application</sys:String> <sys:String>Embedded</sys:String> </touch:TouchNavigationLinks> @@ -47,109 +47,91 @@ <touch:TouchIcon Icon="Magnify" Foreground="{StaticResource TangoGrayBrush}" Width="16" Height="16" /> <touch:TouchTextBox Width="200" VerticalAlignment="Center" Margin="5 -10 0 0" Text="{Binding Filter,Delay=1000}"></touch:TouchTextBox> </StackPanel> - - <touch:TouchCheckBox IsChecked="{Binding ProcessDebugLogs}" Margin="20 0 0 0" Content="Debug Logs"> - <touch:TouchCheckBox.Style> - <Style TargetType="touch:TouchCheckBox" BasedOn="{StaticResource {x:Type touch:TouchCheckBox}}"> - <Setter Property="Visibility" Value="Collapsed"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding ElementName=nav,Path=SelectedIndex}" Value="0"> - <Setter Property="Visibility" Value="Visible"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </touch:TouchCheckBox.Style> - </touch:TouchCheckBox> </StackPanel> </StackPanel> <touch:TouchDatePicker Visibility="Collapsed" SelectedDate="12/15/2018" Height="40" /> </DockPanel> <Grid Margin="20"> - <TabControl Padding="0" BorderThickness="0" Margin="0 10 0 0" Background="Transparent" SelectedIndex="{Binding ElementName=nav,Path=SelectedIndex,Mode=OneWay}"> - <TabItem Header="Application" Visibility="Collapsed"> - <touch:TouchSimpleDataGrid x:Name="gridApplication" Style="{StaticResource TechGrid}" ItemsSource="{Binding ApplicationLogsViewSource}" SelectedItem="{Binding SelectedLog}"> - <DataGrid.Columns> - <DataGridTemplateColumn Header="" Width="50"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <touch:TouchIcon Width="16"> - <touch:TouchIcon.Style> - <Style TargetType="touch:TouchIcon"> - <Setter Property="Icon" Value="InformationOutline"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Category}" Value="Warning"> - <Setter Property="Icon" Value="ExclamationTriangleSolid"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Category}" Value="Error"> - <Setter Property="Icon" Value="Alert"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Category}" Value="Critical"> - <Setter Property="Icon" Value="Alert"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </touch:TouchIcon.Style> - </touch:TouchIcon> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTextColumn Header="Time" Width="120" Binding="{Binding TimeStamp,Converter={StaticResource DateTimeUTCToStringConverter},Mode=OneWay,ConverterParameter='hh\\:mm\\:ss.ff'}" /> - <DataGridTemplateColumn Header="Message" Width="1*"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <TextBlock Text="{Binding Message,Converter={StaticResource LogItemMessageToOneLineConverter},ConverterParameter='70',Mode=OneWay}"/> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - </DataGrid.Columns> - </touch:TouchSimpleDataGrid> - </TabItem> - <TabItem Header="Embedded" Visibility="Collapsed"> - <touch:TouchSimpleDataGrid x:Name="gridEmbedded" Style="{StaticResource TechGrid}" ItemsSource="{Binding EmbeddedLogsViewSource}" SelectedItem="{Binding SelectedLog}"> - <DataGrid.Columns> - <DataGridTemplateColumn Header="" Width="50"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <touch:TouchIcon Width="16"> - <touch:TouchIcon.Style> - <Style TargetType="touch:TouchIcon"> - <Setter Property="Icon" Value="InformationOutline"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Category}" Value="Warning"> - <Setter Property="Icon" Value="ExclamationTriangleSolid"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Category}" Value="Error"> - <Setter Property="Icon" Value="Alert"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Category}" Value="Critical"> - <Setter Property="Icon" Value="Alert"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </touch:TouchIcon.Style> - </touch:TouchIcon> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTextColumn Header="Time" Width="120" Binding="{Binding TimeStamp,Converter={StaticResource DateTimeUTCToStringConverter},Mode=OneWay,ConverterParameter='hh\\:mm\\:ss.ff'}" /> - <DataGridTemplateColumn Header="Message" Width="1*"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <TextBlock Text="{Binding Message,Converter={StaticResource LogItemMessageToOneLineConverter},ConverterParameter='70',Mode=OneWay}"/> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - </DataGrid.Columns> - </touch:TouchSimpleDataGrid> - </TabItem> - </TabControl> + <touch:TouchSimpleDataGrid AutoGenerateColumns="False" SelectionMode="Single" SelectionUnit="FullRow" BorderThickness="1" BorderBrush="{StaticResource TangoDarkForegroundBrush}" HeadersVisibility="Column" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False" CanUserSortColumns="False" IsReadOnly="True" ItemsSource="{Binding ApplicationLogsViewSource}" SelectedItem="{Binding SelectedLog}" VerticalGridLinesBrush="{x:Null}" HorizontalGridLinesBrush="{StaticResource TangoGrayBrush}" RowHeight="50" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled"> + <DataGrid.Resources> + <Style BasedOn="{StaticResource {x:Type DataGridColumnHeader}}" TargetType="{x:Type DataGridColumnHeader}"> + <Setter Property="Background" Value="{StaticResource TangoDarkForegroundBrush}" /> + <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}" /> + <Setter Property="Padding" Value="5"></Setter> + </Style> + </DataGrid.Resources> + <DataGrid.RowStyle> + <Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}"> + <Style.Triggers> + <Trigger Property="IsSelected" Value="True"> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}" /> + </Trigger> + <Trigger Property="IsFocused" Value="True"> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}" /> + </Trigger> + </Style.Triggers> + </Style> + </DataGrid.RowStyle> + <DataGrid.CellStyle> + <Style TargetType="{x:Type DataGridCell}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type DataGridCell}"> + <Grid Background="{TemplateBinding Background}"> + <ContentPresenter VerticalAlignment="Center" /> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <Trigger Property="IsSelected" Value="True"> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}" /> + </Trigger> + </Style.Triggers> + </Style> + </DataGrid.CellStyle> + <DataGrid.Columns> + <DataGridTemplateColumn Header="" Width="50"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <touch:TouchIcon Width="16"> + <touch:TouchIcon.Style> + <Style TargetType="touch:TouchIcon"> + <Setter Property="Icon" Value="InformationOutline"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Category}" Value="Warning"> + <Setter Property="Icon" Value="ExclamationTriangleSolid"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Category}" Value="Error"> + <Setter Property="Icon" Value="Alert"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Category}" Value="Critical"> + <Setter Property="Icon" Value="Alert"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </touch:TouchIcon.Style> + </touch:TouchIcon> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTextColumn Header="Time" Width="120" Binding="{Binding TimeStamp,Converter={StaticResource DateTimeUTCToStringConverter},Mode=OneWay,ConverterParameter='hh\\:mm\\:ss.ff'}" /> + <DataGridTemplateColumn Header="Message" Width="1*"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock Text="{Binding Message,Converter={StaticResource LogItemMessageToOneLineConverter},ConverterParameter='70',Mode=OneWay}"/> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + </DataGrid.Columns> + </touch:TouchSimpleDataGrid> </Grid> </DockPanel> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml index d4235341c..08f9a335a 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/MainView.xaml @@ -17,9 +17,6 @@ <local:LoggingView/> <local:DispensersView/> <local:SystemView/> - <local:PackagesView/> - <local:UpdatesView/> - <local:RemoteConnectionsView/> </controls:NavigationControl> </Grid> </UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/PackagesView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/PackagesView.xaml deleted file mode 100644 index a7944497b..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/PackagesView.xaml +++ /dev/null @@ -1,103 +0,0 @@ -<UserControl x:Class="Tango.PPC.Technician.Views.PackagesView" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - 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:local="clr-namespace:Tango.PPC.Technician.Views" - xmlns:controls="clr-namespace:Tango.PPC.Technician.Controls" - xmlns:sys="clr-namespace:System;assembly=mscorlib" - xmlns:vm="clr-namespace:Tango.PPC.Technician.ViewModels" - xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" - xmlns:global="clr-namespace:Tango.PPC.Technician" - mc:Ignorable="d" - d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:PackagesViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.PackagesViewVM}"> - <Grid Background="{StaticResource TangoMidBackgroundBrush}"> - <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="1*"/> - </Grid.RowDefinitions> - - <Border Padding="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}"> - <Border.Effect> - <DropShadowEffect Color="Silver" ShadowDepth="0" BlurRadius="20" Opacity="1" /> - </Border.Effect> - <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Installed Packages</TextBlock> - </Border> - - <Grid Grid.Row="1"> - <Grid Margin="20"> - <touch:TouchSimpleDataGrid Background="{StaticResource TangoPrimaryBackgroundBrush}" AutoGenerateColumns="False" SelectionMode="Single" SelectionUnit="FullRow" BorderThickness="1" BorderBrush="{StaticResource TangoDarkForegroundBrush}" HeadersVisibility="Column" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False" CanUserSortColumns="False" IsReadOnly="True" ItemsSource="{Binding Packages}" VerticalGridLinesBrush="{x:Null}" HorizontalGridLinesBrush="{StaticResource TangoGrayBrush}" RowHeight="50" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled"> - <DataGrid.Resources> - <Style BasedOn="{StaticResource {x:Type DataGridColumnHeader}}" TargetType="{x:Type DataGridColumnHeader}"> - <Setter Property="Background" Value="{StaticResource TangoDarkForegroundBrush}" /> - <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}" /> - <Setter Property="Padding" Value="5"></Setter> - </Style> - </DataGrid.Resources> - <DataGrid.RowStyle> - <Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}"> - <Style.Triggers> - <Trigger Property="IsSelected" Value="True"> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}" /> - </Trigger> - <Trigger Property="IsFocused" Value="True"> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}" /> - </Trigger> - </Style.Triggers> - </Style> - </DataGrid.RowStyle> - <DataGrid.CellStyle> - <Style TargetType="{x:Type DataGridCell}"> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="{x:Type DataGridCell}"> - <Grid Background="{TemplateBinding Background}"> - <ContentPresenter VerticalAlignment="Center" /> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - <Style.Triggers> - <Trigger Property="IsSelected" Value="True"> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}" /> - </Trigger> - </Style.Triggers> - </Style> - </DataGrid.CellStyle> - <DataGrid.Columns> - <DataGridTemplateColumn Header="" Width="50"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <touch:TouchIcon Width="16"> - <touch:TouchIcon.Style> - <Style TargetType="touch:TouchIcon"> - <Setter Property="Icon" Value="Pause"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoDarkForegroundBrush}"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding State}" Value="Failed"> - <Setter Property="Icon" Value="Alert"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding State}" Value="Installed"> - <Setter Property="Icon" Value="Check"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </touch:TouchIcon.Style> - </touch:TouchIcon> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTextColumn Header="Type" Width="60" Binding="{Binding Type}" /> - <DataGridTextColumn Header="Date" Width="180" Binding="{Binding InstallationDate}" /> - <DataGridTextColumn Header="Name" Width="*" Binding="{Binding PackageName}" /> - </DataGrid.Columns> - </touch:TouchSimpleDataGrid> - </Grid> - </Grid> - </Grid> -</UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/PackagesView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/PackagesView.xaml.cs deleted file mode 100644 index 52384fe73..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/PackagesView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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.PPC.Technician.Views -{ - /// <summary> - /// Interaction logic for DispensersView.xaml - /// </summary> - public partial class PackagesView : UserControl - { - public PackagesView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/RemoteConnectionsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/RemoteConnectionsView.xaml deleted file mode 100644 index af93a56e5..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/RemoteConnectionsView.xaml +++ /dev/null @@ -1,88 +0,0 @@ -<UserControl x:Class="Tango.PPC.Technician.Views.RemoteConnectionsView" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - 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:vm="clr-namespace:Tango.PPC.Technician.ViewModels" - xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" - xmlns:global="clr-namespace:Tango.PPC.Technician" - xmlns:local="clr-namespace:Tango.PPC.Technician.Views" - mc:Ignorable="d" - d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:RemoteConnectionsViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.RemoteConnectionsViewVM}"> - <Grid Background="{StaticResource TangoMidBackgroundBrush}"> - <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="1*"/> - </Grid.RowDefinitions> - - <Border Padding="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}"> - <Border.Effect> - <DropShadowEffect Color="Silver" ShadowDepth="0" BlurRadius="20" Opacity="1" /> - </Border.Effect> - <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Remote Connections</TextBlock> - </Border> - - <Grid Grid.Row="1"> - <Grid Margin="20"> - <DockPanel> - <touch:TouchButton Command="{Binding DisconnectCommand}" DockPanel.Dock="Bottom" HorizontalAlignment="Right" Style="{StaticResource TangoHollowButton}" Height="60" Width="250" Margin="0 20 0 0">DISCONNECT</touch:TouchButton> - <touch:TouchSimpleDataGrid IsSynchronizedWithCurrentItem="True" SelectedItem="{Binding SelectedReceiver,Mode=TwoWay}" Background="{StaticResource TangoPrimaryBackgroundBrush}" AutoGenerateColumns="False" SelectionMode="Single" SelectionUnit="FullRow" BorderThickness="1" BorderBrush="{StaticResource TangoDarkForegroundBrush}" HeadersVisibility="Column" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False" CanUserSortColumns="False" IsReadOnly="True" ItemsSource="{Binding ExternalBridgeService.ActiveReceivers}" VerticalGridLinesBrush="{x:Null}" HorizontalGridLinesBrush="{StaticResource TangoGrayBrush}" RowHeight="50" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled"> - <DataGrid.Resources> - <Style BasedOn="{StaticResource {x:Type DataGridColumnHeader}}" TargetType="{x:Type DataGridColumnHeader}"> - <Setter Property="Background" Value="{StaticResource TangoDarkForegroundBrush}" /> - <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}" /> - <Setter Property="Padding" Value="5"></Setter> - </Style> - </DataGrid.Resources> - <DataGrid.RowStyle> - <Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}"> - <Style.Triggers> - <Trigger Property="IsSelected" Value="True"> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}" /> - </Trigger> - <Trigger Property="IsFocused" Value="True"> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}" /> - </Trigger> - </Style.Triggers> - </Style> - </DataGrid.RowStyle> - <DataGrid.CellStyle> - <Style TargetType="{x:Type DataGridCell}"> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="{x:Type DataGridCell}"> - <Grid Background="{TemplateBinding Background}"> - <ContentPresenter VerticalAlignment="Center" /> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - <Style.Triggers> - <Trigger Property="IsSelected" Value="True"> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}" /> - </Trigger> - </Style.Triggers> - </Style> - </DataGrid.CellStyle> - <DataGrid.Columns> - <DataGridTemplateColumn Header="" Width="50"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <touch:TouchIcon Width="16" Icon="Bridge" /> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTextColumn Header="App ID" Width="130" Binding="{Binding LoginInfo.AppID}" /> - <DataGridTextColumn Header="User" Width="180" Binding="{Binding LoginInfo.UserName}" /> - <DataGridTextColumn Header="Host Name" Width="180" Binding="{Binding LoginInfo.HostName}" /> - <DataGridTextColumn Header="Safety Level Permissions" Width="1*" Binding="{Binding LoginInfo.RequireSafetyLevelOperations,Converter={StaticResource BooleanToYesNoConverter}}" /> - </DataGrid.Columns> - </touch:TouchSimpleDataGrid> - </DockPanel> - </Grid> - </Grid> - </Grid> -</UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/RemoteConnectionsView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/RemoteConnectionsView.xaml.cs deleted file mode 100644 index 5d8e32444..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/RemoteConnectionsView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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.PPC.Technician.Views -{ - /// <summary> - /// Interaction logic for RemoteConnectionsView.xaml - /// </summary> - public partial class RemoteConnectionsView : UserControl - { - public RemoteConnectionsView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml index 52abfc239..f2bfcdf7d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml @@ -8,10 +8,9 @@ xmlns:vm="clr-namespace:Tango.PPC.Technician.ViewModels" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" - xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:global="clr-namespace:Tango.PPC.Technician" mc:Ignorable="d" - d:DesignHeight="1260" d:DesignWidth="600" d:DataContext="{d:DesignInstance Type=vm:SystemViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.SystemViewVM}" x:Name="view"> + d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:SystemViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.SystemViewVM}" x:Name="view"> <UserControl.Resources> <converters:ByteArrayToFileSizeConverter x:Key="ByteArrayToFileSizeConverter" /> @@ -30,283 +29,55 @@ <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">System</TextBlock> </Border> - <Grid Grid.Row="1"> + <Grid Grid.Row="1" Margin="20"> - <touch:LightTouchScrollViewer> - <DockPanel Margin="20"> - <StackPanel Margin="30 40 30 0" DockPanel.Dock="Bottom" VerticalAlignment="Center"> + <DockPanel> + <UniformGrid DockPanel.Dock="Top" Columns="3" Margin="50" TextElement.FontSize="{StaticResource TangoHeaderFontSize}"> + <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold"> + <Run>CPU:</Run> + <Run Text="{Binding CPU,Mode=OneWay,StringFormat='0'}"></Run><Run>%</Run> + </TextBlock> - <StackPanel.Resources> - <Style TargetType="touch:TouchButton" x:Key="ButtonMenu"> - <Setter Property="Padding" Value="10"></Setter> - <Setter Property="HorizontalContentAlignment" Value="Left"></Setter> - <Setter Property="Height" Value="100"></Setter> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="BorderBrush" Value="{StaticResource TangoDarkForegroundBrush}"></Setter> - <Setter Property="BorderThickness" Value="1"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoDarkForegroundBrush}"></Setter> - <Setter Property="EnableDropShadow" Value="False"></Setter> - <Setter Property="CornerRadius" Value="5"></Setter> - <Setter Property="Margin" Value="0 0 0 20"></Setter> - <Setter Property="RippleBrush" Value="#4BB8B8B8"></Setter> - </Style> - </StackPanel.Resources> + <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold"> + <Run>RAM:</Run> + <Run Text="{Binding RAM,Mode=OneWay,Converter={StaticResource ByteArrayToFileSizeConverter},StringFormat='0'}"></Run> + </TextBlock> - <touch:TouchButton Command="{Binding ResetDeviceCommand}" Style="{StaticResource ButtonMenu}"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="../Images/circuit-board.png" Width="60" Height="60" /> - <StackPanel Margin="10 0 0 0"> - <TextBlock FontSize="{StaticResource TangoButtonFontSize}">Reset Embedded Device</TextBlock> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}"> - Resets the embedded device using the DFU channel. - </TextBlock> - </StackPanel> - </StackPanel> - </touch:TouchButton> - - <touch:TouchButton Command="{Binding RestartCommand}" Style="{StaticResource ButtonMenu}"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="../Images/mobile-phone.png" Width="60" Height="60" /> - <StackPanel Margin="10 0 0 0"> - <TextBlock FontSize="{StaticResource TangoButtonFontSize}">Restart Panel PC</TextBlock> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}"> - Restarts the panel PC operation system. - </TextBlock> - </StackPanel> - </StackPanel> - </touch:TouchButton> - <touch:TouchButton Command="{Binding ShutdownCommand}" Style="{StaticResource ButtonMenu}"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="../Images/shutdown.png" Width="60" Height="60" /> - <StackPanel Margin="10 0 0 0"> - <TextBlock FontSize="{StaticResource TangoButtonFontSize}">Shutdown Panel PC</TextBlock> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}"> - Turns off the panel PC (requires turning on from reset button). - </TextBlock> - </StackPanel> - </StackPanel> - </touch:TouchButton> - <touch:TouchButton Command="{Binding FactoryResetCommand}" Style="{StaticResource ButtonMenu}"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="../Images/conveyor.png" Width="60" Height="60" /> - <StackPanel Margin="10 0 0 0"> - <TextBlock FontSize="{StaticResource TangoButtonFontSize}">Factory Reset</TextBlock> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}"> - Removes all data associated with this machine and installs the latest version. - </TextBlock> - </StackPanel> - </StackPanel> - </touch:TouchButton> - <touch:TouchButton Command="{Binding ExitToExplorerCommand}" Style="{StaticResource ButtonMenu}"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <Image Source="../Images/exit.png" Width="60" Height="60" /> - <StackPanel Margin="10 0 0 0"> - <TextBlock FontSize="{StaticResource TangoButtonFontSize}">Exit To Shell</TextBlock> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}"> - Closes the PPC application and opens the windows shell. - </TextBlock> - </StackPanel> - </StackPanel> - </touch:TouchButton> - </StackPanel> - - <FlowDocumentScrollViewer VerticalScrollBarVisibility="Disabled"> - <FlowDocument> - <Table CellSpacing="0" FontFamily="{StaticResource TangoFlexoFontFamily}"> - <Table.Resources> - <Style TargetType="{x:Type TableRowGroup}"> - <Setter Property="FontSize" Value="{StaticResource TangoDefaultFontSize}"/> - </Style> - - <Style TargetType="TableCell"> - <Setter Property="BorderThickness" Value="0 0 0 1"></Setter> - <Setter Property="BorderBrush" Value="{StaticResource TangoGrayBrush}"></Setter> - <Setter Property="Padding" Value="5"></Setter> - </Style> - </Table.Resources> - <Table.Columns> - <TableColumn Width="160" /> - <TableColumn /> - <TableColumn /> - </Table.Columns> - - <TableRowGroup> - <TableRow> - <TableCell> - <Paragraph> - <TextBlock>Application Version:</TextBlock> - </Paragraph> - </TableCell> - - <TableCell> - <Paragraph> - <TextBlock Text="{Binding ApplicationManager.Version,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/> - </Paragraph> - </TableCell> - </TableRow> - - <TableRow> - <TableCell> - <Paragraph> - <TextBlock>Firmware Version:</TextBlock> - </Paragraph> - </TableCell> - - <TableCell> - <Paragraph> - <TextBlock Text="{Binding MachineProvider.MachineOperator.DeviceInformation.Version,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/> - </Paragraph> - </TableCell> - </TableRow> - - <TableRow> - <TableCell> - <Paragraph> - <TextBlock>FPGA 1:</TextBlock> - </Paragraph> - </TableCell> - - <TableCell> - <Paragraph> - <TextBlock Text="{Binding MachineProvider.MachineOperator.DeviceInformation.FPGA1Version,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/> - </Paragraph> - </TableCell> - </TableRow> - - <TableRow> - <TableCell> - <Paragraph> - <TextBlock>FPGA 2:</TextBlock> - </Paragraph> - </TableCell> + <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold"> + <Run>TEMP:</Run> + <Run Text="{Binding Temperature,Mode=OneWay,StringFormat='0 °C'}"></Run> + </TextBlock> + </UniformGrid> - <TableCell> - <Paragraph> - <TextBlock Text="{Binding MachineProvider.MachineOperator.DeviceInformation.FPGA2Version,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/> - </Paragraph> - </TableCell> - </TableRow> + <DockPanel> - <TableRow> - <TableCell> - <Paragraph> - <TextBlock>FPGA 3:</TextBlock> - </Paragraph> - </TableCell> + <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center"> + <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold" FontSize="{StaticResource TangoHeaderFontSize}"> + <Run>UP TIME:</Run> + <Run Text="{Binding UpTime,StringFormat=hh\\:mm\\:ss,FallbackValue='00:00:00'}"></Run> + </TextBlock> - <TableCell> - <Paragraph> - <TextBlock Text="{Binding MachineProvider.MachineOperator.DeviceInformation.FPGA3Version,Mode=OneWay,TargetNullValue='N/A',FallbackValue='N/A'}"/> - </Paragraph> - </TableCell> - </TableRow> - - <TableRow> - <TableCell> - <Paragraph> - <TextBlock>CPU:</TextBlock> - </Paragraph> - </TableCell> - - <TableCell> - <Paragraph> - <TextBlock> - <Run Text="{Binding CPU,Mode=OneWay,StringFormat='0',FallbackValue=0}"></Run> - <Run>%</Run> - </TextBlock> - </Paragraph> - </TableCell> - </TableRow> - - <TableRow> - <TableCell> - <Paragraph> - <TextBlock>RAM:</TextBlock> - </Paragraph> - </TableCell> - - <TableCell> - <Paragraph> - <TextBlock Text="{Binding RAM,Mode=OneWay,FallbackValue=0,Converter={StaticResource ByteArrayToFileSizeConverter},StringFormat='0'}"></TextBlock> - </Paragraph> - </TableCell> - </TableRow> - - <TableRow> - <TableCell> - <Paragraph> - <TextBlock>Temperature:</TextBlock> - </Paragraph> - </TableCell> - - <TableCell> - <Paragraph> - <TextBlock Text="{Binding Temperature,Mode=OneWay,FallbackValue=0,StringFormat='0 °C'}"></TextBlock> - </Paragraph> - </TableCell> - </TableRow> - - <TableRow> - <TableCell> - <Paragraph> - <TextBlock>Up Time:</TextBlock> - </Paragraph> - </TableCell> - - <TableCell> - <Paragraph> - <TextBlock Text="{Binding UpTime,Mode=OneWay,StringFormat=hh\\:mm\\:ss,FallbackValue='00:00:00'}"></TextBlock> - </Paragraph> - </TableCell> - </TableRow> - - <TableRow> - <TableCell> - <Paragraph> - <TextBlock>IP Address:</TextBlock> - </Paragraph> - </TableCell> - - <TableCell> - <Paragraph> - <TextBlock Text="{Binding IPAddress,Mode=OneWay,FallbackValue=0}"></TextBlock> - </Paragraph> - </TableCell> - </TableRow> - - <TableRow> - <TableCell> - <Paragraph> - <TextBlock>Total Dye Time:</TextBlock> - </Paragraph> - </TableCell> - - <TableCell> - <Paragraph> - <TextBlock Text="{Binding TotalDyeTime,Mode=OneWay,FallbackValue=0}"></TextBlock> - </Paragraph> - </TableCell> - </TableRow> - - <TableRow> - <TableCell> - <Paragraph> - <TextBlock>Total Dye Meters:</TextBlock> - </Paragraph> - </TableCell> + <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontWeight="SemiBold" FontSize="{StaticResource TangoHeaderFontSize}"> + <Run>IP ADDRESS:</Run> + <Run Text="{Binding IPAddress}"></Run> + </TextBlock> + </StackPanel> - <TableCell> - <Paragraph> - <TextBlock Text="{Binding TotalDyeMeters,Mode=OneWay,FallbackValue=0}"></TextBlock> - </Paragraph> - </TableCell> - </TableRow> - </TableRowGroup> - </Table> - </FlowDocument> - </FlowDocumentScrollViewer> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="300" TextElement.FontSize="{StaticResource TangoTitleFontSize}"> + <touch:TouchButton Command="{Binding ResetDeviceCommand}" Height="60" Content="Reset Machine"> + <touch:TouchButton.Style> + <Style TargetType="touch:TouchButton" BasedOn="{StaticResource {x:Type touch:TouchButton}}"> + <Setter Property="Background" Value="{StaticResource TangoErrorBrush}"></Setter> + </Style> + </touch:TouchButton.Style> + </touch:TouchButton> + <touch:TouchButton Command="{Binding RestartCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Restart Device</touch:TouchButton> + <touch:TouchButton Command="{Binding ShutdownCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Shutdown Device</touch:TouchButton> + <touch:TouchButton Command="{Binding FactoryResetCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Factory Reset</touch:TouchButton> + <touch:TouchButton Command="{Binding ExitToExplorerCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Exit To Shell</touch:TouchButton> + </StackPanel> </DockPanel> - </touch:LightTouchScrollViewer> + </DockPanel> </Grid> </Grid> </UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/UpdatesView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/UpdatesView.xaml deleted file mode 100644 index 501632bfa..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/UpdatesView.xaml +++ /dev/null @@ -1,160 +0,0 @@ -<UserControl x:Class="Tango.PPC.Technician.Views.UpdatesView" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - 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:local="clr-namespace:Tango.PPC.Technician.Views" - xmlns:sys="clr-namespace:System;assembly=mscorlib" - xmlns:vm="clr-namespace:Tango.PPC.Technician.ViewModels" - xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" - xmlns:converters="clr-namespace:Tango.PPC.Technician.Converters" - xmlns:global="clr-namespace:Tango.PPC.Technician" - mc:Ignorable="d" - d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:UpdatesViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.UpdatesViewVM}"> - - <UserControl.Resources> - <converters:LogItemMessageToOneLineConverter x:Key="LogItemMessageToOneLineConverter" /> - </UserControl.Resources> - - <Grid Background="{StaticResource TangoMidBackgroundBrush}"> - <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="1*"/> - </Grid.RowDefinitions> - - <Border Padding="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}"> - <Border.Effect> - <DropShadowEffect Color="Silver" ShadowDepth="0" BlurRadius="20" Opacity="1" /> - </Border.Effect> - <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Updates & Synchronization</TextBlock> - </Border> - - <Grid Grid.Row="1" Margin="15"> - - <DockPanel> - <touch:TouchNavigationLinks x:Name="nav" DockPanel.Dock="Top" FontSize="{StaticResource TangoTitleFontSize}"> - <sys:String>Updates</sys:String> - <sys:String>Synchronization</sys:String> - </touch:TouchNavigationLinks> - <TabControl Padding="0" BorderThickness="0" Margin="0 10 0 0" Background="Transparent" SelectedIndex="{Binding ElementName=nav,Path=SelectedIndex,Mode=OneWay}"> - <TabItem Visibility="Collapsed" Header="Software Updates"> - <touch:TouchSimpleDataGrid Style="{StaticResource TechGrid}" ItemsSource="{Binding Updates}" SelectedItem="{Binding SelectedUpdate}"> - <DataGrid.Columns> - <DataGridTemplateColumn Header="" Width="50"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <touch:TouchIcon Width="16"> - <touch:TouchIcon.Style> - <Style TargetType="touch:TouchIcon"> - <Setter Property="Icon" Value="Pause"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsSetup}" Value="True"> - <Setter Property="Icon" Value="Settings"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsUpdate}" Value="True"> - <Setter Property="Icon" Value="CloudDownload"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsDataBase}" Value="True"> - <Setter Property="Icon" Value="Database"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsSynchronization}" Value="True"> - <Setter Property="Icon" Value="Sync"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsOfflineUpdate}" Value="True"> - <Setter Property="Icon" Value="Sd"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsOfflineFirmwareUpgrade}" Value="True"> - <Setter Property="Icon" Value="Chip"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsStarted}" Value="True"> - <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsCompleted}" Value="True"> - <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsFailed}" Value="True"> - <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </touch:TouchIcon.Style> - </touch:TouchIcon> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTextColumn Header="Date" Width="120" Binding="{Binding StartDate,Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" /> - <DataGridTextColumn Header="Application" Width="120" Binding="{Binding ApplicationVersion}" /> - <DataGridTextColumn Header="Firmware" Width="120" Binding="{Binding FirmwareVersion}" /> - <DataGridTemplateColumn Header="Message" Width="1*"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <TextBlock Text="{Binding UpdateStatus,Converter={StaticResource EnumToDescriptionConverter}}"/> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - </DataGrid.Columns> - </touch:TouchSimpleDataGrid> - </TabItem> - <TabItem Visibility="Collapsed" Header="Synchronization"> - <DockPanel> - <DockPanel DockPanel.Dock="Bottom"> - <DockPanel Margin="20"> - <touch:TouchButton IsEnabled="{Binding MachineDataSynchronizer.IsEnabled}" DockPanel.Dock="Right" Padding="50 20" CornerRadius="30" Command="{Binding SynchronizeCommand}">Synchronize Now</touch:TouchButton> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" VerticalAlignment="Center" TextWrapping="Wrap" Margin="0 0 20 0">Synchronization occurres automatically in the background. You can choose to synchronize now.</TextBlock> - </DockPanel> - </DockPanel> - - <Grid> - <touch:TouchSimpleDataGrid Style="{StaticResource TechGrid}" ItemsSource="{Binding MachineDataSynchronizer.StatusHistory}" SelectedItem="{Binding SelectedSynchronization}"> - <DataGrid.Columns> - <DataGridTemplateColumn Header="" Width="50"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <touch:TouchIcon Width="16"> - <touch:TouchIcon.Style> - <Style TargetType="touch:TouchIcon"> - <Setter Property="Icon" Value="Pause"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding State}" Value="Pending"> - <Setter Property="Icon" Value="Pause"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoGrayBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding State}" Value="Synchronizing"> - <Setter Property="Icon" Value="CloudSync"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding State}" Value="Failed"> - <Setter Property="Icon" Value="Alert"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding State}" Value="Completed"> - <Setter Property="Icon" Value="Check"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoGreenBrush}"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </touch:TouchIcon.Style> - </touch:TouchIcon> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTextColumn Header="Start Time" Width="120" Binding="{Binding StartDateTime,StringFormat=t}" /> - <DataGridTextColumn Header="Status" Width="120" Binding="{Binding State,Converter={StaticResource EnumToDescriptionConverter}}" /> - <DataGridTextColumn Header="Duration" Width="120" Binding="{Binding Duration,StringFormat='hh\\:mm\\:ss'}" /> - <DataGridTemplateColumn Header="Message" Width="1*"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <TextBlock Text="{Binding Message,Converter={StaticResource StringEllipsisConverter},ConverterParameter='70',Mode=OneWay}"/> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - </DataGrid.Columns> - </touch:TouchSimpleDataGrid> - </Grid> - </DockPanel> - </TabItem> - </TabControl> - </DockPanel> - </Grid> - </Grid> -</UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/UpdatesView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/UpdatesView.xaml.cs deleted file mode 100644 index cdac5cbbb..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/UpdatesView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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.PPC.Technician.Views -{ - /// <summary> - /// Interaction logic for UpdatesView.xaml - /// </summary> - public partial class UpdatesView : UserControl - { - public UpdatesView() - { - InitializeComponent(); - } - } -} |
