[tuxdroid-svn] r709 - api/python/trunk
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2007-11-16 14:34:26
|
Author: Paul_R Date: 2007-11-16 15:34:24 +0100 (Fri, 16 Nov 2007) New Revision: 709 Modified: api/python/trunk/tuxapi_class.py api/python/trunk/tuxapi_const.py Log: * Added two new command (tux.cmd.wings_down & tux.cmd.wings_up) * Changed the params sent to the daemon for the mouth_open/close and eyes_open/close commands. Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2007-11-16 14:31:29 UTC (rev 708) +++ api/python/trunk/tuxapi_class.py 2007-11-16 14:34:24 UTC (rev 709) @@ -1772,6 +1772,8 @@ tux.cmd.wings_off tux.cmd.wings_on tux.cmd.wings_on_free + tux.cmd.wings_up + tux.cmd.wings_down """ #-------------------------------------------------------------------------- @@ -1903,8 +1905,8 @@ Example: >>> tux.cmd.eyes_open() """ - if self.parent.status.get_eyes_closed_position_switch()==0: - self.eyes_on() + self.last_ack=self.structured(TUX_CMD_STRUCT_EYES, \ + TUX_CMD_STRUCT_SUB_OPEN,0,0,0) #-------------------------------------------------------------------------- # Send a command to tux for closing the eyes @@ -1916,8 +1918,8 @@ Example: >>> tux.cmd.eyes_close() """ - if self.parent.status.get_eyes_closed_position_switch()==1: - self.eyes_on() + self.last_ack=self.structured(TUX_CMD_STRUCT_EYES, \ + TUX_CMD_STRUCT_SUB_CLOSE,0,0,0) #-------------------------------------------------------------------------- # Send a command to tux for moving the eyes in free mode @@ -2002,9 +2004,8 @@ Example: >>> tux.cmd.mouth_open() """ - if self.parent.status.get_mouth_open_position()==1: - self.mouth_on() - + self.last_ack=self.structured(TUX_CMD_STRUCT_MOUTH, \ + TUX_CMD_STRUCT_SUB_OPEN,0,0,0) #-------------------------------------------------------------------------- # Send a command to tux for closing the mouth #-------------------------------------------------------------------------- @@ -2015,9 +2016,8 @@ Example: >>> tux.cmd.mouth_close() """ - if self.parent.status.get_mouth_open_position()==0: - self.mouth_on() - + self.last_ack=self.structured(TUX_CMD_STRUCT_MOUTH, \ + TUX_CMD_STRUCT_SUB_CLOSE,0,0,0) #-------------------------------------------------------------------------- # Send a command to tux for stopping the mouth movement #-------------------------------------------------------------------------- @@ -2091,6 +2091,32 @@ TUX_CMD_STRUCT_SUB_OFF,0,0,0) #-------------------------------------------------------------------------- + # Send a command to tux for raise the wings + #-------------------------------------------------------------------------- + def wings_up(self): + """ + Send a command to tux for raise the wings + + Example: + >>> tux.cmd.wings_up() + """ + self.last_ack=self.structured(TUX_CMD_STRUCT_WINGS, \ + TUX_CMD_STRUCT_SUB_UP,0,0,0) + + #-------------------------------------------------------------------------- + # Send a command to tux for raise the wings + #-------------------------------------------------------------------------- + def wings_down(self): + """ + Send a command to tux for lower the wings + + Example: + >>> tux.cmd.wings_down() + """ + self.last_ack=self.structured(TUX_CMD_STRUCT_WINGS, \ + TUX_CMD_STRUCT_SUB_DOWN,0,0,0) + + #-------------------------------------------------------------------------- # Send a command to tux to spin to the left #-------------------------------------------------------------------------- def spinl_on(self,count=4,speed=5): Modified: api/python/trunk/tuxapi_const.py =================================================================== --- api/python/trunk/tuxapi_const.py 2007-11-16 14:31:29 UTC (rev 708) +++ api/python/trunk/tuxapi_const.py 2007-11-16 14:34:24 UTC (rev 709) @@ -306,6 +306,10 @@ TUX_CMD_STRUCT_SUB_BLINK = 0x09 TUX_CMD_STRUCT_SUB_CH_GENERAL = 0x0A TUX_CMD_STRUCT_SUB_CH_TTS = 0x0B +TUX_CMD_STRUCT_SUB_OPEN = 0x0C +TUX_CMD_STRUCT_SUB_UP = 0x0C +TUX_CMD_STRUCT_SUB_CLOSE = 0x0D +TUX_CMD_STRUCT_SUB_DOWN = 0x0D # Tux request information TUX_REQ_INFO_VERSION = 0x01 |