OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNitfAcftbTag.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: LGPL
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: David Burken
8 //
9 // Description: ACFTB - Aircraft Infomation Extension Format tag class
10 // declaration.
11 //
12 // See document STDI-0002 (version 3), Appendix E, Table E-6 for more info.
13 //
14 //----------------------------------------------------------------------------
15 // $Id
16 
17 #include <cstring>
18 #include <istream>
19 #include <iostream>
20 #include <iomanip>
21 
23 
24 
26 
28  : ossimNitfRegisteredTag(std::string("ACFTB"), CEL_SIZE)
29 {
30  clearFields();
31 }
32 
34 {
35 }
36 
38 {
39  clearFields();
40 
41  in.read(theAcMsnId, AC_MSN_ID_SIZE);
42  in.read(theAcTailNo, AC_TAIL_NO_SIZE);
43  in.read(theAcTo, AC_TO_SIZE);
45  in.read(theSensorId, SENSOR_ID_SIZE);
47  in.read(theScNum, SCNUM_SIZE);
48  in.read(thePDate, PDATE_SIZE);
49  in.read(theImHostNo, IMHOSTNO_SIZE);
50  in.read(theImReqID, IMREQID_SIZE);
51  in.read(theMPlan, MPLAN_SIZE);
52  in.read(theEntLoc, ENTLOC_SIZE);
53  in.read(theLocAccy, LOC_ACCY_SIZE);
54  in.read(theEntelv, ENTELV_SIZE);
55  in.read(theElvUnit, ELV_UNIT_SIZE);
56  in.read(theExitLoc, EXITLOC_SIZE);
57  in.read(theExitElev, EXITELV_SIZE);
58  in.read(theTMap, TMAP_SIZE);
64  in.read(theSenserial, SENSERIAL_SIZE);
65  in.read(theAbSwVer, ABSWVER_SIZE);
66  in.read(theCalDate, CAL_DATE_SIZE);
67  in.read(thePatchTot, PATCH_TOT_SIZE);
68  in.read(theMtiTot, MTI_TOT_SIZE);
69 }
70 
72 {
73  out.write(theAcMsnId, AC_MSN_ID_SIZE);
74  out.write(theAcTailNo, AC_TAIL_NO_SIZE);
75  out.write(theAcTo, AC_TO_SIZE);
77  out.write(theSensorId, SENSOR_ID_SIZE);
79  out.write(theScNum, SCNUM_SIZE);
80  out.write(thePDate, PDATE_SIZE);
81  out.write(theImHostNo, IMHOSTNO_SIZE);
82  out.write(theImReqID, IMREQID_SIZE);
83  out.write(theMPlan, MPLAN_SIZE);
84  out.write(theEntLoc, ENTLOC_SIZE);
85  out.write(theLocAccy, LOC_ACCY_SIZE);
86  out.write(theEntelv, ENTELV_SIZE);
87  out.write(theElvUnit, ELV_UNIT_SIZE);
88  out.write(theExitLoc, EXITLOC_SIZE);
89  out.write(theExitElev, EXITELV_SIZE);
90  out.write(theTMap, TMAP_SIZE);
91  out.write(theRowSpacing, ROW_SPACING_SIZE);
93  out.write(theColSpacing, COL_SPACING_SIZE);
96  out.write(theSenserial, SENSERIAL_SIZE);
97  out.write(theAbSwVer, ABSWVER_SIZE);
98  out.write(theCalDate, CAL_DATE_SIZE);
99  out.write(thePatchTot, PATCH_TOT_SIZE);
100  out.write(theMtiTot, MTI_TOT_SIZE);
101 }
102 
104 {
105  // BCS-N's to '0's, BCS-A's to ' '(spaces)
106 
107  // clear
108  memset(theAcMsnId, ' ', AC_MSN_ID_SIZE);
109  memset(theAcTailNo, ' ', AC_TAIL_NO_SIZE);
110  memset(theAcTo, ' ', AC_TO_SIZE);
111  memset(theSensorIdType, ' ', SENSOR_ID_TYPE_SIZE);
112  memset(theSensorId, ' ', SENSOR_ID_SIZE);
113  memset(theSceneSource, ' ', SCENE_SOURCE_SIZE);
114  memset(theScNum, ' ', SCNUM_SIZE);
115  memset(thePDate, ' ', PDATE_SIZE);
116  memset(theImHostNo, ' ', IMHOSTNO_SIZE);
117  memset(theImReqID, ' ', IMREQID_SIZE);
118  memset(theMPlan, ' ', MPLAN_SIZE);
119  memset(theEntLoc, ' ', ENTLOC_SIZE);
120  memset(theLocAccy, ' ', LOC_ACCY_SIZE);
121  memset(theEntelv, ' ', ENTELV_SIZE);
122  memset(theElvUnit, ' ', ELV_UNIT_SIZE);
123  memset(theExitLoc, ' ', EXITLOC_SIZE);
124  memset(theExitElev, ' ', EXITELV_SIZE);
125  memset(theTMap, ' ', TMAP_SIZE);
126  memset(theRowSpacing, ' ', ROW_SPACING_SIZE);
128  memset(theColSpacing, ' ', COL_SPACING_SIZE);
130  memset(theFocalLength, ' ', FOCAL_LENGTH_SIZE);
131  memset(theSenserial, ' ', SENSERIAL_SIZE);
132  memset(theAbSwVer, ' ', ABSWVER_SIZE);
133  memset(theCalDate, ' ', CAL_DATE_SIZE);
134  memset(thePatchTot, ' ', PATCH_TOT_SIZE);
135  memset(theMtiTot, ' ', MTI_TOT_SIZE);
136 
137 
138  // null terminate
139  theAcMsnId[AC_MSN_ID_SIZE] = '\0';
141  theAcTo[AC_TO_SIZE] = '\0';
143  theSensorId[SENSOR_ID_SIZE] = '\0';
145  theScNum[SCNUM_SIZE] = '\0';
146  thePDate[PDATE_SIZE] = '\0';
147  theImHostNo[IMHOSTNO_SIZE] = '\0';
148  theImReqID[IMREQID_SIZE] = '\0';
149  theMPlan[MPLAN_SIZE] = '\0';
150  theEntLoc[ENTLOC_SIZE] = '\0';
151  theLocAccy[LOC_ACCY_SIZE] = '\0';
152  theEntelv[ENTELV_SIZE] = '\0';
153  theElvUnit[ELV_UNIT_SIZE] = '\0';
154  theExitLoc[EXITLOC_SIZE] = '\0';
155  theExitElev[EXITELV_SIZE] = '\0';
156  theTMap[TMAP_SIZE] = '\0';
163  theAbSwVer[ABSWVER_SIZE] = '\0';
164  theCalDate[CAL_DATE_SIZE] = '\0';
165  thePatchTot[PATCH_TOT_SIZE] = '\0';
166  theMtiTot[MTI_TOT_SIZE] = '\0';
167 }
168 
170 {
171  return ossimString(theFocalLength);
172 }
173 
175 {
176  return ossimString(theColSpacing);
177 }
178 
180 {
182 }
183 
185 {
186  return ossimString(theRowSpacing);
187 }
188 
190 {
192 }
193 
194 
196  std::ostream& out, const std::string& prefix) const
197 {
198  std::string pfx = prefix;
199  pfx += getTagName();
200  pfx += ".";
201 
202  out << setiosflags(std::ios::left)
203  << pfx << std::setw(24) << "CETAG:"
204  << getTagName() << "\n"
205  << pfx << std::setw(24) << "CEL:" << getTagLength() << "\n"
206  << pfx << std::setw(24) << "AC_MSN_ID:"
207  << theAcMsnId << "\n"
208  << pfx << std::setw(24) << "AC_TAIL_NO:"
209  << theAcTailNo << "\n"
210  << pfx << std::setw(24) << "AC_TO:"
211  << theAcTo << "\n"
212  << pfx << std::setw(24) << "SENSOR_ID_TYPE:"
213  << theSensorIdType << "\n"
214  << pfx << std::setw(24) << "SENSOR_ID:"
215  << theSensorId << "\n"
216  << pfx << std::setw(24) << "SCENE_SOURCE:"
217  << theSceneSource << "\n"
218  << pfx << std::setw(24) << "SCNUM:"
219  << theScNum << "\n"
220  << pfx << std::setw(24) << "PDATE:"
221  << thePDate << "\n"
222  << pfx << std::setw(24) << "IMHOSTNO:"
223  << theImHostNo << "\n"
224  << pfx << std::setw(24) << "IMREQID:"
225  << theImReqID << "\n"
226  << pfx << std::setw(24) << "MPLAN:"
227  << theMPlan << "\n"
228  << pfx << std::setw(24) << "ENTLOC:"
229  << theEntLoc << "\n"
230  << pfx << std::setw(24) << "LOC_ACCY:"
231  << theLocAccy << "\n"
232  << pfx << std::setw(24) << "ENTELV:"
233  << theEntelv << "\n"
234  << pfx << std::setw(24) << "ELV_UNIT:"
235  << theElvUnit << "\n"
236  << pfx << std::setw(24) << "EXITLOC:"
237  << theExitLoc << "\n"
238  << pfx << std::setw(24) << "EXITELV:"
239  << theExitElev << "\n"
240  << pfx << std::setw(24) << "TMAP:"
241  << theTMap << "\n"
242  << pfx << std::setw(24) << "ROW_SPACING:"
243  << theRowSpacing << "\n"
244  << pfx << std::setw(24) << "ROW_SPACING_UNITS:"
245  << theRowSpacingUnits << "\n"
246  << pfx << std::setw(24) << "COL_SPACING:"
247  << theColSpacing << "\n"
248  << pfx << std::setw(24) << "COL_SPACING_UINTS:"
249  << theColSpacingUnits << "\n"
250  << pfx << std::setw(24) << "FOCAL_LENGTH:"
251  << theFocalLength << "\n"
252  << pfx << std::setw(24) << "SENSERIAL:"
253  << theSenserial << "\n"
254  << pfx << std::setw(24) << "ABSWVER:"
255  << theAbSwVer << "\n"
256  << pfx << std::setw(24) << "CAL_DATE:"
257  << theCalDate << "\n"
258  << pfx << std::setw(24) << "PATCH_TOT:"
259  << thePatchTot << "\n"
260  << pfx << std::setw(24) << "MTI_TOT:"
261  << theMtiTot << "\n";
262 
263  return out;
264 }
char theAcTailNo[AC_TAIL_NO_SIZE+1]
FIELD: AC_TAIL_NO.
char theAcMsnId[AC_MSN_ID_SIZE+1]
Type R = Required Type <R> = BCS spaces allowed for entire field.
virtual const std::string & getTagName() const
This will return the name of the registered tag for this user defined header.
RTTI_DEF1(ossimNitfAcftbTag, "ossimNitfAcftbTag", ossimNitfRegisteredTag)
char theMtiTot[MTI_TOT_SIZE+1]
FIELD: MTI_TOT.
char theImHostNo[IMHOSTNO_SIZE+1]
FIELD: IMHOSTNO.
char theRowSpacingUnits[ROW_SPACING_UNITS_SIZE+1]
FIELD: ROW_SPACING_UNITS.
char theCalDate[CAL_DATE_SIZE+1]
FIELD: CAL_DATE.
char theSenserial[SENSERIAL_SIZE+1]
FIELD: SENSERIAL.
char theImReqID[IMREQID_SIZE+1]
FIELD: IMREQID.
char theMPlan[MPLAN_SIZE+1]
FIELD: MPLAN.
virtual void parseStream(ossim::istream &in)
Method to parse data from stream.
char theColSpacing[COL_SPACING_SIZE+1]
FIELD: COL_SPACING.
virtual std::ostream & print(std::ostream &out, const std::string &prefix=std::string()) const
Print method that outputs a key/value type format adding prefix to keys.
ossimNitfAcftbTag()
default constructor
char theAbSwVer[ABSWVER_SIZE+1]
FIELD: ABSWVER.
ossimString getColumnSpacing() const
char theColSpacingUnits[COL_SPACING_UINTS_SIZE+1]
FIELD: COL_SPACING_UINTS.
char theEntelv[ENTELV_SIZE+1]
FIELD: ENTELV.
char theSensorIdType[SENSOR_ID_TYPE_SIZE+1]
FIELD: SENSOR_ID_TYPE.
char theSensorId[SENSOR_ID_SIZE+1]
FIELD: SENSOR_ID.
char theElvUnit[ELV_UNIT_SIZE+1]
FIELD: ELV_UNIT.
virtual void clearFields()
Method to clear all fields including null terminating.
char theFocalLength[FOCAL_LENGTH_SIZE+1]
FIELD: FOCAL_LENGTH.
char theAcTo[AC_TO_SIZE+1]
FIELD: AC_TO.
virtual ossim_uint32 getTagLength() const
Returns the length in bytes of the tag from the CEL or REL field.
ossimString getColumnSpacingUnits() const
char thePatchTot[PATCH_TOT_SIZE+1]
FIELD: PATCH_TOT.
char theEntLoc[ENTLOC_SIZE+1]
FIELD: ENTLOC.
char theTMap[TMAP_SIZE+1]
FIELD: TMAP.
virtual ~ossimNitfAcftbTag()
destructor
virtual void writeStream(ossim::ostream &out)
Method to write data to stream.
ossimString getFocalLength() const
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
char thePDate[PDATE_SIZE+1]
FIELD: PDATE.
char theSceneSource[SCENE_SOURCE_SIZE+1]
FIELD: SCENE_SOURCE.
char theRowSpacing[ROW_SPACING_SIZE+1]
FIELD: ROW_SPACING.
char theExitLoc[EXITLOC_SIZE+1]
FIELD: EXITLOC.
ossimString getRowSpacing() const
char theExitElev[EXITELV_SIZE+1]
FIELD: EXITELV.
char theLocAccy[LOC_ACCY_SIZE+1]
FIELD: LOC_ACCY.
char theScNum[SCNUM_SIZE+1]
FIELD: SCNUM.
ossimString getRowSpacingUnits() const
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23