[us-commits] r2822 - in trunk: doc/manual doc/manual/images programs/us_density_match

svn at svn.aucsolutions.com svn at svn.aucsolutions.com
Tue Aug 20 16:09:04 MDT 2019


Author: gegorbet
Date: 2019-08-20 22:09:03 +0000 (Tue, 20 Aug 2019)
New Revision: 2822

Added:
   trunk/doc/manual/dens_match.body
   trunk/doc/manual/dens_match_mparam.body
   trunk/doc/manual/dens_match_rmvmods.body
   trunk/doc/manual/images/densmatch_main.png
   trunk/doc/manual/images/densmatch_mpars_completed.png
   trunk/doc/manual/images/densmatch_mpars_empty.png
   trunk/doc/manual/images/densmatch_rmvmodels.png
Modified:
   trunk/doc/manual/index.body
   trunk/doc/manual/manual.qhp
   trunk/programs/us_density_match/us_density_match.cpp
   trunk/programs/us_density_match/us_density_match.h
   trunk/programs/us_density_match/us_remove_models.h
Log:
density_matching: cleanup unused pars, info after all-model remove, new help files

Added: trunk/doc/manual/dens_match.body
===================================================================
--- trunk/doc/manual/dens_match.body	                        (rev 0)
+++ trunk/doc/manual/dens_match.body	2019-08-20 22:09:03 UTC (rev 2822)
@@ -0,0 +1,145 @@
+[% INCLUDE header.us3/
+   title = 'UltraScan III Density Matching'
+%]
+
+    <h2> <i>UltraScan</i> Density Matching:</h2>
+
+    <p>
+    Density Matching experiments are used to determine the partial specific
+    volume of colloidal particles by repeating the velocity experiment in a 
+    range of buffers with a different density, but identical chemical
+    properties. Here it is important that the ionic strength and pH stay
+    constant. This is most easily accomplished by using D2O (heavy water)
+    which has mostly the same chemical properties as light water. The change
+    in buoyancy incurred when changing the density of the solvent causes a
+    change in sedimentation speed, which can be measured. The change is 
+    proportional to the density of the analyte. Density matching experiments
+    exploit this difference.
+    </p> <p>
+    It is recommended that users of this technique measure sedimentation
+    velocity experiments in 4-6 different D2O concentrations, including one
+    buffer that does not have any D2O in it (just light water). Finite
+    element models from these experiments are imported into this program
+    to elucidate the partial specific volume distribution for the entire
+    solution mixture.
+    </p>
+
+    <h3> Main Window:</h3>
+    <p>
+    <img src="images/densmatch_main.png" alt="Density Matching Main Window"/>
+    </p>
+
+    <h3> Dialog Items:</h3>
+
+    <ul>
+       <li>
+          <b>Database</b>: Select to choose models from the database.
+       </li>
+
+       <li>
+          <b>Local Disk</b>: Select to choose models from files on the
+          local disk.
+       </li>
+
+       <li>
+          <b>(prefilter text)</b>: Brief information about PreFilter
+          selection(s) made.
+       </li>
+
+       <li>
+          <b>Select PreFilter</b>: Open a
+          <a href="select_runs.html">Models Pre-Filter dialog</a>
+          to select Run IDs on which to pre-filter lists of models
+          for loading.
+       </li>
+
+       <li>
+          <b>Load Distribution(s)</b>: Load model distribution data
+          to use in density matching, as specified through a
+          <a href="load_model_distrib.html">Model Loader dialog</a>
+       </li>
+
+       <li>
+          <b>Remove Distribution(s)</b>: Open a
+          <a href="dens_match_rmvmods.html">Remove Models dialog</a>
+          to pare down the list of selected models.
+       </li>
+
+       <li>
+          <b>Refresh Plot</b>: Force a re-plot of the currently selected
+          plot type.
+       </li>
+
+       <li>
+          <b>Reset</b>: Clear PreFilter and Distribution selection data.
+       </li>
+
+       <li>
+          <b>Set Model Parameters</b>: Open a
+          <a href="dens_match_mparam.html">Model Parameters dialog</a>
+          to associate D20_Percent, Density, Label values with each model.
+       </li>
+
+       <li>
+          <b>Save</b>: Generate CSV spreadsheet files and PNG plot files
+          for all plot types and save them locally to a runID subdirectory
+          of the */ultrascan/reports directory.
+       </li>
+
+       <li>
+          <b>Plot X:</b> Select the plot to currently be displayed by
+          selected its X axis:
+          <ul>
+             <li> <b>s</b> Sedimentation coefficient. </li>
+             <li> <b>D</b> Diffusion coefficient. </li>
+             <li> <b>vbar</b> Partial specific density. </li>
+             <li> <b>m.mass</b> Molar Mass. </li>
+             <li> <b>ff0</b> Frictional ratio. </li>
+             <li> <b>Rh</b> Hydrodynamic radius. </li>
+          </ul>
+       </li>
+
+       <li>
+          <b>Diffusion Coefficient Averaging:</b> Select the means of averaging
+          diffusion coefficients at each boundard fraction, across models:
+          <ul>
+             <li> <b>none</b> No averaging (use 0-percent model's value). </li>
+             <li> <b>simple</b> Simple averaging. </li>
+             <li> <b>weighted</b> Weighted averaging, using concentrations. </li>
+          </ul>
+       </li>
+
+       <li>
+          <b>(Distribution Information text box)</b> Information about Run and
+          Model Distributions currently being used.
+       </li>
+
+       <li>
+          <b>Divisions:</b> Set the number of boundary fraction divisions to use.
+       </li>
+
+       <li>
+          <b>% of Boundary:</b> Set the extent in boundary percent over which
+          plot values are computed and plotted.
+       </li>
+
+       <li>
+          <b>Boundary Position (%):</b> Set the starting boundary percent.
+       </li>
+
+       <li>
+          <b>Data Smoothing:</b> Set the number of smoothing points to use
+          in curves displayed.
+       </li>
+
+
+       <li>
+          <b>Help</b> Display this documentation.
+       </li>
+
+       <li>
+          <b>Close</b> Exit the application.
+       </li>
+    </ul>
+
+[% INCLUDE footer.us3 %]


Property changes on: trunk/doc/manual/dens_match.body
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+LastChangedDate Author
\ No newline at end of property
Added: trunk/doc/manual/dens_match_mparam.body
===================================================================
--- trunk/doc/manual/dens_match_mparam.body	                        (rev 0)
+++ trunk/doc/manual/dens_match_mparam.body	2019-08-20 22:09:03 UTC (rev 2822)
@@ -0,0 +1,76 @@
+[% INCLUDE header.us3/
+   title = 'UltraScan III Density Matching Model Parameters'
+%]
+
+    <h2> <i>UltraScan</i> Model Parameters:</h2>
+
+    <p> An option in <b><i>UltraScan III US_Density_Match</i></b>, this dialog
+    allows specifying parameters associated with each model distribution.</p>
+
+    <p> The dialog presents a row for each model selected in the calling
+    Density Matching main window. In each model row, the user may add or
+    change the value for (1) D2O (heavy water) percent; (2) density; or
+    (3) model label. After setting all percent values, the Compute Densities
+    button causes computation of the densities for non-zero-percent models,
+    based on the zero-percent model density value. Once all model values are
+    set, the Accept button closes the dialog and returns the values associated
+    with each model.
+
+    <h3> Dialog Window:</h3>
+
+    <p> Upon entry, the dialog appears as follows.</p>
+    <p>
+    <img src="images/densmatch_mpars_empty.png" alt="Model Parameters empty"/>
+    </p>
+
+    <p> After completion of parameter setting, the dialog will appear
+    similar to this:</p>
+    <p>
+    <img src="images/densmatch_mpars_completed.png" alt="Model Parameters completed"/>
+    </p>
+
+    <h3> Dialog Items:</h3>
+
+    <ul>
+       <li>
+          <b>(D2O Percent column)</b>: Text boxes allow setting D2O percent values
+          for each model.
+       </li>
+
+       <li>
+          <b>(Density (g/l) column)</b>: Text boxes allow setting density values in grams
+          per liter for each model. Initial values are computed and often need not
+          be manually changed by the user.
+       </li>
+
+       <li>
+          <b>(Label column)</b>: Text boxes allow setting labels for each model that
+          are used in the Legend of each plot.
+       </li>
+
+       <li>
+          <b>(Description column)</b>: Read-only text boxes display the description text
+          associated with  each model.
+       </li>
+
+       <li>
+          <b>Help</b>: Display this documentation.
+       </li>
+
+       <li>
+          <b>Cancel</b>: Exit this dialog without returning parameter values
+          to the caller.
+       </li>
+
+       <li>
+          <b>Accept</b>: Exit this dialog and return parameter values
+          to the caller.
+       </li>
+
+       <li>
+          <b>Compute Densities</b>: Compute densities values for all models with
+          non-zero D2O percent values .
+       </li>
+    </ul>
+
+[% INCLUDE footer.us3 %]


Property changes on: trunk/doc/manual/dens_match_mparam.body
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+LastChangedDate Author
\ No newline at end of property
Added: trunk/doc/manual/dens_match_rmvmods.body
===================================================================
--- trunk/doc/manual/dens_match_rmvmods.body	                        (rev 0)
+++ trunk/doc/manual/dens_match_rmvmods.body	2019-08-20 22:09:03 UTC (rev 2822)
@@ -0,0 +1,52 @@
+[% INCLUDE header.us3/
+   title = 'UltraScan III Density Matching Remove Models'
+%]
+
+    <h2> <i>UltraScan</i> Density Matching Remove Models:</h2>
+
+    <p> An option in <b><i>UltraScan III US_Density_Match</i></b>,
+    this dialog allows the removal of previously selected model
+    distributions.</p>
+
+    <p> The dialog presents a list of models to be used in density
+    matching. One or more items in the list may be selected and a
+    Remove button clicked to pare down the list.</p>
+
+    <h3> Main Window:</h3>
+
+    <img src="images/densmatch_rmvmodels.png" alt="Remove Models Dialog"/>
+
+    <h3> Dialog Items:</h3>
+
+    <ul>
+       <li>
+          <b>(List of Model Distributions)</b> Select one or more of the
+          items in the list.
+       </li>
+
+       <li>
+          <b>Remove</b> Click this button to remove selected models.
+       </li>
+
+       <li>
+          <b>Restore</b> Click this button to restore the models list
+          to its original contents.
+       </li>
+
+       <li>
+          <b>Help</b> Click this button to display this help dialog.
+       </li>
+
+       <li>
+          <b>Cancel</b> Click this button to cancel the dialog and
+          leave the list of models in the same state as it was upon
+          entry.
+       </li>
+
+       <li>
+          <b>Accept</b> Exit this dialog and return with a modified
+          list of models.
+       </li>
+    </ul>
+
+[% INCLUDE footer.us3 %]


Property changes on: trunk/doc/manual/dens_match_rmvmods.body
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+LastChangedDate Author
\ No newline at end of property
Added: trunk/doc/manual/images/densmatch_main.png
===================================================================
(Binary files differ)

Index: trunk/doc/manual/images/densmatch_main.png
===================================================================
--- trunk/doc/manual/images/densmatch_main.png	2019-08-18 15:32:32 UTC (rev 2821)
+++ trunk/doc/manual/images/densmatch_main.png	2019-08-20 22:09:03 UTC (rev 2822)

Property changes on: trunk/doc/manual/images/densmatch_main.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: trunk/doc/manual/images/densmatch_mpars_completed.png
===================================================================
(Binary files differ)

Index: trunk/doc/manual/images/densmatch_mpars_completed.png
===================================================================
--- trunk/doc/manual/images/densmatch_mpars_completed.png	2019-08-18 15:32:32 UTC (rev 2821)
+++ trunk/doc/manual/images/densmatch_mpars_completed.png	2019-08-20 22:09:03 UTC (rev 2822)

Property changes on: trunk/doc/manual/images/densmatch_mpars_completed.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: trunk/doc/manual/images/densmatch_mpars_empty.png
===================================================================
(Binary files differ)

Index: trunk/doc/manual/images/densmatch_mpars_empty.png
===================================================================
--- trunk/doc/manual/images/densmatch_mpars_empty.png	2019-08-18 15:32:32 UTC (rev 2821)
+++ trunk/doc/manual/images/densmatch_mpars_empty.png	2019-08-20 22:09:03 UTC (rev 2822)

Property changes on: trunk/doc/manual/images/densmatch_mpars_empty.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: trunk/doc/manual/images/densmatch_rmvmodels.png
===================================================================
(Binary files differ)

Index: trunk/doc/manual/images/densmatch_rmvmodels.png
===================================================================
--- trunk/doc/manual/images/densmatch_rmvmodels.png	2019-08-18 15:32:32 UTC (rev 2821)
+++ trunk/doc/manual/images/densmatch_rmvmodels.png	2019-08-20 22:09:03 UTC (rev 2822)

Property changes on: trunk/doc/manual/images/densmatch_rmvmodels.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Modified: trunk/doc/manual/index.body
===================================================================
--- trunk/doc/manual/index.body	2019-08-18 15:32:32 UTC (rev 2821)
+++ trunk/doc/manual/index.body	2019-08-20 22:09:03 UTC (rev 2822)
@@ -75,6 +75,7 @@
       <li> <a href="combine_models.html">Create Global Model</a> </li>
       <li> <a href="mwlr_viewer.html">Multi-Wavelength Raw Viewer</a> </li>
       <li> <a href="cfa_viewer.html">CFA Raw Viewer and Converter</a> </li>
+      <li> <a href="dens_match.html">Density Matching</a> </li>
     </ul>
   </li>
   

Modified: trunk/doc/manual/manual.qhp
===================================================================
--- trunk/doc/manual/manual.qhp	2019-08-18 15:32:32 UTC (rev 2821)
+++ trunk/doc/manual/manual.qhp	2019-08-20 22:09:03 UTC (rev 2822)
@@ -39,6 +39,7 @@
             <keyword id="c5" name="create-experiment" ref="experiment_general.html"/>
             <keyword id="d1" name="data-loader"      ref="data_loader.html"/>
             <keyword id="d2" name="ddist-combine"    ref="ddist_combine.html"/>
+            <keyword id="d3" name="density-match"    ref="dens_match.html"/>
             <keyword id="e1" name="edit"             ref="us_edit.html"/>
             <keyword id="e2" name="equiltime"        ref="us_equiltime.html"/>
             <keyword id="e3" name="experiment"       ref="convert-experiment.html"/>
@@ -262,17 +263,17 @@
             <file>images/astfem_sim.png</file>
             <file>images/simparams.png</file>
 
-				<file>grid_editor.html</file>
-				<file>images/grid_editor.png</file>
-				<file>images/grid_editor_mw_view.png</file>
-				<file>images/grid_editor_multi_grids.png</file>
-				<file>images/grid_editor_multi_grids_sed.png</file>
-				<file>images/grid_editor_subgrid1-good.png</file>
-				<file>images/grid_editor_subgrid1-bad.png</file>
-				<file>images/grid_editor_subgrid2-good.png</file>
-				<file>images/grid_editor_subgrid2-bad.png</file>
-				<file>images/grid_editor_subgrid3-good.png</file>
-				<file>images/grid_editor_subgrid3-bad.png</file>
+            <file>grid_editor.html</file>
+            <file>images/grid_editor.png</file>
+            <file>images/grid_editor_mw_view.png</file>
+            <file>images/grid_editor_multi_grids.png</file>
+            <file>images/grid_editor_multi_grids_sed.png</file>
+            <file>images/grid_editor_subgrid1-good.png</file>
+            <file>images/grid_editor_subgrid1-bad.png</file>
+            <file>images/grid_editor_subgrid2-good.png</file>
+            <file>images/grid_editor_subgrid2-bad.png</file>
+            <file>images/grid_editor_subgrid3-good.png</file>
+            <file>images/grid_editor_subgrid3-bad.png</file>
 
             <file>2dsa.html</file>
             <file>2dsa_analys.html</file>
@@ -399,6 +400,14 @@
             <file>images/cfa_view-loadraw.png</file>
             <file>images/cfa_view-loadauc.png</file>
 
+            <file>dens_match.html</file>
+            <file>dens_match_mparam.html</file>
+            <file>dens_match_rmvmods.html</file>
+            <file>images/densmatch_main.png</file>
+            <file>images/densmatch_mpars_empty.png</file>
+            <file>images/densmatch_mpars_completed.png</file>
+            <file>images/densmatch_rmvmodels.png</file>
+
             <file>2dsa_3dplot.img.html</file>
             <file>2dsa_resplot.img.html</file>
             <file>analyte_details.img.html</file>

Modified: trunk/programs/us_density_match/us_density_match.cpp
===================================================================
--- trunk/programs/us_density_match/us_density_match.cpp	2019-08-18 15:32:32 UTC (rev 2821)
+++ trunk/programs/us_density_match/us_density_match.cpp	2019-08-20 22:09:03 UTC (rev 2822)
@@ -67,9 +67,6 @@
    // Top banner
    QLabel* lb_info1      = us_banner( tr( "Model Selection Controls" ) );
 
-//   us_checkbox( tr( "Save Plot(s)"    ), ck_savepl,  false );
-//   us_checkbox( tr( "Local Save Only" ), ck_locsave, true  );
-
    // Distribution information text box
    te_distr_info = us_textedit();
    te_distr_info->setText( tr( "Run:  runID.triple (method)\n" )
@@ -190,8 +187,6 @@
    spec->addLayout( gl_x_mass,     s_row,   2, 1, 2 );
    spec->addLayout( gl_x_ff0,      s_row,   4, 1, 2 );
    spec->addLayout( gl_x_rh,       s_row++, 6, 1, 2 );
-//   spec->addWidget( ck_savepl,     s_row,   0, 1, 4 );
-//   spec->addWidget( ck_locsave,    s_row++, 4, 1, 4 );
    spec->addWidget( lb_di_avg,     s_row++, 0, 1, 8 );
    spec->addLayout( gl_da_n,       s_row,   2, 1, 2 );
    spec->addLayout( gl_da_s,       s_row,   4, 1, 2 );
@@ -213,7 +208,6 @@
    ct_smoothing    = us_counter( 2, 1, 100, 1 );
 
    ct_division   ->setSingleStep( 1 );
-//   ct_division->setEnabled( true );
    ct_boundaryPct->setSingleStep( 1 );
    ct_boundaryPos->setSingleStep( 1 );
    ct_smoothing  ->setSingleStep( 1 );
@@ -284,8 +278,6 @@
    dataPlotClear( data_plot );
    data_plot->replot();
  
-   need_save  = false;
-
    plot_x     = ATTR_V;
 
    alldis  .clear();
@@ -408,62 +400,6 @@
    QVector< QVector< double > >  v_sedcs;
    QVector< QVector< double > >  v_difcs;
 #endif
-#if 0
-   //QString dtext = te_distr_info->toPlainText().section( "\n", 0, 1 );
-   QString dtext  = tr( "Run:  " ) + tsys->run_name
-         + " (" + tsys->method + ")\n    " + tsys->analys_name;
-
-   bool sv_plot = ck_savepl->isChecked();
-DbgLv(2) << "(1) sv_plot" << sv_plot;
-
-DbgLv(2) << "(3)   need_save sv_plot" << need_save << sv_plot;
-   //if ( need_save  &&  sv_plot )
-   if ( sv_plot )
-   {  // Automatically save plot image in a PNG file
-      const QString s_attrs[] = { "s", "ff0", "MW", "vbar", "D", "f" };
-      QPixmap plotmap = ((QWidget*)data_plot)->grab();
-
-      QString runid   = tsys->run_name.section( ".",  0, -2 );
-      QString triple  = tsys->run_name.section( ".", -1, -1 );
-      QString report  = QString( "pseudo3d_" ) + s_attrs[ plot_x ]
-         + "_" + s_attrs[ ATTR_F ];
-
-      QString ofdir   = US_Settings::reportDir() + "/" + runid;
-      QDir dirof( ofdir );
-      if ( !dirof.exists( ) )
-         QDir( US_Settings::reportDir() ).mkdir( runid );
-      QString ofname = tsys->method + "." + triple + "." + report + ".png";
-      QString ofpath = ofdir + "/" + ofname;
-
-      plotmap.save( ofpath );
-      dtext          = dtext + tr( "\nPLOT %1 SAVED to local" )
-         .arg( curr_distr + 1 );
-
-      if ( dkdb_cntrls->db()  &&  !ck_locsave->isChecked() )
-      {  // Save a copy to the database
-QDateTime time0=QDateTime::currentDateTime();
-         US_Passwd   pw;
-         US_DB2      db( pw.getPasswd() );
-         QStringList query;
-         query << "get_editID" << tsys->editGUID;
-         db.query( query );
-         db.next();
-         int         idEdit   = db.value( 0 ).toString().toInt();
-         US_Report   freport;
-         freport.runID        = runid;
-         freport.saveDocumentFromFile( ofdir, ofname, &db, idEdit );
-QDateTime time1=QDateTime::currentDateTime();
-qDebug() << "DB-save: currdist" << curr_distr
- << "svtime:" << time0.msecsTo(time1);
-         dtext          = dtext + tr( " and DB" );
-      }
-   }
-
-   else
-      dtext          = dtext + tr( "\n(no plot saved)" );
-
-   te_distr_info->setText( dtext );
-#endif
 }
 
 // Plot the data
@@ -479,23 +415,6 @@
 DbgLv(1) << "DaPl: plot_x" << plot_x;
 
 #if 0
-auto_sxy=true;
-   if ( auto_sxy )
-   { // Auto scale x and y
-      data_plot->setAxisAutoScale( QwtPlot::yLeft   );
-      data_plot->setAxisAutoScale( QwtPlot::xBottom );
-   }
-   else
-   { // Manual limits on x and y
-      double lStep = data_plot->axisStepSize( QwtPlot::yLeft   );
-      double bStep = data_plot->axisStepSize( QwtPlot::xBottom );
-      data_plot->setAxisScale( QwtPlot::xBottom, plt_smin, plt_smax, bStep );
-      data_plot->setAxisScale( QwtPlot::yLeft,   plt_kmin, plt_kmax, lStep );
-   }
-#endif
-
-
-#if 0
    QVector< double >             v_bfracs;
    QVector< double >             v_vbars;
    QVector< double >             v_mmass;
@@ -642,67 +561,6 @@
    plot_x         = plot_x_select();
 }
 
