ARB
Classes | Macros | Enumerations | Functions | Variables
AW_status.cxx File Reference
#include <aw_root.hxx>
#include <aw_question.hxx>
#include <aw_awars.hxx>
#include <aw_window.hxx>
#include "aw_msg.hxx"
#include "aw_status.hxx"
#include "aw_preset.hxx"
#include <arbdbt.h>
#include <arb_strbuf.h>
#include <arb_sleep.h>
#include <SigHandler.h>
#include <cerrno>
#include <cstdarg>
#include <ctime>
#include <unistd.h>
Include dependency graph for AW_status.cxx:

Go to the source code of this file.

Classes

struct  aw_stg_struct
 

Macros

#define FD_SET_TYPE
 
#define AW_GAUGE_SIZE   40
 
#define AW_GAUGE_GRANULARITY   10000
 
#define AW_STATUS_KILL_DELAY   4000
 
#define AW_STATUS_LISTEN_DELAY   300
 
#define AW_STATUS_HIDE_DELAY   60
 
#define AW_STATUS_PIPE_CHECK_DELAY   1000*2
 
#define AWAR_STATUS   "tmp/status/"
 
#define AWAR_STATUS_TITLE   AWAR_STATUS "title"
 
#define AWAR_STATUS_TEXT   AWAR_STATUS "text"
 
#define AWAR_STATUS_GAUGE   AWAR_STATUS "gauge"
 
#define AWAR_STATUS_ELAPSED   AWAR_STATUS "elapsed"
 
#define AW_MESSAGE_LINES   500
 
#define FORCE_WEIGHTED_ESTIMATION
 
#define AW_EST_BUFFER   5
 
#define POLL_TIMEOUT   0
 
#define WRITE_TIMEOUT   10000
 
#define MAX_SEC_WIDTH   7
 
#define MAX_SEC_WIDTH_STR   stringize_pscan(MAX_SEC_WIDTH)
 

Enumerations

enum  StatusCommand {
  AW_STATUS_OK = 0, AW_STATUS_ABORT = 1, AW_STATUS_CMD_INIT, AW_STATUS_CMD_OPEN,
  AW_STATUS_CMD_CLOSE, AW_STATUS_CMD_NEW_TITLE, AW_STATUS_CMD_TEXT, AW_STATUS_CMD_GAUGE,
  AW_STATUS_CMD_MESSAGE
}
 
enum  LogLevel {
  LOG_ALWAYS, LOG_ALWAYS_RESET_ONCE_LIMITS, LOG_ALWAYS_WITH_ESTIMATION, LOG_ONCE_PER_SECOND,
  LOG_ONCE_PER_MINUTE_WITH_ESTIMATION, LOG_ONCE_PER_15_MINUTES_WITH_ESTIMATION
}
 

Functions

static void mark_pipe_broken (int err_no)
 
static ssize_t safe_write (int fd, const char *buf, int count)
 
static void aw_status_write (int fd, int cmd)
 
static int aw_status_read_byte (int fd, int poll_flag)
 
static int aw_status_read_int (int fd, int poll_flag)
 
static int aw_status_read_command (int fd, int poll_flag, char *&str, int *gaugePtr=NULp)
 
static void aw_status_check_pipe ()
 
static void aw_status_wait_for_open (int fd)
 
static unsigned aw_status_timer_hide_event (AW_root *)
 
static void aw_status_hide (AW_window *aws)
 
static unsigned aw_status_timer_event (AW_root *awr)
 
static void aw_status_kill (AW_window *aws)
 
static void aw_refresh_tmp_message_display (AW_root *awr)
 
static void aw_insert_message_in_tmp_message_delayed (const char *message)
 
static void aw_insert_message_in_tmp_message (AW_root *awr, const char *message)
 
const charsec2disp (long seconds)
 
const charreadableTime (const time_t &t)
 
void LOG_STATUS (const char *txt1, const char *txt2, LogLevel level)
 
static unsigned aw_status_timer_listen_event (AW_root *awr)
 
void aw_clear_message_cb (AW_window *aww)
 
static void aw_clear_and_hide_message_cb (AW_window *aww)
 
static void save_messagebox_content_to (const char *name)
 
static void aw_message_save_cb (AW_window *aww)
 
