Skip to content

Commit

Permalink
Properly document sample transmission interface
Browse files Browse the repository at this point in the history
Refs #11072
  • Loading branch information
DanNixon committed Feb 17, 2015
1 parent 45204c8 commit e59c110
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 1 deletion.
Expand Up @@ -30,6 +30,8 @@ namespace CustomInterfaces
SampleTransmission(QWidget *parent = 0);

private slots:
/// Opens the Qt help page for the interface
void showHelp();
/// Runs the calculation
void calculate();
/// Handle completion of the calculation algorithm
Expand Down
Expand Up @@ -270,6 +270,34 @@
</item>
<item>
<layout class="QHBoxLayout" name="loActionButtons">
<item>
<widget class="QPushButton" name="pbHelp">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>25</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>25</width>
<height>25</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Opens the help page for the interface.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>?</string>
</property>
</widget>
</item>
<item>
<spacer name="sActionButtons">
<property name="orientation">
Expand All @@ -285,6 +313,9 @@
</item>
<item>
<widget class="QPushButton" name="pbCalculate">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Runs the sample transmission calculation.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Calculate</string>
</property>
Expand Down
11 changes: 11 additions & 0 deletions Code/Mantid/MantidQt/CustomInterfaces/src/SampleTransmission.cpp
Expand Up @@ -5,6 +5,7 @@

#include "MantidAPI/AlgorithmManager.h"
#include "MantidKernel/Statistics.h"
#include "MantidQtAPI/HelpWindow.h"
#include "MantidQtCustomInterfaces/UserInputValidator.h"


Expand Down Expand Up @@ -45,11 +46,21 @@ void SampleTransmission::initLayout()
{
m_uiForm.setupUi(this);
connect(m_uiForm.pbCalculate, SIGNAL(clicked()), this, SLOT(calculate()));
connect(m_uiForm.pbHelp, SIGNAL(clicked()), this, SLOT(showHelp()));

validate(true);
}


/**
* Opens the Qt help page for the interface.
*/
void SampleTransmission::showHelp()
{
MantidQt::API::HelpWindow::showCustomInterface(NULL, QString("SampleTransmissionCalculator"));
}


/**
* Validate user input.
* Outputs any warnings to the results log at warning level.
Expand Down
Expand Up @@ -17,6 +17,8 @@ The sample chemical formula is input for the :ref:`SetSampleMaterial
number density & thickness is input to then calculate the percentage scattering
& transmission.

A flat plate sample which is perpendicular to the beam is assumed.

Usage
-----

Expand Down
Expand Up @@ -9,9 +9,52 @@ Overview

.. interface:: Sample Transmission Calculator
:align: right
:width: 350

The sample transmission calculator allows the calculation fo the sample
The sample transmission calculator allows the calculation of the sample
transmission and scattering over a given wavelength range for a particular
sample material and geometry.

This UI is a front end for the :ref:`CalculateSampleTransmission
<algm-CalculateSampleTransmission>` algorithm.

The algorithm assumes a flat plate sample which is perpendicular to the beam.

Input Wavelength
~~~~~~~~~~~~~~~~

.. interface:: Sample Transmission Calculator
:widget: gbRangeBinning
:align: right
:width: 350

The wavelength range to calculate transmission over can be given either by
providing a single binning range in the format of a start, width and end value or
by providing a bin parameter string as used in the :ref:`Rebin <algm-Rebin>`
algorithm.

Sample Details
~~~~~~~~~~~~~~

.. interface:: Sample Transmission Calculator
:widget: gbSampleDetails
:align: right
:width: 350

The sample details required are the chemical formula which is to be given in the
format expected by the :ref:`SetSampleMaterial <algm-SetSampleMaterial>`
algorithm, number density in :math:`\mathrm{\AA{}}^3` and thickness in :math:`cm`.

Output
~~~~~~

.. interface:: Sample Transmission Calculator
:widget: gbOutput
:align: right
:width: 350

The output is given in a plot of the transmission percentage over wavelength and
a table of statistics for the transmission (maximum, minimum, mean, median and
standard deviation) as well as the scattering percentage for all wavelengths.

.. categories:: Interfaces General

0 comments on commit e59c110

Please sign in to comment.