Skip to content
Snippets Groups Projects
Commit 87dd9bbf authored by t.knopff's avatar t.knopff
Browse files

Make DetectorItem ctor protected

parent 7d4af818
No related branches found
No related tags found
1 merge request!96Refactor model: detector items
......@@ -34,23 +34,6 @@ const QString DetectorItem::P_ANALYZER_DIRECTION = "Analyzer direction";
const QString DetectorItem::P_ANALYZER_EFFICIENCY = QString::fromStdString("Efficiency");
const QString DetectorItem::P_ANALYZER_TOTAL_TRANSMISSION = QString::fromStdString("Transmission");
DetectorItem::DetectorItem(const QString& modelType) : SessionItem(modelType)
{
registerTag(T_MASKS, 0, -1, QStringList() << "MaskContainer");
setDefaultTag(T_MASKS);
addProperty<VectorItem>(P_ANALYZER_DIRECTION)->setToolTip(analyzer_direction_tooltip);
addProperty(P_ANALYZER_EFFICIENCY, 0.0)
->setLimits(RealLimits::limitless())
.setToolTip(analyzer_efficiency_tooltip);
addProperty(P_ANALYZER_TOTAL_TRANSMISSION, 1.0)->setToolTip(analyzer_transmission_tooltip);
mapper()->setOnPropertyChange([this](const QString& name) {
if (name == P_RESOLUTION_FUNCTION)
update_resolution_function_tooltips();
});
}
std::unique_ptr<IDetector2D> DetectorItem::createDetector() const
{
auto result = createDomainDetector();
......@@ -133,6 +116,23 @@ SessionItem* DetectorItem::analyserTotalTransmissionItem() const
return getItem(P_ANALYZER_TOTAL_TRANSMISSION);
}
DetectorItem::DetectorItem(const QString& modelType) : SessionItem(modelType)
{
registerTag(T_MASKS, 0, -1, QStringList() << "MaskContainer");
setDefaultTag(T_MASKS);
addProperty<VectorItem>(P_ANALYZER_DIRECTION)->setToolTip(analyzer_direction_tooltip);
addProperty(P_ANALYZER_EFFICIENCY, 0.0)
->setLimits(RealLimits::limitless())
.setToolTip(analyzer_efficiency_tooltip);
addProperty(P_ANALYZER_TOTAL_TRANSMISSION, 1.0)->setToolTip(analyzer_transmission_tooltip);
mapper()->setOnPropertyChange([this](const QString& name) {
if (name == P_RESOLUTION_FUNCTION)
update_resolution_function_tooltips();
});
}
void DetectorItem::register_resolution_function()
{
auto item = addGroupProperty(P_RESOLUTION_FUNCTION, "Resolution function group");
......
......@@ -32,8 +32,6 @@ private:
static const QString P_ANALYZER_TOTAL_TRANSMISSION;
public:
explicit DetectorItem(const QString& modelType);
std::unique_ptr<IDetector2D> createDetector() const;
// TODO: consider using index-based access functions
......@@ -71,6 +69,8 @@ public:
SessionItem* analyserTotalTransmissionItem() const;
protected:
explicit DetectorItem(const QString& modelType);
void register_resolution_function();
void update_resolution_function_tooltips();
......
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