00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef CalDeviceTable_CLASS
00035 #define CalDeviceTable_CLASS
00036
00037 #include <string>
00038 #include <vector>
00039 #include <map>
00040 #include <set>
00041 using std::string;
00042 using std::vector;
00043 using std::map;
00044
00045 #include <Angle.h>
00046 #include <AngularRate.h>
00047 #include <ArrayTime.h>
00048 #include <ArrayTimeInterval.h>
00049 #include <Complex.h>
00050 #include <Entity.h>
00051 #include <EntityId.h>
00052 #include <EntityRef.h>
00053 #include <Flux.h>
00054 #include <Frequency.h>
00055 #include <Humidity.h>
00056 #include <Interval.h>
00057 #include <Length.h>
00058 #include <PartId.h>
00059 #include <Pressure.h>
00060 #include <Speed.h>
00061 #include <Tag.h>
00062 #include <Temperature.h>
00063 #include <ConversionException.h>
00064 #include <DuplicateKey.h>
00065 #include <UniquenessViolationException.h>
00066 #include <NoSuchRow.h>
00067 #include <DuplicateKey.h>
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 #include "CCalibrationDevice.h"
00089 using namespace CalibrationDeviceMod;
00090
00091
00092
00093 #ifndef WITHOUT_ACS
00094 #include <asdmIDLC.h>
00095 using asdmIDL::CalDeviceTableIDL;
00096 #endif
00097
00098 using asdm::Angle;
00099 using asdm::AngularRate;
00100 using asdm::ArrayTime;
00101 using asdm::Complex;
00102 using asdm::Entity;
00103 using asdm::EntityId;
00104 using asdm::EntityRef;
00105 using asdm::Flux;
00106 using asdm::Frequency;
00107 using asdm::Humidity;
00108 using asdm::Interval;
00109 using asdm::Length;
00110 using asdm::PartId;
00111 using asdm::Pressure;
00112 using asdm::Speed;
00113 using asdm::Tag;
00114 using asdm::Temperature;
00115
00116 using asdm::DuplicateKey;
00117 using asdm::ConversionException;
00118 using asdm::NoSuchRow;
00119 using asdm::DuplicateKey;
00120
00121 #include <Representable.h>
00122
00123 namespace asdm {
00124
00125
00126
00127
00128 class ASDM;
00129 class CalDeviceRow;
00214 class CalDeviceTable : public Representable {
00215 friend class asdm::ASDM;
00216
00217 public:
00218
00219
00225 static vector<string> getKeyName();
00226
00227
00228 virtual ~CalDeviceTable();
00229
00235 ASDM &getContainer() const;
00236
00242 unsigned int size() ;
00243
00249 string getName() const;
00250
00254 Entity getEntity() const;
00255
00260 void setEntity(Entity e);
00261
00262
00263
00264
00265
00270 CalDeviceRow *newRow();
00271
00276 CalDeviceRow* newRowEmpty();
00277
00278
00296 CalDeviceRow *newRow(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval, int numCalload, vector<CalibrationDevice > calLoadName);
00297
00302 CalDeviceRow *newRowFull(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval, int numCalload, vector<CalibrationDevice > calLoadName);
00303
00304
00317 CalDeviceRow *newRow(CalDeviceRow *row);
00318
00323 CalDeviceRow *newRowCopy(CalDeviceRow *row);
00324
00325
00326
00327
00328
00329
00346 CalDeviceRow* add(CalDeviceRow* x) ;
00347
00348
00349
00350
00351
00352
00353
00354
00355
00361 vector<CalDeviceRow *> get() ;
00362
00363
00371 vector <CalDeviceRow*> *getByContext(Tag antennaId, int feedId, Tag spectralWindowId);
00372
00373
00374
00375
00376
00392 CalDeviceRow* CalDeviceTable::getRowByKey(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval);
00393
00394
00395
00396
00397
00417 CalDeviceRow* lookup(Tag antennaId, int feedId, Tag spectralWindowId, ArrayTimeInterval timeInterval, int numCalload, vector<CalibrationDevice > calLoadName);
00418
00419
00420 #ifndef WITHOUT_ACS
00421
00427 CalDeviceTableIDL *toIDL() ;
00428 #endif
00429
00430 #ifndef WITHOUT_ACS
00431
00437 void fromIDL(CalDeviceTableIDL x) throw(DuplicateKey,ConversionException);
00438 #endif
00439
00443 char *toFITS() const throw(ConversionException);
00444
00448 void fromFITS(char *fits) throw(ConversionException);
00449
00453 string toVOTable() const throw(ConversionException);
00454
00458 void fromVOTable(string vo) throw(ConversionException);
00459
00466 string toXML() throw(ConversionException);
00467
00473 void fromXML(string xmlDoc) throw(ConversionException);
00474
00480 string toMIME();
00481
00488 void setFromMIME(const string & mimeMsg);
00489
00499 void toFile(string directory);
00500
00509 void setFromFile(const string& directory);
00510
00511 private:
00512
00521 CalDeviceTable (ASDM & container);
00522
00523 ASDM & container;
00524
00525 bool archiveAsBin;
00526 bool fileAsBin ;
00527
00528 Entity entity;
00529
00530
00531
00535 static string tableName;
00536
00537
00541 static vector<string> key;
00542
00543
00549 CalDeviceRow* checkAndAdd(CalDeviceRow* x) throw (DuplicateKey);
00550
00551
00552
00553
00561 CalDeviceRow * insertByStartTime(CalDeviceRow* x, vector<CalDeviceRow* >& row);
00562
00563
00564
00565
00566
00567
00568 vector<CalDeviceRow * > privateRows;
00569
00570
00571
00572
00573
00574
00575
00576
00577 typedef vector <CalDeviceRow* > TIME_ROWS;
00578 map<string, TIME_ROWS > context;
00579
00584 string Key(Tag antennaId, int feedId, Tag spectralWindowId) ;
00585
00586
00587
00588
00594 void getByKeyNoAutoIncNoTime(vector <CalDeviceRow*>& vin, vector <CalDeviceRow*>& vout, Tag antennaId, int feedId, Tag spectralWindowId);
00595
00596
00597
00598 void error() throw(ConversionException);
00599
00600 };
00601
00602 }
00603
00604 #endif