Skip to content

Commit

Permalink
v1.1.1
Browse files Browse the repository at this point in the history
* (Fix) PHZ, PWS, LGS, SL1 and ZCodex per layer settings and implement missing properties on decode
* (Fix) LGS and PHZ Zip wasn't setting the position z per layer
* (Fix) Add missing ctb v3 per layer settings on edit parameters window
* (Fix) PWS per layer settings internal LiftSpeed was calculating in mm/min, changed to mm/sec
  • Loading branch information
sn4k3 committed Nov 1, 2020
1 parent 679f088 commit 15094f9
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 31 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 01/11/2020 - v1.1.1

* (Fix) PHZ, PWS, LGS, SL1 and ZCodex per layer settings and implement missing properties on decode
* (Fix) LGS and PHZ Zip wasn't setting the position z per layer
* (Fix) Add missing ctb v3 per layer settings on edit parameters window
* (Fix) PWS per layer settings internal LiftSpeed was calculating in mm/min, changed to mm/sec

## 01/11/2020 - v1.1.0

* (Add) photons file format (Read-only)
Expand All @@ -13,7 +20,7 @@
* (Improvement) Adapt every file format to accept per layer settings where possible
* (Improvement) Better gcode checks and per layer settings parses
* (Change) When converting to CTB, version 3 of the file will be used instead of version 2
* (Change) When converting to photon or cbddlp, version 2 of the file will be used instead of version 2
* (Change) When converting to photon or cbddlp, version 2 of the file will be used
* (Change) New logo, thanks to (Vinicius Silva @photonsters)
* (Fix) MSI installer was creating multiple entries/uninstallers on windows Apps and Features (#79)
* (Fix) Release builder script (CreateRelease.WPF.ps1): Replace backslash with shash for zip releases (#82)
Expand Down
8 changes: 4 additions & 4 deletions UVtools.Core/FileFormats/CWSFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -612,16 +612,16 @@ public override void Decode(string fileFullPath, OperationProgress progress = nu

if (Printer == PrinterType.Elfin)
{
LayerManager[layerIndex] =
this[layerIndex] =
new Layer(layerIndex, buffer, zipArchiveEntry.Name)
{
PositionZ = GetHeightFromLayer(layerIndex),
ExposureTime = exposureTime,
LiftHeight = liftHeight,
LiftSpeed = liftSpeed,
RetractSpeed = retractSpeed,
LayerOffTime = lightOffDelay,
LightPWM = pwm,
ExposureTime = exposureTime,
};
}
else
Expand All @@ -638,16 +638,16 @@ public override void Decode(string fileFullPath, OperationProgress progress = nu
spanDecode[i] = span[i];
}

LayerManager[layerIndex] =
this[layerIndex] =
new Layer(layerIndex, matDecode, zipArchiveEntry.Name)
{
PositionZ = GetHeightFromLayer(layerIndex),
ExposureTime = exposureTime,
LiftHeight = liftHeight,
LiftSpeed = liftSpeed,
RetractSpeed = retractSpeed,
LayerOffTime = lightOffDelay,
LightPWM = pwm,
ExposureTime = exposureTime,
};
}
}
Expand Down
7 changes: 7 additions & 0 deletions UVtools.Core/FileFormats/ChituboxFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,9 @@ public override PrintParameterModifier[] PrintParameterPerLayerModifiers {
return new[]
{
PrintParameterModifier.ExposureSeconds,
PrintParameterModifier.LiftHeight,
PrintParameterModifier.LiftSpeed,
PrintParameterModifier.RetractSpeed,
PrintParameterModifier.LayerOffTime,
PrintParameterModifier.LightPWM,
};
Expand Down Expand Up @@ -1557,7 +1560,11 @@ public override void Decode(string fileFullPath, OperationProgress progress = nu
{
PositionZ = LayerDefinitions[0, layerIndex].LayerPositionZ,
ExposureTime = LayerDefinitions[0, layerIndex].LayerExposure,
LiftHeight = GetInitialLayerValueOrNormal((uint)layerIndex, BottomLiftHeight, LiftHeight),
LiftSpeed = GetInitialLayerValueOrNormal((uint)layerIndex, BottomLiftSpeed, LiftSpeed),
RetractSpeed = RetractSpeed,
LayerOffTime = LayerDefinitions[0, layerIndex].LayerOffSeconds,
LightPWM = GetInitialLayerValueOrNormal((uint)layerIndex, BottomLightPWM, LightPWM),
};

if (!(LayerDefinitionsEx is null))
Expand Down
14 changes: 11 additions & 3 deletions UVtools.Core/FileFormats/ChituboxZipFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,15 @@ public override void Decode(string fileFullPath, OperationProgress progress = nu

if (IsPHZZip) // PHZ file
{
LayerManager[layerIndex] = new Layer(layerIndex, entry.Open(), entry.Name);
this[layerIndex] = new Layer(layerIndex, entry.Open(), entry.Name)
{
PositionZ = GetHeightFromLayer(layerIndex),
ExposureTime = GetInitialLayerValueOrNormal(layerIndex, BottomExposureTime, ExposureTime),
LiftHeight = GetInitialLayerValueOrNormal(layerIndex, BottomLiftHeight, LiftHeight),
LiftSpeed = GetInitialLayerValueOrNormal(layerIndex, BottomLiftSpeed, LiftSpeed),
RetractSpeed = RetractSpeed,
LightPWM = GetInitialLayerValueOrNormal(layerIndex, BottomLightPWM, LightPWM),
};
progress++;
continue;;
}
Expand Down Expand Up @@ -537,15 +545,15 @@ public override void Decode(string fileFullPath, OperationProgress progress = nu
}
}

LayerManager[layerIndex] = new Layer(layerIndex, entry.Open(), entry.Name)
this[layerIndex] = new Layer(layerIndex, entry.Open(), entry.Name)
{
PositionZ = posZ,
ExposureTime = exposureTime,
LiftHeight = liftHeight,
LiftSpeed = liftSpeed,
RetractSpeed = retractSpeed,
LayerOffTime = lightOffDelay,
LightPWM = pwm,
ExposureTime = exposureTime,
};
progress++;
}
Expand Down
10 changes: 5 additions & 5 deletions UVtools.Core/FileFormats/FileFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,11 @@ public virtual uint LayerCount
public virtual float ExposureTime { get; set; }
public virtual float BottomLayerOffTime { get; set; }
public virtual float LayerOffTime { get; set; }
public virtual float BottomLiftHeight { get; set; }
public virtual float LiftHeight { get; set; }
public virtual float BottomLiftSpeed { get; set; }
public virtual float LiftSpeed { get; set; }
public virtual float RetractSpeed { get; set; }
public virtual float BottomLiftHeight { get; set; } = 5;
public virtual float LiftHeight { get; set; } = 5;
public virtual float BottomLiftSpeed { get; set; } = 100;
public virtual float LiftSpeed { get; set; } = 100;
public virtual float RetractSpeed { get; set; } = 100;
public virtual byte BottomLightPWM { get; set; } = 255;
public virtual byte LightPWM { get; set; } = 255;

Expand Down
10 changes: 9 additions & 1 deletion UVtools.Core/FileFormats/LGSFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,15 @@ public override void Decode(string fileFullPath, OperationProgress progress = nu

using (var image = layerData[layerIndex].Decode())
{
this[layerIndex] = new Layer((uint) layerIndex, image);
this[layerIndex] = new Layer((uint) layerIndex, image)
{
PositionZ = GetHeightFromLayer((uint)layerIndex),
ExposureTime = GetInitialLayerValueOrNormal((uint)layerIndex, BottomExposureTime, ExposureTime),
LiftHeight = GetInitialLayerValueOrNormal((uint)layerIndex, BottomLiftHeight, LiftHeight),
LiftSpeed = GetInitialLayerValueOrNormal((uint)layerIndex, BottomLiftSpeed, LiftSpeed),
RetractSpeed = RetractSpeed,
LightPWM = GetInitialLayerValueOrNormal((uint)layerIndex, BottomLightPWM, LightPWM),
};

lock (progress.Mutex)
{
Expand Down
6 changes: 5 additions & 1 deletion UVtools.Core/FileFormats/PHZFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,11 @@ public override void Decode(string fileFullPath, OperationProgress progress = nu
{
PositionZ = LayersDefinitions[layerIndex].LayerPositionZ,
ExposureTime = LayersDefinitions[layerIndex].LayerExposure,
LayerOffTime = LayersDefinitions[layerIndex].LayerOffTimeSeconds
LiftHeight = GetInitialLayerValueOrNormal((uint)layerIndex, BottomLiftHeight, LiftHeight),
LiftSpeed = GetInitialLayerValueOrNormal((uint)layerIndex, BottomLiftSpeed, LiftSpeed),
RetractSpeed = RetractSpeed,
LayerOffTime = LayersDefinitions[layerIndex].LayerOffTimeSeconds,
LightPWM = GetInitialLayerValueOrNormal((uint)layerIndex, BottomLightPWM, LightPWM),
};
}

Expand Down
10 changes: 6 additions & 4 deletions UVtools.Core/FileFormats/PWSFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public void RefreshLayerData(uint layerIndex)
LayerPositionZ = Parent[layerIndex].PositionZ;
LayerExposure = Parent[layerIndex].ExposureTime;
LiftHeight = Parent[layerIndex].LiftHeight;
LiftSpeed = Parent[layerIndex].LiftSpeed;
LiftSpeed = (float) Math.Round(Parent[layerIndex].LiftSpeed / 60, 2);
}

public Mat Decode(bool consumeData = true)
Expand Down Expand Up @@ -1153,7 +1153,9 @@ public override void Decode(string fileFullPath, OperationProgress progress = nu
PositionZ = LayersDefinition[(uint)layerIndex].LayerPositionZ,
ExposureTime = LayersDefinition[(uint)layerIndex].LayerExposure,
LiftHeight = LayersDefinition[(uint)layerIndex].LiftHeight,
LiftSpeed = LayersDefinition[(uint)layerIndex].LiftSpeed,
LiftSpeed = (float)Math.Round(LayersDefinition[(uint)layerIndex].LiftSpeed * 60, 2),
RetractSpeed = RetractSpeed,
LightPWM = GetInitialLayerValueOrNormal((uint) layerIndex, BottomLightPWM, LightPWM)
};
}

Expand Down Expand Up @@ -1219,8 +1221,8 @@ public override bool Convert(Type to, string fileFullPath, OperationProgress pro
LayerHeight = LayerHeight,
LayerExposureTime = ExposureTime,
LiftHeight = LiftHeight,
LiftSpeed = LiftSpeed / 60,
RetractSpeed = RetractSpeed / 60,
LiftSpeed = LiftSpeed,
RetractSpeed = RetractSpeed,
LayerOffTime = HeaderSettings.LayerOffTime,
BottomLayersCount = BottomLayerCount,
BottomExposureSeconds = BottomExposureTime,
Expand Down
10 changes: 9 additions & 1 deletion UVtools.Core/FileFormats/PhotonSFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,15 @@ public override void Decode(string fileFullPath, OperationProgress progress = nu

using (var image = layerData[layerIndex].Decode())
{
this[layerIndex] = new Layer((uint) layerIndex, image);
this[layerIndex] = new Layer((uint) layerIndex, image)
{
PositionZ = GetHeightFromLayer((uint)layerIndex),
ExposureTime = GetInitialLayerValueOrNormal((uint)layerIndex, BottomExposureTime, ExposureTime),
LiftHeight = GetInitialLayerValueOrNormal((uint)layerIndex, BottomLiftHeight, LiftHeight),
LiftSpeed = GetInitialLayerValueOrNormal((uint)layerIndex, BottomLiftSpeed, LiftSpeed),
RetractSpeed = RetractSpeed,
LightPWM = GetInitialLayerValueOrNormal((uint)layerIndex, BottomLightPWM, LightPWM),
};

lock (progress.Mutex)
{
Expand Down
18 changes: 16 additions & 2 deletions UVtools.Core/FileFormats/SL1File.cs
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,16 @@ public override void Decode(string fileFullPath, OperationProgress progress = nu
}
}

BottomLiftHeight = LookupCustomValue<float>(Keyword_BottomLiftHeight, 5);
BottomLiftSpeed = LookupCustomValue<float>(Keyword_BottomLiftSpeed, 100);
LiftHeight = LookupCustomValue<float>(Keyword_LiftHeight, 5);
LiftSpeed = LookupCustomValue<float>(Keyword_LiftSpeed, 100);
RetractSpeed = LookupCustomValue<float>(Keyword_RetractSpeed, 100);
BottomLayerOffTime = LookupCustomValue<float>(Keyword_BottomLightOffDelay, 0);
LayerOffTime = LookupCustomValue<float>(Keyword_LayerOffTime, 0);
BottomLightPWM = LookupCustomValue<byte>(Keyword_BottomLightPWM, 255);
LightPWM = LookupCustomValue<byte>(Keyword_LightPWM, 255);

LayerManager = new LayerManager((uint) (OutputConfigSettings.NumSlow + OutputConfigSettings.NumFast), this);

progress.ItemCount = LayerCount;
Expand Down Expand Up @@ -616,10 +626,14 @@ public override void Decode(string fileFullPath, OperationProgress progress = nu
// - .png - 5 numbers
string layerStr = entity.Name.Substring(entity.Name.Length - 4 - 5, 5);
uint iLayer = uint.Parse(layerStr);
LayerManager[iLayer] = new Layer(iLayer, entity.Open(), entity.Name)
this[iLayer] = new Layer(iLayer, entity.Open(), entity.Name)
{
PositionZ = GetHeightFromLayer(iLayer),
ExposureTime = GetInitialLayerValueOrNormal(iLayer, BottomExposureTime, ExposureTime)
ExposureTime = GetInitialLayerValueOrNormal(iLayer, BottomExposureTime, ExposureTime),
LiftHeight = GetInitialLayerValueOrNormal(iLayer, BottomLiftHeight, LiftHeight),
LiftSpeed = GetInitialLayerValueOrNormal(iLayer, BottomLiftSpeed, LiftSpeed),
RetractSpeed = RetractSpeed,
LightPWM = GetInitialLayerValueOrNormal(iLayer, BottomLightPWM, LightPWM),
};
progress.ProcessedItems++;
}
Expand Down
2 changes: 1 addition & 1 deletion UVtools.Core/FileFormats/UVJFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ public override void Decode(string fileFullPath, OperationProgress progress = nu
entry = inputFile.GetEntry($"{FolderImageName}/{layerIndex:D8}.png");
if (ReferenceEquals(entry, null)) continue;

LayerManager[layerIndex] = new Layer(layerIndex, entry.Open(), entry.Name)
this[layerIndex] = new Layer(layerIndex, entry.Open(), entry.Name)
{
PositionZ = JsonSettings.Layers.Count >= layerIndex ? JsonSettings.Layers[(int) layerIndex].Z : GetHeightFromLayer(layerIndex),
LiftHeight = JsonSettings.Layers.Count >= layerIndex ? JsonSettings.Layers[(int)layerIndex].Exposure.LiftHeight : GetInitialLayerValueOrNormal(layerIndex, BottomLiftHeight, LiftHeight),
Expand Down
14 changes: 9 additions & 5 deletions UVtools.Core/FileFormats/ZCodexFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,14 @@ public override void Encode(string fileFullPath, OperationProgress progress = nu

if (lastZPosition != layer.PositionZ)
{
if (LiftHeight > 0)
if (layer.LiftHeight > 0)
{
GCode.AppendLine($"G1 Z{LiftHeight} F{LiftSpeed}");
GCode.AppendLine($"G1 Z-{Math.Round(LiftHeight - layer.PositionZ + lastZPosition, 2)} F{RetractSpeed}");
GCode.AppendLine($"G1 Z{layer.LiftHeight} F{layer.LiftSpeed}");
GCode.AppendLine($"G1 Z-{Math.Round(layer.LiftHeight - layer.PositionZ + lastZPosition, 2)} F{layer.RetractSpeed}");
}
else
{
GCode.AppendLine($"G1 Z{Math.Round(layer.PositionZ- lastZPosition, 2)} F{LiftSpeed}");
GCode.AppendLine($"G1 Z{Math.Round(layer.PositionZ- lastZPosition, 2)} F{layer.LiftSpeed}");
}
}
/*else
Expand Down Expand Up @@ -488,7 +488,11 @@ M106 S0
this[layerIndex] = new Layer((uint) layerIndex, LayersSettings[layerIndex].LayerEntry.Open(), LayersSettings[layerIndex].LayerEntry.Name)
{
PositionZ = currentHeight,
ExposureTime = GetInitialLayerValueOrNormal((uint) layerIndex, BottomExposureTime, ExposureTime)
ExposureTime = GetInitialLayerValueOrNormal((uint) layerIndex, BottomExposureTime, ExposureTime),
LiftHeight = GetInitialLayerValueOrNormal((uint) layerIndex, BottomLiftHeight, LiftHeight),
LiftSpeed = GetInitialLayerValueOrNormal((uint) layerIndex, BottomLiftSpeed, LiftSpeed),
RetractSpeed = RetractSpeed,
LightPWM = GetInitialLayerValueOrNormal((uint) layerIndex, BottomLightPWM, LightPWM),
};
layerIndex++;

Expand Down
2 changes: 1 addition & 1 deletion UVtools.Core/UVtools.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<RepositoryUrl>https://github.com/sn4k3/UVtools</RepositoryUrl>
<PackageProjectUrl>https://github.com/sn4k3/UVtools</PackageProjectUrl>
<Description>MSLA/DLP, file analysis, repair, conversion and manipulation</Description>
<Version>1.1.0</Version>
<Version>1.1.1</Version>
<Copyright>Copyright © 2020 PTRTECH</Copyright>
<PackageIcon>UVtools.png</PackageIcon>
<Platforms>AnyCPU;x64</Platforms>
Expand Down
2 changes: 1 addition & 1 deletion UVtools.Installer/UVtools.Installer.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- If MSIProductVersion still not known, try to get it from TFBuild Environments (V.Next Builds)-->
<MSIProductVersion Condition=" '$(MSIProductVersion)' == '' ">$([System.Text.RegularExpressions.Regex]::Match($(BUILD_BUILDNUMBER), "\d+.\d+.\d+.\d+"))</MSIProductVersion>
<!-- If MSIProductVersion still not known, default to lowerbound 0.0.1 for developer builds.-->
<MSIProductVersion Condition=" '$(MSIProductVersion)' == '' ">1.1.0</MSIProductVersion>
<MSIProductVersion Condition=" '$(MSIProductVersion)' == '' ">1.1.1</MSIProductVersion>
<!-- The following allows one cert to be referenced from the certificate store for self-signing in localbuilds and another cert to be passed in during official builds. -->
<AppxCertificateThumbprint Condition=" '$(AppxCertificateThumbprint)' == '' ">
</AppxCertificateThumbprint>
Expand Down
2 changes: 1 addition & 1 deletion UVtools.WPF/UVtools.WPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<RepositoryUrl>https://github.com/sn4k3/UVtools</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<Nullable>enable</Nullable>
<Version>1.1.0</Version>
<Version>1.1.1</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down

0 comments on commit 15094f9

Please sign in to comment.