-void US_Density_Match::update_resolu( double dval )
-{
-   resolu = dval;
-}
-
-void US_Density_Match::update_xreso( double dval )
-{
-   xreso  = dval;
-}
-
-void US_Density_Match::update_yreso( double dval )
-{
-   yreso  = dval;
-}
-
-void US_Density_Match::update_curr_distr( double dval )
-{
-   curr_distr   = qRound( dval ) - 1;
-DbgLv(1) << "upd_curr_distr" << curr_distr;
-}
-
-void US_Density_Match::update_plot_smin( double dval )
-{
-   plt_smin = dval;
-DbgLv(1) << "plt_smin" << plt_smin;
-}
-
-void US_Density_Match::update_plot_smax( double dval )
-{
-   plt_smax = dval;
-DbgLv(1) << "plt_smax" << plt_smax;
-}
-
-void US_Density_Match::update_plot_kmin( double dval )
-{
-   plt_kmin = dval;
-}
-
-void US_Density_Match::update_plot_kmax( double dval )
-{
-   plt_kmax = dval;
-}
-
-void US_Density_Match::select_autosxy()
-{
-   auto_sxy   = ck_autosxy->isChecked();
-   ct_plt_kmin->setEnabled( !auto_sxy );
-   ct_plt_kmax->setEnabled( !auto_sxy );
-   ct_plt_smin->setEnabled( !auto_sxy );
-   ct_plt_smax->setEnabled( !auto_sxy );
-
-   set_limits();
-}
-
-void US_Density_Match::select_autoscz()
-{
-   auto_scz   = ck_autoscz->isChecked();
-
-   set_limits();
-}
-
 // Load all the distributions (models)
 void US_Density_Match::load_distro()
 {
@@ -721,8 +579,6 @@
    if ( dialog.exec() != QDialog::Accepted )
       return;  // no selection made
 
-   need_save  = false;
-
    te_distr_info->setText(
       QString( models[ 0 ].description ).section( ".", 0, -4 ) );
 
@@ -731,8 +587,6 @@
       load_distro( models[ jj ], mdescs[ jj ] );
    }
 
