38 auto date = Mantid::Types::Core::DateAndTime::getCurrentTime().toISO8601String();
63 auto slit1Component =
instrument->getComponentByName(
"slit1");
64 auto slit2Component =
instrument->getComponentByName(
"slit2");
65 auto sampleComponent =
instrument->getComponentByName(
"some-surface-holder");
67 if (slit1Component.get() !=
nullptr && slit2Component.get() !=
nullptr && sampleComponent.get() !=
nullptr) {
69 const double s1s2 = 1e3 * (slit1Component->getDistance(*slit2Component));
71 ui.spinSlit1Slit2->setValue(s1s2);
73 const double s2sa = 1e3 * (slit2Component->getDistance(*sampleComponent));
75 ui.spinSlit2Sample->setValue(s2sa);
80 ui.spinSlit1Slit2->setValue(0.0);
81 ui.spinSlit2Sample->setValue(0.0);
95 const double s1s2 =
ui.spinSlit1Slit2->value();
96 const double s2sa =
ui.spinSlit2Sample->value();
97 const double res =
ui.spinResolution->value();
98 const double footprint =
ui.spinFootprint->value();
99 const double angle =
ui.spinAngle->value();
103 algSlit->initialize();
104 algSlit->setChild(
true);
105 algSlit->setProperty(
"Slit1Slit2", s1s2);
106 algSlit->setProperty(
"Slit2SA", s2sa);
107 algSlit->setProperty(
"Resolution", res);
108 algSlit->setProperty(
"Footprint", footprint);
109 algSlit->setProperty(
"Angle", angle);
112 const double s1 = algSlit->getProperty(
"Slit1");
113 const double s2 = algSlit->getProperty(
"Slit2");
116 ui.slit1Text->setText(QString::number(s1,
'f', 3));
117 ui.slit2Text->setText(QString::number(s2,
'f', 3));
static std::string getInstrumentFilename(const std::string &instrumentName, const std::string &date="")
Get the IDF using the instrument name and date.
Helper class for reporting progress from algorithms.
Creates an instrument data from a XML instrument description file.
std::shared_ptr< Instrument > parseXML(Kernel::ProgressBase *progressReporter)
Parse XML contents.
std::string getMangledName()
Handle used in the singleton constructor for instrument file should append the value file sha-1 check...
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.
MANTID_KERNEL_DLL std::string loadFile(const std::string &filename)
Loads the entire contents of a text file into a string.