Isis 3.0 Programmer Reference
Back | Home
SensorGetInfoWorkOrder.cpp
Go to the documentation of this file.
1 
23 #include "SensorGetInfoWorkOrder.h"
24 
25 #include <QtDebug>
26 
27 #include <QFileDialog>
28 #include <QInputDialog>
29 
30 #include "Directory.h"
31 #include "IException.h"
32 #include "Project.h"
33 #include "GuiCamera.h"
34 #include "SensorInfoWidget.h"
35 
36 namespace Isis {
37 
44  WorkOrder(project) {
45  QAction::setText(tr("Get Info...") );
46  }
47 
48 
54  WorkOrder(other) {
55  }
56 
57 
62  }
63 
64 
70  return new SensorGetInfoWorkOrder(*this);
71  }
72 
73 
84  if (!guiCamera)
85  return false;
86 
87  // if we already have a view for this camera, don't redisplay
89  for (int i = 0; i < existingViews.size(); i++) {
90  if (existingViews.at(i)->objectName() == guiCamera->displayProperties()->displayName() )
91  return false;
92  }
93 
94  return true;
95  }
96 
97 
104  bool success = WorkOrder::execute();
105 
106  if (success) {
107  QString sensorDisplayName = guiCamera()->displayProperties()->displayName();
108  QUndoCommand::setText(tr("Get %1 sensor info").arg(sensorDisplayName) );
109 
111  internalData.append(sensorDisplayName);
112  setInternalData(internalData);
113  }
114 
115  return success;
116  }
117 
118 
125  // depend on types of ourselves.
126  return dynamic_cast<SensorGetInfoWorkOrder *>(other);
127  }
128 
129 
134  SensorInfoWidget *sensorInfoWidget =
136 
137 
138  if (!sensorInfoWidget) {
139  QString msg = "error displaying sensor info";
141  }
142  }
143 
144 
149  //delete project()->directory()->cnetEditorViews().last();
150  }
151 }
152 
Widget for displaying information about a sensor.
The main project for cnetsuite.
Definition: Project.h:105
This is a child of class WorkOrder which is used for anything that performs an action in a Project...
bool dependsOn(WorkOrder *other) const
Determines whether a WorkOrder depends upon SensorGetInfoWorkerOrder.
Project * project() const
Returns the Project this WorkOrder is attached to.
Definition: WorkOrder.cpp:1116
QStringList internalData() const
Gets the internal data for this WorkOrder.
Definition: WorkOrder.cpp:1186
void syncRedo()
Redisplays the sensor view.
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:154
void syncUndo()
Deletes the last view.
SensorGetInfoWorkOrder(Project *project)
Constructor that creates a WorkOrder that will retrieve target body info.
Parent class for anything that performs an action in Project.
Definition: WorkOrder.h:104
QList< SensorInfoWidget * > sensorInfoViews()
Accessor for the list of SensorInfoWidgets currently available.
Definition: Directory.cpp:977
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:38
bool execute()
Attempts to retrieve target body info from the camera and display it in a view.
virtual bool isExecutable(GuiCameraQsp camera)
Determines if this WorkOrder can be executed.
Directory * directory() const
Returns the directory associated with this Project.
Definition: Project.cpp:824
virtual SensorGetInfoWorkOrder * clone() const
Returns a copy of the current instance of this WorkOrder.
QSharedPointer< GuiCamera > GuiCameraQsp
GuiCameraQsp Represents a smart pointer to a GuiCamera object.
Definition: GuiCamera.h:188
SensorInfoWidget * addSensorInfoView(GuiCameraQsp camera)
Add sensor data view widget to the window.
Definition: Directory.cpp:773
Isis exception class.
Definition: IException.h:99
GuiCameraQsp guiCamera()
WorkOrder::guiCamera.
Definition: WorkOrder.cpp:675
virtual bool execute()
The (child) implementation of this method should prompt the user/gather state by any means necessary...
Definition: WorkOrder.cpp:1078
void setInternalData(QStringList data)
Sets the internal data for this WorkOrder.
Definition: WorkOrder.cpp:1130

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:51