-   curr_distr = alldis.size() - 1;
-//   need_save  = ck_savepl->isChecked()  &&  !cont_loop;
    bool have_m  = ( models.count() > 0 );
    pb_rmvdist->setEnabled( have_m );
    pb_mdlpars->setEnabled( have_m );
@@ -915,27 +769,9 @@
    alldis.append( tsys );
 DbgLv(1) << "LD:   retn fr alldis.append";
 
-#if 0
-   if ( auto_sxy )
-   {
-DbgLv(1) << "LD:  auto_sxy call set_limits";
-      set_limits();
-   }
-   data_plot->setAxisScale( QwtPlot::xBottom, plt_smin, plt_smax );
-   data_plot->setAxisScale( QwtPlot::yLeft,   plt_kmin, plt_kmax );
-
-   pb_pltall ->setEnabled( true );
    pb_refresh->setEnabled( true );
    pb_reset  ->setEnabled( true );
 
-   if ( cont_loop )
-      pb_pltall->setText( tr( "Plot All Distros in a Loop" ) );
-   else
-      pb_pltall->setText( tr( "Plot All Distros" ) );
-#endif
-   pb_refresh->setEnabled( true );
-   pb_reset  ->setEnabled( true );
-
    // Update status text box
    QString distripl = QString( model.description ).section( ".", -3, -3 );
 DbgLv(1) << "LD:  model:" << model.description;
