aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2023-07-27 04:09:45 +0300
committerRoy <Roy.mail.net@gmail.com>2023-07-27 04:09:45 +0300
commitd9d009df1da8630ec6726ed506865ca9818d1eff (patch)
tree46db9f8310e8525e51f6ac1865fe622da61b966b
parent3038323fb9bb7f37bf0cb35f3b7e08adae075b99 (diff)
downloadTango-d9d009df1da8630ec6726ed506865ca9818d1eff.tar.gz
Tango-d9d009df1da8630ec6726ed506865ca9818d1eff.zip
More advanced job resume.
-rw-r--r--Software/DB/PPC/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/PPC/Tango_log.ldfbin53673984 -> 53673984 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs27
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml11
-rw-r--r--Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs19
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs2
6 files changed, 42 insertions, 17 deletions
diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf
index 863af7f7b..8d93f58ca 100644
--- a/Software/DB/PPC/Tango.mdf
+++ b/Software/DB/PPC/Tango.mdf
Binary files differ
diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf
index 1a3467c1a..aa85e4615 100644
--- a/Software/DB/PPC/Tango_log.ldf
+++ b/Software/DB/PPC/Tango_log.ldf
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs
index 65ffca36a..46898210e 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs
@@ -101,7 +101,7 @@ namespace Tango.PPC.Jobs.ViewModels
public bool CanEdit
{
- get { return !MachineProvider.MachineOperator.IsPrinting || MachineProvider.MachineOperator.RunningJob == null || MachineProvider.MachineOperator.RunningJob.Guid != Job.Guid; }
+ get { return (!MachineProvider.MachineOperator.IsPrinting || MachineProvider.MachineOperator.RunningJob == null || MachineProvider.MachineOperator.RunningJob.Guid != Job.Guid) && !HasResumeModel; }
}
private ICollectionView _segmentsCollectionView;
@@ -291,7 +291,7 @@ namespace Tango.PPC.Jobs.ViewModels
public JobResumeModel ResumeModel
{
get { return _resumeModel; }
- set { _resumeModel = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasResumeModel)); }
+ set { _resumeModel = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasResumeModel)); RaisePropertyChanged(nameof(CanEdit)); }
}
public bool HasResumeModel
@@ -355,6 +355,8 @@ namespace Tango.PPC.Jobs.ViewModels
public RelayCommand NavigateBackToJobs { get; set; }
+ public RelayCommand DropResumeCommand { get; set; }
+
#endregion
#region collapsed mode commands
@@ -427,6 +429,8 @@ namespace Tango.PPC.Jobs.ViewModels
CopyCommand = new RelayCommand(Copy);
UndoCommand = new RelayCommand(Undo);//(x) => { return UndoRedoManager.Instance.IsEnableUndoOperation(); }
RedoCommand = new RelayCommand(Redo);//(x) => { return UndoRedoManager.Instance.IsEnableRedoOperation();}
+ DropResumeCommand = new RelayCommand(DropResume);
+
NavigateBackToJobs = new RelayCommand(NavigateBack);
IsFullMode = true;
@@ -537,7 +541,7 @@ namespace Tango.PPC.Jobs.ViewModels
RaisePropertyChanged(nameof(SelectedRML));
await LoadRML(_selectedRML);
- if(BuildProvider.IsEureka && Job.Segments.Count == 1 && Job.Segments[0].BrushStops.Count == 1)
+ if (BuildProvider.IsEureka && Job.Segments.Count == 1 && Job.Segments[0].BrushStops.Count == 1)
{
IsBasicMode = true;
}
@@ -1780,7 +1784,10 @@ namespace Tango.PPC.Jobs.ViewModels
RaisePropertyChanged(nameof(CanEdit));
- UpdateJobResume(e);
+ if (BuildProvider.IsEureka)
+ {
+ UpdateJobResume(e);
+ }
}
@@ -1839,6 +1846,18 @@ namespace Tango.PPC.Jobs.ViewModels
}
}
+ private async void DropResume()
+ {
+ if (Job != null && HasResumeModel)
+ {
+ if (await NotificationProvider.ShowQuestion("Drop resume information and enable job editing?"))
+ {
+ JobResumeDB.Default.Delete(Job.Guid);
+ ResumeModel = null;
+ }
+ }
+ }
+
#endregion
}
}
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 aa54beb9a..811bd5c9a 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
@@ -823,13 +823,13 @@
</UserControl.Resources>
- <Grid Background="{StaticResource TangoMidBackgroundBrush}" SnapsToDevicePixels="False" IsEnabled="{Binding CanEdit}">
+ <Grid Background="{StaticResource TangoMidBackgroundBrush}" SnapsToDevicePixels="False">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
- <touch:TouchLoadingPanel x:Name="GeneralSettings" Grid.Row="1" IsLoading="{Binding IsBusy}" Margin="10 7 10 0">
+ <touch:TouchLoadingPanel x:Name="GeneralSettings" Grid.Row="1" IsLoading="{Binding IsBusy}" Margin="10 7 10 0" IsEnabled="{Binding CanEdit}">
<Border Grid.Row="1" x:Name="jobDetailsBorder" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="2" BorderBrush="{StaticResource TangoLightBorderBrush}" Margin="0 7 0 7">
<Grid x:Name="job_details" HorizontalAlignment="Stretch" >
@@ -943,7 +943,7 @@
</Border>
</touch:TouchLoadingPanel>
- <touch:TouchLoadingPanel Grid.Row="2" IsLoading="{Binding IsBusy}" >
+ <touch:TouchLoadingPanel Grid.Row="2" IsLoading="{Binding IsBusy}" IsEnabled="{Binding CanEdit}">
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
@@ -1348,7 +1348,7 @@
</Style>
</touch:TouchIconButton.Style>
</touch:TouchIconButton>-->
- <touch:TouchTextBox Margin="20 6 240 0" Text="{Binding JobModel.Name,FallbackValue='Job Name'}" ToolTip="{Binding JobModel.Name}" VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold"></touch:TouchTextBox>
+ <touch:TouchTextBox IsEnabled="{Binding CanEdit}" Margin="20 6 240 0" Text="{Binding JobModel.Name,FallbackValue='Job Name'}" ToolTip="{Binding JobModel.Name}" VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold"></touch:TouchTextBox>
<!--<touch:TouchButton Margin="0 0 0 0" VerticalAlignment="Center" Width="50" Height="50" HorizontalAlignment="Left" EnableDropShadow="False" Background="Transparent" BorderThickness="0" Command="{Binding EditJobDetailsCommand}" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"
components:TransformationHelper.TransformWhenPressed ="False">
<Border Height="24" Width="24" Margin="0 0 0 0" BorderThickness="0" Background="Transparent" HorizontalAlignment="Center">
@@ -1370,6 +1370,9 @@
</Style>
</touch:TouchButton.Style>
</touch:TouchButton>
+ <touch:TouchIconButton Visibility="{Binding HasResumeModel,Converter={StaticResource BooleanToVisibilityConverter}}" Icon="DeleteSweep" VerticalAlignment="Center" BorderThickness="0 0 1 0" BorderBrush="White" Height="55" Canvas.Left="-75" Canvas.Top="10" Background="{StaticResource TangoMidAccentBrush}" Padding="15" Width="100" CornerRadius="30 0 0 30" BlurRadius="10" EnableDropShadow="False" Command="{Binding DropResumeCommand}">
+
+ </touch:TouchIconButton>
</Canvas>
</Grid>
</Border>
diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
index 01a32b2b7..9464b37ec 100644
--- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
+++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
@@ -846,15 +846,10 @@ namespace Tango.Emulations.Emulators
//TODO Handle First Unit Length Decrease In Emulator!
double firstUnitStartPosition = request.Message.FirstUnitStartPosition;
+ bool addedResume = firstUnitStartPosition <= 0;
+
for (int i = 0; i < units; i++)
{
- //double unit_length = job.Length;
-
- if (i == 0 && firstUnitStartPosition > 0)
- {
- unit_length = unit_length - firstUnitStartPosition;
- }
-
while (progress < unit_length + (i == units - 1 ? dryerLength : 0) && !_cancelJob)
{
var status = new PMR.Printing.JobStatus();
@@ -886,7 +881,15 @@ namespace Tango.Emulations.Emulators
}
}
- progress += Math.Min((centimeter_per_second / 1000d), (unit_length + (i == units - 1 ? dryerLength : 0)) - progress);
+ if (addedResume)
+ {
+ progress += Math.Min((centimeter_per_second / 1000d), (unit_length + (i == units - 1 ? dryerLength : 0)) - progress);
+ }
+ else
+ {
+ addedResume = true;
+ progress = firstUnitStartPosition;
+ }
double currentPosition = 0;
double nextStopPosition = unit_length;
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
index 0112f944d..20c56bb41 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
@@ -3252,7 +3252,7 @@ namespace Tango.Integration.Operation
if (config.ResumeConfig != null)
{
- resumePreProgress = config.ResumeConfig.GlobalStartPosition;
+ resumePreProgress = config.ResumeConfig.GlobalStartPosition - request.FirstUnitStartPosition;
request.FirstUnitStartPosition = config.ResumeConfig.FirstUnitStartPosition;
request.JobTicket.NumberOfUnits = (uint)Math.Max(config.ResumeConfig.RemainingUnits, 1);
}