46 setStream(buf, dims, sizes, bits_per_sample);
54 IUFillBLOB(&DownloadB,
"PHASE_DOWNLOAD",
"Phase",
"");
64 m_Device->defineProperty(&DownloadBP);
70 m_Device->deleteProperty(DownloadBP.name);
77 if(!phase_loaded)
return false;
78 setStream(buf, dims, sizes, bits_per_sample);
79 if (phase->dims !=
stream->dims)
return false;
80 for (
int d = 0; d <
stream->dims; d++)
81 if (phase->sizes[d] !=
stream->sizes[d])
91 char *formats[],
char *names[],
int n)
95 if(!strcmp(name, DownloadBP.name))
97 IUUpdateBLOB(&DownloadBP, sizes, blobsizes, blobs, formats, names,
n);
104 phase =
loadFITS(blobs[0], sizes[0]);
105 if (phase !=
nullptr)
127 setStream(buf, dims, sizes, bits_per_sample);
146 setStream(buf, dims, sizes, bits_per_sample);
virtual bool processBLOB(uint8_t *out, uint32_t dims, int *sizes, int bits_per_sample) override
processBLOB Propagate to Callback and generate BLOBs for parent device.
Histogram(INDI::DefaultDevice *dev)
Interface(INDI::DefaultDevice *dev, Type type=DSP_NONE, const char *name="DSP_PLUGIN", const char *label="DSP Plugin")
const char * getDeviceName()
virtual void Activated()
Activated Called after activation from client application.
virtual bool processBLOB(uint8_t *buf, uint32_t ndims, int *dims, int bits_per_sample)
processBLOB Propagate to Callback and generate BLOBs for parent device.
bool setStream(void *buf, uint32_t dims, int *sizes, int bits_per_sample)
INDI::DefaultDevice * m_Device
dsp_stream_p loadFITS(char *buf, int len)
loadFITS Converts FITS data into a dsp_stream structure pointer.
bool setMagnitude(void *buf, uint32_t dims, int *sizes, int bits_per_sample)
virtual void Deactivated()
Deactivated Called after deactivation from client application.
virtual bool processBLOB(uint8_t *out, uint32_t dims, int *sizes, int bits_per_sample) override
processBLOB Propagate to Callback and generate BLOBs for parent device.
Spectrum(INDI::DefaultDevice *dev)
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
#define dsp_buffer_set(buf, len, _val)
Fill the buffer with the passed value.
DLL_EXPORT void dsp_stream_free(dsp_stream_p stream)
Free the DSP stream passed as argument.
DLL_EXPORT void dsp_stream_free_buffer(dsp_stream_p stream)
Free the buffer of the DSP Stream passed as argument.
DLL_EXPORT double * dsp_stats_histogram(dsp_stream_p stream, int size)
Histogram of the inut stream.
Implementations for common driver routines.
void IUFillBLOBVector(IBLOBVectorProperty *bvp, IBLOB *bp, int nbp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a BLOB vector property. The vector's auxiliary elements will be set to NULL.
void IUFillBLOB(IBLOB *bp, const char *name, const char *label, const char *format)
Assign attributes for a BLOB property. The BLOB's data and auxiliary elements will be set to NULL.
int IUUpdateBLOB(IBLOBVectorProperty *bvp, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
Update all BLOB members in a BLOB vector property.
*brief user defined string literal for JSON values *sa std::size_t n
#define LOGF_INFO(fmt,...)
The DSP Namespace adds signal processing to INDI drivers. Primarily written for sensors and detectors...