mirror of
https://git.mirrors.martin98.com/https://github.com/petaflot/pygcode
synced 2025-06-04 11:25:20 +08:00
added null machine to standard lib
This commit is contained in:
parent
14b7541ec2
commit
1f3cc5a17d
@ -24,7 +24,10 @@ __copyright__ = "Copyright (c) 2017 {0}".format(__author__)
|
||||
# =========================== Imports ===========================
|
||||
__all__ = [
|
||||
# Machine
|
||||
'Machine', 'Position', 'CoordinateSystem', 'State', 'Mode',
|
||||
'Machine', 'State', 'Mode',
|
||||
'NullMachine', 'NullState', 'NullMode',
|
||||
'Position', 'CoordinateSystem',
|
||||
|
||||
# Line
|
||||
'Line',
|
||||
# Block
|
||||
@ -165,8 +168,8 @@ __all__ = [
|
||||
# Machine
|
||||
from .machine import (
|
||||
Position, CoordinateSystem,
|
||||
State, Mode,
|
||||
Machine,
|
||||
Machine, State, Mode,
|
||||
NullMachine, NullState, NullMode,
|
||||
)
|
||||
|
||||
# Line
|
||||
|
@ -503,3 +503,16 @@ class Machine(object):
|
||||
new_pos = self.pos
|
||||
new_pos.update(**coords) # only change given coordinates
|
||||
self.pos = new_pos
|
||||
|
||||
|
||||
# Null Machine
|
||||
# A machine that presumes nothing
|
||||
class NullMode(Mode):
|
||||
default_mode = ''
|
||||
|
||||
class NullState(State):
|
||||
pass # no change (yet)
|
||||
|
||||
class NullMachine(Machine):
|
||||
MODE_CLASS = NullMode
|
||||
STATE_CLASS = NullState
|
||||
|
Loading…
x
Reference in New Issue
Block a user