1 | #ifndef COLUMNS_H |
---|
2 | #define COLUMNS_H |
---|
3 | |
---|
4 | #include <iostream> |
---|
5 | #include <iomanip> |
---|
6 | #include <string> |
---|
7 | #include <vector> |
---|
8 | |
---|
9 | #include <param.hh> |
---|
10 | |
---|
11 | using std::string; |
---|
12 | using std::vector; |
---|
13 | |
---|
14 | class Detection; |
---|
15 | namespace Column |
---|
16 | { |
---|
17 | |
---|
18 | const int fluxPrec=3, velPrec=3, xyzPrec=1, posPrec=6, wposPrec=2; |
---|
19 | |
---|
20 | class Col{ |
---|
21 | public: |
---|
22 | Col(){width=0;name="";unit="";}; |
---|
23 | Col(int w, string n, string u){width=w; name=n; unit=u;}; |
---|
24 | ~Col(){}; |
---|
25 | int widen(){width++;}; |
---|
26 | int getWidth(){return width;}; |
---|
27 | void setWidth(int i){width=i;}; |
---|
28 | string getName(){return name;}; |
---|
29 | void setName(string s){name=s;}; |
---|
30 | string getUnit(){return unit;}; |
---|
31 | void setUnit(string s){unit=s;}; |
---|
32 | void title(std::ostream &stream){ |
---|
33 | stream << std::setw(this->width) << this->name;}; |
---|
34 | void units(std::ostream &stream){ |
---|
35 | stream << std::setw(this->width) << this->unit;}; |
---|
36 | void dash (std::ostream &stream){ |
---|
37 | stream << std::setfill('-') << std::setw(this->width) |
---|
38 | << ""<< std::setfill(' ');}; |
---|
39 | void blank(std::ostream &stream){ |
---|
40 | stream << std::setfill(' ') << std::setw(this->width) << "";}; |
---|
41 | |
---|
42 | template <class type> void entry(std::ostream &stream, type e){ |
---|
43 | stream << std::setw(this->width) << e;}; |
---|
44 | |
---|
45 | int width; |
---|
46 | string name; |
---|
47 | string unit; |
---|
48 | }; |
---|
49 | |
---|
50 | class ColSet{ |
---|
51 | public: |
---|
52 | ColSet(){defined=false; inserted=false;} |
---|
53 | ~ColSet(){}; |
---|
54 | vector<Col> vec; |
---|
55 | bool defined; |
---|
56 | bool inserted; |
---|
57 | void addFluxCol(Col fluxCol){ |
---|
58 | if(!this->inserted) this->vec.insert(this->vec.begin()+11, fluxCol); |
---|
59 | this->inserted = true; |
---|
60 | } |
---|
61 | |
---|
62 | }; |
---|
63 | |
---|
64 | ColSet getLogColSet(vector<Detection> &objectList); |
---|
65 | ColSet getFullColSet(vector<Detection> &objectList, FitsHeader &head); |
---|
66 | |
---|
67 | } |
---|
68 | |
---|
69 | |
---|
70 | #endif |
---|
71 | |
---|