Skip to content

Commit

Permalink
Added currency parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Molodos committed Apr 26, 2024
1 parent 9193294 commit 274b336
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ the [Cura plugin version](https://github.com/Molodos/ElegooNeptuneThumbnails) of
operating system, you have to compile the script yourself as described in [Packaging Guide](#packaging-guide)
2) Place the binary somewhere on your system and remember the path (
e.g. `C:\Users\Michael\ElegooNeptuneThumbnails-Prusa.exe`)
3) Set the thumbnail generation in PrusaSlicer7OrcaSlicer to at least 300x300 (600x600 is optimal)
3) Set the thumbnail generation in PrusaSlicer/OrcaSlicer to at least 300x300 (600x600 is optimal)
PNG <img src="readme_images/prusaslicer_set_thumbnail.png" width="600">
4) Configure the path to the post-processing script binary in
PrusaSlicer/ORcaSlicer <img src="readme_images/prusaslicer_add_script.png" width="600">
Expand All @@ -63,11 +63,12 @@ the [Cura plugin version](https://github.com/Molodos/ElegooNeptuneThumbnails) of
Yes, check out the [ElegooNeptuneThumbnails plugin for Cura 5.X](https://github.com/Molodos/ElegooNeptuneThumbnails),
which is the extended version of this post processing script.

### I did not use the official Neptune printer preset in PrusaSlicer or OrcaSlicer, what to do?
### I did not use the official Neptune printer preset in PrusaSlicer or OrcaSlicer or want another currency, what to do?

The script cannot auto-detect your printer when doing so. To manually set the printer model, use the
parameter `--printer=<printer_model>` after the path of the processing script in the PrusaSlicer settings. It should
look like `C:\Users\Michael\ElegooNeptuneThumbnails-Prusa.exe --printer=NEPTUNE4PRO`. Allowed values are the following:
look like `C:\Users\Michael\ElegooNeptuneThumbnails-Prusa.exe --printer=NEPTUNE4PRO --currency=€`. Allowed values for
printer are the following:

NEPTUNE4, NEPTUNE4PRO, NEPTUNE4PLUS, NEPTUNE4MAX, NEPTUNE3PRO, NEPTUNE3PLUS, NEPTUNE3MAX, NEPTUNE2, NEPTUNE2S,
NEPTUNE2D, NEPTUNEX and ORANGESTORMGIGA
Expand Down Expand Up @@ -98,7 +99,7 @@ the [Cura plugin version](https://github.com/Molodos/ElegooNeptuneThumbnails) of

### Why does the model height show "N/A" when using PrusaSlicer?

PrusaSlicer unfortunately does not add the model height to the gcode. Therefore the script cannot display it.
PrusaSlicer unfortunately does not add the model height to the gcode. Therefore the script cannot display it.

## Packaging Guide

Expand Down
12 changes: 8 additions & 4 deletions elegoo_neptune_thumbnails.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ class SliceData:
"""

def __init__(self, time_seconds: int, printer_model: str, model_height: float, filament_grams: float,
filament_cost: float, currency: str = "€"):
filament_cost: float, currency: str = None):
self.printer_model: str = printer_model
self.time_seconds: int = time_seconds
self.model_height: float = model_height
self.filament_grams: float = filament_grams
self.filament_cost: float = filament_cost
self.currency: str = currency
self.currency: str = currency if currency else "€"


class ElegooNeptuneThumbnails:
Expand Down Expand Up @@ -63,6 +63,7 @@ def __init__(self):
args: Namespace = self._parse_args()
self._gcode: str = args.gcode
self._printer_model: str = args.printer
self._currency: str = args.currency
self._thumbnail: QImage = self._get_q_image_thumbnail()

# Get slice data
Expand All @@ -86,7 +87,9 @@ def _parse_args(cls) -> Namespace:
description="A post processing script to add Elegoo Neptune thumbnails to gcode")
parser.add_argument("-p", "--printer", help="Printer model to generate for", type=str, required=False,
default="")
parser.add_argument("gcode", help="Gcode path provided by PrusaSlicer", type=str)
parser.add_argument("-c", "--currency", help="The currency to user (default is Euro)", type=str, required=False,
default="")
parser.add_argument("gcode", help="Gcode path provided by OrcaSlicer", type=str)
return parser.parse_args()

def _get_base64_thumbnail(self, min_size: int = 300) -> str:
Expand Down Expand Up @@ -190,7 +193,8 @@ def _get_slice_data(self) -> SliceData:
printer_model=attributes.get("printer_model", None),
model_height=float(attributes.get("model_height", "-1")),
filament_grams=float(attributes.get("filament_grams", "-1")),
filament_cost=float(attributes.get("filament_cost", "-1"))
filament_cost=float(attributes.get("filament_cost", "-1")),
currency=self._currency
)

def is_supported_printer(self) -> bool:
Expand Down

0 comments on commit 274b336

Please sign in to comment.