BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
InstrumentEditController.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Instrument/InstrumentEditController.cpp
6 //! @brief Implements class InstrumentEditController
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
20 
22  InstrumentItem* instrument)
23  : m_instrumentItem(instrument)
24  , m_ec(ec)
25 {
26 }
27 
29 {
31 }
32 
34 {
35  if (d.get() != newValue) {
36  d.set(newValue);
38  }
39 }
40 
42 {
44 }
45 
47 {
48  // update values in pointwise axis. This is necessary after a change of the mean value of the
49  // wavelength.
50  if (auto* specularBeam = dynamic_cast<SpecularBeamItem*>(m_instrumentItem->beamItem())) {
51  if (auto* pw = dynamic_cast<PointwiseAxisItem*>(specularBeam->inclinationAxis()))
52  pw->updateIndicators();
53  }
54 
56 }
57 
59 {
60  // update wavelength. This is necessary after a change in the inclination axis type
61  if (auto* specularBeam = dynamic_cast<SpecularBeamItem*>(m_instrumentItem->beamItem()))
62  specularBeam->updateWavelength();
64 }
Defines class DoubleDescriptor.
Defines class InstrumentEditController.
Defines class InstrumentItem and all its children.
Defines class InstrumentsEditController.
Defines pointwise axis item.
Describes properties of a double value which are necessary to allow GUI representation,...
function< void(double)> set
function to set the value
function< double()> get
function to get the current value
void notifyWavelengthDistributionChanged()
Update dependent data and emit a changed signal.
InstrumentEditController(InstrumentsEditController *ec, InstrumentItem *instrument)
void setDouble(DoubleDescriptor &d, double newValue)
Sets the double and emits InstrumentsEditController::instrumentChanged if the double changed.
InstrumentsEditController * m_ec
void notifyInclinationAxisChanged()
Update dependent data and emit a changed signal.
void setInstrumentName(const QString &name)
Set the instrument name and emit the respective signal.
void notifyInstrumentChanged()
Call this if any instrument value has been changed outside this controller.
Abstract base class for instrument-specific item classes.
virtual BeamItem * beamItem() const
Class to modify the instruments list or a single instrument and provide the necessary signaling withi...
void instrumentChanged(const InstrumentItem *instrument)
Signals any change in the settings of the given instrument.
void setInstrumentName(InstrumentItem *instrument, const QString &name)
Set an instrument's name and emit the respective signal.
Item for non-uniform axis with specified coordinates.
QString const & name(EShape k)
Definition: particles.cpp:20