summaryrefslogtreecommitdiff
path: root/src/opticaldesign.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opticaldesign.cpp')
-rw-r--r--src/opticaldesign.cpp48
1 files changed, 48 insertions, 0 deletions
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 <QSize>
+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
+ );
+}