blob: c342418309c199b32a37e77451201c1c7eec0acf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
using Avalonia.Markup.Xaml;
using UVtools.Core.FileFormats;
using UVtools.Core.Operations;
namespace UVtools.WPF.Controls.Tools
{
public class ToolCalculatorControl : ToolControl
{
public OperationCalculator Operation => BaseOperation as OperationCalculator;
public FileFormat SlicerFile => App.SlicerFile;
public ToolCalculatorControl()
{
InitializeComponent();
BaseOperation = new OperationCalculator
{
CalcMillimetersToPixels = new OperationCalculator.MillimetersToPixels(SlicerFile.Resolution, SlicerFile.Display),
CalcLightOffDelay = new OperationCalculator.LightOffDelayC(
(decimal)SlicerFile.LiftHeight, (decimal)SlicerFile.BottomLiftHeight,
(decimal)SlicerFile.LiftSpeed, (decimal)SlicerFile.BottomLiftSpeed,
(decimal)SlicerFile.RetractSpeed, (decimal)SlicerFile.RetractSpeed)
};
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
public void LightOffDelaySetParameters(byte side)
{
if (side == 0) // Bottom layers
{
SlicerFile.BottomLiftHeight = (float)Operation.CalcLightOffDelay.BottomLiftHeight;
SlicerFile.BottomLiftSpeed = (float)Operation.CalcLightOffDelay.BottomLiftSpeed;
SlicerFile.RetractSpeed = (float)Operation.CalcLightOffDelay.RetractSpeed;
SlicerFile.BottomLayerOffTime = (float)Operation.CalcLightOffDelay.BottomLightOffDelay;
}
else // Normal layers
{
SlicerFile.LiftHeight = (float)Operation.CalcLightOffDelay.LiftHeight;
SlicerFile.LiftSpeed = (float)Operation.CalcLightOffDelay.LiftSpeed;
SlicerFile.RetractSpeed = (float)Operation.CalcLightOffDelay.RetractSpeed;
SlicerFile.LayerOffTime = (float)Operation.CalcLightOffDelay.LightOffDelay;
}
App.MainWindow.CanSave = true;
}
}
}
|