diff --git a/GUI/Model/Sim/InstrumentItems.cpp b/GUI/Model/Sim/InstrumentItems.cpp index a75855eeec0861be2c002d28a40d840dd70dafb3..df5f14e9e53cbdff2c0cd9d923427d6a54d9cc8d 100644 --- a/GUI/Model/Sim/InstrumentItems.cpp +++ b/GUI/Model/Sim/InstrumentItems.cpp @@ -200,10 +200,8 @@ std::unique_ptr<PhysicalScan> ScanningInstrumentItem::createScan(const Scale& ax { const BeamDistributionItem* it = scanItem()->wavelengthItem(); ASSERT(it); - const auto* distr_item = - dynamic_cast<const SymmetricDistributionItem*>(it->distributionItem()); + const DistributionItem* distr_item = it->distributionItem(); ASSERT(distr_item); - const double scale = it->scaleFactor(); if (std::unique_ptr<IDistribution1D> distr = distr_item->createDistribution(scale)) result->setWavelengthDistribution(*distr); @@ -212,10 +210,8 @@ std::unique_ptr<PhysicalScan> ScanningInstrumentItem::createScan(const Scale& ax { const GrazingScanItem* it = scanItem()->grazingScanItem(); ASSERT(it); - const auto* distr_item = - dynamic_cast<const SymmetricDistributionItem*>(it->distributionItem()); + const DistributionItem* distr_item = it->distributionItem(); ASSERT(distr_item); - const double scale = it->scaleFactor(); if (std::unique_ptr<IDistribution1D> distr = distr_item->createDistribution(scale)) result->setAngleDistribution(*distr);