Newer
Older
####################################################################################################
#
# Copyright (C) 2018 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
####################################################################################################
"""
####################################################################################################
__all__ = [
]
####################################################################################################
from pathlib import Path as Path
from .Config import Config
from .Parser import GcodeParser, GcodeParserError
####################################################################################################
class GcodeMachine:
PARSER_CLS = GcodeParser
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
def __init__(self):
self._config = None
self.load_config()
self._parser = None
self.setup_parser()
##############################################
def load_config(self):
data_path = Path(__file__).parent.joinpath('data')
self._config = Config(
execution_order=data_path.joinpath('rs274-execution-order.yaml'),
gcodes=data_path.joinpath('rs274-gcodes.yaml'),
letters=data_path.joinpath('rs274-word-starting-letter.yaml'),
modal_groups=data_path.joinpath('rs274-modal-groups.yaml'),
parameters=data_path.joinpath('rs274-default-parameter-file.yaml'),
)
##############################################
def setup_parser(self):
self._parser = self.PARSER_CLS(machine=self)
##############################################
@property
def config(self):
return self._config
@property
def parser(self):
return self._parser
##############################################
def reset():
pass
##############################################