Skip to content

Commit

Permalink
Outputting warning (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneGit authored Mar 31, 2024
1 parent 5e7b23a commit 669163c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,11 @@ def work():
return p.stderr
elif p.returncode == 1:
# fatal, the error is in the latest line
return p.stdout.splitlines()[-1]
error_message = p.stdout.splitlines()[-1]
if "path is not closed before triangulation" in error_message:
return locales.getLocale().WarningPathNotClosed
else:
return error_message

# no errors
return ""
Expand Down
2 changes: 2 additions & 0 deletions src/locales.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ class Locale:

UninterruptedPrint = "Uninterrupted print"
M10CutDistance = "Filament cut distance, mm:"
WarningPathNotClosed = "When cutting the model, not closed areas were found! Check that the shapes are positioned correctly"

def __init__(self, **entries):
self.__dict__.update(entries)
Expand Down Expand Up @@ -290,6 +291,7 @@ def __init__(self, **entries):
SelectingCalibrationData="Выбор калибровочных данных",
UninterruptedPrint="Печать непрерывным волокном",
M10CutDistance="Дистанция отреза филамента, мм:",
WarningPathNotClosed="При разрезании модели были обнаружены незамкнутые участки! Проверьте корректность расположения фигур",
),
}

Expand Down

0 comments on commit 669163c

Please sign in to comment.