Skip to content

Commit

Permalink
C++ version is working. Ready to connect to python. This refs #5801
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanBilheux committed Sep 11, 2012
1 parent ed6b6b1 commit 79e8f41
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
4 changes: 1 addition & 3 deletions Code/Mantid/MantidQt/RefDetectorViewer/src/IVConnections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,6 @@ void IVConnections::graph_range_changed()
void IVConnections::edit_manual_input()
{

std::cout << "here" << std::endl;

QLineEdit* peak_left_control = iv_ui->lineEdit_peakLeft;
double peak_left = 100;
if (!IVUtils::StringToDouble(peak_left_control->text().toStdString(), peak_left))
Expand Down Expand Up @@ -391,9 +389,9 @@ void IVConnections::edit_manual_input()
{
ErrorHandler::Error("TOF max is not a NUMBER! Value reset to 250.");
}
image_display->setTOFmax(tof_max);

image_display->UpdateImage();
std::cout << "peak_left: " << peak_left << std::endl;

}

Expand Down
6 changes: 0 additions & 6 deletions Code/Mantid/MantidQt/RefDetectorViewer/src/ImageDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,34 +544,28 @@ void ImageDisplay::ShowPeakBackSelectionValue(double x, double 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(xValue);
ImageDisplay::TOFmin = static_cast<int>(x);
return;
}
if (radioButtonTOFmax->isChecked()) { // tof max selected
lineEditTOFmax->setText(xValue);
ImageDisplay::TOFmax = static_cast<int>(x);
return;
}

UpdateImage(); //force refresh of the plot
Expand Down
3 changes: 2 additions & 1 deletion Code/Mantid/MantidQt/RefDetectorViewer/src/ImagePlotItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void ImagePlotItem::draw( QPainter * painter,
const QwtScaleMap & yMap,
const QRect & ) const
{
if ( !positive_color_table ) // if no color table, the data is not yet
if ( !positive_color_table ) // if no color table, the data is not yet
{ // set, so just return
return;
}
Expand Down Expand Up @@ -262,6 +262,7 @@ void ImagePlotItem::draw( QPainter * painter,
ImageDisplay* myImage;

float peakLeft = float(myImage->getPeakLeft());

if (peakLeft != 0) {
coeff_top_right = float(y_max) - float(peakLeft);
pixel_value = int((coeff_top_right / coeff_left) + float(pix_y_max));
Expand Down

0 comments on commit 79e8f41

Please sign in to comment.