static void create_status_awars (AW_root *aw_root)
 
void aw_initstatus ()
 
static void status_write_cmd_and_text (StatusCommand cmd, const char *text, int textlen)
 
static void status_write_cmd_and_text (StatusCommand cmd, const char *text)
 
void aw_openstatus (const char *title)
 
void aw_closestatus ()
 
void aw_status_title (const char *new_title)
 
void aw_status_subtitle (const char *text)
 
void aw_status_gauge (double gauge)
 
bool aw_status_aborted ()
 
void aw_set_local_message ()
 
void aw_message (const char *msg)
 

Variables

static aw_stg_struct aw_stg
 
static time_t status_started
 
static bool timer_ok = false
 

Macro Definition Documentation

#define FD_SET_TYPE

Definition at line 31 of file AW_status.cxx.

Referenced by aw_status_read_byte(), aw_status_read_int(), and aw_status_wait_for_open().

#define AW_GAUGE_SIZE   40

Definition at line 34 of file AW_status.cxx.

Referenced by aw_initstatus(), and aw_status_read_command().

#define AW_GAUGE_GRANULARITY   10000
#define AW_STATUS_KILL_DELAY   4000

Definition at line 37 of file AW_status.cxx.

Referenced by aw_status_kill().

#define AW_STATUS_LISTEN_DELAY   300

Definition at line 38 of file AW_status.cxx.

Referenced by aw_status_timer_listen_event().

#define AW_STATUS_HIDE_DELAY   60

Definition at line 39 of file AW_status.cxx.

Referenced by aw_status_timer_listen_event().

#define AW_STATUS_PIPE_CHECK_DELAY   1000*2

Definition at line 40 of file AW_status.cxx.

Referenced by aw_status_wait_for_open().

#define AWAR_STATUS   "tmp/status/"

Definition at line 42 of file AW_status.cxx.

#define AWAR_STATUS_TITLE   AWAR_STATUS "title"
#define AWAR_STATUS_TEXT   AWAR_STATUS "text"
#define AWAR_STATUS_GAUGE   AWAR_STATUS "gauge"

Definition at line 45 of file AW_status.cxx.

Referenced by aw_initstatus(), aw_status_timer_listen_event(), and create_status_awars().

#define AWAR_STATUS_ELAPSED   AWAR_STATUS "elapsed"

Definition at line 46 of file AW_status.cxx.

Referenced by aw_initstatus(), aw_status_timer_listen_event(), and create_status_awars().

#define AW_MESSAGE_LINES   500
#define FORCE_WEIGHTED_ESTIMATION

Definition at line 63 of file AW_status.cxx.

#define AW_EST_BUFFER   5

Definition at line 80 of file AW_status.cxx.

Referenced by aw_status_timer_listen_event().

#define POLL_TIMEOUT   0

Definition at line 132 of file AW_status.cxx.

Referenced by aw_status_read_byte(), and aw_status_read_int().

#define WRITE_TIMEOUT   10000

Definition at line 137 of file AW_status.cxx.

Referenced by mark_pipe_broken(), and safe_write().

#define MAX_SEC_WIDTH   7

Definition at line 537 of file AW_status.cxx.

Referenced by sec2disp().

#define MAX_SEC_WIDTH_STR   stringize_pscan(MAX_SEC_WIDTH)

Definition at line 538 of file AW_status.cxx.

Referenced by LOG_STATUS().

Enumeration Type Documentation

Enumerator
AW_STATUS_OK 
AW_STATUS_ABORT 
AW_STATUS_CMD_INIT 
AW_STATUS_CMD_OPEN 
AW_STATUS_CMD_CLOSE 
AW_STATUS_CMD_NEW_TITLE 
AW_STATUS_CMD_TEXT 
AW_STATUS_CMD_GAUGE 
AW_STATUS_CMD_MESSAGE 

Definition at line 66 of file AW_status.cxx.

enum LogLevel
Enumerator
LOG_ALWAYS 
LOG_ALWAYS_RESET_ONCE_LIMITS 
LOG_ALWAYS_WITH_ESTIMATION 
LOG_ONCE_PER_SECOND 
LOG_ONCE_PER_MINUTE_WITH_ESTIMATION 
LOG_ONCE_PER_15_MINUTES_WITH_ESTIMATION 

