[us-commits] r2838 - in trunk: gui utils

svn at svn.aucsolutions.com svn at svn.aucsolutions.com
Mon Oct 21 15:42:28 MDT 2019


Author: gegorbet
Date: 2019-10-21 21:42:28 +0000 (Mon, 21 Oct 2019)
New Revision: 2838

Modified:
   trunk/gui/us_model_loader.cpp
   trunk/utils/us_xpn_data.cpp
Log:
modify Load Model regexp type for search

Modified: trunk/gui/us_model_loader.cpp
===================================================================
--- trunk/gui/us_model_loader.cpp	2019-09-26 17:52:45 UTC (rev 2837)
+++ trunk/gui/us_model_loader.cpp	2019-10-21 21:42:28 UTC (rev 2838)
@@ -210,6 +210,8 @@
 
    // Trigger models list from db or disk source
    select_diskdb();
+
+   resize( 700, 500 );
 }
 
 // Load model data by index
@@ -354,10 +356,19 @@
    bool listedit = do_edit || do_run;        // edit filtered?
    bool listsing = do_single;                // show singles of MC groups?
    bool listall  = !listdesc;                // unfiltered by description?
-   QRegExp mpart = QRegExp( ".*" + mfilt + ".*", Qt::CaseInsensitive );
+   QString mflt1 = mfilt;
+   if ( ! mfilt.isEmpty() )
+   {
+      if ( !mfilt.startsWith( "*" ) )
+         mflt1         = "*" + mflt1;
+      if ( !mfilt.endsWith( "*" ) )
+         mflt1         = mflt1 + "*";
+   }
+
+   QRegExp mpart = QRegExp( mflt1, Qt::CaseInsensitive, QRegExp::WildcardUnix );
    model_descriptions.clear();               // clear model descriptions
 qDebug() << "LM: desc single edit" << listdesc << listsing << listedit
- << "editGUID" << editGUID << "nruns" << runIDs.size();
+ << "editGUID" << editGUID << "nruns" << runIDs.size() << "mflt1" << mflt1;
    int kmmnew    = 0;
    int kmmold    = 0;
    int kmmmod    = 0;
@@ -751,7 +762,9 @@
    {  // Filter by model description sub-string
       for ( int jj = 0; jj < model_descrs_ufilt.size(); jj++ )
       {
-         if ( model_descrs_ufilt[ jj ].description.contains( mpart ) )
+         mdesc     = model_descrs_ufilt[ jj ].description;
+         lmdesc    = alt_description( mdesc, true );
+         if ( lmdesc.contains( mpart ) )
          {  // description filter matches
             model_descriptions << model_descrs_ufilt[ jj ];
 //ModelDesc desc = model_descrs_recs[jj];
@@ -796,12 +809,12 @@
 
    singprev   = listsing;    // save list-singles flag
 
+#if 0
    // Resize the widget to show listed items well
    QFontMetrics fm = lw_models->fontMetrics();
    int olwid    = lw_models->width();
    int olhgt    = lw_models->height();
    int nlines   = qMin( model_descriptions.size(), 30 );
-#if 0
    int width    = qMin( 600, maxlch * fm.maxWidth()    );
    int height   = qMin( 800, nlines * fm.lineSpacing() );
 qDebug() << "LM: olwid olhgt" << olwid << olhgt << "width height" << width << height;
@@ -809,8 +822,6 @@
    height       = ( height > olhgt ) ? height : ( ( olhgt + height ) / 2 );
    width        = this->width()  + width  - olwid;
    height       = this->height() + height - olhgt;
-#endif
-#if 1
    int width    = fm.width( strmx );
    int height   = nlines * fm.lineSpacing();
 qDebug() << "LM: olwid olhgt" << olwid << olhgt << "width height" << width << height;
@@ -819,12 +830,12 @@
 qDebug() << "LM: nlines maxlch" << nlines << maxlch << "width height" << width << height;
    width        = qMin( width,  qApp->desktop()->width()  - 100 );
    height       = qMin( height, qApp->desktop()->height() - 100 );
-#endif
 qDebug() << "LM: width height" << width << height;
 
    resize( width, height );
 qDebug() << "LM:  sized:" << size();
    //adjustSize();
+#endif
 
    connect( le_mfilter,    SIGNAL( textChanged( const QString& ) ),
             this,          SLOT(   msearch(     const QString& ) ) );

Modified: trunk/utils/us_xpn_data.cpp
===================================================================
--- trunk/utils/us_xpn_data.cpp	2019-09-26 17:52:45 UTC (rev 2837)
+++ trunk/utils/us_xpn_data.cpp	2019-10-21 21:42:28 UTC (rev 2838)
@@ -314,7 +314,11 @@
       // Skip any runs with no associated scan table entries
       if ( ! ( exprow.abscnf || exprow.flscnf ||
                exprow.inscnf || exprow.wlscnf ) )
+      {
+DbgLv(1) << "XpDa: NO AFIW:  run exp" << exprow.runId << exprow.expId
+ << "expname resname" << exprow.expname << exprow.resname;
          continue;
+      }
 
       // Save experiment row
       tExprun << exprow;



More information about the us-commits mailing list