Changeset 6358 for branches/stable_5.0

Show
Ignore:
Timestamp:
19/01/10 14:11:52 (2 years ago)
Author:
westram
Message:
Location:
branches/stable_5.0
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • branches/stable_5.0/EDIT4/ED4_cursor.cxx

    r6109 r6358  
    592592} 
    593593 
     594void ED4_init_notFoundMessage() { 
     595    not_found_counter = 0; 
     596    not_found_message = GBS_stropen(10000); 
     597    // GBS_strcat(not_found_message,"Species not found: "); 
     598} 
     599void ED4_finish_and_show_notFoundMessage() { 
     600    if (not_found_counter != 0) { 
     601        GBS_strcat(not_found_message, GBS_global_string("(skipped display of %zu more species)\n", not_found_counter-MAX_SHOWN_MISSING_SPECIES)); 
     602        char *out_message = GBS_strclose(not_found_message); 
     603        aw_message(out_message); 
     604        aw_message(GBS_global_string("Couldn't load %zu species:", not_found_counter)); 
     605        free(out_message); 
     606    } 
     607    else { 
     608        GBS_strforget(not_found_message); 
     609    } 
     610    not_found_message = 0; 
     611} 
     612 
    594613void ED4_get_and_jump_to_species(GB_CSTR species_name) 
    595614{ 
     
    608627        ED4_index                  lot                 = 0; 
    609628 
    610         all_found         = 0; 
    611         not_found_message = GBS_stropen(1000); 
    612         GBS_strcat(not_found_message,"Species not found: "); 
     629        ED4_init_notFoundMessage(); 
    613630 
    614631        sprintf(string, "-L%s", species_name); 
     
    618635        loaded = 1; 
    619636 
    620         { 
    621             char *out_message = GBS_strclose(not_found_message); 
    622             not_found_message = 0; 
    623             if (all_found != 0) aw_message(out_message); 
    624             free(out_message); 
    625         } 
     637        ED4_finish_and_show_notFoundMessage(); 
    626638 
    627639        { 
     
    699711        aw_status("Loading species..."); 
    700712 
    701         all_found         = 0; 
    702         not_found_message = GBS_stropen(1000); 
    703         GBS_strcat(not_found_message,"Species not found: "); 
     713        ED4_init_notFoundMessage(); 
    704714 
    705715        while (gb_species) { 
     
    755765        aw_message(GBS_global_string("Loaded %i of %i marked species.", inserted, marked)); 
    756766 
    757         { 
    758             char *out_message = GBS_strclose(not_found_message); 
    759             not_found_message = 0; 
    760             if (all_found != 0) aw_message(out_message); 
    761             free(out_message); 
    762         } 
    763  
     767        ED4_finish_and_show_notFoundMessage(); 
     768         
    764769        if (inserted) { 
    765770            /* new AAseqTerminals should be created if it is in ProtView mode */ 
  • branches/stable_5.0/EDIT4/ED4_main.cxx

    r6169 r6358  
    5252 
    5353long           ED4_counter = 0; 
    54 long           all_found;       // nr of species which haven't been found 
    55 long           species_read;    // nr of species read; important during loading 
     54size_t         not_found_counter;                   // nr of species which haven't been found 
    5655GBS_strstruct *not_found_message; 
    57 long           max_seq_terminal_length; // global maximum of sequence terminal length 
    58 ED4_EDITMODI   awar_edit_modus; 
    59 long           awar_edit_direction; 
    60 bool           move_cursor;     // only needed for editing in consensus 
    61 bool           DRAW; 
    62 bool           last_window_reached; // needed for refreshing all windows (if TRUE refresh/...-flags will be cleared) 
     56 
     57long         max_seq_terminal_length;               // global maximum of sequence terminal length 
     58ED4_EDITMODI awar_edit_modus; 
     59long         awar_edit_direction; 
     60bool         move_cursor;                           // only needed for editing in consensus 
     61bool         DRAW; 
     62bool         last_window_reached;                   // needed for refreshing all windows (if TRUE refresh/...-flags will be cleared) 
    6363 
    6464size_t status_count_total;                          // used for consensus progress bar 
     
    6969void ED4_config_change_cb(AW_root *) 
    7070{ 
    71  
    7271    // @@@ FIXME: ok to be empty ? check! 
    7372} 
  • branches/stable_5.0/EDIT4/ED4_no_class.cxx

    r6203 r6358  
    13161316    ED4_calc_terminal_extentions(); 
    13171317 
    1318     all_found = 0; 
    1319     species_read = 0; 
    13201318    max_seq_terminal_length = 0; 
    1321     not_found_message = GBS_stropen(1000); 
    1322     GBS_strcat(not_found_message,"Some species not found:\n"); 
     1319     
     1320    ED4_init_notFoundMessage(); 
    13231321 
    13241322 
  • branches/stable_5.0/EDIT4/ED4_root.cxx

    r6169 r6358  
    732732    aw_root->add_timed_callback(2000,ED4_timer,(AW_CL)0,(AW_CL)0); 
    733733 
    734     char *out_message = GBS_strclose(not_found_message); 
    735     not_found_message = 0; 
    736     if (all_found != 0) aw_message(out_message); 
    737     free(out_message); 
     734    ED4_finish_and_show_notFoundMessage(); 
    738735 
    739736    return ( ED4_R_OK ); 
     
    19691966    DRAW                    = 1; 
    19701967    move_cursor             = 0; 
    1971     all_found               = 0; 
    1972     species_read            = 0; 
    19731968    max_seq_terminal_length = 0; 
    19741969 
    1975     not_found_message = GBS_stropen(1000); 
    1976  
    1977     GBS_strcat(not_found_message,"Some species not found:\n"); 
     1970    ED4_init_notFoundMessage(); 
    19781971 
    19791972    return ( new_window->aww ); 
  • branches/stable_5.0/EDIT4/EDB_root_bact.cxx

    r5929 r6358  
    7575    } 
    7676 
    77  
    7877    if (!gb_datamode) { // didn't find this species 
    7978        char dummy[150]; 
    80         all_found++; 
    81         sprintf(dummy,"%ld. %s\n",all_found, str); 
    82         GBS_strcat(not_found_message,dummy); 
     79        not_found_counter++; 
     80        if (not_found_counter <= MAX_SHOWN_MISSING_SPECIES) { 
     81            sprintf(dummy,"%zu. %s\n", not_found_counter, str); 
     82            GBS_strcat(not_found_message,dummy); 
     83        } 
    8384        return ED4_R_BREAK; 
    8485    } 
    8586 
    86     // check whether sequence has data in desired alignment 
     87        // check whether sequence has data in desired alignment 
    8788    bool has_alignment = 0 != GB_entry(gb_datamode,ED4_ROOT->alignment_name); 
    8889    if (!has_alignment) { 
    8990        if (datamode == ED4_D_SPECIES) { // only warn about species w/o data (SAIs are skipped silently) 
    9091            char dummy[150]; 
    91             all_found++; 
    92             sprintf(dummy,"%ld. %s (no data in alignment)\n",all_found, str); 
    93             GBS_strcat(not_found_message,dummy); 
     92            not_found_counter++; 
     93            if (not_found_counter <= MAX_SHOWN_MISSING_SPECIES) { 
     94                sprintf(dummy,"%zu. %s (no data in alignment)\n", not_found_counter, str); 
     95                GBS_strcat(not_found_message,dummy); 
     96            } 
    9497        } 
    9598        return ED4_R_BREAK; 
     
    138141    local_count_position += max(name_coords, seq_coords); 
    139142    name_coords = seq_coords = 0; 
    140     species_read ++; 
    141143 
    142144    if (!(multi_species_manager->flag.hidden)) { 
     
    586588    sequence_terminal->parent->resize_requested_by_child(); 
    587589 
    588     species_read ++; 
    589590    (*y) += height_terminal + height_spacer; 
    590591 
  • branches/stable_5.0/EDIT4/ed4_class.hxx

    r5894 r6358  
    19661966void ED4_selected_SAI_changed_cb     (AW_root *aw_root); 
    19671967 
     1968void ED4_init_notFoundMessage(); 
     1969void ED4_finish_and_show_notFoundMessage(); 
     1970 
    19681971extern int  ED4_elements_in_species_container; // # of elements in species container 
    19691972void        ED4_undo_redo               (AW_window*, AW_CL undo_type); 
  • branches/stable_5.0/EDIT4/ed4_defs.hxx

    r5901 r6358  
    3838extern int SEQ_TERM_TEXT_YOFFSET; 
    3939 
    40 extern int            MAXSEQUENCECHARACTERLENGTH; // greatest # of characters in a sequence string terminal 
    41 extern int            MAXSPECIESWIDTH; 
    42 extern int            MAXINFOWIDTH; 
    43 extern long           ED4_counter; 
    44 extern long           all_found; // nr of species which haven't been found 
    45 extern long           species_read; // nr of species read; important during loading 
    46 extern GBS_strstruct *not_found_message; 
    47 extern long           max_seq_terminal_length; // global maximum of sequence terminal length 
    48 extern ED4_EDITMODI   awar_edit_modus; 
    49 extern long           awar_edit_direction; 
    50 extern bool           move_cursor; //only needed for editing in consensus 
    51 extern bool           DRAW; 
    52 extern bool           last_window_reached; //only needed for refreshing all windows 
     40extern int  MAXSEQUENCECHARACTERLENGTH;             // greatest # of characters in a sequence string terminal 
     41extern int  MAXSPECIESWIDTH; 
     42extern int  MAXINFOWIDTH; 
     43extern long ED4_counter; 
     44 
     45// use ED4_init_notFoundMessage and ED4_finish_and_show_notFoundMessage to 
     46// modify the following elements 
     47#define MAX_SHOWN_MISSING_SPECIES 200U              // limit no of missing species/data printed into not_found_message 
     48extern size_t         not_found_counter;            // nr of species which haven't been found 
     49extern GBS_strstruct *not_found_message;            // error message containing (some) missing/unloadable species 
     50 
     51extern long         max_seq_terminal_length;        // global maximum of sequence terminal length 
     52extern ED4_EDITMODI awar_edit_modus; 
     53extern long         awar_edit_direction; 
     54extern bool         move_cursor;                    //only needed for editing in consensus 
     55extern bool         DRAW; 
     56extern bool         last_window_reached;            //only needed for refreshing all windows 
    5357 
    5458extern size_t status_count_total; // used for consensus progress bar 
  • branches/stable_5.0/NTREE/NT_edconf.cxx

    r6287 r6358  
    399399    GBDATA         *gb_configuration = GBT_find_configuration(GLOBAL_gb_main,cn); 
    400400    if (!gb_configuration){ 
    401         aw_message(GBS_global_string("Configuration '%s' not found in the database",cn)); 
     401        aw_message(GBS_global_string("Configuration '%s' not found in the database", cn)); 
    402402    } 
    403403    else { 
    404         GBDATA *gb_middle_area = GB_search(gb_configuration,"middle_area",GB_STRING); 
    405         char *md = 0; 
    406         if (gb_middle_area){ 
     404        GBDATA *gb_middle_area  = GB_search(gb_configuration,"middle_area",GB_STRING); 
     405        char   *md              = 0; 
     406        size_t  unknown_species = 0; 
     407 
     408        if (gb_middle_area) { 
    407409            extractType ext_type = extractType(cl_extractType); 
    408410 
     
    455457                        GB_write_flag(gb_species,mark); 
    456458                    } 
     459                    else { 
     460                        unknown_species++; 
     461                    } 
    457462                } 
    458463            } 
     
    460465            GBS_free_hash(was_marked); 
    461466        } 
     467 
     468        if (unknown_species>0) { 
     469            aw_message(GBS_global_string("configuration '%s' contains %zu unknown species", cn, unknown_species)); 
     470        } 
     471 
    462472        free(md); 
    463473    }