Isis 3 Programmer Reference
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  // TODO Find legal image for this!
38  image.load(":cassini-iss-nac");
39  }
40  else if (displayName.contains("Metric")) {
41  image.load(FileName("$ISISROOT/images/icons/nasa_apollo_metric_camera.png")
42  .expanded());
43  }
44  else if (displayName.contains("HiRISE")) {
45  // TODO Find legal image for this!
46  image.load(":hirise-camera");
47  }
48 
49  m_ui->spacecraftlabel->setText(tr("Spacecraft: %1")
50  .arg(m_camera->spacecraftNameLong()));
51 
52  setMinimumWidth(m_ui->tabWidget->minimumWidth()+20);
53 
54  m_ui->targetImage->setPixmap(image);
55 
56  setFrameStyle(QFrame::Panel | QFrame::Sunken);
57  setLineWidth(2);
58 
59  m_ui->tabWidget->setCurrentIndex(0);
60 
61 // m_ui->poleRightAscensionLabel->setText(formatPoleRaString());
62 // m_ui->poleDeclinationLabel->setText(formatPoleDecString());
63 // m_ui->polePMOffsetLabel->setText(formatPmString());
64 
65 // m_ui->aRadiiLabel->setText(tr("%1").arg(m_target->radiusA().kilometers()));
66 // m_ui->bRadiiLabel->setText(tr("%1").arg(m_target->radiusB().kilometers()));
67 // m_ui->cRadiiLabel->setText(tr("%1").arg(m_target->radiusC().kilometers()));
68 // m_ui->meanRadiiLabel->setText(tr("%1").arg(m_target->meanRadius().kilometers()));
69  }
70 
71 
76  delete m_ui;
77  }
78 
79 
80 // QString SensorInfoWidget::formatPoleRaString() {
81 // std::vector<double> poleRaCoefs = m_target->poleRaCoefs();
82 // std::vector<double> poleRaNutPrecCoefs = m_target->poleRaNutPrecCoefs();
83 
84 // const QChar degChar(0260);
85 // QString poleRaString = "";
86 // QString coefLetter = m_target->naifPlanetSystemName().at(0);
87 
88 // if (poleRaCoefs[1] < 0.0 )
89 // poleRaString.append(tr("%1%3 - %2T").arg(poleRaCoefs[0]).arg(-poleRaCoefs[1]).arg(degChar));
90 // else
91 // poleRaString.append(tr("%1%3 + %2T").arg(poleRaCoefs[0]).arg(poleRaCoefs[1]).arg(degChar));
92 
93 // QString tmp;
94 // int nCoefs = poleRaNutPrecCoefs.size();;
95 // for (int i = 0; i < nCoefs; i++) {
96 // if (poleRaNutPrecCoefs[i] < 0.0 ) {
97 // tmp.append(tr(" - %1%2%3").arg(-poleRaNutPrecCoefs[i]).arg("sin %1").arg(coefLetter)
98 // .arg(i+1));
99 // }
100 // else if (poleRaNutPrecCoefs[i] > 0.0 ) {
101 // tmp.append(tr(" + %1%2%3").arg(poleRaNutPrecCoefs[i]).arg("sin %1").arg(coefLetter)
102 // .arg(i+1));
103 // }
104 // }
105 
106 // poleRaString.append(tmp);
107 
108 // return poleRaString;
109 // }
110 
111 
112 // QString SensorInfoWidget::formatPoleDecString() {
113 // std::vector<double> poleDecCoefs = m_target->poleDecCoefs();
114 // std::vector<double> poleDecNutPrecCoefs = m_target->poleDecNutPrecCoefs();
115 
116 // const QChar degChar(0260);
117 // QString poleDecString = "";
118 // QString coefLetter = m_target->naifPlanetSystemName().at(0);
119 
120 // if (poleDecCoefs[1] < 0.0 )
121 // poleDecString.append(tr("%1%3 - %2T").arg(poleDecCoefs[0]).arg(-poleDecCoefs[1])
122 // .arg(degChar));
123 // else
124 // poleDecString.append(tr("%1%3 + %2T").arg(poleDecCoefs[0]).arg(poleDecCoefs[1]).arg(degChar));
125 
126 // QString tmp;
127 // int nCoefs = poleDecNutPrecCoefs.size();;
128 // for (int i = 0; i < nCoefs; i++) {
129 // if (poleDecNutPrecCoefs[i] < 0.0 ) {
130 // tmp.append(tr(" - %1%2%3").arg(-poleDecNutPrecCoefs[i]).arg("cos %1").arg(coefLetter)
131 // .arg(i+1));
132 // }
133 // else if (poleDecNutPrecCoefs[i] > 0.0 ) {
134 // tmp.append(tr(" + %1%2%3").arg(poleDecNutPrecCoefs[i]).arg("cos %1").arg(coefLetter)
135 // .arg(i+1));
136 // }
137 // }
138 
139 // poleDecString.append(tmp);
140 
141 // return poleDecString;
142 // }
143 
144 
145 // QString SensorInfoWidget::formatPmString() {
146 // std::vector<double> pmCoefs = m_target->pmCoefs();
147 // std::vector<double> pmNutPrecCoefs = m_target->pmNutPrecCoefs();
148 
149 // const QChar degChar(0260);
150 // QString pmString = "";
151 // QString coefLetter = m_target->naifPlanetSystemName().at(0);
152 
153 // if (pmCoefs[1] < 0.0 )
154 // pmString.append(tr("%1%3 - %2d").arg(pmCoefs[0]).arg(-pmCoefs[1]).arg(degChar));
155 // else if (pmCoefs[1] > 0.0 )
156 // pmString.append(tr("%1%3 + %2d").arg(pmCoefs[0]).arg(pmCoefs[1]).arg(degChar));
157 
158 // if (pmCoefs[2] < 0.0 )
159 // pmString.append(tr(" - %2d^2").arg(-pmCoefs[2]));
160 // else if (pmCoefs[2] > 0.0 )
161 // pmString.append(tr(" + %2d^2").arg(pmCoefs[2]));
162 
163 
164 // QString tmp;
165 // for (int i = 0; i < pmNutPrecCoefs.size(); i++) {
166 // 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 // else if (pmNutPrecCoefs[i] > 0.0 ) {
170 // tmp.append(tr(" + %1%2%3").arg(pmNutPrecCoefs[i]).arg("sin %1").arg(coefLetter).arg(i+1));
171 // }
172 // }
173 
174 // pmString.append(tmp);
175 
176 // return pmString;
177 // }
178 }
QWidget
Isis::Directory
Definition: Directory.h:271
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::SensorInfoWidget::m_ui
Ui::SensorInfoWidget * m_ui
The widget ui.
Definition: SensorInfoWidget.h:38
Isis::GuiCamera::displayProperties
const GuiCameraDisplayProperties * displayProperties() const
Retrieves the display properties of the camera.
Definition: GuiCamera.cpp:133
Isis::GuiCamera::spacecraftNameLong
QString spacecraftNameLong()
Retrieves the full name of the spacecraft.
Definition: GuiCamera.cpp:343
Isis::SensorInfoWidget::~SensorInfoWidget
~SensorInfoWidget()
Destructor.
Definition: SensorInfoWidget.cpp:75
Isis::GuiCamera
Container class for GuiCamera.
Definition: GuiCamera.h:72
Isis::SensorInfoWidget::m_camera
GuiCamera * m_camera
The sensor whose information is being displayed.
Definition: SensorInfoWidget.h:45
Isis::DisplayProperties::displayName
QString displayName() const
Returns the display name.
Definition: DisplayProperties.cpp:88
GuiCamera.h
GuiCameraDisplayProperties.h
Isis::SensorInfoWidget::SensorInfoWidget
SensorInfoWidget(GuiCamera *camera, Directory *directory, QWidget *parent=0)
Constructor.
Definition: SensorInfoWidget.cpp:21
Isis::SensorInfoWidget
Widget for displaying information about a sensor.
Definition: SensorInfoWidget.h:30
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16