Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

dnpsearchalgo.cc

Go to the documentation of this file.
00001 #include "dnpsearchalgo.h"
00002 #include <qinputdialog.h>
00003 #include <limits>
00004 
00005 using namespace std;
00006 
00007 void DnpSearchAlgo::start()
00008 {
00009   bool ok;
00010   int res = QInputDialog::getInteger(
00011                                      "Search DNP ID", "Enter ID:", 0, 0, numeric_limits<int>::max(), 1,
00012                                      &ok, 0 );
00013   
00014   if ( ok ) {
00015     // user entered something and pressed OK
00016     for( size_t i = 0; i < getMAl()->get_num_seq(); i++ ) {
00017       bool found(false);
00018       for( size_t j = 0; j < getMAl()->get_len(i); j++ ) {
00019         if ( getMAl()->is_DNP( i, j ) && getMAl()->get_DNP_ID(i, j) == res ) {
00020           found = true;
00021           break;
00022         }
00023       }
00024       if ( !found )
00025         getMAl()->select_read(i, false);
00026     }
00027     
00028   } else {
00029     // user pressed Cancel
00030     return;
00031   }
00032   
00033 }

Generated on Fri Mar 17 17:44:24 2006 for trapper by  doxygen 1.4.4