aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-06-01 15:48:54 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-06-01 15:48:54 +0300
commit218794a0207ccb6e89a9a3c7175180001ae03740 (patch)
tree7c6e9bf38dc959f890dbb6f9a985d76b94fc4164 /Software/Visual_Studio/PPC/Modules
parenta0640910b61e0f38ede0c70e92997bc6d2717282 (diff)
downloadTango-218794a0207ccb6e89a9a3c7175180001ae03740.tar.gz
Tango-218794a0207ccb6e89a9a3c7175180001ae03740.zip
PPC. GUI bugs,.
Related Work Items: #8497, #8509, #8512
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs52
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml22
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml23
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml2
4 files changed, 71 insertions, 28 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs
index df3ae4596..e5e41b382 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs
@@ -225,6 +225,11 @@ namespace Tango.PPC.Jobs.ViewModels
/// </summary>
public RelayCommand ExportJobCommand { get; set; }
+ /// <summary>
+ /// Gets or sets the move to list ( History or Draft) jobs command.
+ /// </summary>
+ public RelayCommand MoveToListJobsCommand { get; set; }
+
#endregion
#region Constructors
@@ -251,6 +256,7 @@ namespace Tango.PPC.Jobs.ViewModels
DeleteJobsCommand = new RelayCommand(() => DeleteJobs(SelectedJobs));
CloneJobsCommand = new RelayCommand(() => CloneJobs(SelectedJobs));
ExportJobCommand = new RelayCommand(ExportJob);
+ MoveToListJobsCommand = new RelayCommand(() => MoveToListJobs(SelectedJobs));
RegisterForMessage<JobRemovedMessage>(HandleJobRemovedMessage);
RegisterForMessage<JobSavedMessage>(HandleJobSavedMessage);
@@ -644,6 +650,52 @@ namespace Tango.PPC.Jobs.ViewModels
}
/// <summary>
+ /// Moves to list (Draft/History) jobs.
+ /// </summary>
+ /// <param name="jobs">The jobs.</param>
+ private async void MoveToListJobs(ObservableCollection<Job> jobs)
+ {
+ bool isHistory = SelectedCategory == JobsCategory.History;
+ string list = isHistory ? "Draft" : "History";
+ try
+ {
+
+ LogManager.Log($"Move To {list} selected jobs:\n{jobs.Select(x => x.Name).ToList().ToJsonString()}");
+
+ foreach (var job in SelectedJobs)
+ {
+ if(isHistory)
+ {
+ if(job.JobStatus != JobStatuses.Draft)
+ {
+ job.JobStatus = JobStatuses.Draft;
+ job.LastUpdated = DateTime.UtcNow;
+ }
+ }
+ if(!isHistory)//draft
+ {
+ if(job.JobStatus == JobStatuses.Draft)
+ {
+ job.JobStatus = JobStatuses.Completed;
+ job.LastUpdated = DateTime.UtcNow;
+ }
+ }
+ }
+
+ await _db.SaveChangesAsync();
+
+ HistoryJobsCollectionView.Refresh();
+ DraftJobsCollectionView.Refresh();
+ ClearSelection();
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, $"Error Move To {list} selected jobs.");
+ await NotificationProvider.ShowError($"An error occurred while trying to Move To {list} the selected jobs.");
+ }
+ }
+
+ /// <summary>
/// Called when the search filter has been changed
/// </summary>
private void OnFilterChanged()
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml
index a92c950ed..613200c02 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml
@@ -259,7 +259,7 @@
<touch:TouchNumericTextBox Margin="20 0 0 0" Width="192" FocusSelectionMode="SelectAll" HorizontalAlignment="Left" HideUnderline="True" VerticalAlignment="Center"
Value="{Binding Length, UpdateSourceTrigger=LostFocus}" VerticalContentAlignment="Center"
StringFormat="0.0" AutoCalculateJogStep="False"
- HasDecimalPoint="True" Minimum="1" Maximum="100000"
+ HasDecimalPoint="True" Minimum="1" Maximum="1000000"
KeyboardContainer="{Binding ElementName=Container}"
FontSize="18" ValueChangedEnd="Length_ValueChanged"
TextGotFocus="Length_BeforeChangeValue" RippleBrush="Transparent"/>
@@ -268,7 +268,7 @@
<touch:TouchNumericTextBox Margin="20 0 0 0" Width="192" FocusSelectionMode="SelectAll" HorizontalAlignment="Left" HideUnderline="True" VerticalAlignment="Center"
Value="{Binding Weight, UpdateSourceTrigger=LostFocus}" VerticalContentAlignment="Center"
StringFormat="0.0" AutoCalculateJogStep="False"
- HasDecimalPoint="True" Minimum="0" Maximum="1000"
+ HasDecimalPoint="True" Minimum="0" Maximum="100000"
KeyboardContainer="{Binding ElementName=Container}"
FontSize="18" RippleBrush="Transparent"/>
</Border>
@@ -887,14 +887,14 @@
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Margin="0 10 0 0" Text="Copies" FontSize="{StaticResource TangoButtonFontSize}" Width="145"/>
<Border Margin="20 0 0 0" BorderThickness="1" Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Width="120">
- <touch:TouchNumericTextBox BorderBrush="Transparent" HasDecimalPoint="False" Minimum="4" Step="4" Margin="0 0 0 0" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Value="{Binding JobModel.Copies}" HideUnderline="True" RippleBrush="Transparent"></touch:TouchNumericTextBox>
+ <touch:TouchNumericTextBox BorderBrush="Transparent" HasDecimalPoint="False" Minimum="4" Maximum="1000000" Step="4" Margin="0 0 0 0" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Value="{Binding JobModel.Copies}" HideUnderline="True" RippleBrush="Transparent"></touch:TouchNumericTextBox>
</Border>
</StackPanel>
</DockPanel>
<StackPanel Orientation="Horizontal" Margin="60 0 60 20" Visibility="{Binding IsBasicMode, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
- <TextBlock HorizontalAlignment="Left" Margin="0 10 0 0" Text="White Gap (m)" FontSize="{StaticResource TangoButtonFontSize}" Width="145"/>
+ <TextBlock HorizontalAlignment="Left" Margin="0 10 0 0" Text="White Gap(m)" FontSize="{StaticResource TangoButtonFontSize}" Width="145"/>
<Border Margin="20 0 0 0" BorderThickness="1" Height="44" CornerRadius="12" BorderBrush="{StaticResource TangoMidAccentBrush}" Width="120">
<touch:TouchNumericTextBox BorderBrush="Transparent" HasDecimalPoint="False" Minimum="0" Margin="0 0 0 0" FontSize="{StaticResource TangoComboBoxItemFontSize}" VerticalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Value="{Binding JobModel.InterSegmentLength}" HideUnderline="True" RippleBrush="Transparent"></touch:TouchNumericTextBox>
@@ -1030,7 +1030,7 @@
<touch:TouchNumericTextBox Margin="20 0 0 0" Width="192" FocusSelectionMode="SelectAll" HorizontalAlignment="Left" HideUnderline="True" VerticalAlignment="Center"
Value="{Binding Length, UpdateSourceTrigger=LostFocus}" VerticalContentAlignment="Center"
StringFormat="0.0" AutoCalculateJogStep="False"
- HasDecimalPoint="True" Minimum="1" Maximum="100000"
+ HasDecimalPoint="True" Minimum="1" Maximum="1000000"
KeyboardContainer="{Binding ElementName=Container}"
FontSize="18" ValueChangedEnd="Length_ValueChanged"
TextGotFocus="Length_BeforeChangeValue" RippleBrush="Transparent"/>
@@ -1040,7 +1040,7 @@
<touch:TouchNumericTextBox Margin="20 0 0 0" Width="192" FocusSelectionMode="SelectAll" HorizontalAlignment="Left" HideUnderline="True" VerticalAlignment="Center"
Value="{Binding Weight, UpdateSourceTrigger=LostFocus}" VerticalContentAlignment="Center"
StringFormat="0.0" AutoCalculateJogStep="False"
- HasDecimalPoint="True" Minimum="0" Maximum="1000"
+ HasDecimalPoint="True" Minimum="0" Maximum="100000"
KeyboardContainer="{Binding ElementName=Container}"
FontSize="18" RippleBrush="Transparent"/>
@@ -1193,7 +1193,7 @@
<touch:TouchExpander x:Name="summaryExpander" IsExpanded="{Binding IsSummaryOpened, Mode=TwoWay}" Grid.Row="3" Margin="15 0 15 0 " FontSize="{StaticResource TangoTitleFontSize}" BorderThickness="0" Style="{StaticResource TouchRoundedExpander}" CornerRadius="20 20 0 0" Padding="10" IsTabStop="False" >
<touch:TouchExpander.Header>
<DockPanel Height="84">
- <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 20 0" VerticalAlignment="Center" >
+ <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0" VerticalAlignment="Center" >
<StackPanel Orientation="Horizontal" Visibility="{Binding IsSummaryOpened, Converter={StaticResource BooleanToVisibilityInverseConverter}, Mode=TwoWay}">
<TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
<Run Text="Copy:" FontWeight="Normal"></Run>
@@ -1212,12 +1212,12 @@
</Run>
<Run Text="g" FontWeight="DemiBold"></Run>
</TextBlock>
- <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
+ <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
<Run Text="Total:" FontWeight="Normal"></Run>
<Run Text="{Binding JobModel.LengthIncludingNumberOfUnitsAndSpools,Mode=OneWay, StringFormat=0.##}" FontWeight="Bold"/>
<Run Text="m" FontWeight="Bold"></Run>
</TextBlock>
- <TextBlock VerticalAlignment="Center" Margin="20 0 0 0" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}">
+ <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="{StaticResource TangoTitleFontSize}" Visibility="{Binding IsWeightView, Converter={StaticResource BooleanToVisibilityConverter}}">
<Run Text="Total:" FontWeight="Normal"></Run>
<Run FontWeight="Bold">
<Run.Text>
@@ -1230,7 +1230,7 @@
<Run Text="g" FontWeight="Bold"></Run>
</TextBlock>
</StackPanel>
- <TextBlock Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" FontWeight="Bold" Foreground="{StaticResource TangoDarkForegroundBrush}">
+ <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" FontWeight="Bold" Foreground="{StaticResource TangoDarkForegroundBrush}">
<Run Text="Duration: " FontWeight="Normal"></Run>
<Run Text="{Binding JobModel.GetEstimatedDuration, Converter={StaticResource TimeSpanToTwoDigitsTimeConverter}, FallbackValue=0, Mode=OneWay}"></Run>
<Run Text="{Binding JobModel.GetEstimatedDuration, Converter={StaticResource TimeSpanToLabelConverter}, FallbackValue=min, Mode=OneWay}"></Run>
@@ -1238,7 +1238,7 @@
</StackPanel>
<StackPanel DockPanel.Dock="Left" Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}">
<Image Source="../Images/JobView/job-summary.png" Width="39" />
- <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Job Summary</TextBlock>
+ <TextBlock FontWeight="Medium" Margin="10 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Summary</TextBlock>
</StackPanel>
</DockPanel>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml
index 5a64922af..d396b5860 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml
@@ -91,26 +91,17 @@
</Style.Triggers>
</Style>
</StackPanel.Style>
- <touch:TouchIconButton Command="{Binding ClearSelectionCommand}" Visibility="{Binding IsMultiSelecting,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 0 30 0" Padding="20" Icon="Undo">
+ <touch:TouchIconButton Command="{Binding ClearSelectionCommand}" Visibility="{Binding IsMultiSelecting,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 0 30 0" Padding="20" Icon="Close" Width="50" Height="50" Style="{StaticResource TangoRoundTouchIconButton}">
+
+ </touch:TouchIconButton>
+ <touch:TouchIconButton Command="{Binding MoveToListJobsCommand}" Margin="0 0 30 0" Padding="20" >
<touch:TouchIconButton.Style>
<Style TargetType="touch:TouchIconButton" BasedOn="{StaticResource TangoRoundTouchIconButton}">
<Setter Property="IconAngle" Value="0"></Setter>
+ <Setter Property="Icon" Value="Redo"/>
<Style.Triggers>
- <DataTrigger Binding="{Binding IsMultiSelecting}" Value="True">
- <DataTrigger.EnterActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetProperty="IconAngle" To="360" Duration="00:00:0.2"></DoubleAnimation>
- </Storyboard>
- </BeginStoryboard>
- </DataTrigger.EnterActions>
- <DataTrigger.ExitActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetProperty="IconAngle" To="0" Duration="00:00:00"></DoubleAnimation>
- </Storyboard>
- </BeginStoryboard>
- </DataTrigger.ExitActions>
+ <DataTrigger Binding="{Binding SelectedCategoryIndex}" Value="1">
+ <Setter Property="Icon" Value="Undo"/>
</DataTrigger>
</Style.Triggers>
</Style>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml
index 6475869dd..764f044d0 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml
@@ -461,7 +461,7 @@
</DockPanel>
<DockPanel Margin="0 20 0 0" TextElement.FontSize="{StaticResource TangoDefaultFontSize}">
- <TextBlock VerticalAlignment="Center">Show advanced options (Multi-segments &amp; Gradients) in the Job Editor</TextBlock>
+ <TextBlock VerticalAlignment="Center">Show advanced options (Segments &amp; Gradients) in the Job Editor</TextBlock>
<touch:TouchToggleSlider IsChecked="{Binding Settings.ShowAdvancedOptions}" Margin="0 0 100 0" DockPanel.Dock="Right" Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Width="90"></touch:TouchToggleSlider>
</DockPanel>