Skip to content
Snippets Groups Projects
Commit 7f59aafd authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

resolve further warnings from clang-tidy

parent 9e0b4bc0
No related branches found
No related tags found
1 merge request!347Resolve numerous warnings from clang-tidy; disable several rules
......@@ -212,23 +212,22 @@ bool SpecularInstrumentItem::alignedWith(const RealDataItem* item) const
if (native_units == "nbins") {
return beamItem()->currentInclinationAxisItem()->modelType() == BasicAxisItem::M_TYPE
&& shape() == item->shape();
} else {
auto axis_item = dynamic_cast<PointwiseAxisItem*>(beamItem()->currentInclinationAxisItem());
if (!axis_item)
return false;
if (axis_item->getUnitsLabel() != native_units)
return false;
auto instrument_axis = axis_item->axis();
if (!instrument_axis)
return false;
if (!item->hasNativeData())
return false;
const auto& native_axis = item->nativeOutputData()->axis(0);
return *instrument_axis == native_axis;
}
auto axis_item = dynamic_cast<PointwiseAxisItem*>(beamItem()->currentInclinationAxisItem());
if (!axis_item)
return false;
if (axis_item->getUnitsLabel() != native_units)
return false;
auto instrument_axis = axis_item->axis();
if (!instrument_axis)
return false;
if (!item->hasNativeData())
return false;
const auto& native_axis = item->nativeOutputData()->axis(0);
return *instrument_axis == native_axis;
}
ICoordSystem* SpecularInstrumentItem::createCoordSystem() const
......
......@@ -165,7 +165,6 @@ private:
virtual void setU0(double u0) = 0;
virtual void setV0(double v0) = 0;
private:
QDoubleSpinBox* m_u0SpinBox;
QDoubleSpinBox* m_v0SpinBox;
QDoubleSpinBox* m_distanceSpinBox;
......
......@@ -24,9 +24,6 @@
#include <QFormLayout>
#include <QStackedLayout>
#include <boost/polymorphic_cast.hpp>
using boost::polymorphic_downcast;
namespace {
// some temporary functions to be able to assign the value of a distribution to an other
......@@ -45,7 +42,7 @@ void assignSymmetric(const SymmetricDistributionItem* src, SymmetricDistribution
if (assignMean)
dst->setMean(src->mean());
}
void assign(const DistributionNoneItem* src, DistributionNoneItem* dst, const bool assignMean)
{
if (assignMean)
......@@ -92,7 +89,7 @@ void assign(const DistributionTrapezoidItem* src, DistributionTrapezoidItem* dst
dst->setMiddleWidth(src->middleWidth());
dst->setRightWidth(src->rightWidth());
}
void assign(const ItemWithDistribution* src, ItemWithDistribution* dst, const bool assignMean)
{
dst->setDistributionType(src->distribution()->modelType());
......@@ -152,7 +149,7 @@ DistributionSelector::DistributionSelector(const std::optional<MeanConfig>& mean
this, &DistributionSelector::distributionChanged);
m_stack->addWidget(cosform);
m_forms.emplace(DistributionCosineItem::M_TYPE, cosform);
if (m_distributions == Distributions::All) {
m_combo->addItem("Gate", DistributionGateItem::M_TYPE);
GateDistributionForm* gateform = new GateDistributionForm(this);
......@@ -168,7 +165,7 @@ DistributionSelector::DistributionSelector(const std::optional<MeanConfig>& mean
this, &DistributionSelector::distributionChanged);
m_stack->addWidget(gaussform);
m_forms.emplace(DistributionGaussianItem::M_TYPE, gaussform);
if (m_distributions == Distributions::All) {
m_combo->addItem("Log normal", DistributionLogNormalItem::M_TYPE);
LogNormalDistributionForm* lognormform = new LogNormalDistributionForm(this);
......
......@@ -13,6 +13,7 @@
// ************************************************************************************************
#include "GUI/Views/InstrumentWidgets/InstrumentEditor.h"
#include "Base/Utils/Assert.h"
#include "GUI/Models/InstrumentItems.h"
#include "GUI/Views/InstrumentWidgets/DepthProbeInstrumentEditor.h"
#include "GUI/Views/InstrumentWidgets/GISASInstrumentEditor.h"
......@@ -32,14 +33,13 @@ QString instrumentTypeName(InstrumentItem* instrument)
{
if (instrument->hasModelType<SpecularInstrumentItem>())
return "Specular";
else if (instrument->hasModelType<DepthProbeInstrumentItem>())
if (instrument->hasModelType<DepthProbeInstrumentItem>())
return "Depth probe";
else if (instrument->hasModelType<GISASInstrumentItem>())
if (instrument->hasModelType<GISASInstrumentItem>())
return "GISAS";
else if (instrument->hasModelType<OffSpecularInstrumentItem>())
if (instrument->hasModelType<OffSpecularInstrumentItem>())
return "Off specular";
else
return "unknown";
ASSERT(0);
}
} // namespace
......
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