01234567890123456789012345678901234567890123456789012345678901234567890123456789
892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932 | <----SKIPPED LINES----> Log('Heartbeat read by Servo: %s' % str(heartbeat)) now = GetNow(json_desc_dict, additional_attr) current_angles = AzimuthAltitude(flight, now) if time.time() > next_write: if (current_angles and current_angles[1] >= configuration['minimum_altitude_servo_tracking'] and 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) else: rgb_tuple = HexColorToRGBTuple(configuration['led_color']) 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): <----SKIPPED LINES----> |
01234567890123456789012345678901234567890123456789012345678901234567890123456789
892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932 | <----SKIPPED LINES----> Log('Heartbeat read by Servo: %s' % str(heartbeat)) now = GetNow(json_desc_dict, additional_attr) current_angles = AzimuthAltitude(flight, now) if time.time() > next_write: if (current_angles and current_angles[1] >= configuration['minimum_altitude_servo_tracking'] and 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 = HexColorToRGBTuple(configuration['led_color']) 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): <----SKIPPED LINES----> |