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

Azimuthal angle is added in real time view

parent bf42e54b
No related branches found
No related tags found
No related merge requests found
......@@ -221,6 +221,12 @@ void Simulation::setInstrument(const Instrument& instrument)
void Simulation::setBeamParameters(double lambda, double alpha_i, double phi_i)
{
if (lambda<=0.0) {
throw ClassInitializationException(
"Simulation::setBeamParameters() "
"-> Error. Incoming wavelength <= 0.");
}
m_instrument.setBeamParameters(lambda, alpha_i, phi_i);
}
......
......@@ -15,8 +15,8 @@ BeamItem::BeamItem(ParameterizedItem *parent)
{
setItemName(Constants::BeamType);
registerProperty(P_INTENSITY, 1e+08);
registerProperty(P_WAVELENGTH, 0.1, PropertyAttribute(AttLimits::lowerLimited(1e-3), 3));
registerProperty(P_AZIMUTHAL_ANGLE, AngleProperty::Degrees(0.0));
registerProperty(P_WAVELENGTH, 0.1, PropertyAttribute(AttLimits::lowerLimited(1e-4), 4));
registerProperty(P_AZIMUTHAL_ANGLE, AngleProperty::Degrees(0.0), PropertyAttribute(AttLimits::limited(-90.0, 90.0), 3));
registerProperty(P_INCLINATION_ANGLE, AngleProperty::Degrees(0.2));
}
......
......@@ -145,8 +145,12 @@ QStandardItem *ParameterModelBuilder::iterateInstrumentModel(InstrumentModel *in
insertRowIntoItem(standardItem, BeamItem::P_WAVELENGTH, beamItem->getRegisteredProperty(BeamItem::P_WAVELENGTH), beamItem);
double v = beamItem->getRegisteredProperty(BeamItem::P_INCLINATION_ANGLE).value<AngleProperty>().getValue();
QVariant variant(v);
insertRowIntoItem(standardItem, BeamItem::P_INCLINATION_ANGLE, variant, beamItem);
QVariant variant_inclination(v);
insertRowIntoItem(standardItem, BeamItem::P_INCLINATION_ANGLE, variant_inclination, beamItem);
v = beamItem->getRegisteredProperty(BeamItem::P_AZIMUTHAL_ANGLE).value<AngleProperty>().getValue();
insertRowIntoItem(standardItem, BeamItem::P_AZIMUTHAL_ANGLE, QVariant(v), beamItem);
}
}
......
......@@ -37,7 +37,8 @@ BeamEditorWidget::BeamEditorWidget(QWidget *parent)
m_intensityText->setValidator(m_intensityValidator);
m_wavelengthSpinBox->setSingleStep(0.1);
m_wavelengthSpinBox->setDecimals(3);
m_wavelengthSpinBox->setDecimals(4);
m_wavelengthSpinBox->setMinimum(0.0001);
m_wavelengthSpinBox->setMaximum(100.);
m_beamTypeCombo->addItem("Monochromatic");
......
......@@ -239,7 +239,7 @@ void CentralPlot::drawPlot(OutputDataItem *outputDataItem, QCPColorGradient grad
OutputData<double>::const_iterator it_max = std::max_element(data->begin(), data->end());
OutputData<double>::const_iterator it_min = std::min_element(data->begin(), data->end());
std::cout << "CentralPlot::drawPlot min max" << (*it_min) << " "<< (*it_max) << std::endl;
qDebug() << "CentralPlot::drawPlot min max" << (*it_min) << " "<< (*it_max);
this->setInteractions(QCP::iRangeDrag|QCP::iRangeZoom); // this will also allow rescaling the color scale by dragging/zooming
......
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