@@ -959,99 +795,6 @@
    return plotx;
 }
 
-void US_Density_Match::set_limits()
-{
-   double smin = 1.0e30;
-   double smax = -1.0e30;
-   double kmin = 1.0e30;
-   double kmax = -1.0e30;
-   double sinc;
-   double kinc;
-   xa_title    = anno_title( plot_x );
-   ya_title    = anno_title( ATTR_F );
-
-   data_plot->setAxisTitle( QwtPlot::xBottom, xa_title );
-   data_plot->setAxisTitle( QwtPlot::yLeft,   ya_title );
-
-   if ( alldis.size() < 1 )
-      return;
-
-   // find min,max for X,Y distributions
-   for ( int ii = 0; ii < alldis.size(); ii++ )
-   {
-      DisSys* tsys = (DisSys*)&alldis.at( ii );
-
-      for ( int jj = 0; jj < tsys->nm_distro.size(); jj++ )
-      {
-         double sval = tsys->nm_distro.at( jj ).s;
-         double kval = tsys->nm_distro.at( jj ).k;
-         smin        = qMin( smin, sval );
-         smax        = qMax( smax, sval );
-         kmin        = qMin( kmin, kval );
-         kmax        = qMax( kmax, kval );
-      }
-   }
-
-   // adjust minima, maxima
-   sinc      = ( smax - smin ) / 10.0;
-   kinc      = ( kmax - kmin ) / 10.0;
-   sinc      = ( sinc <= 0.0 ) ? ( smin * 0.05 ) : sinc;
-   kinc      = ( kinc <= 0.0 ) ? ( kmin * 0.05 ) : kinc;
-DbgLv(1) << "SL: real smin smax kmin kmax" << smin << smax << kmin << kmax;
-   smin     -= sinc;
-   smax     += sinc;
-   kmin     -= kinc;
-   kmax     += kinc;
-DbgLv(1) << "SL: adjusted smin smax kmin kmax" << smin << smax << kmin << kmax;
-
-   if ( auto_sxy )
-   {  // Set auto limits on X and Y
-      sinc        = pow( 10.0, qFloor( log10( smax ) ) - 3.0 );
-      kinc        = pow( 10.0, qFloor( log10( kmax ) ) - 3.0 );
-      if ( qAbs( ( smax - smin ) / smax ) < 0.001 )
-      {  // Put padding around virtually constant value
-         smin     -= sinc;
-         smax     += sinc;
-      }
-      if ( qAbs( ( kmax - kmin ) / kmax ) < 0.001 )
-      {  // Put padding around virtually constant value
-         kmin     -= kinc;
-         kmax     += kinc;
-      }
-      // Make sure limits are nearest reasonable values
-      smin        = qFloor( smin / sinc ) * sinc;
-      smax        = qFloor( smax / sinc ) * sinc + sinc;
-      smin        = ( plot_x != ATTR_S ) ? qMax( smin, 0.0 ) : smin;
-      smin        = ( plot_x == ATTR_K ) ? qMax( smin, 0.5 ) : smin;
-      kmin        = qFloor( kmin / kinc ) * kinc;
-      kmax        = qFloor( kmax / kinc ) * kinc + kinc;
-
-DbgLv(1) << "SL: setVal kmin kmax" << kmin << kmax;
-#if 0
-      ct_plt_smin->setValue( smin );
-      ct_plt_smax->setValue( smax );
-      ct_plt_kmin->setValue( kmin );
-      ct_plt_kmax->setValue( kmax );
-#endif
-
-      plt_smin    = smin;
-      plt_smax    = smax;
-      plt_kmin    = kmin;
-      plt_kmax    = kmax;
-   }
-   else
-   {
-#if 0
-      plt_smin    = ct_plt_smin->value();
-      plt_smax    = ct_plt_smax->value();
-      plt_kmin    = ct_plt_kmin->value();
-      plt_kmax    = ct_plt_kmax->value();
-#endif
-   }
-DbgLv(1) << "SL: plt_smin _smax _kmin _kmax" << plt_smin << plt_smax
- << plt_kmin << plt_kmax;
-}
-
 // Sort distribution solute list by s,d values and optionally reduce
 void US_Density_Match::sort_distro( QList< S_Solute >& listsols,
       bool reduce )
