50 const char *ieport()
const {
return type ==
FT_IMPORT ?
"import" :
"export"; }
51 const char *get_suffix()
const {
return type ==
FT_IMPORT ?
"ift" :
"eft"; }
53 const char *get_selected_filter()
const {
return awar_filtername->
read_char_pntr(); }
55 char *user_filter_fullname(
const char *name) {
66 char *fullTargetName = user_filter_fullname(targetName);
67 const char *fullSourceName = get_selected_filter();
69 if (strcmp(fullSourceName, fullTargetName) == 0) {
70 error =
"source and destination are the same";
72 else if (action ==
RENAME) {
86 return tester->nameEntered_handler(action, targetName);
90 Action[0] = toupper(Action[0]);
99 AWT_activate_prompt(title, prompt, nameOnly, Action, makeResultHandler(nameEntered_wrapper, action,
this));
111 awar_filtername = aws->
get_root()->
awar(get_awarname());
118 char *filter_name = awar_filtername->
read_string();
124 handle_copyRename(action);
128 if (action ==
EDIT) {
130 aw_message(
"The filter is write-protected (use COPY to create a local copy)");
136 else if (action ==
DELETE) {
187 FILE *in = fopen(filename,
"rt");
194 view.
ncat(line.c_str(), line.size());
207 #define TESTER_AWAR_PREFIX "tmp/tester/"
208 #define AWAR_TESTER_LINK_EX2IMPORT TESTER_AWAR_PREFIX "link"
209 #define AWAR_TESTER_EXPORT_RESULT TESTER_AWAR_PREFIX "result"
210 #define AWAR_TESTER_IMPORT_FILENAME TESTER_AWAR_PREFIX "filename"
211 #define AWAR_TESTER_IMPORT_STATUS TESTER_AWAR_PREFIX "status"
212 #define AWAR_TESTER_IMPORT_SPECIES TESTER_AWAR_PREFIX "species"
255 char *real_outname =
NULp;
262 filter, cut_stop_codon, compress,
263 db_name, formname, ftsname,
264 outname, 0, &real_outname);
284 free(selected_species);
300 if (awar_ifilename) {
301 awar_ifilename->
touch();
312 species_sellist(
NULp),
314 gb_main_lastImport(
NULp)
318 if (gb_main_lastImport) {
324 if (gb_main_lastImport) {
326 gb_main_lastImport =
NULp;
328 species_sellist->
clear();
330 species_sellist->
update();
333 gb_main_lastImport = gb_new_main;
345 species_sellist->
insert(name, name);
348 species_sellist->
insert(
"<unnamed species>",
"");
352 species_sellist->
update();
371 for (
int p = 0; seq[p]; ++p) {
372 dataCount += !!isalpha(seq[p]);
393 bool touch_selected =
true;
403 long speciesCount, dataCount;
414 char *previously_selected = awar_selected->
read_string();
419 touch_selected =
false;
422 free(previously_selected);
425 if (touch_selected) awar_selected->
touch();
443 if (species_name[0]) {
465 static AW_window_simple *aws =
NULp;
473 aws =
new AW_window_simple;
474 aws->init(awr,
"ARB_IMPORT_TEST",
"Test import filter");
475 aws->load_xfig(
"awt/import_test.fig");
479 tester->create_common_gui(
"import_test.hlp");
511 static AW_window_simple *aws =
NULp;
519 aws =
new AW_window_simple;
520 aws->init(awr,
"ARB_EXPORT_TEST",
"Test export filter");
521 aws->load_xfig(
"awt/export_test.fig");
525 tester->create_common_gui(
"export_test.hlp");
527 aws->label(
"Link to import");
static void import_file_changed_cb(const char *, ChangeReason, ImportTestData *tdata)
static void exportImportLinkChanged_cb(AW_root *awr, GBDATA *gb_main, adfiltercbstruct *acbs)
GB_CSTR GB_path_in_arbprop(const char *relative_path)
GB_ERROR GB_safe_copy_file(const char *oldpath, const char *newpath)
static void neverCalledDummy_cb(AW_root *)
#define AWAR_IMPORT_FORMATNAME
bool getLine(string &line)
void insert_default(const char *displayed, const AW_scalar &value)
void AW_edit(const char *path)
GB_ERROR import_data(AW_root *awr, const char *mask, bool keep_found_IDs)
static bool test_import_active
void GB_unlink_or_warn(const char *path, GB_ERROR *error)
void setNewImport(GBDATA *gb_new_main)
#define AWAR_EXPORT_COMPRESS
GBDATA * gb_main_lastImport
static void action_cb_wrapper(AW_window *, FormatTester *const tester, FormatAction action)
static ArbImporter * importer
GB_ERROR GB_IO_error(const char *action, const char *filename)
char * ARB_strdup(const char *str)
static void rerun_importTest_cb(AW_root *awr, ImportTestData *tdata)
const char * GBS_global_string(const char *templat,...)
void AW_POPDOWN(AW_window *window)
SmartPtr< FormatTester > FormatTesterPtr
int GB_unlink(const char *path)
static void disable_test_import(AW_window *)
#define AWAR_TESTER_IMPORT_SPECIES
static void create_tester_awars(AW_root *awr)
AW_awar * add_callback(const RootCallback &cb)
void insert(const char *displayed, const AW_scalar &value)
GB_ERROR GB_safe_rename_file(const char *oldpath, const char *newpath)
const char * read_char_pntr() const
static void update_exportTest_result_cb(AW_root *awr, GBDATA *gb_main, adfiltercbstruct *acbs)
GB_ERROR GB_await_error()
static GBDATA * get_selected_imported_species(GBDATA *gb_main, AW_root *aw_root)
static AW_root * SINGLETON
void countSpeciesAndData(const char *aliName, long &speciesCount, long &dataCount)
WindowCallback makeHelpCallback(const char *helpfile)
char * GB_create_tempfile(const char *name)
const char * change_key_path
GBDATA *(* get_selected_item)(GBDATA *gb_main, AW_root *aw_root)
const char * GBS_readable_size(unsigned long long size, const char *unit_suffix)
static void error(const char *msg)
static void disable_test_export(AW_window *aww)
GB_ERROR export_by_format(GBDATA *gb_main, ExportWhich which, const char *one_species, AP_filter *filter, int cut_stop_codon, int compress, const char *dbname, const char *formname, const char *field_transfer_set, const char *outname, int multiple, char **real_outname)
#define AWAR_SPECIES_NAME
#define AWAR_EXPORT_FORMATNAME
AW_selection_list * species_sellist
static DbScanner * create(GBDATA *gb_main, const char *scanner_id, AW_window *aws, const char *box_pos_fig, const char *edit_pos_fig, const char *edit_enable_pos_fig, DB_SCANNERMODE scannermode, const char *mark_pos_fig, ItemSelector &selector)
char * read_string() const
static bool test_export_active
AW_awar * awar_no_error(const char *awar)
end timer stuff
AW_awar * awar(const char *awar)
void RemapToDatabase(GBDATA *gb_new_main)
static BasicStatus status
#define AWAR_TESTER_IMPORT_FILENAME
const char * XFER_getFullFTS(const char *name)
GBDATA * GBT_find_sequence(GBDATA *gb_species, const char *aliname)
static const ItemSelector & get_importedSpecies_selector()
bool GB_is_writeablefile(const char *filename)
GB_CSTR GB_append_suffix(const char *name, const char *suffix)
#define AWAR_TESTER_EXPORT_RESULT
AP_filter * awt_get_filter(adfiltercbstruct *acbs)
GB_CSTR GB_concat_path(GB_CSTR anypath_left, GB_CSTR anypath_right)
void ncat(const char *from, size_t count)
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
void auto_space(int xspace, int yspace)
#define awti_assert(cond)
const struct formatTable formname[]
const ItemSelector & get_selector() const
DbScanner * field_scanner
void Map(GBDATA *gb_new_item, const char *key_path)
ItemSelector & SPECIES_get_selector()
GBDATA * GBT_first_species(GBDATA *gb_main)
#define AWAR_TESTER_IMPORT_STATUS
void aw_message(const char *msg)
void AWTI_activate_import_test_window(AW_window *awp)
void GB_split_full_path(const char *fullpath, char **res_dir, char **res_fullname, char **res_name_only, char **res_suffix)
GBDATA * GBT_next_species(GBDATA *gb_species)
bool GB_is_regularfile(const char *path)
GBDATA * GBT_find_species(GBDATA *gb_main, const char *name)
#define AWAR_IMPORT_FILENAME
void AWTI_activate_export_test_window(AW_window *awp, GBDATA *gb_main, adfiltercbstruct *acbs)
GB_ERROR write_string(const char *aw_string)
void refill_species_list()
const char * GBT_get_name(GBDATA *gb_item)
static void remap_scanner_cb(AW_root *awr, ImportTestData *tdata)
GB_transaction ta(gb_var)
void callback(const WindowCallback &cb)
#define AWAR_EXPORT_CUTSTOP
GB_CSTR GB_read_char_pntr(GBDATA *gbd)
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
static char * get_file_content_for_viewer(const char *filename)
static const char * action_name[]
GB_ERROR write_int(long aw_int)
static void update_import_filename_cb(AW_root *awr)
#define AWAR_TESTER_LINK_EX2IMPORT
void remap_scanner(AW_root *awr)
char * GBS_global_string_copy(const char *templat,...)
void GB_close(GBDATA *gbd)
void create_button(const char *macro_name, AW_label label, const char *mnemonic=NULp, const char *color=NULp)
void AWT_activate_prompt(const char *title, const char *prompt, const char *defaultResult, const char *button, const ResultHandler &handle_result, const char *helpfile, const char *srt)