Instrument Neutral Distributed Interface INDI  1.9.2
manager.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright(c) 2017 Ilia Platone, Jasem Mutlaq. All rights reserved.
3 
4  DSP plugin manager
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 *******************************************************************************/
20 
21 #pragma once
22 
23 #include "indidevapi.h"
24 #include "convolution.h"
25 #include "transforms.h"
26 
27 #include <fitsio.h>
28 #include <functional>
29 #include <string>
30 
31 namespace INDI
32 {
33 class DefaultDevice;
34 }
35 
36 namespace DSP
37 {
38 class Manager
39 {
40  public:
42  virtual ~Manager();
43 
44  virtual void ISGetProperties(const char *dev);
45  virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n);
46  virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n);
47  virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n);
48  virtual bool ISNewBLOB(const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n);
49  virtual bool saveConfigItems(FILE *fp);
50  virtual bool updateProperties();
51 
52  bool processBLOB(uint8_t* buf, uint32_t ndims, int* dims, int bits_per_sample);
53 
54  inline void setSizes(uint32_t num, int* sizes) { BufferSizes = sizes; BufferSizesQty = num; }
55  inline void getSizes(uint32_t *num, int** sizes) { *sizes = BufferSizes; *num = BufferSizesQty; }
56 
57  inline void setBPS(int bps) { BPS = bps; }
58  inline int getBPS() { return BPS; }
59 
60  private:
61  Convolution *convolution;
62  FourierTransform *dft;
64  Spectrum *spectrum;
65  Histogram *histogram;
66  Wavelets *wavelets;
67  uint32_t BufferSizesQty;
68  int *BufferSizes;
69  int BPS;
70 };
71 }
DSP::Manager::~Manager
virtual ~Manager()
Definition: manager.cpp:60
DSP::InverseFourierTransform
Definition: transforms.h:58
DSP::Manager::getSizes
void getSizes(uint32_t *num, int **sizes)
Definition: manager.h:55
DSP::Manager::saveConfigItems
virtual bool saveConfigItems(FILE *fp)
Definition: manager.cpp:135
convolution.h
DSP::Manager::ISNewSwitch
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Definition: manager.cpp:86
DSP::Manager::setSizes
void setSizes(uint32_t num, int *sizes)
Definition: manager.h:54
DSP::Manager::setBPS
void setBPS(int bps)
Definition: manager.h:57
DSP::Manager::ISGetProperties
virtual void ISGetProperties(const char *dev)
Definition: manager.cpp:64
transforms.h
DSP::Manager::getBPS
int getBPS()
Definition: manager.h:58
indidevapi.h
Interface to the reference INDI C API device implementation on the Device Driver side.
DSP::Wavelets
Definition: convolution.h:54
DSP::Manager::ISNewNumber
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n)
Definition: manager.cpp:110
DSP::Manager::updateProperties
virtual bool updateProperties()
Definition: manager.cpp:74
DSP::Histogram
Definition: transforms.h:78
DSP::Manager::ISNewText
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n)
Definition: manager.cpp:98
DSP
The DSP Namespace adds signal processing to INDI drivers. Primarily written for sensors and detectors...
Definition: convolution.cpp:39
DSP::Manager::processBLOB
bool processBLOB(uint8_t *buf, uint32_t ndims, int *dims, int bits_per_sample)
Definition: manager.cpp:147
INDI
Namespace to encapsulate INDI client, drivers, and mediator classes.
Definition: AlignmentSubsystemForClients.cpp:11
DSP::Manager::ISNewBLOB
virtual bool ISNewBLOB(const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
Definition: manager.cpp:122
DSP::FourierTransform
Definition: transforms.h:48
ISState
ISState
Switch state.
Definition: indiapi.h:148
DSP::Manager::Manager
Manager(INDI::DefaultDevice *dev)
Definition: manager.cpp:50
INDI::DefaultDevice
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
Definition: defaultdevice.h:118
DSP::Manager
Definition: manager.h:38
DSP::Spectrum
Definition: transforms.h:68
DSP::Convolution
Definition: convolution.h:31