Skip to content

Commit

Permalink
Merge branch 'indilib:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
azwing authored Aug 26, 2023
2 parents 1ac1db0 + e3ab7c3 commit afb0869
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
5 changes: 4 additions & 1 deletion drivers/focuser/lacerta_mfoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,10 @@ IPState lacerta_mfoc::MoveAbsFocuser(uint32_t targetTicks)
IPState lacerta_mfoc::MoveRelFocuser(FocusDirection dir, uint32_t ticks)
{
// Calculation of the demand absolute position
auto targetTicks = std::clamp(FocusAbsPosN[0].value + (ticks * (dir == FOCUS_INWARD ? -1 : 1)), FocusAbsPosN[0].min, FocusAbsPosN[0].max);
auto targetTicks = FocusAbsPosN[0].value;
if (dir == FOCUS_INWARD) targetTicks -= ticks;
else targetTicks += ticks;
targetTicks = std::clamp(targetTicks, FocusAbsPosN[0].min, FocusAbsPosN[0].max);

FocusAbsPosNP.s = IPS_BUSY;
IDSetNumber(&FocusAbsPosNP, nullptr);
Expand Down
5 changes: 4 additions & 1 deletion drivers/focuser/lacerta_mfoc_fmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,10 @@ IPState lacerta_mfoc_fmc::MoveAbsFocuser(uint32_t targetTicks)
IPState lacerta_mfoc_fmc::MoveRelFocuser(FocusDirection dir, uint32_t ticks)
{
// Calculation of the demand absolute position
auto targetTicks = std::clamp(FocusAbsPosN[0].value + (ticks * (dir == FOCUS_INWARD ? -1 : 1)), FocusAbsPosN[0].min, FocusAbsPosN[0].max);
auto targetTicks = FocusAbsPosN[0].value;
if (dir == FOCUS_INWARD) targetTicks -= ticks;
else targetTicks += ticks;
targetTicks = std::clamp(targetTicks, FocusAbsPosN[0].min, FocusAbsPosN[0].max);

FocusAbsPosNP.s = IPS_BUSY;
IDSetNumber(&FocusAbsPosNP, nullptr);
Expand Down
17 changes: 8 additions & 9 deletions libs/indibase/indiccd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,28 +465,27 @@ bool CCD::initProperties()
IUFillTextVector(&ActiveDeviceTP, ActiveDeviceT, 5, getDeviceName(), "ACTIVE_DEVICES", "Snoop devices", OPTIONS_TAB,
IP_RW, 60, IPS_IDLE);

auto mount = ActiveDeviceT[ACTIVE_TELESCOPE].text ? ActiveDeviceT[ACTIVE_TELESCOPE].text : "";
// Snooped RA/DEC Property
IUFillNumber(&EqN[0], "RA", "Ra (hh:mm:ss)", "%010.6m", 0, 24, 0, 0);
IUFillNumber(&EqN[1], "DEC", "Dec (dd:mm:ss)", "%010.6m", -90, 90, 0, 0);
IUFillNumberVector(&EqNP, EqN, 2, ActiveDeviceT[ACTIVE_TELESCOPE].text, "EQUATORIAL_EOD_COORD", "EQ Coord", "Main Control",
IP_RW,
60, IPS_IDLE);
IUFillNumberVector(&EqNP, EqN, 2, mount, "EQUATORIAL_EOD_COORD", "EQ Coord", "Main Control", IP_RW, 60, IPS_IDLE);

// Snooped J2000 RA/DEC Property
IUFillNumber(&J2000EqN[0], "RA", "Ra (hh:mm:ss)", "%010.6m", 0, 24, 0, 0);
IUFillNumber(&J2000EqN[1], "DEC", "Dec (dd:mm:ss)", "%010.6m", -90, 90, 0, 0);
IUFillNumberVector(&J2000EqNP, J2000EqN, 2, ActiveDeviceT[ACTIVE_TELESCOPE].text, "EQUATORIAL_COORD", "J2000 EQ Coord",
IUFillNumberVector(&J2000EqNP, J2000EqN, 2, mount, "EQUATORIAL_COORD", "J2000 EQ Coord",
"Main Control", IP_RW,
60, IPS_IDLE);

// Snoop properties of interest

// Snoop mount
IDSnoopDevice(ActiveDeviceT[ACTIVE_TELESCOPE].text, "EQUATORIAL_EOD_COORD");
IDSnoopDevice(ActiveDeviceT[ACTIVE_TELESCOPE].text, "EQUATORIAL_COORD");
IDSnoopDevice(ActiveDeviceT[ACTIVE_TELESCOPE].text, "TELESCOPE_INFO");
IDSnoopDevice(ActiveDeviceT[ACTIVE_TELESCOPE].text, "GEOGRAPHIC_COORD");
IDSnoopDevice(ActiveDeviceT[ACTIVE_TELESCOPE].text, "TELESCOPE_PIER_SIDE");
IDSnoopDevice(mount, "EQUATORIAL_EOD_COORD");
IDSnoopDevice(mount, "EQUATORIAL_COORD");
IDSnoopDevice(mount, "TELESCOPE_INFO");
IDSnoopDevice(mount, "GEOGRAPHIC_COORD");
IDSnoopDevice(mount, "TELESCOPE_PIER_SIDE");

// Snoop Rotator
IDSnoopDevice(ActiveDeviceT[ACTIVE_ROTATOR].text, "ABS_ROTATOR_ANGLE");
Expand Down

0 comments on commit afb0869

Please sign in to comment.