diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-18 12:45:43 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-18 12:45:43 +0200 |
| commit | 0c7904ace0b17162b4b1c47ab157d085e73e0e15 (patch) | |
| tree | a40d1f0f2b4ec0b2931956830c079af170238e40 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer | |
| parent | 858a2b114f78c87883510e3627874c7632f81177 (diff) | |
| download | Tango-0c7904ace0b17162b4b1c47ab157d085e73e0e15.tar.gz Tango-0c7904ace0b17162b4b1c47ab157d085e73e0e15.zip | |
More work on new developer module..
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer')
9 files changed, 620 insertions, 422 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Navigation/DeveloperNavigationView.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Navigation/DeveloperNavigationView.cs index 90548d1b4..6d1c6669e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Navigation/DeveloperNavigationView.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Navigation/DeveloperNavigationView.cs @@ -9,6 +9,7 @@ namespace Tango.MachineStudio.Developer.Navigation public enum DeveloperNavigationView { MachineJobSelectionView, - JobView + JobView, + RunningJobView } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj index 1291fb0cd..086d6cd91 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj @@ -31,6 +31,12 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> + <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll</HintPath> + </Reference> + <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll</HintPath> + </Reference> <Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL"> <HintPath>..\..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath> </Reference> @@ -56,6 +62,7 @@ <HintPath>..\..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath> </Reference> <Reference Include="System" /> + <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Data" /> <Reference Include="System.Reactive.Core, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> <HintPath>..\..\..\packages\System.Reactive.Core.3.1.1\lib\net46\System.Reactive.Core.dll</HintPath> @@ -132,6 +139,9 @@ <Compile Include="..\..\..\Versioning\GlobalVersionInfo.cs"> <Link>GlobalVersionInfo.cs</Link> </Compile> + <Compile Include="Views\RunningJobView.xaml.cs"> + <DependentUpon>RunningJobView.xaml</DependentUpon> + </Compile> <Page Include="Controls\IOMonitorControl.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -156,6 +166,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Views\RunningJobView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> </ItemGroup> <ItemGroup> <Compile Include="Properties\AssemblyInfo.cs"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 267f0bb0c..2e5d42296 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -48,6 +48,8 @@ namespace Tango.MachineStudio.Developer.ViewModels private int _fullScreenGraphIndex; private JobHandler _jobHandler; private DeveloperNavigationManager _navigation; + private ObservablesContext _dbJobContext; + private Job _jobFromList; #region Properties @@ -399,9 +401,14 @@ namespace Tango.MachineStudio.Developer.ViewModels public RelayCommand RemoveBrushStopCommand { get; set; } /// <summary> - /// Gets or sets the save jobs command. + /// Gets or sets the save job command. /// </summary> - public RelayCommand SaveJobsCommand { get; set; } + public RelayCommand SaveJobCommand { get; set; } + + /// <summary> + /// Gets or sets the discard job command. + /// </summary> + public RelayCommand DiscardJobCommand { get; set; } /// <summary> /// Gets or sets the start job command. @@ -478,7 +485,8 @@ namespace Tango.MachineStudio.Developer.ViewModels RemoveJobCommand = new RelayCommand(RemoveJob, () => SelectedJob != null); AddBrushStopCommand = new RelayCommand(AddBrushStop, () => SelectedSegment != null); RemoveBrushStopCommand = new RelayCommand(RemoveBrushStop, () => SelectedBrushStop != null); - SaveJobsCommand = new RelayCommand(SaveJobs, () => SelectedMachine != null); + SaveJobCommand = new RelayCommand(SaveJob, () => SelectedMachine != null); + DiscardJobCommand = new RelayCommand(DiscardJob, () => SelectedMachine != null); StartJobCommand = new RelayCommand(StartJob, () => SelectedJob != null && !IsJobRunning); StopJobCommand = new RelayCommand(StopJob, () => IsJobRunning); CloseJobCompletionStatusCommand = new RelayCommand(CloseJobCompletionStatusBar); @@ -615,22 +623,53 @@ namespace Tango.MachineStudio.Developer.ViewModels #region Private Methods - private void LoadJob() + private async void LoadJob() { if (SelectedJob != null) { - Task.Factory.StartNew(() => + using (_notification.PushTaskItem("Loading job details...")) { - SelectedSegment = SelectedJob.Segments.FirstOrDefault(); + await Task.Factory.StartNew(() => + { + _dbJobContext = ObservablesContext.CreateDefault(); - SelectedJob.LengthChanged -= SelectedJob_LengthChanged; - SelectedJob.LengthChanged += SelectedJob_LengthChanged; + _jobFromList = SelectedJob; + SelectedJob = _dbJobContext.Jobs.SingleOrDefault(x => x.Guid == SelectedJob.Guid); + SelectedRML = SelectedJob.Rml; - UpdateEstimatedDuration(); - }); + SelectedSegment = SelectedJob.Segments.FirstOrDefault(); - _navigation.NavigateTo(DeveloperNavigationView.JobView); + SelectedJob.LengthChanged -= SelectedJob_LengthChanged; + SelectedJob.LengthChanged += SelectedJob_LengthChanged; + + UpdateEstimatedDuration(); + }); + + _navigation.NavigateTo(DeveloperNavigationView.JobView); + } + } + } + private async void SaveJob() + { + if (SelectedJob != null) + { + using (_notification.PushTaskItem("Saving machine jobs...")) + { + SelectedJob.LastUpdated = DateTime.UtcNow; + SelectedJob.Rml = SelectedRML; + await _dbJobContext.SaveChangesAsync(); + await _jobFromList.Reload(); + } + } + } + + private void DiscardJob() + { + if (_notification.ShowQuestion("This will discard the current job changes. Are you sue?")) + { + _dbJobContext.Dispose(); + _navigation.NavigateTo(DeveloperNavigationView.MachineJobSelectionView); } } @@ -689,6 +728,7 @@ namespace Tango.MachineStudio.Developer.ViewModels private void CloseJobCompletionStatusBar() { + _navigation.NavigateTo(DeveloperNavigationView.JobView); IsJobCompleted = false; IsJobFailed = false; IsJobCanceled = false; @@ -723,6 +763,12 @@ namespace Tango.MachineStudio.Developer.ViewModels return; } + if (SelectedProcessParametersTable == null) + { + _notification.ShowError("No process parameters table selected. Could not execute the specified job."); + return; + } + RunningJobRemainingTime = TimeSpan.Zero; RunningJobProgress = 0; IsJobFailed = false; @@ -735,6 +781,8 @@ namespace Tango.MachineStudio.Developer.ViewModels RunningJobSegments = CreateRunningJobEffectiveSegments(RunningJob); + _navigation.NavigateTo(DeveloperNavigationView.RunningJobView); + _jobHandler = MachineOperator.Print(SelectedJob, SelectedProcessParametersTable); _jobHandler.StatusReceived += (x, status) => @@ -785,18 +833,6 @@ namespace Tango.MachineStudio.Developer.ViewModels }; } - private async void SaveJobs() - { - if (SelectedJob != null) - { - using (_notification.PushTaskItem("Saving machine jobs...")) - { - SelectedJob.CreationDate = DateTime.UtcNow; - await SelectedJob.SaveAsync(); - } - } - } - private void UpdateEstimatedDuration() { if (SelectedJob != null && SelectedProcessParametersTable != null && SelectedProcessParametersTable.DyeingSpeed > 0) @@ -957,7 +993,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { if (SelectedMachine != null) { - SelectedMachine.Jobs.Add(new Job() + SelectedMachine.Jobs.Add(new Job(DateTime.UtcNow) { Name = "Untitled Job", CreationDate = DateTime.UtcNow, @@ -1158,7 +1194,6 @@ namespace Tango.MachineStudio.Developer.ViewModels } SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedMachineGuid = SelectedMachine != null ? SelectedMachine.Guid : null; - SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedRMLGuid = SelectedRML != null ? SelectedRML.Guid : null; SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedJobGuid = SelectedJob != null ? SelectedJob.Guid : null; return Task.FromResult(true); @@ -1177,11 +1212,6 @@ namespace Tango.MachineStudio.Developer.ViewModels SelectedMachine = Adapter.Machines.SingleOrDefault(x => x.Guid == SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedMachineGuid); } - if (SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedRMLGuid != null) - { - SelectedRML = Adapter.Rmls.SingleOrDefault(x => x.Guid == SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedRMLGuid); - } - if (SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedJobGuid != null && SelectedMachine != null) { SelectedJob = SelectedMachine.Jobs.SingleOrDefault(x => x.Guid == SettingsManager.Default.MachineStudio.DeveloperModule.LastSelectedJobGuid); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/DeveloperView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/DeveloperView.xaml index 9a48f605b..5dbbde482 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/DeveloperView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/DeveloperView.xaml @@ -3,22 +3,413 @@ 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:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:localConverters="clr-namespace:Tango.MachineStudio.Developer.Converters" xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" xmlns:global="clr-namespace:Tango.MachineStudio.Developer" mc:Ignorable="d" d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + + <UserControl.Resources> + <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> + <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" /> + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + <converters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> + <localConverters:DbRmlViewToEntityConverter x:Key="DbRmlViewToEntityConverter"></localConverters:DbRmlViewToEntityConverter> + <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter"></converters:NullObjectToBooleanConverter> + <converters:GreaterThanToBooleanConverter x:Key="GreaterThanToBooleanConverter"></converters:GreaterThanToBooleanConverter> + <converters:SmallerThanToBooleanConverter x:Key="SmallerThanToBooleanConverter"></converters:SmallerThanToBooleanConverter> + <localConverters:BrushStopToColorConverter x:Key="BrushStopToColorConverter" /> + <localConverters:BrushStopCMYKToColorConverter x:Key="BrushStopCMYKToColorConverter" /> + <localConverters:BrushStopLabToColorConverter x:Key="BrushStopLabToColorConverter" /> + <localConverters:SegmentToGradientStopsConverter x:Key="SegmentToGradientStopsConverter" /> + <localConverters:BrushStopToOffsetLimitConverter x:Key="BrushStopToOffsetLimitConverter" /> + <localConverters:JobToColumnDefinitionsConverter x:Key="JobToColumnDefinitionsConverter" /> + <localConverters:SegmentLengthToWidthConverter x:Key="SegmentLengthToWidthConverter" /> + <localConverters:SegmentToGradientStopsConverterMulti x:Key="SegmentToGradientStopsConverterMulti" /> + <localConverters:SegmentToBrushConverter x:Key="SegmentToBrushConverter" /> + <localConverters:SegmentToBrushConverterMulti x:Key="SegmentToBrushConverterMulti" /> + <localConverters:ObjectsNotEqualToBooleanConveter x:Key="ObjectsNotEqualToBooleanConveter" /> + <localConverters:JobProgressToPositionConverter x:Key="JobProgressToPositionConverter" /> + <localConverters:BrushStopToOffsetValueConverter x:Key="BrushStopToOffsetValueConverter" /> + <converters:StringEllipsisConverter x:Key="StringEllipsisConverter" /> + + + <SolidColorBrush x:Key="SideBarBackground" Color="White"> + + </SolidColorBrush> + + <Color x:Key="dummyColor">Transparent</Color> + </UserControl.Resources> + + <Grid> - <controls:MultiTransitionControl x:Name="TransitionControl" TransitionType="Slide"> - <controls:MultiTransitionControl.Controls> - <ContentControl Tag="MachineJobSelectionView"> - <local:MachineJobSelectionView/> - </ContentControl> - <ContentControl Tag="JobView"> - <local:JobView/> - </ContentControl> - </controls:MultiTransitionControl.Controls> - </controls:MultiTransitionControl> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="1*" /> + </Grid.RowDefinitions> + + <StackPanel> + <Grid Background="#202020" TextElement.Foreground="Silver"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="LayoutTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="0" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding ShowJobStatus}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + <Border BorderBrush="#404040" BorderThickness="0 0 0 1" Padding="20"> + <DockPanel> + <Grid DockPanel.Dock="Left" MinWidth="190" VerticalAlignment="Center" Margin="0 0 0 0"> + <StackPanel Orientation="Vertical" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"> + <ProgressBar Foreground="#FF6464" Width="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="True" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" /> + <TextBlock Margin="0 10 0 0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" FontStyle="Italic" FontWeight="DemiBold" Foreground="#FF6464" TextWrapping="Wrap"> + <Run Text="Running '"></Run> + <Run Text="{Binding RunningJob.Name}"></Run> + <Run Text="'..."></Run> + </TextBlock> + </StackPanel> + </Grid> + <StackPanel DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0 20 0 0"> + <StackPanel Orientation="Horizontal"> + <TextBlock VerticalAlignment="Center" FontSize="30" FontFamily="{StaticResource digital-7}" Margin="0 0 40 0" Foreground="#FF6464" Width="100" Text="{Binding RunningJobRemainingTime,StringFormat=hh\\:mm\\:ss}"></TextBlock> + + <Button Height="40" Width="170" Command="{Binding StopJobCommand}" Background="#FF6464" BorderBrush="#FF6464"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="Stop" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">STOP</TextBlock> + </StackPanel> + </Button> + </StackPanel> + </StackPanel> + <Grid> + <Grid> + <Border Margin="0 10 0 0" VerticalAlignment="Bottom" Width="1200" BorderBrush="#404040" BorderThickness="0" ClipToBounds="False"> + <Grid ClipToBounds="False" > + + <ItemsControl ClipToBounds="False" x:Name="runningJobBrushList" ItemsSource="{Binding RunningJobSegments}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Grid ClipToBounds="False"> + <Grid.Width> + <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob.Length"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> + <Binding Path="Length"></Binding> + </MultiBinding> + </Grid.Width> + + <StackPanel Margin="0 0 0 0" ClipToBounds="False"> + + <StackPanel Margin="0 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center"> + <TextBlock Margin="0 0 0 0" FontSize="14" HorizontalAlignment="Right"> + <Run Text="{Binding Length,Mode=OneWay}"></Run> + <Run FontSize="12" Text="m"></Run> + </TextBlock> + <materialDesign:PackIcon HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" Kind="Triangle" Width="12" Height="12"> + <materialDesign:PackIcon.RenderTransform> + <RotateTransform Angle="180" /> + </materialDesign:PackIcon.RenderTransform> + </materialDesign:PackIcon> + </StackPanel> + + <Rectangle Height="30" Margin="0 10 0 0" VerticalAlignment="Center"> + <Rectangle.Fill> + <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}"> + <Binding Path="."></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob.Length"></Binding> + </MultiBinding> + </Rectangle.Fill> + </Rectangle> + + <Canvas Height="30" HorizontalAlignment="Center" Width="80"> + <Label Padding="0" Margin="0"> + <Label.Style> + <Style TargetType="Label"> + <Setter Property="Content" Value="{x:Null}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Started}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <TextBlock Text="{Binding RemainingTime,StringFormat=hh\\:mm\\:ss}" Foreground="#FF6464" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Margin="10" FontSize="20"></TextBlock> + </Setter.Value> + </Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Completed}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <materialDesign:PackIcon Margin="30 10 0 0" HorizontalAlignment="Center" Width="24" Height="24" Kind="Check" Foreground="#47FF00" /> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Label.Style> + </Label> + </Canvas> + </StackPanel> + + <Rectangle HorizontalAlignment="Right" Stroke="White" Margin="0 35 0 25"></Rectangle> + </Grid> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + + <StackPanel Margin="-40 -5 0 0" HorizontalAlignment="Left"> + <TextBlock FontSize="14"> + <Run Text="0"></Run> + <Run FontSize="13" Text="m"></Run> + </TextBlock> + <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="SubdirectoryArrowRight" Width="20" Height="20"> + + </materialDesign:PackIcon> + </StackPanel> + + <StackPanel Margin="0 -5 -40 0" HorizontalAlignment="Right"> + <TextBlock FontSize="14"> + <Run Text="{Binding RunningJob.Length,Mode=OneWay}"></Run> + <Run FontSize="13" Text="m"></Run> + </TextBlock> + <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="20" Height="20"> + + </materialDesign:PackIcon> + </StackPanel> + + <Border BorderBrush="#404040" BorderThickness="1" VerticalAlignment="Center" Height="30" Margin="0 11 0 0"> + + </Border> + + <Canvas x:Name="jobProgressCanvas"> + <Grid Canvas.Top="0"> + <Canvas.Left> + <MultiBinding Converter="{StaticResource JobProgressToPositionConverter}"> + <Binding Path="RunningJob" /> + <Binding Path="RunningJobProgress" /> + <Binding ElementName="jobProgressCanvas" Path="ActualWidth" /> + </MultiBinding> + </Canvas.Left> + <materialDesign:PackIcon Kind="MapMarker" Foreground="#FF6464" Width="35" Height="35" Margin="-17 0 0 0" /> + <TextBlock Margin="-11 -23 0 0" FontSize="16" Foreground="#FF6464" VerticalAlignment="Top" Height="18" Text="{Binding RunningJobProgress,StringFormat=0.0}"></TextBlock> + </Grid> + </Canvas> + </Grid> + </Border> + </Grid> + </Grid> + </DockPanel> + </Border> + + <ProgressBar IsIndeterminate="True" VerticalAlignment="Bottom" Height="3" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar> + </Grid> + + <Grid Background="#C1FFC7"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="LayoutTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="0" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsJobCompleted}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + + <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5"> + <DockPanel> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> + <materialDesign:PackIcon Kind="Check" Width="32" Height="32" VerticalAlignment="Center" /> + <TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Completed Successfully</TextBlock> + </StackPanel> + + <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0"> + <Button Height="20" Padding="0" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> + </StackPanel> + </Button> + </StackPanel> + + <Grid> + + </Grid> + </DockPanel> + </Border> + </Grid> + + <Grid Background="#FF8888"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="LayoutTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="0" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsJobFailed}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + + <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5"> + <DockPanel> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> + <materialDesign:PackIcon Kind="Alert" Width="32" Height="32" VerticalAlignment="Center" /> + <TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Failed To Complete</TextBlock> + </StackPanel> + + <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0"> + <!--<Button Height="40" Width="170" Command="{Binding ViewResultsCommand}" Background="#303030" BorderBrush="#202020"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="ChartLine" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">RESULTS</TextBlock> + </StackPanel> + </Button>--> + + <Button Padding="0" Height="20" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> + </StackPanel> + </Button> + </StackPanel> + + <Grid> + + </Grid> + </DockPanel> + </Border> + </Grid> + + <Grid Background="#FFE388"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="LayoutTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="0" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsJobCanceled}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + + <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5"> + <DockPanel> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> + <materialDesign:PackIcon Kind="Alert" Width="32" Height="32" VerticalAlignment="Center" /> + <TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Aborted By User</TextBlock> + </StackPanel> + + <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0"> + <Button Padding="0" Height="20" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> + </StackPanel> + </Button> + </StackPanel> + + <Grid> + + </Grid> + </DockPanel> + </Border> + </Grid> + </StackPanel> + + + <Grid Grid.Row="1"> + <controls:MultiTransitionControl x:Name="TransitionControl" TransitionType="Slide"> + <controls:MultiTransitionControl.Controls> + <ContentControl Tag="MachineJobSelectionView"> + <local:MachineJobSelectionView/> + </ContentControl> + <ContentControl Tag="JobView"> + <local:JobView/> + </ContentControl> + <ContentControl Tag="RunningJobView"> + <local:RunningJobView/> + </ContentControl> + </controls:MultiTransitionControl.Controls> + </controls:MultiTransitionControl> + </Grid> + </Grid> </Grid> </UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 17e0461e8..0568d5f60 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -154,16 +154,16 @@ </Style> <Style TargetType="Border" x:Key="JobFieldBorder"> - <Setter Property="BorderBrush" Value="{StaticResource SideBarBackground}"></Setter> - <Setter Property="BorderThickness" Value="0"></Setter> + <Setter Property="BorderBrush" Value="#A5A4A4"></Setter> + <Setter Property="BorderThickness" Value="0 0 1 1"></Setter> <Setter Property="CornerRadius" Value="100 10 100 0"></Setter> - <Setter Property="Padding" Value="10 5"></Setter> + <Setter Property="Padding" Value="10 5 10 5"></Setter> <Setter Property="Margin" Value="0 0 10 0"></Setter> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> - <GradientStop Color="#8EE6E6E6"/> - <GradientStop Color="White" Offset="1"/> + <GradientStop Color="#00E6E6E6"/> + <GradientStop Color="#DEDEDE" Offset="1"/> </LinearGradientBrush> </Setter.Value> </Setter> @@ -214,352 +214,6 @@ </UserControl.Resources> <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="1*" /> - </Grid.RowDefinitions> - - <StackPanel> - <Grid Background="#202020" TextElement.Foreground="Silver"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="LayoutTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="0" /> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding ShowJobStatus}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - <Border BorderBrush="#404040" BorderThickness="0 0 0 1" Padding="20"> - <DockPanel> - <Grid DockPanel.Dock="Left" MinWidth="190" VerticalAlignment="Center" Margin="0 0 0 0"> - <StackPanel Orientation="Vertical" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"> - <ProgressBar Foreground="#FF6464" Width="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="True" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" /> - <TextBlock Margin="0 10 0 0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" FontStyle="Italic" FontWeight="DemiBold" Foreground="#FF6464" TextWrapping="Wrap"> - <Run Text="Running '"></Run> - <Run Text="{Binding RunningJob.Name}"></Run> - <Run Text="'..."></Run> - </TextBlock> - </StackPanel> - </Grid> - <StackPanel DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0 20 0 0"> - <StackPanel Orientation="Horizontal"> - <TextBlock VerticalAlignment="Center" FontSize="30" FontFamily="{StaticResource digital-7}" Margin="0 0 40 0" Foreground="#FF6464" Width="100" Text="{Binding RunningJobRemainingTime,StringFormat=hh\\:mm\\:ss}"></TextBlock> - - <Button Height="40" Width="170" Command="{Binding StopJobCommand}" Background="#FF6464" BorderBrush="#FF6464"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="Stop" /> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">STOP</TextBlock> - </StackPanel> - </Button> - </StackPanel> - </StackPanel> - <Grid> - <Grid> - <Border Margin="0 10 0 0" VerticalAlignment="Bottom" Width="1200" BorderBrush="#404040" BorderThickness="0" ClipToBounds="False"> - <Grid ClipToBounds="False" > - - <ItemsControl ClipToBounds="False" x:Name="runningJobBrushList" ItemsSource="{Binding RunningJobSegments}"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <Grid ClipToBounds="False"> - <Grid.Width> - <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob.Length"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> - <Binding Path="Length"></Binding> - </MultiBinding> - </Grid.Width> - - <StackPanel Margin="0 0 0 0" ClipToBounds="False"> - - <StackPanel Margin="0 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center"> - <TextBlock Margin="0 0 0 0" FontSize="14" HorizontalAlignment="Right"> - <Run Text="{Binding Length,Mode=OneWay}"></Run> - <Run FontSize="12" Text="m"></Run> - </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" Kind="Triangle" Width="12" Height="12"> - <materialDesign:PackIcon.RenderTransform> - <RotateTransform Angle="180" /> - </materialDesign:PackIcon.RenderTransform> - </materialDesign:PackIcon> - </StackPanel> - - <Rectangle Height="30" Margin="0 10 0 0" VerticalAlignment="Center"> - <Rectangle.Fill> - <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}"> - <Binding Path="."></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob"></Binding> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob.Length"></Binding> - </MultiBinding> - </Rectangle.Fill> - </Rectangle> - - <Canvas Height="30" HorizontalAlignment="Center" Width="80"> - <Label Padding="0" Margin="0"> - <Label.Style> - <Style TargetType="Label"> - <Setter Property="Content" Value="{x:Null}"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Started}" Value="True"> - <Setter Property="Content"> - <Setter.Value> - <TextBlock Text="{Binding RemainingTime,StringFormat=hh\\:mm\\:ss}" Foreground="#FF6464" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Margin="10" FontSize="20"></TextBlock> - </Setter.Value> - </Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Completed}" Value="True"> - <Setter Property="Content"> - <Setter.Value> - <materialDesign:PackIcon Margin="30 10 0 0" HorizontalAlignment="Center" Width="24" Height="24" Kind="Check" Foreground="#47FF00" /> - </Setter.Value> - </Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </Label.Style> - </Label> - </Canvas> - </StackPanel> - - <Rectangle HorizontalAlignment="Right" Stroke="White" Margin="0 35 0 25"></Rectangle> - </Grid> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - - <StackPanel Margin="-40 -5 0 0" HorizontalAlignment="Left"> - <TextBlock FontSize="14"> - <Run Text="0"></Run> - <Run FontSize="13" Text="m"></Run> - </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="SubdirectoryArrowRight" Width="20" Height="20"> - - </materialDesign:PackIcon> - </StackPanel> - - <StackPanel Margin="0 -5 -40 0" HorizontalAlignment="Right"> - <TextBlock FontSize="14"> - <Run Text="{Binding RunningJob.Length,Mode=OneWay}"></Run> - <Run FontSize="13" Text="m"></Run> - </TextBlock> - <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="20" Height="20"> - - </materialDesign:PackIcon> - </StackPanel> - - <Border BorderBrush="#404040" BorderThickness="1" VerticalAlignment="Center" Height="30" Margin="0 11 0 0"> - - </Border> - - <Canvas x:Name="jobProgressCanvas"> - <Grid Canvas.Top="0"> - <Canvas.Left> - <MultiBinding Converter="{StaticResource JobProgressToPositionConverter}"> - <Binding Path="RunningJob" /> - <Binding Path="RunningJobProgress" /> - <Binding ElementName="jobProgressCanvas" Path="ActualWidth" /> - </MultiBinding> - </Canvas.Left> - <materialDesign:PackIcon Kind="MapMarker" Foreground="#FF6464" Width="35" Height="35" Margin="-17 0 0 0" /> - <TextBlock Margin="-11 -23 0 0" FontSize="16" Foreground="#FF6464" VerticalAlignment="Top" Height="18" Text="{Binding RunningJobProgress,StringFormat=0.0}"></TextBlock> - </Grid> - </Canvas> - </Grid> - </Border> - </Grid> - </Grid> - </DockPanel> - </Border> - - <ProgressBar IsIndeterminate="True" VerticalAlignment="Bottom" Height="3" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar> - </Grid> - - <Grid Background="#C1FFC7"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="LayoutTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="0" /> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsJobCompleted}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - - <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5"> - <DockPanel> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> - <materialDesign:PackIcon Kind="Check" Width="32" Height="32" VerticalAlignment="Center" /> - <TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Completed Successfully</TextBlock> - </StackPanel> - - <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0"> - <Button Height="20" Padding="0" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> - </StackPanel> - </Button> - </StackPanel> - - <Grid> - - </Grid> - </DockPanel> - </Border> - </Grid> - - <Grid Background="#FF8888"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="LayoutTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="0" /> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsJobFailed}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - - <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5"> - <DockPanel> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> - <materialDesign:PackIcon Kind="Alert" Width="32" Height="32" VerticalAlignment="Center" /> - <TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Failed To Complete</TextBlock> - </StackPanel> - - <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0"> - <!--<Button Height="40" Width="170" Command="{Binding ViewResultsCommand}" Background="#303030" BorderBrush="#202020"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="ChartLine" /> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">RESULTS</TextBlock> - </StackPanel> - </Button>--> - - <Button Padding="0" Height="20" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> - </StackPanel> - </Button> - </StackPanel> - - <Grid> - - </Grid> - </DockPanel> - </Border> - </Grid> - - <Grid Background="#FFE388"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="LayoutTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="0" /> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsJobCanceled}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - - <Border BorderBrush="#404040" BorderThickness="0 1 0 1" Padding="5"> - <DockPanel> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> - <materialDesign:PackIcon Kind="Alert" Width="32" Height="32" VerticalAlignment="Center" /> - <TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Aborted By User</TextBlock> - </StackPanel> - - <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0"> - <Button Padding="0" Height="20" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Foreground="#202020" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> - </StackPanel> - </Button> - </StackPanel> - - <Grid> - - </Grid> - </DockPanel> - </Border> - </Grid> - </StackPanel> - <Grid Grid.Row="1"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> @@ -667,8 +321,8 @@ </Polygon.Style> </Polygon> <Border Height="100" Padding="5"> - - <Grid> + + <Grid> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontStyle="Italic"> <Run>#</Run> <Run>SEGMENT</Run> @@ -686,8 +340,8 @@ </Rectangle> </Grid> - </Border> - + </Border> + </Grid> </DataTemplate> </ListBox.ItemTemplate> @@ -739,7 +393,7 @@ <Image Source="../Images/name.png" Width="32"></Image> <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Name</TextBlock> </StackPanel> - <TextBox Margin="0 3 0 0" Text="{Binding SelectedJob.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox> + <TextBox Margin="0 3 0 0" Width="100" HorizontalAlignment="Left" Text="{Binding SelectedJob.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox> </StackPanel> </Border> @@ -749,7 +403,7 @@ <Image Source="../Images/wind.png" Width="32"></Image> <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Winding Method</TextBlock> </StackPanel> - <ComboBox ItemsSource="{Binding Adapter.WindingMethods}" SelectedItem="{Binding SelectedJob.WindingMethod}" DisplayMemberPath="Name" ></ComboBox> + <ComboBox Width="90" HorizontalAlignment="Left" ItemsSource="{Binding Adapter.WindingMethods}" SelectedItem="{Binding SelectedJob.WindingMethod}" DisplayMemberPath="Name" ></ComboBox> </StackPanel> </Border> @@ -760,8 +414,8 @@ <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Inter Segment</TextBlock> </StackPanel> <DockPanel LastChildFill="True"> - <ToggleButton Margin="10 0 0 0" DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="{Binding SelectedJob.EnableInterSegment}"></ToggleButton> - <mahapps:NumericUpDown StringFormat="{}{0:N1} m" FontFamily="{StaticResource digital-7}" IsEnabled="{Binding SelectedJob.EnableInterSegment}" Margin="0 2 0 0" HideUpDownButtons="True" Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedJob.InterSegmentLength,Mode=TwoWay}"></mahapps:NumericUpDown> + <ToggleButton Margin="10 0 25 0" DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="{Binding SelectedJob.EnableInterSegment}"></ToggleButton> + <mahapps:NumericUpDown Width="70" HorizontalAlignment="Left" StringFormat="{}{0:N1} m" FontFamily="{StaticResource digital-7}" IsEnabled="{Binding SelectedJob.EnableInterSegment}" Margin="0 2 0 0" HideUpDownButtons="True" Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedJob.InterSegmentLength,Mode=TwoWay}"></mahapps:NumericUpDown> </DockPanel> </StackPanel> </Border> @@ -772,7 +426,7 @@ <Image Source="../Images/lubrication.png" Width="32"></Image> <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Lubrication</TextBlock> </StackPanel> - <DockPanel LastChildFill="True" Margin="0 10 0 0"> + <DockPanel LastChildFill="True" Margin="0 10 30 0"> <ToggleButton DockPanel.Dock="Right" VerticalAlignment="Center" HorizontalAlignment="Center" IsChecked="{Binding SelectedJob.EnableLubrication}"></ToggleButton> </DockPanel> </StackPanel> @@ -795,13 +449,21 @@ </StackPanel> - <Grid HorizontalAlignment="Right" Margin="0 0 100 0"> - <Button Height="80" Width="100" Margin="0 0 0 0" Style="{StaticResource MaterialDesignFlatButton}" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding SaveJobsCommand}"> - <StackPanel> - <materialDesign:PackIcon HorizontalAlignment="Center" Width="24" Height="24" Kind="ContentSave" /> - <TextBlock VerticalAlignment="Center" Margin="0 10 0 0">SAVE JOB</TextBlock> - </StackPanel> - </Button> + <Grid HorizontalAlignment="Right" Margin="0 0 10 0"> + <StackPanel Orientation="Horizontal"> + <Button Height="70" Width="135" Margin="0 0 10 0" Background="White" Foreground="#202020" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding DiscardJobCommand}"> + <StackPanel> + <materialDesign:PackIcon HorizontalAlignment="Center" Width="24" Height="24" Kind="KeyboardBackspace" /> + <TextBlock VerticalAlignment="Center" Margin="0 10 0 0">TO JOBS</TextBlock> + </StackPanel> + </Button> + <Button Height="70" Width="135" Margin="0 0 0 0" Background="White" Foreground="#202020" VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding SaveJobCommand}"> + <StackPanel> + <materialDesign:PackIcon HorizontalAlignment="Center" Width="24" Height="24" Kind="ContentSave" /> + <TextBlock VerticalAlignment="Center" Margin="0 10 0 0">SAVE JOB</TextBlock> + </StackPanel> + </Button> + </StackPanel> </Grid> </Grid> <Grid Grid.Row="1" Margin="0 20 0 0"> @@ -824,7 +486,7 @@ <Image Source="../Images/ruler.png" Width="32"></Image> <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Length</TextBlock> </StackPanel> - <mahapps:NumericUpDown FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N1} m" Margin="0 2 0 0" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedSegment.Length,Mode=TwoWay}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown HideUpDownButtons="True" Width="90" HorizontalAlignment="Left" FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N1} m" Margin="0 2 0 0" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedSegment.Length,Mode=TwoWay}"></mahapps:NumericUpDown> </StackPanel> </Border> @@ -850,22 +512,29 @@ </StackPanel> </Button> - - + + </StackPanel> </StackPanel> - + </Grid> + + + </StackPanel> + + <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal" Margin="0 40 40 0"> + <materialDesign:PackIcon Kind="ChevronLeft" Width="24" Height="24" /> + <TextBlock Margin="10 -2 10 0" VerticalAlignment="Center"><Run>RML LIQUID FACTORS</Run> <Run FontSize="10" Foreground="DimGray">( Max Nanolitter/CM )</Run></TextBlock> + <materialDesign:PackIcon Kind="ChevronRight" Width="24" Height="24" /> </StackPanel> <Grid HorizontalAlignment="Right" Margin="0 0 0 0"> <Grid> <DockPanel> <Grid> - <StackPanel HorizontalAlignment="Right" Margin="0 -20 0 0"> - <TextBlock Margin="20 0 0 0" ><Run>LIQUID FACTORS</Run> <Run FontSize="10" Foreground="DimGray">( Max Nanolitter/CM )</Run></TextBlock> + <StackPanel HorizontalAlignment="Right" Margin="0 0 0 0"> <StackPanel Margin="0 10 0 0" Orientation="Horizontal" VerticalAlignment="Center"> <ItemsControl ItemsSource="{Binding LiquidTypesRmls}"> <ItemsControl.ItemsPanel> @@ -903,7 +572,7 @@ </StackPanel> </StackPanel> - + </Grid> </DockPanel> </Grid> @@ -913,19 +582,19 @@ <Border DockPanel.Dock="Bottom" Margin="10"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> - <Button Command="{Binding DuplicateBrushStopCommand}" Margin="0 0 4 0" Background="#FF9A6A" BorderBrush="#FF9A6A" Height="42" Padding="10" ToolTip="Duplicate Segment"> + <Button Command="{Binding DuplicateBrushStopCommand}" Margin="0 0 4 0" Background="#FF9A6A" BorderBrush="#FF9A6A" Height="42" Padding="10"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="ContentCopy" Width="24" Height="24"></materialDesign:PackIcon> <TextBlock VerticalAlignment="Center">Duplicate</TextBlock> </StackPanel> </Button> - <Button Command="{Binding RemoveBrushStopCommand}" Margin="0 0 4 0" Background="#FF6A6A" BorderBrush="#FF6A6A" Height="42" Padding="10" ToolTip="Remove Segment"> + <Button Command="{Binding RemoveBrushStopCommand}" Margin="0 0 4 0" Background="#FF6A6A" BorderBrush="#FF6A6A" Height="42" Padding="10"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Delete" Width="24" Height="24"></materialDesign:PackIcon> <TextBlock VerticalAlignment="Center">Remove</TextBlock> </StackPanel> </Button> - <Button Command="{Binding AddBrushStopCommand}" Background="#68B367" BorderBrush="#68B367" Height="42" Padding="10" ToolTip="Add Segment"> + <Button Command="{Binding AddBrushStopCommand}" Background="#68B367" BorderBrush="#68B367" Height="42" Padding="10"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="24" Height="24"></materialDesign:PackIcon> <TextBlock VerticalAlignment="Center">New</TextBlock> @@ -934,7 +603,7 @@ </StackPanel> </Border> - <Grid Margin="0 20 0 0"> + <Grid Margin="0 40 0 0"> <DockPanel> <Grid DockPanel.Dock="Top"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> @@ -1141,7 +810,13 @@ <Image Source="../Images/colorspace.png" Width="24"></Image> <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Color Space</TextBlock> </StackPanel> - <ComboBox Background="#FCFCFC" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Adapter.ColorSpaces}" SelectedItem="{Binding ColorSpace}" DisplayMemberPath="Name"></ComboBox> + <ComboBox ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Adapter.ColorSpaces}" SelectedItem="{Binding ColorSpace}" DisplayMemberPath="Name"> + <ComboBox.ItemContainerStyle> + <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}"> + <Setter Property="Background" Value="#ECECEC"></Setter> + </Style> + </ComboBox.ItemContainerStyle> + </ComboBox> </StackPanel> </Border> </Grid> @@ -1162,7 +837,10 @@ <Run FontFamily="{StaticResource digital-7}" Text="{Binding OffsetPercent,StringFormat={}{0:F1}%}"></Run> <Run Foreground="Gray" Text="{Binding OffsetMeters,Mode=OneWay,StringFormat={} ( {0:F1}m )}"></Run> </TextBlock> - <Slider ValueChanged="Offset_Slider_ValueChanged" SmallChange="0.1" IsSnapToTickEnabled="True" TickFrequency="0.1" Margin="0 5 0 0" HorizontalAlignment="Center" Width="500" Value="{Binding OffsetPercent}" IsEnabled="{Binding IsMiddle}"> + <Slider ValueChanged="Offset_Slider_ValueChanged" Style="{StaticResource GradientOffsetSlider}" SmallChange="0.1" IsSnapToTickEnabled="True" TickFrequency="0.1" Margin="0 20 0 0" HorizontalAlignment="Center" Width="500" Value="{Binding OffsetPercent}" IsEnabled="{Binding IsMiddle}"> + <Slider.Foreground> + <SolidColorBrush Color="{Binding Color}"></SolidColorBrush> + </Slider.Foreground> <Slider.Minimum> <MultiBinding Converter="{StaticResource BrushStopToOffsetLimitConverter}" ConverterParameter="min"> <Binding Path="."></Binding> @@ -1390,7 +1068,7 @@ <TextBlock FontSize="16" Margin="0 0 0 0"> <Run FontWeight="Bold">ESTIMATED DURATION:</Run> <Run Foreground="Black" FontSize="22" FontStyle="Italic" FontFamily="{StaticResource digital-7}" Text="{Binding EstimatedDuration,StringFormat=hh\\:mm\\:ss,TargetNullValue='00:00:00'}"></Run> - </TextBlock> + </TextBlock> </Grid> <Grid DockPanel.Dock="Right" Margin="0 0 10 0"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml new file mode 100644 index 000000000..30941f3dd --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml @@ -0,0 +1,45 @@ +<UserControl x:Class="Tango.MachineStudio.Developer.Views.RunningJobView" + 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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" + xmlns:global="clr-namespace:Tango.MachineStudio.Developer" + xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" + mc:Ignorable="d" + d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + <Grid> + <Grid Margin="40"> + <DockPanel> + <StackPanel Margin="0 20 0 0" Orientation="Horizontal" DockPanel.Dock="Top"> + <materialDesign:PackIcon Kind="Settings" Width="60" Height="60" /> + <TextBlock FontSize="30" FontWeight="SemiBold" VerticalAlignment="Center" Margin="10 0 0 0">Job Status</TextBlock> + </StackPanel> + + <Grid DockPanel.Dock="Bottom" Height="40"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 0 0"> + <Button Command="{Binding ExportToExcelCommand}" Style="{StaticResource MaterialDesignFlatButton}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon VerticalAlignment="Center" Kind="FileExcel"></materialDesign:PackIcon> + <TextBlock Margin="10 0 0 0">EXPORT TO EXCEL</TextBlock> + </StackPanel> + </Button> + </StackPanel> + </Grid> + + <Grid> + <DataGrid Background="Transparent" Margin="0 20 0 0" BorderThickness="1" BorderBrush="Gainsboro"> + <DataGrid.Columns> + <DataGridTextColumn Width="Auto" Header="#"/> + <DataGridTextColumn Width="200" Header="TIME STAMP"/> + <DataGridTextColumn Width="100" Header="CODE"/> + <DataGridTextColumn Width="200" Header="NAME"/> + <DataGridTextColumn Width="1*" Header="DESCRIPTION"/> + </DataGrid.Columns> + </DataGrid> + </Grid> + </DockPanel> + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml.cs new file mode 100644 index 000000000..74ace554e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/RunningJobView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.Developer.Views +{ + /// <summary> + /// Interaction logic for RunningJobView.xaml + /// </summary> + public partial class RunningJobView : UserControl + { + public RunningJobView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/app.config index cacd4cd77..4a6cb0526 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/app.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/app.config @@ -1,5 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <configuration> + <configSections> + <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> + <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> + </configSections> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> @@ -8,4 +12,10 @@ </dependentAssembly> </assemblyBinding> </runtime> + <entityFramework> + <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> + <providers> + <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> + </providers> + </entityFramework> </configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/packages.config index 6c338d81b..7994d1504 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/packages.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/packages.config @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="CommonServiceLocator" version="1.3" targetFramework="net46" /> + <package id="EntityFramework" version="6.0.0" targetFramework="net46" /> <package id="Google.Protobuf" version="3.4.1" targetFramework="net46" /> <package id="MahApps.Metro" version="1.5.0" targetFramework="net46" /> <package id="MaterialDesignColors" version="1.1.2" targetFramework="net46" /> |
