Instrument Neutral Distributed Interface INDI  2.0.2
indispectrograph.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 #ifdef HAVE_WEBSOCKET
26 #include "indiwsserver.h"
27 #endif
28 
29 #include <fitsio.h>
30 
31 #include <memory>
32 #include <cstring>
33 #include <chrono>
34 #include <stdint.h>
35 #include <mutex>
36 #include <thread>
37 
38 //JM 2019-01-17: Disabled until further notice
39 //#define WITH_EXPOSURE_LOOPING
40 
41 
58 namespace INDI
59 {
60 class StreamManager;
61 
62 class Spectrograph : public virtual SensorInterface
63 {
64  public:
65  enum
66  {
69 
70  Spectrograph();
71  virtual ~Spectrograph();
72 
73  virtual bool initProperties() override;
74  virtual bool updateProperties() override;
75  virtual void ISGetProperties(const char *dev) override;
76  virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
77  virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
78  virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override;
79  virtual bool ISNewBLOB(const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[],
80  char *names[], int n) override;
81  virtual bool ISSnoopDevice(XMLEle *root) override;
82 
83  virtual bool StartIntegration(double duration) override;
84  virtual void addFITSKeywords(fitsfile *fptr, uint8_t* buf, int len) override;
85 
90  void setLowCutFrequency(double freq);
91 
96  void setHighCutFrequency(double freq);
97 
102  void setGain(double gain);
103 
108  inline double getLowCutFrequency()
109  {
110  return LowCutFrequency;
111  }
112 
117  inline double getHighCutFrequency()
118  {
119  return HighCutFrequency;
120  }
121 
126  inline double getGain()
127  {
128  return Gain;
129  }
130 
135  {
136  return &SpectrographSettingsNP;
137  }
138 
142  uint32_t GetSpectrographCapability() const
143  {
144  return capability;
145  }
146 
151  void SetSpectrographCapability(uint32_t cap);
152 
163  virtual void setMinMaxStep(const char *property, const char *element, double min, double max, double step,
164  bool sendToClient = true) override;
165 
166  typedef enum
167  {
176 
177  private:
178  double LowCutFrequency;
179  double HighCutFrequency;
180  double Gain;
181 
182 };
183 }
The SensorDevice class provides functionality of a Sensor Device within a Sensor.
Class to provide general functionality of Monodimensional Spectrograph.
INumberVectorProperty * getSpectrographSettings()
Return Vector Info Property.
double getGain()
getGain Get requested integration gain for the sensor.
virtual bool StartIntegration(double duration) override
Start integration from the Sensor device.
void setLowCutFrequency(double freq)
setLowCutFrequency Set low cut frequency of Spectrograph device.
uint32_t GetSpectrographCapability() const
GetSpectrographCapability returns the Sensor capabilities.
double getHighCutFrequency()
getHighCutFrequency Get requested high cut frequency in Hz.
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
void SetSpectrographCapability(uint32_t cap)
SetSpectrographCapability Set the Spectrograph capabilities. Al fields must be initialized.
enum INDI::Spectrograph::@256 SpectrographCapability
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual 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 setGain(double gain)
setGain Set gain of Spectrograph device.
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
INumber SpectrographSettingsN[8]
virtual void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
virtual void addFITSKeywords(fitsfile *fptr, uint8_t *buf, int len) override
Add FITS keywords to a fits file.
virtual bool ISSnoopDevice(XMLEle *root) override
Process a snoop event from INDI server. This function is called when a snooped property is updated in...
INumberVectorProperty SpectrographSettingsNP
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
void setHighCutFrequency(double freq)
setHighCutFrequency Set high cut frequency of Spectrograph device.
double getLowCutFrequency()
getLowCutFrequency Get requested low cut frequency in Hz.
virtual void setMinMaxStep(const char *property, const char *element, double min, double max, double step, bool sendToClient=true) override
setMinMaxStep for a number property element
Class to provide video streaming and recording functionality.
double max(void)
double min(void)
ISState
Switch state.
Definition: indiapi.h:150
Namespace to encapsulate INDI client, drivers, and mediator classes.
One number descriptor.
Number vector property descriptor.
Definition: indiapi.h:319