@@ -1183,17 +926,22 @@
       int jd     = alldis.size();
 
       if ( jd < 1 )
-      {
-         reset();
-         return;
+      {  // Handle case where ALL distributions removed
+         QString dinfo   = te_distr_info->toPlainText()
+                           .section( "\n", 0, 0 ) +
+                           tr( "\n(no models)\n" );
+         te_distr_info->setText( dinfo );
+         dataPlotClear( data_plot );
+         data_plot->replot();
       }
-
-      curr_distr = 0;
 DbgLv(1) << "rmvdis:Accepted";
    }
 
-   // Summarize new set of models in info box
-   models_summary();
+   if ( alldis.size() > 0 )
+   {
+      // Summarize new set of models in info box
+      models_summary();
+   }
 
    // Build and plot updated data
    build_bf_dists();    // (Re-)build boundary fraction distributions
@@ -1231,51 +979,9 @@
 DbgLv(1) << "sel_x:  ival" << ival;
    plot_x     = ival;
 
-#if 0
-   const QString xlabs[] = {   "mass", "f/f0",   "rh", "vbar",     "s" };
-   const double  xvlos[] = {     2e+4,   1.0,    2e+4,  0.60,      1.0 };
-   const double  xvhis[] = {     1e+5,   4.0,    1e+5,  0.80,     10.0 };
-   const double  xmins[] = {      0.0,   1.0,     0.0,  0.01, -10000.0 };
-   const double  xmaxs[] = {    1e+10,  50.0,   1e+10,  3.00,  10000.0 };
-   const double  xincs[] = {   1000.0,  0.01,  1000.0,  0.01,     0.01 };
-#endif
-
-   const QString xlabs[] = {      "s", "f/f0", "mass","vbar", "D", "f",  "rh"  };
-   const double  xvlos[] = {      1.0,   1.0,    2e+4,  0.60, 1e-8, 1e-8, 0.1  };
-   const double  xvhis[] = {     10.0,   4.0,    1e+5,  0.80, 1e-7, 1e-7, 1000.};
-   const double  xmins[] = { -10000.0,   1.0,     0.0,  0.01, 1e-9, 1e-9, 1e-1 };
-   const double  xmaxs[] = {  10000.0,  50.0,   1e+10,  3.00, 1e-5, 1e-5, 1e+3 };
-   const double  xincs[] = {     0.01,  0.01,  1000.0,  0.01, 1e-9, 1e-9, 1e-2 };
-#if 0
-   const QString xlabs[] = {      "s", "f/f0",  "MW", "vbar", "D", "f"  };
-   const double  xvlos[] = {      1.0,   1.0,   2e+4,  0.60, 1e-8, 1e-8 };
-   const double  xvhis[] = {     10.0,   4.0,   1e+5,  0.80, 1e-7, 1e-7 };
-   const double  xmins[] = { -10000.0,   1.0,    0.0,  0.01, 1e-9, 1e-9 };
-   const double  xmaxs[] = {  10000.0,  50.0,  1e+10,  3.00, 1e-5, 1e-5 };
-   const double  xincs[] = {     0.01,  0.01, 1000.0,  0.01, 1e-9, 1e-9 };
-#endif
-
-#if 0
-   lb_plt_smin->setText( tr( "Plot Limit " ) + xlabs[ plot_x ]
-                       + tr( " Minimum:" ) );
-   lb_plt_smax->setText( tr( "Plot Limit " ) + xlabs[ plot_x ]
-                       + tr( " Maximum:" ) );
-   ct_plt_smin->setRange( xmins[ plot_x ], xmaxs[ plot_x ] );
-   ct_plt_smax->setRange( xmins[ plot_x ], xmaxs[ plot_x ] );
-   ct_plt_smin->setSingleStep( xincs[ plot_x ] );
-   ct_plt_smax->setSingleStep( xincs[ plot_x ] );
-   ct_plt_smin->setValue( xvlos[ plot_x ] );
-   ct_plt_smax->setValue( xvhis[ plot_x ] );
-#endif
-DbgLv(1) << "sel_x:   lab vlos vhis xmin xmax xinc" << xlabs[plot_x]
- << xvlos[plot_x] << xvhis[plot_x] << xmins[plot_x] << xmaxs[plot_x]
- << xincs[plot_x];
-
    build_bf_dists();    // Build the boundary fraction distributions
    build_bf_vects();    // Build the boundary fraction vectors
 
