diff options
author | Tiago Conceição <Tiago_caza@hotmail.com> | 2020-09-13 03:18:43 +0300 |
---|---|---|
committer | Tiago Conceição <Tiago_caza@hotmail.com> | 2020-09-13 03:18:43 +0300 |
commit | 9c421cc144b66d4c7e73e09f5f44e27358bc7eac (patch) | |
tree | 2eed390ea1ea1e52fe5b145e8c33632fcb90fbd1 /UVtools.GUI | |
parent | 12fc6dae7d1b3b471141ab2e070b460e7b1ad3e3 (diff) |
More abstraction
* (Add) Global print properties on formats for more internal abstraction
* (Improvement) Print properties performance internal code with abstraction
Diffstat (limited to 'UVtools.GUI')
-rw-r--r-- | UVtools.GUI/Controls/Tools/CtrlToolEditEditParameters.cs | 3 | ||||
-rw-r--r-- | UVtools.GUI/Forms/FrmToolWindow.cs | 4 | ||||
-rw-r--r-- | UVtools.GUI/FrmMain.cs | 25 |
3 files changed, 18 insertions, 14 deletions
diff --git a/UVtools.GUI/Controls/Tools/CtrlToolEditEditParameters.cs b/UVtools.GUI/Controls/Tools/CtrlToolEditEditParameters.cs index 228fcf0..0a93a3a 100644 --- a/UVtools.GUI/Controls/Tools/CtrlToolEditEditParameters.cs +++ b/UVtools.GUI/Controls/Tools/CtrlToolEditEditParameters.cs @@ -35,7 +35,6 @@ namespace UVtools.GUI.Controls.Tools public RowControl(FileFormat.PrintParameterModifier modifier) { Modifier = modifier; - modifier.OldValue = decimal.Parse(Program.SlicerFile.GetValueFromPrintParameterModifier(modifier).ToString()); Name = new Label { @@ -111,6 +110,8 @@ namespace UVtools.GUI.Controls.Tools public CtrlToolEditParameters() { InitializeComponent(); + + Program.SlicerFile.RefreshPrintParametersModifiersValues(); Operation = new OperationEditParameters(Program.SlicerFile.PrintParameterModifiers); SetOperation(Operation); diff --git a/UVtools.GUI/Forms/FrmToolWindow.cs b/UVtools.GUI/Forms/FrmToolWindow.cs index f9a3875..823c375 100644 --- a/UVtools.GUI/Forms/FrmToolWindow.cs +++ b/UVtools.GUI/Forms/FrmToolWindow.cs @@ -310,13 +310,13 @@ namespace UVtools.GUI.Forms if (ReferenceEquals(sender, btnLayerRangeBottomLayers)) { nmLayerRangeStart.Value = 0; - nmLayerRangeEnd.Value = Program.SlicerFile.InitialLayerCount-1; + nmLayerRangeEnd.Value = Program.SlicerFile.BottomLayerCount-1; return; } if (ReferenceEquals(sender, btnLayerRangeNormalLayers)) { - nmLayerRangeStart.Value = Program.SlicerFile.InitialLayerCount - 1; + nmLayerRangeStart.Value = Program.SlicerFile.BottomLayerCount - 1; nmLayerRangeEnd.Value = Program.SlicerFile.LayerCount - 1; return; } diff --git a/UVtools.GUI/FrmMain.cs b/UVtools.GUI/FrmMain.cs index 9ac592d..88d1853 100644 --- a/UVtools.GUI/FrmMain.cs +++ b/UVtools.GUI/FrmMain.cs @@ -1471,6 +1471,13 @@ namespace UVtools.GUI } } + private void pbLayer_SelectionRegionChanged(object sender, EventArgs e) + { + var roi = ROI; + btnLayerROI.Text = roi.IsEmpty ? "ROI: (NS)" : $"ROI: {roi}"; + btnLayerROI.Enabled = !roi.IsEmpty; + } + private void pbLayer_Zoomed(object sender, Cyotek.Windows.Forms.ImageBoxZoomEventArgs e) { if (SupressLayerZoomEvent) return; @@ -2129,9 +2136,9 @@ namespace UVtools.GUI statusBar.Items.Clear(); AddStatusBarItem(nameof(SlicerFile.LayerHeight), SlicerFile.LayerHeight, "mm"); - AddStatusBarItem(nameof(SlicerFile.InitialLayerCount), SlicerFile.InitialLayerCount); - AddStatusBarItem(nameof(SlicerFile.InitialExposureTime), SlicerFile.InitialExposureTime, "s"); - AddStatusBarItem(nameof(SlicerFile.LayerExposureTime), SlicerFile.LayerExposureTime, "s"); + AddStatusBarItem(nameof(SlicerFile.BottomLayerCount), SlicerFile.BottomLayerCount); + AddStatusBarItem(nameof(SlicerFile.BottomExposureTime), SlicerFile.BottomExposureTime, "s"); + AddStatusBarItem(nameof(SlicerFile.ExposureTime), SlicerFile.ExposureTime, "s"); AddStatusBarItem(nameof(SlicerFile.PrintTime), Math.Round(SlicerFile.PrintTime / 3600, 2), "h"); AddStatusBarItem(nameof(SlicerFile.UsedMaterial), Math.Round(SlicerFile.UsedMaterial, 2), "ml"); AddStatusBarItem(nameof(SlicerFile.MaterialCost), SlicerFile.MaterialCost, "€"); @@ -4137,10 +4144,11 @@ namespace UVtools.GUI switch (baseOperation) { case OperationEditParameters operation: - foreach (var modifier in operation.Modifiers.Where(modifier => modifier.HasChanged)) + /*foreach (var modifier in operation.Modifiers.Where(modifier => modifier.HasChanged)) { SlicerFile.SetValueFromPrintParameterModifier(modifier, modifier.NewValue); - } + }*/ + SlicerFile.SetValuesFromPrintParametersModifiers(); RefreshInfo(); menuFileSave.Enabled = true; @@ -4286,11 +4294,6 @@ namespace UVtools.GUI return true; } - private void pbLayer_SelectionRegionChanged(object sender, EventArgs e) - { - var roi = ROI; - btnLayerROI.Text = roi.IsEmpty ? "ROI: (NS)" : $"ROI: {roi}"; - btnLayerROI.Enabled = !roi.IsEmpty; - } + } } |