Files
UVtools/UVtools.Core/Enumerations.cs
T
Tiago Conceição c94b5fb7f1 v2.17.0
- **Windows MSI:**
   - (Fix) Use the folder programs x64 instead of x86 for new installation path (#254)
   - (Improvement) Mark program and all files as x64
   - (Improvement) Add UVtools logo to side panel and top banner
   - (Improvement) Add open-source logo to side panel
   - (Improvement) License text aligment and bold title
- (Add) File format: OSLA / ODLP / OMSLA - Universal binary file format
- (Add) Calibration - Lift height: Generates test models with various strategies and increments to measure the optimal lift height or peel forces for layers given the printed area
- (Add) Layer Actions - Export layers to images (PNG, JPG/JPEG, JP2, TIF/TIFF, BMP, PBM, PGM, SR/RAS and SVG)
- (Add) About box: License with link
- (Add) Include a copy of the LICENSE on the packages
- (Improvement) File formats: Implement `Wait time before cure` properties on file formats with light-off delay, when used it will calculate the right light-off delay with that extra time and set to `LightOffDelay` property
- (Improvement) Change all date times to Utc instead of local
- (Fix) Tool - Flip: 'Both' were not working correctly
- (Fix) Linux: File 'UVtools.sh' with incorrect line break type, changed to \n (#258)
2021-08-08 23:57:00 +01:00

99 lines
3.1 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 System.ComponentModel;
using Emgu.CV.CvEnum;
namespace UVtools.Core
{
public class Enumerations
{
public enum LayerRangeSelection : byte
{
None,
All,
Current,
Bottom,
Normal,
First,
Last
}
public enum FlipDirection : byte
{
None,
Horizontally,
Vertically,
Both,
}
public enum RotateDirection : sbyte
{
[Description("None")]
None = -1,
/// <summary>Rotate 90 degrees clockwise (0)</summary>
[Description("Rotate 90º CW")]
Rotate90Clockwise = 0,
/// <summary>Rotate 180 degrees clockwise (1)</summary>
[Description("Rotate 180º")]
Rotate180 = 1,
/// <summary>Rotate 270 degrees clockwise (2)</summary>
[Description("Rotate 90º CCW")]
Rotate90CounterClockwise = 2,
}
public enum Anchor : byte
{
TopLeft, TopCenter, TopRight,
MiddleLeft, MiddleCenter, MiddleRight,
BottomLeft, BottomCenter, BottomRight,
None
}
public enum LightOffDelaySetMode : byte
{
[Description("Set the light-off with an extra delay")]
UpdateWithExtraDelay,
[Description("Set the light-off without an extra delay")]
UpdateWithoutExtraDelay,
[Description("Set the light-off to zero")]
SetToZero,
[Description("Disabled")]
NoAction
}
public static FlipType ToOpenCVFlipType(FlipDirection flip)
{
return flip switch
{
FlipDirection.None => throw new NotSupportedException($"Flip type: {flip} is not supported by OpenCV."),
FlipDirection.Horizontally => FlipType.Horizontal,
FlipDirection.Vertically => FlipType.Vertical,
FlipDirection.Both => FlipType.Both,
_ => throw new ArgumentOutOfRangeException(nameof(flip), flip, null)
};
}
public static RotateFlags ToOpenCVRotateFlags(RotateDirection rotate)
{
return rotate switch
{
RotateDirection.None => throw new NotSupportedException($"Rotate direction: {rotate} is not supported by OpenCV."),
RotateDirection.Rotate90Clockwise => RotateFlags.Rotate90Clockwise,
RotateDirection.Rotate90CounterClockwise => RotateFlags.Rotate90CounterClockwise,
RotateDirection.Rotate180 => RotateFlags.Rotate180,
_ => throw new ArgumentOutOfRangeException(nameof(rotate), rotate, null)
};
}
}
}