Skip to content

Commit

Permalink
Work in progress of adding callback. This refs #5801
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanBilheux committed Oct 16, 2012
1 parent b617580 commit da7b0bb
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ public slots:
void spectrum_color_scale();
void edit_manual_input();

public signals:
void peak_back_tof_range_update();


private:

Ui_RefImageViewer* iv_ui;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class EXPORT_OPT_MANTIDQT_IMAGEVIEWER RefImageView : public QMainWindow
/// Construct an ImageView to display data from the specified data source
RefImageView( RefImageDataSource* data_source );

~RefImageView();

~RefImageView();
private:
GraphDisplay* h_graph;
GraphDisplay* v_graph;
Expand Down
13 changes: 13 additions & 0 deletions Code/Mantid/MantidQt/RefDetectorViewer/src/RefIVConnections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,19 @@ void RefIVConnections::graph_range_changed()
// v_graph_display->SetRangeScale( range_scale );
}

void RefImageView::peak_back_tof_range_update ()
{
std::cout << "Inside RefImageView::peak_back_tof_range_update"<< std::endl;
double peakmin = iv_ui->lineEdit_peakLeft->text()->toDouble();
double peakmax = iv_ui->lineEdit_peakRight->text()->toDouble();
double backmin = iv_ui->lineEdit_backLeft->text()->toDouble();
double backmax = iv_ui->lineEdit_backright->text()->toDouble();
double tofmin = iv_ui->lineEdit_TOFmin->text()->toDouble();
double tofmax = iv_ui->lineEdit_TOFmax->text()->toDouble();
std::cout << "peakmin: " << peakmin << std::endl;
emit peak_back_tof_range_update(peakmin, peakmax, backmin, backmax, tofmin, tofmax);
}

void RefIVConnections::edit_manual_input()
{

Expand Down
3 changes: 1 addition & 2 deletions Code/Mantid/MantidQt/RefDetectorViewer/src/RefImageView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ RefImageView::RefImageView( RefImageDataSource* data_source )

image_display->SetDataSource( data_source );
}



RefImageView::~RefImageView()
{
// std::cout << "ImageView destructor called" << std::endl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -876,40 +876,38 @@ def _plot_data_count_vs_tof_2d(self):
# if is_pixel_y is False:
# ws_output_base = "Counts vs X pixel - %s" % basename
# x_title = "X pixel"

range_min = int(self._summary.data_from_tof.text())
range_max = int(self._summary.data_to_tof.text())


# range_min = int(self._summary.data_from_tof.text())
# range_max = int(self._summary.data_to_tof.text())

# min_ctrl = self._summary.data_from_tof
# max_ctrl = self._summary.data_to_tof

ws_output_base = "Peak - " + basename + " - Y pixel "
ws_output_base_2d = ws_output_base + "_2D"
ws_output_base = "Peak - " + basename + " - Y pixel _2D"
if mtd.workspaceExists(ws_output_base):
mtd.deleteWorkspace(ws_output_base)
ws_output_base1 = "__" + basename
mtd.deleteWorkspace(ws_output_base1)
ws_output_base2 = ws_output_base1 + "_all"
mtd.deleteWorkspace(ws_output_base2)
mtd.deleteWorkspace(ws_output_base_2d)
ws_output_base_1 = "__" + self.instrument_name + "_" + str(run_number) + "_event.nxs"
mtd.deleteWorkspace(ws_output_base_1)
ws_output_base_2 = "__" + self.instrument_name + "_" + str(run_number) + "_event.nxs_all"
mtd.deleteWorkspace(ws_output_base_2)
ws_output_base_3 = "Peak - " + self.instrument_name + "_" + str(run_number) + "_event.nxs - Y pixel "
mtd.deleteWorkspace(ws_output_base_3)

data_manipulation.counts_vs_pixel_distribution(file_path,
True,
None)

None)

def call_back(peakmin, peakmax, backmin, backmax, tofmin, tofmax):
print 'Inside the call_back on the python side'
# self._summary.data_peak_from_pixel.setText("%-d" % int(peakmin))
# self._summary.data_peak_to_pixel.setText("%-d" % int(peakmax))
# self._summary.data_background_from_pixel1.setText("%-d" % int(backmin))
# self._summary.data_background_to_pixel1.setText("%-d" % int(backmax))
# self._summary.x_min_edit.setText("%-d" % int(tofmin))
# self._summary.x_max_edit.setText("%-d" % int(tofmax))

import _qti
_qti.app.connect(_qti.app.mantidUI, QtCore.SIGNAL("peak_back_tof_range_update(double,double,double,double,double,double)"), call_back)

# def call_back(xmin, xmax):
# min_ctrl.setText("%-d" % int(xmin))
# max_ctrl.setText("%-d" % int(xmax))

# _qti.app.connect(_qti.app.mantidUI,
# QtCore.SIGNAL("x_range_update(double,double)"),
# call_back)
import mantidqtpython
mantidqtpython.MantidQt.RefDetectorViewer.RefMatrixWSImageView(ws_output_base_2d)


mantidqtpython.MantidQt.RefDetectorViewer.RefMatrixWSImageView(ws_output_base)

def _norm_count_vs_y(self):

Expand Down

0 comments on commit da7b0bb

Please sign in to comment.