* (Add) PHZ file format
* (Add) "Phrozen Sonic Mini" printer
* (Add) Convert Chitubox files to PHZ files and otherwise
* (Add) Convert Chitubox and PHZ files to ZCodex
* (Add) Elapsed seconds to convertion and extract dialog
* (Improvement) "Convert To" menu now only show available formats to convert to, if none menu is disabled
* (Fixed) Enforce cbt encryption
* (Fixed) Not implemented convertions stay processing forever
This commit is contained in:
Tiago Conceição
2020-05-19 16:57:04 +01:00
parent e756162d70
commit d91986f803
14 changed files with 1591 additions and 73 deletions
+12
View File
@@ -1,5 +1,17 @@
# Changelog
## ? - v0.3.3 - Beta
* (Add) PHZ file format
* (Add) "Phrozen Sonic Mini" printer
* (Add) Convert Chitubox files to PHZ files and otherwise
* (Add) Convert Chitubox and PHZ files to ZCodex
* (Add) Elapsed seconds to convertion and extract dialog
* (Improvement) "Convert To" menu now only show available formats to convert to, if none menu is disabled
* (Fixed) Enforce cbt encryption
* (Fixed) Not implemented convertions stay processing forever
## 11/05/2020 - v0.3.2 - Beta
* (Add) Show layer differences where daker pixels were also present on previous layer and the white pixels the difference between previous and current layer.
+152 -10
View File
@@ -11,6 +11,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using BinarySerialization;
using PrusaSL1Reader.Extensions;
@@ -29,7 +30,7 @@ namespace PrusaSL1Reader
private const ushort REPEATRGB15MASK = 0x20;
private const byte RLE8EncodingLimit = 125;
private const ushort RLE16EncodingLimit = 0x1000;
private const ushort RLE16EncodingLimit = 0xFFF;
#endregion
#region Sub Classes
@@ -438,10 +439,7 @@ namespace PrusaSL1Reader
public List<byte> Read(List<byte> input)
{
List<byte> data = new List<byte>(input.Count);
for (int i = 0; i < input.Count; i++)
{
data[i] = (byte)(input[i] ^ Next());
}
data.AddRange(input.Select(t => (byte) (t ^ Next())));
return data;
}
@@ -482,6 +480,12 @@ namespace PrusaSL1Reader
new FileExtension("photon", "Photon Files"),
};
public override Type[] ConvertToFormats { get; } =
{
typeof(PHZFile),
typeof(ZCodexFile),
};
public override PrintParameterModifier[] PrintParameterModifiers { get; } =
{
PrintParameterModifier.InitialLayerCount,
@@ -564,11 +568,19 @@ namespace PrusaSL1Reader
HeaderSettings.Magic = fileFullPath.EndsWith(".ctb") ? MAGIC_CBT : MAGIC_CBDDLP;
HeaderSettings.PrintParametersSize = (uint)Helpers.Serializer.SizeOf(PrintParametersSettings);
if (IsCbtFile)
{
PrintParametersSettings.Padding4 = 0x1234;
SlicerInfoSettings.EncryptionMode = 0xf;
//SlicerInfoSettings.EncryptionMode = 0xf;
SlicerInfoSettings.EncryptionMode = 7;
SlicerInfoSettings.Unknown1 = 0x200;
if (HeaderSettings.EncryptionKey == 0)
{
Random rnd = new Random();
HeaderSettings.EncryptionKey = (uint)rnd.Next(short.MaxValue, int.MaxValue);
}
}
uint currentOffset = (uint)Helpers.Serializer.SizeOf(HeaderSettings);
@@ -854,10 +866,7 @@ namespace PrusaSL1Reader
for (int x = 0; x < image.Width; x++)
{
var grey7 = (byte)(pixelRowSpan[x].PackedValue >> 1);
if (pixelRowSpan[x].PackedValue > 0)
{
}
if (grey7 == color)
{
stride++;
@@ -1389,7 +1398,140 @@ namespace PrusaSL1Reader
public override bool Convert(Type to, string fileFullPath)
{
throw new NotImplementedException();
if (to == typeof(PHZFile))
{
PHZFile file = new PHZFile
{
Layers = Layers
};
file.HeaderSettings.Version = 2;
file.HeaderSettings.BedSizeX = HeaderSettings.BedSizeX;
file.HeaderSettings.BedSizeY = HeaderSettings.BedSizeY;
file.HeaderSettings.BedSizeZ = HeaderSettings.BedSizeZ;
file.HeaderSettings.OverallHeightMilimeter = TotalHeight;
file.HeaderSettings.BottomExposureSeconds = InitialExposureTime;
file.HeaderSettings.BottomLayersCount = InitialLayerCount;
file.HeaderSettings.BottomLightPWM = HeaderSettings.BottomLightPWM;
file.HeaderSettings.LayerCount = LayerCount;
file.HeaderSettings.LayerExposureSeconds = LayerExposureTime;
file.HeaderSettings.LayerHeightMilimeter = LayerHeight;
file.HeaderSettings.LayerOffTime = HeaderSettings.LayerOffTime;
file.HeaderSettings.LightPWM = HeaderSettings.LightPWM;
file.HeaderSettings.PrintTime = HeaderSettings.PrintTime;
file.HeaderSettings.ProjectorType = HeaderSettings.ProjectorType;
file.HeaderSettings.ResolutionX = ResolutionX;
file.HeaderSettings.ResolutionY = ResolutionY;
file.HeaderSettings.BottomLayerCount = InitialLayerCount;
file.HeaderSettings.BottomLiftHeight = PrintParametersSettings.BottomLiftHeight;
file.HeaderSettings.BottomLiftSpeed = PrintParametersSettings.BottomLiftSpeed;
file.HeaderSettings.BottomLightOffDelay = PrintParametersSettings.BottomLightOffDelay;
file.HeaderSettings.CostDollars = MaterialCost;
file.HeaderSettings.LiftHeight = PrintParametersSettings.LiftHeight;
file.HeaderSettings.LiftingSpeed = PrintParametersSettings.LiftingSpeed;
file.HeaderSettings.LayerOffTime = HeaderSettings.LayerOffTime;
file.HeaderSettings.RetractSpeed = PrintParametersSettings.RetractSpeed;
file.HeaderSettings.VolumeMl = UsedMaterial;
file.HeaderSettings.WeightG = PrintParametersSettings.WeightG;
file.HeaderSettings.MachineName = MachineName;
file.HeaderSettings.MachineNameSize = (uint) MachineName.Length;
file.SetThumbnails(Thumbnails);
file.Encode(fileFullPath);
return true;
}
if (to == typeof(ZCodexFile))
{
TimeSpan ts = new TimeSpan(0, 0, (int)PrintTime);
ZCodexFile file = new ZCodexFile
{
ResinMetadataSettings = new ZCodexFile.ResinMetadata
{
MaterialId = 2,
Material = MaterialName,
AdditionalSupportLayerTime = 0,
BottomLayersNumber = InitialLayerCount,
BottomLayersTime = (uint)(InitialExposureTime * 1000),
LayerTime = (uint)(LayerExposureTime * 1000),
DisableSettingsChanges = false,
LayerThickness = LayerHeight,
PrintTime = (uint)PrintTime,
TotalLayersCount = LayerCount,
TotalMaterialVolumeUsed = UsedMaterial,
TotalMaterialWeightUsed = UsedMaterial,
},
UserSettings = new ZCodexFile.UserSettingsdata
{
Printer = MachineName,
BottomLayersCount = InitialLayerCount,
PrintTime = $"{ts.Hours}h {ts.Minutes}m",
LayerExposureTime = (uint)(LayerExposureTime * 1000),
BottomLayerExposureTime = (uint)(InitialExposureTime * 1000),
MaterialId = 2,
LayerThickness = $"{LayerHeight} mm",
AntiAliasing = 0,
CrossSupportEnabled = 1,
ExposureOffTime = (uint) HeaderSettings.LayerOffTime,
HollowEnabled = 0,
HollowThickness = 0,
InfillDensity = 0,
IsAdvanced = 0,
MaterialType = MaterialName,
MaterialVolume = UsedMaterial,
MaxLayer = LayerCount - 1,
ModelLiftEnabled = 0,
ModelLiftHeight = 0,
RaftEnabled = 0,
RaftHeight = 0,
RaftOffset = 0,
SupportAdditionalExposureEnabled = 0,
SupportAdditionalExposureTime = 0,
XCorrection = 0,
YCorrection = 0,
ZLiftDistance = PrintParametersSettings.LiftHeight,
ZLiftFeedRate = PrintParametersSettings.LiftingSpeed,
ZLiftRetractRate = PrintParametersSettings.RetractSpeed,
},
ZCodeMetadataSettings = new ZCodexFile.ZCodeMetadata
{
PrintTime = (uint)PrintTime,
PrinterName = MachineName,
Materials = new List<ZCodexFile.ZCodeMetadata.MaterialsData>
{
new ZCodexFile.ZCodeMetadata.MaterialsData
{
Name = MaterialName,
ExtruderType = "MAIN",
Id = 0,
Usage = 0,
Temperature = 0
}
},
},
Layers = Layers
};
float usedMaterial = UsedMaterial / LayerCount;
for (uint layerIndex = 0; layerIndex < LayerCount; layerIndex++)
{
file.ResinMetadataSettings.Layers.Add(new ZCodexFile.ResinMetadata.LayerData
{
Layer = layerIndex,
UsedMaterialVolume = usedMaterial
});
}
file.SetThumbnails(Thumbnails);
file.Encode(fileFullPath);
return true;
}
return false;
}
#endregion
}
+13 -5
View File
@@ -6,16 +6,11 @@
* of this license document, but changing it is not allowed.
*/
using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using PrusaSL1Reader.Extensions;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats.Png;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using Size = System.Drawing.Size;
@@ -133,6 +128,7 @@ namespace PrusaSL1Reader
{
new SL1File(), // Prusa SL1
new ChituboxFile(), // cbddlp, cbt, photon
new PHZFile(), // phz
new ZCodexFile(), // zcodex
};
@@ -172,6 +168,17 @@ namespace PrusaSL1Reader
{
return (from fileFormat in AvaliableFormats where fileFormat.IsExtensionValid(extension, isFilePath) select createNewInstance ? (FileFormat) Activator.CreateInstance(fileFormat.GetType()) : fileFormat).FirstOrDefault();
}
/// <summary>
/// Find <see cref="FileFormat"/> by an type
/// </summary>
/// <param name="type">Type to find</param>
/// <param name="createNewInstance">True to create a new instance of found file format, otherwise will return a pre created one which should be used for read-only purpose</param>
/// <returns><see cref="FileFormat"/> object or null if not found</returns>
public static FileFormat FindByType(Type type, bool createNewInstance = false)
{
return (from t in AvaliableFormats where type == t.GetType() select createNewInstance ? (FileFormat) Activator.CreateInstance(type) : t).FirstOrDefault();
}
#endregion
#region Properties
@@ -179,6 +186,7 @@ namespace PrusaSL1Reader
public abstract FileFormatType FileType { get; }
public abstract FileExtension[] FileExtensions { get; }
public abstract Type[] ConvertToFormats { get; }
public abstract PrintParameterModifier[] PrintParameterModifiers { get; }
+5
View File
@@ -30,6 +30,11 @@ namespace PrusaSL1Reader
/// </summary>
FileExtension[] FileExtensions { get; }
/// <summary>
/// Gets the implemented file formats able to convert to
/// </summary>
Type[] ConvertToFormats { get; }
/// <summary>
/// Gets the available <see cref="FileFormat.PrintParameterModifier"/>
/// </summary>
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -7,9 +7,9 @@
<PackageProjectUrl>https://github.com/sn4k3/PrusaSL1Viewer</PackageProjectUrl>
<PackageIcon></PackageIcon>
<RepositoryUrl>https://github.com/sn4k3/PrusaSL1Viewer</RepositoryUrl>
<AssemblyVersion>0.3.2.0</AssemblyVersion>
<FileVersion>0.3.2.0</FileVersion>
<Version>0.3.2</Version>
<AssemblyVersion>0.3.3.0</AssemblyVersion>
<FileVersion>0.3.3.0</FileVersion>
<Version>0.3.3</Version>
<Description>Open, view, edit, extract and convert DLP/SLA files generated from Slicers</Description>
</PropertyGroup>
+79 -22
View File
@@ -8,13 +8,11 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using PrusaSL1Reader.Extensions;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
@@ -278,6 +276,13 @@ namespace PrusaSL1Reader
new FileExtension("sl1", "Prusa SL1 Files")
};
public override Type[] ConvertToFormats { get; } =
{
typeof(ChituboxFile),
typeof(PHZFile),
typeof(ZCodexFile),
};
public override PrintParameterModifier[] PrintParameterModifiers { get; } = {
PrintParameterModifier.InitialLayerCount,
PrintParameterModifier.InitialExposureSeconds,
@@ -356,6 +361,7 @@ namespace PrusaSL1Reader
: memberName[i].ToString();
}
if (iniKey.EndsWith("_"))
iniKey.Remove(iniKey.Length - 1);
@@ -623,21 +629,18 @@ namespace PrusaSL1Reader
file.HeaderSettings.BedSizeY = PrinterSettings.DisplayHeight;
file.HeaderSettings.BedSizeZ = PrinterSettings.MaxPrintHeight;
file.HeaderSettings.OverallHeightMilimeter = TotalHeight;
file.HeaderSettings.BottomExposureSeconds = MaterialSettings.InitialExposureTime;
file.HeaderSettings.BottomLayersCount = PrintSettings.FadedLayers;
file.HeaderSettings.BottomExposureSeconds = InitialExposureTime;
file.HeaderSettings.BottomLayersCount = InitialLayerCount;
file.HeaderSettings.BottomLightPWM = LookupCustomValue<ushort>("BottomLightPWM", file.HeaderSettings.BottomLightPWM);
file.HeaderSettings.LayerCount = LayerCount;
file.HeaderSettings.LayerExposureSeconds = MaterialSettings.ExposureTime;
file.HeaderSettings.LayerHeightMilimeter = PrintSettings.LayerHeight;
file.HeaderSettings.LayerExposureSeconds = LayerExposureTime;
file.HeaderSettings.LayerHeightMilimeter = LayerHeight;
file.HeaderSettings.LayerOffTime = LookupCustomValue<float>("LayerOffTime", file.HeaderSettings.LayerOffTime);
file.HeaderSettings.LightPWM = LookupCustomValue<ushort>("LightPWM", file.HeaderSettings.LightPWM);
file.HeaderSettings.PrintTime = (uint) OutputConfigSettings.PrintTime;
file.HeaderSettings.ProjectorType = PrinterSettings.DisplayMirrorX ? 1u : 0u;
file.HeaderSettings.ResolutionX = PrinterSettings.DisplayPixelsX;
file.HeaderSettings.ResolutionY = PrinterSettings.DisplayPixelsY;
//file.HeaderSettings.AntiAliasLevel = LookupCustomValue<uint>("AntiAliasLevel", 1);
file.HeaderSettings.ResolutionX = ResolutionX;
file.HeaderSettings.ResolutionY = ResolutionY;
file.PrintParametersSettings.BottomLayerCount = PrintSettings.FadedLayers;
file.PrintParametersSettings.BottomLiftHeight = LookupCustomValue<float>("BottomLiftHeight", file.PrintParametersSettings.BottomLiftHeight);
@@ -648,13 +651,13 @@ namespace PrusaSL1Reader
file.PrintParametersSettings.LiftingSpeed = LookupCustomValue<float>("LiftingSpeed", file.PrintParametersSettings.LiftingSpeed);
file.PrintParametersSettings.LightOffDelay = LookupCustomValue<float>("LightOffDelay", file.PrintParametersSettings.LightOffDelay);
file.PrintParametersSettings.RetractSpeed = LookupCustomValue<float>("RetractSpeed", file.PrintParametersSettings.RetractSpeed);
file.PrintParametersSettings.VolumeMl = OutputConfigSettings.UsedMaterial;
file.PrintParametersSettings.VolumeMl = UsedMaterial;
file.PrintParametersSettings.WeightG = (float) Math.Round(OutputConfigSettings.UsedMaterial * MaterialSettings.MaterialDensity, 2);
file.SlicerInfoSettings.MachineName = MachineName;
file.SlicerInfoSettings.MachineNameSize = (uint)MachineName.Length;
file.SetThumbnails(Thumbnails);
file.SlicerInfoSettings.MachineName = PrinterSettings.PrinterSettingsId;
file.SlicerInfoSettings.MachineNameSize = (uint) PrinterSettings.PrinterSettingsId.Length;
file.Layers = Layers;
if (LookupCustomValue<bool>("FLIP_XY", false, true))
{
@@ -662,12 +665,67 @@ namespace PrusaSL1Reader
file.HeaderSettings.ResolutionY = PrinterSettings.DisplayPixelsX;
}
file.Layers = Layers;
file.SetThumbnails(Thumbnails);
file.Encode(fileFullPath);
return true;
}
if (to == typeof(PHZFile))
{
PHZFile file = new PHZFile
{
Layers = Layers
};
file.HeaderSettings.Version = 2;
file.HeaderSettings.BedSizeX = PrinterSettings.DisplayWidth;
file.HeaderSettings.BedSizeY = PrinterSettings.DisplayHeight;
file.HeaderSettings.BedSizeZ = PrinterSettings.MaxPrintHeight;
file.HeaderSettings.OverallHeightMilimeter = TotalHeight;
file.HeaderSettings.BottomExposureSeconds = MaterialSettings.InitialExposureTime;
file.HeaderSettings.BottomLayersCount = PrintSettings.FadedLayers;
file.HeaderSettings.BottomLightPWM = LookupCustomValue<ushort>("BottomLightPWM", file.HeaderSettings.BottomLightPWM);
file.HeaderSettings.LayerCount = LayerCount;
file.HeaderSettings.LayerExposureSeconds = MaterialSettings.ExposureTime;
file.HeaderSettings.LayerHeightMilimeter = PrintSettings.LayerHeight;
file.HeaderSettings.LayerOffTime = LookupCustomValue<float>("LayerOffTime", file.HeaderSettings.LayerOffTime);
file.HeaderSettings.LightPWM = LookupCustomValue<ushort>("LightPWM", file.HeaderSettings.LightPWM);
file.HeaderSettings.PrintTime = (uint)OutputConfigSettings.PrintTime;
file.HeaderSettings.ProjectorType = PrinterSettings.DisplayMirrorX ? 1u : 0u;
file.HeaderSettings.ResolutionX = PrinterSettings.DisplayPixelsX;
file.HeaderSettings.ResolutionY = PrinterSettings.DisplayPixelsY;
file.HeaderSettings.BottomLayerCount = PrintSettings.FadedLayers;
file.HeaderSettings.BottomLiftHeight = LookupCustomValue<float>("BottomLiftHeight", file.HeaderSettings.BottomLiftHeight);
file.HeaderSettings.BottomLiftSpeed = LookupCustomValue<float>("BottomLiftSpeed", file.HeaderSettings.BottomLiftSpeed);
file.HeaderSettings.BottomLightOffDelay = LookupCustomValue<float>("BottomLightOffDelay", file.HeaderSettings.BottomLightOffDelay);
file.HeaderSettings.CostDollars = MaterialCost;
file.HeaderSettings.LiftHeight = LookupCustomValue<float>("LiftHeight", file.HeaderSettings.LiftHeight);
file.HeaderSettings.LiftingSpeed = LookupCustomValue<float>("LiftingSpeed", file.HeaderSettings.LiftingSpeed);
file.HeaderSettings.LayerOffTime = LookupCustomValue<float>("LayerOffTime", file.HeaderSettings.LayerOffTime);
file.HeaderSettings.RetractSpeed = LookupCustomValue<float>("RetractSpeed", file.HeaderSettings.RetractSpeed);
file.HeaderSettings.VolumeMl = OutputConfigSettings.UsedMaterial;
file.HeaderSettings.WeightG = (float)Math.Round(OutputConfigSettings.UsedMaterial * MaterialSettings.MaterialDensity, 2);
file.HeaderSettings.MachineName = MachineName;
file.HeaderSettings.MachineNameSize = (uint)MachineName.Length;
if (LookupCustomValue<bool>("FLIP_XY", false, true))
{
file.HeaderSettings.ResolutionX = ResolutionX;
file.HeaderSettings.ResolutionY = ResolutionY;
}
file.SetThumbnails(Thumbnails);
file.Encode(fileFullPath);
return true;
}
if (to == typeof(ZCodexFile))
{
TimeSpan ts = new TimeSpan(0, 0, (int)PrintTime);
@@ -724,7 +782,7 @@ namespace PrusaSL1Reader
{
PrintTime = (uint)PrintTime,
PrinterName = MachineName,
Materials = new List<ZCodexFile.ZCodeMetadata.MaterialsData>()
Materials = new List<ZCodexFile.ZCodeMetadata.MaterialsData>
{
new ZCodexFile.ZCodeMetadata.MaterialsData
{
@@ -736,11 +794,9 @@ namespace PrusaSL1Reader
}
},
},
Layers = Layers
};
file.SetThumbnails(Thumbnails);
file.Layers = Layers;
float usedMaterial = UsedMaterial / LayerCount;
for (uint layerIndex = 0; layerIndex < LayerCount; layerIndex++)
{
@@ -751,6 +807,7 @@ namespace PrusaSL1Reader
});
}
file.SetThumbnails(Thumbnails);
file.Encode(fileFullPath);
return true;
}
+2
View File
@@ -149,6 +149,8 @@ namespace PrusaSL1Reader
new FileExtension("zcodex", "ZCodex/Z-Suite Files")
};
public override Type[] ConvertToFormats { get; } = null;
public override PrintParameterModifier[] PrintParameterModifiers { get; } = {
PrintParameterModifier.InitialLayerCount,
PrintParameterModifier.InitialExposureSeconds,
+1 -1
View File
@@ -6,7 +6,7 @@ namespace PrusaSL1Viewer
{
public partial class FrmLoading : Form
{
private Stopwatch StopWatch { get; } = new Stopwatch();
public Stopwatch StopWatch { get; } = new Stopwatch();
public FrmLoading()
{
InitializeComponent();
+51 -24
View File
@@ -216,7 +216,7 @@ namespace PrusaSL1Viewer
FrmLoading.ShowDialog();
if (MessageBox.Show(
$"Extraction was successful, browser folder to see it contents.\n{finalPath}\nPress 'Yes' if you want open the target folder, otherwise select 'No' to continue.",
$"Extraction was successful ({FrmLoading.StopWatch.ElapsedMilliseconds/1000}s), browser folder to see it contents.\n{finalPath}\nPress 'Yes' if you want open the target folder, otherwise select 'No' to continue.",
"Extraction completed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
DialogResult.Yes)
{
@@ -514,24 +514,42 @@ namespace PrusaSL1Viewer
DisableGUI();
FrmLoading.SetDescription($"Converting {Path.GetFileName(SlicerFile.FileFullPath)} to {Path.GetExtension(dialog.FileName)}");
var task = Task.Factory.StartNew(() =>
Task<bool> task = Task<bool>.Factory.StartNew(() =>
{
SlicerFile.Convert(fileFormat, dialog.FileName);
Invoke((MethodInvoker)delegate {
// Running on the UI thread
EnableGUI(true);
});
bool result = false;
try
{
result = SlicerFile.Convert(fileFormat, dialog.FileName);
}
catch (Exception)
{
}
finally
{
Invoke((MethodInvoker)delegate {
// Running on the UI thread
EnableGUI(true);
});
}
return result;
});
FrmLoading.ShowDialog();
if (MessageBox.Show($"Convertion is completed: {Path.GetFileName(dialog.FileName)}\n" +
"Do you want open the converted file in a new window?",
"Convertion completed", MessageBoxButtons.YesNo,
MessageBoxIcon.Information) == DialogResult.Yes)
if (task.Result)
{
Program.NewInstance(dialog.FileName);
if (MessageBox.Show($"Convertion is completed: {Path.GetFileName(dialog.FileName)} in {FrmLoading.StopWatch.ElapsedMilliseconds/1000}s\n" +
"Do you want open the converted file in a new window?",
"Convertion completed", MessageBoxButtons.YesNo,
MessageBoxIcon.Information) == DialogResult.Yes)
{
Program.NewInstance(dialog.FileName);
}
}
else
{
MessageBox.Show("Convertion was unsuccessful! Maybe not implemented...", "Convertion unsuccessful", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -682,18 +700,27 @@ namespace PrusaSL1Viewer
return;
}
foreach (var fileFormat in FileFormat.AvaliableFormats)
if (!ReferenceEquals(SlicerFile.ConvertToFormats, null))
{
if (fileFormat.GetType() == SlicerFile.GetType()) continue;
string extensions = fileFormat.FileExtensions.Length > 0 ? $" ({fileFormat.GetFileExtensions()})" : string.Empty;
ToolStripMenuItem menuItem = new ToolStripMenuItem(fileFormat.GetType().Name.Replace("File", extensions))
foreach (var fileFormatType in SlicerFile.ConvertToFormats)
{
Tag = fileFormat,
Image = Properties.Resources.layers_16x16
};
menuItem.Click += ConvertToItemOnClick;
menuFileConvert.DropDownItems.Add(menuItem);
FileFormat fileFormat = FileFormat.FindByType(fileFormatType);
//if (fileFormat.GetType() == SlicerFile.GetType()) continue;
string extensions = fileFormat.FileExtensions.Length > 0
? $" ({fileFormat.GetFileExtensions()})"
: string.Empty;
ToolStripMenuItem menuItem =
new ToolStripMenuItem(fileFormat.GetType().Name.Replace("File", extensions))
{
Tag = fileFormat,
Image = Properties.Resources.layers_16x16
};
menuItem.Click += ConvertToItemOnClick;
menuFileConvert.DropDownItems.Add(menuItem);
}
menuFileConvert.Enabled = menuFileConvert.DropDownItems.Count > 0;
}
scLeft.Panel1Collapsed = SlicerFile.CreatedThumbnailsCount == 0;
@@ -726,7 +753,7 @@ namespace PrusaSL1Viewer
menuFileReload.Enabled =
menuFileClose.Enabled =
menuFileExtract.Enabled =
menuFileConvert.Enabled =
sbLayers.Enabled =
pbLayers.Enabled =
menuEdit.Enabled =
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.3.2.0")]
[assembly: AssemblyFileVersion("0.3.2.0")]
[assembly: AssemblyVersion("0.3.3.0")]
[assembly: AssemblyFileVersion("0.3.3.0")]
+5 -5
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.Net.Compilers.Toolset.3.6.0-3.final\build\Microsoft.Net.Compilers.Toolset.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.Toolset.3.6.0-3.final\build\Microsoft.Net.Compilers.Toolset.props')" />
<Import Project="..\packages\Microsoft.Net.Compilers.Toolset.3.6.0-4.final\build\Microsoft.Net.Compilers.Toolset.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.Toolset.3.6.0-4.final\build\Microsoft.Net.Compilers.Toolset.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -259,13 +259,13 @@
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy /y $(ProjectDir)..\LICENSE $(ProjectDir)$(OutDir)</PostBuildEvent>
</PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.Toolset.3.6.0-3.final\build\Microsoft.Net.Compilers.Toolset.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.Toolset.3.6.0-3.final\build\Microsoft.Net.Compilers.Toolset.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.Toolset.3.6.0-4.final\build\Microsoft.Net.Compilers.Toolset.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.Toolset.3.6.0-4.final\build\Microsoft.Net.Compilers.Toolset.props'))" />
</Target>
<PropertyGroup>
<PostBuildEvent>xcopy /y $(ProjectDir)..\LICENSE $(ProjectDir)$(OutDir)</PostBuildEvent>
</PropertyGroup>
</Project>
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BinarySerializer" version="8.5.1" targetFramework="net48" />
<package id="Microsoft.Net.Compilers.Toolset" version="3.6.0-3.final" targetFramework="net48" developmentDependency="true" />
<package id="Microsoft.Net.Compilers.Toolset" version="3.6.0-4.final" targetFramework="net48" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
<package id="SixLabors.Core" version="1.0.0-beta0008" targetFramework="net48" />
<package id="SixLabors.ImageSharp" version="1.0.0-rc0001" targetFramework="net48" />
@@ -0,0 +1,37 @@
# generated by PrusaSlicer 2.2.0+win64 on 2020-05-19 at 02:50:50 UTC
absolute_correction = 0
area_fill = 50
bed_custom_model =
bed_custom_texture =
bed_shape = 0x0,120x0,120x66,0x66
default_sla_material_profile = Prusa Orange Tough 0.05
default_sla_print_profile = 0.05 Normal
display_height = 66.04
display_mirror_x = 1
display_mirror_y = 0
display_orientation = portrait
display_pixels_x = 1920
display_pixels_y = 1080
display_width = 120.96
elefant_foot_compensation = 0.2
elefant_foot_min_width = 0.2
fast_tilt_time = 5
gamma_correction = 1
inherits = Original Prusa SL1
max_exposure_time = 120
max_initial_exposure_time = 300
max_print_height = 130
min_exposure_time = 1
min_initial_exposure_time = 1
print_host =
printer_model = SL1
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_SL1\nPRINTER_VENDOR_PHROZEN\nPRINTER_MODEL_SONICMINI\nSTART_CUSTOM_VALUES\nFLIP_XY\nLayerOffTime_7\nBottomLiftHeight_6\nBottomLiftSpeed_100\nLiftHeight_5\nLiftingSpeed_100\nRetractSpeed_200\nBottomLightOffDelay_7\nBottomLightPWM_255\nLightPWM_255\nEND_CUSTOM_VALUES
printer_settings_id =
printer_technology = SLA
printer_variant = default
printer_vendor =
printhost_apikey =
printhost_cafile =
relative_correction = 1,1
slow_tilt_time = 8
thumbnails = 400x400,800x480