[tuxdroid-svn] r867 - api/python/trunk
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2008-01-23 11:52:40
|
Author: Paul_R Date: 2008-01-23 12:52:32 +0100 (Wed, 23 Jan 2008) New Revision: 867 Modified: api/python/trunk/tuxapi_class.py Log: * Created aliases of the tux.cmd.move function : - All existing functions have been linked to the tux.cmd.move function - Replaced all the tux.cmd.wings* function by tux.cmd.flippers*. The 'wings' functions have been deprecated. - For each movement type, I've added an 'on_during' function * Added the documentation for all the movements functions and reorganized the class's documentation Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2008-01-22 08:30:36 UTC (rev 866) +++ api/python/trunk/tuxapi_class.py 2008-01-23 11:52:32 UTC (rev 867) @@ -1745,56 +1745,84 @@ "no_ack" as boolean : Allow to wait a ACK from tuxd Functions list for the users: - tux.cmd.audio_channel_general - tux.cmd.audio_channel_tts - tux.cmd.eyes_close - tux.cmd.eyes_off - tux.cmd.eyes_on - tux.cmd.eyes_on_free - tux.cmd.eyes_open - tux.cmd.ir_off - tux.cmd.ir_on - tux.cmd.ir_send - tux.cmd.ledl_during - tux.cmd.ledl_during_free - tux.cmd.ledl_off - tux.cmd.ledl_on - tux.cmd.ledr_during - tux.cmd.ledr_during_free - tux.cmd.ledr_off - tux.cmd.ledr_on - tux.cmd.leds_blink - tux.cmd.leds_during - tux.cmd.leds_during_free - tux.cmd.leds_off - tux.cmd.leds_on - tux.cmd.mouth_close - tux.cmd.mouth_off - tux.cmd.mouth_on - tux.cmd.mouth_on_free - tux.cmd.mouth_open - tux.cmd.move - tux.cmd.ping - tux.cmd.raw - tux.cmd.sleep_off - tux.cmd.sleep_on - tux.cmd.sound_play - tux.cmd.sound_confirm - tux.cmd.sound_storing - tux.cmd.sound_erase - tux.cmd.sound_test - tux.cmd.spinl_off - tux.cmd.spinl_on - tux.cmd.spinl_on_free - tux.cmd.spinr_off - tux.cmd.spinr_on - tux.cmd.spinr_on_free - tux.cmd.structured - tux.cmd.wings_off - tux.cmd.wings_on - tux.cmd.wings_on_free - tux.cmd.wings_up - tux.cmd.wings_down + + Movements commands : + tux.cmd.move : General command + + Eyes commands : + tux.cmd.eyes_close + tux.cmd.eyes_open + tux.cmd.eyes_off + tux.cmd.eyes_on + tux.cmd.eyes_on_free + tux.cmd.eyes_on_during + + Mouth commands : + tux.cmd.mouth_close + tux.cmd.mouth_open + tux.cmd.mouth_off + tux.cmd.mouth_on + tux.cmd.mouth_on_free + tux.cmd.mouth_on_during + + Flippers commands : + tux.cmd.flippers_up + tux.cmd.flippers_down + tux.cmd.flippers_off + tux.cmd.flippers_on + tux.cmd.flippers_on_free + tux.cmd.flippers_on_during + + Spinning commands : + tux.cmd.spin_speed + tux.cmd.spin_off + tux.cmd.spinl_on + tux.cmd.spinl_on_during + tux.cmd.spinl_on_free + tux.cmd.spinr_on + tux.cmd.spinr_on_during + tux.cmd.spinr_on_free + + LEDs commands : + tux.cmd.led_set : General command to set the LEDs + tux.cmd.led_pulse : General command to configure the + LEDs effects + + tux.cmd.ledl_during + tux.cmd.ledl_during_free + tux.cmd.ledl_off + tux.cmd.ledl_on + tux.cmd.ledr_during + tux.cmd.ledr_during_free + tux.cmd.ledr_off + tux.cmd.ledr_on + tux.cmd.leds_blink + tux.cmd.leds_during + tux.cmd.leds_during_free + tux.cmd.leds_off + tux.cmd.leds_on + + Audio commands : + TTS : + tux.cmd.audio_channel_general + tux.cmd.audio_channel_tts + + Sound flash : + tux.cmd.sound_play + tux.cmd.sound_confirm + tux.cmd.sound_storing + tux.cmd.sound_erase + tux.cmd.sound_test + + Misc : + tux.cmd.ir_off + tux.cmd.ir_on + tux.cmd.ir_send + tux.cmd.ping + tux.cmd.raw + tux.cmd.sleep_off + tux.cmd.sleep_on + tux.cmd.structured """ #-------------------------------------------------------------------------- @@ -2010,24 +2038,52 @@ #-------------------------------------------------------------------------- # Send a command to tux for moving the eyes #-------------------------------------------------------------------------- - def eyes_on(self,count=1): + def eyes_on(self,counter=1, final_state = 0): """ Send a command to tux for moving the eyes Parameters: "count" as integer : Number of movements (default = 1) - + + "final_state" as enum : 0 - UNDEFINED + 1 - OPEN + 2 - CLOSE + (default = 0) Example: >>> tux.cmd.eyes_on() >>> tux.cmd.eyes_on(2) + >>> tux.cmd.eyes_on(counter = 2, final_state = OPEN) """ - self.last_ack=self.structured(TUX_CMD_STRUCT_EYES, \ - TUX_CMD_STRUCT_SUB_ON,count,0,0) + self.move(movement = EYES, counter = counter, final_state = final_state) self.parent.event.wait_status(DATAS_STATUS_EYES_POSITION_COUNTER, \ - 0,(0.3*count)) + 0,(0.3*counter)) #-------------------------------------------------------------------------- + # Send a command to tux for moving the eyes during a defined time + #-------------------------------------------------------------------------- + def eyes_on_during(self, timeout = 0.5, final_state = 0): + ''' + Send a command to tux for moving the eyes during a defined time + + Parameters: + "timeout" as float : The movement duration + + "final_state" as enum : 0 - UNDEFINED + 1 - OPEN + 2 - CLOSE + (default = 0) + + The final state is ignored if timeout is + < 300ms (0.3) + + Examples : + >>> tux.cmd.eyes_on_during(0.5, 1) + or + >>> tux.cmd.eyes_on_during(timeout = 0.5, final_state = OPEN) + ''' + self.move(movement = EYES, timeout = timeout, final_state = final_state) + #-------------------------------------------------------------------------- # Send a command to tux for opening the eyes #-------------------------------------------------------------------------- def eyes_open(self): @@ -2037,9 +2093,7 @@ Example: >>> tux.cmd.eyes_open() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_EYES, \ - TUX_CMD_STRUCT_SUB_OPEN,0,0,0) - + self.move(movement = EYES, final_state = OPEN) #-------------------------------------------------------------------------- # Send a command to tux for closing the eyes #-------------------------------------------------------------------------- @@ -2050,13 +2104,11 @@ Example: >>> tux.cmd.eyes_close() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_EYES, \ - TUX_CMD_STRUCT_SUB_CLOSE,0,0,0) - + self.move(movement = EYES, final_state = CLOSE) #-------------------------------------------------------------------------- # Send a command to tux for moving the eyes in free mode #-------------------------------------------------------------------------- - def eyes_on_free(self,count=1): + def eyes_on_free(self,counter=1, final_state = 0): """ Send a command to tux for moving the eyes in free mode @@ -2064,11 +2116,17 @@ "count" as integer : number of movements (default = 1) + "final_state" as enum : 0 - UNDEFINED + 1 - OPEN + 2 - CLOSE + (default = 0) + Example: >>> tux.cmd.eyes_on_free() >>> tux.cmd.eyes_on_free(2) + >>> tux.cmd.eyes_on_free(counter = 2, final_state = OPEN) """ - t=threading.Thread(target=self.eyes_on,args=(count,)) + t=threading.Thread(target=self.eyes_on,args=(counter,final_state,)) t.setName('cmd.eyes_on') t.start() self.parent.daemon.free_thread_list.append(t) @@ -2079,17 +2137,16 @@ def eyes_off(self): """ Send a command to tux for stopping the eyes movement - + Example: >>> tux.cmd.eyes_off() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_EYES, \ - TUX_CMD_STRUCT_SUB_OFF,0,0,0) + self.move(movement = EYES, final_state = STOP) #-------------------------------------------------------------------------- # Send a command to tux for moving the mouth #-------------------------------------------------------------------------- - def mouth_on(self,count=1): + def mouth_on(self,counter=1, final_state = 0): """ Send a command to tux for moving the mouth @@ -2097,19 +2154,23 @@ "count" as integer : number of movements (default = 1) + "final_state" as enum : 0 - UNDEFINED + 1 - OPEN + 2 - CLOSE + (default = 0) Example: >>> tux.cmd.mouth_on() >>> tux.cmd.mouth_on(2) + >>> tux.cmd.mouth_on(counter = 2, final_state = CLOSE) """ - self.last_ack=self.structured(TUX_CMD_STRUCT_MOUTH, \ - TUX_CMD_STRUCT_SUB_ON,count,0,0) + self.move(movement = MOUTH, counter = counter, final_state = final_state) self.parent.event.wait_status(DATAS_STATUS_MOUTH_POSITION_COUNTER, \ - 0,(0.3*count)) + 0,(0.3*counter)) #-------------------------------------------------------------------------- # Send a command to tux for moving the mouth in free mode #-------------------------------------------------------------------------- - def mouth_on_free(self,count=1): + def mouth_on_free(self,counter=1, final_state = 0): """ Send a command to tux for moving the mouth in free mode @@ -2117,16 +2178,45 @@ "count" as integer : number of movements (default = 1) + "final_state" as enum : 0 - UNDEFINED + 1 - OPEN + 2 - CLOSE + (default = 0) Example: >>> tux.cmd.mouth_on_free() >>> tux.cmd.mouth_on_free(2) + >>> tux.cmd.mouth_on_free(counter = 2, final_state = CLOSE) """ - t=threading.Thread(target=self.mouth_on,args=(count,)) + t=threading.Thread(target=self.mouth_on,args=(counter,final_state,)) t.setName('cmd.mouth_on') t.start() self.parent.daemon.free_thread_list.append(t) #-------------------------------------------------------------------------- + # Send a command to tux for moving the mouth during a defined time + #-------------------------------------------------------------------------- + def mouth_on_during(self, timeout = 0.5, final_state = 0): + ''' + Send a command to tux for moving the mouth during a defined time + + Parameters: + "timeout" as float : The movement duration + "final_state" as enum : 0 - UNDEFINED + 1 - OPEN + 2 - CLOSE + (default = 0) + + The final state is ignored if timeout is + < 300ms (0.3) + + Examples : + >>> tux.cmd.mouth_on_during(0.5, 1) + or + >>> tux.cmd.mouth_on_during(timeout = 0.5, final_state = OPEN) + ''' + self.move(movement = MOUTH, timeout = timeout, final_state = final_state) + + #-------------------------------------------------------------------------- # Send a command to tux for opening the mouth #-------------------------------------------------------------------------- def mouth_open(self): @@ -2136,8 +2226,7 @@ Example: >>> tux.cmd.mouth_open() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_MOUTH, \ - TUX_CMD_STRUCT_SUB_OPEN,0,0,0) + self.move(movement = MOUTH, final_state = OPEN) #-------------------------------------------------------------------------- # Send a command to tux for closing the mouth #-------------------------------------------------------------------------- @@ -2148,8 +2237,7 @@ Example: >>> tux.cmd.mouth_close() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_MOUTH, \ - TUX_CMD_STRUCT_SUB_CLOSE,0,0,0) + self.move(movement = MOUTH, final_state = CLOSE) #-------------------------------------------------------------------------- # Send a command to tux for stopping the mouth movement #-------------------------------------------------------------------------- @@ -2160,15 +2248,13 @@ Example: >>> tux.cmd.mouth_off() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_MOUTH, \ - TUX_CMD_STRUCT_SUB_OFF,0,0,0) - + self.move(movement = MOUTH, final_state = STOP) #-------------------------------------------------------------------------- - # Send a command to tux for moving the wings + # Send a command to tux for moving the flippers #-------------------------------------------------------------------------- - def wings_on(self,count=1,speed=5): + def flippers_on(self,counter=1,speed=5, final_state = 0): """ - Send a command to tux for moving the wings + Send a command to tux for moving the flippers Parameters: "count" as integer : number of movements @@ -2176,82 +2262,179 @@ "speed" as integer : speed of the movement(1-5) (default = 5) + "final_state" as enum : 0 - UNDEFINED + 1 - UP + 2 - DOWN + (default = 0) Example: - >>> tux.cmd.wings_on() - >>> tux.cmd.wings_on(2) (2 movements) - >>> tux.cmd.wings_on(2,5) (2 movements and speed=5) + >>> tux.cmd.flippers_on() + >>> tux.cmd.flippers_on(2) (2 movements) + >>> tux.cmd.flippers_on(2,5) (2 movements and speed=5) + >>> tux.cmd.flippers_on(2,5,1) + >>> tux.cmd.flippers_on(counter = 2, speed = HIGH, final_state = UP) """ - self.last_ack=self.structured(TUX_CMD_STRUCT_WINGS, \ - TUX_CMD_STRUCT_SUB_ON,count,speed,0) + self.move(movement = FLIPPERS, counter = counter, speed = speed,\ + final_state = final_state) self.parent.event.wait_status(DATAS_STATUS_WINGS_POSITION_COUNTER, \ - 0,(0.6*count)) + 0,(0.6*counter)) #-------------------------------------------------------------------------- - # Send a command to tux for moving the wings in free mode + # Send a command to tux for moving the flippers in free mode #-------------------------------------------------------------------------- - def wings_on_free(self,count=1,speed=5): + def flippers_on_free(self,counter=1,speed=5, final_state = 0): """ - Send a command to tux for moving the wings in free mode + Send a command to tux for moving the flippers in free mode Parameters: "count" as integer : number of movements (default = 1) - "speed" as integer : speed of the movement(1..5) + "speed" as integer : speed of the movement(1-5) (default = 5) + "final_state" as enum : 0 - UNDEFINED + 1 - UP + 2 - DOWN + (default = 0) Example: - >>> tux.cmd.wings_on_free() - >>> tux.cmd.wings_on_free(2) (2 movements) - >>> tux.cmd.wings_on_free(2,5) (2 movements and speed=5) + >>> tux.cmd.flippers_on_free() + >>> tux.cmd.flippers_on_free(2) (2 movements) + >>> tux.cmd.flippers_on_free(2,5) (2 movements and speed=5) + >>> tux.cmd.flippers_on_free2,5,1) + >>> tux.cmd.flippers_on_free(counter = 2, speed = HIGH, final_state = UP) """ - t=threading.Thread(target=self.wings_on,args=(count,speed,)) - t.setName('cmd.wings_on') + t=threading.Thread(target=self.flippers_on,args=(counter,speed,final_state,)) + t.setName('cmd.flippers_on') t.start() self.parent.daemon.free_thread_list.append(t) #-------------------------------------------------------------------------- - # Send a command to tux for stopping the wings movement + # Send a command to tux for moving the flippers during a defined time #-------------------------------------------------------------------------- - def wings_off(self): + def flippers_on_during(self, timeout = 0.5, final_state = 0, speed = 5): + ''' + Send a command to tux for moving the flippers during a defined time + + Parameters: + "timeout" as float : The movement duration + "final_state" as enum : 0 - UNDEFINED + 1 - UP + 2 - DOWN + (default = 0) + + The final state is ignored if timeout is + < 300ms (0.3) + + "speed" as enum : speed of the movement + 1 - VERYLOW + 2 - LOW + 3 - MEDIUM + 4 - MIDHIGH + 5 - HIGH + (default = 5) + + Examples : + >>> tux.cmd.flippers_on_during(0.5, 1, 5) + or + >>> tux.cmd.flippers_on_during(timeout = 0.5, final_state = OPEN, speed = HIGH) + ''' + self.move(movement = FLIPPERS, timeout = timeout, \ + final_state = final_state, \ + speed = speed) + + #-------------------------------------------------------------------------- + # Send a command to tux to change the speed of the flippers + #-------------------------------------------------------------------------- + def flippers_speed(self, speed): + ''' + Send a command to tux to change the flippers speed + + Parameters: + "speed" as enum : speed of the movement + 1 - VERYLOW + 2 - LOW + 3 - MEDIUM + 4 - MIDHIGH + 5 - HIGH + + Examples : + >>> tux.cmd.flippers_speed(5) + or + >>> tux.cmd.flippers_speed(speed = HIGH) + ''' + self.move(movement = FLIPPERS, speed = speed, refresh = True) + #-------------------------------------------------------------------------- + # Send a command to tux for stopping the flippers movement + #-------------------------------------------------------------------------- + def flippers_off(self): """ - Send a command to tux for stopping the wings movement + Send a command to tux for stopping the flippers movement Example: - >>> tux.cmd.wings_off() + >>> tux.cmd.flippers_off() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_WINGS, \ - TUX_CMD_STRUCT_SUB_OFF,0,0,0) - + self.move(movement = FLIPPERS, final_state = STOP) #-------------------------------------------------------------------------- - # Send a command to tux for raise the wings + # Send a command to tux for raise the flippers #-------------------------------------------------------------------------- - def wings_up(self): + def flippers_up(self): """ - Send a command to tux for raise the wings + Send a command to tux for raise the flippers Example: - >>> tux.cmd.wings_up() + >>> tux.cmd.flippers_up() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_WINGS, \ - TUX_CMD_STRUCT_SUB_UP,0,0,0) + self.move(movement = FLIPPERS, final_state = UP) #-------------------------------------------------------------------------- - # Send a command to tux for raise the wings + # Send a command to tux for lower the flippers #-------------------------------------------------------------------------- - def wings_down(self): + def flippers_down(self): """ - Send a command to tux for lower the wings + Send a command to tux for lower the flippers Example: - >>> tux.cmd.wings_down() + >>> tux.cmd.flippers_down() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_WINGS, \ - TUX_CMD_STRUCT_SUB_DOWN,0,0,0) + self.move(movement = FLIPPERS, final_state = DOWN) #-------------------------------------------------------------------------- + # Send a command to tux to spin to the right during a defined time + #-------------------------------------------------------------------------- + def spin_speed(self, speed): + ''' + Send a command to tux to change the spinning speed + + Parameters: + "speed" as enum : speed of the movement + 1 - VERYLOW + 2 - LOW + 3 - MEDIUM + 4 - MIDHIGH + 5 - HIGH + + Examples : + >>> tux.cmd.spin_speed(5) + or + >>> tux.cmd.spin_speed(speed = HIGH) + ''' + self.move(movement = SPIN_R, speed = speed, refresh = True) + + + #-------------------------------------------------------------------------- + # Send a command to tux to stop the spinning + #-------------------------------------------------------------------------- + def spin_off(self): + ''' + Send a command to tux to stop the spinning + + Example : + >>> tux.cmd.spin_off() + ''' + self.move(movement = SPIN_R, final_state = STOP) + #-------------------------------------------------------------------------- # Send a command to tux to spin to the left #-------------------------------------------------------------------------- - def spinl_on(self,count=4,speed=5): + def spinl_on(self,counter=4,speed=5): """ Send a command to tux to spin to the left @@ -2266,15 +2449,14 @@ >>> tux.cmd.spinl_on(2) (count = 2) >>> tux.cmd.spinl_on(2,5) (count = 2 and speed = 5) """ - self.last_ack=self.structured(TUX_CMD_STRUCT_SPINL, \ - TUX_CMD_STRUCT_SUB_ON,count,speed,0) + self.move(movement = SPIN_L, counter = counter, speed = speed) self.parent.event.wait_status(DATAS_STATUS_SPIN_POSITION_COUNTER, \ - 0,(0.5*count)) + 0,(0.5*counter)) #-------------------------------------------------------------------------- # Send a command to tux to spin to the left in free mode #-------------------------------------------------------------------------- - def spinl_on_free(self,count=4,speed=5): + def spinl_on_free(self,counter=4,speed=5): """ Send a command to tux to spin to the left in free mode @@ -2289,28 +2471,41 @@ >>> tux.cmd.spinl_on_free(2) (count = 2) >>> tux.cmd.spinl_on_free(2,5) (count = 2 and speed = 5) """ - t=threading.Thread(target=self.spinl_on,args=(count,speed,)) + t=threading.Thread(target=self.spinl_on,args=(counter,speed,)) t.setName('cmd.spinl_on') t.start() self.parent.daemon.free_thread_list.append(t) #-------------------------------------------------------------------------- - # Send a command to tux for stopping the spinning movement + # Send a command to tux to spin to the left during a defined time #-------------------------------------------------------------------------- - def spinl_off(self): - """ - Send a command to tux for stopping the spinning movement + def spinl_on_during(self, timeout = 0.5, speed = 5): + ''' + Send a command to tux to spin left during a defined time - Example: - >>> tux.cmd.spinl_off() - """ - self.last_ack=self.structured(TUX_CMD_STRUCT_SPINL, \ - TUX_CMD_STRUCT_SUB_OFF,0,0,0) + Parameters: + "timeout" as float : The movement duration + + "speed" as enum : speed of the movement + 1 - VERYLOW + 2 - LOW + 3 - MEDIUM + 4 - MIDHIGH + 5 - HIGH + (default = 5) + Examples : + >>> tux.cmd.spinl_on_during(0.5, 5) + or + >>> tux.cmd.spinl_on_during(timeout = 0.5, speed = HIGH) + ''' + self.move(movement = SPIN_L, timeout = timeout, speed = speed) + + #-------------------------------------------------------------------------- # Send a command to tux to spin to the right #-------------------------------------------------------------------------- - def spinr_on(self,count=4,speed=5): + def spinr_on(self,counter=4,speed=5): """ Send a command to tux to spin to the right @@ -2325,15 +2520,14 @@ >>> tux.cmd.spinr_on(2) (count = 2) >>> tux.cmd.spinr_on(2,5) (count = 2 and speed = 5) """ - self.last_ack=self.structured(TUX_CMD_STRUCT_SPINR, \ - TUX_CMD_STRUCT_SUB_ON,count,speed,0) + self.move(movement = SPIN_R, counter = counter, speed = speed) self.parent.event.wait_status(DATAS_STATUS_SPIN_POSITION_COUNTER,0, \ - (0.5*count)) + (0.5*counter)) #-------------------------------------------------------------------------- # Send a command to tux to spin to the right in free mode #-------------------------------------------------------------------------- - def spinr_on_free(self,count=4,speed=5): + def spinr_on_free(self,counter=4,speed=5): """ Send a command to tux to spin to the right in free mode @@ -2348,24 +2542,37 @@ >>> tux.cmd.spinr_on_free(2) (count = 2) >>> tux.cmd.spinr_on_free(2,5) (count = 2 and speed = 5) """ - t=threading.Thread(target=self.spinr_on,args=(count,speed,)) + t=threading.Thread(target=self.spinr_on,args=(counter,speed,)) t.setName('cmd.spinr_on') t.start() self.parent.daemon.free_thread_list.append(t) #-------------------------------------------------------------------------- - # Send a command to tux for stopping the spinning movement + # Send a command to tux to spin to the right during a defined time #-------------------------------------------------------------------------- - def spinr_off(self): - """ - Send a command to tux for stopping the spinning movement + def spinr_on_during(self, timeout = 0.5, speed = 5): + ''' + Send a command to tux to spin right during a defined time - Example: - >>> tux.cmd.spinr_off() - """ - self.last_ack=self.structured(TUX_CMD_STRUCT_SPINR, \ - TUX_CMD_STRUCT_SUB_OFF,0,0,0) + Parameters: + "timeout" as float : The movement duration + + "speed" as enum : speed of the movement + 1 - VERYLOW + 2 - LOW + 3 - MEDIUM + 4 - MIDHIGH + 5 - HIGH + (dafault = 5) + Examples : + >>> tux.cmd.spinr_on_during(0.5, 5) + or + >>> tux.cmd.spinr_on_during(timeout = 0.5, speed = HIGH) + ''' + self.move(movement = SPIN_R, timeout = timeout, speed = speed) + + #-------------------------------------------------------------------------- # Send a command to tux for turning the IR on #-------------------------------------------------------------------------- @@ -2949,6 +3156,86 @@ TUX_CMD_STRUCT_SUB_CH_TTS,0,0,0) self.no_ack=False +#-------------------------------------------------------------------------- +# Deprecated functions +#-------------------------------------------------------------------------- + + #-------------------------------------------------------------------------- + # Send a command to tux for moving the wings + #-------------------------------------------------------------------------- + def wings_on(self,counter=1,speed=5): + """ + Deprecated : + see tux.cmd.flippers_on + """ + self.move(movement = FLIPPERS, counter = counter, speed = speed) + self.parent.event.wait_status(DATAS_STATUS_WINGS_POSITION_COUNTER, \ + 0,(0.6*counter)) + + #-------------------------------------------------------------------------- + # Send a command to tux for moving the wings in free mode + #-------------------------------------------------------------------------- + def wings_on_free(self,counter=1,speed=5): + """ + Deprecated : + see tux.cmd.flippers_on_free + """ + t=threading.Thread(target=self.wings_on,args=(counter,speed,)) + t.setName('cmd.wings_on') + t.start() + self.parent.daemon.free_thread_list.append(t) + + #-------------------------------------------------------------------------- + # Send a command to tux for stopping the wings movement + #-------------------------------------------------------------------------- + def wings_off(self): + """ + Deprecated : + see tux.cmd.flippers_off + """ + self.move(movement = FLIPPERS, final_state = STOP) + #-------------------------------------------------------------------------- + # Send a command to tux for raise the wings + #-------------------------------------------------------------------------- + def wings_up(self): + """ + Deprecated : + see tux.cmd.flippers_up + """ + self.move(movement = FLIPPERS, final_state = UP) + #self.last_ack=self.structured(TUX_CMD_STRUCT_WINGS, \ + # TUX_CMD_STRUCT_SUB_UP,0,0,0) + + #-------------------------------------------------------------------------- + # Send a command to tux for lower the wings + #-------------------------------------------------------------------------- + def wings_down(self): + """ + Deprecated : + see tux.cmd.flippers_down + """ + self.move(movement = FLIPPERS, final_state = DOWN) + + + #-------------------------------------------------------------------------- + # Send a command to tux for stopping the spinning movement + #-------------------------------------------------------------------------- + def spinl_off(self): + """ + Deprecated : + see tux.cmd.spin_off + """ + self.move(movement = SPIN_L, final_state = STOP) + + #-------------------------------------------------------------------------- + # Send a command to tux for stopping the spinning movement + #-------------------------------------------------------------------------- + def spinr_off(self): + """ + Deprecated : + see tux.cmd.spin_off + """ + self.move(movement = SPIN_R, final_state = STOP) #============================================================================== # TUXTCPCommunicator - status - class #============================================================================== |