Skip to content
Snippets Groups Projects
Commit 4bb48d58 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

Alpha axis introduced for OffSpecInstrumentItem

parent 99f14476
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,8 @@
#include "SimulationOptionsItem.h"
#include "OffSpecSimulation.h"
#include "TransformToDomain.h"
#include "AxesItems.h"
#include "Units.h"
//! Creates domain simulation from sample and instrument items.
std::unique_ptr<Simulation> DomainSimulationBuilder::createSimulation(const MultiLayerItem* sampleItem,
......@@ -64,6 +66,11 @@ std::unique_ptr<Simulation> DomainSimulationBuilder::createSimulation(const Mult
offspec->setSample(*P_multilayer);
offspec->setInstrument(*P_instrument);
auto beamItem = offspecInstrument->beamItem();
auto axisItem = dynamic_cast<BasicAxisItem*>(offspecInstrument->getItem(OffSpecInstrumentItem::P_ALPHA_AXIS));
offspec->setBeamParameters(beamItem->getWavelength(), *axisItem->createAxis(Units::degree), beamItem->getAzimuthalAngle());
// TODO Take care about distributions
// TransformToDomain::addDistributionParametersToSimulation(*gisasInstrument->beamItem(), gisas.get());
// Simulation options
......
......@@ -24,6 +24,7 @@
#include "ParameterTranslators.h"
#include "Instrument.h"
#include "IDetector2D.h"
#include "AxesItems.h"
namespace {
const QString background_group_label = "Type";
......@@ -134,8 +135,19 @@ GISASInstrumentItem::GISASInstrumentItem()
{
}
const QString OffSpecInstrumentItem::P_ALPHA_AXIS = "Alpha axis";
OffSpecInstrumentItem::OffSpecInstrumentItem()
: Instrument2DItem(Constants::OffSpecInstrumentType)
{
auto item = addGroupProperty(P_ALPHA_AXIS, Constants::BasicAxisType);
item->setToolTip("Incoming alpha range [deg]");
item->getItem(BasicAxisItem::P_TITLE)->setVisible(false);
item->getItem(BasicAxisItem::P_NBINS)->setToolTip("Number of points in scan");
item->getItem(BasicAxisItem::P_MIN)->setToolTip("Starting value [deg]");
item->getItem(BasicAxisItem::P_MAX)->setToolTip("Ending value [deg]");
item->setItemValue(BasicAxisItem::P_MIN, 0.0);
item->setItemValue(BasicAxisItem::P_MAX, 10.0);
}
......@@ -72,6 +72,8 @@ public:
class BA_CORE_API_ OffSpecInstrumentItem : public Instrument2DItem
{
public:
static const QString P_ALPHA_AXIS;
OffSpecInstrumentItem();
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment