diff options
Diffstat (limited to 'UVtools.Core/Operations/OperationFlip.cs')
-rw-r--r-- | UVtools.Core/Operations/OperationFlip.cs | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/UVtools.Core/Operations/OperationFlip.cs b/UVtools.Core/Operations/OperationFlip.cs index 5381d1b..26fbf18 100644 --- a/UVtools.Core/Operations/OperationFlip.cs +++ b/UVtools.Core/Operations/OperationFlip.cs @@ -87,6 +87,14 @@ namespace UVtools.Core.Operations } #endregion + #region Constructor + + public OperationFlip() { } + + public OperationFlip(FileFormat slicerFile) : base(slicerFile) { } + + #endregion + #region Equality protected bool Equals(OperationFlip other) @@ -113,24 +121,22 @@ namespace UVtools.Core.Operations #endregion #region Methods - public override bool Execute(FileFormat slicerFile, OperationProgress progress = null) + protected override bool ExecuteInternally(OperationProgress progress) { - progress ??= new OperationProgress(); - progress.Reset(ProgressAction, LayerRangeCount); Parallel.For(LayerIndexStart, LayerIndexEnd + 1, layerIndex => { if (progress.Token.IsCancellationRequested) return; - using var mat = slicerFile[layerIndex].LayerMat; + using var mat = SlicerFile[layerIndex].LayerMat; Execute(mat); - slicerFile[layerIndex].LayerMat = mat; + SlicerFile[layerIndex].LayerMat = mat; lock (progress.Mutex) { progress++; } }); - progress.Token.ThrowIfCancellationRequested(); - return true; + + return !progress.Token.IsCancellationRequested; } public override bool Execute(Mat mat, params object[] arguments) |