CARMA C++
Dewar.h
Go to the documentation of this file.
1 
15 #ifndef CARMA_ANTENNA_BIMA_DEWAR_H
16 #define CARMA_ANTENNA_BIMA_DEWAR_H
17 
18 #include <vector>
19 
20 // System includes
21 #include <string>
22 #include <unistd.h>
23 
24 // CARMA includes
25 #include "carma/util/Program.h"
27 #include "carma/services/Table.h"
30 
31 namespace carma
32 {
33  namespace antenna
34  {
35  namespace bima
36  {
37  class Dewar : public TelemetryClient
38  {
39 
40  public:
41  Dewar( Configuration& conf );
42 
43  std::string getSISMixerBName(); // read from dewars.tab
44  std::string getSISMixerBConfFile(); // derived from name
45  std::string getSISMixerDName(); // read from dewars.tab
46  std::string getSISMixerDConfFile(); // derived from name
47  std::string getSISTuningMode(); // read from dewars.tab
48  int getSafeAtten(); // read from dewars.tab
49 
50  double stage1temp(); // Tempature in Kelvins on stage1
51  double stage2temp(); // Tempature in Kelvins on stage2
52  double stage3temp(); // Tempature in Kelvins on stage3
53  double stage4temp(); // Tempature in Kelvins on stage4
54  double stage5temp(); // Tempature in Kelvins on stage5
55 
56  double cmStage1temp();
57  double cmStage2temp();
58  double cmStage3temp();
59  double cmStage4temp();
60 
61  double getHeater3mW();
62  void setHeater3V( double volts );
63  double getPowExp(); // read from dewars.tab
64  double getGainI(); // read from dewars.tab
65  void setGainI( double set ); // unless set here
66  double getGainP(); // read from dewars.tab
67  double getGateD() { return _gateD; };
68  double getGateB() { return _gateB; };
69  void setGainP( double set ); // unless set here
70  int getHeaterMinCnt(); // read from dewars.tab
71  int getHeaterMaxCnt(); // read from dewars.tab
72 
73  double getCompressorInletTemp();
74  double getCompressorDischTemp();
75  double getCompressorExchTemp();
76  double getCompressorSumpTemp();
77  double getHeSupplyP();
78  double getHeReturnP();
79 
80  double getGateVoltage(unsigned short deviceID);
81  double getDrainCurrent(unsigned short deviceID);
82  double getIFCurrent();
83 
84  private:
85  std::string _name;
86  std::vector<std::string> _stageFiles;
87  std::vector<double> _stage1Curve;
88  std::vector<double> _stage2Curve;
89  std::vector<double> _stage3Curve;
90  std::vector<double> _stage4Curve;
91  std::vector<double> _stage5Curve;
92  std::vector<double> _curve10;
93  std::vector<double> _t;
94  double _gainp, _gaini, _powexp, _gateB, _gateD;
95  int _hmincnt, _hmaxcnt, _safeatten;
96 
97  Configuration _config;
98 
99  double tempConvert( std::vector<double> *tryThisCurve, double volts );
100  double diodeRawToVolts( int raw )
101  { return (double)(raw * TVOLTS); };
102 
103  void lookUpDewar();
104  void loadDiodeCurves();
105  std::vector<double> loadACurve( std::string filename );
106 
107  std::string _sisMixerBName;
108  std::string _sisMixerBConfFile;
109  std::string _sisMixerDName;
110  std::string _sisMixerDConfFile;
111  std::string _tuningmode;
112 
113  // CM Rx stuff
114  std::string _cmName;
115  std::map<unsigned short, double> _gateVoltage;
116  std::map<unsigned short, double> _drainCurrent;
117  double _ifCurrent;
118 
119  }; // class Dewar
120  } // namespace bima
121  } // namespace antenna
122 } // namespace carma
123 
124 ::std::ostream& operator<<( ::std::ostream& os,
125  ::carma::antenna::bima::Dewar& dewar );
126 
127 
128 #endif // CARMA_ANTENNA_BIMA_DEWAR_H
std::ostream & operator<<(::std::ostream &os, const carma::dbms::Table &table)
Common table functions.
Class definition for TelemetryClient on the BIMA antennas.
Class definition for Stepper Motors for BIMA systems.
FileNotFoundException class.