mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-08 17:42:31 +02:00
v0.2
This commit is contained in:
@@ -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<Gray8> 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()
|
||||
|
||||
@@ -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<T>(BinaryReader reader)
|
||||
@@ -56,22 +62,22 @@ namespace PrusaSL1Reader
|
||||
return Helpers.Serializer.Deserialize<T>(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+21
-11
@@ -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<Image<Gray8>> images = new List<Image<Gray8>>();
|
||||
|
||||
@@ -492,6 +493,11 @@ namespace PrusaSL1Reader
|
||||
},
|
||||
};
|
||||
|
||||
if (LookupCustomValue<bool>("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<T>(string name, T defaultValue)
|
||||
public T LookupCustomValue<T>(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<T>();
|
||||
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;
|
||||
|
||||
Generated
+13
-13
@@ -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;
|
||||
|
||||
+53
-27
@@ -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
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
using System.IO;
|
||||
/*
|
||||
* 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.IO;
|
||||
using SixLabors.ImageSharp;
|
||||
using SixLabors.ImageSharp.Advanced;
|
||||
using SixLabors.ImageSharp.Formats.Png;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 788 B |
Binary file not shown.
|
After Width: | Height: | Size: 114 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 459 B |
@@ -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");*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+20
@@ -70,6 +70,16 @@ namespace PrusaSL1Viewer.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Convert_16x16 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Convert-16x16", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -110,6 +120,16 @@ namespace PrusaSL1Viewer.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap layers_16x16 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("layers-16x16", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
||||
@@ -121,6 +121,12 @@
|
||||
<data name="Open-16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\Open-16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="PrusaSL1Viewer" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\PrusaSL1Viewer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Convert-16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\Convert-16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Button-Info-16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\Button-Info-16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
@@ -136,7 +142,7 @@
|
||||
<data name="Extract-object-16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\Extract-object-16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="PrusaSL1Viewer" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\PrusaSL1Viewer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="layers-16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\layers-16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -195,6 +195,8 @@
|
||||
<None Include="Images\Button-Info-16x16.png" />
|
||||
<None Include="Images\Donate-16x16.png" />
|
||||
<None Include="Images\Global-Network-icon-16x16.png" />
|
||||
<None Include="Images\Convert-16x16.png" />
|
||||
<None Include="Images\layers-16x16.png" />
|
||||
<Content Include="PrusaSL1Viewer.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user