Isis 3 Programmer Reference
ControlHealthMonitorView.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "IsisDebug.h"
10 
11 #include "ControlHealthMonitorView.h"
12 
13 #include <QAction>
14 #include <QList>
15 #include <QSize>
16 #include <QSizePolicy>
17 #include <QToolBar>
18 #include <QVBoxLayout>
19 #include <QWidgetAction>
20 
21 #include "ControlHealthMonitorWidget.h"
22 #include "ControlPointEditView.h"
23 #include "ControlPointEditWidget.h"
24 #include "CnetEditorView.h"
25 #include "CubeDnView.h"
26 
27 #include "ControlNet.h"
28 #include "ControlPoint.h"
29 #include "Directory.h"
30 #include "ProjectItem.h"
31 #include "ProjectItemModel.h"
32 
33 #include "ToolPad.h"
34 
35 
36 namespace Isis {
37 
42  AbstractProjectItemView(parent) {
43  m_directory = directory;
44  ControlNet *net = m_directory->project()->activeControl()->controlNet();
45 
46  ControlNetVitals *vitals = new ControlNetVitals(net);
47  m_controlHealthMonitorWidget = new ControlHealthMonitorWidget(vitals, parent);
48 
49  connect(m_controlHealthMonitorWidget, SIGNAL(openPointEditor(ControlPoint *)),
50  this, SLOT(openPointEditor(ControlPoint *)));
51 
52  connect(m_controlHealthMonitorWidget, SIGNAL(openImageEditor(QList<QString>)),
53  this, SLOT(openImageEditor(QList<QString>)));
54 
55  setCentralWidget(m_controlHealthMonitorWidget);
56 
57  m_permToolBar = new QToolBar("Standard Tools", 0);
58  m_permToolBar->setObjectName("permToolBar");
59  m_permToolBar->setIconSize(QSize(22, 22));
60 
61  m_activeToolBar = new QToolBar("Active Tool", 0);
62  m_activeToolBar->setObjectName("activeToolBar");
63  m_activeToolBar->setIconSize(QSize(22, 22));
64 
65  m_toolPad = new ToolPad("Tool Pad", 0);
66  m_toolPad->setObjectName("toolPad");
67 
68 
69 // m_ControlHealthMonitorWidget->addToPermanent(m_permToolBar);
70 // m_ControlHealthMonitorWidget->addTo(m_activeToolBar);
71 // m_ControlHealthMonitorWidget->addTo(m_toolPad);
72 
73  m_activeToolBarAction = new QWidgetAction(this);
74  m_activeToolBarAction->setDefaultWidget(m_activeToolBar);
75 
76  setAcceptDrops(true);
77 
78  setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
79  }
80 
81 
86 
87  return QSize(500, 700);
88  }
89 
90 
101  ControlPointEditWidget* widget = m_directory->addControlPointEditView()->controlPointEditWidget();
102 
103  if (point && point != widget->editPoint()) {
104  widget->setEditPoint(point);
105  }
106 
107  // m_directory->addCnetEditorView(m_directory->project()->activeControl());
108  }
109 
110 
118  CubeDnView *cubeView = m_directory->addCubeDnView();
119  foreach (QString serial, serials) {
120  QList<ImageList*> imageLists = m_directory->project()->images();
121  foreach(ImageList *list, imageLists) {
122  foreach(Image *image, *list) {
123  QString imageSerial = image->serialNumber();
124  if (imageSerial == serial) {
125  ProjectItem *item = m_directory->model()->findItemData(QVariant::fromValue(image));
126  if (item) {
127  cubeView->addItem(item);
128  }
129  }
130  }
131  }
132  }
133  }
134 
135 
140  delete m_controlHealthMonitorWidget;
141  delete m_permToolBar;
142  delete m_activeToolBar;
143  delete m_toolPad;
144 
145  m_permToolBar = 0;
146  m_activeToolBar = 0;
147  m_toolPad = 0;
148  }
149 
150 
157  return m_controlHealthMonitorWidget;
158  }
159 
160 
167  return m_permToolBar->actions();
168  }
169 
170 
177  QList<QAction *> actions;
178  actions.append(m_activeToolBarAction);
179  return actions;
180  }
181 
182 
189  return m_toolPad->actions();
190  }
191 
192 
193 }
Isis::ControlHealthMonitorView::permToolBarActions
virtual QList< QAction * > permToolBarActions()
Returns a list of actions for the permanent tool bar.
Definition: ControlHealthMonitorView.cpp:166
QWidget
Isis::CubeDnView
View that displays cubes in a QView-like way.
Definition: CubeDnView.h:97
Isis::ControlHealthMonitorView::openImageEditor
void openImageEditor(QList< QString > serials)
This SLOT is designed to intercept the openImageEditor() signal that's emitted Whenever an image is d...
Definition: ControlHealthMonitorView.cpp:117
Isis::Directory
Definition: Directory.h:271
Isis::AbstractProjectItemView
AbstractProjectItemView is a base class for views of a ProjectItemModel in Qt's model-view framework.
Definition: AbstractProjectItemView.h:79
QList< QString >
Isis::Image::serialNumber
QString serialNumber()
Returns the serial number of the Cube.
Definition: Image.cpp:361
Isis::Directory::model
ProjectItemModel * model()
Gets the ProjectItemModel for this directory.
Definition: Directory.cpp:1091
Isis::ControlHealthMonitorView::m_toolPad
ToolPad * m_toolPad
The tool pad.
Definition: ControlHealthMonitorView.h:70
Isis::ControlHealthMonitorView::m_permToolBar
QToolBar * m_permToolBar
The permanent tool bar.
Definition: ControlHealthMonitorView.h:71
Isis::Directory::addCubeDnView
CubeDnView * addCubeDnView(QString objectName="")
Add the qview workspace to the window.
Definition: Directory.cpp:706
Isis::ControlPointEditView::controlPointEditWidget
ControlPointEditWidget * controlPointEditWidget()
Returns the ControlPointEditWidget.
Definition: ControlPointEditView.cpp:65
Isis::ControlHealthMonitorView::~ControlHealthMonitorView
~ControlHealthMonitorView()
Destructor.
Definition: ControlHealthMonitorView.cpp:139
Isis::ControlHealthMonitorView::toolPadActions
virtual QList< QAction * > toolPadActions()
Returns a list of actions for the tool pad.
Definition: ControlHealthMonitorView.cpp:188
Isis::Project::activeControl
Control * activeControl()
Return the Active Control (control network)
Definition: Project.cpp:1903
Isis::Directory::project
Project * project() const
Gets the Project for this directory.
Definition: Directory.cpp:1311
Isis::ControlHealthMonitorView::activeToolBarActions
virtual QList< QAction * > activeToolBarActions()
Returns a list of actions for the active tool bar.
Definition: ControlHealthMonitorView.cpp:176
Isis::ControlHealthMonitorView::m_activeToolBarAction
QWidgetAction * m_activeToolBarAction
Stores the active tool bar.
Definition: ControlHealthMonitorView.h:74
QToolBar
Isis::ImageList
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:55
Isis::Project::images
static QStringList images(QStringList)
Verify that the input fileNames are image files.
Definition: Project.cpp:894
Isis::ControlPointEditWidget
Gui for editing ControlPoints in ipce application.
Definition: ControlPointEditWidget.h:121
Isis::ControlPoint
A single control point.
Definition: ControlPoint.h:354
Isis::ControlHealthMonitorWidget
Interface that allows real-time evaluation of the state of a Control Network.
Definition: ControlHealthMonitorWidget.h:29
Isis::Control::controlNet
ControlNet * controlNet()
Open and return a pointer to the ControlNet for this Control.
Definition: Control.cpp:150
Isis::ControlNetVitals
ControlNetVitals.
Definition: ControlNetVitals.h:51
Isis::ControlHealthMonitorView::sizeHint
virtual QSize sizeHint() const
Return a reasonable size.
Definition: ControlHealthMonitorView.cpp:85
Isis::ControlNet
a control network
Definition: ControlNet.h:257
Isis::Image
This represents a cube in a project-based GUI interface.
Definition: Image.h:107
Isis::ProjectItemModel::findItemData
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...
Definition: ProjectItemModel.cpp:290
Isis::ControlHealthMonitorView::openPointEditor
void openPointEditor(ControlPoint *point)
This SLOT is designed to intercept the openPointEditor() signal that's emitted Whenever a point is do...
Definition: ControlHealthMonitorView.cpp:100
Isis::ControlHealthMonitorView::ControlHealthMonitorView
ControlHealthMonitorView(Directory *directory, QWidget *parent=0)
Constructor.
Definition: ControlHealthMonitorView.cpp:41
Isis::ControlHealthMonitorView::m_activeToolBar
QToolBar * m_activeToolBar
The active tool bar.
Definition: ControlHealthMonitorView.h:72
Isis::ToolPad
Definition: ToolPad.h:14
Isis::ControlHealthMonitorView::controlHealthMonitorWidget
ControlHealthMonitorWidget * controlHealthMonitorWidget()
Returns the ControlHealthMonitorWidget.
Definition: ControlHealthMonitorView.cpp:156
Isis::ControlPointEditWidget::setEditPoint
void setEditPoint(ControlPoint *controlPoint, QString serialNumber="")
Slot called by Directory to set the control point for editing.
Definition: ControlPointEditWidget.cpp:1169
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ProjectItem
Represents an item of a ProjectItemModel in Qt's model-view framework.
Definition: ProjectItem.h:134
Isis::CubeDnView::addItem
void addItem(ProjectItem *item)
Adds an item to the view.
Definition: CubeDnView.cpp:356