Definition at line 607 of file AW_status.cxx.

Function Documentation

static void mark_pipe_broken ( int  err_no)
static

Definition at line 140 of file AW_status.cxx.

References aw_stg_struct::err_no, aw_stg_struct::pipe_broken, and WRITE_TIMEOUT.

Referenced by safe_write().

static ssize_t safe_write ( int  fd,
const char buf,
int  count 
)
static
static void aw_status_write ( int  fd,
int  cmd 
)
static
static int aw_status_read_byte ( int  fd,
int  poll_flag 
)
static

Definition at line 231 of file AW_status.cxx.

References buffer, EXIT_FAILURE, FD_SET_TYPE, NULp, and POLL_TIMEOUT.

Referenced by aw_status_read_command().

static int aw_status_read_int ( int  fd,
int  poll_flag 
)
static

Definition at line 258 of file AW_status.cxx.

References buffer, EXIT_FAILURE, FD_SET_TYPE, NULp, and POLL_TIMEOUT.

Referenced by aw_status_read_command().

static int aw_status_read_command ( int  fd,
int  poll_flag,
char *&  str,
int gaugePtr = NULp 
)
static
static void aw_status_check_pipe ( )
static

Definition at line 334 of file AW_status.cxx.

References EXIT_FAILURE.

Referenced by aw_status_timer_listen_event(), and aw_status_wait_for_open().

static void aw_status_wait_for_open ( int  fd)
static
static unsigned aw_status_timer_hide_event ( AW_root )
static

Definition at line 377 of file AW_status.cxx.

References aw_stg_struct::aws, aw_stg_struct::hide, and AW_window::show().

Referenced by aw_status_hide().

static void aw_status_hide ( AW_window aws)
static
static unsigned aw_status_timer_event ( AW_root awr)
static
static void aw_status_kill ( AW_window aws)
static
static void aw_refresh_tmp_message_display ( AW_root awr)
static
static void aw_insert_message_in_tmp_message_delayed ( const char message)
static
static void aw_insert_message_in_tmp_message ( AW_root awr,
const char message 
)
static
const char* sec2disp ( long  seconds)
inline

Definition at line 540 of file AW_status.cxx.

References arb_assert, buffer, long, MAX_SEC_WIDTH, and plural().

Referenced by aw_status_timer_listen_event(), and LOG_STATUS().

const char* readableTime ( const time_t &  t)
inline

Definition at line 616 of file AW_status.cxx.

References arb_test::nl().

Referenced by LOG_STATUS().

void LOG_STATUS ( const char txt1,
const char txt2,
LogLevel  level 
)
inline
static unsigned aw_status_timer_listen_event ( AW_root awr)
static
void aw_clear_message_cb ( AW_window aww)
static void aw_clear_and_hide_message_cb ( AW_window aww)
static

Definition at line 920 of file AW_status.cxx.

References aw_clear_message_cb(), and AW_POPDOWN().

Referenced by aw_initstatus().

static void save_messagebox_content_to ( const char name)
static
static void aw_message_save_cb ( AW_window aww)
static
static void create_status_awars ( AW_root aw_root)
static
void aw_initstatus ( )
static void status_write_cmd_and_text ( StatusCommand  cmd,
const char text,
int  textlen 
)
static
static void status_write_cmd_and_text ( StatusCommand  cmd,
const char text 
)
static

Definition at line 1079 of file AW_status.cxx.

References status_write_cmd_and_text().

void aw_openstatus ( const char title)
void aw_closestatus ( )

Definition at line 1093 of file AW_status.cxx.

References AW_STATUS_CMD_CLOSE, aw_status_write(), and aw_stg_struct::fd_to.

void aw_status_title ( const char new_title)

Definition at line 1097 of file AW_status.cxx.

References AW_STATUS_CMD_NEW_TITLE, and status_write_cmd_and_text().

void aw_status_subtitle ( const char text)

Definition at line 1100 of file AW_status.cxx.

References AW_STATUS_CMD_TEXT, and status_write_cmd_and_text().

void aw_status_gauge ( double  gauge)
bool aw_status_aborted ( )
void aw_set_local_message ( )

Definition at line 1137 of file AW_status.cxx.

