diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
11 files changed, 136 insertions, 17 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Converters/MachineEventToViewConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Converters/MachineEventToViewConverter.cs index 47c9e0ddf..6981bd5d6 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Converters/MachineEventToViewConverter.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Converters/MachineEventToViewConverter.cs @@ -22,6 +22,7 @@ namespace Tango.PPC.Events.Converters _eventViews.Add(EventTypes.JOB_ABORTED, typeof(JobEventView)); _eventViews.Add(EventTypes.JOB_COMPLETED, typeof(JobEventView)); _eventViews.Add(EventTypes.JOB_FAILED, typeof(JobEventView)); + _eventViews.Add(EventTypes.THREAD_BREAK, typeof(ThreadBreakView)); } public object Convert(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/ThreadBreakView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/ThreadBreakView.xaml new file mode 100644 index 000000000..71c4ced07 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/ThreadBreakView.xaml @@ -0,0 +1,26 @@ +<UserControl x:Class="Tango.PPC.Events.EventsViews.ThreadBreakView" + 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:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:local="clr-namespace:Tango.PPC.Events.EventsViews" + mc:Ignorable="d" + d:DesignHeight="220" d:DesignWidth="750" d:DataContext="{d:DesignInstance Type=entities:MachinesEvent, IsDesignTimeCreatable=False}"> + <Grid Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <DockPanel> + <Image Stretch="None" Margin="20" DockPanel.Dock="Right" Source="../Images/machine_small.png" RenderOptions.BitmapScalingMode="Fant" /> + <DockPanel Margin="35 20 20 20"> + <TextBlock FontSize="{StaticResource TangoTitleFontSize}" FontWeight="SemiBold" DockPanel.Dock="Top" Text="{Binding EventType.Title,FallbackValue='Unknown Event'}"></TextBlock> + + <StackPanel Margin="0 30 0 0"> + <TextBlock TextWrapping="Wrap" FontWeight="SemiBold" Text="{Binding EventType.Description,FallbackValue='No Description'}"></TextBlock> + <Rectangle Margin="0 5 0 10" StrokeThickness="2" Stroke="{StaticResource TangoDividerBrush}" /> + + <touch:TouchButton x:Name="btnLoadThreadBreakWizard" Margin="0 10 0 0" Height="55" Style="{StaticResource TangoHollowButton}" Width="280" HorizontalAlignment="Left">LOAD THREAD BREAK WIZARD</touch:TouchButton> + </StackPanel> + </DockPanel> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/ThreadBreakView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/ThreadBreakView.xaml.cs new file mode 100644 index 000000000..7e8337514 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/ThreadBreakView.xaml.cs @@ -0,0 +1,49 @@ +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; +using Tango.Core.DI; +using Tango.PPC.Common.ThreadLoading; + +namespace Tango.PPC.Events.EventsViews +{ + /// <summary> + /// Interaction logic for ThreadBreakView.xaml + /// </summary> + public partial class ThreadBreakView : UserControl + { + public ThreadBreakView() + { + InitializeComponent(); + + btnLoadThreadBreakWizard.Click += BtnLoadThreadBreakWizard_Click; + } + + private void BtnLoadThreadBreakWizard_Click(object sender, RoutedEventArgs e) + { + try + { + var threadLoadingService = TangoIOC.Default.GetInstance<IThreadLoadingService>(); + + if (threadLoadingService != null) + { + threadLoadingService.StartThreadBreakWizard(); + } + } + catch (Exception ex) + { + Logging.LogManager.Default.Log(ex, "Error loading the thread break wizard."); + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj index e2133e585..e8d4683ee 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Tango.PPC.Events.csproj @@ -76,6 +76,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="EventsViews\ThreadBreakView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Resources\Styles.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -98,6 +102,9 @@ <Compile Include="EventsViews\JobEventView.xaml.cs"> <DependentUpon>JobEventView.xaml</DependentUpon> </Compile> + <Compile Include="EventsViews\ThreadBreakView.xaml.cs"> + <DependentUpon>ThreadBreakView.xaml</DependentUpon> + </Compile> <Compile Include="Properties\AssemblyInfo.cs"> <SubType>Code</SubType> </Compile> @@ -180,7 +187,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs index a6ccad7de..64931cbe3 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs @@ -809,7 +809,7 @@ namespace Tango.PPC.Jobs.ViewModels { var jobFile = await job.ToJobFile(); - using (FileStream fs = new FileStream(Path.Combine(result.Path, jobFile.Name) + ExplorerFileDefinition.Job.Extension, FileMode.Create)) + using (FileStream fs = new FileStream(Path.Combine(result.Path, jobFile.Name.ToValidFileName()) + ExplorerFileDefinition.Job.Extension, FileMode.Create)) { jobFile.WriteTo(fs); } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/thread_loading.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/thread_loading.png Binary files differnew file mode 100644 index 000000000..5d536e7ae --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/thread_loading.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj index 94dc4e2cb..f334dac5b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj @@ -300,10 +300,13 @@ <Resource Include="Images\Waste\present_empty_right.png" /> <Resource Include="Images\Waste\present_full_right.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\thread_loading.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs index 9de8313f8..c8cb4415d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs @@ -106,6 +106,8 @@ namespace Tango.PPC.Maintenance.ViewModels public RelayCommand StartThreadLoadingCommand { get; set; } + public RelayCommand StartThreadBreakCommand { get; set; } + public MaintenanceViewVM() { Guides = new ObservableCollection<GuideBase>(GuideHelper.CreateAllGuides()); @@ -119,7 +121,8 @@ namespace Tango.PPC.Maintenance.ViewModels OpenCloseRightLeadingWheelsCommand = new OpenCloseRightLeadingWheelsCommand(); ResetThreadLoadingCommand = new ResetThreadLoadingCommand(); HeadCleaningCommand = new RelayCommand(PerformHeadCleaning, () => MachineProvider.MachineOperator.CanPrint); - StartThreadLoadingCommand = new RelayCommand(StartThreadLoading, () => MachineProvider.MachineOperator.CanPrint); + StartThreadLoadingCommand = new RelayCommand(StartThreadLoadingWizard, () => MachineProvider.MachineOperator.CanPrint); + StartThreadBreakCommand = new RelayCommand(StartThreadBreakWizard, () => MachineProvider.MachineOperator.CanPrint); WasteStates = new List<WasteStateModel>() { @@ -282,9 +285,14 @@ namespace Tango.PPC.Maintenance.ViewModels await NotificationProvider.ShowDialog<HeadCleaningViewVM>(); } - private void StartThreadLoading() + private void StartThreadLoadingWizard() + { + ThreadLoadingService.StartThreadLoadingWizard(); + } + + private void StartThreadBreakWizard() { - ThreadLoadingService.StartThreadLoading(); + ThreadLoadingService.StartThreadBreakWizard(); } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml index 188983b3f..a24d336ee 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml @@ -12,7 +12,7 @@ xmlns:localControls="clr-namespace:Tango.PPC.Maintenance.Controls" xmlns:local="clr-namespace:Tango.PPC.Maintenance.Views" mc:Ignorable="d" - d:DesignHeight="1380" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MaintenanceViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MaintenanceViewVM}"> + d:DesignHeight="1800" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MaintenanceViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MaintenanceViewVM}"> <UserControl.Resources> @@ -252,18 +252,46 @@ <localControls:ButtonState Value="Opened" Content="CLOSE DYEING HEAD LID" /> </localControls:StateTouchButton> - <touch:TouchButton Margin="20" CornerRadius="25" Height="50" FontSize="18" Style="{StaticResource TangoHollowButton}" Command="{Binding ResetThreadLoadingCommand.Command}">RESET THREAD LOADING</touch:TouchButton> - <touch:TouchButton Margin="20" CornerRadius="25" Height="50" FontSize="18" Style="{StaticResource TangoHollowButton}" Command="{Binding HeadCleaningCommand}">RUN HEAD CLEANING</touch:TouchButton> - <touch:TouchButton Margin="20" CornerRadius="25" Height="50" FontSize="18" Style="{StaticResource TangoHollowButton}" Command="{Binding StartThreadLoadingCommand}">THREAD LOADING WIZARD</touch:TouchButton> - <touch:TouchButton Margin="20" CornerRadius="25" Height="50" FontSize="18" Style="{StaticResource TangoHollowButton}" Command="{Binding ExportLogsCommand}" Visibility="{Binding ApplicationManager.IsInTechnicianMode,Converter={StaticResource BooleanToVisibilityConverter}}">EXPORT SYSTEM LOGS</touch:TouchButton> </UniformGrid> </StackPanel> </StackPanel> </touch:TouchDropShadowBorder> + <!--THREAD LOADING--> + <touch:TouchDropShadowBorder Margin="0 20 0 0" Padding="0 0 0 50" MinHeight="330"> + <StackPanel> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> + <Image Source="../Images/thread_loading.png" Width="48" RenderOptions.BitmapScalingMode="Fant" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Thread Loading</TextBlock> + </StackPanel> + + <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> + <UniformGrid Columns="1" Margin="0 0" HorizontalAlignment="Left"> + <StackPanel Margin="20"> + <touch:TouchButton Width="280" HorizontalAlignment="Left" CornerRadius="25" Height="50" FontSize="18" Style="{StaticResource TangoHollowButton}" Command="{Binding StartThreadBreakCommand}">THREAD BREAK WIZARD</touch:TouchButton> + <DockPanel Margin="15 10 0 0" TextElement.Foreground="{StaticResource TangoGrayTextBrush}" HorizontalAlignment="Left"> + <touch:TouchIcon Icon="InformationOutline" Width="14" Height="18" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0" FontSize="{StaticResource TangoSmallFontSize}">This wizard will help you resolve thread breaking issues</TextBlock> + </DockPanel> + </StackPanel> + + <StackPanel Margin="20"> + <touch:TouchButton Width="280" HorizontalAlignment="Left" CornerRadius="25" Height="50" FontSize="18" Style="{StaticResource TangoHollowButton}" Command="{Binding StartThreadLoadingCommand}">THREAD LOADING WIZARD</touch:TouchButton> + <DockPanel Margin="15 10 0 0" TextElement.Foreground="{StaticResource TangoGrayTextBrush}" HorizontalAlignment="Left"> + <touch:TouchIcon Icon="InformationOutline" Width="14" Height="18" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0" FontSize="{StaticResource TangoSmallFontSize}">This wizard will help you load a new thread in to the system</TextBlock> + </DockPanel> + </StackPanel> + + <touch:TouchButton Width="280" HorizontalAlignment="Left" Margin="20" CornerRadius="25" Height="50" FontSize="18" Style="{StaticResource TangoHollowButton}" Command="{Binding ResetThreadLoadingCommand.Command}">RESET THREAD LOADING</touch:TouchButton> + </UniformGrid> + </StackPanel> + </StackPanel> + </touch:TouchDropShadowBorder> + <!--GUIDES--> <touch:TouchDropShadowBorder Margin="0 20 0 0" Padding="0 0 0 50"> <StackPanel> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs index b9d59334c..9b22fcdb5 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs @@ -22,7 +22,6 @@ namespace Tango.PPC.Storage.ViewModels { private bool _allow_exit; private ExplorerFileItem _selectedItem; - private static char[] _invalidChars = System.IO.Path.GetInvalidFileNameChars(); private String _currentPath; public String CurrentPath @@ -238,10 +237,7 @@ namespace Tango.PPC.Storage.ViewModels if (text != null) { - foreach (var c in _invalidChars) - { - text = text.Replace(c.ToString(), ""); - } + text = text.ToValidFileName(); _fileName = text; RaisePropertyChanged(nameof(FileName)); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml index e8d402d89..c57735a7b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/Views/MainView.xaml @@ -112,7 +112,8 @@ <Setter Property="EnableMultiSelect" Value="True"></Setter> </DataTrigger> <DataTrigger Binding="{Binding Request.Intent}" Value="LoadFile"> - <Setter Property="EnableFileSelection" Value="False"></Setter> + <Setter Property="EnableFileSelection" Value="True"></Setter> + <Setter Property="EnableMultiSelect" Value="False"></Setter> </DataTrigger> </Style.Triggers> </Style> |
