Skip to content

Commit

Permalink
Update the value of TwoTheta in refl_gui's table.
Browse files Browse the repository at this point in the history
Refs #10198.
  • Loading branch information
Harry Jeffery committed Sep 1, 2014
1 parent 469dae7 commit 943ca37
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions Code/Mantid/scripts/Interface/ui/reflectometer/refl_gui.py
Expand Up @@ -683,13 +683,27 @@ def _process(self):
else:
Load(Filename=runno[0], OutputWorkspace="run")
loadedRun = mtd["run"]
angle_entry = str(self.tableMain.item(row, 1).text()) # use the first angle entry
two_theta_str = str(self.tableMain.item(row, 1).text())
try:
angle_entry=float(angle_entry)
dqq = CalculateResolution(Workspace=loadedRun, TwoTheta=angle_entry)
item = QtGui.QTableWidgetItem()
item.setText(str(dqq))
self.tableMain.setItem(row, 15, item)
two_theta = None
if len(two_theta_str) > 0:
two_theta = float(two_theta_str)
logger.error("casted value for two_theta:" + str(two_theta))

dqq, two_theta = CalculateResolution(Workspace = loadedRun, TwoTheta = two_theta)

logger.error("returned value for two_theta:" + str(two_theta))

#Put the calculated resolution into the table
resItem = QtGui.QTableWidgetItem()
resItem.setText(str(dqq))
self.tableMain.setItem(row, 15, resItem)

#Update the value for two_theta in the table
ttItem = QtGui.QTableWidgetItem()
ttItem.setText(str(two_theta))
self.tableMain.setItem(row, 1, ttItem)

logger.notice("Calculated resolution: " + str(dqq))
except IndexError:
self.statusMain.clearMessage()
Expand Down

0 comments on commit 943ca37

Please sign in to comment.