First commit
@@ -0,0 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## 06/04/2020 - V0.1 - Beta
|
||||
|
||||
* First release for testing
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace PrusaSL1Reader
|
||||
{
|
||||
public static class About
|
||||
{
|
||||
public static string Author = "Tiago Conceição";
|
||||
public static string Company = "PTRTECH";
|
||||
public static string Website = "https://github.com/sn4k3/PrusaSL1Viewer";
|
||||
public static string Donate = "https://paypal.me/SkillTournament";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace PrusaSL1Reader
|
||||
{
|
||||
public class CbddlpFile : FileFormat
|
||||
{
|
||||
const uint SPI_FILE_MAGIC_BASE = 0x12FD0000;
|
||||
const int SPECIAL_BIT = 1 << 1;
|
||||
const int SPECIAL_BIT_MASK = ~SPECIAL_BIT;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct Header
|
||||
{
|
||||
public uint Magic;
|
||||
public uint Version;
|
||||
public float BedSizeX;
|
||||
public float BedSizeY;
|
||||
public float BedSizeZ;
|
||||
public uint Unknown1;
|
||||
public uint Unknown2;
|
||||
public uint Unknown3;
|
||||
public float LayerHeightMilimeter;
|
||||
public float LayerExposureSeconds;
|
||||
public float BottomExposureSeconds;
|
||||
public float LayerOffTime;
|
||||
public uint BottomLayersCount;
|
||||
public uint ResolutionX;
|
||||
public uint ResolutionY;
|
||||
public uint PreviewOneOffsetAddress;
|
||||
public uint LayersDefinitionOffsetAddress;
|
||||
public uint LayerCount;
|
||||
public uint PreviewTwoOffsetAddress;
|
||||
public uint PrintTime;
|
||||
public uint ProjectorType;
|
||||
public uint PrintParametersOffsetAddress;
|
||||
public uint PrintParametersSize;
|
||||
public uint AntiAliasLevel;
|
||||
public ushort LightPWM;
|
||||
public ushort BottomLightPWM;
|
||||
public uint Padding1;
|
||||
public uint Padding2;
|
||||
public uint Padding3;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(Magic)}: {Magic}, {nameof(Version)}: {Version}, {nameof(BedSizeX)}: {BedSizeX}, {nameof(BedSizeY)}: {BedSizeY}, {nameof(BedSizeZ)}: {BedSizeZ}, {nameof(Unknown1)}: {Unknown1}, {nameof(Unknown2)}: {Unknown2}, {nameof(Unknown3)}: {Unknown3}, {nameof(LayerHeightMilimeter)}: {LayerHeightMilimeter}, {nameof(LayerExposureSeconds)}: {LayerExposureSeconds}, {nameof(BottomExposureSeconds)}: {BottomExposureSeconds}, {nameof(LayerOffTime)}: {LayerOffTime}, {nameof(BottomLayersCount)}: {BottomLayersCount}, {nameof(ResolutionX)}: {ResolutionX}, {nameof(ResolutionY)}: {ResolutionY}, {nameof(PreviewOneOffsetAddress)}: {PreviewOneOffsetAddress}, {nameof(LayersDefinitionOffsetAddress)}: {LayersDefinitionOffsetAddress}, {nameof(LayerCount)}: {LayerCount}, {nameof(PreviewTwoOffsetAddress)}: {PreviewTwoOffsetAddress}, {nameof(PrintTime)}: {PrintTime}, {nameof(ProjectorType)}: {ProjectorType}, {nameof(PrintParametersOffsetAddress)}: {PrintParametersOffsetAddress}, {nameof(PrintParametersSize)}: {PrintParametersSize}, {nameof(AntiAliasLevel)}: {AntiAliasLevel}, {nameof(LightPWM)}: {LightPWM}, {nameof(BottomLightPWM)}: {BottomLightPWM}, {nameof(Padding1)}: {Padding1}, {nameof(Padding2)}: {Padding2}, {nameof(Padding3)}: {Padding3}";
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct PrintParameters
|
||||
{
|
||||
public float BottomLiftHeight;
|
||||
public float BottomLiftSpeed;
|
||||
public float LiftHeight;
|
||||
public float LiftingSpeed;
|
||||
public float RetractSpeed;
|
||||
public float VolumeMl;
|
||||
public float WeightG;
|
||||
public float CostDollars;
|
||||
public float BottomLightOffDelay;
|
||||
public float LightOffDelay;
|
||||
public uint BottomLayerCount;
|
||||
public uint P1;
|
||||
public uint P2;
|
||||
public uint P3;
|
||||
public uint P4;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(BottomLiftHeight)}: {BottomLiftHeight}, {nameof(BottomLiftSpeed)}: {BottomLiftSpeed}, {nameof(LiftHeight)}: {LiftHeight}, {nameof(LiftingSpeed)}: {LiftingSpeed}, {nameof(RetractSpeed)}: {RetractSpeed}, {nameof(VolumeMl)}: {VolumeMl}, {nameof(WeightG)}: {WeightG}, {nameof(CostDollars)}: {CostDollars}, {nameof(BottomLightOffDelay)}: {BottomLightOffDelay}, {nameof(LightOffDelay)}: {LightOffDelay}, {nameof(BottomLayerCount)}: {BottomLayerCount}, {nameof(P1)}: {P1}, {nameof(P2)}: {P2}, {nameof(P3)}: {P3}, {nameof(P4)}: {P4}";
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct Layer
|
||||
{
|
||||
public float LayerPositionZ;
|
||||
public float LayerExposure;
|
||||
public float LayerOffTimeSeconds;
|
||||
public uint DataAddress;
|
||||
public uint DataSize;
|
||||
public uint Unknown1;
|
||||
public uint Unknown2;
|
||||
public uint Unknown3;
|
||||
public uint Unknown4;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(LayerPositionZ)}: {LayerPositionZ}, {nameof(LayerExposure)}: {LayerExposure}, {nameof(LayerOffTimeSeconds)}: {LayerOffTimeSeconds}, {nameof(DataAddress)}: {DataAddress}, {nameof(DataSize)}: {DataSize}, {nameof(Unknown1)}: {Unknown1}, {nameof(Unknown2)}: {Unknown2}, {nameof(Unknown3)}: {Unknown3}, {nameof(Unknown4)}: {Unknown4}";
|
||||
}
|
||||
}
|
||||
|
||||
public Header HeaderSettings { get; private set; }
|
||||
public PrintParameters PrintParametersSettings { get; private set; }
|
||||
|
||||
public List<Layer> Layers { get; } = new List<Layer>();
|
||||
|
||||
|
||||
public override string FileExtension { get; } = "cbddlp";
|
||||
public override string FileExtensionName { get; } = "Chitubox DLP Files";
|
||||
public override void Load(string fileFullPath)
|
||||
{
|
||||
FileValidation(fileFullPath);
|
||||
FileFullPath = fileFullPath;
|
||||
|
||||
Layers.Clear();
|
||||
|
||||
BinaryReader binReader = new BinaryReader(File.Open(FileFullPath, FileMode.Open));
|
||||
|
||||
HeaderSettings = Helpers.ByteToType<CbddlpFile.Header>(binReader);
|
||||
if (HeaderSettings.Magic != (SPI_FILE_MAGIC_BASE | 0x19))
|
||||
{
|
||||
throw new FileLoadException("Not a valid CBDDLP file!", fileFullPath);
|
||||
}
|
||||
|
||||
Debug.WriteLine(HeaderSettings);
|
||||
|
||||
if (HeaderSettings.Version == 2)
|
||||
{
|
||||
binReader.BaseStream.Seek(HeaderSettings.PrintParametersOffsetAddress, SeekOrigin.Begin);
|
||||
PrintParametersSettings = Helpers.ByteToType<CbddlpFile.PrintParameters>(binReader);
|
||||
Debug.WriteLine(PrintParametersSettings);
|
||||
}
|
||||
|
||||
uint aaLevel = HeaderSettings.Version == 1 ? 1 : HeaderSettings.AntiAliasLevel;
|
||||
|
||||
uint layerOffset = HeaderSettings.LayersDefinitionOffsetAddress;
|
||||
|
||||
for (int image = 1; image <= HeaderSettings.AntiAliasLevel; image++)
|
||||
{
|
||||
if (HeaderSettings.AntiAliasLevel > 1) Debug.WriteLine("Image GROUP " + image + "----");
|
||||
for (int i = 0; i < HeaderSettings.LayerCount; i++)
|
||||
{
|
||||
binReader.BaseStream.Seek(layerOffset, SeekOrigin.Begin);
|
||||
Layer layer = Helpers.ByteToType<CbddlpFile.Layer>(binReader);
|
||||
Layers.Add(layer);
|
||||
|
||||
layerOffset += (uint)Marshal.SizeOf((object)layer);
|
||||
Debug.WriteLine("LAYER " + i);
|
||||
Debug.WriteLine(layer);
|
||||
}
|
||||
}
|
||||
|
||||
binReader.Close();
|
||||
binReader.Dispose();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override float GetHeightFromLayer(uint layerNum)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace PrusaSL1Reader
|
||||
{
|
||||
public abstract class FileFormat : IFileFormat
|
||||
{
|
||||
public string FileFullPath { get; protected set; }
|
||||
public abstract string FileExtension { get; }
|
||||
public abstract string FileExtensionName { get; }
|
||||
public abstract void Load(string fileFullPath);
|
||||
public abstract float GetHeightFromLayer(uint layerNum);
|
||||
|
||||
public void FileValidation(string fileFullPath)
|
||||
{
|
||||
if (ReferenceEquals(fileFullPath, null)) throw new ArgumentNullException(nameof(FileFullPath), "fullFilePath can't be null.");
|
||||
if (!File.Exists(fileFullPath)) throw new FileNotFoundException("The specified file does not exists.", fileFullPath);
|
||||
if (!Path.GetExtension(fileFullPath).Equals($".{FileExtension}")) throw new FileLoadException($"The specified file is not valid, can only open {FileExtension} files.", fileFullPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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 System.Runtime.InteropServices;
|
||||
|
||||
namespace PrusaSL1Reader
|
||||
{
|
||||
public static class Helpers
|
||||
{
|
||||
public static T ByteToType<T>(BinaryReader reader)
|
||||
{
|
||||
byte[] bytes = reader.ReadBytes(Marshal.SizeOf(typeof(T)));
|
||||
|
||||
GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
|
||||
T theStructure = (T)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T));
|
||||
handle.Free();
|
||||
|
||||
return theStructure;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
namespace PrusaSL1Reader
|
||||
{
|
||||
public interface IFileFormat
|
||||
{
|
||||
string FileExtension { get; }
|
||||
string FileExtensionName { get; }
|
||||
void Load(string fileFullPath);
|
||||
float GetHeightFromLayer(uint layerNum);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Authors>Tiago Conceição</Authors>
|
||||
<Company>PTRTECH</Company>
|
||||
<PackageProjectUrl>https://github.com/sn4k3/PrusaSL1Viewer</PackageProjectUrl>
|
||||
<PackageIcon></PackageIcon>
|
||||
<RepositoryUrl>https://github.com/sn4k3/PrusaSL1Viewer</RepositoryUrl>
|
||||
<AssemblyVersion>0.1.0.0</AssemblyVersion>
|
||||
<FileVersion>0.1.0.0</FileVersion>
|
||||
<Version>0.1</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="..\LICENSE" Link="LICENSE" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,442 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace PrusaSL1Reader
|
||||
{
|
||||
public class SL1File : FileFormat, IDisposable, IEquatable<SL1File>
|
||||
{
|
||||
#region Sub Classes
|
||||
|
||||
#region Printer
|
||||
public class Printer
|
||||
{
|
||||
#region Printer
|
||||
public string PrinterSettingsId { get; set; }
|
||||
public string PrinterTechnology { get; set; }
|
||||
public string PrinterModel { get; set; }
|
||||
public string PrinterVariant { get; set; }
|
||||
public string PrinterVendor { get; set; }
|
||||
public string DefaultSlaMaterialProfile { get; set; }
|
||||
public string DefaultSlaPrintProfile { get; set; }
|
||||
public string PrinterNotes { get; set; }
|
||||
public string Thumbnails { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Size and Coordinates
|
||||
public string BedCustomModel { get; set; }
|
||||
public string BedCustomTexture { get; set; }
|
||||
public string BedShape { get; set; }
|
||||
public ushort MaxPrintHeight { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Display
|
||||
public float DisplayWidth { get; set; }
|
||||
public float DisplayHeight { get; set; }
|
||||
public ushort DisplayPixelsX { get; set; }
|
||||
public ushort DisplayPixelsY { get; set; }
|
||||
public string DisplayOrientation { get; set; }
|
||||
public bool DisplayMirrorX { get; set; }
|
||||
public bool DisplayMirrorY { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Tilt
|
||||
public byte FastTiltTime { get; set; }
|
||||
public byte SlowTiltTime { get; set; }
|
||||
public byte AreaFill { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Corrections
|
||||
public string RelativeCorrection { get; set; }
|
||||
public byte AbsoluteCorrection { get; set; }
|
||||
public float ElefantFootCompensation { get; set; }
|
||||
public float ElefantFootMinWidth { get; set; }
|
||||
public byte GammaCorrection { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Exposure
|
||||
|
||||
public byte MinExposureTime { get; set; }
|
||||
public byte MaxExposureTime { get; set; }
|
||||
public byte MinInitialExposureTime { get; set; }
|
||||
public ushort MaxInitialExposureTime { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Overrides
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(PrinterSettingsId)}: {PrinterSettingsId}, {nameof(PrinterTechnology)}: {PrinterTechnology}, {nameof(PrinterModel)}: {PrinterModel}, {nameof(PrinterVariant)}: {PrinterVariant}, {nameof(PrinterVendor)}: {PrinterVendor}, {nameof(DefaultSlaMaterialProfile)}: {DefaultSlaMaterialProfile}, {nameof(DefaultSlaPrintProfile)}: {DefaultSlaPrintProfile}, {nameof(PrinterNotes)}: {PrinterNotes}, {nameof(Thumbnails)}: {Thumbnails}, {nameof(BedCustomModel)}: {BedCustomModel}, {nameof(BedCustomTexture)}: {BedCustomTexture}, {nameof(BedShape)}: {BedShape}, {nameof(MaxPrintHeight)}: {MaxPrintHeight}, {nameof(DisplayWidth)}: {DisplayWidth}, {nameof(DisplayHeight)}: {DisplayHeight}, {nameof(DisplayPixelsX)}: {DisplayPixelsX}, {nameof(DisplayPixelsY)}: {DisplayPixelsY}, {nameof(DisplayOrientation)}: {DisplayOrientation}, {nameof(DisplayMirrorX)}: {DisplayMirrorX}, {nameof(DisplayMirrorY)}: {DisplayMirrorY}, {nameof(FastTiltTime)}: {FastTiltTime}, {nameof(SlowTiltTime)}: {SlowTiltTime}, {nameof(AreaFill)}: {AreaFill}, {nameof(RelativeCorrection)}: {RelativeCorrection}, {nameof(AbsoluteCorrection)}: {AbsoluteCorrection}, {nameof(ElefantFootCompensation)}: {ElefantFootCompensation}, {nameof(ElefantFootMinWidth)}: {ElefantFootMinWidth}, {nameof(GammaCorrection)}: {GammaCorrection}, {nameof(MinExposureTime)}: {MinExposureTime}, {nameof(MaxExposureTime)}: {MaxExposureTime}, {nameof(MinInitialExposureTime)}: {MinInitialExposureTime}, {nameof(MaxInitialExposureTime)}: {MaxInitialExposureTime}";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Material
|
||||
public class Material
|
||||
{
|
||||
#region Material
|
||||
public string MaterialVendor { get; set; }
|
||||
public string MaterialType { get; set; }
|
||||
public string SlaMaterialSettingsId { get; set; }
|
||||
public float BottleCost { get; set; }
|
||||
public ushort BottleVolume { get; set; }
|
||||
public float BottleWeight { get; set; }
|
||||
public float MaterialDensity { get; set; }
|
||||
public string MaterialNotes { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Layers
|
||||
|
||||
public float InitialLayerHeight { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Exposure
|
||||
|
||||
public byte ExposureTime { get; set; }
|
||||
public ushort InitialExposureTime { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Corrections
|
||||
public string MaterialCorrection { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Dependencies
|
||||
|
||||
public string CompatiblePrintersConditionCummulative { get; set; }
|
||||
public string CompatiblePrintsConditionCummulative { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Overrides
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(MaterialVendor)}: {MaterialVendor}, {nameof(MaterialType)}: {MaterialType}, {nameof(SlaMaterialSettingsId)}: {SlaMaterialSettingsId}, {nameof(BottleCost)}: {BottleCost}, {nameof(BottleVolume)}: {BottleVolume}, {nameof(BottleWeight)}: {BottleWeight}, {nameof(MaterialDensity)}: {MaterialDensity}, {nameof(MaterialNotes)}: {MaterialNotes}, {nameof(InitialLayerHeight)}: {InitialLayerHeight}, {nameof(ExposureTime)}: {ExposureTime}, {nameof(InitialExposureTime)}: {InitialExposureTime}, {nameof(MaterialCorrection)}: {MaterialCorrection}, {nameof(CompatiblePrintersConditionCummulative)}: {CompatiblePrintersConditionCummulative}, {nameof(CompatiblePrintsConditionCummulative)}: {CompatiblePrintsConditionCummulative}";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Print
|
||||
|
||||
public class Print
|
||||
{
|
||||
#region Print
|
||||
public string SlaPrintSettingsId { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Layers
|
||||
|
||||
public float LayerHeight { get; set; }
|
||||
public byte FadedLayers { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Supports
|
||||
public bool SupportsEnable { get; set; }
|
||||
|
||||
|
||||
public float SupportHeadFrontDiameter { get; set; }
|
||||
public float SupportHeadPenetration { get; set; }
|
||||
public float SupportHeadWidth { get; set; }
|
||||
|
||||
public byte SupportPillarWideningFactor { set; get; }
|
||||
public float SupportPillarDiameter { get; set; }
|
||||
public float SupportMaxBridgesOnPillar { get; set; }
|
||||
public string SupportPillarConnectionMode { get; set; }
|
||||
public bool SupportBuildplateOnly { get; set; }
|
||||
public float SupportBaseDiameter { get; set; }
|
||||
public float SupportBaseHeight { get; set; }
|
||||
public float SupportBaseSafetyDistance { get; set; }
|
||||
public bool PadAroundObject { get; set; }
|
||||
public float SupportObjectElevation { get; set; }
|
||||
|
||||
|
||||
public ushort SupportCriticalAngle { get; set; }
|
||||
public float SupportMaxBridgeLength { get; set; }
|
||||
public float SupportMaxPillarLinkDistance { get; set; }
|
||||
|
||||
|
||||
public byte SupportPointsDensityRelative { get; set; }
|
||||
public float SupportPointsMinimalDistance { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Pad
|
||||
|
||||
public bool PadEnable { set; get; }
|
||||
public float PadWallThickness { set; get; }
|
||||
public float PadWallHeight { set; get; }
|
||||
public float PadBrimSize { set; get; }
|
||||
public float PadMaxMergeDistance { set; get; }
|
||||
public float PadWallSlope { set; get; }
|
||||
//public float PadAroundObject { set; get; }
|
||||
public bool PadAroundObjectEverywhere { set; get; }
|
||||
public float PadObjectGap { set; get; }
|
||||
public float PadObjectConnectorStride { set; get; }
|
||||
public float PadObjectConnectorWidth { set; get; }
|
||||
public float PadObjectConnectorPenetration { set; get; }
|
||||
#endregion
|
||||
|
||||
#region Hollowing
|
||||
public bool HollowingEnable { set; get; }
|
||||
public float HollowingMinThickness { set; get; }
|
||||
public float HollowingQuality { set; get; }
|
||||
public float HollowingClosingDistance { set; get; }
|
||||
#endregion
|
||||
|
||||
#region Advanced
|
||||
public float SliceClosingRadius { set; get; }
|
||||
#endregion
|
||||
|
||||
#region Output
|
||||
public string OutputFilenameFormat { set; get; }
|
||||
#endregion
|
||||
|
||||
#region Dependencies
|
||||
public string CompatiblePrintsCondition { set; get; }
|
||||
#endregion
|
||||
|
||||
#region Overrides
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(SlaPrintSettingsId)}: {SlaPrintSettingsId}, {nameof(LayerHeight)}: {LayerHeight}, {nameof(FadedLayers)}: {FadedLayers}, {nameof(SupportsEnable)}: {SupportsEnable}, {nameof(SupportHeadFrontDiameter)}: {SupportHeadFrontDiameter}, {nameof(SupportHeadPenetration)}: {SupportHeadPenetration}, {nameof(SupportHeadWidth)}: {SupportHeadWidth}, {nameof(SupportPillarWideningFactor)}: {SupportPillarWideningFactor}, {nameof(SupportPillarDiameter)}: {SupportPillarDiameter}, {nameof(SupportMaxBridgesOnPillar)}: {SupportMaxBridgesOnPillar}, {nameof(SupportPillarConnectionMode)}: {SupportPillarConnectionMode}, {nameof(SupportBuildplateOnly)}: {SupportBuildplateOnly}, {nameof(SupportBaseDiameter)}: {SupportBaseDiameter}, {nameof(SupportBaseHeight)}: {SupportBaseHeight}, {nameof(SupportBaseSafetyDistance)}: {SupportBaseSafetyDistance}, {nameof(PadAroundObject)}: {PadAroundObject}, {nameof(SupportObjectElevation)}: {SupportObjectElevation}, {nameof(SupportCriticalAngle)}: {SupportCriticalAngle}, {nameof(SupportMaxBridgeLength)}: {SupportMaxBridgeLength}, {nameof(SupportMaxPillarLinkDistance)}: {SupportMaxPillarLinkDistance}, {nameof(SupportPointsDensityRelative)}: {SupportPointsDensityRelative}, {nameof(SupportPointsMinimalDistance)}: {SupportPointsMinimalDistance}, {nameof(PadEnable)}: {PadEnable}, {nameof(PadWallThickness)}: {PadWallThickness}, {nameof(PadWallHeight)}: {PadWallHeight}, {nameof(PadBrimSize)}: {PadBrimSize}, {nameof(PadMaxMergeDistance)}: {PadMaxMergeDistance}, {nameof(PadWallSlope)}: {PadWallSlope}, {nameof(PadAroundObjectEverywhere)}: {PadAroundObjectEverywhere}, {nameof(PadObjectGap)}: {PadObjectGap}, {nameof(PadObjectConnectorStride)}: {PadObjectConnectorStride}, {nameof(PadObjectConnectorWidth)}: {PadObjectConnectorWidth}, {nameof(PadObjectConnectorPenetration)}: {PadObjectConnectorPenetration}, {nameof(HollowingEnable)}: {HollowingEnable}, {nameof(HollowingMinThickness)}: {HollowingMinThickness}, {nameof(HollowingQuality)}: {HollowingQuality}, {nameof(HollowingClosingDistance)}: {HollowingClosingDistance}, {nameof(SliceClosingRadius)}: {SliceClosingRadius}, {nameof(OutputFilenameFormat)}: {OutputFilenameFormat}, {nameof(CompatiblePrintsCondition)}: {CompatiblePrintsCondition}";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region OutputConfig
|
||||
|
||||
public class OutputConfig
|
||||
{
|
||||
public string Action { get; set; }
|
||||
public string JobDir { get; set; }
|
||||
public byte ExpTime { get; set; }
|
||||
public ushort ExpTimeFirst { get; set; }
|
||||
public string FileCreationTimestamp { get; set; }
|
||||
public float LayerHeight { get; set; }
|
||||
public string MaterialName { get; set; }
|
||||
public byte NumFade { get; set; }
|
||||
public ushort NumFast { get; set; }
|
||||
public byte NumSlow { get; set; }
|
||||
public string PrintProfile { get; set; }
|
||||
public float PrintTime { get; set; }
|
||||
public string PrinterModel { get; set; }
|
||||
public string PrinterProfile { get; set; }
|
||||
public string PrinterVariant { get; set; }
|
||||
public string PrusaSlicerVersion { get; set; }
|
||||
public float UsedMaterial { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(Action)}: {Action}, {nameof(JobDir)}: {JobDir}, {nameof(ExpTime)}: {ExpTime}, {nameof(ExpTimeFirst)}: {ExpTimeFirst}, {nameof(FileCreationTimestamp)}: {FileCreationTimestamp}, {nameof(LayerHeight)}: {LayerHeight}, {nameof(MaterialName)}: {MaterialName}, {nameof(NumFade)}: {NumFade}, {nameof(NumFast)}: {NumFast}, {nameof(NumSlow)}: {NumSlow}, {nameof(PrintProfile)}: {PrintProfile}, {nameof(PrintTime)}: {PrintTime}, {nameof(PrinterModel)}: {PrinterModel}, {nameof(PrinterProfile)}: {PrinterProfile}, {nameof(PrinterVariant)}: {PrinterVariant}, {nameof(PrusaSlicerVersion)}: {PrusaSlicerVersion}, {nameof(UsedMaterial)}: {UsedMaterial}";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
public ZipArchive Archive { get; private set; }
|
||||
|
||||
public Printer PrinterSettings { get; private set; }
|
||||
|
||||
public Material MaterialSettings { get; private set; }
|
||||
|
||||
public Print PrintSettings { get; private set; }
|
||||
public OutputConfig OutputConfigSettings { get; private set; }
|
||||
|
||||
public Statistics Statistics { get; } = new Statistics();
|
||||
|
||||
public List<ZipArchiveEntry> Thumbnails { get; } = new List<ZipArchiveEntry>(2);
|
||||
public List<ZipArchiveEntry> LayerImages { get; } = new List<ZipArchiveEntry>();
|
||||
|
||||
public uint GetLayerCount => (uint)LayerImages.Count;
|
||||
|
||||
public double TotalHeight => Math.Round(MaterialSettings.InitialLayerHeight + (LayerImages.Count - 1) * OutputConfigSettings.LayerHeight, 2);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Overrides
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return Equals(obj as SL1File);
|
||||
}
|
||||
|
||||
public bool Equals(SL1File other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
return FileFullPath == other.FileFullPath;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return (FileFullPath != null ? FileFullPath.GetHashCode() : 0);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Archive?.Dispose();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(FileFullPath)}: {FileFullPath}, {nameof(MaterialSettings)}: {MaterialSettings}, {nameof(PrintSettings)}: {PrintSettings}, {nameof(OutputConfigSettings)}: {OutputConfigSettings}, {nameof(Statistics)}: {Statistics}, {nameof(GetLayerCount)}: {GetLayerCount}, {nameof(TotalHeight)}: {TotalHeight}";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Contructors
|
||||
public SL1File() { }
|
||||
public SL1File(string fileFullPath)
|
||||
{
|
||||
Load(fileFullPath);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Functions
|
||||
|
||||
public override string FileExtension { get; } = "sl1";
|
||||
public override string FileExtensionName { get; } = "Prusa SL1 Files";
|
||||
|
||||
public override void Load(string fileFullPath)
|
||||
{
|
||||
FileValidation(fileFullPath);
|
||||
FileFullPath = fileFullPath;
|
||||
|
||||
Archive?.Dispose();
|
||||
Thumbnails.Clear();
|
||||
LayerImages.Clear();
|
||||
Statistics.Clear();
|
||||
|
||||
PrinterSettings = new Printer();
|
||||
MaterialSettings = new Material();
|
||||
PrintSettings = new Print();
|
||||
OutputConfigSettings = new OutputConfig();
|
||||
|
||||
Statistics.ExecutionTime.Restart();
|
||||
|
||||
var parseTypes = new[]
|
||||
{
|
||||
new KeyValuePair<Type, object>(typeof(Printer), PrinterSettings),
|
||||
new KeyValuePair<Type, object>(typeof(Material), MaterialSettings),
|
||||
new KeyValuePair<Type, object>(typeof(Print), PrintSettings),
|
||||
new KeyValuePair<Type, object>(typeof(OutputConfig), OutputConfigSettings),
|
||||
};
|
||||
|
||||
Archive = ZipFile.OpenRead(FileFullPath);
|
||||
foreach (ZipArchiveEntry entity in Archive.Entries)
|
||||
{
|
||||
if (entity.Name.EndsWith(".ini"))
|
||||
{
|
||||
using (StreamReader streamReader = new StreamReader(entity.Open()))
|
||||
{
|
||||
string line = null;
|
||||
while ((line = streamReader.ReadLine()) != null)
|
||||
{
|
||||
string[] keyValue = line.Split(new []{'='}, 2);
|
||||
if (keyValue.Length < 1) continue;
|
||||
keyValue[0] = keyValue[0].Trim();
|
||||
keyValue[1] = keyValue[1].Trim();
|
||||
|
||||
var fieldName = IniKeyToMemberName(keyValue[0]);
|
||||
bool foundMember = false;
|
||||
|
||||
foreach (var kv in parseTypes)
|
||||
{
|
||||
var attribute = kv.Key.GetProperty(fieldName);
|
||||
if (attribute == null) continue;
|
||||
SetValue(attribute, kv.Value, keyValue[1]);
|
||||
Statistics.ImplementedKeys.Add(keyValue[0]);
|
||||
foundMember = true;
|
||||
}
|
||||
|
||||
if (!foundMember)
|
||||
{
|
||||
Statistics.MissingKeys.Add(keyValue[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (entity.Name.EndsWith(".png"))
|
||||
{
|
||||
if (entity.Name.StartsWith("thumbnail"))
|
||||
{
|
||||
Thumbnails.Add(entity);
|
||||
continue;
|
||||
}
|
||||
|
||||
LayerImages.Add(entity);
|
||||
}
|
||||
}
|
||||
Statistics.ExecutionTime.Stop();
|
||||
|
||||
Debug.WriteLine(Statistics);
|
||||
}
|
||||
|
||||
public override float GetHeightFromLayer(uint layerNum)
|
||||
{
|
||||
return (float)Math.Round(MaterialSettings.InitialLayerHeight + (layerNum - 1) * OutputConfigSettings.LayerHeight, 2);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Static Functions
|
||||
public static string IniKeyToMemberName(string keyName)
|
||||
{
|
||||
string memberName = string.Empty;
|
||||
string[] objs = keyName.Split('_');
|
||||
return objs.Aggregate(memberName, (current, obj) => current + obj.FirstCharToUpper());
|
||||
}
|
||||
|
||||
public static bool SetValue(PropertyInfo attribute, object obj, string value)
|
||||
{
|
||||
var name = attribute.PropertyType.Name.ToLower();
|
||||
switch (name)
|
||||
{
|
||||
case "string":
|
||||
attribute.SetValue(obj, value.Convert<string>());
|
||||
return true;
|
||||
case "boolean":
|
||||
attribute.SetValue(obj, !value.Equals(0));
|
||||
return true;
|
||||
case "byte":
|
||||
attribute.SetValue(obj, value.Convert<byte>());
|
||||
return true;
|
||||
case "uint16":
|
||||
attribute.SetValue(obj, value.Convert<ushort>());
|
||||
return true;
|
||||
case "single":
|
||||
attribute.SetValue(obj, float.Parse(value, CultureInfo.InvariantCulture.NumberFormat));
|
||||
return true;
|
||||
case "double":
|
||||
attribute.SetValue(obj, double.Parse(value, CultureInfo.InvariantCulture.NumberFormat));
|
||||
return true;
|
||||
default:
|
||||
throw new Exception($"Data type '{name}' not recognized, contact developer.");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace PrusaSL1Reader
|
||||
{
|
||||
public class Statistics
|
||||
{
|
||||
#region Properties
|
||||
|
||||
public List<string> ImplementedKeys { get; } = new List<string>();
|
||||
public List<string> MissingKeys { get; } = new List<string>();
|
||||
public ushort TotalKeys => (ushort)(ImplementedKeys.Count + MissingKeys.Count);
|
||||
|
||||
public Stopwatch ExecutionTime { get; } = new Stopwatch();
|
||||
#endregion
|
||||
|
||||
#region Overrides
|
||||
public override string ToString()
|
||||
{
|
||||
string message = $"{nameof(ImplementedKeys)}: {ImplementedKeys.Count}, {nameof(MissingKeys)}: {MissingKeys.Count}, {nameof(TotalKeys)}: {TotalKeys}, {nameof(ExecutionTime)}: {ExecutionTime.ElapsedMilliseconds}ms";
|
||||
message = MissingKeys.Aggregate(message, (current, missingKey) => current + ("\n" + missingKey));
|
||||
return message;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
ImplementedKeys.Clear();
|
||||
MissingKeys.Clear();
|
||||
ExecutionTime.Reset();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
|
||||
namespace PrusaSL1Reader
|
||||
{
|
||||
public static class StringExtensions
|
||||
{
|
||||
public static string FirstCharToUpper(this string input)
|
||||
{
|
||||
switch (input)
|
||||
{
|
||||
case null: throw new ArgumentNullException(nameof(input));
|
||||
case "": throw new ArgumentException($"{nameof(input)} cannot be empty", nameof(input));
|
||||
default: return input.First().ToString().ToUpper() + input.Substring(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static T Convert<T>(this string input)
|
||||
{
|
||||
var converter = TypeDescriptor.GetConverter(typeof(T));
|
||||
if (converter != null)
|
||||
{
|
||||
//Cast ConvertFromString(string text) : object to (T)
|
||||
return (T)converter.ConvertFromString(input);
|
||||
}
|
||||
return default(T);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29926.136
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrusaSL1Viewer", "PrusaSL1Viewer\PrusaSL1Viewer.csproj", "{E7389EE3-CF56-464B-9BA1-816B31D1E6FF}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{53B884CA-E640-4171-8AA2-03935AC076D2} = {53B884CA-E640-4171-8AA2-03935AC076D2}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrusaSL1Reader", "PrusaSL1Reader\PrusaSL1Reader.csproj", "{53B884CA-E640-4171-8AA2-03935AC076D2}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E7389EE3-CF56-464B-9BA1-816B31D1E6FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E7389EE3-CF56-464B-9BA1-816B31D1E6FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E7389EE3-CF56-464B-9BA1-816B31D1E6FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E7389EE3-CF56-464B-9BA1-816B31D1E6FF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{53B884CA-E640-4171-8AA2-03935AC076D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{53B884CA-E640-4171-8AA2-03935AC076D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{53B884CA-E640-4171-8AA2-03935AC076D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{53B884CA-E640-4171-8AA2-03935AC076D2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E9BEE8D8-E894-49A9-9435-491BF1E26E46}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,185 @@
|
||||
namespace PrusaSL1Viewer
|
||||
{
|
||||
partial class FrmAbout
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.logoPictureBox = new System.Windows.Forms.PictureBox();
|
||||
this.labelProductName = new System.Windows.Forms.Label();
|
||||
this.labelVersion = new System.Windows.Forms.Label();
|
||||
this.labelCopyright = new System.Windows.Forms.Label();
|
||||
this.labelCompanyName = new System.Windows.Forms.Label();
|
||||
this.textBoxDescription = new System.Windows.Forms.TextBox();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.tableLayoutPanel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel
|
||||
//
|
||||
this.tableLayoutPanel.ColumnCount = 2;
|
||||
this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F));
|
||||
this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 67F));
|
||||
this.tableLayoutPanel.Controls.Add(this.logoPictureBox, 0, 0);
|
||||
this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0);
|
||||
this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1);
|
||||
this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2);
|
||||
this.tableLayoutPanel.Controls.Add(this.labelCompanyName, 1, 3);
|
||||
this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4);
|
||||
this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5);
|
||||
this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel.Location = new System.Drawing.Point(9, 9);
|
||||
this.tableLayoutPanel.Name = "tableLayoutPanel";
|
||||
this.tableLayoutPanel.RowCount = 6;
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
|
||||
this.tableLayoutPanel.Size = new System.Drawing.Size(670, 254);
|
||||
this.tableLayoutPanel.TabIndex = 0;
|
||||
//
|
||||
// logoPictureBox
|
||||
//
|
||||
this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.logoPictureBox.Image = global::PrusaSL1Viewer.Properties.Resources.PrusaSL1Viewer;
|
||||
this.logoPictureBox.Location = new System.Drawing.Point(3, 3);
|
||||
this.logoPictureBox.Name = "logoPictureBox";
|
||||
this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6);
|
||||
this.logoPictureBox.Size = new System.Drawing.Size(215, 248);
|
||||
this.logoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.logoPictureBox.TabIndex = 12;
|
||||
this.logoPictureBox.TabStop = false;
|
||||
//
|
||||
// labelProductName
|
||||
//
|
||||
this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelProductName.Location = new System.Drawing.Point(227, 0);
|
||||
this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelProductName.Name = "labelProductName";
|
||||
this.labelProductName.Size = new System.Drawing.Size(440, 17);
|
||||
this.labelProductName.TabIndex = 19;
|
||||
this.labelProductName.Text = "Product Name";
|
||||
this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// labelVersion
|
||||
//
|
||||
this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelVersion.Location = new System.Drawing.Point(227, 25);
|
||||
this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelVersion.Name = "labelVersion";
|
||||
this.labelVersion.Size = new System.Drawing.Size(440, 17);
|
||||
this.labelVersion.TabIndex = 0;
|
||||
this.labelVersion.Text = "Version";
|
||||
this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// labelCopyright
|
||||
//
|
||||
this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelCopyright.Location = new System.Drawing.Point(227, 50);
|
||||
this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelCopyright.Name = "labelCopyright";
|
||||
this.labelCopyright.Size = new System.Drawing.Size(440, 17);
|
||||
this.labelCopyright.TabIndex = 21;
|
||||
this.labelCopyright.Text = "Copyright";
|
||||
this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// labelCompanyName
|
||||
//
|
||||
this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.labelCompanyName.Location = new System.Drawing.Point(227, 75);
|
||||
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
|
||||
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 17);
|
||||
this.labelCompanyName.Name = "labelCompanyName";
|
||||
this.labelCompanyName.Size = new System.Drawing.Size(440, 17);
|
||||
this.labelCompanyName.TabIndex = 22;
|
||||
this.labelCompanyName.Text = "Company Name";
|
||||
this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// textBoxDescription
|
||||
//
|
||||
this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.textBoxDescription.Location = new System.Drawing.Point(227, 103);
|
||||
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
|
||||
this.textBoxDescription.Multiline = true;
|
||||
this.textBoxDescription.Name = "textBoxDescription";
|
||||
this.textBoxDescription.ReadOnly = true;
|
||||
this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.textBoxDescription.Size = new System.Drawing.Size(440, 121);
|
||||
this.textBoxDescription.TabIndex = 23;
|
||||
this.textBoxDescription.TabStop = false;
|
||||
this.textBoxDescription.Text = "Description";
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.okButton.Location = new System.Drawing.Point(592, 230);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(75, 21);
|
||||
this.okButton.TabIndex = 24;
|
||||
this.okButton.Text = "&OK";
|
||||
//
|
||||
// FrmAbout
|
||||
//
|
||||
this.AcceptButton = this.okButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(688, 272);
|
||||
this.Controls.Add(this.tableLayoutPanel);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "FrmAbout";
|
||||
this.Padding = new System.Windows.Forms.Padding(9);
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "AboutBox1";
|
||||
this.tableLayoutPanel.ResumeLayout(false);
|
||||
this.tableLayoutPanel.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;
|
||||
private System.Windows.Forms.PictureBox logoPictureBox;
|
||||
private System.Windows.Forms.Label labelProductName;
|
||||
private System.Windows.Forms.Label labelVersion;
|
||||
private System.Windows.Forms.Label labelCopyright;
|
||||
private System.Windows.Forms.Label labelCompanyName;
|
||||
private System.Windows.Forms.TextBox textBoxDescription;
|
||||
private System.Windows.Forms.Button okButton;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace PrusaSL1Viewer
|
||||
{
|
||||
partial class FrmAbout : Form
|
||||
{
|
||||
public FrmAbout()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Text = String.Format("About {0}", AssemblyTitle);
|
||||
this.labelProductName.Text = AssemblyProduct;
|
||||
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
|
||||
this.labelCopyright.Text = AssemblyCopyright;
|
||||
this.labelCompanyName.Text = AssemblyCompany;
|
||||
this.textBoxDescription.Text = AssemblyDescription;
|
||||
}
|
||||
|
||||
#region Assembly Attribute Accessors
|
||||
|
||||
public static string AssemblyTitle
|
||||
{
|
||||
get
|
||||
{
|
||||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
|
||||
if (attributes.Length > 0)
|
||||
{
|
||||
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
|
||||
if (titleAttribute.Title != "")
|
||||
{
|
||||
return titleAttribute.Title;
|
||||
}
|
||||
}
|
||||
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
|
||||
}
|
||||
}
|
||||
|
||||
public static string AssemblyVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public static string AssemblyDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
|
||||
}
|
||||
}
|
||||
|
||||
public static string AssemblyProduct
|
||||
{
|
||||
get
|
||||
{
|
||||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return ((AssemblyProductAttribute)attributes[0]).Product;
|
||||
}
|
||||
}
|
||||
|
||||
public static string AssemblyCopyright
|
||||
{
|
||||
get
|
||||
{
|
||||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
|
||||
}
|
||||
}
|
||||
|
||||
public static string AssemblyCompany
|
||||
{
|
||||
get
|
||||
{
|
||||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
|
||||
if (attributes.Length == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return ((AssemblyCompanyAttribute)attributes[0]).Company;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,415 @@
|
||||
namespace PrusaSL1Viewer
|
||||
{
|
||||
partial class FrmMain
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Printer", System.Windows.Forms.HorizontalAlignment.Left);
|
||||
System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Material", System.Windows.Forms.HorizontalAlignment.Left);
|
||||
System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("Print", System.Windows.Forms.HorizontalAlignment.Left);
|
||||
System.Windows.Forms.ListViewGroup listViewGroup4 = new System.Windows.Forms.ListViewGroup("Output", System.Windows.Forms.HorizontalAlignment.Left);
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
|
||||
this.menu = new System.Windows.Forms.MenuStrip();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuFileOpen = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuFileExit = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuEdit = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuEditExtract = 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();
|
||||
this.menuAboutAbout = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.statusBar = new System.Windows.Forms.StatusStrip();
|
||||
this.sbLayers = new System.Windows.Forms.VScrollBar();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.lbLayers = new System.Windows.Forms.Label();
|
||||
this.scLeft = new System.Windows.Forms.SplitContainer();
|
||||
this.pbThumbnail = new System.Windows.Forms.PictureBox();
|
||||
this.lvProperties = new System.Windows.Forms.ListView();
|
||||
this.lvChKey = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.lvChValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.scCenter = new System.Windows.Forms.SplitContainer();
|
||||
this.pbLayer = new System.Windows.Forms.PictureBox();
|
||||
this.pbLayers = new System.Windows.Forms.ProgressBar();
|
||||
this.menu.SuspendLayout();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.scLeft)).BeginInit();
|
||||
this.scLeft.Panel1.SuspendLayout();
|
||||
this.scLeft.Panel2.SuspendLayout();
|
||||
this.scLeft.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pbThumbnail)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.scCenter)).BeginInit();
|
||||
this.scCenter.Panel1.SuspendLayout();
|
||||
this.scCenter.Panel2.SuspendLayout();
|
||||
this.scCenter.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pbLayer)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menu
|
||||
//
|
||||
this.menu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fileToolStripMenuItem,
|
||||
this.menuEdit,
|
||||
this.helpToolStripMenuItem});
|
||||
this.menu.Location = new System.Drawing.Point(0, 0);
|
||||
this.menu.Name = "menu";
|
||||
this.menu.Size = new System.Drawing.Size(1631, 24);
|
||||
this.menu.TabIndex = 0;
|
||||
this.menu.Text = "menuStrip1";
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.menuFileOpen,
|
||||
this.menuFileExit});
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
||||
this.fileToolStripMenuItem.Text = "&File";
|
||||
//
|
||||
// menuFileOpen
|
||||
//
|
||||
this.menuFileOpen.Image = global::PrusaSL1Viewer.Properties.Resources.Open_16x16;
|
||||
this.menuFileOpen.Name = "menuFileOpen";
|
||||
this.menuFileOpen.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
|
||||
this.menuFileOpen.Size = new System.Drawing.Size(146, 22);
|
||||
this.menuFileOpen.Text = "&Open";
|
||||
this.menuFileOpen.Click += new System.EventHandler(this.MenuItemClicked);
|
||||
//
|
||||
// menuFileExit
|
||||
//
|
||||
this.menuFileExit.Image = global::PrusaSL1Viewer.Properties.Resources.Exit_16x16;
|
||||
this.menuFileExit.Name = "menuFileExit";
|
||||
this.menuFileExit.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
|
||||
this.menuFileExit.Size = new System.Drawing.Size(146, 22);
|
||||
this.menuFileExit.Text = "&Exit";
|
||||
this.menuFileExit.Click += new System.EventHandler(this.MenuItemClicked);
|
||||
//
|
||||
// menuEdit
|
||||
//
|
||||
this.menuEdit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.menuEditExtract});
|
||||
this.menuEdit.Enabled = false;
|
||||
this.menuEdit.Name = "menuEdit";
|
||||
this.menuEdit.Size = new System.Drawing.Size(39, 20);
|
||||
this.menuEdit.Text = "&Edit";
|
||||
//
|
||||
// menuEditExtract
|
||||
//
|
||||
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(150, 22);
|
||||
this.menuEditExtract.Text = "&Extract";
|
||||
this.menuEditExtract.Click += new System.EventHandler(this.MenuItemClicked);
|
||||
//
|
||||
// helpToolStripMenuItem
|
||||
//
|
||||
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.menuAboutWebsite,
|
||||
this.menuAboutDonate,
|
||||
this.menuAboutAbout});
|
||||
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
|
||||
this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
|
||||
this.helpToolStripMenuItem.Text = "&Help";
|
||||
//
|
||||
// menuAboutWebsite
|
||||
//
|
||||
this.menuAboutWebsite.Image = global::PrusaSL1Viewer.Properties.Resources.Global_Network_icon_16x16;
|
||||
this.menuAboutWebsite.Name = "menuAboutWebsite";
|
||||
this.menuAboutWebsite.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.W)));
|
||||
this.menuAboutWebsite.Size = new System.Drawing.Size(161, 22);
|
||||
this.menuAboutWebsite.Text = "&Website";
|
||||
this.menuAboutWebsite.Click += new System.EventHandler(this.MenuItemClicked);
|
||||
//
|
||||
// menuAboutDonate
|
||||
//
|
||||
this.menuAboutDonate.Image = global::PrusaSL1Viewer.Properties.Resources.Donate_16x16;
|
||||
this.menuAboutDonate.Name = "menuAboutDonate";
|
||||
this.menuAboutDonate.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D)));
|
||||
this.menuAboutDonate.Size = new System.Drawing.Size(161, 22);
|
||||
this.menuAboutDonate.Text = "&Donate";
|
||||
this.menuAboutDonate.Click += new System.EventHandler(this.MenuItemClicked);
|
||||
//
|
||||
// menuAboutAbout
|
||||
//
|
||||
this.menuAboutAbout.Image = global::PrusaSL1Viewer.Properties.Resources.Button_Info_16x16;
|
||||
this.menuAboutAbout.Name = "menuAboutAbout";
|
||||
this.menuAboutAbout.ShortcutKeys = System.Windows.Forms.Keys.F1;
|
||||
this.menuAboutAbout.Size = new System.Drawing.Size(161, 22);
|
||||
this.menuAboutAbout.Text = "&About";
|
||||
this.menuAboutAbout.Click += new System.EventHandler(this.MenuItemClicked);
|
||||
//
|
||||
// statusBar
|
||||
//
|
||||
this.statusBar.Location = new System.Drawing.Point(0, 761);
|
||||
this.statusBar.Name = "statusBar";
|
||||
this.statusBar.Size = new System.Drawing.Size(1631, 22);
|
||||
this.statusBar.TabIndex = 1;
|
||||
this.statusBar.Text = "statusStrip1";
|
||||
//
|
||||
// sbLayers
|
||||
//
|
||||
this.sbLayers.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.sbLayers.Enabled = false;
|
||||
this.sbLayers.LargeChange = 1;
|
||||
this.sbLayers.Location = new System.Drawing.Point(0, 0);
|
||||
this.sbLayers.Name = "sbLayers";
|
||||
this.sbLayers.Size = new System.Drawing.Size(94, 642);
|
||||
this.sbLayers.TabIndex = 4;
|
||||
this.sbLayers.ValueChanged += new System.EventHandler(this.sbLayers_ValueChanged);
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 3;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 400F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.splitContainer1, 2, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.scLeft, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.scCenter, 1, 0);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 24);
|
||||
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.Size = new System.Drawing.Size(1631, 737);
|
||||
this.tableLayoutPanel1.TabIndex = 5;
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer1.IsSplitterFixed = true;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(1534, 3);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.sbLayers);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.lbLayers);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(94, 731);
|
||||
this.splitContainer1.SplitterDistance = 642;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// lbLayers
|
||||
//
|
||||
this.lbLayers.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lbLayers.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lbLayers.Location = new System.Drawing.Point(0, 0);
|
||||
this.lbLayers.Name = "lbLayers";
|
||||
this.lbLayers.Size = new System.Drawing.Size(94, 85);
|
||||
this.lbLayers.TabIndex = 0;
|
||||
this.lbLayers.Text = "Layers";
|
||||
this.lbLayers.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// scLeft
|
||||
//
|
||||
this.scLeft.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.scLeft.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||
this.scLeft.IsSplitterFixed = true;
|
||||
this.scLeft.Location = new System.Drawing.Point(3, 3);
|
||||
this.scLeft.Name = "scLeft";
|
||||
this.scLeft.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// scLeft.Panel1
|
||||
//
|
||||
this.scLeft.Panel1.Controls.Add(this.pbThumbnail);
|
||||
this.scLeft.Panel1MinSize = 400;
|
||||
//
|
||||
// scLeft.Panel2
|
||||
//
|
||||
this.scLeft.Panel2.Controls.Add(this.lvProperties);
|
||||
this.scLeft.Size = new System.Drawing.Size(394, 731);
|
||||
this.scLeft.SplitterDistance = 400;
|
||||
this.scLeft.TabIndex = 3;
|
||||
//
|
||||
// pbThumbnail
|
||||
//
|
||||
this.pbThumbnail.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.pbThumbnail.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pbThumbnail.Location = new System.Drawing.Point(0, 0);
|
||||
this.pbThumbnail.Name = "pbThumbnail";
|
||||
this.pbThumbnail.Size = new System.Drawing.Size(394, 400);
|
||||
this.pbThumbnail.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.pbThumbnail.TabIndex = 4;
|
||||
this.pbThumbnail.TabStop = false;
|
||||
//
|
||||
// lvProperties
|
||||
//
|
||||
this.lvProperties.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.lvChKey,
|
||||
this.lvChValue});
|
||||
this.lvProperties.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lvProperties.FullRowSelect = true;
|
||||
this.lvProperties.GridLines = true;
|
||||
listViewGroup1.Header = "Printer";
|
||||
listViewGroup1.Name = "lvGroupPrinter";
|
||||
listViewGroup2.Header = "Material";
|
||||
listViewGroup2.Name = "lvGroupMaterial";
|
||||
listViewGroup3.Header = "Print";
|
||||
listViewGroup3.Name = "lvGroupPrint";
|
||||
listViewGroup4.Header = "Output";
|
||||
listViewGroup4.Name = "lvGroupOutput";
|
||||
this.lvProperties.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] {
|
||||
listViewGroup1,
|
||||
listViewGroup2,
|
||||
listViewGroup3,
|
||||
listViewGroup4});
|
||||
this.lvProperties.HideSelection = false;
|
||||
this.lvProperties.Location = new System.Drawing.Point(0, 0);
|
||||
this.lvProperties.Name = "lvProperties";
|
||||
this.lvProperties.Size = new System.Drawing.Size(394, 327);
|
||||
this.lvProperties.TabIndex = 0;
|
||||
this.lvProperties.UseCompatibleStateImageBehavior = false;
|
||||
this.lvProperties.View = System.Windows.Forms.View.Details;
|
||||
//
|
||||
// lvChKey
|
||||
//
|
||||
this.lvChKey.Text = "Key";
|
||||
this.lvChKey.Width = 183;
|
||||
//
|
||||
// lvChValue
|
||||
//
|
||||
this.lvChValue.Text = "Value";
|
||||
this.lvChValue.Width = 205;
|
||||
//
|
||||
// scCenter
|
||||
//
|
||||
this.scCenter.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.scCenter.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.scCenter.IsSplitterFixed = true;
|
||||
this.scCenter.Location = new System.Drawing.Point(403, 3);
|
||||
this.scCenter.Name = "scCenter";
|
||||
this.scCenter.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// scCenter.Panel1
|
||||
//
|
||||
this.scCenter.Panel1.Controls.Add(this.pbLayer);
|
||||
//
|
||||
// scCenter.Panel2
|
||||
//
|
||||
this.scCenter.Panel2.Controls.Add(this.pbLayers);
|
||||
this.scCenter.Panel2MinSize = 18;
|
||||
this.scCenter.Size = new System.Drawing.Size(1125, 731);
|
||||
this.scCenter.SplitterDistance = 702;
|
||||
this.scCenter.TabIndex = 4;
|
||||
//
|
||||
// pbLayer
|
||||
//
|
||||
this.pbLayer.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.pbLayer.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pbLayer.Location = new System.Drawing.Point(0, 0);
|
||||
this.pbLayer.Name = "pbLayer";
|
||||
this.pbLayer.Size = new System.Drawing.Size(1125, 702);
|
||||
this.pbLayer.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.pbLayer.TabIndex = 5;
|
||||
this.pbLayer.TabStop = false;
|
||||
//
|
||||
// pbLayers
|
||||
//
|
||||
this.pbLayers.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pbLayers.Location = new System.Drawing.Point(0, 0);
|
||||
this.pbLayers.Name = "pbLayers";
|
||||
this.pbLayers.Size = new System.Drawing.Size(1125, 25);
|
||||
this.pbLayers.Step = 1;
|
||||
this.pbLayers.TabIndex = 6;
|
||||
//
|
||||
// FrmMain
|
||||
//
|
||||
this.AllowDrop = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1631, 783);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Controls.Add(this.statusBar);
|
||||
this.Controls.Add(this.menu);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MainMenuStrip = this.menu;
|
||||
this.MinimumSize = new System.Drawing.Size(1000, 600);
|
||||
this.Name = "FrmMain";
|
||||
this.Text = "PrusaSL1Viewer";
|
||||
this.menu.ResumeLayout(false);
|
||||
this.menu.PerformLayout();
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.scLeft.Panel1.ResumeLayout(false);
|
||||
this.scLeft.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.scLeft)).EndInit();
|
||||
this.scLeft.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pbThumbnail)).EndInit();
|
||||
this.scCenter.Panel1.ResumeLayout(false);
|
||||
this.scCenter.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.scCenter)).EndInit();
|
||||
this.scCenter.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pbLayer)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.MenuStrip menu;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuFileOpen;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuFileExit;
|
||||
private System.Windows.Forms.StatusStrip statusBar;
|
||||
private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuAboutWebsite;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuAboutDonate;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuAboutAbout;
|
||||
private System.Windows.Forms.VScrollBar sbLayers;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.Label lbLayers;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuEdit;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuEditExtract;
|
||||
private System.Windows.Forms.PictureBox pbThumbnail;
|
||||
private System.Windows.Forms.ListView lvProperties;
|
||||
private System.Windows.Forms.ColumnHeader lvChKey;
|
||||
private System.Windows.Forms.ColumnHeader lvChValue;
|
||||
private System.Windows.Forms.SplitContainer scLeft;
|
||||
private System.Windows.Forms.SplitContainer scCenter;
|
||||
private System.Windows.Forms.PictureBox pbLayer;
|
||||
private System.Windows.Forms.ProgressBar pbLayers;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,219 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using PrusaSL1Reader;
|
||||
|
||||
namespace PrusaSL1Viewer
|
||||
{
|
||||
public partial class FrmMain : Form
|
||||
{
|
||||
#region Constructors
|
||||
public FrmMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
Text = $"{FrmAbout.AssemblyTitle} Version: {FrmAbout.AssemblyVersion}";
|
||||
|
||||
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
|
||||
private void sbLayers_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
ShowLayer(sbLayers.Maximum - sbLayers.Value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void MenuItemClicked(object sender, EventArgs e)
|
||||
{
|
||||
if (ReferenceEquals(sender, menuFileOpen))
|
||||
{
|
||||
using (OpenFileDialog openFile = new OpenFileDialog())
|
||||
{
|
||||
openFile.CheckFileExists = true;
|
||||
openFile.Filter = $@"{Program.SL1File.FileExtensionName} (*.{Program.SL1File.FileExtension})|*.{Program.SL1File.FileExtension}";
|
||||
openFile.FilterIndex = 0;
|
||||
if (openFile.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
ProcessFile(openFile.FileName);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
MessageBox.Show(exception.ToString(), "Error while try opening the file", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (ReferenceEquals(sender, menuFileExit))
|
||||
{
|
||||
Application.Exit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (ReferenceEquals(sender, menuEditExtract))
|
||||
{
|
||||
using (FolderBrowserDialog folder = new FolderBrowserDialog())
|
||||
{
|
||||
if (folder.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
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.",
|
||||
"Extraction completed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
Process.Start(folder.SelectedPath);
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
MessageBox.Show(exception.ToString(), "Error while try extracting the file", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (ReferenceEquals(sender, menuAboutAbout))
|
||||
{
|
||||
Program.FrmAbout.ShowDialog();
|
||||
}
|
||||
if (ReferenceEquals(sender, menuAboutWebsite))
|
||||
{
|
||||
Process.Start(PrusaSL1Reader.About.Website);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ReferenceEquals(sender, menuAboutDonate))
|
||||
{
|
||||
MessageBox.Show("All my work here is given for free (OpenSource), it took some hours to build, test and polish the program.\n" +
|
||||
"If you're happy to contribute for a better program and for my work i will appreciate the tip.\n" +
|
||||
"A browser window will be open and forward to my paypal address after you click 'OK'.\nHappy Printing!", "Donation", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
Process.Start(About.Donate);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
void ProcessFile(string[] files)
|
||||
{
|
||||
if (ReferenceEquals(files, null)) return;
|
||||
foreach (string file in files)
|
||||
{
|
||||
if (!file.EndsWith($".{Program.SL1File.FileExtension}")) continue;
|
||||
try
|
||||
{
|
||||
ProcessFile(file);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
MessageBox.Show(exception.ToString(), "Error while try opening the file", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessFile(string fileName)
|
||||
{
|
||||
if (!ReferenceEquals(Program.SL1File, null))
|
||||
{
|
||||
Program.SL1File.Dispose();
|
||||
}
|
||||
|
||||
Program.SL1File.Load(fileName);
|
||||
|
||||
pbThumbnail.Image = Image.FromStream(Program.SL1File.Thumbnails[0].Open());
|
||||
//ShowLayer(0);
|
||||
|
||||
sbLayers.SmallChange = 1;
|
||||
sbLayers.Minimum = 0;
|
||||
sbLayers.Maximum = (int)Program.SL1File.GetLayerCount-1;
|
||||
sbLayers.Value = sbLayers.Maximum;
|
||||
|
||||
sbLayers.Enabled = menuEdit.Enabled = menuEditExtract.Enabled = true;
|
||||
|
||||
lvProperties.BeginUpdate();
|
||||
lvProperties.Items.Clear();
|
||||
|
||||
object[] configs = { Program.SL1File.PrinterSettings, Program.SL1File.MaterialSettings, Program.SL1File.PrintSettings, Program.SL1File.OutputConfigSettings };
|
||||
byte configNum = 0;
|
||||
foreach (object config in configs)
|
||||
{
|
||||
foreach (PropertyInfo propertyInfo in config.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance))
|
||||
{
|
||||
ListViewItem item = new ListViewItem(propertyInfo.Name, lvProperties.Groups[configNum]);
|
||||
object obj = new object();
|
||||
item.SubItems.Add(propertyInfo.GetValue(config)?.ToString());
|
||||
lvProperties.Items.Add(item);
|
||||
}
|
||||
|
||||
configNum++;
|
||||
}
|
||||
lvProperties.EndUpdate();
|
||||
|
||||
statusBar.Items.Clear();
|
||||
|
||||
AddStatusBarItem(nameof(Program.SL1File.OutputConfigSettings.LayerHeight), Program.SL1File.OutputConfigSettings.LayerHeight, "mm");
|
||||
AddStatusBarItem(nameof(Program.SL1File.OutputConfigSettings.ExpTimeFirst), Program.SL1File.OutputConfigSettings.ExpTimeFirst);
|
||||
AddStatusBarItem(nameof(Program.SL1File.OutputConfigSettings.ExpTime), Program.SL1File.OutputConfigSettings.ExpTime);
|
||||
AddStatusBarItem(nameof(Program.SL1File.OutputConfigSettings.PrintTime), Math.Round(Program.SL1File.OutputConfigSettings.PrintTime/ 3600, 2), "h");
|
||||
AddStatusBarItem(nameof(Program.SL1File.OutputConfigSettings.UsedMaterial), Math.Round(Program.SL1File.OutputConfigSettings.UsedMaterial, 2), "ml");
|
||||
AddStatusBarItem(nameof(Program.SL1File.OutputConfigSettings.MaterialName), Program.SL1File.OutputConfigSettings.MaterialName);
|
||||
AddStatusBarItem(nameof(Program.SL1File.OutputConfigSettings.PrinterProfile), Program.SL1File.OutputConfigSettings.PrinterProfile);
|
||||
|
||||
Text = $"{FrmAbout.AssemblyTitle} Version: {FrmAbout.AssemblyVersion} File: {Path.GetFileName(fileName)}";
|
||||
}
|
||||
|
||||
void ShowLayer(int layerNum)
|
||||
{
|
||||
//if(!ReferenceEquals(pbLayer.Image, null))
|
||||
// pbLayer.Image.Dispose(); SLOW! LET GC DO IT
|
||||
pbLayer.Image = Image.FromStream(Program.SL1File.LayerImages[layerNum].Open());
|
||||
pbLayer.Image.RotateFlip(RotateFlipType.Rotate90FlipNone);
|
||||
|
||||
byte percent = (byte)((layerNum + 1) * 100 / Program.SL1File.GetLayerCount);
|
||||
|
||||
|
||||
lbLayers.Text = $"{Program.SL1File.TotalHeight}mm\n{layerNum+1} / {Program.SL1File.GetLayerCount}\n{Program.SL1File.GetHeightFromLayer((uint)layerNum+1)}mm\n{percent}%";
|
||||
pbLayers.Value = percent;
|
||||
}
|
||||
|
||||
void AddStatusBarItem(string name, object item, string extraText = "")
|
||||
{
|
||||
if (statusBar.Items.Count > 0)
|
||||
statusBar.Items.Add(new ToolStripSeparator());
|
||||
|
||||
ToolStripLabel label = new ToolStripLabel($"{name}: {item.ToString()}{extraText}");
|
||||
statusBar.Items.Add(label);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 791 B |
|
After Width: | Height: | Size: 769 B |
|
After Width: | Height: | Size: 230 B |
|
After Width: | Height: | Size: 554 B |
|
After Width: | Height: | Size: 963 B |
|
After Width: | Height: | Size: 455 B |
|
After Width: | Height: | Size: 282 KiB |
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using PrusaSL1Reader;
|
||||
|
||||
namespace PrusaSL1Viewer
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
public static SL1File SL1File { get; } = new SL1File();
|
||||
public static FrmMain FrmMain { get; private set; }
|
||||
public static FrmAbout FrmAbout { get; private set; }
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
FrmMain = new FrmMain();
|
||||
FrmAbout = new FrmAbout();
|
||||
Application.Run(FrmMain);
|
||||
|
||||
//CbddlpFile file = new CbddlpFile();
|
||||
|
||||
//file.Load(@"D:\Tiago\Desktop\_Coronavirus-v6-HIRES-Supports.cbddlp");
|
||||
|
||||
|
||||
|
||||
//LayerPositionZ: 0, LayerExposure: 35, LayerOffTimeSeconds: 0, DataAddress: 283641, DataSize: 30804, Unknown1: 0, Unknown2: 0, Unknown3: 0, Unknown4: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("PrusaSL1Viewer")]
|
||||
[assembly: AssemblyDescription("Open, view, extract and convert SL1 files generated from PrusaSlicer")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("PTRTECH")]
|
||||
[assembly: AssemblyProduct("PrusaSL1Viewer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020 PTRTECH")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("e7389ee3-cf56-464b-9ba1-816b31d1e6ff")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// 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.1.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.1.0.0")]
|
||||
@@ -0,0 +1,133 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace PrusaSL1Viewer.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PrusaSL1Viewer.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Button_Info_16x16 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Button-Info-16x16", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Donate_16x16 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Donate-16x16", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Exit_16x16 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Exit-16x16", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Extract_object_16x16 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Extract-object-16x16", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Global_Network_icon_16x16 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Global-Network-icon-16x16", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Open_16x16 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Open-16x16", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap PrusaSL1Viewer {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("PrusaSL1Viewer", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<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="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>
|
||||
<data name="Exit-16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\Exit-16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Donate-16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\Donate-16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Global-Network-icon-16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Images\Global-Network-icon-16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<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>
|
||||
</root>
|
||||
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace PrusaSL1Viewer.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,150 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{E7389EE3-CF56-464B-9BA1-816B31D1E6FF}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>PrusaSL1Viewer</RootNamespace>
|
||||
<AssemblyName>PrusaSL1Viewer</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>PrusaSL1Viewer.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.IO.Compression.FileSystem" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FrmAbout.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FrmAbout.Designer.cs">
|
||||
<DependentUpon>FrmAbout.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FrmMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FrmMain.Designer.cs">
|
||||
<DependentUpon>FrmMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="FrmAbout.resx">
|
||||
<DependentUpon>FrmAbout.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="FrmMain.resx">
|
||||
<DependentUpon>FrmMain.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="..\CHANGELOG.md">
|
||||
<Link>CHANGELOG.md</Link>
|
||||
</None>
|
||||
<None Include="..\LICENSE">
|
||||
<Link>LICENSE</Link>
|
||||
</None>
|
||||
<None Include="..\README.md">
|
||||
<Link>README.md</Link>
|
||||
</None>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PrusaSL1Reader\PrusaSL1Reader.csproj">
|
||||
<Project>{53b884ca-e640-4171-8aa2-03935ac076d2}</Project>
|
||||
<Name>PrusaSL1Reader</Name>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="PrusaSL1Viewer.png" />
|
||||
<None Include="Images\Exit-16x16.png" />
|
||||
<None Include="Images\Open-16x16.png" />
|
||||
<None Include="Images\Extract-object-16x16.png" />
|
||||
<None Include="Images\Button-Info-16x16.png" />
|
||||
<None Include="Images\Donate-16x16.png" />
|
||||
<None Include="Images\Global-Network-icon-16x16.png" />
|
||||
<Content Include="PrusaSL1Viewer.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
|
After Width: | Height: | Size: 105 KiB |
|
After Width: | Height: | Size: 122 KiB |
|
After Width: | Height: | Size: 30 KiB |
@@ -1,2 +1,63 @@
|
||||
# PrusaSL1Viewer
|
||||
Pursa SL1 File Viewer
|
||||
# Prusa SL1 File Viewer
|
||||
|
||||
Open, view, extract and convert SL1 files generated from PrusaSlicer.
|
||||
|
||||
This easy tool can also give you insight of supports and find some failures.
|
||||
|
||||
## Why this project?
|
||||
I don't own a Prusa SL1 or any other resin printer, for now I’m only a FDM user with
|
||||
Prusa MK3 and a Ender3.
|
||||
PrusaSlicer is my only choose, why? Because I think it's the best and feature more,
|
||||
at least for me, simple but powerful.
|
||||
|
||||
So why this project? Well in fact I’m looking for a resin printer and i like to study
|
||||
and learn first before buy, get good and don't regret, and while inspecting i found that
|
||||
resin printers firmwares are not as universal as FDM, too many file formats and there
|
||||
before each printer can use their own property file, this of course limit the software selection,
|
||||
for example, only PrusaSlicer can slice SL1 files. So with that in mind i'm preparing when I got
|
||||
some resin printer in future I can use PrusaSlicer instead of others.
|
||||
I've explored the other slicers and again, no one give me joy, and i feel them unstable,
|
||||
many users slice model on PrusaSlicer just to get those supports and export stl to load in another,
|
||||
that means again PrusaSlicer is on the win side, the problem is they can't slice directly on PrusaSlicer,
|
||||
so, in the end, my project aims to do almost that, configure a printer on PrusaSlicer, eg: EPAX X1,
|
||||
slice, export file, convert SL1 to native printer file and print.
|
||||
|
||||
Please note i don't have any resin printer! All my work is virtual and calculated,
|
||||
so, use experimental functions with care! Once things got confirmed a list will show.
|
||||
But also, i need victims for test subject. Proceed at your own risk!
|
||||
|
||||
## Features
|
||||
|
||||
* View image layer by layer
|
||||
* View thumbnail
|
||||
* View all used settings
|
||||
* Export file to a folder
|
||||
* Portable (2 files only)
|
||||
|
||||
## Requirements
|
||||
|
||||
### Windows
|
||||
|
||||
1. Windows 7 or greater
|
||||
2. .NET Framework 4.8 installed (Comes pre-installed on Windows 10 with last updates)
|
||||
|
||||
### Mac and Linux
|
||||
|
||||
1. Latest Mono
|
||||
|
||||
## How to use
|
||||
|
||||
Theres multiple ways to open your SL1 file:
|
||||
|
||||
1. Open PrusaSL1Viewer.exe and load your file (CTRL + O) (File -> Open)
|
||||
2. Open PrusaSL1Viewer.exe and drag and drop your file inside window
|
||||
3. Drag and drop sl1 file into PrusaSL1Viewer.exe
|
||||
|
||||
## Library -> Developers
|
||||
|
||||
Are you a developer? This project include a .NET Core library (PrusaSL1Reader) that can be referenced in your application to make use of my work. Easy to use calls that allow you work with the formats. For more information navigate main code.
|
||||
|
||||
|
||||
## TODO
|
||||
* Convert SL1 files to another slicer file format
|
||||
* Add printer profiles
|
||||