* **Core:**
   * Write "Unhandled Exceptions" to an "errors.log" file at user settings directory
   * Increase layer height max precision from 2 to 3 decimals
* **Settings - Layer Preview:**
   * Allow to set hollow line thickness to -1 to fill the area
   * Add tooltip for "Auto rotate on load": Auto rotate the layer preview on file load for a landscape viewport
   * Add option to masks outline color and thickness
   * Add option to clear ROI when adding masks
   * Add option "Auto flip on load": Auto flip the layer preview on file load if the file is marked to print mirrored on the printer LCD
* **Layer preview:**
   * Add selectable rotation directions 90º (CW and CCW)
   * Add preview flip (CTRL+F) horizontally and/or vertically
   * Add maskable regions to process on a layer (SHIFT + Alt + Click) on a area
   * ROI: Shortcut "Shift + left click" now also selects hollow black areas inside a white perimeter
   * ROI: Shortcut "ESC + Shift" to clear only the ROI and leave masks in
   * Fix a crash when using the pixel picker tool outside image bounds
* **Pixel editor:**
   * Change drawings brush diameter limit from 255 to 4000 maximum
   * When using layers below go lower than layer 0 it no longer apply the modifications
* **File formats:**
   * Add an internal GCodeBuilder to generate identical gcode within formats with auto convertion, managing features and parsing information
   * Internally rearrange formats properties and pass values to the base class
   * Fix "Save As" filename when using formats with dual extensions
   * CBDDLP and CTB: "LightPWM" was setting "BottomLightPWM" instead
   * CWS: Fix problem with filenames with dots (.) and ending with numbers (#171)
   * CWS: Improved the enconding and decoding performance
   * CWS: Implement all available print paramenters and per layer, missing values are got from gcode interpretation
   * CWS: Use set "light off delay" layer value instead of calculating it
   * CWS: Get light off delay per layer parsed from gcode
   * CWS - RGB flavour (Bene4 Mono): Warn about wrong resolution if width not multiples of 3 (#171)
   * ZCode: Allow to set Bottom and Light intensity (LightPWM) on paramters and per layer
   * ZCode: Allow to change bottom light pwm independent from normal light pwm
   * LGS: Light off and bottom light off was setting the value on the wrong units
   * UVJ: Unable to set per layer parameters
* **Issues:**
   * When computing islands and resin traps together, they will not compute in parallel anymore to prevent CPU and tasks exaustion, it will calculate islands first and then resin traps, this should also speed up the process on weaker machines
   * Gather resin trap areas together when computing for other issues to spare a decoding cycle latter
   * When using a threshold for islands detection it was also appling it to the overhangs
   * Fix the spare decoding conditional cycle for partial scans
   * Change resin trap search from parallel to sync to prevent fake detections and missing joints at cost of speed (#13)
* **Tools:**
   * Add layer selector: 'From first to current layer' and 'From current to last layer'
   * I printed this file: Multiplier - Number of time(s) the file has been printed. Half numbers can be used to consume from a failed print. Example: 0.5x if a print canceled at 50% progress
   * Pixel dimming: Increase wall thickness default from 5px to 10px
   * Import layers: Importing layers was not marking layers as modified, then the save file won't save the new images in, to prevent other similar bugs, all layers that got replaced will be auto marked as modified
This commit is contained in:
Tiago Conceição
2021-03-19 04:48:45 +00:00
parent cb1070df5e
commit 3f838001c7
87 changed files with 3627 additions and 2363 deletions
+6
View File
@@ -65,6 +65,12 @@ namespace UVtools.Core.Objects
return true;
}
protected void RaiseAndSet<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
{
field = value;
RaisePropertyChanged(propertyName);
}
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
{
+2 -2
View File
@@ -16,7 +16,7 @@ namespace UVtools.Core.Objects
public decimal LayerHeight
{
get => _layerHeight;
set => RaiseAndSetIfChanged(ref _layerHeight, Math.Round(value, 2));
set => RaiseAndSetIfChanged(ref _layerHeight, Layer.RoundHeight(value));
}
@@ -59,7 +59,7 @@ namespace UVtools.Core.Objects
public ExposureItem(decimal layerHeight, decimal bottomExposure = 0, decimal exposure = 0, byte brightness = 255)
{
_layerHeight = Math.Round(layerHeight, 2);
_layerHeight = Layer.RoundHeight(layerHeight);
_bottomExposure = Math.Round(bottomExposure, 2);
_exposure = Math.Round(exposure, 2);
_brightness = brightness;
-180
View File
@@ -1,180 +0,0 @@
/*
* 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.Text;
namespace UVtools.Core.Objects
{
public class GCodeBuilder : BindableBase
{
#region Enums
public enum GCodeTimeUnits : byte
{
Milliseconds,
Seconds
}
public enum GCodeSpeedUnits : byte
{
MillimetersPerSecond,
MillimetersPerMinute,
CentimetersPerMinute,
}
#endregion
#region Members
private readonly StringBuilder _gcode = new();
private bool _appendComma = true;
private bool _appendComment = true;
private bool _useAbsoluteCommands = true;
private GCodeTimeUnits _gCodeTimeUnit = GCodeTimeUnits.Milliseconds;
private GCodeSpeedUnits _gCodeSpeedUnit = GCodeSpeedUnits.MillimetersPerMinute;
#endregion
#region Properties
public bool UseAbsoluteCommands
{
get => _useAbsoluteCommands;
set => RaiseAndSetIfChanged(ref _useAbsoluteCommands, value);
}
public GCodeTimeUnits GCodeTimeUnit
{
get => _gCodeTimeUnit;
set => RaiseAndSetIfChanged(ref _gCodeTimeUnit, value);
}
public GCodeSpeedUnits GCodeSpeedUnit
{
get => _gCodeSpeedUnit;
set => RaiseAndSetIfChanged(ref _gCodeSpeedUnit, value);
}
public bool AppendComma
{
get => _appendComma;
set => RaiseAndSetIfChanged(ref _appendComma, value);
}
public bool AppendComment
{
get => _appendComment;
set => RaiseAndSetIfChanged(ref _appendComment, value);
}
#endregion
#region StringBuilder
public void AppendLine() => _gcode.AppendLine();
public void AppendLine(string line) => _gcode.AppendLine(line);
public void AppendFormat(string format, params object?[] args) => _gcode.AppendFormat(format, args);
public void Clear() => _gcode.Clear();
public override string ToString() => _gcode.ToString();
#endregion
#region Methods
public string FormatGCodeLine(string line, string comment)
{
if (_appendComma || _appendComment)
line += ';';
if (_appendComment)
line += comment;
return line;
}
public void AppendUnitsMmG21()
{
AppendLine(FormatGCodeLine("G21", "Set units to be mm"));
}
public void AppendPositioningType()
{
if (_useAbsoluteCommands)
{
AppendLine(FormatGCodeLine("G90", "Absolute positioning"));
}
else
{
AppendLine(FormatGCodeLine("G91", "Partial positioning"));
}
}
public void AppendEnableMotors()
{
AppendLine(FormatGCodeLine("M17", "Enable motors"));
}
public void AppendDisableMotors()
{
AppendLine(FormatGCodeLine("M18", "Disable motors"));
}
public void AppendTurnMotors(bool enable)
{
if (enable)
AppendEnableMotors();
else
AppendDisableMotors();
}
public void AppendHomeZG28()
{
AppendLine(FormatGCodeLine("G28 Z0", "Home Z"));
}
public void AppendMoveG0(float z, float feedRate)
{
AppendLine(FormatGCodeLine($"G0 Z{z} F{feedRate}", "Z Move"));
}
public void AppendLiftMoveG0(float upZ, float upFeedRate, float downZ, float downFeedRate)
{
AppendLine(FormatGCodeLine($"G0 Z{upZ} F{upFeedRate}", "Z Lift"));
AppendLine(FormatGCodeLine($"G0 Z{downZ} F{downFeedRate}", "Retract to layer height"));
}
public void AppendWaitG4(float time)
{
AppendLine(FormatGCodeLine($"G4 P{time}", "Delay"));
}
public void AppendTurnLightM106(ushort value)
{
AppendLine(FormatGCodeLine($"M106 S{value}", "Turn LED"));
}
public void AppendLightOffM106() => AppendTurnLightM106(0);
public void AppendLightFullM106() => AppendTurnLightM106(255);
public void AppendExposure(ushort value, float time)
{
if (time <= 0) return;
AppendTurnLightM106(value);
AppendWaitG4(time);
AppendLightOffM106();
}
public void AppendShowImageM6054(string name)
{
AppendLine(FormatGCodeLine($"M6054 \"{name}\"","Show image"));
}
public void AppendLineComment(string comment)
{
AppendLine($";{comment}");
}
}
#endregion
}
+2 -1
View File
@@ -1,4 +1,5 @@
using System.IO;
using System;
using System.IO;
using System.Security.Cryptography;
namespace UVtools.Core.Objects