01234567890123456789012345678901234567890123456789012345678901234567890123456789
24812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521 5320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362 | <----SKIPPED LINES----> configuration['setting_on_time'])) elif minute_of_day > configuration['setting_off_time'] + 1: flight_meets_criteria = False if log: Log( '%s not displayed because it occurs too late - minute_of_day: ' '%d; setting_off_time: %d' % ( DisplayFlightNumber(flight), minute_of_day, configuration['setting_off_time'])) elif configuration.get('setting_screen_enabled', 'off') == 'off': flight_meets_criteria = False if log: Log( '%s not displayed because screen disabled' % DisplayFlightNumber(flight)) return flight_meets_criteria def MessageMeetsDisplayCriteria(configuration, log=False): """Returns boolean indicating whether is active. Based on the configuration file, determines whether the flight data should be displayed. Specifically, the configuration: - may include 'enabled' indicating whether screen should be driven at all - should include 'on' & 'off' parameters indicating minute (from midnight) of operation Note that this differs from FlightMeetsDisplayCriteria in that this function does not use any attribute about the flight (elevation or distance), only whether the screen is still active. Args: configuration: dictionary of configuration attributes. log: optional boolean indicating whether a flight that fails the criteria should be logged with the reason Returns: Boolean as described. """ message_meets_criteria = True <----SKIPPED LINES----> lines.append(screen_title.upper()) if data_summary: lines.append(summary_text.upper()) for line_index in range(number_of_lines): key_value = [] for column_index in range(columns): index = start_index + column_index*number_of_lines + line_index if index <= end_index: if absolute: value_string = format_string % values[index] else: # If the % is >=1%, display right-justified 2 digit percent, i.e. ' # 5%' Otherwise, if it rounds to at least 0.1%, display i.e. '.5%'; # Otherwise, if it round to at least 0.01%, display i.e.: '.01%', # getting rid of the space between the label & the value (i.e.: # PSP.01 instead of PSP .4). if values[index]/total*100 >= 0.95: value_string = ' %2d' % round(values[index]/total*100) elif round(values[index]/total*1000)/10 >= 0.1: value_string = ( ' %.1f' % (round(values[index]/total*1000)/10))[1:] elif round(values[index]/total*1000)/10 >= 0.01: value_string = ( '%.2f' % (round(values[index]/total*10000)/100))[1:] else: value_string = ' 0' key_value.append('%s%s%s' % ( str(keys[index])[:column_key_width].ljust(column_key_width), value_string, printed_percent_sign)) line = (column_divider.join(key_value)).upper() lines.append(line) split_flap_boards.append(lines) return split_flap_boards def TriggerHistograms(flights, histogram_settings, heartbeat=True): """Triggers the text-based or web-based histograms. <----SKIPPED LINES----> |
01234567890123456789012345678901234567890123456789012345678901234567890123456789
24812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521 5320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362 | <----SKIPPED LINES----> configuration['setting_on_time'])) elif minute_of_day > configuration['setting_off_time'] + 1: flight_meets_criteria = False if log: Log( '%s not displayed because it occurs too late - minute_of_day: ' '%d; setting_off_time: %d' % ( DisplayFlightNumber(flight), minute_of_day, configuration['setting_off_time'])) elif configuration.get('setting_screen_enabled', 'off') == 'off': flight_meets_criteria = False if log: Log( '%s not displayed because screen disabled' % DisplayFlightNumber(flight)) return flight_meets_criteria def MessageMeetsDisplayCriteria(configuration, log=False): """Returns boolean indicating whether screen is active. Based on the configuration file, determines whether the flight data should be displayed. Specifically, the configuration: - may include 'enabled' indicating whether screen should be driven at all - should include 'on' & 'off' parameters indicating minute (from midnight) of operation Note that this differs from FlightMeetsDisplayCriteria in that this function does not use any attribute about the flight (elevation or distance), only whether the screen is still active. Args: configuration: dictionary of configuration attributes. log: optional boolean indicating whether a flight that fails the criteria should be logged with the reason Returns: Boolean as described. """ message_meets_criteria = True <----SKIPPED LINES----> lines.append(screen_title.upper()) if data_summary: lines.append(summary_text.upper()) for line_index in range(number_of_lines): key_value = [] for column_index in range(columns): index = start_index + column_index*number_of_lines + line_index if index <= end_index: if absolute: value_string = format_string % values[index] else: # If the % is >=1%, display right-justified 2 digit percent, i.e. ' # 5%' Otherwise, if it rounds to at least 0.1%, display i.e. '.5%'; # Otherwise, if it round to at least 0.01%, display i.e.: '.01%', # getting rid of the space between the label & the value (i.e.: # PSP.01 instead of PSP .4). if values[index]/total*100 >= 0.95: value_string = ' %2d' % round(values[index]/total*100) elif round(values[index]/total*1000)/10 >= 0.1: value_string = ' ' + ( '%.1f' % (round(values[index]/total*1000)/10))[1:] elif round(values[index]/total*10000)/100 >= 0.01: value_string = ( '%.2f' % (round(values[index]/total*10000)/100))[1:] else: value_string = ' 0' key_value.append('%s%s%s' % ( str(keys[index])[:column_key_width].ljust(column_key_width), value_string, printed_percent_sign)) line = (column_divider.join(key_value)).upper() lines.append(line) split_flap_boards.append(lines) return split_flap_boards def TriggerHistograms(flights, histogram_settings, heartbeat=True): """Triggers the text-based or web-based histograms. <----SKIPPED LINES----> |