References aw_stg_struct::local_message.

Referenced by ED4_root::generate_window().

void aw_message ( const char msg)

Definition at line 1142 of file AW_status.cxx.

References aw_assert, aw_insert_message_in_tmp_message(), AW_STATUS_CMD_INIT, AW_STATUS_CMD_MESSAGE, aw_status_write(), aw_stg_struct::fd_to, aw_stg_struct::local_message, RUNNING_TEST, AW_root::SINGLETON, aw_stg_struct::status_initialized, and status_write_cmd_and_text().

Referenced by ad_move_tree_info(), add_field_cb(), adjustTreeRoot(), after_callback_guard(), SEC_region::align_helix_strands(), alignToNextRelative(), AW_window::alloc_named_data_color(), AP_user_pop_cb(), ARB_main(), askCopyMoveRuleset_cb(), AW_create_fileselection_awars(), aw_help_browse(), aw_help_edit_help(), aw_help_helpfile_changed_cb(), aw_help_search(), aw_message_and_dump_stderr(), aw_message_if(), aw_message_reload(), aw_question(), AW_reactivate_all_advices(), AW_reactivate_all_questions(), AW_save_specific_properties(), AW_server_callback(), aw_status_timer_event(), aw_window_avoid_destroy_cb(), AW_xfig::AW_xfig(), aw_xkey_2_awkey(), awt_string_handler::awar_changed(), awt_aps_go(), awt_create_input_mask(), AWT_create_mask_submenu(), AWT_initialize_input_mask(), AWT_input_mask_browse_url(), AWT_modify_managed_configs(), awt_openDefaultURL_on_selected_species(), awt_rename_cb(), AWT_show_file(), awtc_delete_names_file(), AWTC_generate_random_name(), awtc_nn_search(), awtc_nn_search_all_listed(), before_callback_guard(), boundloc_changed_cb(), build_reverse_complement(), calc_and_update_alignment_errors_cb(), FieldReader::calc_value(), ColumnStat::calculate(), DI_MATRIX::calculate(), calculate_clusters(), calculate_sai_cb(), Dict::canDecompress(), canvas_to_printer(), canvas_to_xfig_and_run_xfig(), change_constraints(), VarUpdateInfo::change_from_widget(), check_and_correct_current_field(), AWT_graphic_tree::check_for_DB_update(), check_for_remote_command(), clear_all_colors_cb(), color_group_name_changed_cb(), colorDefChanged_callback(), colstat_2_gnuplot_cb(), comment_changed_cb(), ED4_remap::compile(), concatenateAlignments(), concatenateFieldsCreateNewSpecies(), FINAL_TYPE< SEQTYPE >::configure_active_plugin(), copy_SAI_cb(), copy_SAI_to_species_cb(), QUERY::copy_selection_list_2_query_box(), AW_window::create_button(), create_macro_variables(), create_matrix_config_window(), create_modify_fields_window(), create_new_mask_cb(), create_new_species(), create_primer_design_window(), create_probe_design_variables(), createOpFromConfigAwar(), createValNameList(), del_boolrule_cb(), delete_ali_cb(), delete_cb(), delete_kept_ghostnodes(), delete_macro_cb(), delete_queried_species_cb(), delete_SAI_cb(), TreeAdmin::delete_tree_cb(), deleteColorTranslationTable(), InfoWindow::detach_selected_item(), detect_current_ref_terminal(), ArbImporter::detect_format(), detect_input_format_cb(), di_autodetect_callback(), di_calculate_tree_cb(), di_mark_by_distance(), InfoWindow::display_selected_item(), display_selected_rule_cb(), dot_missing_bases(), ed4_create_all_awars(), ED4_finish_and_show_notFoundMessage(), ED4_get_and_jump_to_current(), ED4_get_and_jump_to_selected_SAI(), ED4_get_and_jump_to_species(), ED4_get_marked_from_menu(), ED4_helix_jump_opposite(), ED4_jump_to_current_species(), ED4_jump_to_cursor_position(), ED4_menu_highlight(), ED4_pfold_select_SAI_and_update_option_menu(), ED4_remove_faligner_entries(), ED4_restore_curpos(), ED4_search_cb(), ED4_set_col_stat_threshold(), ED4_set_helixnr(), ED4_set_iupac(), ED4_set_protection(), ED4_show_protein_match_on_device(), ED4_start_editor_on_configuration(), ED4_store_curpos(), ED4_toggle_detailed_column_stats(), ED4_undo_redo(), ED4_with_whole_block(), ed_save_var_to_file(), ed_submit_info_event(), ED4_Edit_String::edit(), ProbeValuation::evolution(), exec_macro_cb(), execute_macro(), executeKeystroke(), expect_species_selected(), experiment_delete_cb(), export_go_cb(), export_nds_cb(), export_structure_to_file(), export_to_DB(), ExposeOpenGLWindow(), field_convert_commit_cb(), field_create_cb(), field_delete_cb(), fieldtype_changed_cb(), AWT_tree_selection::fill(), PT_selection::fill(), MO_Liste::fill_marked_bakts(), EDB_root_bact::fill_species(), fillSelNamList(), find_SAI_candidates(), find_species_candidates(), fit_pages(), GDE_showhelp_cb(), GDE_startaction_cb(), GEN_create_nds_vars(), gen_extract_gene_2_pseudoSpecies(), Sonde::gen_Hitliste(), GEN_make_node_text_nds(), GEN_mark_command(), GEN_perform_command(), GEN_root::GEN_root(), GEN_select_gene(), GEN_undo_cb(), gene_create_cb(), gene_delete_cb(), ED4_root::generate_window(), group_clusters(), group_species(), FormatTester::handle_action_cb(), hide_field_cb(), AW_window::hide_or_notify(), ArbImporter::import_and_continueOnSuccess(), ArbImporter::import_data(), import_structure_from_file(), PH_display::initialize_display(), input_cb(), insdel_event(), insdel_sai_event(), InsertDatainGDE(), ED4_cursor::jump_screen_pos(), jump_to_next_helix_cb(), AWT_configuration::keep_changed_fields(), ED4_terminal::kill_object(), launch_MapViewer_cb(), lintRuleset(), load_probe_collection(), load_search_paras_from_file(), LoadData(), loadsave_colorset_cb(), macro_terminated(), di_protdist::makedists(), AW_awar::map(), mark_action(), AP_tree::mark_duplicates(), mark_gene_species_using_current_alignment(), mark_nontree_cb(), mark_tree_cb(), matrix_config_changed_cb(), FastAlignReport::memorize_insertion(), mergeSimilarSpecies(), mg_check_field_cb(), MG_config_delete_cb(), MG_copy_and_check_alignments(), MG_create_db_dependent_rename_awars(), MG_create_merge_configs_window(), MG_create_merge_species_window(), MG_create_merge_trees_window(), MG_create_remap(), MG_delete_selected_field_def(), MG_export_fields(), MG_extended_delete_cb(), MG_merge_tagged_field_cb(), MG_save_cb(), MG_save_quick_result_cb(), MG_source_field_changed_cb(), MG_transfer_config(), MG_transfer_extended(), mg_transfer_listed_species(), mg_transfer_selected_species(), MG_transfer_tree(), mod_boolrule_cb(), modify_target_string(), move_species_to_extended(), MP_compute(), mp_file2list(), MP_mark_probes_in_tree(), MP_new_sequence(), MP_selected_chosen(), MP_show_probes_in_tree(), multiroot_sync_subsetTrees(), n_encode(), NDS_popup_select_srtaci_window(), nds_restore_config(), ArbImporter::next_file(), awt_input_mask_global::no_item_selected(), nt_add(), NT_alltree_remove_leafs(), NT_convert_gene_locations(), NT_count_different_chars(), nt_create_all_awars(), NT_create_main_window(), NT_create_sai_from_pfold(), NT_createConcatenationAwars(), NT_del_mark_move_REF(), nt_delete_configuration(), nt_delete_database(), NT_delete_mark_all_cb(), NT_deleteValidNames(), NT_edit_bootstrap(), nt_extract_configuration(), NT_fix_dict_compress(), NT_fix_gene_data(), NT_import_sequences(), NT_importValidNames(), NT_jump_cb(), NT_mark_all_cb(), NT_move_boot_branch(), NT_multifurcate_tree(), NT_reload_tree_event(), NT_remove_bootstrap(), NT_remove_leafs(), nt_rename_configuration(), NT_rerepair_DB(), NT_reset_branchlengths(), NT_resort_data_by_phylogeny(), NT_resort_data_by_user_criteria(), NT_save_quick_cb(), NT_scale_tree(), NT_suggestValidNames(), NT_undo_cb(), p_encode(), SEC_root::paintSearchPatternStrings(), pars_create_all_awars(), pars_start_cb(), pd_export_pt_server(), pd_kill_pt_server(), pd_start_pt_server(), awt_mask_action::perform_action(), perform_query_cb(), ph_calc_filter_cb(), popup_interrupt_macro_window_cb(), preCreateTempfile(), predef_prg(), primer_design_event_go(), primer_design_event_init(), probe_design_event(), probe_match_event(), probe_match_with_specificity_event(), PV_PrintMissingDBentryInformation(), PV_SaveData(), PV_WriteTranslatedSequenceToDB(), quick_scan_input_mask(), ReadArbdb(), ReadArbdb2(), realign_event(), AP_tree::recompute_and_write_folding(), refDbModeChanged_cb(), UserlandCheck::Register(), RegFieldSelection::registrate(), ED4_seq_colors::reload(), reload_ecoli_cb(), reload_helix_cb(), remote_command_handler(), rename_both_databases(), GroupUIdata::rename_listed_groups(), rename_SAI_cb(), renameDB(), reorder_keys(), reorder_trees_cb(), reorder_up_down(), ReplaceArgs(), restore_colorset_representation(), AP_main::revert_user_state(), rootsync_subsetTrees_vs_selected(), ruleset_awar_changed_cb(), Aligner::run(), AW_cb::run_callbacks(), saicalc_edit_method_cb(), save_search_paras_to_file(), AWT_graphic_tree::save_to_DB(), AP_tree_root::saveToDB(), QUERY::search_duplicated_field_content(), searchParamsChanged(), SearchTree::SearchTree(), SEC_delete_structure(), SEC_toggle_cb(), SEC_undo_cb(), selectValidNameFromList(), sequence_changed_cb(), set_diff_reference(), set_field_of_queried_cb(), set_protection_of_queried_cb(), show_count(), GroupChanges::show_message(), sina_cmd_changed_cb(), sina_start(), species_copy_cb(), species_delete_cb(), species_rename_join(), sq_calc_seq_quality_cb(), st_check_cb(), ST_Container::ST_Container(), st_remove_entries(), start_macro_cb(), startup_sequence_cb(), store_cb(), sync_changed_cb(), AWT_graphic_tree::toggle_group(), toggle_helix_for_SAI(), ED4_block::toggle_type(), track_ali_change_cb(), trackAlignmentChanges(), transfer_field_of_listed_cb(), transfer_field_of_selected_cb(), transl_def_changed_cb(), translate_config_changed_cb(), TranslateGeneToAminoAcidSequence(), transpro_event(), SearchSettings::update(), ED4_manager::update_bases_and_rebuild_consensi(), GroupBuilder::update_group(), update_rulesAwar(), updateValNameList(), useSelectedAlignment(), AWT_graphic_tree::warn_inappropriate_mode(), warn_unknown_awar(), warn_unrecordable(), Warning(), with_affected_clusters_do(), NodeTextBuilder::work(), AWT_config_definition::write(), write_file(), ED4_terminal::write_sequence(), AWT_config::write_to_awars(), AWT_canvas::zoom(), and EG2PS_data::~EG2PS_data().

Variable Documentation

aw_stg_struct aw_stg
static
Initial value:
= {
{ 0, 0 },
{ 0, 0 },
0,
0,
0,
false,
0,
0,
NULp,
NULp,
false,
{ NULp, NULp, NULp },
false,
0,
0,
0,
0,
0,
{ 0 },
-1,
}
#define NULp
Definition: cxxforward.h:116

Definition at line 106 of file AW_status.cxx.

time_t status_started
static

Definition at line 604 of file AW_status.cxx.

Referenced by aw_status_timer_listen_event(), and LOG_STATUS().

bool timer_ok = false
static

Definition at line 605 of file AW_status.cxx.

Referenced by aw_status_timer_listen_event(), and LOG_STATUS().