Skip to content

Commit

Permalink
sl1: add code 10715 FILL_THE_RESIN
Browse files Browse the repository at this point in the history
Warning used in Prusa Connect to pour in resin before print
and refill dutring the print.

Part of: SL1SW-2097
  • Loading branch information
filipkotoucek committed Apr 30, 2024
1 parent f47edf2 commit 16d5132
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
7 changes: 7 additions & 0 deletions 10_SL1/errors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -823,3 +823,10 @@ Errors:
text: "Incorrect RPM reading of the %(failed_fans_text)s fan. The print may continue, however, there's a risk of overheating."
id: "EXPECT_OVERHEATING"
approved: true

- code: "10715"
title: "FILL THE RESIN"
text: "Pour enough resin for the selected file into the tank and close the lid. The minimal amount of the resin is displayed on the touchscreen."
id: "FILL_THE_RESIN"
action: ['Resin filled']
approved: false
15 changes: 13 additions & 2 deletions prusaerrors/shared/codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import re
from enum import unique, IntEnum
from pathlib import Path
from typing import TextIO, Dict
from typing import List, TextIO, Dict
import yaml


Expand Down Expand Up @@ -68,6 +68,7 @@ def __init__(
title: str,
message: str,
approved: bool,
action: List[str] = None
):
if printer.value < 0 or printer.value > 99:
raise ValueError(f"Printer class {printer} out of range")
Expand All @@ -83,6 +84,7 @@ def __init__(
self._title = title
self._message = message
self._approved = approved
self._action = action

@property
def code(self) -> str:
Expand Down Expand Up @@ -166,6 +168,13 @@ def approved(self):
"""
return self._approved

@property
def action(self) -> List[str]:
"""
List of strings with actions to be taken when the error occurs.
"""
return self._action

def __lt__(self, other):
if not isinstance(other, Code):
return NotImplementedError()
Expand Down Expand Up @@ -386,7 +395,9 @@ def decor(cls):
printer = Printer(int(code_parts["printer"]))
category = Category(int(code_parts["category"]))
error = int(code_parts["error"])
setattr(cls, entry["id"], Code(printer, category, error, entry["title"], entry["text"], entry["approved"]))
action = entry.get("action", [])
setattr(cls, entry["id"], Code(printer, category, error, entry["title"], entry["text"],
entry["approved"], action))
return cls

return decor

0 comments on commit 16d5132

Please sign in to comment.