Changeset 2835
- Timestamp:
- Sep 25, 2019 1:31:51 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/programs/us_xpn_viewer/us_xpn_viewer_gui.cpp
r2834 r2835 1599 1599 //ALEXEY: make sure ExpID is coupled to the RunID which is already in the autoflow DB 1600 1600 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 1610 1609 //ALEXEY: need to update 'autoflow' table with the unique RunID_to_retrieve && Start Run Time fields !!! 1611 1610 //Conditional: Do it ONLY once !!! … … 2344 2343 // if ( lddiag->exec() == QDialog::Rejected ) //ALEXEY need drDesc but do NOT need dialog 2345 2344 // { 2346 // DbgLv(1) << "RD r: rtn fr XpnRunRaw dialog: CANCEL";2345 // DbgLv(1) << "RDa: rtn fr XpnRunRaw dialog: CANCEL"; 2347 2346 // return; 2348 2347 // } … … 2350 2349 // // Restore area beneath dialog 2351 2350 // qApp->processEvents(); 2352 // DbgLv(1) << "RD r: rtn fr XpnRunRaw dialog";2353 // DbgLv(1) << "RD r: drDesc" << drDesc;2351 // DbgLv(1) << "RDa: rtn fr XpnRunRaw dialog"; 2352 // DbgLv(1) << "RDa: drDesc" << drDesc; 2354 2353 2355 2354 // See if we need to fix the runID … … 2412 2411 scanmask += QString( sMasks ).mid( 4, 1 ) == "1" ? 4 : 0; 2413 2412 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; 2413 DbgLv(1) << "RDa: iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask; 2417 2414 2418 2415 //ALEXEY: maybe put in_reload_check_sysdata = true; and then false (after xpn_data->import_data( iRunId, scanmask ); ) 2419 2416 //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 2421 2420 int ntsrows = xpn_data->countOf( "scan_rows" ); 2422 DbgLv(1) << "RD r: ntsrows" << ntsrows;2423 DbgLv(1) << "RD r: knt(triple) " << xpn_data->countOf( "triple" );2421 DbgLv(1) << "RDa: ntsrows" << ntsrows; 2422 DbgLv(1) << "RDa: knt(triple) " << xpn_data->countOf( "triple" ); 2424 2423 qApp->processEvents(); 2425 2424 … … 2429 2428 .arg( fRunId ) ); 2430 2429 2431 in_reload_all_data = false; 2432 2430 in_reload_all_data = false; 2431 2433 2432 //ALEXEY: rare case when no data but exp. aborted !!!! 2434 2433 if ( CheckExpComplete_auto( RunID_to_retrieve ) == 0 ) //ALEXEY should be == 3 as per documentation … … 2510 2509 drtype2 = ( runType2 == "FI" ) ? "Fluorescence" : drtype2; 2511 2510 drtype2 = ( runType2 == "WI" ) ? "Wavelength" : drtype2; 2512 opsys << drtype1 << drtype2;2513 2514 2511 QString msg = tr( "Multiple scan data types are present:\n" ) 2515 2512 + "'" + 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"; 2514 DbgLv(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 ) ) 2528 2521 { 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 ); 2531 2527 } 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; 2546 DbgLv(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 } 2532 2552 } 2533 2553 2534 2554 qApp->processEvents(); //ALEXEY: maybe this will help 2535 2536 qDebug() << "1. Crashes HERE!!!!"; 2555 DbgLv(1) << "RDa: 1. Crashes HERE!!!!"; 2537 2556 2538 2557 cb_optsys->disconnect(); 2539 2558 cb_optsys->clear(); 2540 2541 qDebug() << "1a. Crashes HERE!!!!"; 2559 DbgLv(1) << "RDa: 1a. Crashes HERE!!!!"; 2542 2560 2543 2561 cb_optsys->addItems( opsys ); // ALEXEY fill out Optics listbox 2544 2545 qDebug() << "1ab. Crashes HERE!!!! - BEFORE Setting index to cb_optsys"; 2562 DbgLv(1) << "RDa: 1ab. Crashes HERE!!!! - BEFORE Setting index to cb_optsys"; 2546 2563 cb_optsys->setCurrentIndex( optndx ); 2547 qDebug() << "1ac. Crashes HERE!!!! - AFTER Setting index to cb_optsys";2564 DbgLv(1) << "RDa: 1ac. Crashes HERE!!!! - AFTER Setting index to cb_optsys"; 2548 2565 2549 2566 connect( cb_optsys, SIGNAL( currentIndexChanged( int ) ), 2550 2567 this, SLOT ( changeOptics( ) ) ); 2551 2552 qDebug() << "1b. Crashes HERE!!!!"; 2568 DbgLv(1) << "RDa: 1b. Crashes HERE!!!!"; 2553 2569 2554 2570 runID = new_runID; 2555 DbgLv(1) << "RD r: runID" << runID << "runType" << runType;2571 DbgLv(1) << "RDa: runID" << runID << "runType" << runType; 2556 2572 xpn_data->set_run_values( runID, runType ); // ALEXEY 2557 2558 qDebug() << "2. Crashes HERE!!!! (after xpn_data->set_run_values( runID, runType ) )"; 2573 DbgLv(1) << "RDa: 2. Crashes HERE!!!! (after xpn_data->set_run_values( runID, runType ) )"; 2559 2574 2560 2575 // Build the AUC equivalent … … 2564 2579 2565 2580 xpn_data->build_rawData( allData ); // ALEXEY Builds Raw Data 2566 2567 qDebug() << "3. Crashes HERE!!!! (after xpn_data->build_rawData( allData ))"; 2581 DbgLv(1) << "RDa: 3. Crashes HERE!!!! (after xpn_data->build_rawData( allData ))"; 2568 2582 2569 2583 double tm2=(double)sttime.msecsTo(QDateTime::currentDateTime())/1000.0; 2570 DbgLv(1) << "RD r: build-raw done: tm1 tm2" << tm1 << tm2;2584 DbgLv(1) << "RDa: build-raw done: tm1 tm2" << tm1 << tm2; 2571 2585 2572 2586 QApplication::restoreOverrideCursor(); … … 2580 2594 npoint = allData[ 0 ].pointCount(); 2581 2595 2582 DbgLv(1) << "RD r: mwr ntriple" << ntriple;2583 DbgLv(1) << "RD r: ncellch" << ncellch << cellchans.count();2584 DbgLv(1) << "RD r: nscan" << nscan << "npoint" << npoint;2585 DbgLv(1) << "RD r: rvS rvE" << r_radii[0] << r_radii[npoint-1];2596 DbgLv(1) << "RDa: mwr ntriple" << ntriple; 2597 DbgLv(1) << "RDa: ncellch" << ncellch << cellchans.count(); 2598 DbgLv(1) << "RDa: nscan" << nscan << "npoint" << npoint; 2599 DbgLv(1) << "RDa: rvS rvE" << r_radii[0] << r_radii[npoint-1]; 2586 2600 cb_cellchn->disconnect(); 2587 2601 cb_cellchn->clear(); … … 2596 2610 ntriple = nlambda * ncellch; // Number triples 2597 2611 ntpoint = npoint * nscan; // Number radius points per triple 2598 DbgLv(1) << "RD r: nwl wvlo wvhi" << nlambda << wvlo << wvhi2612 DbgLv(1) << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi 2599 2613 << "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple; 2600 2614 triples.clear(); … … 2610 2624 #if 1 2611 2625 ntriple = xpn_data->data_triples( triples ); // ALEXEY triples 2612 DbgLv(1) << "RD r: nwl wvlo wvhi" << nlambda << wvlo << wvhi2626 DbgLv(1) << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi 2613 2627 << "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple 2614 2628 << triples.count(); 2615 2629 2616 qDebug() << "RD r: nwl wvlo wvhi" << nlambda << wvlo << wvhi2630 qDebug() << "RDa: nwl wvlo wvhi" << nlambda << wvlo << wvhi 2617 2631 << "ncellch" << ncellch << "nlambda" << nlambda << "ntriple" << ntriple 2618 2632 << triples.count(); 2619 2633 #endif 2620 2634 2621 DbgLv(1) << "RD r: allData size" << allData.size();2622 2623 qDebug() << "RD r: allData size" << allData.size();2635 DbgLv(1) << "RDa: allData size" << allData.size(); 2636 2637 qDebug() << "RDa: allData size" << allData.size(); 2624 2638 2625 2639 //QApplication::restoreOverrideCursor(); … … 2785 2799 DbgLv(1) << "RDr: iRId" << iRunId << "sMsks scnmask" << sMasks << scanmask; 2786 2800 2787 xpn_data->import_data( iRunId, scanmask ); 2801 xpn_data->import_data( iRunId, scanmask ); 2802 2788 2803 int ntsrows = xpn_data->countOf( "scan_rows" ); 2789 2804 DbgLv(1) << "RDr: ntsrows" << ntsrows; 2790 2805 DbgLv(1) << "RDr: knt(triple) " << xpn_data->countOf( "triple" ); 2791 2792 2806 2793 2807 if ( ntsrows < 1 ) … … 2809 2823 if ( scanmask == 1 || scanmask == 2 || 2810 2824 scanmask == 4 || scanmask == 8 ) 2811 { 2825 { // Single type of data present 2812 2826 runType = ( scanmask == 2 ) ? "FI" : runType; 2813 2827 runType = ( scanmask == 4 ) ? "IP" : runType; … … 2824 2838 2825 2839 else if ( ( scanmask & 1 ) != 0 ) 2826 { 2840 { // Multiple data types present 2827 2841 QApplication::restoreOverrideCursor(); 2828 2842 QApplication::restoreOverrideCursor(); … … 2838 2852 drtype2 = ( runType2 == "FI" ) ? "Fluorescence" : drtype2; 2839 2853 drtype2 = ( runType2 == "WI" ) ? "Wavelength" : drtype2; 2840 opsys << drtype1 << drtype2;2841 2842 2854 QString msg = tr( "Multiple scan data types are present:\n" ) 2843 2855 + "'" + 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"; 2857 DbgLv(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 ) ) 2856 2864 { 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; 2889 DbgLv(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 } 2859 2894 } 2860 2895 }
Note: See TracChangeset
for help on using the changeset viewer.