Skip to content

Commit

Permalink
v0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sn4k3 committed Apr 27, 2020
1 parent bfc42aa commit 788f12c
Show file tree
Hide file tree
Showing 29 changed files with 2,104 additions and 726 deletions.
25 changes: 21 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 27/04/2020 - v0.3.0 - Beta

* (Add) zcodex file format
* (Add) Zortrax Inkspire Printer
* (Add) Properties menu -- Shows total keys and allow save information to a file
* (Add) "GCode" viewer Tab -- Only for formats that incldue gcode into file (ie: zcodex)
* (Add) Save gcode to a text file
* (Add) Allow to vertical arrange height between thumbnails and properties
* (Improvement) Thumbnail section is now hidden if no thumbnails avaliable
* (Improvement) Thumbnail section now vertical auto scales to the image height on file load
* (Improvement) On "modify properties" window, ENTER key can now be used to accept and submit the form
* (Fixed) Current model height doesn't calculate when viewing cbddlp files
* (Change) Round values up to two decimals
* (Change) Move actual model height near total height, now it shows (actual/total mm)
* (Change) Increase font size
* (Change) Rearrange code

## 22/04/2020 - v0.2.2 - Beta

* (Add) File -> Reload
Expand Down Expand Up @@ -27,10 +44,10 @@

## 12/04/2020 - v0.2 - Beta

* Add cbddlp file format
* Add "convert to" function, allow convert sl1 file to another
* Add EPAX X1 printer
* Change code with abstraction of file formats
* (Add) cbddlp file format
* (Add) "convert to" function, allow convert sl1 file to another
* (Add) EPAX X1 printer
* (Change) Code with abstraction of file formats

## 06/04/2020 - V0.1 - Beta

Expand Down
395 changes: 197 additions & 198 deletions PrusaSL1Reader/CbddlpFile.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

namespace PrusaSL1Reader
namespace PrusaSL1Reader.Extensions
{
public static class ObjectExtensions
{
Expand All @@ -21,7 +21,7 @@ public static class ObjectExtensions
/// <returns>Converted value into target type</returns>
public static T Convert<T>(this object input)
{
return input.ToString().Convert<T>();
return StringExtensions.Convert<T>(input.ToString());
}

public static object DeserializeFromBytes(byte[] bytes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
* 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
namespace PrusaSL1Reader.Extensions
{
public static class StringExtensions
{
Expand Down
54 changes: 54 additions & 0 deletions PrusaSL1Reader/Extensions/ZipArchiveExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* 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.IO.Compression;

namespace PrusaSL1Reader.Extensions
{
public static class ZipArchiveExtensions
{
/// <summary>
/// Create a file into archive and write content to it
/// </summary>
/// <param name="input"><see cref="ZipArchive"/></param>
/// <param name="filename">Filename to create</param>
/// <param name="content">Content to write</param>
/// <returns>Created <see cref="ZipArchiveEntry"/></returns>
public static ZipArchiveEntry PutFileContent(this ZipArchive input, string filename, string content, bool deleteFirst = true)
{
if(deleteFirst) input.GetEntry(filename)?.Delete();

var entry = input.CreateEntry(filename);
if (ReferenceEquals(content, null)) return entry;
using (TextWriter tw = new StreamWriter(entry.Open()))
{
tw.Write(content);
tw.Close();
}

return entry;
}

public static ZipArchiveEntry PutFileContent(this ZipArchive input, string filename, Stream content, bool deleteFirst = true)
{
if (deleteFirst) input.GetEntry(filename)?.Delete();
var entry = input.CreateEntry(filename);
if (ReferenceEquals(content, null)) return entry;
using (StreamWriter tw = new StreamWriter(entry.Open()))
{
tw.Write(content);
tw.Close();
}

return entry;
}


}
}
Loading

0 comments on commit 788f12c

Please sign in to comment.