24 setWindowTitle( tr(
"Select Run ID for vHW Distributions (%1)" )
25 .arg(
sel_db ?
"DB" :
"Local" ) );
27 setMinimumSize( 480, 300 );
31 QVBoxLayout*
main =
new QVBoxLayout(
this );
32 main->setContentsMargins( 2, 2, 2, 2 );
33 main->setSpacing ( 2 );
36 QGridLayout* top =
new QGridLayout;
47 QLabel* lb_filtdata =
us_label( tr(
"Search" ) );
55 connect(
le_dfilter, SIGNAL( textChanged(
const QString& ) ),
56 SLOT (
search (
const QString& ) ) );
60 top->addWidget(
pb_invest, row, 0, 1, 1 );
61 top->addWidget(
le_invest, row++, 1, 1, 2 );
62 top->addWidget( lb_filtdata, row, 0, 1, 1 );
65 main->addLayout( top );
70 lw_data =
new QListWidget(
this );
71 lw_data->setFrameStyle ( QFrame::NoFrame );
74 lw_data->setSelectionMode( QAbstractItemView::ExtendedSelection );
76 connect(
lw_data, SIGNAL( itemSelectionChanged() ),
82 QHBoxLayout* buttons =
new QHBoxLayout;
87 connect( pb_cancel, SIGNAL( clicked() ), SLOT(
cancelled() ) );
88 connect( pb_accept, SIGNAL( clicked() ), SLOT(
accepted() ) );
90 buttons->addWidget( pb_cancel );
91 buttons->addWidget( pb_accept );
93 main->addLayout( buttons );
96 QFontMetrics fm( font );
97 int fhigh = fm.lineSpacing();
98 int fwide = fm.width( QChar(
'6' ) );
99 int lhigh = fhigh * 3 + 12;
100 int lwide = fwide * 32;
116 lw_data->setCurrentItem( NULL );
118 for (
int ii = 0; ii <
lw_data->count(); ii++ )
120 QListWidgetItem* lwi =
lw_data->item( ii );
121 bool hide = ! lwi->text().contains( search_string, Qt::CaseInsensitive );
122 lwi->setHidden( hide );
144 QString clabel = tr(
"No data found." );
145 lw_data->addItem(
new QListWidgetItem( clabel ) );
150 for (
int ii = 0; ii <
rlabels.size(); ii++ )
152 QString clabel =
rlabels.at( ii );
154 lw_data->addItem(
new QListWidgetItem( clabel ) );
160 tr(
"The list derives from %1 scanned run IDs.\n"
161 "Of these, %2 have associated vHW distribution data.\n"
162 "%3 runs are currently selected for combination plot components." )
176 DbgLv(1) <<
"SE:accepted()";
177 QList< QListWidgetItem* > selitems =
lw_data->selectedItems();
179 if ( selitems.size() == 0 )
181 QMessageBox::information(
this,
182 tr(
"No Data Selected" ),
183 tr(
"You have not selected any data.\nSelect or Cancel" ) );
188 for (
int ii = 0; ii < selitems.size(); ii++ )
190 QListWidgetItem* lwi_data = selitems.at( ii );
191 QString clabel = lwi_data->text();
192 DbgLv(1) <<
"SE: ii clabel" << ii << clabel;
213 QMessageBox::information(
this,
214 tr(
"DB Connection Problem" ),
215 tr(
"There was an error connecting to the database:\n" )
227 query <<
"get_report_desc" << invID;
232 runid = db.value( 4 ).toString();
233 DbgLv(1) <<
"ScDB: report runid" << runid;
235 if ( ! docruns.contains( runid ) )
242 int nreps = docruns.count();
243 DbgLv(1) <<
"ScDB: nreps" << nreps;
244 for (
int ii = 0; ii < nreps; ii++ )
246 runid = docruns[ ii ];
248 freport.
readDB( runid, &db );
249 int ntrip = freport.
triples.count();
250 DbgLv(1) <<
"ScDB: ntrip" << ntrip;
253 for (
int jj = 0; jj < ntrip; jj++ )
256 int ndocs = tripl->
docs.count();
258 for (
int kk = 0; kk < ndocs; kk++ )
263 DbgLv(1) <<
"ScDB: kk fname" << kk << fname;
264 if ( fname.contains(
"distrib.csv" ) )
269 DbgLv(1) <<
"ScDB: ndats" << ndats;
284 QStringList aucdirs = QDir( rdir ).entryList(
285 QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name );
286 DbgLv(1) <<
"ScLo:rdir" << rdir <<
"aucdir count" << aucdirs.count();
288 QStringList aucfilt(
"*.auc" );
294 for (
int ii = 0; ii < aucdirs.count(); ii++ )
296 QString subdir = rdir +
"/" + aucdirs.at( ii );
297 QStringList aucfiles = QDir( subdir ).entryList(
298 aucfilt, QDir::Files, QDir::Name );
299 DbgLv(1) <<
"ScLo: subdir" << subdir <<
"aucfiles count" << aucfiles.count();
301 if ( aucfiles.count() < 1 )
304 QString aucfbase = aucfiles.at( 0 );
305 QString aucfname = subdir +
"/" + aucfbase;
306 QString runID = aucfbase.section(
".", 0, -6 );
307 QString tripl = aucfbase.section(
".", -4, -2 )
312 datfilt <<
"vHW." + tripl +
".*distrib.csv"
313 <<
"vHW." + tripl +
".*envelope.csv";
314 QStringList datfiles = QDir( subdir ).entryList(
315 datfilt, QDir::Files, QDir::Name );
316 DbgLv(1) <<
"ScLo: datfilt0" << datfilt[0];
317 DbgLv(1) <<
"ScLo: datfiles count" << datfiles.count();
319 if ( datfiles.count() < 1 )
335 connect( dialog, SIGNAL( investigator_accepted(
int ) ),
344 QString number = ( ID > 0 ) ? QString::number( ID ) +
": " :
"";
359 setWindowTitle( tr(
"Select Run ID for vHW Distributions (%1)" )
360 .arg(
sel_db ?
"DB" :
"Local" ) );
369 tr(
"The list derives from %1 scanned run IDs.\n"
370 "Of these, %2 have associated vHW distribution data.\n"
371 "%3 %4 currently selected for combination plot components." )
373 .arg(
count_seld > 1 ? tr(
"runs are" ) : tr(
"run is" ) ) );