28 #define currentCCDTemperature TemperatureN[0].value
105 void SimpleCCD::setupParams()
120 ExposureRequest = duration;
125 ExposureTimer.
start();
146 TemperatureRequest = temperature;
155 float SimpleCCD::CalcTimeLeft()
157 return ExposureRequest - ExposureTimer.
elapsed() / 1000.0;
170 double timeleft = CalcTimeLeft();
230 void SimpleCCD::grabImage()
240 for (
int i = 0; i < height; i++)
241 for (
int j = 0; j < width; j++)
242 image[i * width + j] = rand() % 255;
const char * getDeviceName() const
uint8_t * getFrameBuffer()
getFrameBuffer Get raw frame buffer of the CCD chip.
void setExposureDuration(double duration)
setExposureDuration Set desired CCD frame exposure duration for next exposure. You must call this fun...
int getSubH() const
getSubH Get the height of the frame
int getBPP() const
getBPP Get CCD Chip depth (bits per pixel).
int getBinY() const
getBinY Get vertical binning of the CCD chip.
int getXRes() const
getXRes Get the horizontal resolution in pixels of the CCD Chip.
int getBinX() const
getBinX Get horizontal binning of the CCD chip.
void setExposureLeft(double duration)
setExposureLeft Update exposure time left. Inform the client of the new exposure time left value.
int getSubW() const
getSubW Get the width of the frame
void setFrameBufferSize(uint32_t nbuf, bool allocMem=true)
setFrameBufferSize Set desired frame buffer size. The function will allocate memory accordingly....
int getYRes() const
Get the vertical resolution in pixels of the CCD Chip.
virtual bool ExposureComplete(CCDChip *targetChip)
Uploads target Chip exposed buffer as FITS to the client. Dervied classes should class this function ...
virtual bool initProperties() override
Initilize 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. Al fields must be initialized.
INumberVectorProperty TemperatureNP
TemperatureNP Camera Temperature in Celcius.
virtual void SetCCDParams(int x, int y, int bpp, float xf, float yf)
Setup CCD paramters 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.
int64_t elapsed() const
Returns the number of milliseconds since this ElapsedTimer was last started.
void start()
Starts this timer. Once started, a timer value can be checked with elapsed().
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
Initilize 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.
void IDSetNumber(const INumberVectorProperty *nvp, const char *fmt,...)
void IDMessage(const char *dev, const char *fmt,...)
#define currentCCDTemperature
std::unique_ptr< SimpleCCD > simpleCCD(new SimpleCCD())
Construct a basic INDI CCD device that simulates exposure & temperature settings. It also generates a...