Changeset 12188 for trunk/FACT++


Ignore:
Timestamp:
10/17/11 19:47:14 (13 years ago)
Author:
tbretz
Message:
Fixed several mappings.
Location:
trunk/FACT++/gui/RawEventsViewer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc

    r12185 r12188  
    167167        color = float(eventsData[eventNum][i][whichSlice]+(VALUES_SPAN/2))/(float)(VALUES_SPAN-1);
    168168#else
    169         color = float(eventData[nRoi*i + whichSlice]+(VALUES_SPAN/2))/(float)(VALUES_SPAN-1);
     169        color = float(eventData[nRoi*hardwareMapping[i] + whichSlice]+(VALUES_SPAN/2))/(float)(VALUES_SPAN-1);
    170170        if (logScale)
    171171        {
     
    271271    float plusMe = VALUES_SPAN/2;
    272272
    273     cout << "---> value span..." << endl;
    274 
    275273    /*
    276274    if (drawCalibrationLoaded)
     
    281279        plusMe = 0 ;///=2;
    282280        }*/
     281
     282    const int hw = hardwareMapping[selectedPixel];
    283283
    284284    for (int i=0;i<nRoi-1;i++)
     
    291291#else
    292292
    293         float d1 = eventData[nRoi*selectedPixel + i]+plusMe;
    294         float d2 = eventData[nRoi*selectedPixel + i+1]+plusMe;
     293
     294        float d1 = eventData[nRoi*hw + i]+plusMe;
     295        float d2 = eventData[nRoi*hw + i+1]+plusMe;
    295296        if (!finite(d1)) d1 = 20000;
    296297        if (!finite(d2)) d2 = 20000;
     
    11031104            for (int i=0;i<nRoi;i++)
    11041105            {
    1105                 aMeas[i] = eventData[j*1024+i];// * adcCount;
     1106                aMeas[i] = eventData[j*nRoi+i];// * adcCount;
    11061107
    11071108            }
     
    13981399        timer.start();
    13991400}
    1400 /************************************************************
    1401  * CURRENT SLICE HAS CHANGE. ui handler
    1402  ************************************************************/
    1403 void UIConnector::currentSliceHasChanged(int slice)
     1401
     1402void UIConnector::displaySliceValue()
    14041403{
    14051404    if (!GLWindow->nRoi)
    14061405        return;
    1407 //    str << "Displaying Slice " << slice;
    1408 //    QString qstr(str.str().c_str());
     1406
     1407    const int idx =
     1408        GLWindow->nRoi*GLWindow->hardwareMapping[GLWindow->selectedPixel]
     1409        + GLWindow->whichSlice;
     1410
     1411    ostringstream str;
     1412    str << "Current Pixel val.: " << GLWindow->eventData[idx];
     1413    currentPixelValue->setText(QString(str.str().c_str()));
     1414}
     1415
     1416/************************************************************
     1417 * CURRENT SLICE HAS CHANGE. ui handler
     1418 ************************************************************/
     1419void UIConnector::currentSliceHasChanged(int slice)
     1420{
     1421    if (!GLWindow->nRoi)
     1422        return;
     1423
    14091424    if (updateSpinnerDisplay)
    14101425        displayingSliceBox->setValue(slice);
    14111426
    1412     ostringstream str;
    1413     str << "Current Pixel val.: " << GLWindow->eventData[GLWindow->nRoi*GLWindow->selectedPixel + GLWindow->whichSlice];
    1414     currentPixelValue->setText(QString(str.str().c_str()));
    1415 
    1416 }
    1417 /************************************************************
     1427    displaySliceValue();
     1428}
     1429
     1430/*****
     1431 *******************************************************
    14181432 * CURRENT EVENT HAS CHANGED. ui handler
    14191433 ************************************************************/
     1434
    14201435double xval[50000];
    14211436double yval[50000];
     
    14721487    triggerTypeLabel->setText(QString(str.str().c_str()));
    14731488
    1474     str.str("");
    1475     str << "Current Pixel val.: " << GLWindow->eventData[GLWindow->nRoi*GLWindow->selectedPixel + GLWindow->whichSlice];
    1476     currentPixelValue->setText(QString(str.str().c_str()));
     1489    displaySliceValue();
    14771490
    14781491    if (autoScaleColor->isChecked())
     
    18071820    triggerDelayHistoZoom->setZoomStack(stack);
    18081821    stack.pop();
     1822
    18091823    pixelChanged(GLWindow->selectedPixel);
    18101824}
     
    19331947
    19341948}
     1949
    19351950void UIConnector::pixelChanged(int pixel)
    19361951{
    19371952    pixel = GLWindow->hardwareMapping[pixel];
     1953
    19381954    HwIDBox->setValue(pixel);
    19391955
     
    19701986    stack.pop();
    19711987
    1972     ostringstream str;
    1973     QString qstr;
    1974     str << "Current Pixel val.: " << GLWindow->eventData[GLWindow->nRoi*GLWindow->selectedPixel + GLWindow->whichSlice];
    1975     currentPixelValue->setText(qstr.fromStdString(str.str()));
     1988    displaySliceValue();
    19761989    on_autoScaleColor_clicked();
    19771990}
     
    19972010    updating = false;
    19982011
    1999     pixelChanged(GLWindow->softwareMapping[hwID]);
    2000 
    20012012    GLWindow->selectedPixel = GLWindow->softwareMapping[hwID];
    20022013    GLWindow->updateGL();
     2014
     2015    pixelChanged(GLWindow->selectedPixel);
    20032016}
    20042017
  • trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h

    r12185 r12188  
    248248    void on_blueValue4_valueChanged(double);
    249249
    250     void pixelChanged(int pixel);
     250    void pixelChanged(int);
    251251
    252252    void cbpxChanged();
     
    269269    void on_displayingSliceBox_valueChanged(int);
    270270    void on_displayingEventBox_valueChanged(int);
     271
     272    void displaySliceValue();
    271273
    272274    int SetupConfiguration(Configuration &conf);
Note: See TracChangeset for help on using the changeset viewer.