Instrument Neutral Distributed Interface INDI 2.2.5
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
31namespace INDI
32{
33class DefaultDevice;
34}
35
36namespace DSP
37{
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[],
49 char *names[], int n);
50 virtual bool saveConfigItems(FILE *fp);
51 virtual bool updateProperties();
52
53 bool processBLOB(uint8_t* buf, uint32_t ndims, int* dims, int bits_per_sample);
54
55 inline void setSizes(uint32_t num, int* sizes)
56 {
57 BufferSizes = sizes;
58 BufferSizesQty = num;
59 }
60 inline void getSizes(uint32_t *num, int** sizes)
61 {
62 *sizes = BufferSizes;
63 *num = BufferSizesQty;
64 }
65
66 inline void setBPS(int bps)
67 {
68 BPS = bps;
69 }
70 inline int getBPS()
71 {
72 return BPS;
73 }
74
75 void setCaptureFileExtension(const char *ext);
76
77 private:
78 Convolution *convolution;
81 Spectrum *spectrum;
82 Histogram *histogram;
83 Wavelets *wavelets;
84 uint32_t BufferSizesQty;
85 int *BufferSizes;
86 int BPS;
87};
88}
void setSizes(uint32_t num, int *sizes)
Definition manager.h:55
void setBPS(int bps)
Definition manager.h:66
bool processBLOB(uint8_t *buf, uint32_t ndims, int *dims, int bits_per_sample)
Definition manager.cpp:131
virtual bool ISNewBLOB(const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
Definition manager.cpp:106
virtual void ISGetProperties(const char *dev)
Definition manager.cpp:48
int getBPS()
Definition manager.h:70
virtual bool saveConfigItems(FILE *fp)
Definition manager.cpp:119
virtual ~Manager()
Definition manager.cpp:44
virtual bool updateProperties()
Definition manager.cpp:58
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n)
Definition manager.cpp:94
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Definition manager.cpp:70
Manager(INDI::DefaultDevice *dev)
Definition manager.cpp:34
void getSizes(uint32_t *num, int **sizes)
Definition manager.h:60
void setCaptureFileExtension(const char *ext)
Definition manager.cpp:142
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n)
Definition manager.cpp:82
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
ISState
Switch state.
Definition indiapi.h:148
Interface to the reference INDI C API device implementation on the Device Driver side.
*brief user defined string literal for JSON values *sa std::size_t n
The DSP Namespace adds signal processing to INDI drivers. Primarily written for sensors and detectors...
Namespace to encapsulate INDI client, drivers, and mediator classes.