Skip to content

Commit

Permalink
update EqPENP property
Browse files Browse the repository at this point in the history
  • Loading branch information
naheedsa committed Feb 12, 2024
1 parent d14a995 commit 47d6909
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
24 changes: 12 additions & 12 deletions drivers/ccd/ccd_simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ bool CCDSim::initProperties()
ISR_ATMOST1, 0, IPS_IDLE);

// Periodic Error
IUFillNumber(&EqPEN[AXIS_RA], "RA_PE", "RA (hh:mm:ss)", "%010.6m", 0, 24, 0, 0);
IUFillNumber(&EqPEN[AXIS_DE], "DEC_PE", "DEC (dd:mm:ss)", "%010.6m", -90, 90, 0, 0);
IUFillNumberVector(&EqPENP, EqPEN, 2, getDeviceName(), "EQUATORIAL_PE", "EQ PE", SIMULATOR_TAB, IP_RW, 60,
EqPENP[AXIS_RA].fill("RA_PE", "RA (hh:mm:ss)", "%010.6m", 0, 24, 0, 0);
EqPENP[AXIS_DE].fill("DEC_PE", "DEC (dd:mm:ss)", "%010.6m", -90, 90, 0, 0);
EqPENP.fill(getDeviceName(), "EQUATORIAL_PE", "EQ PE", SIMULATOR_TAB, IP_RW, 60,
IPS_IDLE);

// FWHM
Expand Down Expand Up @@ -263,7 +263,7 @@ void CCDSim::ISGetProperties(const char * dev)
INDI::CCD::ISGetProperties(dev);

defineProperty(SimulatorSettingsNP);
defineProperty(&EqPENP);
defineProperty(EqPENP);
defineProperty(FocusSimulationNP);
defineProperty(SimulateBayerSP);
defineProperty(CrashSP);
Expand Down Expand Up @@ -1109,24 +1109,24 @@ SimulatorSettingsNP.setState(IPS_OK);
}
// Record PE EQ to simulate different position in the sky than actual mount coordinate
// This can be useful to simulate Periodic Error or cone error or any arbitrary error.
else if (!strcmp(name, EqPENP.name))
else if (EqPENP.isNameMatch(name))
{
IUUpdateNumber(&EqPENP, values, names, n);
EqPENP.s = IPS_OK;
EqPENP.update(values, names, n);
EqPENP.setState(IPS_OK);

INDI::IEquatorialCoordinates epochPos { 0, 0 }, J2000Pos { 0, 0 };
epochPos.rightascension = EqPEN[AXIS_RA].value;
epochPos.declination = EqPEN[AXIS_DE].value;
epochPos.rightascension = EqPENP[AXIS_RA].value;
epochPos.declination = EqPENP[AXIS_DE].value;

RA = EqPEN[AXIS_RA].value;
Dec = EqPEN[AXIS_DE].value;
RA = EqPENP[AXIS_RA].value;
Dec = EqPENP[AXIS_DE].value;

INDI::ObservedToJ2000(&epochPos, ln_get_julian_from_sys(), &J2000Pos);
currentRA = J2000Pos.rightascension;
currentDE = J2000Pos.declination;
usePE = true;

IDSetNumber(&EqPENP, nullptr);
EqPENP.apply();
return true;
}
else if (!strcmp(name, FilterSlotNP.name))
Expand Down
5 changes: 1 addition & 4 deletions drivers/ccd/ccd_simulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ class CCDSim : public INDI::CCD, public INDI::FilterInterface
SIM_SEEING
};

INumberVectorProperty EqPENP;
INumber EqPEN[2];
INDI::PropertyNumber EqPENP {2};

ISwitch CoolerS[2];
ISwitchVectorProperty CoolerSP;
Expand All @@ -253,8 +252,6 @@ class CCDSim : public INDI::CCD, public INDI::FilterInterface
CRASH
};

ISwitch CrashS[1];

INDI::PropertySwitch ResolutionSP {2};
inline static const std::vector<std::pair<uint32_t, uint32_t>> Resolutions =
{
Expand Down

0 comments on commit 47d6909

Please sign in to comment.