-//   set_limits();
-
    plot_data();         // Plot data
 }
 
@@ -1378,7 +1084,6 @@
          double wsum      = 0.0;
          for ( int ii = 0; ii < ndists; ii++ )
          {  // Accumulate (weighted) sum and sum of weights
-//            double dwt       = alldis[ ii ].bf_distro[ jj ].c;
             double dwt       = ( diff_avg == 1 ) ? 1.0
                                                  : alldis[ ii ].bf_distro[ jj ].c;
             dsum            += ( alldis[ ii ].bf_distro[ jj ].d * dwt );
@@ -1493,8 +1198,6 @@
    for ( int jj = 0; jj < npoints; jj++ )
    {
       // *** Mi = si*R*T/(Di_avg*(1-vbari*rho))
-//      double sedco     = alldis[ 0 ].bf_distro[ jj ].s * 1.0e-13;
-//      double difco     = alldis[ 0 ].bf_distro[ jj ].d * 1.0e-7;
       double sedco     = v_sedcs[ zx ][ jj ] * 1.0e-13;
       double difco     = v_difcs[ zx ][ jj ] * 1.0e-7;
       double vbari     = v_vbars[ jj ];
@@ -1714,6 +1417,11 @@
                           + mlab + "  " + mdesc + "\n";
    }
 
+   if ( alldis.size() < 1 )
+   {
+      dinfo            += tr( "(no models)\n" );
+   }
+
    te_distr_info->setText( dinfo );
 }
 

