From 363e05209780149f53fba1f749240f706cc01cec Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sat, 3 Aug 2019 23:14:36 -0400 Subject: input: read STOP commands too --- lib/stitch_plan/stitch_plan.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/stitch_plan/stitch_plan.py') diff --git a/lib/stitch_plan/stitch_plan.py b/lib/stitch_plan/stitch_plan.py index b621ef07..c62ebe98 100644 --- a/lib/stitch_plan/stitch_plan.py +++ b/lib/stitch_plan/stitch_plan.py @@ -210,6 +210,20 @@ class ColorBlock(object): else: return False + @property + def trim_after(self): + # If there's a STOP, it will be at the end. We still want to return + # True. + for stitch in reversed(self.stitches): + if stitch.stop or stitch.jump: + continue + elif stitch.trim: + return True + else: + break + + return False + def filter_duplicate_stitches(self): if not self.stitches: return -- cgit v1.2.3