From 7ebc7505bc5b1b810d36dd59cbe1e90644a8951e Mon Sep 17 00:00:00 2001 From: Fabrice Salvaire Date: Tue, 25 Dec 2018 18:09:48 +0100 Subject: [PATCH] doc fixes --- PythonicGcodeMachine/Gcode/Rs274/Config.py | 9 +++++--- .../source/gcode-reference/rs-274/index.rst | 23 ++----------------- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/PythonicGcodeMachine/Gcode/Rs274/Config.py b/PythonicGcodeMachine/Gcode/Rs274/Config.py index 2663fc9..8bac554 100644 --- a/PythonicGcodeMachine/Gcode/Rs274/Config.py +++ b/PythonicGcodeMachine/Gcode/Rs274/Config.py @@ -54,6 +54,9 @@ def ensure_list(obj): obj = [obj] return obj +def format_gcode_list(gcodes): + return ' '.join([str(gcode) for gcode in gcodes]) + #################################################################################################### class YamlMixin: @@ -497,7 +500,7 @@ class ExecutionOrder(YamlMixin, RstMixin): path, headers=('Order', 'G-codes', 'Comment'), columns=('index', 'raw_gcodes', 'meaning'), - str_gcodes=lambda item: ' '.join(item), + str_raw_gcodes=lambda gcodes: format_gcode_list(gcodes), ) #################################################################################################### @@ -527,7 +530,7 @@ class ModalGroup(MeaningMixin): ############################################## def __repr__(self): - return '#{0._index}: ({1}) Meaning: {0._meaning}'.format(self, ' '.join([str(gcode) for gcode in self._gcodes])) + return '#{0._index}: ({1}) Meaning: {0._meaning}'.format(self, format_gcode_list(self._gcodes)) #################################################################################################### @@ -576,7 +579,7 @@ class ModalGroupSet(YamlMixin, RstMixin): path, headers=('Group', 'G-codes', 'Comment'), columns=('index', 'gcodes', 'meaning'), - str_gcodes=lambda gcodes: ' '.join([str(gcode) for gcode in gcodes]), + str_gcodes=lambda gcodes: format_gcode_list(gcodes), ) #################################################################################################### diff --git a/doc/sphinx/source/gcode-reference/rs-274/index.rst b/doc/sphinx/source/gcode-reference/rs-274/index.rst index a8e8b8a..8cbf7e4 100644 --- a/doc/sphinx/source/gcode-reference/rs-274/index.rst +++ b/doc/sphinx/source/gcode-reference/rs-274/index.rst @@ -321,28 +321,9 @@ from group 0 are :code:`G10`, :code:`G28`, :code:`G30`, and :code:`G92`. G and Input Codes ----------------- -.. include:: gcodes.rst +For a documentation on G-codes, see :mod:`PythonicGcodeMachine.Gcode.Rs274.GcodeDoc`. -.. - G codes of the RS274/NGC language are shown in Table 5 and described following that. - - In the command prototypes, three dots (...) stand for a real value. As described earlier, a real - value may be (1) an explicit number, 4, for example, (2) an expression, :code:`[2+2]`, for example, - (3) a parameter value, #88, for example, or (4) a unary function value, :code:`acos[0]`, for - example. In most cases, if axis words (any or all of X..., Y..., Z..., A..., B..., C...) are given, - they specify a destination point. Axis numbers are in the currently active coordinate system, unless - explicitly described as being in the absolute coordinate system. Where axis words are optional, any - omitted axes will have their current value. Any items in the command prototypes not explicitly - described as optional are required. It is an error if a required item is omitted. - - In the prototypes, the values following letters are often given as explicit numbers. Unless stated - otherwise, the explicit numbers can be real values. For example, :code:`G10 L2` could equally well - be written :code:`G[2*5] L[1+1]`. If the value of parameter 100 were 2, :code:`G10 L#100` would also - mean the same. Using real values which are not explicit numbers as just shown in the examples is - rarely useful. - - If L... is written in a prototype the “...” will often be referred to as the “L number”. Similarly the - “...” in H... may be called the “H number”, and so on for any other letter. +.. include:: gcodes.rst Order of Execution ------------------ -- GitLab