8#include <gtest/gtest.h>
18char _me[] =
"MockScopeSimDriver";
35 const char *types[] = {
"ALTAZ",
"EQ_FORK",
"EQ_GEM" };
38 for (
int i = 0; i < 3; i++)
41 names[i] =
const_cast<char *
>(types[i]);
77TEST(TelescopeSimulatorTest, switchingBetweenAltAzAndEquatorialClearsSyncPoints)
96TEST(TelescopeSimulatorTest, switchingBetweenEquatorialTypesKeepsSyncPoints)
112static void checkResyncReplacesOlderPoint(
const char *mountType)
118 ASSERT_TRUE(sim.
syncAt(9.50, 45.00));
122 ASSERT_TRUE(sim.
syncAt(9.51, 45.05));
128TEST(TelescopeSimulatorTest, resyncReplacesOlderSyncPointEquatorial)
130 checkResyncReplacesOlderPoint(
"EQ_GEM");
141 const std::string configFile =
"/tmp/test_telescope_simulator_" + std::to_string(getpid()) +
"_config.xml";
142 setenv(
"INDICONFIG", configFile.c_str(), 1);
145 ::testing::InitGoogleTest(&argc, argv);
146 int rc = RUN_ALL_TESTS();
147 std::remove(configFile.c_str());
148 std::remove((configFile +
".default").c_str());
AlignmentDatabaseType & GetAlignmentDatabase()
Get a reference to the in memory database.
bool syncAt(double ra, double dec)
void setLocation(double latitude, double longitude)
void selectMountType(const char *type)
const AlignmentDatabaseEntry & lastSyncPoint()
The ScopeSim class provides a simple mount simulator of an equatorial mount.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool Sync(double ra, double dec) override
Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates.
virtual void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
virtual bool initProperties() override
Called to initialize basic properties required all the time.
Entry in the in memory alignment database.
double RightAscension
Right ascension in decimal hours. N.B. libnova works in decimal degrees so conversion is always neede...
double ObservationJulianDate
double Declination
Declination in decimal degrees.
int PrivateDataSize
This size in bytes of any private data.
static const loggerConf file_off
void configure(const std::string &outputFile, const loggerConf configuration, const int fileVerbosityLevel, const int screenVerbosityLevel)
Method to configure the logger. Called by the DEBUG_CONF() macro. To make implementation easier,...
static Logger & getInstance()
Method to get a reference to the object (i.e., Singleton) It is a static method.
TEST(TelescopeSimulatorTest, switchingBetweenAltAzAndEquatorialClearsSyncPoints)