Files
UVtools/UVtools.ScriptSample/ScriptSetLiftHeightSample.cs
T
Tiago Conceição 3cd46728f1 v2.11.1
- **Shortcuts:**
   - (Add) (Ctrl + Shift + R) to turn on and cycle the Rotate modes
   - (Add) (Ctrl + Shift + F) to turn on and cycle the Flip modes
   - (Add) (Ctrl + Shift + B) to select the build volume as ROI
- **GUI:**
   - (Add) Allow to drag and drop '.uvtop' files into UVtools to sequential show and load operations from files
   - (Change) Rotate icon on layer preview
   - (Upgrade) AvaloniaUI from 0.10.3 to 0.10.4
- **Tools:**
   - (Add) 'Reset to defaults' button on every dialog
   - (Improvement) Window size and position handling
   - (Improvement) Constrain profile box width to not stretch the window
   - (Improvement) ROI section design
- **Dynamic lift:**
   - (Add) View buttons to show the largest/smallest layers
   - (Add) Light-off mode: Set the light-off with an extra delay
   - (Add) Light-off mode: Set the light-off without an extra delay
   - (Add) Light-off mode: Set the light-off to zero
   - (Improvement) Disable bottom and/or normal layer fields when the selected range is outside
- (Add) Settings - Automations: Light-off delay set modes
- (Fix) Exposure time finder: Add staircase, bullseye and counter triangles to feature count at thumbnail
2021-05-11 19:10:36 +01:00

77 lines
2.4 KiB
C#

/*
* GNU AFFERO GENERAL PUBLIC LICENSE
* Version 3, 19 November 2007
* Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/
using System;
using UVtools.Core.Scripting;
namespace UVtools.ScriptSample
{
/// <summary>
/// Change layer properties to random values
/// </summary>
public class ScriptSetLiftHeightSample : ScriptGlobals
{
ScriptNumericalInput<float> BottomLiftHeight = new()
{
Label = "Bottom lift height",
Unit = "mm",
Minimum = 0,
Maximum = 300,
Increment = 0.5f,
Value = 0.5f,
DecimalPlates = 2
};
ScriptNumericalInput<float> LiftHeight = new()
{
Label = "Lift height",
Unit = "mm",
Minimum = 0,
Maximum = 300,
Increment = 0.5f,
Value = 0.5f,
DecimalPlates = 2
};
/// <summary>
/// Set configurations here, this function trigger just after load a script
/// </summary>
public void ScriptInit()
{
Script.Name = "Change lift height properties";
Script.Description = "Change file lift height";
Script.Author = "Tiago Conceição";
Script.Version = new Version(0, 1);
Script.UserInputs.AddRange(new []{ BottomLiftHeight , LiftHeight});
}
/// <summary>
/// Validate user inputs here, this function trigger when user click on execute
/// </summary>
/// <returns>A error message, empty or null if validation passes.</returns>
public string ScriptValidate()
{
return null;
}
/// <summary>
/// Execute the script, this function trigger when when user click on execute and validation passes
/// </summary>
/// <returns>True if executes successfully to the end, otherwise false.</returns>
public bool ScriptExecute()
{
SlicerFile.BottomLiftHeight = BottomLiftHeight.Value;
SlicerFile.LiftHeight = LiftHeight.Value;
// return true if not cancelled by user
return !Progress.Token.IsCancellationRequested;
}
}
}