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
(axes)
| 98 | |
| 99 | |
| 100 | def encode_axes(axes): |
| 101 | """ |
| 102 | Encode an array of axes names into an axis bitfield |
| 103 | @param axes Array of axis names ['x', 'y', ...] |
| 104 | @return bitfield containing a representation of the axes map |
| 105 | """ |
| 106 | axes_map = { |
| 107 | 'x': 0x01, |
| 108 | 'y': 0x02, |
| 109 | 'z': 0x04, |
| 110 | 'a': 0x08, |
| 111 | 'b': 0x10, |
| 112 | } |
| 113 | |
| 114 | bitfield = 0 |
| 115 | |
| 116 | for axis in axes: |
| 117 | bitfield |= axes_map[axis.lower()] |
| 118 | |
| 119 | return bitfield |
| 120 | |
| 121 | |
| 122 | def unpack_response(format, data): |
nothing calls this directly
no outgoing calls
no test coverage detected