Modified: trunk/programs/us_density_match/us_density_match.h
===================================================================
--- trunk/programs/us_density_match/us_density_match.h	2019-08-18 15:32:32 UTC (rev 2821)
+++ trunk/programs/us_density_match/us_density_match.h	2019-08-20 22:09:03 UTC (rev 2822)
@@ -52,11 +52,6 @@
 
       enum attr_type { ATTR_S, ATTR_K, ATTR_W, ATTR_V, ATTR_D, ATTR_F, ATTR_R };
 
-      QLabel*       lb_plt_smin;
-      QLabel*       lb_plt_smax;
-      QLabel*       lb_plt_kmin;
-      QLabel*       lb_plt_kmax;
-      QLabel*       lb_tolerance;
       QLabel*       lb_division;
 
       QTextEdit*    te_distr_info;
@@ -65,12 +60,6 @@
 
       US_Help       showHelp;
  
-      QwtCounter*   ct_resolu;
-      QwtCounter*   ct_plt_kmin;     
-      QwtCounter*   ct_plt_kmax;     
-      QwtCounter*   ct_plt_smin;     
-      QwtCounter*   ct_plt_smax;     
-      QwtCounter*   ct_plt_dlay;     
       QwtCounter*   ct_division;
       QwtCounter*   ct_smoothing;
       QwtCounter*   ct_boundaryPct;
