Isis 3 Programmer Reference
ControlHealthMonitorView.cpp
Go to the documentation of this file.
1 
23 #include "IsisDebug.h"
24 
26 
27 #include <QAction>
28 #include <QList>
29 #include <QSize>
30 #include <QSizePolicy>
31 #include <QToolBar>
32 #include <QVBoxLayout>
33 #include <QWidgetAction>
34 
36 #include "ControlPointEditView.h"
37 #include "ControlPointEditWidget.h"
38 #include "CnetEditorView.h"
39 #include "CubeDnView.h"
40 
41 #include "ControlNet.h"
42 #include "ControlPoint.h"
43 #include "Directory.h"
44 #include "ProjectItem.h"
45 #include "ProjectItemModel.h"
46 
47 #include "ToolPad.h"
48 
49 
50 namespace Isis {
51 
56  AbstractProjectItemView(parent) {
57  m_directory = directory;
58  ControlNet *net = m_directory->project()->activeControl()->controlNet();
59 
60  ControlNetVitals *vitals = new ControlNetVitals(net);
61  m_controlHealthMonitorWidget = new ControlHealthMonitorWidget(vitals, parent);
62 
63  connect(m_controlHealthMonitorWidget, SIGNAL(openPointEditor(ControlPoint *)),
64  this, SLOT(openPointEditor(ControlPoint *)));
65 
66  connect(m_controlHealthMonitorWidget, SIGNAL(openImageEditor(QList<QString>)),
67  this, SLOT(openImageEditor(QList<QString>)));
68 
69  setCentralWidget(m_controlHealthMonitorWidget);
70 
71  m_permToolBar = new QToolBar("Standard Tools", 0);
72  m_permToolBar->setObjectName("permToolBar");
73  m_permToolBar->setIconSize(QSize(22, 22));
74 
75  m_activeToolBar = new QToolBar("Active Tool", 0);
76  m_activeToolBar->setObjectName("activeToolBar");
77  m_activeToolBar->setIconSize(QSize(22, 22));
78 
79  m_toolPad = new ToolPad("Tool Pad", 0);
80  m_toolPad->setObjectName("toolPad");
81 
82 
83 // m_ControlHealthMonitorWidget->addToPermanent(m_permToolBar);
84 // m_ControlHealthMonitorWidget->addTo(m_activeToolBar);
85 // m_ControlHealthMonitorWidget->addTo(m_toolPad);
86 
87  m_activeToolBarAction = new QWidgetAction(this);
88  m_activeToolBarAction->setDefaultWidget(m_activeToolBar);
89 
90  setAcceptDrops(true);
91 
92  setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
93  }
94 
95 
100 
101  return QSize(500, 700);
102  }
103 
104 
115  ControlPointEditWidget* widget = m_directory->addControlPointEditView()->controlPointEditWidget();
116 
117  if (point && point != widget->editPoint()) {
118  widget->setEditPoint(point);
119  }
120 
121  // m_directory->addCnetEditorView(m_directory->project()->activeControl());
122  }
123 
124 
132  CubeDnView *cubeView = m_directory->addCubeDnView();
133  foreach (QString serial, serials) {
134  QList<ImageList*> imageLists = m_directory->project()->images();
135  foreach(ImageList *list, imageLists) {
136  foreach(Image *image, *list) {
137  QString imageSerial = image->serialNumber();
138  if (imageSerial == serial) {
139  ProjectItem *item = m_directory->model()->findItemData(QVariant::fromValue(image));
140  if (item) {
141  cubeView->addItem(item);
142  }
143  }
144  }
145  }
146  }
147  }
148 
149 
154  delete m_controlHealthMonitorWidget;
155  delete m_permToolBar;
156  delete m_activeToolBar;
157  delete m_toolPad;
158 
159  m_permToolBar = 0;
160  m_activeToolBar = 0;
161  m_toolPad = 0;
162  }
163 
164 
171  return m_controlHealthMonitorWidget;
172  }
173 
174 
181  return m_permToolBar->actions();
182  }
183 
184 
191  QList<QAction *> actions;
192  actions.append(m_activeToolBarAction);
193  return actions;
194  }
195 
196 
203  return m_toolPad->actions();
204  }
205 
206 
207 }
void openImageEditor(QList< QString > serials)
This SLOT is designed to intercept the openImageEditor() signal that&#39;s emitted Whenever an image is d...
$Date$ $Revision$
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:55
QWidgetAction * m_activeToolBarAction
Stores the active tool bar.
ControlPointEditWidget * controlPointEditWidget()
Returns the ControlPointEditWidget.
$Date$ $Revision$
virtual QList< QAction * > toolPadActions()
Returns a list of actions for the tool pad.
$Date$ $Revision$
ControlNetVitals.
QToolBar * m_permToolBar
The permanent tool bar.
Gui for editing ControlPoints in ipce application.
Control * activeControl()
Return the Active Control (control network)
Definition: Project.cpp:1903
virtual QList< QAction * > permToolBarActions()
Returns a list of actions for the permanent tool bar.
Interface that allows real-time evaluation of the state of a Control Network.
AbstractProjectItemView is a base class for views of a ProjectItemModel in Qt&#39;s model-view framework...
static QStringList images(QStringList)
Verify that the input fileNames are image files.
Definition: Project.cpp:894
ProjectItem * findItemData(const QVariant &data, int role=Qt::UserRole+1)
Returns the first item found that contains the given data in the given role or a null pointer if no i...
virtual QList< QAction * > activeToolBarActions()
Returns a list of actions for the active tool bar.
ProjectItemModel * model()
Gets the ProjectItemModel for this directory.
Definition: Directory.cpp:1105
a control network
Definition: ControlNet.h:271
A single control point.
Definition: ControlPoint.h:369
This represents a cube in a project-based GUI interface.
Definition: Image.h:107
ControlNet * controlNet()
Open and return a pointer to the ControlNet for this Control.
Definition: Control.cpp:142
$Date$ $Revision$
void addItem(ProjectItem *item)
Adds an item to the view.
Definition: CubeDnView.cpp:370
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
View that displays cubes in a QView-like way.
Definition: CubeDnView.h:111
Represents an item of a ProjectItemModel in Qt&#39;s model-view framework.
Definition: ProjectItem.h:146
QString serialNumber()
Returns the serial number of the Cube.
Definition: Image.cpp:361
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
ControlHealthMonitorView(Directory *directory, QWidget *parent=0)
Constructor.
Project * project() const
Gets the Project for this directory.
Definition: Directory.cpp:1325
QToolBar * m_activeToolBar
The active tool bar.
virtual QSize sizeHint() const
Return a reasonable size.
ControlHealthMonitorWidget * controlHealthMonitorWidget()
Returns the ControlHealthMonitorWidget.
void setEditPoint(ControlPoint *controlPoint, QString serialNumber="")
Slot called by Directory to set the control point for editing.
$Date$ $Revision$
void openPointEditor(ControlPoint *point)
This SLOT is designed to intercept the openPointEditor() signal that&#39;s emitted Whenever a point is do...
CubeDnView * addCubeDnView(QString objectName="")
Add the qview workspace to the window.
Definition: Directory.cpp:720