diff --git a/CHANGELOG.md b/CHANGELOG.md index 6201488..2a74010 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 20/10/2022 - v3.7.2 + +- **File formats:** + - (Add) AnyCubic PM3R (#587) + - (Add) AnyCubic PMX2 + - (Fix) LGS: `LightOffDelay` is `WaitTimeBeforeCure` in this format +- **PrusaSlicer printer:** + - (Add) AnyCubic Photon M3 Premium + - (Add) AnyCubic Photon Mono X2 +- (Fix) Scripting: Unable to use sub-classes (#583) +- (Fix) Loading an image as file cause application to crash +- (Fix) "File - Send to" doesn't ignore case on file extension names resulting in ignore files in a uppercase even if extension is correct +- (Fix) Do not show layer material milliliters when value is 0 or the percentage is NaN +- (Fix) Auto-upgrade on Linux with AppImage integrated on system causes the file name to grow with hash strings + ## 17/10/2022 - v3.7.1 - (Add) PrusaSlicer printer: Elegoo Saturn 2 @@ -12,9 +27,9 @@ - (Add) Utility methods for transition layers calculation/parse - (Improvement) Calculate and set `TransitionLayerCount` property in file decode based on layer exposure time configuration - **GCode:** - - (Improvement) GCode: Able to parse layer image file with appended numbers on the filename (Afecting CWS) (#577) - - (Fix) Bad parsing of the file when it comes from Lychee or NovaMaker slicer (Afecting CWS) - - (Fix) Incorrect parse of "Wait time before cure" from layers when printer require wait sync moves (Afecting CWS) + - (Improvement) GCode: Able to parse layer image file with appended numbers on the filename (Affecting CWS) (#577) + - (Fix) Bad parsing of the file when it comes from Lychee or NovaMaker slicer (Affecting CWS) + - (Fix) Incorrect parse of "Wait time before cure" from layers when printer require wait sync moves (Affecting CWS) - **Tools:** - (Add) External tests: The Complete Resin 3D Printing Settings Guide for Beginners - (Add) External tests: 9 settings for faster printing diff --git a/PrusaSlicer/printer/AnyCubic Photon M3 Premium.ini b/PrusaSlicer/printer/AnyCubic Photon M3 Premium.ini new file mode 100644 index 0000000..f1a2925 --- /dev/null +++ b/PrusaSlicer/printer/AnyCubic Photon M3 Premium.ini @@ -0,0 +1,42 @@ +# generated by PrusaSlicer 2.5.0+win64 on 2022-10-20 at 13:33:45 UTC +absolute_correction = 0 +area_fill = 50 +bed_custom_model = +bed_custom_texture = +bed_shape = 0x0,218.88x0,218.88x123.12,0x123.12 +default_sla_material_profile = Prusa Orange Tough 0.05 +default_sla_print_profile = 0.05 Normal +display_height = 123.12 +display_mirror_x = 1 +display_mirror_y = 0 +display_orientation = landscape +display_pixels_x = 7680 +display_pixels_y = 4320 +display_width = 218.88 +elefant_foot_compensation = 0.2 +elefant_foot_min_width = 0.2 +fast_tilt_time = 5 +gamma_correction = 1 +high_viscosity_tilt_time = 10 +host_type = octoprint +inherits = Original Prusa SL1 +max_exposure_time = 120 +max_initial_exposure_time = 300 +max_print_height = 250 +min_exposure_time = 1 +min_initial_exposure_time = 1 +print_host = +printer_model = SL1 +printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_SL1\nPRINTER_VENDOR_ANYCUBIC\nPRINTER_MODEL_PHOTON_M3_PREMIUM\nFILEVERSION_517\nFILEFORMAT_PM3R\n\nSTART_CUSTOM_VALUES\nWaitTimeBeforeCure_2.5\nBottomLiftHeight_8\nLiftHeight_8\nBottomLiftSpeed_120\nLiftSpeed_120\nRetractSpeed_120\nBottomLightPWM_255\nLightPWM_255\nEND_CUSTOM_VALUES +printer_settings_id = +printer_technology = SLA +printer_variant = default +printer_vendor = +printhost_apikey = +printhost_cafile = +relative_correction = 1,1 +relative_correction_x = 1 +relative_correction_y = 1 +relative_correction_z = 1 +slow_tilt_time = 8 +thumbnails = 400x400,800x480 diff --git a/PrusaSlicer/printer/AnyCubic Photon Mono X2.ini b/PrusaSlicer/printer/AnyCubic Photon Mono X2.ini new file mode 100644 index 0000000..52b7a0c --- /dev/null +++ b/PrusaSlicer/printer/AnyCubic Photon Mono X2.ini @@ -0,0 +1,42 @@ +# generated by PrusaSlicer 2.5.0+win64 on 2022-10-20 at 13:33:53 UTC +absolute_correction = 0 +area_fill = 50 +bed_custom_model = +bed_custom_texture = +bed_shape = 0x0,196.61x0,196.61x122.88,0x122.88 +default_sla_material_profile = Prusa Orange Tough 0.05 +default_sla_print_profile = 0.05 Normal +display_height = 122.88 +display_mirror_x = 1 +display_mirror_y = 0 +display_orientation = landscape +display_pixels_x = 4096 +display_pixels_y = 2560 +display_width = 196.61 +elefant_foot_compensation = 0.2 +elefant_foot_min_width = 0.2 +fast_tilt_time = 5 +gamma_correction = 1 +high_viscosity_tilt_time = 10 +host_type = octoprint +inherits = Original Prusa SL1 +max_exposure_time = 120 +max_initial_exposure_time = 300 +max_print_height = 200 +min_exposure_time = 1 +min_initial_exposure_time = 1 +print_host = +printer_model = SL1 +printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_SL1\nPRINTER_VENDOR_ANYCUBIC\nPRINTER_MODEL_PHOTON_MONO_X2\nFILEVERSION_517\nFILEFORMAT_PMX2\n\nSTART_CUSTOM_VALUES\nWaitTimeBeforeCure_2.5\nBottomLiftHeight_8\nLiftHeight_8\nBottomLiftSpeed_120\nLiftSpeed_120\nRetractSpeed_120\nBottomLightPWM_255\nLightPWM_255\nEND_CUSTOM_VALUES +printer_settings_id = +printer_technology = SLA +printer_variant = default +printer_vendor = +printhost_apikey = +printhost_cafile = +relative_correction = 1,1 +relative_correction_x = 1 +relative_correction_y = 1 +relative_correction_z = 1 +slow_tilt_time = 8 +thumbnails = 400x400,800x480 diff --git a/README.md b/README.md index 212af49..933a1c1 100644 --- a/README.md +++ b/README.md @@ -116,10 +116,12 @@ But also, I need victims for test subject. Proceed at your own risk! - PWMA (Photon Workshop) - PWMS (Photon Workshop) - PWMX (Photon Workshop) +- PMX2 (Photon Workshop) - PWMB (Photon Workshop) - PWSQ (Photon Workshop) - PM3 (Photon Workshop) - PM3M (Photon Workshop) +- PM3R (Photon Workshop) - PWC (Photon Workshop) - JXS (GKone Slicer) - ZCode (UnizMaker) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index eb91362..1f7a996 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,13 @@ -- (Add) PrusaSlicer printer: Elegoo Saturn 2 -- (Fix) PCB Exposure: Possible error when drawing outline primitive macros that contains duplicate points (#580) +- **File formats:** + - (Add) AnyCubic PM3R (#587) + - (Add) AnyCubic PMX2 + - (Fix) LGS: `LightOffDelay` is `WaitTimeBeforeCure` in this format +- **PrusaSlicer printer:** + - (Add) AnyCubic Photon M3 Premium + - (Add) AnyCubic Photon Mono X2 +- (Fix) Scripting: Unable to use sub-classes (#583) +- (Fix) Loading an image as file cause application to crash +- (Fix) "File - Send to" doesn't ignore case on file extension names resulting in ignore files in a uppercase even if extension is correct +- (Fix) Do not show layer material milliliters when value is 0 or the percentage is NaN +- (Fix) Auto-upgrade on Linux with AppImage integrated on system causes the file name to grow with hash strings diff --git a/Scripts/010 Editor/lgs.bt b/Scripts/010 Editor/lgs.bt index 2dacca7..0654150 100644 --- a/Scripts/010 Editor/lgs.bt +++ b/Scripts/010 Editor/lgs.bt @@ -15,11 +15,11 @@ typedef struct() { struct HEADER { char Name[8] ; - uint32 Uint_08 ; - uint32 Uint_0C ; - uint32 PrinterModel ; - uint32 Uint_14 ; - uint32 MagicKey ; + uint Uint_08 ; + uint Uint_0C ; + uint PrinterModel ; + uint Uint_14 ; + uint MagicKey ; float PixelPerMmX ; float PixelPerMmY ; @@ -29,8 +29,8 @@ struct HEADER { float ExposureTimeMs ; float BottomExposureTimeMs ; float Float_38 ; - float LightOffDelayMs ; - float BottomLightOffDelayMs ; + float WaiTimeBeforeCureMs ; + float BottomWaiTimeBeforeCureMs ; float BottomHeight ; float Float_48 ; float BottomLiftHeight ; @@ -52,13 +52,13 @@ struct HEADER { float Float_8c ; float Float_90 ; float MachineZ ; - uint32 Uint_98 ; - uint32 Uint_9c ; - uint32 Uint_a0 ; - uint32 LayerCount ; - uint32 Uint_a8 ; - uint32 PreviewSizeX ; - uint32 PreviewSizeY ; + uint Uint_98 ; + uint Uint_9c ; + uint Uint_a0 ; + uint LayerCount ; + uint Uint_a8 ; + uint PreviewSizeX ; + uint PreviewSizeY ; } header; @@ -67,7 +67,7 @@ ubyte preview_data[header.PreviewSizeX*header.PreviewSizeY*2]; if(header.PrinterModel == 120) // .lgs120 { struct PNG_PREVIEW { - uint32 pngLength ; + uint pngLength ; ubyte png[pngLength] ; ushort padding ; } png_preview; diff --git a/Scripts/install-uvtools.sh b/Scripts/install-uvtools.sh index 36cd452..494c0f3 100644 --- a/Scripts/install-uvtools.sh +++ b/Scripts/install-uvtools.sh @@ -123,7 +123,7 @@ tmpfile="/tmp/$filename" echo "Downloading: $download_url" #wget $download_url -O "$tmpfile" -q --show-progress -curl -L --retry 3 $download_url -o "$tmpfile" +curl -L --retry 4 $download_url -o "$tmpfile" echo "- Setting permissions" chmod -fv a+x "$tmpfile" diff --git a/UVtools.Core/Extensions/SizeExtensions.cs b/UVtools.Core/Extensions/SizeExtensions.cs index 2429186..cfa922a 100644 --- a/UVtools.Core/Extensions/SizeExtensions.cs +++ b/UVtools.Core/Extensions/SizeExtensions.cs @@ -56,10 +56,17 @@ public static class SizeExtensions public static Size Multiply(this Size size, double dxy) => new((int)(size.Width * dxy), (int)(size.Height * dxy)); public static Size Multiply(this Size size, double dx, double dy) => new((int)(size.Width * dx), (int)(size.Height * dy)); - public static Size Divide(this Size size, SizeF otherSize) => new((int)(size.Width / otherSize.Width), (int)(size.Height / otherSize.Height)); + public static Size Divide(this Size size, Size otherSize) => new((int)(otherSize.Width == 0 ? 0 : size.Width / otherSize.Width), (int)(otherSize.Height == 0 ? 0 : size.Height / otherSize.Height)); + public static Size Divide(this Size size, SizeF otherSize) => new((int)(otherSize.Width == 0 ? 0 : size.Width / otherSize.Width), (int)(otherSize.Height == 0 ? 0 : size.Height / otherSize.Height)); public static Size Divide(this Size size) => size.Divide(size); - public static Size Divide(this Size size, double dxy) => new((int)(size.Width / dxy), (int)(size.Height / dxy)); - public static Size Divide(this Size size, double dx, double dy) => new((int)(size.Width / dx), (int)(size.Height / dy)); + public static Size Divide(this Size size, double dxy) => dxy == 0 ? Size.Empty : new((int)(size.Width / dxy), (int)(size.Height / dxy)); + public static Size Divide(this Size size, double dx, double dy) => new((int)(dx == 0 ? 0 : size.Width / dx), (int)(dy == 0 ? 0 : size.Height / dy)); + + public static SizeF Divide(this SizeF size, Size otherSize) => new((int)(otherSize.Width == 0 ? 0 : size.Width / otherSize.Width), (int)(otherSize.Height == 0 ? 0 : size.Height / otherSize.Height)); + public static SizeF Divide(this SizeF size, SizeF otherSize) => new((int)(otherSize.Width == 0 ? 0 : size.Width / otherSize.Width), (int)(otherSize.Height == 0 ? 0 : size.Height / otherSize.Height)); + public static SizeF Divide(this SizeF size) => size.Divide(size); + public static SizeF Divide(this SizeF size, double dxy) => dxy == 0 ? Size.Empty : new((int)(size.Width / dxy), (int)(size.Height / dxy)); + public static SizeF Divide(this SizeF size, double dx, double dy) => new((int)(dx == 0 ? 0 : size.Width / dx), (int)(dy == 0 ? 0 : size.Height / dy)); /// /// Gets if this size have a zero value on width or height diff --git a/UVtools.Core/FileFormats/LGSFile.cs b/UVtools.Core/FileFormats/LGSFile.cs index 9503f85..028320e 100644 --- a/UVtools.Core/FileFormats/LGSFile.cs +++ b/UVtools.Core/FileFormats/LGSFile.cs @@ -49,8 +49,8 @@ public class LGSFile : FileFormat [FieldOrder(11)] public float ExposureTimeMs { get; set; } [FieldOrder(12)] public float BottomExposureTimeMs { get; set; } [FieldOrder(13)] public float Float_38 { get; set; } = 10; // 0x38: 10 - [FieldOrder(14)] public float LightOffDelayMs { get; set; } = 2000; - [FieldOrder(15)] public float BottomLightOffDelayMs { get; set; } + [FieldOrder(14)] public float WaiTimeBeforeCureMs { get; set; } = 1000; + [FieldOrder(15)] public float BottomWaiTimeBeforeCureMs { get; set; } = 2000; [FieldOrder(16)] public float BottomHeight { get; set; } [FieldOrder(17)] public float Float_48 { get; set; } = 0.6f; // 0x48: 0.6 [FieldOrder(18)] public float BottomLiftHeight { get; set; } = 4; @@ -275,8 +275,8 @@ public class LGSFile : FileFormat { PrintParameterModifier.BottomLayerCount, - PrintParameterModifier.BottomLightOffDelay, - PrintParameterModifier.LightOffDelay, + PrintParameterModifier.BottomWaitTimeBeforeCure, + PrintParameterModifier.WaitTimeBeforeCure, PrintParameterModifier.BottomExposureTime, PrintParameterModifier.ExposureTime, @@ -380,42 +380,22 @@ public class LGSFile : FileFormat } } - public override float BottomLightOffDelay - { - get => TimeConverter.MillisecondsToSeconds(HeaderSettings.BottomLightOffDelayMs); - set - { - HeaderSettings.BottomLightOffDelayMs = TimeConverter.SecondsToMilliseconds(value); - base.BottomLightOffDelay = value; - } - } - - public override float LightOffDelay - { - get => TimeConverter.MillisecondsToSeconds(HeaderSettings.LightOffDelayMs); - set - { - HeaderSettings.LightOffDelayMs = TimeConverter.SecondsToMilliseconds(value); - base.LightOffDelay = value; - } - } - public override float BottomWaitTimeBeforeCure { - get => base.BottomWaitTimeBeforeCure; + get => TimeConverter.MillisecondsToSeconds(HeaderSettings.BottomWaiTimeBeforeCureMs); set { - SetBottomLightOffDelay(value); + HeaderSettings.BottomWaiTimeBeforeCureMs = TimeConverter.SecondsToMilliseconds(value); base.BottomWaitTimeBeforeCure = value; } } public override float WaitTimeBeforeCure { - get => base.WaitTimeBeforeCure; + get => TimeConverter.MillisecondsToSeconds(HeaderSettings.WaiTimeBeforeCureMs); set { - SetNormalLightOffDelay(value); + HeaderSettings.WaiTimeBeforeCureMs = TimeConverter.SecondsToMilliseconds(value); base.WaitTimeBeforeCure = value; } } diff --git a/UVtools.Core/FileFormats/PhotonWorkshopFile.cs b/UVtools.Core/FileFormats/PhotonWorkshopFile.cs index 5a50448..349b648 100644 --- a/UVtools.Core/FileFormats/PhotonWorkshopFile.cs +++ b/UVtools.Core/FileFormats/PhotonWorkshopFile.cs @@ -91,10 +91,12 @@ public class PhotonWorkshopFile : FileFormat PhotonMonoSE, PhotonMono4K, PhotonMonoX, + PhotonMonoX2, PhotonMonoX6KM3Plus, PhotonMonoSQ, PhotonM3, PhotonM3Max, + PhotonM3Premium, Custom, } #endregion @@ -1102,6 +1104,7 @@ public class PhotonWorkshopFile : FileFormat new(typeof(PhotonWorkshopFile), "dlp", "Photon Ultra (DLP)"), new(typeof(PhotonWorkshopFile), "dl2p", "Photon Photon D2 (DL2P)"), new(typeof(PhotonWorkshopFile), "pwmx", "Photon Mono X (PWMX)"), + new(typeof(PhotonWorkshopFile), "pmx2", "Photon Mono X2 (PMX2)"), new(typeof(PhotonWorkshopFile), "pwmb", "Photon Mono X 6K / Photon M3 Plus (PWMB)"), new(typeof(PhotonWorkshopFile), "pwmo", "Photon Mono (PWMO)"), new(typeof(PhotonWorkshopFile), "pwms", "Photon Mono SE (PWMS)"), @@ -1109,6 +1112,7 @@ public class PhotonWorkshopFile : FileFormat new(typeof(PhotonWorkshopFile), "pmsq", "Photon Mono SQ (PMSQ)"), new(typeof(PhotonWorkshopFile), "pm3", "Photon M3 (PM3)"), new(typeof(PhotonWorkshopFile), "pm3m", "Photon M3 Max (PM3M)"), + new(typeof(PhotonWorkshopFile), "pm3r", "Photon M3 Premium (PM3R)"), new(typeof(PhotonWorkshopFile), "pwc", "Anycubic Custom Machine (PWC)"), //new(typeof(PhotonWorkshopFile), "pwmb", "Photon M3 Plus (PWMB)"), }; @@ -1228,10 +1232,12 @@ public class PhotonWorkshopFile : FileFormat AnyCubicMachine.PhotonMonoSE => 82.62f, AnyCubicMachine.PhotonMono4K => 134.40f, AnyCubicMachine.PhotonMonoX => 192, + AnyCubicMachine.PhotonMonoX2 => 196.61f, AnyCubicMachine.PhotonMonoX6KM3Plus => 198.15f, AnyCubicMachine.PhotonMonoSQ => 120, AnyCubicMachine.PhotonM3 => 163.84f, AnyCubicMachine.PhotonM3Max => 298.08f, + AnyCubicMachine.PhotonM3Premium => 218.88f, _ => 0 }; } @@ -1257,10 +1263,12 @@ public class PhotonWorkshopFile : FileFormat AnyCubicMachine.PhotonMonoSE => 130.56f, AnyCubicMachine.PhotonMono4K => 84, AnyCubicMachine.PhotonMonoX => 120, + AnyCubicMachine.PhotonMonoX2 => 122.88f, AnyCubicMachine.PhotonMonoX6KM3Plus => 123.84f, AnyCubicMachine.PhotonMonoSQ => 128, AnyCubicMachine.PhotonM3 => 102.40f, AnyCubicMachine.PhotonM3Max => 165.60f, + AnyCubicMachine.PhotonM3Premium => 123.12f, _ => 0 }; } @@ -1287,10 +1295,12 @@ public class PhotonWorkshopFile : FileFormat AnyCubicMachine.PhotonMonoSE => 160, AnyCubicMachine.PhotonMono4K => 165, AnyCubicMachine.PhotonMonoX => 245, + AnyCubicMachine.PhotonMonoX2 => 200, AnyCubicMachine.PhotonMonoX6KM3Plus => 245, AnyCubicMachine.PhotonMonoSQ => 200, - AnyCubicMachine.PhotonM3 => 180f, - AnyCubicMachine.PhotonM3Max => 300f, + AnyCubicMachine.PhotonM3 => 180, + AnyCubicMachine.PhotonM3Max => 300, + AnyCubicMachine.PhotonM3Premium => 250, _ => 0 }; } @@ -1584,10 +1594,12 @@ public class PhotonWorkshopFile : FileFormat AnyCubicMachine.PhotonMonoSE => "Photon Mono SE", AnyCubicMachine.PhotonMono4K => "Photon Mono 4K", AnyCubicMachine.PhotonMonoX => "Photon Mono X", + AnyCubicMachine.PhotonMonoX2 => "Photon Mono X2", AnyCubicMachine.PhotonMonoX6KM3Plus => "Photon Mono X 6K / M3 Plus", AnyCubicMachine.PhotonMonoSQ => "Photon Mono SQ", AnyCubicMachine.PhotonM3 => "Photon M3", AnyCubicMachine.PhotonM3Max => "Photon M3 Max", + AnyCubicMachine.PhotonM3Premium => "Photon M3 Premium", AnyCubicMachine.Custom => "Custom", _ => base.MachineName }; @@ -1651,6 +1663,11 @@ public class PhotonWorkshopFile : FileFormat return AnyCubicMachine.PhotonMonoX; } + if (FileEndsWith(".pmx2")) + { + return AnyCubicMachine.PhotonMonoX2; + } + if (FileEndsWith(".pwmb")) { return AnyCubicMachine.PhotonMonoX6KM3Plus; @@ -1671,6 +1688,11 @@ public class PhotonWorkshopFile : FileFormat return AnyCubicMachine.PhotonM3Max; } + if (FileEndsWith(".pm3r")) + { + return AnyCubicMachine.PhotonM3Premium; + } + if (FileEndsWith(".pwc")) { return AnyCubicMachine.Custom; @@ -2083,10 +2105,12 @@ public class PhotonWorkshopFile : FileFormat AnyCubicMachine.PhotonMonoSE => VERSION_515, AnyCubicMachine.PhotonMono4K => VERSION_516, AnyCubicMachine.PhotonMonoX => VERSION_516, + AnyCubicMachine.PhotonMonoX2 => VERSION_517, AnyCubicMachine.PhotonMonoX6KM3Plus => VERSION_517, AnyCubicMachine.PhotonMonoSQ => VERSION_515, AnyCubicMachine.PhotonM3 => VERSION_516, AnyCubicMachine.PhotonM3Max => VERSION_516, + AnyCubicMachine.PhotonM3Premium => VERSION_517, AnyCubicMachine.Custom => VERSION_517, _ => VERSION_517 }; diff --git a/UVtools.Core/Layers/Layer.cs b/UVtools.Core/Layers/Layer.cs index 5b7ac72..c1769d8 100644 --- a/UVtools.Core/Layers/Layer.cs +++ b/UVtools.Core/Layers/Layer.cs @@ -680,7 +680,7 @@ public class Layer : BindableBase, IEquatable, IEquatable /// /// Gets the computed material milliliters percentage compared to the rest of the model /// - public float MaterialMillilitersPercent => _materialMilliliters * 100 / SlicerFile.MaterialMilliliters; + public float MaterialMillilitersPercent => SlicerFile.MaterialMilliliters > 0 ? _materialMilliliters * 100 / SlicerFile.MaterialMilliliters : float.NaN; /// /// Gets or sets the compression method used to cache the image @@ -1241,8 +1241,9 @@ public class Layer : BindableBase, IEquatable, IEquatable } else { - using var roiMat = mat.Roi(_boundingRectangle); + var roiMat = mat.Roi(_boundingRectangle); NonZeroPixelCount = (uint)CvInvoke.CountNonZero(roiMat); + roiMat.DisposeIfSubMatrix(); } diff --git a/UVtools.Core/Printer/Machine.cs b/UVtools.Core/Printer/Machine.cs index e1c191b..53a9b65 100644 --- a/UVtools.Core/Printer/Machine.cs +++ b/UVtools.Core/Printer/Machine.cs @@ -186,11 +186,13 @@ namespace UVtools.Core.Printer new(PrinterBrand.AnyCubic, "AnyCubic Photon M3", "Photon M3", 4096, 2560, 163.84f, 102.40f, 180f, FlipDirection.Horizontally), new(PrinterBrand.AnyCubic, "AnyCubic Photon M3 Max", "Photon M3 Max", 6480, 3600, 298.08f, 165.60f, 300f, FlipDirection.Horizontally), new(PrinterBrand.AnyCubic, "AnyCubic Photon M3 Plus", "Photon M3 Plus", 5760, 3600, 198.15f, 123.84f, 245f, FlipDirection.Horizontally), + new(PrinterBrand.AnyCubic, "AnyCubic Photon M3 Premium", "Photon M3 Premium", 7680, 4320, 218.88f, 123.12f, 250f, FlipDirection.Horizontally), new(PrinterBrand.AnyCubic, "AnyCubic Photon Mono 4K", "Photon Mono 4K", 3840, 2400, 134.40f, 84f, 165f, FlipDirection.Horizontally), new(PrinterBrand.AnyCubic, "AnyCubic Photon Mono SE", "Photon Mono SE", 1620, 2560, 82.62f, 130.56f, 160f, FlipDirection.Horizontally), new(PrinterBrand.AnyCubic, "AnyCubic Photon Mono SQ", "Photon Mono SQ", 2400, 2560, 120f, 128f, 200f, FlipDirection.Horizontally), new(PrinterBrand.AnyCubic, "AnyCubic Photon Mono X 6K", "Photon Mono X 6K", 5760, 3600, 198.15f, 123.84f, 245f, FlipDirection.Horizontally), new(PrinterBrand.AnyCubic, "AnyCubic Photon Mono X", "Photon Mono X", 3840, 2400, 192f, 120f, 245f, FlipDirection.Horizontally), + new(PrinterBrand.AnyCubic, "AnyCubic Photon Mono X2", "Photon Mono X2", 4096, 2560, 196.61f, 122.88f, 260f, FlipDirection.Horizontally), new(PrinterBrand.AnyCubic, "AnyCubic Photon Mono", "Photon Mono", 1620, 2560, 82.62f, 130.56f, 165f, FlipDirection.Horizontally), new(PrinterBrand.AnyCubic, "AnyCubic Photon S", "Photon S", 1440, 2560, 68.04f, 120.96f, 165f, FlipDirection.Horizontally), new(PrinterBrand.AnyCubic, "AnyCubic Photon Ultra", "Photon Ultra", 1280, 720, 102.4f, 57.6f, 165f, FlipDirection.Horizontally), diff --git a/UVtools.Core/Printer/Screen.cs b/UVtools.Core/Printer/Screen.cs new file mode 100644 index 0000000..2547b88 --- /dev/null +++ b/UVtools.Core/Printer/Screen.cs @@ -0,0 +1,55 @@ +/* + * GNU AFFERO GENERAL PUBLIC LICENSE + * Version 3, 19 November 2007 + * Copyright (C) 2007 Free Software Foundation, Inc. + * Everyone is permitted to copy and distribute verbatim copies + * of this license document, but changing it is not allowed. + */ + +using System.Drawing; +using UVtools.Core.Extensions; + +namespace UVtools.Core.Printer +{ + /// + /// Utility methods over a printer screen + /// + public static class Screen + { + /// + /// Gets the pixel size in mm + /// + /// Resolution in pixels + /// Display size in mm + /// Pixel size in mm + public static float GetPixelSize(int resolution, float displaySize) => resolution == 0 ? 0 : displaySize / resolution; + + /// + /// Gets the pixel size in microns + /// + /// Resolution in pixels + /// Display size in mm + /// Pixel size in microns + public static ushort GetPixelSizeMicrons(int resolution, float displaySize) => (ushort)(GetPixelSize(resolution, displaySize) * 1000); + + /// + /// Gets the pixel size in mm + /// + /// Resolution in pixels + /// Display size in mm + /// Pixel size in mm + public static SizeF GetPixelSize(Size resolution, SizeF displaySize) => displaySize.Divide(resolution); + + /// + /// Gets the pixel size in microns + /// + /// Resolution in pixels + /// Display size in mm + /// Pixel size in microns + public static Size GetPixelSizeMicrons(Size resolution, SizeF displaySize) + { + var pixel = GetPixelSize(resolution, displaySize); + return new Size((int)(pixel.Width * 1000), (int)(pixel.Height * 1000)); + } + } +} diff --git a/UVtools.Core/Scripting/ScriptParser.cs b/UVtools.Core/Scripting/ScriptParser.cs index 2223487..52f6630 100644 --- a/UVtools.Core/Scripting/ScriptParser.cs +++ b/UVtools.Core/Scripting/ScriptParser.cs @@ -41,12 +41,13 @@ public static class ScriptParser var textLength = text.Length; sbyte bracketsToRemove = 0; - text = Regex.Replace(text, @"(namespace\s+.+\n*.*{)", string.Empty); + text = Regex.Replace(text, @"(namespace\s+.+\n*\s*{)", string.Empty); if (textLength != text.Length) bracketsToRemove++; - else text = Regex.Replace(text, @"(namespace\s+.+\n*.*;)", string.Empty); // NET 6.0 + else text = Regex.Replace(text, @"(namespace\s+.+\n*\s*;)", string.Empty); // NET >= 6.0 textLength = text.Length; - text = Regex.Replace(text, @"(.*class\s+.*\n*.*{)", string.Empty); + var regex = new Regex(@"(.*class\s+.*\n*.*{)"); + text = regex.Replace(text, string.Empty, 1); if (textLength != text.Length) bracketsToRemove++; if (bracketsToRemove <= 0) return text; diff --git a/UVtools.Core/UVtools.Core.csproj b/UVtools.Core/UVtools.Core.csproj index 11c334f..0cd165f 100644 --- a/UVtools.Core/UVtools.Core.csproj +++ b/UVtools.Core/UVtools.Core.csproj @@ -10,7 +10,7 @@ https://github.com/sn4k3/UVtools https://github.com/sn4k3/UVtools MSLA/DLP, file analysis, calibration, repair, conversion and manipulation - 3.7.1 + 3.7.2 Copyright © 2020 PTRTECH UVtools.png AnyCPU;x64 diff --git a/UVtools.Installer/Code/HeatGeneratedFileList.wxs b/UVtools.Installer/Code/HeatGeneratedFileList.wxs index a1c4f23..1d0ae9d 100644 --- a/UVtools.Installer/Code/HeatGeneratedFileList.wxs +++ b/UVtools.Installer/Code/HeatGeneratedFileList.wxs @@ -938,6 +938,9 @@ + + + @@ -956,6 +959,9 @@ + + + @@ -1892,12 +1898,14 @@ + + diff --git a/UVtools.Installer/Code/Product.wxs b/UVtools.Installer/Code/Product.wxs index 098623f..f2c04ab 100644 --- a/UVtools.Installer/Code/Product.wxs +++ b/UVtools.Installer/Code/Product.wxs @@ -153,7 +153,7 @@ - + diff --git a/UVtools.WPF/MainWindow.Information.cs b/UVtools.WPF/MainWindow.Information.cs index 92021fd..1a8b413 100644 --- a/UVtools.WPF/MainWindow.Information.cs +++ b/UVtools.WPF/MainWindow.Information.cs @@ -374,7 +374,7 @@ public partial class MainWindow CurrentLayerProperties.Add(new ValueDescription(layer.LightPWM.ToString(), nameof(layer.LightPWM))); } var materialMillilitersPercent = layer.MaterialMillilitersPercent; - if (!float.IsNaN(materialMillilitersPercent)) + if (layer.MaterialMilliliters > 0 && !float.IsNaN(materialMillilitersPercent)) { CurrentLayerProperties.Add(new ValueDescription($"{layer.MaterialMilliliters}ml ({materialMillilitersPercent:F2}%)", nameof(layer.MaterialMilliliters))); } diff --git a/UVtools.WPF/MainWindow.axaml.cs b/UVtools.WPF/MainWindow.axaml.cs index c8b727a..fc393df 100644 --- a/UVtools.WPF/MainWindow.axaml.cs +++ b/UVtools.WPF/MainWindow.axaml.cs @@ -373,7 +373,7 @@ public partial class MainWindow : WindowEx var found = false; foreach (var ext in extensions) { - found = SlicerFile.FileFullPath.EndsWith($".{ext}"); + found = SlicerFile.FileEndsWith($".{ext}"); if (found) break; } if(!found) continue; @@ -404,7 +404,7 @@ public partial class MainWindow : WindowEx var found = false; foreach (var ext in extensions) { - found = SlicerFile.FileFullPath.EndsWith($".{ext}"); + found = SlicerFile.FileEndsWith($".{ext}"); if (found) break; } if (!found) continue; @@ -435,7 +435,7 @@ public partial class MainWindow : WindowEx var found = false; foreach (var ext in extensions) { - found = SlicerFile.FileFullPath.EndsWith($".{ext}"); + found = SlicerFile.FileEndsWith($".{ext}"); if (found) break; } if (!found) continue; @@ -1277,7 +1277,7 @@ public partial class MainWindow : WindowEx { if (!File.Exists(files[i])) continue; - if (files[i].EndsWith(".uvtop")) + if (files[i].EndsWith(".uvtop", StringComparison.OrdinalIgnoreCase)) { if(!IsFileLoaded) continue; try @@ -1295,7 +1295,7 @@ public partial class MainWindow : WindowEx continue; } - if (files[i].EndsWith(".cs") || files[i].EndsWith(".csx")) + if (files[i].EndsWith(".cs", StringComparison.OrdinalIgnoreCase) || files[i].EndsWith(".csx", StringComparison.OrdinalIgnoreCase)) { if (!IsFileLoaded) continue; try @@ -1759,10 +1759,14 @@ public partial class MainWindow : WindowEx if (SlicerFile is CTBEncryptedFile) { + if (Settings.General.LockedFilesOpenCounter == 0) + { + await this.MessageBoxInfo(CTBEncryptedFile.Preamble, "Information"); + } + Settings.General.LockedFilesOpenCounter++; if (Settings.General.LockedFilesOpenCounter >= UserSettings.GeneralUserSettings.LockedFilesMaxOpenCounter) { - await this.MessageBoxInfo(CTBEncryptedFile.Preamble, "Information"); Settings.General.LockedFilesOpenCounter = 0; } UserSettings.Save(); @@ -1867,7 +1871,7 @@ public partial class MainWindow : WindowEx catch (Exception ex) { string extraMessage = string.Empty; - if (SlicerFile.FileFullPath!.EndsWith(".sl1")) + if (SlicerFile.FileEndsWith(".sl1")) { extraMessage = "Note: When converting from SL1 make sure you have the correct printer selected, you MUST use a UVtools base printer.\n" + "Go to \"Help\" -> \"Install profiles into PrusaSlicer\" to install printers.\n"; diff --git a/UVtools.WPF/Structures/AppVersionChecker.cs b/UVtools.WPF/Structures/AppVersionChecker.cs index e4018b8..650c137 100644 --- a/UVtools.WPF/Structures/AppVersionChecker.cs +++ b/UVtools.WPF/Structures/AppVersionChecker.cs @@ -209,10 +209,10 @@ public class AppVersionChecker : BindableBase if (downloadFilename.EndsWith(".AppImage") && SystemAware.IsRunningLinuxAppImage(out var appImagePath)) { var directory = Path.GetDirectoryName(appImagePath); - var oldFileName = Path.GetFileName(appImagePath); + //var oldFileName = Path.GetFileName(appImagePath); // Try to keep same filename logic if user renamed the file, like UVtools.AppImage would keep same same - var newFilename = Regex.Replace(oldFileName, @"v\d.\d.\d", $"v{_version}"); - var newFullPath = Path.Combine(directory, newFilename); + //var newFilename = Regex.Replace(oldFileName, @"v\d+.\d+.\d+", $"v{_version}"); + var newFullPath = Path.Combine(directory, downloadFilename); if (File.Exists(appImagePath)) File.Delete(appImagePath); File.Move(DownloadedFile, newFullPath, true); @@ -247,7 +247,7 @@ public class AppVersionChecker : BindableBase //stream.WriteLine($"[ -f {About.Software} ] && {App.AppExecutableQuoted} & || dotnet {About.Software}.dll &"); if (SystemAware.IsRunningMacOSApp) { - await stream.WriteLineAsync($"find {upgradeFolder} -print0 | xargs -0 xattr -d com.apple.quarantine"); + await stream.WriteLineAsync($"find '{upgradeFolder}' -print0 | xargs -0 xattr -d com.apple.quarantine"); await stream.WriteLineAsync($"cp -fR {upgradeFolder}/* ../../../"); await stream.WriteLineAsync($"open ../../../{About.Software}.app"); } diff --git a/UVtools.WPF/UVtools.WPF.csproj b/UVtools.WPF/UVtools.WPF.csproj index ec73205..2dfc86b 100644 --- a/UVtools.WPF/UVtools.WPF.csproj +++ b/UVtools.WPF/UVtools.WPF.csproj @@ -12,7 +12,7 @@ LICENSE https://github.com/sn4k3/UVtools Git - 3.7.1 + 3.7.2 AnyCPU;x64 UVtools.png README.md diff --git a/UVtools.sln b/UVtools.sln index e722ae9..2353766 100644 --- a/UVtools.sln +++ b/UVtools.sln @@ -28,8 +28,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{B5BD32D7 build\compile.sh = build\compile.sh build\createRelease.ps1 = build\createRelease.ps1 build\createRelease.sh = build\createRelease.sh - build\libcvextern.sh = build\libcvextern.sh build\cvextern.ps1 = build\cvextern.ps1 + build\libcvextern.sh = build\libcvextern.sh build\README.md = build\README.md build\run.bat = build\run.bat build\run.sh = build\run.sh @@ -44,6 +44,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{E91CEB7A-5 RELEASE_NOTES.md = RELEASE_NOTES.md EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{2BE3B5D1-3E9C-451E-A795-40298AFFDE6B}" + ProjectSection(SolutionItems) = preProject + Scripts\ImportPrusaSlicerData.ps1 = Scripts\ImportPrusaSlicerData.ps1 + Scripts\install-dependencies.sh = Scripts\install-dependencies.sh + Scripts\install-uvtools.sh = Scripts\install-uvtools.sh + Scripts\libdl-solver.sh = Scripts\libdl-solver.sh + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -126,6 +134,10 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {B5BD32D7-3B3E-4254-877C-3353664BC044} = {E91CEB7A-5EDC-4928-8133-D8F354EF3CE8} + {2BE3B5D1-3E9C-451E-A795-40298AFFDE6B} = {E91CEB7A-5EDC-4928-8133-D8F354EF3CE8} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E9BEE8D8-E894-49A9-9435-491BF1E26E46} EndGlobalSection diff --git a/build/createRelease.ps1 b/build/createRelease.ps1 index dadbcf1..a9e95b9 100644 --- a/build/createRelease.ps1 +++ b/build/createRelease.ps1 @@ -158,7 +158,7 @@ foreach($element in $msiComponentsXml.Wix.Module.Directory.Directory) { wixCleanUpElement $element $msiSourceFiles #WriteXmlToScreen($msiComponentsXml); - #$msiComponentsXml.Save("$rootFolder\$publishFolder\test.xml") + #$msiComponentsXml.Save("$rootPath\$publishFolder\test.xml") return break } @@ -178,7 +178,7 @@ function WriteXmlToScreen([xml]$xml) #> # Script working directory -Set-Location $PSScriptRoot\.. +#Set-Location $PSScriptRoot\.. #################################### ### Configuration ### @@ -198,20 +198,23 @@ $stopWatch.Start() # Variables -$software = "UVtools" -$project = "UVtools.WPF" -$buildWith = "Release" -$netVersion = "6.0" -$rootFolder = $(Get-Location) -$buildFolder = "$rootFolder\build" -$releaseFolder = "$project\bin\$buildWith\net$netVersion" -$objFolder = "$project\obj\$buildWith\net$netVersion" -$publishFolder = "publish" -$platformsFolder = "$buildFolder\platforms" -$changelogFile = "$rootFolder\CHANGELOG.md" +$software = "UVtools" +$project = "UVtools.WPF" +$buildWith = "Release" +$netVersion = "6.0" +$publishFolder = "publish" -#$version = (Get-Command "$releaseFolder\UVtools.dll").FileVersionInfo.ProductVersion -$projectXml = [Xml] (Get-Content "$project\$project.csproj") +$rootPath = Split-Path $PSScriptRoot -Parent +$buildPath = "$rootPath\build" +$platformsPath = "$buildPath\platforms" +$publishPath = "$rootPath\$publishFolder" +$releasePath = "$rootPath\$project\bin\$buildWith\net$netVersion" +$objPath = "$rootPath\$project\obj\$buildWith\net$netVersion" +$changelogFile = "$rootPath\CHANGELOG.md" +$releaseNotesFile = "$rootPath\RELEASE_NOTES.md" + +#$version = (Get-Command "$releasePath\UVtools.dll").FileVersionInfo.ProductVersion +$projectXml = [Xml] (Get-Content "$rootPath\$project\$project.csproj") $version = "$($projectXml.Project.PropertyGroup.Version)".Trim(); if([string]::IsNullOrWhiteSpace($version)){ Write-Error "Can not detect the UVtools version, does $project\$project.csproj exists?" @@ -219,10 +222,11 @@ if([string]::IsNullOrWhiteSpace($version)){ } # MSI Variables -$installer = "UVtools.Installer" -$msiOutputFile = "$rootFolder\UVtools.Installer\bin\x64\Release\UVtools.msi" -$msiProductFile = "$rootFolder\UVtools.Installer\Code\Product.wxs" -$msiSourceFiles = "$rootFolder\$publishFolder\${software}_win-x64_v$version" +$installer = "UVtools.Installer" +$installerPath = "$rootPath\$installer" +$msiOutputFile = "$installerPath\bin\x64\Release\UVtools.msi" +$msiProductFile = "$installerPath\Code\Product.wxs" +$msiSourceFiles = "$publishPath\${software}_win-x64_v$version" $msbuildPaths = "${env:ProgramFiles}\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe", "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe", @@ -314,8 +318,9 @@ foreach($line in $changelog) { [void]$sb.AppendLine($line) } } + Write-Host $sb.ToString() -Set-Content -Path "$rootFolder/RELEASE_NOTES.md" -Value $sb.ToString() +Set-Content -Path "$releaseNotesFile" -Value $sb.ToString() <# if($null -ne $enableNugetPublish -and $enableNugetPublish) @@ -348,47 +353,49 @@ foreach ($obj in $runtimes.GetEnumerator()) { $runtime = $obj.Name; # runtime name $extraCmd = $obj.extraCmd; # extra cmd to run with dotnet $publishName="${software}_${runtime}_v$version" + $publishCurrentPath="$publishPath\$publishName" #dotnet build "UVtools.Cmd" -c $buildWith #dotnet build $project -c $buildWith if($runtime.StartsWith("win-")) { - $targetZip = "$publishFolder/${software}_${runtime}_v$version.zip" # Target zip filename - Remove-Item "$publishFolder/$publishName" -Recurse -ErrorAction Ignore + $targetZip = "$publishPath/${software}_${runtime}_v$version.zip" # Target zip filename + Remove-Item "$publishCurrentPath" -Recurse -ErrorAction Ignore Remove-Item "$targetZip" -ErrorAction Ignore # Deploy Write-Output "################################ Building: $runtime" - dotnet publish "UVtools.Cmd" -o "$publishFolder/$publishName" -c $buildWith -r $runtime -p:PublishReadyToRun=true --self-contained $extraCmd - dotnet publish $project -o "$publishFolder/$publishName" -c $buildWith -r $runtime -p:PublishReadyToRun=true --self-contained $extraCmd + dotnet publish "$rootPath\UVtools.Cmd" -o "$publishCurrentPath" -c $buildWith -r $runtime -p:PublishReadyToRun=true --self-contained $extraCmd + dotnet publish "$rootPath\$project" -o "$publishCurrentPath" -c $buildWith -r $runtime -p:PublishReadyToRun=true --self-contained $extraCmd - New-Item "$publishFolder/$publishName/runtime_package.dat" -ItemType File -Value $runtime + New-Item "$publishCurrentPath\runtime_package.dat" -ItemType File -Value $runtime # Cleanup - Remove-Item "UVtools.Cmd\bin\$buildWith\net$netVersion\$runtime" -Recurse -ErrorAction Ignore - Remove-Item "UVtools.Cmd\obj\$buildWith\net$netVersion\$runtime" -Recurse -ErrorAction Ignore + Remove-Item "$rootPath\UVtools.Cmd\bin\$buildWith\net$netVersion\$runtime" -Recurse -ErrorAction Ignore + Remove-Item "$rootPath\UVtools.Cmd\obj\$buildWith\net$netVersion\$runtime" -Recurse -ErrorAction Ignore - Remove-Item "$releaseFolder\$runtime" -Recurse -ErrorAction Ignore - Remove-Item "$objFolder\$runtime" -Recurse -ErrorAction Ignore + Remove-Item "$releasePath\$runtime" -Recurse -ErrorAction Ignore + Remove-Item "$objPath\$runtime" -Recurse -ErrorAction Ignore - Write-Output "$releaseFolder\$runtime" + Write-Output "$publishCurrentPath" foreach ($excludeObj in $obj.Value.exclude) { Write-Output "Excluding: $excludeObj" - Remove-Item "$publishFolder\$runtime\$excludeObj" -Recurse -ErrorAction Ignore + Remove-Item "$publishPath\$runtime\$excludeObj" -Recurse -ErrorAction Ignore } foreach ($includeObj in $obj.Value.include) { Write-Output "Including: $includeObj" - Copy-Item "$platformsFolder\$runtime\$includeObj" -Destination "$publishFolder\$publishName" -Recurse -ErrorAction Ignore + Copy-Item "$platformsPath\$runtime\$includeObj" -Destination "$publishCurrentPath" -Recurse -ErrorAction Ignore + Copy-Item "$platformsPath\$runtime\$includeObj" -Destination "$publishCurrentPath" -Recurse -ErrorAction Ignore } if($null -ne $zipPackages -and $zipPackages) { Write-Output "Compressing $runtime to: $targetZip" - wsl cd "$publishFolder/$publishName" `&`& pwd `&`& zip -rq "../../$targetZip" . + wsl --cd "$publishCurrentPath" pwd `&`& zip -rq "../../$targetZip" . } } else @@ -398,7 +405,8 @@ foreach ($obj in $runtimes.GetEnumerator()) { { $buildArgs += ' -z' # Zip } - bash -c "'build/createRelease.sh' $buildArgs $runtime" + + wsl --cd "$buildPath" bash -c "./createRelease.sh $buildArgs $runtime" #Start-Job { bash -c "'build/createRelease.sh' $using:buildArgs$buildArgs $using:runtime" } } @@ -438,7 +446,7 @@ Building: $runtime" dotnet build $project -c $buildWith Write-Output "Compressing $runtime to: $targetZip" -[System.IO.Compression.ZipFile]::CreateFromDirectory($releaseFolder, $targetZip, [System.IO.Compression.CompressionLevel]::Optimal, $false, [FixedEncoder]::new()) +[System.IO.Compression.ZipFile]::CreateFromDirectory($releasePath, $targetZip, [System.IO.Compression.CompressionLevel]::Optimal, $false, [FixedEncoder]::new()) Write-Output "Took: $($deployStopWatch.Elapsed) ################################ " @@ -451,11 +459,12 @@ if($null -ne $enableMSI -and $enableMSI) $deployStopWatch.Restart() $runtime = 'win-x64' $publishName = "${software}_${runtime}_v$version"; + $publishCurrentPath="$publishPath\$publishName" if ((Test-Path -Path $msiSourceFiles) -and ((Get-ChildItem "$msiSourceFiles" | Measure-Object).Count) -gt 0) { if ($null -ne $msbuild) { - $msiTargetFile = "$publishFolder\$publishName.msi" + $msiTargetFile = "$publishPath\$publishName.msi" Write-Output "################################" Write-Output "Clean and build MSI components manifest file" @@ -476,8 +485,8 @@ if($null -ne $enableMSI -and $enableMSI) } #> - if(Test-Path "$publishFolder\$publishName\UVtools.Core.dll" -PathType Leaf){ - Add-Type -Path "$publishFolder\$publishName\UVtools.Core.dll" + if(Test-Path "$publishCurrentPath\UVtools.Core.dll" -PathType Leaf){ + Add-Type -Path "$publishCurrentPath\UVtools.Core.dll" } else { Write-Error "Unable to find UVtools.Core.dll" return @@ -504,9 +513,9 @@ if($null -ne $enableMSI -and $enableMSI) # Clean and build MSI - Remove-Item "$installer\obj" -Recurse -ErrorAction Ignore - Remove-Item "$installer\bin" -Recurse -ErrorAction Ignore - Invoke-Expression "& $msbuild $installer\$installer.wixproj" + Remove-Item "$installerPath\obj" -Recurse -ErrorAction Ignore + Remove-Item "$installerPath\bin" -Recurse -ErrorAction Ignore + Invoke-Expression "& $msbuild '$installerPath\$installer.wixproj'" Write-Output "Copying $runtime MSI to: $msiTargetFile" Copy-Item $msiOutputFile $msiTargetFile diff --git a/build/createRelease.sh b/build/createRelease.sh index c988ecd..8d89f72 100644 --- a/build/createRelease.sh +++ b/build/createRelease.sh @@ -40,8 +40,10 @@ fi bundlePublish=false keepNetPublish=false zipPackage=false + +#echo $@ while getopts 'bzk' flag; do - case "${flag}" in + case $flag in b) bundlePublish=true ;; k) keepNetPublish=true ;; z) zipPackage=true ;; @@ -54,6 +56,10 @@ while getopts 'bzk' flag; do esac done +#echo "Bundle publish: $bundlePublish" +#echo "Keep publish: $keepNetPublish" +#echo "Zip package: $zipPackage" + # Checks if ! command -v dotnet &> /dev/null then diff --git a/documentation/UVtools.Core.xml b/documentation/UVtools.Core.xml index ee89b81..49343fa 100644 --- a/documentation/UVtools.Core.xml +++ b/documentation/UVtools.Core.xml @@ -6490,6 +6490,43 @@ + + + Utility methods over a printer screen + + + + + Gets the pixel size in mm + + Resolution in pixels + Display size in mm + Pixel size in mm + + + + Gets the pixel size in microns + + Resolution in pixels + Display size in mm + Pixel size in microns + + + + Gets the pixel size in mm + + Resolution in pixels + Display size in mm + Pixel size in mm + + + + Gets the pixel size in microns + + Resolution in pixels + Display size in mm + Pixel size in microns + Gets the input label