FilterDialog::FilterDialog( QWidget *parent ) : QDialog( parent ) { ui.setupUi( this ); ui.originalLabel->setPixmap( QPixmap( "source.jpeg" ) ); connect( ui.filterList, SIGNAL(currentTextChanged(QString)), this, SLOT(filterChanged(QString)) ); findFilters(); filterChanged( QString() ); }
glob_t * io_loadEv(defs *d) { // If data is loaded free it up if (d->nfiles != 0) { tffree(d->files, d->nfiles); d->files = NULL; d->nfiles = 0; d->has3 = 0; } // Prepare the pathname for the current event char *path = d->glb->gl_pathv[d->currentdir]; // Prepare a new glob glob_t *glb = filelist(path, getConfigAsString(config, NAME_Z, DEFAULT_Z)); glob_t *glbt =filelist(path, getConfigAsString(config, NAME_T, DEFAULT_T)); // Set HAS to 0 d->has = findHas(glb); // Load the Z components int nfiles = 0; tf *files = io_loadZ(glb, &nfiles); if (getConfigAsBoolean(config, NAME_LOAD, DEFAULT_LOAD)) { // Load N components glob_t *glbn = filelist(path, getConfigAsString(config, NAME_N, DEFAULT_N)); io_loadN(glbn, files, nfiles); killGlob(glbn); // Load E glob_t *glbe = filelist(path, getConfigAsString(config, NAME_E, DEFAULT_E)); io_loadE(glbe, files, nfiles); killGlob(glbe); // Load R components glob_t *glbr = filelist(path, getConfigAsString(config, NAME_R, DEFAULT_R)); io_loadR(glbr, files, nfiles); killGlob(glbr); // Load T glob_t *glbt = filelist(path, getConfigAsString(config, NAME_T, DEFAULT_T)); io_loadT(glbt, files, nfiles); d->has3 = 1; } // Find the filters in use for this event if (getConfigAsNumber(config, NAME_PICK, DEFAULT_PICK) == P) d->filter = findFilters(glb, &d->lp, &d->hp); else if (getConfigAsNumber(config, NAME_PICK, DEFAULT_PICK) == S) d->filter = findFilters(glbt, &d->lp, &d->hp); else { sprintf(message, " filters used couldn't be loaded "); alert(WARNING); } //kill globs killGlob(glb); killGlob(glbt); // Check the files if (nfiles != 0) { // Check that we have picks checkTREF(files, nfiles); // Sort the files qsort(files, nfiles, sizeof(tf), sortDist); // Synch Time synch(files, nfiles); } // Set Aligmenmode d->alig = (d->has) ? ALIGF : ALIGA; // Set the filterneed if needed if (d->filter) d->needfilter = 1; // Set offset to 0 d->offset = 0; // Prepare to return d->files = files; d->nfiles = nfiles; // Adjust the curent pointer io_AdjustCurrent(d); // Done return NULL; }