summaryrefslogtreecommitdiff
path: root/gerber/render/render.py
diff options
context:
space:
mode:
authorHamilton Kibbe <hamilton.kibbe@gmail.com>2014-10-09 09:51:29 -0400
committerHamilton Kibbe <hamilton.kibbe@gmail.com>2014-10-09 09:51:29 -0400
commit84bfd34e918251ff82f4b3818bc6268feab72efe (patch)
tree4362bed2208efa281817635bf2a5d8ba1c5d9aac /gerber/render/render.py
parentbcb6cbc50dea975954b8a3864690f68ab5e984b7 (diff)
downloadgerbonara-84bfd34e918251ff82f4b3818bc6268feab72efe.tar.gz
gerbonara-84bfd34e918251ff82f4b3818bc6268feab72efe.tar.bz2
gerbonara-84bfd34e918251ff82f4b3818bc6268feab72efe.zip
Add mode statement parsing
Diffstat (limited to 'gerber/render/render.py')
-rw-r--r--gerber/render/render.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/gerber/render/render.py b/gerber/render/render.py
index e7ec6ee..e91c71e 100644
--- a/gerber/render/render.py
+++ b/gerber/render/render.py
@@ -16,8 +16,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from ..gerber_statements import (
- CommentStmt, UnknownStmt, EofStmt, ParamStmt, CoordStmt, ApertureStmt
+from ..gerber_statements import (CommentStmt, UnknownStmt, EofStmt, ParamStmt,
+ CoordStmt, ApertureStmt, RegionModeStmt,
+ QuadrantModeStmt,
)
@@ -111,9 +112,18 @@ class GerberContext(object):
elif isinstance(stmt, ApertureStmt):
self._evaluate_aperture(stmt)
+ elif isinstance(stmt, (RegionModeStmt, QuadrantModeStmt)):
+ self._evaluate_mode(stmt)
+
else:
raise Exception("Invalid statement to evaluate")
+ def _evaluate_mode(self, stmt):
+ if stmt.type == 'RegionMode':
+ self.region_mode = stmt.mode
+ elif stmt.type == 'QuadrantMode':
+ self.quadrant_mode = stmt.mode
+
def _evaluate_param(self, stmt):
if stmt.param == "FS":
self.set_coord_format(stmt.zero_suppression, stmt.format,