metadata: add PrusaSlicer aliases
The varous forks of PrusaSlicer are processed identically outside of their identifier, so there is no need to implement new classes for each fork. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
81b0c0a581
commit
fdfab66951
|
@ -177,12 +177,18 @@ class UnknownSlicer(BaseSlicer):
|
||||||
|
|
||||||
class PrusaSlicer(BaseSlicer):
|
class PrusaSlicer(BaseSlicer):
|
||||||
def check_identity(self, data: str) -> Optional[Dict[str, str]]:
|
def check_identity(self, data: str) -> Optional[Dict[str, str]]:
|
||||||
match = re.search(r"PrusaSlicer\s(.*)\son", data)
|
aliases = {
|
||||||
if match:
|
'PrusaSlicer': r"PrusaSlicer\s(.*)\son",
|
||||||
return {
|
'SuperSlicer': r"SuperSlicer\s(.*)\son",
|
||||||
'slicer': "PrusaSlicer",
|
'SliCR-3D': r"SliCR-3D\s(.*)\son"
|
||||||
'slicer_version': match.group(1)
|
}
|
||||||
}
|
for name, expr in aliases.items():
|
||||||
|
match = re.search(expr, data)
|
||||||
|
if match:
|
||||||
|
return {
|
||||||
|
'slicer': name,
|
||||||
|
'slicer_version': match.group(1)
|
||||||
|
}
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def parse_first_layer_height(self) -> Optional[float]:
|
def parse_first_layer_height(self) -> Optional[float]:
|
||||||
|
@ -329,16 +335,6 @@ class Slic3r(Slic3rPE):
|
||||||
def parse_estimated_time(self) -> Optional[float]:
|
def parse_estimated_time(self) -> Optional[float]:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
class SuperSlicer(PrusaSlicer):
|
|
||||||
def check_identity(self, data: str) -> Optional[Dict[str, str]]:
|
|
||||||
match = re.search(r"SuperSlicer\s(.*)\son", data)
|
|
||||||
if match:
|
|
||||||
return {
|
|
||||||
'slicer': "SuperSlicer",
|
|
||||||
'slicer_version': match.group(1)
|
|
||||||
}
|
|
||||||
return None
|
|
||||||
|
|
||||||
class Cura(PrusaSlicer):
|
class Cura(PrusaSlicer):
|
||||||
def check_identity(self, data: str) -> Optional[Dict[str, str]]:
|
def check_identity(self, data: str) -> Optional[Dict[str, str]]:
|
||||||
match = re.search(r"Cura_SteamEngine\s(.*)", data)
|
match = re.search(r"Cura_SteamEngine\s(.*)", data)
|
||||||
|
@ -637,8 +633,9 @@ class IceSL(BaseSlicer):
|
||||||
|
|
||||||
READ_SIZE = 512 * 1024
|
READ_SIZE = 512 * 1024
|
||||||
SUPPORTED_SLICERS: List[Type[BaseSlicer]] = [
|
SUPPORTED_SLICERS: List[Type[BaseSlicer]] = [
|
||||||
PrusaSlicer, Slic3rPE, Slic3r, SuperSlicer,
|
PrusaSlicer, Slic3rPE, Slic3r, Cura, Simplify3D,
|
||||||
Cura, Simplify3D, KISSlicer, IdeaMaker, IceSL]
|
KISSlicer, IdeaMaker, IceSL
|
||||||
|
]
|
||||||
SUPPORTED_DATA = [
|
SUPPORTED_DATA = [
|
||||||
'layer_height', 'first_layer_height', 'object_height',
|
'layer_height', 'first_layer_height', 'object_height',
|
||||||
'filament_total', 'filament_weight_total', 'estimated_time',
|
'filament_total', 'filament_weight_total', 'estimated_time',
|
||||||
|
|
Loading…
Reference in New Issue