Changeset 5
- Timestamp:
- 01/28/10 15:18:54 (12 years ago)
- Location:
- rc
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
rc/puzzlebox_brainstorms_rc.py
r3 r5 2 2 # -*- coding: utf-8 -*- 3 3 # 4 # Puzzlebox - Brainstorms - R C5 # 6 # Copyright Steven M. Castellotti(2010)4 # Puzzlebox - Brainstorms - Remote Control 5 # 6 # Copyright Puzzlebox Productions, LLC (2010) 7 7 # 8 8 # Portions of this code have been previously … … 11 11 # For more information please refer to http://www.gnu.org/copyleft/gpl.html 12 12 # 13 # Last Update: 2010.01.2 713 # Last Update: 2010.01.28 14 14 # 15 15 ##################################################################### … … 19 19 import jaraco.nxt 20 20 import jaraco.nxt.messages 21 import puzzlebox_brainstorms_configuration as configuration 21 22 22 23 ##################################################################### … … 26 27 DEBUG = 2 27 28 28 BLUETOOTH_DEVICE ='/dev/rfcomm0'29 MOTORS_MOUNTED_BACKWARDS = True30 MOTOR_PORT_RIGHT = 'a'31 MOTOR_PORT_LEFT = 'b'29 BLUETOOTH_DEVICE = configuration.BLUETOOTH_DEVICE 30 MOTORS_MOUNTED_BACKWARDS = configuration.MOTORS_MOUNTED_BACKWARDS 31 MOTOR_PORT_RIGHT = configuration.MOTOR_PORT_RIGHT 32 MOTOR_PORT_LEFT = configuration.MOTOR_PORT_LEFT 32 33 33 34 ##################################################################### -
rc/puzzlebox_brainstorms_server.py
r4 r5 11 11 # For more information please refer to http://www.gnu.org/copyleft/gpl.htm 12 12 # 13 # Last Update: 2010.01.2 713 # Last Update: 2010.01.28 14 14 # 15 15 ##################################################################### 16 16 17 import os, signal, time17 import os, signal, sys, time 18 18 import cPickle as pickle 19 19 20 20 from twisted.internet import reactor, protocol, defer 21 21 22 #import puzzlebox_configuration23 import puzzlebox_ master_control_client22 import puzzlebox_brainstorms_configuration as configuration 23 import puzzlebox_brainstorms_client 24 24 #import puzzlebox_logger 25 25 26 27 26 ##################################################################### 28 27 # Globals … … 31 30 DEBUG = 1 32 31 33 #SERVER_HOST = puzzlebox_configuration.SERVER_HOST 34 #SERVER_PORT = puzzlebox_configuration.SERVER_PORT 35 SERVER_HOST = '127.0.0.1' 36 SERVER_PORT = 8194 32 SERVER_HOST = configuration.SERVER_HOST 33 SERVER_PORT = configuration.SERVER_PORT 37 34 38 35 #MAX_COMPONENTS = puzzlebox_configuration.MAX_COMPONENTS … … 78 75 79 76 if 'command' in instruction: 80 81 77 response = '%s instruction received' % instruction['command'] 82 78 … … 84 80 if 'information' in instruction: 85 81 information = instruction['information'] 82 83 84 if instruction['command'] == 'test_drive': 85 86 command = 'python puzzlebox_brainstorms_rc.py' 87 88 os.system(command) 86 89 87 90 … … 451 454 ################################################################## 452 455 453 #def process_connection_lost(self, instruction):454 455 #if not instruction:456 457 #self.log.debug("Connection lost with no instruction?")458 #if self.DEBUG:459 #print "Connection lost with no instruction?"460 #return456 def process_connection_lost(self, instruction): 457 458 if not instruction: 459 460 self.log.debug("Connection lost with no instruction?") 461 if self.DEBUG: 462 print "Connection lost with no instruction?" 463 return 461 464 462 465 #else: … … 564 567 #if self.DEBUG: 565 568 #print "Not spawning process because command is '%s'" % instruction['command'] 569 570 571 ################################################################## 572 573 #def spawn_new_process(self, instruction, d): 574 575 #process = reactor.spawnProcess(pp, file, args, os.environ, usePTY=True) 576 577 #if len(self.registry['components']) >= MAX_COMPONENTS and \ 578 #not self.stop_oldest_component(): 579 #self.log.error("Max components exceeded, not spawning any new ones.") 580 #if self.DEBUG: 581 #print "Max components exceeded, not spawning any new ones." 582 #return 583 584 #if instruction['command'] == 'load_url': 585 586 #information = instruction['information'] 587 588 ## command = '/usr/bin/screen -S web_browser ' + \ 589 ## '%s %i %i %i %i %i %i %i %i %i %s' % \ 590 #command = '%s %i %i %i %i %i %i %i %i %i %i %s' % \ 591 #('/usr/bin/puzzlebox_web_browser.py', \ 592 #information['window_id'], \ 593 #information['display_pos_x'], \ 594 #information['display_pos_y'], \ 595 #information['window_size_x'], \ 596 #information['window_size_y'], \ 597 #information['display_fullscreen'], \ 598 #information['refresh_interval'], \ 599 #information['duration'], \ 600 #information['hide_on_duration_expire'], \ 601 #information['autobit_white_flash_fix'], \ 602 #information['url']) 603 604 #args = command.strip().split() 605 #file = args[0] 606 607 #self.log.debug("Spawning process from command: [%s]" % command) 608 #if self.DEBUG: 609 #print "Spawning process from command: [%s]" % command 610 611 #pp = puzzlebox_mcp_browser_pp(self.log, instruction, self.registry, \ 612 #self.spawn_new_component, self.restart_component, d, self.DEBUG) 613 #process = reactor.spawnProcess(pp, file, args, os.environ, usePTY=True) 614 615 #else: 616 #self.log.debug("Not spawning process because command is '%s'" % instruction['command']) 617 #if self.DEBUG: 618 #print "Not spawning process because command is '%s'" % instruction['command' 566 619 567 620
Note: See TracChangeset
for help on using the changeset viewer.