# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# 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):
    def swig_import_helper():
        import importlib
        pkg = __name__.rpartition('.')[0]
        mname = '.'.join((pkg, '_pyupm_smartdrive')).lstrip('.')
        try:
            return importlib.import_module(mname)
        except ImportError:
            return importlib.import_module('_pyupm_smartdrive')
    _pyupm_smartdrive = swig_import_helper()
    del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_pyupm_smartdrive', [dirname(__file__)])
        except ImportError:
            import _pyupm_smartdrive
            return _pyupm_smartdrive
        try:
            _mod = imp.load_module('_pyupm_smartdrive', fp, pathname, description)
        finally:
            if fp is not None:
                fp.close()
        return _mod
    _pyupm_smartdrive = swig_import_helper()
    del swig_import_helper
else:
    import _pyupm_smartdrive
del _swig_python_version_info

try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        if _newclass:
            object.__setattr__(self, name, value)
        else:
            self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr(self, class_type, name):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))


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,)

try:
    _object = object
    _newclass = 1
except __builtin__.Exception:
    class _object:
        pass
    _newclass = 0


def getVersion():
    return _pyupm_smartdrive.getVersion()
getVersion = _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):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, SmartDrive, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, SmartDrive, name)
    __repr__ = _swig_repr

    def __init__(self, i2c_bus, address=0x1b):
        this = _pyupm_smartdrive.new_SmartDrive(i2c_bus, address)
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this

    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
    __del__ = lambda self: None
SmartDrive_swigregister = _pyupm_smartdrive.SmartDrive_swigregister
SmartDrive_swigregister(SmartDrive)

# This file is compatible with both classic and new-style classes.


