robotpy / robotpy-crio

Obsolete. Python 3 port for cRIO for use in the FIRST Robotics Competition (FRC)
http://robotpy.github.io
43 stars 16 forks source link

PWM.sip should be inheriting LiveWindowSendable, ITableListener #7

Closed mattyork closed 9 years ago

mattyork commented 10 years ago

I can fix this and send a pull request after this weekends comp.

PWM.sip:

class PWM : SensorBase

PWM.h:

class PWM : public SensorBase, public ITableListener, public LiveWindowSendable

This might be a problem for other ITableListener and LiveWindowSendable children. Should check all those guys, too.

We found this because this Python in our code:

LiveWindow.GetInstance().AddActuator('subsystem', 'name', Talon(1))

Failed with this error:

File "/c/py/robot.py", line 19, in init 
  self.lw.AddActuator('subsystem', 'name', self.motor) TypeError: LiveWindow.AddActuator(): 
arguments did not match any overloaded call: 
   overload 1: argument 3 has unexpected type 'Talon' 
   overload 2: argument 2 has unexpected type 'str'

overload 1 is the correct overloaded AddActuator method, but RobotPy doesn't know that Talon is a LiveWindowSendable.

virtuald commented 9 years ago

Closed due to age.