def do_abort(get_steps_taken): if (get_steps_taken): send_c4_command(command, False) motor_position_response = send_single_command( commands.REQUEST_MOTOR_POSITION + commands.CR) return motor_position_response else: return send_c4_command(commands.ABORT)
def get(self): product_info = send_c4_command(commands.FIRMWARE_INFO_PRODUCT) description = send_c4_command(commands.FIRMWARE_INFO_DESCRIPTION) version = send_c4_command(commands.FIRMWARE_INFO_VERSION) return { 'product_info': product_info, 'description': description, 'version': version }, 200
def do_multiaxis_movement(parameters, acknowledge): if (parameters): parameters += "n" if (acknowledge) else "" return send_c4_command(parameters) else: abort( 422, message="No movements information has been given, command ignored")
def do_return_home_list(motor_list): if (motor_list): motors = "" for motor in motor_list: motors += str(motor) return send_c4_command(commands.HOME + motors) else: abort( 422, message="No movements information has been given, command ignored")
def do_single_movement(motor_number, direction, steps, acknowledge): acknowledge_flag = "n" if (acknowledge) else "" pre_parameters = str(motor_number) + direction + str( steps) + acknowledge_flag return send_c4_command(commands.MOVE + pre_parameters)
def get(self): serial_return = send_c4_command(commands.FIRMWARE_INFO_VERSION) return {'response': serial_return}, 200
def get(self): serial_return = send_c4_command(commands.COPYRIGHT) return {'response': serial_return}, 200
def post(self, id): serial_return = send_c4_command(commands.HOME + str(id)) return {'response': serial_return}, 200