A simple CCD device that can capture images and control temperature. It returns a FITS image to the client. To build drivers for complex CCDs, please refer to the INDI Generic CCD driver template in INDI SVN (under 3rdparty).
#include <memory>
#define currentCCDTemperature TemperatureNP[0].value
{
LOG_INFO(
"Simple CCD connected successfully!");
return true;
}
{
LOG_INFO(
"Simple CCD disconnected successfully!");
return true;
}
{
return "Simple CCD";
}
{
return true;
}
{
{
setupParams();
}
return true;
}
void SimpleCCD::setupParams()
{
}
{
ExposureRequest = duration;
ExposureTimer.start();
InExposure = true;
return true;
}
{
InExposure = false;
return true;
}
{
return 0;
}
float SimpleCCD::CalcTimeLeft()
{
return ExposureRequest - ExposureTimer.elapsed() / 1000.0;
}
{
return;
if (InExposure)
{
double timeleft = CalcTimeLeft();
if (timeleft < 0.1)
{
LOG_INFO(
"Exposure done, downloading image...");
InExposure = false;
grabImage();
}
else
}
{
break;
else
{
LOG_WARN(
"Target temperature reached.");
break;
}
break;
break;
}
}
void SimpleCCD::grabImage()
{
for (int i = 0; i < height; i++)
for (int j = 0; j < width; j++)
image[i * width + j] = rand() % 255;
}
virtual bool ExposureComplete(CCDChip *targetChip)
Uploads target Chip exposed buffer as FITS to the client. Derived classes should class this function ...
INDI::PropertyNumber TemperatureNP
TemperatureNP Camera Temperature in Celcius.
virtual bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
void SetCCDCapability(uint32_t cap)
SetCCDCapability Set the CCD capabilities. All fields must be initialized.
virtual void SetCCDParams(int x, int y, int bpp, float xf, float yf)
Setup CCD parameters for primary CCD. Child classes call this function to update CCD parameters.
void setDefaultPollingPeriod(uint32_t msec)
setDefaultPollingPeriod Change the default polling period to call TimerHit() function in the driver.
uint32_t getCurrentPollingPeriod() const
getCurrentPollingPeriod Return the current polling period.
void addAuxControls()
Add Debug, Simulation, and Configuration options to the driver.
int SetTimer(uint32_t ms)
Set a timer to call the function TimerHit after ms milliseconds.
int SetTemperature(double temperature) override
Set CCD temperature.
bool Disconnect() override
Disconnect from device.
bool AbortExposure() override
Abort ongoing exposure.
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
const char * getDefaultName() override
bool StartExposure(float duration) override
Start exposing primary CCD chip.
void TimerHit() override
Callback function to be called once SetTimer duration elapses.
std::unique_ptr< SimpleCCD > simpleCCD(new SimpleCCD())
#define currentCCDTemperature
Construct a basic INDI CCD device that simulates exposure & temperature settings. It also generates a...