Skip to content

Commit b004e18

Browse files
author
ControlSFEL
committed
Added TX term to TPoint model.
1 parent 9d32d2f commit b004e18

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

LibDegorasSLR/includes/LibDegorasSLR/TrackingMount/models/tpoint/tpoint_tools.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ enum class TPointCoefficientId : std::int16_t
6060
AW,
6161
NPAE,
6262
TF,
63+
TX,
6364
H
6465
};
6566

LibDegorasSLR/sources/TrackingMount/models/tpoint/tpoint_tools.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ TPointCoefficientId fromString(const std::string &term_name)
6565
id = TPointCoefficientId::NPAE;
6666
else if (term_name == "TF")
6767
id = TPointCoefficientId::TF;
68+
else if (term_name.size() >= 2 && term_name[0] == 'T' && term_name[1] == 'X')
69+
id = TPointCoefficientId::TX;
6870
}
6971

7072
return id;
@@ -137,6 +139,33 @@ AltAzCorrection computeSingleCoefficient(const TPointSingleCoefficient& coef, co
137139
offsets.el = -coefValue * sin(PI_HALF - elevation); // The correction is from zenith, so change sign.
138140
break;
139141

142+
case TPointCoefficientId::TX:
143+
if (coef.name == "TX")
144+
{
145+
offsets.el = -coefValue * tan(PI_HALF - elevation); // The correction is from zenith, so change sign.
146+
}
147+
else if (coef.name == "TXL")
148+
{
149+
offsets.el = -coefValue / tan(elevation);
150+
}
151+
else if (coef.name == "TX5")
152+
{
153+
if (elevation > dpslr::math::units::degToRad(5.))
154+
offsets.el = -coefValue * tan(PI_HALF - elevation); // The correction is from zenith, so change sign.
155+
}
156+
else if (coef.name == "TX10")
157+
{
158+
if (elevation > dpslr::math::units::degToRad(10.))
159+
offsets.el = -coefValue * tan(PI_HALF - elevation); // The correction is from zenith, so change sign.
160+
}
161+
else if (coef.name == "TX15")
162+
{
163+
if (elevation > dpslr::math::units::degToRad(15.))
164+
offsets.el = -coefValue * tan(PI_HALF - elevation); // The correction is from zenith, so change sign.
165+
}
166+
break;
167+
168+
140169
case TPointCoefficientId::H:
141170
{
142171
// Parse harmonic term

0 commit comments

Comments
 (0)