@@ -92,15 +81,6 @@
       QPushButton*  pb_mdlpars;
       QPushButton*  pb_save;
 
-      QCheckBox*    ck_autosxy;
-      QCheckBox*    ck_autoscz;
-      QCheckBox*    ck_plot_sk;
-      QCheckBox*    ck_plot_wk;
-      QCheckBox*    ck_plot_sv;
-      QCheckBox*    ck_plot_wv;
-      QCheckBox*    ck_savepl;
-      QCheckBox*    ck_locsave;
-
       QRadioButton* rb_x_mass;
       QRadioButton* rb_x_ff0;
       QRadioButton* rb_x_rh;
@@ -124,30 +104,10 @@
       QVector< QVector< double > >  v_sedcs;   // Vector of sedi coeff vectors per distro
       QVector< QVector< double > >  v_difcs;   // Vector of diff coeff vectors per distro
 
-      double        resolu;
-      double        plt_smin;
-      double        plt_smax;
-      double        plt_kmin;
-      double        plt_kmax;
-      double        plt_zmin;
-      double        plt_zmax;
-      double        s_range;
-      double        k_range;
-      double        xreso;
-      double        yreso;
-
-      int           curr_distr;
       int           dbg_level;
       int           plot_x;
       int           diff_avg;
 
-      bool          auto_sxy;
-      bool          auto_scz;
-      bool          cont_loop;
-      bool          need_save;
-      bool          runsel;
-      bool          latest;
-
       QString       xa_title;
       QString       ya_title;
       QString       mfilter;
@@ -157,18 +117,8 @@
 
    private slots:
 
-      void update_resolu(     double );
-      void update_xreso(      double );
-      void update_yreso(      double );
-      void update_curr_distr( double );
-      void update_plot_smin(  double );
-      void update_plot_smax(  double );
-      void update_plot_kmin(  double );
-      void update_plot_kmax(  double );
       void plot_data(      int );
       void plot_data(      void );
-      void select_autosxy( void );
-      void select_autoscz( void );
       void update_disk_db( bool );
       void update_divis  ( double );
       void select_prefilt( void );
@@ -176,7 +126,6 @@
       void load_distro(    US_Model, QString );
       void reset(   void );
       void save(    void );
-      void set_limits     (  void );
       void sort_distro    ( QList< S_Solute >&, bool );
       void remove_distro  ( void );
       void set_mparms     ( void );

Modified: trunk/programs/us_density_match/us_remove_models.h
===================================================================
--- trunk/programs/us_density_match/us_remove_models.h	2019-08-18 15:32:32 UTC (rev 2821)
+++ trunk/programs/us_density_match/us_remove_models.h	2019-08-20 22:09:03 UTC (rev 2822)
@@ -53,7 +53,7 @@
       void restore          ( void );
       void accepted         ( void );
       void help             ( void )
-      { showHelp.show_help( "mass_distrib_rmv.html" ); };
+      { showHelp.show_help( "dens_match_rmvmods.html" ); };
 };
 #endif
 



More information about the us-commits mailing list