diff --git a/PrusaSL1Reader/CbddlpFile.cs b/PrusaSL1Reader/CbddlpFile.cs index e2fad08..4035ae7 100644 --- a/PrusaSL1Reader/CbddlpFile.cs +++ b/PrusaSL1Reader/CbddlpFile.cs @@ -10,6 +10,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Security.Cryptography; using BinarySerialization; using SixLabors.ImageSharp; using SixLabors.ImageSharp.Advanced; @@ -182,13 +183,13 @@ namespace PrusaSL1Reader public PrintParameters PrintParametersSettings { get; protected internal set; } public MachineInfo MachineInfoSettings { get; protected internal set; } - //public string MachineName { get; protected internal set; } public Preview[] Previews { get; protected internal set; } public Layer[,] Layers { get; private set; } private uint CurrentOffset { get; set; } + private uint LayerDataCurrentOffset { get; set; } #endregion @@ -219,10 +220,10 @@ namespace PrusaSL1Reader //HeaderSettings.PreviewOneOffsetAddress = CurrentOffset; HeaderSettings.PrintParametersSize = (uint)Helpers.Serializer.SizeOf(PrintParametersSettings); - Helpers.SerializeWriteFileStream(OutputFile, HeaderSettings); + //CurrentOffset = Helpers.SerializeWriteFileStream(OutputFile, HeaderSettings); + + OutputFile.Seek((int)CurrentOffset, SeekOrigin.Begin); - //OutputFile.Seek((int)HeaderSettings.PreviewOneOffsetAddress, SeekOrigin.Begin); - /*for (int i = 0; i < ThumbnailsCount; i++) { @@ -295,37 +296,29 @@ namespace PrusaSL1Reader Previews[i] = preview; - using (MemoryStream stream = Helpers.Serialize(preview)) - { - OutputFile.Write(stream.GetBuffer()); - } - - OutputFile.Write(rawData.ToArray()); - - CurrentOffset += (uint)rawData.Count; - } - */ + Helpers.SerializeWriteFileStream(OutputFile, preview); + CurrentOffset += Helpers.SerializeWriteFileStream(OutputFile, rawData.ToArray()); + }*/ + if (HeaderSettings.Version == 2) { HeaderSettings.PrintParametersOffsetAddress = CurrentOffset; - Helpers.SerializeWriteFileStream(OutputFile, PrintParametersSettings); + CurrentOffset += Helpers.SerializeWriteFileStream(OutputFile, PrintParametersSettings); - CurrentOffset += (uint) (Helpers.Serializer.SizeOf(PrintParametersSettings) + - Helpers.Serializer.SizeOf(MachineInfoSettings) - - MachineInfoSettings.MachineNameSize); + MachineInfoSettings.MachineNameAddress = (uint)(CurrentOffset + Helpers.Serializer.SizeOf(MachineInfoSettings) - + MachineInfoSettings.MachineNameSize); - MachineInfoSettings.MachineNameAddress = CurrentOffset; - Helpers.SerializeWriteFileStream(OutputFile, MachineInfoSettings); - - CurrentOffset += MachineInfoSettings.MachineNameSize; + CurrentOffset += Helpers.SerializeWriteFileStream(OutputFile, MachineInfoSettings); } HeaderSettings.LayersDefinitionOffsetAddress = CurrentOffset; + LayerDataCurrentOffset = CurrentOffset + (uint)Helpers.Serializer.SizeOf(new Layer()) * HeaderSettings.LayerCount * HeaderSettings.AntiAliasLevel; } + public override void InsertLayerImageEncode(Image image, uint layerIndex) { Layer layer = new Layer(); @@ -347,13 +340,15 @@ namespace PrusaSL1Reader if (prevColor == byte.MaxValue) prevColor = color; bool isLastPixel = x == (image.Width - 1) && y == (image.Height - 1); - if (color == prevColor && nrOfColor< 0x7D && !isLastPixel) + if (color == prevColor && nrOfColor < 0x7D && !isLastPixel) { nrOfColor++; } else { - byte encValue = (byte)((prevColor << 7) | nrOfColor); // push color (B/W) to highest bit and repetitions to lowest 7 bits. + byte encValue = + (byte) ((prevColor << 7) | + nrOfColor); // push color (B/W) to highest bit and repetitions to lowest 7 bits. rawData.Add(encValue); prevColor = color; nrOfColor = 1; @@ -361,19 +356,20 @@ namespace PrusaSL1Reader } } - CurrentOffset += (uint)Helpers.Serializer.SizeOf(layer); - layer.DataAddress = CurrentOffset; + //layer.DataAddress = CurrentOffset + (uint)Helpers.Serializer.SizeOf(layer); + layer.DataAddress = LayerDataCurrentOffset; layer.DataSize = (uint)rawData.Count; layer.LayerPositionZ = layerIndex * HeaderSettings.LayerHeightMilimeter; layer.LayerOffTimeSeconds = layerIndex < HeaderSettings.BottomLayersCount ? PrintParametersSettings.BottomLightOffDelay : PrintParametersSettings.LightOffDelay; layer.LayerExposure = layerIndex < HeaderSettings.BottomLayersCount ? HeaderSettings.BottomExposureSeconds : HeaderSettings.LayerExposureSeconds; - Layers[layerIndex, 0] = layer; + Layers[layerIndex, 0] = layer; - Helpers.SerializeWriteFileStream(OutputFile, layer); - Helpers.WriteFileStream(OutputFile, rawData.ToArray()); - - CurrentOffset += (uint)rawData.Count; + CurrentOffset += Helpers.SerializeWriteFileStream(OutputFile, layer); + + OutputFile.Seek(LayerDataCurrentOffset, SeekOrigin.Begin); + LayerDataCurrentOffset += Helpers.WriteFileStream(OutputFile, rawData.ToArray()); + OutputFile.Seek(CurrentOffset, SeekOrigin.Begin); } public override void EndEncode() diff --git a/PrusaSL1Reader/Helpers.cs b/PrusaSL1Reader/Helpers.cs index 1dfd138..5fb37fa 100644 --- a/PrusaSL1Reader/Helpers.cs +++ b/PrusaSL1Reader/Helpers.cs @@ -5,6 +5,8 @@ * Everyone is permitted to copy and distribute verbatim copies * of this license document, but changing it is not allowed. */ + +using System; using System.IO; using System.Runtime.InteropServices; using System.Runtime.Serialization.Formatters.Binary; @@ -15,6 +17,10 @@ namespace PrusaSL1Reader { public static class Helpers { + public static Type[] AvaliableFileFormats { get; } = { + typeof(SL1File), + typeof(CbddlpFile) + }; public static BinarySerializer Serializer { get; } = new BinarySerializer {Endianness = Endianness.Little }; public static Gray8 Gray8White { get; } = new Gray8(255); public static T ByteToType(BinaryReader reader) @@ -56,22 +62,22 @@ namespace PrusaSL1Reader return Helpers.Serializer.Deserialize(stream); } - public static int WriteFileStream(FileStream fs, MemoryStream stream, uint offset = 0) + public static uint WriteFileStream(FileStream fs, MemoryStream stream, uint offset = 0) { - return WriteFileStream(fs, stream.GetBuffer(), offset); + return WriteFileStream(fs, stream.ToArray(), offset); } - public static int WriteFileStream(FileStream fs, byte[] bytes, uint offset = 0) + public static uint WriteFileStream(FileStream fs, byte[] bytes, uint offset = 0) { fs.Write(bytes, 0, bytes.Length); - return bytes.Length; + return (uint)bytes.Length; } - public static int SerializeWriteFileStream(FileStream fs, object value, uint offset = 0) + public static uint SerializeWriteFileStream(FileStream fs, object value, uint offset = 0) { using (MemoryStream stream = Helpers.Serialize(value)) { - return Helpers.WriteFileStream(fs, stream); + return (uint)Helpers.WriteFileStream(fs, stream); } } } diff --git a/PrusaSL1Reader/SL1File.cs b/PrusaSL1Reader/SL1File.cs index 283de7b..c6d065e 100644 --- a/PrusaSL1Reader/SL1File.cs +++ b/PrusaSL1Reader/SL1File.cs @@ -15,7 +15,6 @@ using System.Linq; using System.Reflection; using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing; namespace PrusaSL1Reader { @@ -282,6 +281,12 @@ namespace PrusaSL1Reader #endregion #region Overrides + + public override string FileFullPath { get; protected set; } + + public override FileExtension[] ValidFiles { get; } = { + new FileExtension("sl1", "Prusa SL1 Files") + }; public override bool Equals(object obj) { return Equals(obj as SL1File); @@ -314,13 +319,9 @@ namespace PrusaSL1Reader } #endregion - #region Functions + #region Methods - public override string FileFullPath { get; protected set; } - - public override FileExtension[] ValidFiles { get; } = { - new FileExtension("sl1", "Prusa SL1 Files") - }; + private List> images = new List>(); @@ -492,6 +493,11 @@ namespace PrusaSL1Reader }, }; + if (LookupCustomValue("FLIP_XY", false, true)) + { + file.HeaderSettings.ResolutionX = PrinterSettings.DisplayPixelsY; + file.HeaderSettings.ResolutionY = PrinterSettings.DisplayPixelsX; + } file.BeginEncode(fileFullPath); @@ -507,15 +513,19 @@ namespace PrusaSL1Reader return false; } - public T LookupCustomValue(string name, T defaultValue) + public T LookupCustomValue(string name, T defaultValue, bool existsOnly = false) { string result = string.Empty; - name += '_'; + if(!existsOnly) + name += '_'; int index = PrinterSettings.PrinterNotes.IndexOf(name, StringComparison.Ordinal); + + int startIndex = index + name.Length; - + if (index < 0 || PrinterSettings.PrinterNotes.Length < startIndex) return defaultValue; + if (existsOnly) return "true".Convert(); for (int i = startIndex; i < PrinterSettings.PrinterNotes.Length; i++) { char c = PrinterSettings.PrinterNotes[i]; @@ -532,7 +542,7 @@ namespace PrusaSL1Reader #endregion - #region Static Functions + #region Static Methods public static string IniKeyToMemberName(string keyName) { string memberName = string.Empty; diff --git a/PrusaSL1Viewer/FrmMain.Designer.cs b/PrusaSL1Viewer/FrmMain.Designer.cs index 660b61d..c132f4c 100644 --- a/PrusaSL1Viewer/FrmMain.Designer.cs +++ b/PrusaSL1Viewer/FrmMain.Designer.cs @@ -39,6 +39,7 @@ this.menuFileExit = new System.Windows.Forms.ToolStripMenuItem(); this.menuEdit = new System.Windows.Forms.ToolStripMenuItem(); this.menuEditExtract = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditConvert = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuAboutWebsite = new System.Windows.Forms.ToolStripMenuItem(); this.menuAboutDonate = new System.Windows.Forms.ToolStripMenuItem(); @@ -56,7 +57,6 @@ this.scCenter = new System.Windows.Forms.SplitContainer(); this.pbLayer = new System.Windows.Forms.PictureBox(); this.pbLayers = new System.Windows.Forms.ProgressBar(); - this.menuEditConvert = new System.Windows.Forms.ToolStripMenuItem(); this.menu.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); @@ -129,11 +129,20 @@ this.menuEditExtract.Enabled = false; this.menuEditExtract.Image = global::PrusaSL1Viewer.Properties.Resources.Extract_object_16x16; this.menuEditExtract.Name = "menuEditExtract"; - this.menuEditExtract.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); - this.menuEditExtract.Size = new System.Drawing.Size(181, 22); + this.menuEditExtract.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Alt) + | System.Windows.Forms.Keys.E))); + this.menuEditExtract.Size = new System.Drawing.Size(180, 22); this.menuEditExtract.Text = "&Extract"; this.menuEditExtract.Click += new System.EventHandler(this.MenuItemClicked); // + // menuEditConvert + // + this.menuEditConvert.Enabled = false; + this.menuEditConvert.Image = global::PrusaSL1Viewer.Properties.Resources.Convert_16x16; + this.menuEditConvert.Name = "menuEditConvert"; + this.menuEditConvert.Size = new System.Drawing.Size(180, 22); + this.menuEditConvert.Text = "&Convert To"; + // // helpToolStripMenuItem // this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -204,7 +213,7 @@ this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 1; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 737F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(1631, 737); this.tableLayoutPanel1.TabIndex = 5; // @@ -351,15 +360,6 @@ this.pbLayers.Step = 1; this.pbLayers.TabIndex = 6; // - // menuEditConvert - // - this.menuEditConvert.Name = "menuEditConvert"; - this.menuEditConvert.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Alt) - | System.Windows.Forms.Keys.C))); - this.menuEditConvert.Size = new System.Drawing.Size(181, 22); - this.menuEditConvert.Text = "&Convert"; - this.menuEditConvert.Click += new System.EventHandler(this.MenuItemClicked); - // // FrmMain // this.AllowDrop = true; diff --git a/PrusaSL1Viewer/FrmMain.cs b/PrusaSL1Viewer/FrmMain.cs index 0b7d3de..86c6625 100644 --- a/PrusaSL1Viewer/FrmMain.cs +++ b/PrusaSL1Viewer/FrmMain.cs @@ -7,7 +7,6 @@ */ using System; using System.Diagnostics; -using System.Drawing; using System.IO; using System.IO.Compression; using System.Reflection; @@ -25,11 +24,24 @@ namespace PrusaSL1Viewer InitializeComponent(); Text = $"{FrmAbout.AssemblyTitle} Version: {FrmAbout.AssemblyVersion}"; + foreach (var type in Helpers.AvaliableFileFormats) + { + if(type == typeof(SL1File)) continue; + ToolStripMenuItem menuItem = new ToolStripMenuItem(type.Name.Replace("File", string.Empty)) + { + Tag = type, + Image = Properties.Resources.layers_16x16 + }; + menuItem.Click += ConvertToItemOnClick; + menuEditConvert.DropDownItems.Add(menuItem); + } + DragEnter += (s, e) => { if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropEffects.Copy; }; DragDrop += (s, e) => { ProcessFile((string[])e.Data.GetData(DataFormats.FileDrop)); }; ProcessFile(Environment.GetCommandLineArgs()); } + #endregion #region Events @@ -38,8 +50,6 @@ namespace PrusaSL1Viewer ShowLayer((uint)(sbLayers.Maximum - sbLayers.Value)); } - - private void MenuItemClicked(object sender, EventArgs e) { if (ReferenceEquals(sender, menuFileOpen)) @@ -79,6 +89,19 @@ namespace PrusaSL1Viewer { try { + if (Directory.Exists(folder.SelectedPath)) + { + DirectoryInfo di = new DirectoryInfo(folder.SelectedPath); + + foreach (FileInfo file in di.GetFiles()) + { + file.Delete(); + } + foreach (DirectoryInfo dir in di.GetDirectories()) + { + dir.Delete(true); + } + } Program.SL1File.Archive.ExtractToDirectory(folder.SelectedPath); if (MessageBox.Show( $"Extraction was successful, browser folder to see it contents.\n{folder.SelectedPath}\nPress 'Yes' if you want open the target folder, otherwise select 'No' to continue.", @@ -98,27 +121,6 @@ namespace PrusaSL1Viewer return; } - if (ReferenceEquals(sender, menuEditConvert)) - { - using (SaveFileDialog dialog = new SaveFileDialog()) - { - dialog.FileName = Path.GetFileNameWithoutExtension(Program.SL1File.FileFullPath); - using (CbddlpFile file = new CbddlpFile()) - { - dialog.Filter = file.GetFileFilter(); - } - - - if (dialog.ShowDialog() == DialogResult.OK) - { - Program.SL1File.Convert(typeof(CbddlpFile), dialog.FileName); - } - - } - - return; - } - if (ReferenceEquals(sender, menuAboutAbout)) { Program.FrmAbout.ShowDialog(); @@ -138,6 +140,29 @@ namespace PrusaSL1Viewer return; } } + + private void ConvertToItemOnClick(object sender, EventArgs e) + { + ToolStripMenuItem menuItem = (ToolStripMenuItem)sender; + Type type = (Type)menuItem.Tag; + using (SaveFileDialog dialog = new SaveFileDialog()) + { + dialog.FileName = Path.GetFileNameWithoutExtension(Program.SL1File.FileFullPath); + + using (FileFormat instance = (FileFormat)Activator.CreateInstance(type)) + //using (CbddlpFile file = new CbddlpFile()) + { + dialog.Filter = instance.GetFileFilter(); + } + + + if (dialog.ShowDialog() == DialogResult.OK) + { + Program.SL1File.Convert(type, dialog.FileName); + } + + } + } #endregion #region Methods @@ -178,7 +203,10 @@ namespace PrusaSL1Viewer sbLayers.Maximum = (int)Program.SL1File.GetLayerCount-1; sbLayers.Value = sbLayers.Maximum; - sbLayers.Enabled = menuEdit.Enabled = menuEditExtract.Enabled = true; + sbLayers.Enabled = + menuEdit.Enabled = + menuEditExtract.Enabled = + menuEditConvert.Enabled = true; lvProperties.BeginUpdate(); lvProperties.Items.Clear(); @@ -238,7 +266,5 @@ namespace PrusaSL1Viewer statusBar.Items.Add(label); } #endregion - - } } diff --git a/PrusaSL1Viewer/ImageSharpExtensions.cs b/PrusaSL1Viewer/ImageSharpExtensions.cs index 4366112..fe91543 100644 --- a/PrusaSL1Viewer/ImageSharpExtensions.cs +++ b/PrusaSL1Viewer/ImageSharpExtensions.cs @@ -1,4 +1,11 @@ -using System.IO; +/* + * GNU AFFERO GENERAL PUBLIC LICENSE + * Version 3, 19 November 2007 + * Copyright (C) 2007 Free Software Foundation, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ +using System.IO; using SixLabors.ImageSharp; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.Formats.Png; diff --git a/PrusaSL1Viewer/Images/Convert-16x16.png b/PrusaSL1Viewer/Images/Convert-16x16.png new file mode 100644 index 0000000..75ea569 Binary files /dev/null and b/PrusaSL1Viewer/Images/Convert-16x16.png differ diff --git a/PrusaSL1Viewer/Images/Screenshots/SL1ToCbddlp.png b/PrusaSL1Viewer/Images/Screenshots/SL1ToCbddlp.png new file mode 100644 index 0000000..4da7c62 Binary files /dev/null and b/PrusaSL1Viewer/Images/Screenshots/SL1ToCbddlp.png differ diff --git a/PrusaSL1Viewer/Images/layers-16x16.png b/PrusaSL1Viewer/Images/layers-16x16.png new file mode 100644 index 0000000..efc9a32 Binary files /dev/null and b/PrusaSL1Viewer/Images/layers-16x16.png differ diff --git a/PrusaSL1Viewer/Program.cs b/PrusaSL1Viewer/Program.cs index e789378..e6afefa 100644 --- a/PrusaSL1Viewer/Program.cs +++ b/PrusaSL1Viewer/Program.cs @@ -6,13 +6,8 @@ * of this license document, but changing it is not allowed. */ using System; -using System.Drawing; -using System.IO; -using System.Runtime.InteropServices; -using System.Text; using System.Windows.Forms; using PrusaSL1Reader; -using SixLabors.ImageSharp; namespace PrusaSL1Viewer { @@ -34,16 +29,14 @@ namespace PrusaSL1Viewer FrmAbout = new FrmAbout(); Application.Run(FrmMain); - CbddlpFile file = new CbddlpFile(); + //CbddlpFile file = new CbddlpFile(); //file.Decode(@"D:\Tiago\Desktop\_Coronavirus-v6-HIRES-Supports_NOAA.cbddlp"); - //file.Decode(@"D:\Tiago\Desktop\coronanew11.cbddlp"); - /*file.GetLayerImage(0).Save(@"D:\img0.png"); - file.GetLayerImage(10).Save(@"D:\img10.png"); - file.GetLayerImage(20).Save(@"D:\img20.png"); - file.GetLayerImage(50).Save(@"D:\img50.png");*/ - - //LayerPositionZ: 0, LayerExposure: 35, LayerOffTimeSeconds: 0, DataAddress: 283641, DataSize: 30804, Unknown1: 0, Unknown2: 0, Unknown3: 0, Unknown4: 0 + /*file.Decode(@"D:\Tiago\Desktop\coronanew11.cbddlp"); + file.GetLayerImage(0).Save(@"D:\img-new-0.png"); + file.GetLayerImage(10).Save(@"D:\img-new-10.png"); + file.GetLayerImage(20).Save(@"D:\img-new-20.png"); + file.GetLayerImage(50).Save(@"D:\img-new-50.png");*/ } } } diff --git a/PrusaSL1Viewer/Properties/Resources.Designer.cs b/PrusaSL1Viewer/Properties/Resources.Designer.cs index d029123..72e9f34 100644 --- a/PrusaSL1Viewer/Properties/Resources.Designer.cs +++ b/PrusaSL1Viewer/Properties/Resources.Designer.cs @@ -70,6 +70,16 @@ namespace PrusaSL1Viewer.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Convert_16x16 { + get { + object obj = ResourceManager.GetObject("Convert-16x16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -110,6 +120,16 @@ namespace PrusaSL1Viewer.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap layers_16x16 { + get { + object obj = ResourceManager.GetObject("layers-16x16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/PrusaSL1Viewer/Properties/Resources.resx b/PrusaSL1Viewer/Properties/Resources.resx index e96a580..d18193f 100644 --- a/PrusaSL1Viewer/Properties/Resources.resx +++ b/PrusaSL1Viewer/Properties/Resources.resx @@ -121,6 +121,12 @@ ..\Images\Open-16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\PrusaSL1Viewer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Images\Convert-16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Images\Button-Info-16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -136,7 +142,7 @@ ..\Images\Extract-object-16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\PrusaSL1Viewer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Images\layers-16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/PrusaSL1Viewer/PrusaSL1Viewer.csproj b/PrusaSL1Viewer/PrusaSL1Viewer.csproj index 0c3c766..198223f 100644 --- a/PrusaSL1Viewer/PrusaSL1Viewer.csproj +++ b/PrusaSL1Viewer/PrusaSL1Viewer.csproj @@ -195,6 +195,8 @@ + + diff --git a/README.md b/README.md index c1141ba..92bbadb 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,29 @@ But also, i need victims for test subject. Proceed at your own risk! * View thumbnail * View all used settings * Export file to a folder -* Portable (2 files only) +* Convert SL1 format to another format +* Portable (No installation needed) + +## Known Formats + +* SL1 (Prusa SL1) +* CBDDLP (Chitubox DLP) + +## Configure printer under PrusaSlicer + +1. Import Epax X1 printer (PrusaSlicer -> printers) +1. Duplicate and tune the values if required +1. Look up under "Printer -> Notes" and configure parameters from target slicer +1. Change only the value after the "_" (underscore) + +## Custom "Printer Notes" keywords + +* **FLIP_XY** Flip X with Y resolution, this is required in some cases, it will not affect Prusa output, only used for convertions to another format, use this if you have to use inverted XY under printer settings (Epax for example). + +## File Convertion + +I highly recommend open the converted file into original slicer and check if it's okay to print, on this beta stage never blind trust the program. +After some tests without failure you can increase your confidence and ignore this stage, or maybe not ;) ## Requirements @@ -64,8 +86,10 @@ Are you a developer? This project include a .NET Core library (PrusaSL1Reader) t ## TODO -* Convert SL1 files to another slicer file format -* Add printer profiles +* Speed up layer preview +* Put convert operation under a task (No GUI freeze) +* More file formats +* Clean up (always) ## Support my work / Donate