3#include <gtest/gtest.h>
7char _me[] =
"MockGuideSimDriver";
22 ASSERT_TRUE(p.isValid());
23 ASSERT_NE(p.findWidgetByName(
"SIM_XRES"),
nullptr);
24 ASSERT_NE(p.findWidgetByName(
"SIM_YRES"),
nullptr);
25 ASSERT_NE(p.findWidgetByName(
"SIM_XSIZE"),
nullptr);
26 ASSERT_NE(p.findWidgetByName(
"SIM_YSIZE"),
nullptr);
27 ASSERT_NE(p.findWidgetByName(
"SIM_MAXVAL"),
nullptr);
28 ASSERT_NE(p.findWidgetByName(
"SIM_SATURATION"),
nullptr);
29 ASSERT_NE(p.findWidgetByName(
"SIM_LIMITINGMAG"),
nullptr);
30 ASSERT_NE(p.findWidgetByName(
"SIM_NOISE"),
nullptr);
31 ASSERT_NE(p.findWidgetByName(
"SIM_SKYGLOW"),
nullptr);
32 ASSERT_NE(p.findWidgetByName(
"SIM_OAGOFFSET"),
nullptr);
33 ASSERT_NE(p.findWidgetByName(
"SIM_POLAR"),
nullptr);
34 ASSERT_NE(p.findWidgetByName(
"SIM_POLARDRIFT"),
nullptr);
35 ASSERT_NE(p.findWidgetByName(
"SIM_KING_GAMMA"),
nullptr);
36 ASSERT_NE(p.findWidgetByName(
"SIM_KING_THETA"),
nullptr);
37 ASSERT_NE(p.findWidgetByName(
"SIM_RA_DRIFT"),
nullptr);
38 ASSERT_NE(p.findWidgetByName(
"SIM_DEC_DRIFT"),
nullptr);
47 double const arcsec = 1.0 / 3600.0;
76 p.findWidgetByName(
"SIM_NOISE")->setValue(0.0);
77 p.findWidgetByName(
"SIM_SKYGLOW")->setValue(15.0);
78 p.findWidgetByName(
"SIM_BIAS")->setValue(0.0);
89 for (
int i = 0; i < n; i++)
90 if (fb[i] > peak) peak = fb[i];
108 <<
"frame must contain sky glow even without GSC stars";
118 auto p =
getNumber(
"SIMULATOR_SETTINGS");
119 p.findWidgetByName(
"SIM_KING_GAMMA")->setValue(0.5);
120 p.findWidgetByName(
"SIM_KING_THETA")->setValue(45.0);
132 <<
"King path must still produce sky glow";
141 auto p =
getNumber(
"SIMULATOR_SETTINGS");
142 p.findWidgetByName(
"SIM_POLAR")->setValue(10.0);
143 p.findWidgetByName(
"SIM_POLARDRIFT")->setValue(1.0);
144 p.findWidgetByName(
"SIM_OAGOFFSET")->setValue(20.0);
145 p.findWidgetByName(
"SIM_RA_DRIFT")->setValue(0.5);
146 p.findWidgetByName(
"SIM_DEC_DRIFT")->setValue(0.3);
157 <<
"frame must contain sky glow with polar drift active";
161TEST(GuideSimulatorDriverTest, test_properties)
166TEST(GuideSimulatorDriverTest, test_guide_api)
171TEST(GuideSimulatorDriverTest, draw_ccd_frame_smoke_test)
176TEST(GuideSimulatorDriverTest, king_transform_smoke_test)
181TEST(GuideSimulatorDriverTest, polar_drift_smoke_test)
191 ::testing::InitGoogleTest(&argc, argv);
192 return RUN_ALL_TESTS();
The GuideSim class provides an advanced simulator for a CCD that includes a dedicated on-board guide ...
virtual IPState GuideNorth(uint32_t) override
Guide northward for ms milliseconds.
virtual IPState GuideEast(uint32_t) override
Guide easward for ms milliseconds.
void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
virtual IPState GuideSouth(uint32_t) override
Guide southward for ms milliseconds.
bool StartExposure(float duration) override
Start exposing primary CCD chip.
virtual IPState GuideWest(uint32_t) override
Guide westward for ms milliseconds.
INDI::PropertyNumber getNumber(const char *name) const
int getXRes() const
getXRes Get the horizontal resolution in pixels of the CCD Chip.
uint8_t * getFrameBuffer()
getFrameBuffer Get raw frame buffer of the CCD chip.
int getFrameBufferSize() const
getFrameBufferSize Get allocated frame buffer size to hold the CCD image frame.
int getYRes() const
Get the vertical resolution in pixels of the CCD Chip.
INDI::PropertyNumber ScopeInfoNP
void testKingTransformSmokeTest()
void testDrawCcdFrameSmokeTest()
void prepareForRendering()
void testPolarDriftSmokeTest()
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(GuideSimulatorDriverTest, test_properties)