/[PAMELA software]/DarthVader/OrbitalInfo/src/OrbitalInfo.cpp
ViewVC logotype

Diff of /DarthVader/OrbitalInfo/src/OrbitalInfo.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by mocchiut, Fri May 19 13:15:58 2006 UTC revision 1.9 by mocchiut, Wed Apr 18 14:06:50 2007 UTC
# Line 1  Line 1 
1  #include <OrbitalInfo.h>  #include <OrbitalInfo.h>
2    
3  OrbitalInfo::OrbitalInfo() :      OrbitalInfo::OrbitalInfo(){
4    absTime(0){}    absTime = 0;
5      OBT = 0;
6      pkt_num = 0;
7    
8      lon = 0.;
9      lat = 0.;
10      alt = 0.;
11    
12      Bnorth = 0.;
13      Beast = 0.;
14      Bdown = 0.;
15      Babs = 0.;
16      BB0 = 0.;
17      L = 0.;
18    
19      londip = -1000.;
20      latdip = -1000.;
21      altdip = -1000.;
22    
23      loncgm = -1000.;
24      latcgm = -1000.;
25      altcgm = -1000.;
26    
27      loncbm = -1000.;
28      latcbm = -1000.;
29      altcbm = -1000.;
30    
31      std::fill_n(cutoff, 20, 0.);
32    
33      // Quaternions
34      q0 = -1000.;
35      q1 = -1000.;
36      q2 = -1000.;
37      q3 = -1000.;
38    
39      // Euler angles (nadir reference frame)
40      theta = -1000.;
41      phi = -1000.;
42      etha = -1000.;
43    
44    //   // Euler angles (local field reference frame)
45    //   thetamag = -1000.;
46    //   phimag = -1000.;
47    //   ethamag = -1000.;
48      mode = 0;
49    //  std::fill_n(goodAttitude, 5, 0);
50    }
51    
52    
53    void OrbitalInfo::Clear(){
54      absTime = 0;
55      OBT = 0;
56      pkt_num = 0;
57    
58      lon = -1000.;
59      lat = -1000.;
60      alt = -1000.;
61    
62      Bnorth = -1000.;
63      Beast = -1000.;
64      Bdown = -1000.;
65      Babs = -1000.;
66      BB0 = -1000.;
67      L = -1000.;
68    
69      londip = -1000.;
70      latdip = -1000.;
71      altdip = -1000.;
72    
73      loncgm = -1000.;
74      latcgm = -1000.;
75      altcgm = -1000.;
76    
77      loncbm = -1000.;
78      latcbm = -1000.;
79      altcbm = -1000.;
80    
81      std::fill_n(cutoff, 20, 0.);
82    
83      // Quaternions
84      q0 = -1000.;
85      q1 = -1000.;
86      q2 = -1000.;
87      q3 = -1000.;
88    
89      // Euler angles (nadir reference frame)
90      theta = -1000.;
91      phi = -1000.;
92      etha = -1000.;
93    
94      // Euler angles (local field reference frame)
95      //  thetamag = -1000.;
96      //  phimag = -1000.;
97      //  ethamag = -1000.;
98    
99      mode = 0;
100      //  std::fill_n(goodAttitude, 5, 0);
101    }
102    
103    /**
104     * Fills a struct cOrbitalInfo with values from a OrbitalInfo object (to put data into a F77 common).
105     */
106    void OrbitalInfo::GetLevel2Struct(cOrbitalInfo *l2) const{
107      l2->abstime  = absTime;
108      l2->obt      = OBT;
109      l2->pkt_num  = pkt_num;
110    
111      l2->lon = lon;
112      l2->lat = lat;
113      l2->alt = alt;
114    
115      l2->Bnorth = Bnorth;
116      l2->Beast = Beast;
117      l2->Bdown = Bdown;
118      l2->Babs = Babs;
119      l2->BB0 = BB0;
120      l2->L = L;
121    
122      l2->londip = londip;
123      l2->latdip = latdip;
124      l2->altdip = altdip;
125    
126      l2->loncgm = loncgm;
127      l2->latcgm = latcgm;
128      l2->altcgm = altcgm;
129    
130      l2->loncbm = loncbm;
131      l2->latcbm = latcbm;
132      l2->altcbm = altcbm;
133    
134      memcpy(l2->cutoff, cutoff, sizeof(cutoff));
135    
136      // Quaternions
137      l2->q0 = q0;
138      l2->q1 = q1;
139      l2->q2 = q2;
140      l2->q3 = q3;
141    
142      // Euler angles (nadir reference frame)
143      l2->theta = theta;
144      l2->phi = phi;
145      l2->etha = etha;
146    
147      l2->mode = mode;
148      // Euler angles (local field reference frame)
149    //   l2->thetamag = thetamag;
150    //   l2->phimag = phimag;
151    //   l2->ethamag = ethamag;
152    
153    //   memcpy(l2->goodAttitude, goodAttitude, sizeof(goodAttitude));
154    }
155    
156    void OrbitalInfo::SetFromLevel2Struct(cOrbitalInfo *l2){
157      absTime  = l2->abstime;
158      OBT      = l2->obt;
159      pkt_num  = l2->pkt_num;
160    
161      lon = l2->lon;
162      lat = l2->lat;
163      alt = l2->alt;
164    
165      l2->Bnorth = Bnorth;
166      l2->Beast = Beast;
167      l2->Bdown = Bdown;
168      l2->Babs = Babs;
169      BB0 = l2->BB0;
170      L = l2->L;
171    
172      londip = l2->londip;
173      latdip = l2->latdip;
174      altdip = l2->altdip;
175    
176      loncgm = l2->loncgm;
177      latcgm = l2->latcgm;
178      altcgm = l2->altcgm;
179    
180      loncbm = l2->loncbm;
181      latcbm = l2->latcbm;
182      altcbm = l2->altcbm;
183    
184      memcpy(cutoff, l2->cutoff, sizeof(l2->cutoff));
185    
186      // Quaternions
187      q0 = l2->q0;
188      q1 = l2->q1;
189      q2 = l2->q2;
190      q3 = l2->q3;
191    
192      // Euler angles (nadir reference frame)
193      theta = l2->theta;
194      phi = l2->phi;
195      etha = l2->etha;
196    
197      mode = l2->mode;
198      // Euler angles (local field reference frame)
199    //   thetamag = l2->thetamag;
200    //   phimag = l2->phimag;
201    //   ethamag = l2->ethamag;
202    
203    //   memcpy(goodAttitude, l2->goodAttitude, sizeof(l2->goodAttitude));
204    }
205    
206  ClassImp(OrbitalInfo)  ClassImp(OrbitalInfo)
   

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.23