[504] | 1 | /*******************************************************************************
|
---|
| 2 | Copyright(c) 2010 Gerry Rozema. All rights reserved.
|
---|
| 3 |
|
---|
[642] | 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.
|
---|
[504] | 17 | *******************************************************************************/
|
---|
| 18 |
|
---|
| 19 | #ifndef CCDSIM_H
|
---|
| 20 | #define CCDSIM_H
|
---|
| 21 |
|
---|
| 22 | #include "indibase/indiccd.h"
|
---|
| 23 |
|
---|
| 24 | /* Some headers we need */
|
---|
| 25 | #include <math.h>
|
---|
| 26 | #include <sys/time.h>
|
---|
| 27 |
|
---|
| 28 |
|
---|
| 29 | class CCDSim : public INDI::CCD
|
---|
| 30 | {
|
---|
| 31 | protected:
|
---|
| 32 | private:
|
---|
| 33 |
|
---|
| 34 | bool InExposure;
|
---|
| 35 | float ExposureRequest;
|
---|
| 36 | struct timeval ExpStart;
|
---|
| 37 |
|
---|
| 38 | bool InGuideExposure;
|
---|
| 39 | float GuideExposureRequest;
|
---|
| 40 | struct timeval GuideExpStart;
|
---|
| 41 |
|
---|
| 42 | float CalcTimeLeft(timeval,float);
|
---|
| 43 |
|
---|
| 44 | int testvalue;
|
---|
| 45 | int ShowStarField;
|
---|
| 46 | int bias;
|
---|
| 47 | int maxnoise;
|
---|
| 48 | int maxval;
|
---|
| 49 | float skyglow;
|
---|
| 50 | float limitingmag;
|
---|
| 51 | float saturationmag;
|
---|
| 52 | float seeing;
|
---|
| 53 | float ImageScalex;
|
---|
| 54 | float ImageScaley;
|
---|
| 55 | float focallength;
|
---|
| 56 | float OAGoffset;
|
---|
| 57 | float TimeFactor;
|
---|
| 58 | // our zero point calcs used for drawing stars
|
---|
| 59 | float k;
|
---|
| 60 | float z;
|
---|
| 61 |
|
---|
| 62 | bool AbortGuideFrame;
|
---|
| 63 |
|
---|
[642] | 64 |
|
---|
[504] | 65 | float GuideRate;
|
---|
| 66 |
|
---|
| 67 | float PEPeriod;
|
---|
| 68 | float PEMax;
|
---|
| 69 | time_t RunStart;
|
---|
| 70 |
|
---|
| 71 | // And this lives in our simulator settings page
|
---|
| 72 |
|
---|
| 73 | INumberVectorProperty *SimulatorSettingsNV;
|
---|
[697] | 74 | INumber SimulatorSettingsN[11];
|
---|
[504] | 75 |
|
---|
| 76 | ISwitch TimeFactorS[3];
|
---|
| 77 | ISwitchVectorProperty *TimeFactorSV;
|
---|
| 78 |
|
---|
| 79 | bool SetupParms();
|
---|
| 80 |
|
---|
[697] | 81 | // We are going to snoop these from focuser
|
---|
| 82 | INumberVectorProperty FWHMNP;
|
---|
| 83 | INumber FWHMN[1];
|
---|
| 84 |
|
---|
| 85 | // We are going to snoop these from telescope
|
---|
| 86 | INumber ScopeParametersN[2];
|
---|
| 87 | INumberVectorProperty ScopeParametersNP;
|
---|
| 88 |
|
---|
[504] | 89 | public:
|
---|
| 90 | CCDSim();
|
---|
| 91 | virtual ~CCDSim();
|
---|
| 92 |
|
---|
| 93 | const char *getDefaultName();
|
---|
| 94 |
|
---|
| 95 | bool initProperties();
|
---|
| 96 | bool updateProperties();
|
---|
| 97 |
|
---|
| 98 | void ISGetProperties (const char *dev);
|
---|
| 99 |
|
---|
| 100 |
|
---|
| 101 | bool Connect();
|
---|
| 102 | bool Disconnect();
|
---|
| 103 |
|
---|
| 104 | int StartExposure(float duration);
|
---|
| 105 | int StartGuideExposure(float);
|
---|
| 106 | bool AbortGuideExposure();
|
---|
| 107 |
|
---|
| 108 |
|
---|
| 109 | void TimerHit();
|
---|
| 110 |
|
---|
| 111 | int DrawCcdFrame();
|
---|
| 112 | int DrawGuiderFrame();
|
---|
| 113 |
|
---|
| 114 | int DrawImageStar(float,float,float);
|
---|
| 115 | int AddToPixel(int,int,int);
|
---|
| 116 |
|
---|
[642] | 117 | bool GuideNorth(float);
|
---|
| 118 | bool GuideSouth(float);
|
---|
| 119 | bool GuideEast(float);
|
---|
| 120 | bool GuideWest(float);
|
---|
[504] | 121 |
|
---|
| 122 | virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n);
|
---|
| 123 | virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n);
|
---|
[697] | 124 | virtual bool ISSnoopDevice (XMLEle *root);
|
---|
[504] | 125 |
|
---|
| 126 | };
|
---|
| 127 |
|
---|
| 128 | #endif // CCDSim_H
|
---|