Isis 3.0 Programmer Reference
Back | Home
SensorInfoWidget.cpp
1 #include "SensorInfoWidget.h"
2 #include "ui_SensorInfoWidget.h"
3 
4 #include <QPixmap>
5 
6 #include "Camera.h"
7 #include "CameraDistortionMap.h"
8 #include "Directory.h"
9 #include "GuiCamera.h"
11 
12 namespace Isis {
13 
22  QWidget *parent) : m_ui(new Ui::SensorInfoWidget) {
23  m_ui->setupUi(this);
24 
25  m_camera = camera;
26 
27  // danger here
28 // Camera *isisCamera = camera->camera();
29  // danger here
30 
31  QString displayName = camera->displayProperties()->displayName();
32 
33 // CameraDistortionMap *distortionMap = isisCamera->DistortionMap();
34 
35  QPixmap image;
36  if (displayName.contains("ISSNA")) {
37  image.load(":cassini-iss-nac");
38  }
39  else if (displayName.contains("Metric")) {
40  image.load(":apollo-metric-camera");
41  }
42  else if (displayName.contains("HiRISE")) {
43  image.load(":hirise-camera");
44  }
45 
46  m_ui->spacecraftlabel->setText(tr("Spacecraft: %1")
47  .arg(m_camera->spacecraftNameLong()));
48 
49  setMinimumWidth(m_ui->tabWidget->minimumWidth()+20);
50 
51  m_ui->targetImage->setPixmap(image);
52 
53  setFrameStyle(QFrame::Panel | QFrame::Sunken);
54  setLineWidth(2);
55 
56  m_ui->tabWidget->setCurrentIndex(0);
57 
58 // m_ui->poleRightAscensionLabel->setText(formatPoleRaString());
59 // m_ui->poleDeclinationLabel->setText(formatPoleDecString());
60 // m_ui->polePMOffsetLabel->setText(formatPmString());
61 
62 // m_ui->aRadiiLabel->setText(tr("%1").arg(m_target->radiusA().kilometers()));
63 // m_ui->bRadiiLabel->setText(tr("%1").arg(m_target->radiusB().kilometers()));
64 // m_ui->cRadiiLabel->setText(tr("%1").arg(m_target->radiusC().kilometers()));
65 // m_ui->meanRadiiLabel->setText(tr("%1").arg(m_target->meanRadius().kilometers()));
66  }
67 
68 
73  delete m_ui;
74  }
75 
76 
77 // QString SensorInfoWidget::formatPoleRaString() {
78 // std::vector<double> poleRaCoefs = m_target->poleRaCoefs();
79 // std::vector<double> poleRaNutPrecCoefs = m_target->poleRaNutPrecCoefs();
80 
81 // const QChar degChar(0260);
82 // QString poleRaString = "";
83 // QString coefLetter = m_target->naifPlanetSystemName().at(0);
84 
85 // if (poleRaCoefs[1] < 0.0 )
86 // poleRaString.append(tr("%1%3 - %2T").arg(poleRaCoefs[0]).arg(-poleRaCoefs[1]).arg(degChar));
87 // else
88 // poleRaString.append(tr("%1%3 + %2T").arg(poleRaCoefs[0]).arg(poleRaCoefs[1]).arg(degChar));
89 
90 // QString tmp;
91 // int nCoefs = poleRaNutPrecCoefs.size();;
92 // for (int i = 0; i < nCoefs; i++) {
93 // if (poleRaNutPrecCoefs[i] < 0.0 ) {
94 // tmp.append(tr(" - %1%2%3").arg(-poleRaNutPrecCoefs[i]).arg("sin %1").arg(coefLetter)
95 // .arg(i+1));
96 // }
97 // else if (poleRaNutPrecCoefs[i] > 0.0 ) {
98 // tmp.append(tr(" + %1%2%3").arg(poleRaNutPrecCoefs[i]).arg("sin %1").arg(coefLetter)
99 // .arg(i+1));
100 // }
101 // }
102 
103 // poleRaString.append(tmp);
104 
105 // return poleRaString;
106 // }
107 
108 
109 // QString SensorInfoWidget::formatPoleDecString() {
110 // std::vector<double> poleDecCoefs = m_target->poleDecCoefs();
111 // std::vector<double> poleDecNutPrecCoefs = m_target->poleDecNutPrecCoefs();
112 
113 // const QChar degChar(0260);
114 // QString poleDecString = "";
115 // QString coefLetter = m_target->naifPlanetSystemName().at(0);
116 
117 // if (poleDecCoefs[1] < 0.0 )
118 // poleDecString.append(tr("%1%3 - %2T").arg(poleDecCoefs[0]).arg(-poleDecCoefs[1])
119 // .arg(degChar));
120 // else
121 // poleDecString.append(tr("%1%3 + %2T").arg(poleDecCoefs[0]).arg(poleDecCoefs[1]).arg(degChar));
122 
123 // QString tmp;
124 // int nCoefs = poleDecNutPrecCoefs.size();;
125 // for (int i = 0; i < nCoefs; i++) {
126 // if (poleDecNutPrecCoefs[i] < 0.0 ) {
127 // tmp.append(tr(" - %1%2%3").arg(-poleDecNutPrecCoefs[i]).arg("cos %1").arg(coefLetter)
128 // .arg(i+1));
129 // }
130 // else if (poleDecNutPrecCoefs[i] > 0.0 ) {
131 // tmp.append(tr(" + %1%2%3").arg(poleDecNutPrecCoefs[i]).arg("cos %1").arg(coefLetter)
132 // .arg(i+1));
133 // }
134 // }
135 
136 // poleDecString.append(tmp);
137 
138 // return poleDecString;
139 // }
140 
141 
142 // QString SensorInfoWidget::formatPmString() {
143 // std::vector<double> pmCoefs = m_target->pmCoefs();
144 // std::vector<double> pmNutPrecCoefs = m_target->pmNutPrecCoefs();
145 
146 // const QChar degChar(0260);
147 // QString pmString = "";
148 // QString coefLetter = m_target->naifPlanetSystemName().at(0);
149 
150 // if (pmCoefs[1] < 0.0 )
151 // pmString.append(tr("%1%3 - %2d").arg(pmCoefs[0]).arg(-pmCoefs[1]).arg(degChar));
152 // else if (pmCoefs[1] > 0.0 )
153 // pmString.append(tr("%1%3 + %2d").arg(pmCoefs[0]).arg(pmCoefs[1]).arg(degChar));
154 
155 // if (pmCoefs[2] < 0.0 )
156 // pmString.append(tr(" - %2d^2").arg(-pmCoefs[2]));
157 // else if (pmCoefs[2] > 0.0 )
158 // pmString.append(tr(" + %2d^2").arg(pmCoefs[2]));
159 
160 
161 // QString tmp;
162 // for (int i = 0; i < pmNutPrecCoefs.size(); i++) {
163 // if (pmNutPrecCoefs[i] < 0.0 ) {
164 // tmp.append(tr(" - %1%2%3").arg(-pmNutPrecCoefs[i]).arg("sin %1").arg(coefLetter).arg(i+1));
165 // }
166 // else if (pmNutPrecCoefs[i] > 0.0 ) {
167 // tmp.append(tr(" + %1%2%3").arg(pmNutPrecCoefs[i]).arg("sin %1").arg(coefLetter).arg(i+1));
168 // }
169 // }
170 
171 // pmString.append(tmp);
172 
173 // return pmString;
174 // }
175 }
Ui::SensorInfoWidget * m_ui
The widget ui.
Widget for displaying information about a sensor.
QString spacecraftNameLong()
Retrieves the full name of the spacecraft.
Definition: GuiCamera.cpp:443
Container class for GuiCamera.
Definition: GuiCamera.h:70
~SensorInfoWidget()
Destructor.
GuiCamera * m_camera
The sensor whose information is being displayed.
const GuiCameraDisplayProperties * displayProperties() const
Retrieves the display properties of the camera.
Definition: GuiCamera.cpp:135
QString displayName() const
Returns the display name.
SensorInfoWidget(GuiCamera *camera, Directory *directory, QWidget *parent=0)
Constructor.

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:28:53