Instrument Neutral Distributed Interface INDI 2.2.5
indicorrelator.h
Go to the documentation of this file.
1/*******************************************************************************
2 Copyright(c) 2010, 2017 Ilia Platone, Jasem Mutlaq. All rights reserved.
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*******************************************************************************/
18
19#pragma once
20
21#include "indisensorinterface.h"
22#include "dsp.h"
23#include <fitsio.h>
24
25#include <fitsio.h>
26
27#include <memory>
28#include <cstring>
29#include <chrono>
30#include <stdint.h>
31#include <mutex>
32#include <thread>
33
34//JM 2019-01-17: Disabled until further notice
35//#define WITH_EXPOSURE_LOOPING
36
37
54namespace INDI
55{
56class StreamManager;
57
59{
60 public:
65 typedef union
66 {
67 struct
68 {
69 double x;
70 double y;
71 double z;
72 };
73 double values[3];
74 } Baseline;
75
80 typedef union
81 {
82 struct
83 {
84 double u;
85 double v;
86 };
87 double values[2];
89
100
101 enum
102 {
105
106 Correlator();
107 virtual ~Correlator();
108
109 bool initProperties() override;
110 bool updateProperties() override;
111 void ISGetProperties(const char *dev) override;
112 bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
113 bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
114 bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override;
115 bool ISNewBLOB(const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[],
116 char *names[], int n) override;
117 bool ISSnoopDevice(XMLEle *root) override;
118
119 virtual bool StartIntegration(double duration) override;
120
125 virtual inline double getCorrelationDegree()
126 {
127 return 0.0;
128 }
129
135 {
136 Correlation ret;
138 ret.baseline = baseline;
140 return ret;
141 }
142
147 void setBaseline(Baseline bl);
148
153 void setWavelength(double wl);
154
159 void setBandwidth(double bw);
160
166 {
167 return baseline;
168 }
169
174 inline double getWavelength()
175 {
176 return wavelength;
177 }
178
183 UVCoordinate getUVCoordinates();
184
190 UVCoordinate getUVCoordinates(double lst);
191
198 UVCoordinate getUVCoordinates(double alt, double az);
199
204 double getDelay();
205
211 double getDelay(double lst);
212
219 double getDelay(double alt, double az);
220
225 inline double setBandwidth()
226 {
227 return bandwidth;
228 }
229
237
241 uint32_t GetCorrelatorCapability() const
242 {
243 return capability;
244 }
245
250 void SetCorrelatorCapability(uint32_t cap);
251
262 virtual void setMinMaxStep(const char *property, const char *element, double min, double max, double step,
263 bool sendToClient) override;
264
274
275 private:
276 Baseline baseline;
277 double wavelength;
278 double bandwidth;
279 INumber CorrelatorSettingsN[5];
280};
281}
Class to provide general functionality of Monodimensional Correlator.
INumberVectorProperty * getCorrelatorSettings()
Return Vector Info Property.
bool ISNewBLOB(const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n) override
Process the client newBLOB command.
void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
double setBandwidth()
setBandwidth Get the bandwidth of the correlator.
INumberVectorProperty CorrelatorSettingsNP
bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
void SetCorrelatorCapability(uint32_t cap)
SetCorrelatorCapability Set the Correlator capabilities. Al fields must be initialized.
virtual bool StartIntegration(double duration) override
Start integration from the Sensor device.
uint32_t GetCorrelatorCapability() const
GetCorrelatorCapability returns the Sensor capabilities.
Correlation getCorrelation()
getCorrelation Get current correlation degree plus UV and baseline information.
double getDelay()
getDelay Get current baseline delay with reference to the current sidereal time.
virtual void setMinMaxStep(const char *property, const char *element, double min, double max, double step, bool sendToClient) override
setMinMaxStep for a number property element
bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
virtual double getCorrelationDegree()
getCorrelationDegree Get current correlation degree.
bool ISSnoopDevice(XMLEle *root) override
Process a snoop event from INDI server. This function is called when a snooped property is updated in...
double getWavelength()
setWavelength Get the observed wavelength.
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
void setBaseline(Baseline bl)
setBaseline Set the baseline size in meters.
enum INDI::Correlator::@432 CorrelatorCapability
void setWavelength(double wl)
setWavelength Set the observed wavelength.
bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
Baseline getBaseline()
setBaseline Get the baseline size in meters.
UVCoordinate getUVCoordinates()
getUVCoordinates Get current UV projected coordinates with reference to the current sidereal time.
bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
The SensorDevice class provides functionality of a Sensor Device within a Sensor.
Class to provide video streaming and recording functionality.
double max(void)
#define min(a, b)
ISState
Switch state.
Definition indiapi.h:148
Namespace to encapsulate INDI client, drivers, and mediator classes.
One number descriptor.
Number vector property descriptor.
Definition indiapi.h:317
the baseline (position of the telescopes) of this correlator.