28 #define currentReceiverTemperature TemperatureN[0].value
59 return "Simple Receiver";
119 void SimpleReceiver::setupParams()
134 IntegrationRequest = duration;
139 gettimeofday(&CapStart,
nullptr);
141 InIntegration =
true;
152 InIntegration =
false;
161 TemperatureRequest = temperature;
170 float SimpleReceiver::CalcTimeLeft()
179 gettimeofday(&now,
nullptr);
181 timesince = (double)(now.tv_sec * 1000.0 + now.tv_usec / 1000) -
182 (double)(CapStart.tv_sec * 1000.0 + CapStart.tv_usec / 1000);
183 timesince = timesince / 1000;
185 timeleft = IntegrationRequest - timesince;
201 timeleft = CalcTimeLeft();
214 InIntegration =
false;
261 void SimpleReceiver::grabFrame()
271 for (
int i = 0; i < len; i++)
272 continuum[i] = rand() % 255;
const char * getDeviceName() const
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.
void setGain(double gain)
setGain Set gain of Receiver device.
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
void setBandwidth(double bandwidth)
setBandwidth Set bandwidth of Receiver device.
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
void setFrequency(double freq)
setFrequency Set the frequency observed.
double getSampleRate()
getSampleRate Get requested sample rate for the sensor in Hz.
void setSampleRate(double sr)
setSampleRate Set depth of Receiver device.
void SetCapability(uint32_t cap)
SetCapability Set the Sensor capabilities. Al fields must be initialized.
void setBPS(int bps)
setBPP Set depth of Sensor device.
void setBufferSize(int nbuf, bool allocMem=true)
setBufferSize Set desired buffer size. The function will allocate memory accordingly....
void setIntegrationLeft(double duration)
setIntegrationLeft Update Integration time left. Inform the client of the new Integration time left v...
uint8_t * getBuffer()
getBuffer Get raw buffer of the stream of the Sensor device.
void setIntegrationTime(double duration)
setIntegrationTime Set desired Sensor frame Integration duration for next Integration....
INumberVectorProperty TemperatureNP
virtual bool IntegrationComplete()
Uploads target Device exposed buffer as FITS to the client. Dervied classes should class this functio...
int getBPS() const
getBPS Get Sensor depth (bits per sample).
double getIntegrationTime() const
getIntegrationTime Get requested Integration duration for the Sensor device in seconds.
void TimerHit() override
Callback function to be called once SetTimer duration elapses.
bool StartIntegration(double duration) override
Start integration from the Sensor device.
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...
bool Disconnect() override
Disconnect from device.
const char * getDefaultName() override
int SetTemperature(double temperature) override
Set Sensor temperature.
bool paramsUpdated(float sr, float freq, float bps, float bw, float gain)
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
bool AbortIntegration() override
Abort ongoing Integration.
void IDSetNumber(const INumberVectorProperty *nvp, const char *fmt,...)
void IDMessage(const char *dev, const char *fmt,...)
std::unique_ptr< SimpleReceiver > simpleReceiver(new SimpleReceiver())
#define currentReceiverTemperature