... compiled!

This commit is contained in:
Timur A. Fatkhullin
2025-10-30 01:01:52 +03:00
parent 620f8ba136
commit 85259fc6ad
14 changed files with 261 additions and 216 deletions

View File

@@ -208,6 +208,177 @@ static auto Asibfm700MountConfigDefaults = std::make_tuple(
);
static constexpr std::string_view Asibfm700MountDefaultConfigString =
R"--(
#
# ASTROSIB FM-700 MOUNT DEFAULT CONFIGURATION
#
# (created 2025-10-01T03:00:00.0)
#
# main cycle period in millisecs
hardwarePollingPeriod = 100
# geographic coordinates of the observation site
# site latitude in degrees
siteLatitude = 43.646711
# site longitude in degrees
siteLongitude = 41.440732
# site elevation in meters
siteElevation = 2070.0
# celestial coordinate transformation
# wavelength at which refraction is calculated (in mkm)
refractWavelength = 0.5
# an empty filename means default precompiled string
leapSecondFilename =
# an empty filename means default precompiled string
bulletinAFilename =
# pointing correction model
# PCM default type:
# GEOMETRY - "classic" geometry-based correction coefficients
# GEOMETRY-BSPLINE - previous one and additional 2D B-spline corrections
# BSPLINE - pure 2D B-spline corrections
pcmType = GEOMETRY
# PCM geometrical coefficients
pcmGeomCoeffs = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
# PCM B-spline degrees
pcmBsplineDegree = 3, 3
# PCM B-spline knots along X-axis (HA-angle). By default from 0 to 2*PI radians
pcmBsplineXknots = 0.0, 0.6981317, 1.3962634, 2.0943951, 2.7925268, 3.4906585, 4.1887902, 4.88692191, 5.58505361, 6.28318531
# PCM B-spline knots along Y-axis (declination-angle). By default from -PI/6 to PI/2 radians
pcmBsplineYknots = -0.52359878, -0.29088821, -0.05817764, 0.17453293, 0.40724349, 0.63995406, 0.87266463, 1.10537519, 1.33808576, 1.57079633
# PCM B-spline coeffs for along X-axis (HA-angle)
pcmBsplineXcoeffs =
# PCM B-spline coeffs for along Y-axis (declination-angle)
pcmBsplineYcoeffs =
# slewing and tracking parameters
# arcseconds per second
#sideralRate = 15.0410686
# timeout for telemetry updating in milliseconds
telemetryTimeout = 3000
# minimal allowed time in seconds to prohibited zone
minTimeToPZone = 10
# a time interval to update prohibited zones related quantities (millisecs)
updatingPZoneInterval = 5000
# coordinates difference in arcsecs to stop slewing
slewToleranceRadius = 5.0
# target-mount coordinate difference in arcsecs to start adjusting of slewing
adjustCoordDiff = 50.0
# minimum time in millisecs between two successive adjustments
adjustCycleInterval = 300
# slew process timeout in seconds
slewTimeout = 3600
# a time shift into future to compute target position in future (UT1-scale time duration, millisecs)
timeShiftToTargetPoint = 10000
# minimum time in millisecs between two successive tracking corrections
trackingCycleInterval = 300
# maximal valid target-to-mount distance for tracking process (arcsecs)
# if current distance is greater than assume current mount coordinate as target point
trackingMaxCoordDiff = 20.0
# prohibited zones
# minimal altitude in degrees
pzMinAltitude = 10.0
# HA-axis limit switch minimal value in degrees
pzLimitSwitchHAMin = -170.0
# HA-axis limit switch maximal value in degrees
pzLimitSwitchHAMax = 170.0
# DEC-axis limit switch minimal value in degrees
pzLimitSwitchDecMin = -90.0
# DEC-axis limit switch maximal value in degrees
pzLimitSwitchDecMax = 90.0
# hardware-related
# hardware mode: 1 - model mode, otherwise real mode
RunModel = 0
# mount serial device paths
MountDevPath = /dev/ttyUSB0
# mount serial device speed
MountDevSpeed = 19200
# motor encoders serial device path
EncoderDevPath =
# X-axis encoder serial device path
EncoderXDevPath = /dev/encoderX0
# Y-axis encoder serial device path
EncoderYDevPath = /dev/encoderY0
# encoders serial device speed
EncoderDevSpeed = 153000
# ==1 if encoder works as separate serial device, ==2 if there's new version with two devices
SepEncoder = 2
# mount polling interval in millisecs
MountReqInterval = 100
# encoders polling interval in millisecs
EncoderReqInterval = 50
# mount axes rate calculation interval in millisecs
EncoderSpeedInterval = 100
# X-axis coordinate PID P,I,D-params
XPIDC = 0.8, 0.1, 0.3
# X-axis rate PID P,I,D-params
XPIDV = 1.0, 0.01, 0.2
# Y-axis coordinate PID P,I,D-params
YPIDC = 0.8, 0.1, 0.3
# Y-axis rate PID P,I,D-params
YPIDV = 0.5, 0.2, 0.5
# maximal moving rate (degrees per second) along HA-axis (Y-axis of Sidereal servo microcontroller)
hwMaxRateHA = 8.0
# maximal moving rate (degrees per second) along DEC-axis (X-axis of Sidereal servo microcontroller)
hwMaxRateDEC = 10.0
)--";
class Asibfm700MountConfig : public mcc::utils::KeyValueHolder<decltype(Asibfm700MountConfigDefaults)>
{
@@ -227,14 +398,14 @@ protected:
} else if constexpr (std::same_as<VT, mcc::MccAngle>) { // assume here all angles are in degrees
double vd;
// ec = base_t::defaultDeserializeFunc(str, vd);
ec = deser(str, value);
ec = deser(str, vd);
if (!ec) {
value = mcc::MccAngle(vd, mcc::MccDegreeTag{});
}
} else if constexpr (std::same_as<VT, mcc::MccDefaultPCMType>) {
std::string vstr;
// ec = base_t::defaultDeserializeFunc(str, vstr);
ec = deser(str, value);
ec = deser(str, vstr);
if (!ec) {
auto s = mcc::utils::trimSpaces(vstr);
@@ -620,172 +791,22 @@ public:
return ec;
}
// dump default values to file
static bool dumpDefaults(const std::filesystem::path& path)
{
std::ofstream fst(path);
if (!fst.is_open()) {
return false;
}
fst << asibfm700::Asibfm700MountDefaultConfigString;
fst.close();
return true;
}
};
static constexpr std::string_view Asibfm700MountConfigString =
R"--(
#
# ASTROSIB FM-700 MOUNT DEFAULT CONFIGURATION
#
# (created 2025-10-01T03:00:00.0)
#
# main cycle period
hardwarePollingPeriod = 100
# geographic coordinates of the observation site
# site latitude in degrees
siteLatitude = 43.646711
# site longitude in degrees
siteLongitude = 41.440732
# site elevation in meters
siteElevation = 2070.0
# celestial coordinate transformation
# wavelength at which refraction is calculated (in mkm)
refractWavelength = 0.5
# an empty filename means default precompiled string
leapSecondFilename =
# an empty filename means default precompiled string
bulletinAFilename =
# pointing correction model
# PCM default type
pcmType = GEOMETRY
# PCM geometrical coefficients
pcmGeomCoeffs = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
# PCM B-spline degrees
pcmBsplineDegree = 3, 3
# PCM B-spline knots along X-axis (HA-angle or azimuth). By default from 0 to 2*PI radians
pcmBsplineXknots = 0.0, 0.6981317, 1.3962634, 2.0943951, 2.7925268, 3.4906585, 4.1887902, 4.88692191, 5.58505361, 6.28318531
# PCM B-spline knots along Y-axis (declination or zenithal distance). By default from -PI/6 to PI/2 radians
pcmBsplineYknots = -0.52359878, -0.29088821, -0.05817764, 0.17453293, 0.40724349, 0.63995406, 0.87266463, 1.10537519, 1.33808576, 1.57079633
# PCM B-spline coeffs for along X-axis (HA-angle or azimuth)
pcmBsplineXcoeffs =
# PCM B-spline coeffs for along Y-axis (declination or zenithal distance)
pcmBsplineYcoeffs =
# slewing and tracking parameters
# arcseconds per second
#sideralRate = 15.0410686
# timeout for telemetry updating in milliseconds
telemetryTimeout = 3000
# minimal allowed time in seconds to prohibited zone
minTimeToPZone = 10
# a time interval to update prohibited zones related quantities (millisecs)
updatingPZoneInterval = 5000
# coordinates difference in arcsecs to stop slewing
slewToleranceRadius = 5.0
# target-mount coordinate difference in arcsecs to start adjusting of slewing
adjustCoordDiff = 50.0
# minimum time in millisecs between two successive adjustments
adjustCycleInterval = 300
# slew process timeout in seconds
slewTimeout = 3600
# a time shift into future to compute target position in future (UT1-scale time duration, millisecs)
timeShiftToTargetPoint = 10000
# minimum time in millisecs between two successive tracking corrections
trackingCycleInterval = 300
# prohibited zones
# minimal altitude in degrees
pzMinAltitude = 10.0
# HA-axis limit switch minimal value in degrees
pzLimitSwitchHAMin = -170.0
# HA-axis limit switch maximal value in degrees
pzLimitSwitchHAMax = 170.0
# DEC-axis limit switch minimal value in degrees
pzLimitSwitchDecMin = -90.0
# DEC-axis limit switch maximal value in degrees
pzLimitSwitchDecMax = 90.0
# hardware-related
# hardware mode: 1 - model mode, otherwise real mode
RunModel = 0
# mount serial device paths
MountDevPath = /dev/ttyUSB0
# mount serial device speed
MountDevSpeed = 19200
# motor encoders serial device path
EncoderDevPath =
# X-axis encoder serial device path
EncoderXDevPath = /dev/encoderX0
# Y-axis encoder serial device path
EncoderYDevPath = /dev/encoderY0
# encoders serial device speed
EncoderDevSpeed = 153000
# ==1 if encoder works as separate serial device, ==2 if there's new version with two devices
SepEncoder = 2
# mount polling interval in millisecs
MountReqInterval = 100
# encoders polling interval in millisecs
EncoderReqInterval = 50
# mount axes rate calculation interval in millisecs
EncoderSpeedInterval = 100
# X-axis coordinate PID P,I,D-params
XPIDC = 0.8, 0.1, 0.3
# X-axis rate PID P,I,D-params
XPIDV = 1.0, 0.01, 0.2
# Y-axis coordinate PID P,I,D-params
YPIDC = 0.8, 0.1, 0.3
# Y-axis rate PID P,I,D-params
YPIDV = 0.5, 0.2, 0.5
# maximal moving rate (degrees per second) along HA-axis (Y-axis of Sidereal servo microcontroller)
hwMaxRateHA = 8.0
# maximal moving rate (degrees per second) along DEC-axis (X-axis of Sidereal servo microcontroller)
hwMaxRateDEC = 10.0
)--";
} // namespace asibfm700