private void SetPositionText() { if (!posTextChanged_) { return; } posTextChanged_ = false; string s = ""; if (connectionAltAzm_ == null || connectionEqu_ == null || alignment_ == null || !alignment_.IsAligned || object_ == null) { s += "--, --"; } else { double d = ClientCommonAPI.CalcTime(); double azm, alt; object_.CalcAzimuthal(d, latitude_, longitude_, out azm, out alt); PairA objScope = alignment_.Horz2Scope(new PairA(azm * Const.toRad, alt * Const.toRad), EquAngle); if (!showNearestAzmRotation_) { s += ClientCommonAPI.PrintAzmAltDifference(SkyObjectPosCalc.Rev(objScope.Azm * Const.toDeg) - AzmAngle * Const.toDeg, (objScope.Alt - AltAngle) * Const.toDeg, oppositeHorzPositioningDir_); } else { double azmd = SkyObjectPosCalc.Rev(objScope.Azm * Const.toDeg - AzmAngle * Const.toDeg); if (azmd > 180) { azmd -= 360; } s += ClientCommonAPI.PrintAzmAltDifference(azmd, (objScope.Alt - AltAngle) * Const.toDeg, oppositeHorzPositioningDir_); } } textBoxPosition.Text = s; }