Changeset 2835


Ignore:
Timestamp:
Sep 25, 2019 1:31:51 PM (7 weeks ago)
Author:
alexey
Message:

Merging mine and Gary's mods to us_xpn_viewer_gui.cpp..
(accidentally overwrote last time)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp

    r2834 r2835  
    15991599      //ALEXEY: make sure ExpID is coupled to the RunID which is already in the autoflow DB
    16001600      if ( runID_passed != "NULL" )
    1601         {
    1602           if ( runID_passed.toInt() != RunID_to_retrieve.toInt() )
    1603             {
    1604               RunID_to_retrieve = runID_passed;
    1605               qDebug() << "Correcting RunID to : " << RunID_to_retrieve;
    1606             }
    1607         }
    1608  
    1609      
     1601  {
     1602    if ( runID_passed.toInt() != RunID_to_retrieve.toInt() )
     1603      {
     1604        RunID_to_retrieve = runID_passed;
     1605        qDebug() << "Correcting RunID to : " << RunID_to_retrieve;
     1606      }
     1607  }
     1608           
    16101609      //ALEXEY: need to update 'autoflow' table with the unique RunID_to_retrieve && Start Run Time fields !!!
    16111610      //Conditional:  Do it ONLY once !!!
     
    23442343//    if ( lddiag->exec() == QDialog::Rejected )                    //ALEXEY need drDesc but do NOT need dialog
    23452344//    {
    2346 // DbgLv(1) << "RDr:  rtn fr XpnRunRaw dialog: CANCEL";
     2345// DbgLv(1) << "RDa:  rtn fr XpnRunRaw dialog: CANCEL";
    23472346//       return;
    23482347//    }
     
    23502349//    // Restore area beneath dialog
    23512350//    qApp->processEvents();
    2352 // DbgLv(1) << "RDr:  rtn fr XpnRunRaw dialog";
    2353 // DbgLv(1) << "RDr:   drDesc" << drDesc;
     2351// DbgLv(1) << "RDa:  rtn fr XpnRunRaw dialog";
     2352// DbgLv(1) << "RDa:   drDesc" << drDesc;
    23542353
    23552354   // See if we need to fix the runID
     
    24122411   scanmask          += QString( sMasks ).mid( 4, 1 ) == "1" ? 4 : 0;
    24132412   scanmask          += QString( sMasks ).mid( 6, 1 ) == "1" ? 8 : 0;
    2414 DbgLv(1) << "RDr:     iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
    2415 
    2416  qDebug() << "RDr:     iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
     2413DbgLv(1) << "RDa:     iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
    24172414
    24182415 //ALEXEY: maybe put in_reload_check_sysdata = true; and then false (after xpn_data->import_data( iRunId, scanmask ); )
    24192416 //in_reload_check_sysdata = true; //ALEXEY
    2420  xpn_data->import_data( iRunId, scanmask );                               // ALEXEY <-- actual data retreiving
     2417
     2418   xpn_data->import_data( iRunId, scanmask );                               // ALEXEY <-- actual data retreiving
     2419
    24212420   int ntsrows        = xpn_data->countOf( "scan_rows" );
    2422 DbgLv(1) << "RDr:     ntsrows" << ntsrows;
    2423 DbgLv(1) << "RDr:      knt(triple)   " << xpn_data->countOf( "triple"    );
     2421DbgLv(1) << "RDa:     ntsrows" << ntsrows;
     2422DbgLv(1) << "RDa:      knt(triple)   " << xpn_data->countOf( "triple"    );
    24242423 qApp->processEvents();
    24252424
     
    24292428                          .arg( fRunId ) );
    24302429
    2431       in_reload_all_data   = false; 
    2432      
     2430      in_reload_all_data   = false;
     2431
    24332432      //ALEXEY: rare case when no data but exp. aborted !!!!
    24342433      if ( CheckExpComplete_auto( RunID_to_retrieve ) == 0 ) //ALEXEY should be == 3 as per documentation
     
    25102509      drtype2            = ( runType2 == "FI" ) ? "Fluorescence" : drtype2;
    25112510      drtype2            = ( runType2 == "WI" ) ? "Wavelength"   : drtype2;
    2512       opsys << drtype1 << drtype2;
    2513 
    25142511      QString msg        = tr( "Multiple scan data types are present:\n" )
    25152512                           +   "'" + drtype1 + "'\n or \n"
    2516                            +   "'" + drtype2 + "' .\n\n"
    2517                            + tr( "Choose one for initial display." );
    2518       QMessageBox mbox;
    2519       mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
    2520       mbox.setText( msg );
    2521       QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
    2522       QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
    2523       mbox.setEscapeButton ( pb_opt2 );
    2524       mbox.setDefaultButton( pb_opt1 );
    2525 
    2526       mbox.exec();
    2527       if ( mbox.clickedButton() == pb_opt2 )
     2513                           +   "'" + drtype2 + "' .\n";
     2514DbgLv(1) << "RDa:   runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
     2515 << xpn_data->countOf( "iscn_rows" )
     2516 << xpn_data->countOf( "fscn_rows" )
     2517 << xpn_data->countOf( "wscn_rows" );
     2518      if ( ( runType2 == "IP"  &&  xpn_data->countOf( "iscn_rows" ) == 0 )  ||
     2519           ( runType2 == "FI"  &&  xpn_data->countOf( "fscn_rows" ) == 0 )  ||
     2520           ( runType2 == "WI"  &&  xpn_data->countOf( "wscn_rows" ) == 0 ) )
    25282521      {
    2529          runType            = runType2;
    2530          optndx             = 1;
     2522         msg               += tr( "\nScans are missing so only " ) + drtype1
     2523                              + tr( " scans are processed." );
     2524         QMessageBox::warning( this,
     2525               tr( "Multiple Types with Missing Scans" ),
     2526               msg );
    25312527      }
     2528
     2529      else
     2530      {
     2531         opsys << drtype1 << drtype2;
     2532         msg               += tr( "\nChoose one for initial display." );
     2533         QMessageBox mbox;
     2534         mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
     2535         mbox.setText( msg );
     2536         QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
     2537         QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
     2538         mbox.setEscapeButton ( pb_opt2 );
     2539         mbox.setDefaultButton( pb_opt1 );
     2540
     2541         mbox.exec();
     2542         if ( mbox.clickedButton() == pb_opt2 )
     2543         {
     2544            runType            = runType2;
     2545            optndx             = 1;
     2546DbgLv(1) << "RDa:   runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
     2547 << xpn_data->countOf( "iscn_rows" )
     2548 << xpn_data->countOf( "fscn_rows" )
     2549 << xpn_data->countOf( "wscn_rows" );
     2550         }
     2551      }
    25322552   }
    25332553
    25342554   qApp->processEvents();  //ALEXEY: maybe this will help
    2535    
    2536    qDebug() << "1. Crashes HERE!!!!";
     2555DbgLv(1) << "RDa: 1. Crashes HERE!!!!";
    25372556     
    25382557   cb_optsys->disconnect();
    25392558   cb_optsys->clear();
    2540 
    2541    qDebug() << "1a. Crashes HERE!!!!";
     2559DbgLv(1) << "RDa: 1a. Crashes HERE!!!!";
    25422560   
    25432561   cb_optsys->addItems( opsys );                                  // ALEXEY fill out Optics listbox
    2544 
    2545    qDebug() << "1ab. Crashes HERE!!!! - BEFORE Setting index to cb_optsys";
     2562DbgLv(1) << "RDa: 1ab. Crashes HERE!!!! - BEFORE Setting index to cb_optsys";
    25462563   cb_optsys->setCurrentIndex( optndx );
    2547    qDebug() << "1ac. Crashes HERE!!!! - AFTER Setting index to cb_optsys";
     2564DbgLv(1) << "RDa: 1ac. Crashes HERE!!!! - AFTER Setting index to cb_optsys";
    25482565   
    25492566   connect( cb_optsys,    SIGNAL( currentIndexChanged( int ) ),
    25502567            this,         SLOT  ( changeOptics( )            ) );
    2551 
    2552    qDebug() << "1b. Crashes HERE!!!!";
     2568DbgLv(1) << "RDa: 1b. Crashes HERE!!!!";
    25532569   
    25542570   runID         = new_runID;
    2555 DbgLv(1) << "RDr:  runID" << runID << "runType" << runType;
     2571DbgLv(1) << "RDa:  runID" << runID << "runType" << runType;
    25562572   xpn_data->set_run_values( runID, runType );                    // ALEXEY
    2557 
    2558    qDebug() << "2. Crashes HERE!!!! (after xpn_data->set_run_values( runID, runType ) )";
     2573DbgLv(1) << "RDa: 2. Crashes HERE!!!! (after xpn_data->set_run_values( runID, runType ) )";
    25592574
    25602575   // Build the AUC equivalent
     
    25642579
    25652580   xpn_data->build_rawData( allData );                            // ALEXEY Builds Raw Data
    2566 
    2567    qDebug() << "3. Crashes HERE!!!! (after  xpn_data->build_rawData( allData ))";
     2581DbgLv(1) << "RDa: 3. Crashes HERE!!!! (after  xpn_data->build_rawData( allData ))";
    25682582   
    25692583double tm2=(double)sttime.msecsTo(QDateTime::currentDateTime())/1000.0;
    2570 DbgLv(1) << "RDr:      build-raw done: tm1 tm2" << tm1 << tm2;
     2584DbgLv(1) << "RDa:      build-raw done: tm1 tm2" << tm1 << tm2;
    25712585
    25722586   QApplication::restoreOverrideCursor();
     
    25802594   npoint        = allData[ 0 ].pointCount();
    25812595
    2582 DbgLv(1) << "RDr: mwr ntriple" << ntriple;
    2583 DbgLv(1) << "RDr: ncellch" << ncellch << cellchans.count();
    2584 DbgLv(1) << "RDr: nscan" << nscan << "npoint" << npoint;
    2585 DbgLv(1) << "RDr:   rvS rvE" << r_radii[0] << r_radii[npoint-1];
     2596DbgLv(1) << "RDa: mwr ntriple" << ntriple;
     2597DbgLv(1) << "RDa: ncellch" << ncellch << cellchans.count();
     2598DbgLv(1) << "RDa: nscan" << nscan << "npoint" << npoint;
     2599DbgLv(1) << "RDa:   rvS rvE" << r_radii[0] << r_radii[npoint-1];
    25862600   cb_cellchn->disconnect();                                     
    25872601   cb_cellchn->clear();
     
    25962610   ntriple      = nlambda * ncellch;  // Number triples
    25972611   ntpoint      = npoint  * nscan;    // Number radius points per triple
    2598 DbgLv(1) << "RDr: nwl wvlo wvhi" << nlambda << wvlo << wvhi
     2612DbgLv(1) << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi
    25992613   << "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple;
    26002614   triples.clear();
     
    26102624#if 1
    26112625   ntriple      = xpn_data->data_triples( triples );              // ALEXEY triples
    2612 DbgLv(1) << "RDr: nwl wvlo wvhi" << nlambda << wvlo << wvhi
     2626DbgLv(1) << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi
    26132627   << "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple
    26142628   << triples.count();
    26152629
    2616  qDebug() << "RDr: nwl wvlo wvhi" << nlambda << wvlo << wvhi
     2630 qDebug() << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi
    26172631   << "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple
    26182632   << triples.count();
    26192633#endif
    26202634
    2621 DbgLv(1) << "RDr: allData size" << allData.size();
    2622 
    2623  qDebug() << "RDr: allData size" << allData.size();
     2635DbgLv(1) << "RDa: allData size" << allData.size();
     2636
     2637 qDebug() << "RDa: allData size" << allData.size();
    26242638
    26252639 //QApplication::restoreOverrideCursor();
     
    27852799DbgLv(1) << "RDr:     iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask;
    27862800
    2787  xpn_data->import_data( iRunId, scanmask );                             
     2801   xpn_data->import_data( iRunId, scanmask );                             
     2802
    27882803   int ntsrows        = xpn_data->countOf( "scan_rows" );
    27892804DbgLv(1) << "RDr:     ntsrows" << ntsrows;
    27902805DbgLv(1) << "RDr:      knt(triple)   " << xpn_data->countOf( "triple"    );
    2791 
    27922806
    27932807   if ( ntsrows < 1 )
     
    28092823   if ( scanmask == 1  ||  scanmask == 2  ||
    28102824        scanmask == 4  ||  scanmask == 8 )
    2811    {
     2825   {  // Single type of data present
    28122826      runType            = ( scanmask == 2 ) ? "FI" : runType;
    28132827      runType            = ( scanmask == 4 ) ? "IP" : runType;
     
    28242838
    28252839   else if ( ( scanmask & 1 ) != 0 )
    2826    {
     2840   {  // Multiple data types present
    28272841      QApplication::restoreOverrideCursor();
    28282842      QApplication::restoreOverrideCursor();
     
    28382852      drtype2            = ( runType2 == "FI" ) ? "Fluorescence" : drtype2;
    28392853      drtype2            = ( runType2 == "WI" ) ? "Wavelength"   : drtype2;
    2840       opsys << drtype1 << drtype2;
    2841 
    28422854      QString msg        = tr( "Multiple scan data types are present:\n" )
    28432855                           +   "'" + drtype1 + "'\n or \n"
    2844                            +   "'" + drtype2 + "' .\n\n"
    2845                            + tr( "Choose one for initial display." );
    2846       QMessageBox mbox;
    2847       mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
    2848       mbox.setText( msg );
    2849       QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
    2850       QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
    2851       mbox.setEscapeButton ( pb_opt2 );
    2852       mbox.setDefaultButton( pb_opt1 );
    2853 
    2854       mbox.exec();
    2855       if ( mbox.clickedButton() == pb_opt2 )
     2856                           +   "'" + drtype2 + "' .\n";
     2857DbgLv(1) << "RDr:   runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
     2858 << xpn_data->countOf( "iscn_rows" )
     2859 << xpn_data->countOf( "fscn_rows" )
     2860 << xpn_data->countOf( "wscn_rows" );
     2861      if ( ( runType2 == "IP"  &&  xpn_data->countOf( "iscn_rows" ) == 0 )  ||
     2862           ( runType2 == "FI"  &&  xpn_data->countOf( "fscn_rows" ) == 0 )  ||
     2863           ( runType2 == "WI"  &&  xpn_data->countOf( "wscn_rows" ) == 0 ) )
    28562864      {
    2857          runType            = runType2;
    2858          optndx             = 1;
     2865         msg               += tr( "\nScans are missing so only " ) + drtype1
     2866                              + tr( " scans are processed." );
     2867         QMessageBox::warning( this,
     2868               tr( "Multiple Types with Missing Scans" ),
     2869               msg );
     2870      }
     2871
     2872      else
     2873      {
     2874         opsys << drtype1 << drtype2;
     2875         msg               += tr( "\nChoose one for initial display." );
     2876         QMessageBox mbox;
     2877         mbox.setWindowTitle( tr( "Scan Data Type to Process" ) );
     2878         mbox.setText( msg );
     2879         QPushButton* pb_opt1 = mbox.addButton( drtype1, QMessageBox::AcceptRole );
     2880         QPushButton* pb_opt2 = mbox.addButton( drtype2, QMessageBox::RejectRole );
     2881         mbox.setEscapeButton ( pb_opt2 );
     2882         mbox.setDefaultButton( pb_opt1 );
     2883
     2884         mbox.exec();
     2885         if ( mbox.clickedButton() == pb_opt2 )
     2886         {
     2887            runType            = runType2;
     2888            optndx             = 1;
     2889DbgLv(1) << "RDr:   runType2 scanmask" << runType2 << scanmask << "[ifw]scn_rows"
     2890 << xpn_data->countOf( "iscn_rows" )
     2891 << xpn_data->countOf( "fscn_rows" )
     2892 << xpn_data->countOf( "wscn_rows" );
     2893         }
    28592894      }
    28602895   }
Note: See TracChangeset for help on using the changeset viewer.