From 122cc945d7d8b1501efbe14d01b7ea7378301572 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Mon, 22 Jan 2024 11:14:06 -0300 Subject: [PATCH] [Rotation Filter][Added] More debug for level 2+ The list of offsets and rotations after processing all --- kibot/fil_rot_footprint.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kibot/fil_rot_footprint.py b/kibot/fil_rot_footprint.py index 71927d1c..31c98edb 100644 --- a/kibot/fil_rot_footprint.py +++ b/kibot/fil_rot_footprint.py @@ -65,6 +65,14 @@ class Regex(Optionable): if offset_y is not None: self.offset_y = offset_y + def __str__(self): + res = f'{self.field} matches {self.regex} =>' + if self.apply_angle: + res += f' rotate {self.angle}' + if self.apply_offset: + res += f' move {self.offset_x},{self.offset_y}' + return res + def config(self, parent): super().config(parent) if not self.field: @@ -177,6 +185,13 @@ class Rot_Footprint(BaseFilter): # noqa: F821 self._offset.append(Regex(regex=compile(regex_str), offset_x=offset[0], offset_y=offset[1])) if not self._rot and not self._offset: raise KiPlotConfigurationError("No rotations and/or offsets provided") + if GS.debug_level > 2: + logger.debug('Final rotations list:') + for r in self._rot: + logger.debug(r) + logger.debug('Final offsets list:') + for r in self._offset: + logger.debug(r) self.rot_fields = self.force_list(self.rot_fields, default=DEFAULT_ROT_FIELDS) self.offset_fields = self.force_list(self.offset_fields, default=DEFAULT_OFFSET_FIELDS)