# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _pyupm_smartdrive
else:
    import _pyupm_smartdrive

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)



def getVersion():
    return _pyupm_smartdrive.getVersion()
SmartDrive_Motor_ID_1 = _pyupm_smartdrive.SmartDrive_Motor_ID_1
SmartDrive_Motor_ID_2 = _pyupm_smartdrive.SmartDrive_Motor_ID_2
SmartDrive_Motor_ID_BOTH = _pyupm_smartdrive.SmartDrive_Motor_ID_BOTH
SmartDrive_Dir_Reverse = _pyupm_smartdrive.SmartDrive_Dir_Reverse
SmartDrive_Dir_Forward = _pyupm_smartdrive.SmartDrive_Dir_Forward
SmartDrive_Action_Float = _pyupm_smartdrive.SmartDrive_Action_Float
SmartDrive_Action_Brake = _pyupm_smartdrive.SmartDrive_Action_Brake
SmartDrive_Action_BrakeHold = _pyupm_smartdrive.SmartDrive_Action_BrakeHold
SmartDrive_Completion_Wait_For = _pyupm_smartdrive.SmartDrive_Completion_Wait_For
SmartDrive_Completion_Dont_Wait = _pyupm_smartdrive.SmartDrive_Completion_Dont_Wait
SmartDrive_DefaultAddress = _pyupm_smartdrive.SmartDrive_DefaultAddress
SmartDrive_VOLTAGE_MULTIPLIER = _pyupm_smartdrive.SmartDrive_VOLTAGE_MULTIPLIER
SmartDrive_Speed_Full = _pyupm_smartdrive.SmartDrive_Speed_Full
SmartDrive_Speed_Medium = _pyupm_smartdrive.SmartDrive_Speed_Medium
SmartDrive_Speed_Slow = _pyupm_smartdrive.SmartDrive_Speed_Slow
SmartDrive_CONTROL_SPEED = _pyupm_smartdrive.SmartDrive_CONTROL_SPEED
SmartDrive_CONTROL_RAMP = _pyupm_smartdrive.SmartDrive_CONTROL_RAMP
SmartDrive_CONTROL_RELATIVE = _pyupm_smartdrive.SmartDrive_CONTROL_RELATIVE
SmartDrive_CONTROL_TACHO = _pyupm_smartdrive.SmartDrive_CONTROL_TACHO
SmartDrive_CONTROL_BRK = _pyupm_smartdrive.SmartDrive_CONTROL_BRK
SmartDrive_CONTROL_ON = _pyupm_smartdrive.SmartDrive_CONTROL_ON
SmartDrive_CONTROL_TIME = _pyupm_smartdrive.SmartDrive_CONTROL_TIME
SmartDrive_CONTROL_GO = _pyupm_smartdrive.SmartDrive_CONTROL_GO
SmartDrive_COMMAND = _pyupm_smartdrive.SmartDrive_COMMAND
SmartDrive_SETPT_M1 = _pyupm_smartdrive.SmartDrive_SETPT_M1
SmartDrive_SPEED_M1 = _pyupm_smartdrive.SmartDrive_SPEED_M1
SmartDrive_TIME_M1 = _pyupm_smartdrive.SmartDrive_TIME_M1
SmartDrive_CMD_B_M1 = _pyupm_smartdrive.SmartDrive_CMD_B_M1
SmartDrive_CMD_A_M1 = _pyupm_smartdrive.SmartDrive_CMD_A_M1
SmartDrive_SETPT_M2 = _pyupm_smartdrive.SmartDrive_SETPT_M2
SmartDrive_SPEED_M2 = _pyupm_smartdrive.SmartDrive_SPEED_M2
SmartDrive_TIME_M2 = _pyupm_smartdrive.SmartDrive_TIME_M2
SmartDrive_CMD_B_M2 = _pyupm_smartdrive.SmartDrive_CMD_B_M2
SmartDrive_CMD_A_M2 = _pyupm_smartdrive.SmartDrive_CMD_A_M2
SmartDrive_POSITION_M1 = _pyupm_smartdrive.SmartDrive_POSITION_M1
SmartDrive_POSITION_M2 = _pyupm_smartdrive.SmartDrive_POSITION_M2
SmartDrive_STATUS_M1 = _pyupm_smartdrive.SmartDrive_STATUS_M1
SmartDrive_STATUS_M2 = _pyupm_smartdrive.SmartDrive_STATUS_M2
SmartDrive_TASKS_M1 = _pyupm_smartdrive.SmartDrive_TASKS_M1
SmartDrive_TASKS_M2 = _pyupm_smartdrive.SmartDrive_TASKS_M2
SmartDrive_P_Kp = _pyupm_smartdrive.SmartDrive_P_Kp
SmartDrive_P_Ki = _pyupm_smartdrive.SmartDrive_P_Ki
SmartDrive_P_Kd = _pyupm_smartdrive.SmartDrive_P_Kd
SmartDrive_S_Kp = _pyupm_smartdrive.SmartDrive_S_Kp
SmartDrive_S_Ki = _pyupm_smartdrive.SmartDrive_S_Ki
SmartDrive_S_Kd = _pyupm_smartdrive.SmartDrive_S_Kd
SmartDrive_PASSCOUNT = _pyupm_smartdrive.SmartDrive_PASSCOUNT
SmartDrive_PASSTOLERANCE = _pyupm_smartdrive.SmartDrive_PASSTOLERANCE
SmartDrive_CHKSUM = _pyupm_smartdrive.SmartDrive_CHKSUM
SmartDrive_BATT_VOLTAGE = _pyupm_smartdrive.SmartDrive_BATT_VOLTAGE
SmartDrive_RESETSTATUS = _pyupm_smartdrive.SmartDrive_RESETSTATUS
SmartDrive_CURRENT_M1 = _pyupm_smartdrive.SmartDrive_CURRENT_M1
SmartDrive_CURRENT_M2 = _pyupm_smartdrive.SmartDrive_CURRENT_M2
CMD_R = _pyupm_smartdrive.CMD_R
CMD_S = _pyupm_smartdrive.CMD_S
CMD_a = _pyupm_smartdrive.CMD_a
CMD_b = _pyupm_smartdrive.CMD_b
CMD_c = _pyupm_smartdrive.CMD_c
CMD_A = _pyupm_smartdrive.CMD_A
CMD_B = _pyupm_smartdrive.CMD_B
CMD_C = _pyupm_smartdrive.CMD_C
SmartDrive_MOTOR_CONTROL_ON = _pyupm_smartdrive.SmartDrive_MOTOR_CONTROL_ON
SmartDrive_MOTOR_IS_RAMPING = _pyupm_smartdrive.SmartDrive_MOTOR_IS_RAMPING
SmartDrive_MOTOR_IS_POWERED = _pyupm_smartdrive.SmartDrive_MOTOR_IS_POWERED
SmartDrive_MOTOR_POS_CTRL_ON = _pyupm_smartdrive.SmartDrive_MOTOR_POS_CTRL_ON
SmartDrive_MOTOR_IN_BRAKE_MODE = _pyupm_smartdrive.SmartDrive_MOTOR_IN_BRAKE_MODE
SmartDrive_MOTOR_OVERLOADED = _pyupm_smartdrive.SmartDrive_MOTOR_OVERLOADED
SmartDrive_MOTOR_IN_TIME_MODE = _pyupm_smartdrive.SmartDrive_MOTOR_IN_TIME_MODE
SmartDrive_MOTOR_IS_STALLED = _pyupm_smartdrive.SmartDrive_MOTOR_IS_STALLED
class SmartDrive(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, i2c_bus, address=0x1b):
        _pyupm_smartdrive.SmartDrive_swiginit(self, _pyupm_smartdrive.new_SmartDrive(i2c_bus, address))

    def command(self, cmd):
        return _pyupm_smartdrive.SmartDrive_command(self, cmd)

    def GetBattVoltage(self):
        return _pyupm_smartdrive.SmartDrive_GetBattVoltage(self)

    def ReadTachometerPosition(self, motor_id):
        return _pyupm_smartdrive.SmartDrive_ReadTachometerPosition(self, motor_id)

    def Run_Unlimited(self, motor_id, direction, speed):
        return _pyupm_smartdrive.SmartDrive_Run_Unlimited(self, motor_id, direction, speed)

    def StopMotor(self, motor_id, next_action):
        return _pyupm_smartdrive.SmartDrive_StopMotor(self, motor_id, next_action)

    def Run_Seconds(self, motor_id, direction, speed, duration, wait_for_completion, next_action):
        return _pyupm_smartdrive.SmartDrive_Run_Seconds(self, motor_id, direction, speed, duration, wait_for_completion, next_action)

    def WaitUntilTimeDone(self, motor_id):
        return _pyupm_smartdrive.SmartDrive_WaitUntilTimeDone(self, motor_id)

    def IsTimeDone(self, motor_id):
        return _pyupm_smartdrive.SmartDrive_IsTimeDone(self, motor_id)

    def Run_Degrees(self, motor_id, direction, speed, degrees, wait_for_completion, next_action):
        return _pyupm_smartdrive.SmartDrive_Run_Degrees(self, motor_id, direction, speed, degrees, wait_for_completion, next_action)

    def Run_Rotations(self, motor_id, direction, speed, rotations, wait_for_completion, next_action):
        return _pyupm_smartdrive.SmartDrive_Run_Rotations(self, motor_id, direction, speed, rotations, wait_for_completion, next_action)

    def Run_Tacho(self, motor_id, speed, tacho_count, wait_for_completion, next_action):
        return _pyupm_smartdrive.SmartDrive_Run_Tacho(self, motor_id, speed, tacho_count, wait_for_completion, next_action)

    def WaitUntilTachoDone(self, motor_id):
        return _pyupm_smartdrive.SmartDrive_WaitUntilTachoDone(self, motor_id)

    def IsTachoDone(self, motor_id):
        return _pyupm_smartdrive.SmartDrive_IsTachoDone(self, motor_id)

    def SetPerformanceParameters(self, Kp_tacho, Ki_tacho, Kd_tacho, Kp_speed, Ki_speed, Kd_speed, passcount, tolerance):
        return _pyupm_smartdrive.SmartDrive_SetPerformanceParameters(self, Kp_tacho, Ki_tacho, Kd_tacho, Kp_speed, Ki_speed, Kd_speed, passcount, tolerance)

    def ReadPerformanceParameters(self):
        return _pyupm_smartdrive.SmartDrive_ReadPerformanceParameters(self)

    def GetMotorStatus(self, motor_id):
        return _pyupm_smartdrive.SmartDrive_GetMotorStatus(self, motor_id)

    def PrintMotorStatus(self, motor_id):
        return _pyupm_smartdrive.SmartDrive_PrintMotorStatus(self, motor_id)
    __swig_destroy__ = _pyupm_smartdrive.delete_SmartDrive

# Register SmartDrive in _pyupm_smartdrive:
_pyupm_smartdrive.SmartDrive_swigregister(SmartDrive)



