From bd0117f22285a4b360d2faa7da000c6445220280 Mon Sep 17 00:00:00 2001 From: Nikita Kostovsky Date: Tue, 6 Jan 2026 15:09:48 +0100 Subject: add top view for laser/range; add groups --- src/opticaldesign.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src/opticaldesign.cpp') diff --git a/src/opticaldesign.cpp b/src/opticaldesign.cpp index 01f6050..15d8001 100644 --- a/src/opticaldesign.cpp +++ b/src/opticaldesign.cpp @@ -3,6 +3,32 @@ // qt #include +OpticalDesign::OpticalDesign(QObject* parent) + : goodies::G_Object{parent} +{ + const auto emitActualZBaseTextChanged = [this]() { + emit actualZBaseTextChanged(actualZBaseText()); + }; + connect( + this, + qOverload<>(&OpticalDesign::actualZBaseMmChanged), + this, + emitActualZBaseTextChanged + ); + connect( + this, + qOverload<>(&OpticalDesign::scannerBodyFrontWallOffsetMmChanged), + this, + emitActualZBaseTextChanged + ); + connect( + this, + qOverload<>(&OpticalDesign::scannerBodyWallThicknessMmChanged), + this, + emitActualZBaseTextChanged + ); +} + void OpticalDesign::calculate() const { const auto F = get_focalDistanceMm(); @@ -12,3 +38,25 @@ void OpticalDesign::calculate() const const auto hMm = get_sensorHeightMm(); const auto oAngle = get_opticalAxisAngleDegrees(); } + +/* +double OpticalDesign::fullBodyOffset() const +{ + return get_scannerBodyFrontWallOffsetMm() - + get_scannerBodyWallThicknessMm(); +} +*/ + +QString OpticalDesign::actualZBaseText() const +{ + constexpr int decimals{2}; + return QStringLiteral("%1 (%2)") + .arg(get_actualZBaseMm(), 0, 'f', decimals) + .arg( + get_actualZBaseMm() + get_scannerBodyFrontWallOffsetMm() - + get_scannerBodyWallThicknessMm(), + 0, + 'f', + decimals + ); +} -- cgit v1.2.3-70-g09d2