01234567890123456789012345678901234567890123456789012345678901234567890123456789
941942943944945946947948949950951952953954955956957958959960 961962963964965966967968969970971972973974975976977978979980 | <----SKIPPED LINES----> configuration['servo_mode'] in ('laser_only', 'both')): if VERBOSE: Log('Flight #: %s current_angles: %s' % ( messageboard.DisplayFlightNumber(flight), str(current_angles))) laser_rgb = LaserRGBFlight(flight) message_dict = GenerateServoMessage( laser=laser_rgb, angles=current_angles, led=LED_OFF) elif configuration['servo_mode'] == 'laser_only': message_dict = GenerateServoMessage(laser=LASER_OFF, led=LED_OFF) else: rgb_tuple = GammaRGB( HexColorToRGBTuple(configuration['led_color']), gamma) message_dict = GenerateServoMessage(laser=LASER_OFF, led=rgb_tuple) message_tuple = DictToValueTuple( message_dict, write_keys, write_format_tuple) link.Write(message_tuple) next_write = time.time() + WRITE_DELAY_TIME # One final write telling Arduino to do a software reset message_dict = GenerateServoMessage(laser=LASER_OFF, reset=True) message_tuple = DictToValueTuple(message_dict, write_keys, write_format_tuple) link.Write(message_tuple) link.Close(SHUTDOWN_TEXT) def LaserRGBFlight(flight): """Based on flight attributes, set the laser.""" # Possible assignment based on: # - ascending / descending / level # - to SFO / from SFO / other # - big plane / med plane / small plane # - low alt / med alt / high alt # - low speed / med speed / high speed <----SKIPPED LINES----> |
01234567890123456789012345678901234567890123456789012345678901234567890123456789
941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981 | <----SKIPPED LINES----> configuration['servo_mode'] in ('laser_only', 'both')): if VERBOSE: Log('Flight #: %s current_angles: %s' % ( messageboard.DisplayFlightNumber(flight), str(current_angles))) laser_rgb = LaserRGBFlight(flight) message_dict = GenerateServoMessage( laser=laser_rgb, angles=current_angles, led=LED_OFF) elif configuration['servo_mode'] == 'laser_only': message_dict = GenerateServoMessage(laser=LASER_OFF, led=LED_OFF) else: rgb_tuple = GammaRGB( HexColorToRGBTuple(configuration['led_color']), gamma) message_dict = GenerateServoMessage(laser=LASER_OFF, led=rgb_tuple) message_tuple = DictToValueTuple( message_dict, write_keys, write_format_tuple) Log(message_tuple) link.Write(message_tuple) next_write = time.time() + WRITE_DELAY_TIME # One final write telling Arduino to do a software reset message_dict = GenerateServoMessage(laser=LASER_OFF, reset=True) message_tuple = DictToValueTuple(message_dict, write_keys, write_format_tuple) link.Write(message_tuple) link.Close(SHUTDOWN_TEXT) def LaserRGBFlight(flight): """Based on flight attributes, set the laser.""" # Possible assignment based on: # - ascending / descending / level # - to SFO / from SFO / other # - big plane / med plane / small plane # - low alt / med alt / high alt # - low speed / med speed / high speed <----SKIPPED LINES----> |