MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / encode_axis

Function encode_axis

src/ext/makerbot_driver/Encoder/Coding.py:83–97  ·  view source on GitHub ↗

Encode an array of axes names into an axis bitfield @param axes Array of axis names ['x', 'y', ...] @return bitfield containing a representation of the axes map

(axis)

Source from the content-addressed store, hash-verified

81
82
83def encode_axis(axis):
84 """
85 Encode an array of axes names into an axis bitfield
86 @param axes Array of axis names ['x', 'y', ...]
87 @return bitfield containing a representation of the axes map
88 """
89 axes_map = {
90 'x': 0x01,
91 'y': 0x02,
92 'z': 0x03,
93 'a': 0x04,
94 'b': 0x05,
95 }
96
97 return axes_map[axis.lower()]
98
99
100def encode_axes(axes):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected