Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException with MangOS printer Lychee file #474

Open
bonezinger opened this issue May 13, 2022 · 5 comments
Open

NullPointerException with MangOS printer Lychee file #474

bonezinger opened this issue May 13, 2022 · 5 comments
Assignees

Comments

@bonezinger
Copy link

OS: Windows 10 64-bit
Slicer: Lychee 3.7.1
Printer: MangOS printer profile
UVtools version: 3.3.2 X64

Steps to replicate:

  1. Open Lychee, create a new MangOS printer profile (it's at the bottom of the list)
  2. Load any 3d file
  3. Slice, save file with .cws extension
  4. Open the saved file in UVTools with Partial mode

Doing that, the following error occurs:

System.NullReferenceException: Object reference not set to an instance of an object.
   at UVtools.Core.FileFormats.FileFormat.Sanitize() in D:\Tiago\Dropbox\Programming\C#\UVtools\UVtools.Core\FileFormats\FileFormat.cs:line 5312
   at UVtools.Core.FileFormats.FileFormat.Decode(String fileFullPath, FileDecodeType fileDecodeType, OperationProgress progress) in D:\Tiago\Dropbox\Programming\C#\UVtools\UVtools.Core\FileFormats\FileFormat.cs:line 3343
   at UVtools.WPF.MainWindow.<>c__DisplayClass104_0.<ProcessFile>b__1() in D:\Tiago\Dropbox\Programming\C#\UVtools\UVtools.WPF\MainWindow.axaml.cs:line 1453

The error does NOT occur if you open the file normally. However, it asks for Layer height, Display width and Display height once you load the file, even if you have set up all values properly in Lychee.

I am not entirely sure whether this is a problem with how Lychee saves the .cws file or with UVTools, since files generated with the Nova printer profiles have no such problem. I've reported this on Lychee's Discord as well.

@sn4k3
Copy link
Owner

sn4k3 commented May 13, 2022

It may due lychee is using other names for keys or not dump the information at all since cws does not require that information which is crucial to UVtools.
Please attach the file here

@bonezinger
Copy link
Author

Here's the file generated.
https://www.mediafire.com/file/th3kapyvh3jall5/MANGOS2.cws/file

@sn4k3
Copy link
Owner

sn4k3 commented May 13, 2022

There's a bug on sanitize function which not cover this situation on partial mode. Still i can't open your file on normal mode, with a different error... I will have a look.

Regarding not having layer height and others is because lychee use another key for the name.
CWS is a mess because each variant use different names...

@sn4k3
Copy link
Owner

sn4k3 commented May 13, 2022

The problem seens on PNG itself, extracting layer from zip gives:
explorer_2022-05-13_02-47-51

But UVtools PNG decoder detects as 2400x3840.
Also lychee use 32bit PNGs while UVtools is all 8bit, but this isn't the problem since extra channels are stripped converted to 8bit.

Open as 32bit also gives: 2400, 3840, 3.
Something is really off here

Is printer LCD a square shape?

@bonezinger
Copy link
Author

2048x2048 is the default values of the MangOS printer, it shows up as a square, but I suspect Lychee uses that as a "custom" profile for any unlisted printer, as it's the only one that lets you freely change several parameters that are locked for typical printers.

I've changed the parameters of the profile I'm using to use the same screen size as a Nova Whale2 printer, which is 3840x2400, 192mm x 120mm, but it doesn't look like it's being correctly exported by Lychee. - https://www.mediafire.com/file/ugk9rmbxaq18kd3/MangosProfile-Whale2.lyp/file

sn4k3 added a commit that referenced this issue May 16, 2022
- **Core:**
   - (Add) Getter `FileFormat.DisplayPixelCount` Gets the display total number of pixels (ResolutionX * ResolutionY)
   - (Add) Getter `Layer.NonZeroPixelRatio` Gets the ratio between non zero pixels and display number of pixels
   - (Add) Getter `Layer.NonZeroPixelPercentage` Gets the percentage of non zero pixels relative to the display number of pixels
   - (Add) Getter `Layer.PreviousHeightLayer()` Gets the previous layer with a different height from the current, returns null if no previous layer
   - (Add) Getter `Layer.NextHeightLayer()` Gets the next layer with a different height from the current, returns null if no next layer
   - (Add) Method `Layer.GetPreviousLayerWithAtLeastPixelCountOf()` Gets the previous layer matching at least a number of pixels, returns null if no previous layer
   - (Add) Method `Layer.GetNextLayerWithAtLeastPixelCountOf()` Gets the next layer matching at least a number of pixels, returns null if no next layer
   - (Add) Method `Operation.GetRoiOrVolumeBounds()` returns the selected ROI rectangle or model volume bounds rectangle
   - (Add) Documentation around `Operation` methods
   - (Fix) Open files in partial mode when the resolution is not defined would cause a `NullPointerException` (#474)
- **Suggestion: Wait time before cure**
   - (Add) Proportional maximum time change: Sets the maximum allowed time difference relative to the previous layer (#471)
   - (Add) Proportional mass get modes: Previous, Average and Maximum relative to a defined height (#471)
   - (Change) Proportional set type sets fallback time to the first layer
   - (Fix) Proportional set type was taking current layer mass instead of looking to the previous cured layer (#471)
- **Tools:**
   - **Edit print parameters:**
      - (Change) Incorporate the unit label into the numeric input box
      - (Change) Allow TSMC speeds to be 0 as minimum value (#472)
   - (Fix) PCB Exposure: The thumbnail has random noise around the image
- **Settings:**
   - (Add) Tools: "Always prompt for confirmation before execute the operation"
   - (Fix) Changing layer compression method when no file is loaded would cause a error
- **UI:**
   - (Add) Holding Shift key while drag and drop a .uvtop file will try to execute the operation without showing the window or prompt
   - (Add) Drag and drop a .cs or .csx file into UVtools will load and show the scripting dialog with the file selected
- (Add) Errors that crash application will now show an report window with the crash information and able to fast report them
- (Add) "Version" key and value on registry to tell the current installed version (Windows MSI only)
- (Upgrade) AvaloniaUI from 0.10.13 to 0.10.14
- (Upgrade) .NET from 6.0.4 to 6.0.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants