Skip to content

Commit

Permalink
Added the possibility to select the TOF range as well. This refs #5801
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanBilheux committed Sep 5, 2012
1 parent 6232478 commit 25dc157
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,6 @@ def isRunsSorted(list_runs, S1H, S2H):

return True


def calculateAndFit(numerator='',
denominator='',
list_peak_back_numerator=None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ class EXPORT_OPT_MANTIDQT_IMAGEVIEWER ImageDisplay
/// Show information about the point (x, y) on the image in the table
void ShowInfoList( double x, double y );

// Show information about the y value selected in peak/back/left/right boxes
void ShowPeakBackSelectionValue(double y );
// Show information about the x and y values selected in peak/back/tof/left/right boxes
void ShowPeakBackSelectionValue(double x, double y );

std::vector<QRgb> positive_color_table;
std::vector<QRgb> negative_color_table;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>50</width>
<width>30</width>
<height>20</height>
</size>
</property>
Expand Down
23 changes: 16 additions & 7 deletions Code/Mantid/MantidQt/RefDetectorViewer/src/ImageDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ void ImageDisplay::SetPointedAtPoint( QPoint point, int mouseClick)
ShowInfoList( x, y );
if (mouseClick == 1) //left click
{
ShowPeakBackSelectionValue(y);
ShowPeakBackSelectionValue(x, y);
}

}
Expand Down Expand Up @@ -536,33 +536,42 @@ void ImageDisplay::ShowInfoList( double x, double y )
*
* @param y The y coordinate of the pointed at location on the image.
*/
void ImageDisplay::ShowPeakBackSelectionValue(double y )
void ImageDisplay::ShowPeakBackSelectionValue(double x, double y )
{
// QString yValue = QString::number(int(y));

// QString yValue = QString::number(int(y));
QString yValue = QString("%1").arg(int(y));
if (radioButtonPeakLeft->isChecked()) { //peak left selected
lineEditPeakLeft->setText(yValue);
ImageDisplay::peakLeft = static_cast<int>(y);
return;
}
if (radioButtonPeakRight->isChecked()) { //peak right selected
lineEditPeakRight->setText(yValue);
ImageDisplay::peakRight = static_cast<int>(y);
return;
}
if (radioButtonBackLeft->isChecked()) { //back left selected
lineEditBackLeft->setText(yValue);
ImageDisplay::backLeft = static_cast<int>(y);
return;
}
if (radioButtonBackRight->isChecked()) { //back right selected
lineEditBackRight->setText(yValue);
ImageDisplay::backRight = static_cast<int>(y);
return;
}

QString xValue = QString("%1").arg(int(x));
if (radioButtonTOFmin->isChecked()) { //tof min selected
lineEditTOFmin->setText(yValue);
ImageDisplay::TOFmin = static_cast<int>(y);
lineEditTOFmin->setText(xValue);
ImageDisplay::TOFmin = static_cast<int>(x);
return;
}
if (radioButtonTOFmax->isChecked()) { // tof max selected
lineEditTOFmax->setText(yValue);
ImageDisplay::TOFmax = static_cast<int>(y);
lineEditTOFmax->setText(xValue);
ImageDisplay::TOFmax = static_cast<int>(x);
return;
}

UpdateImage(); //force refresh of the plot
Expand Down

0 comments on commit 25dc157

Please sign in to comment.