Isis 3.0 Programmer Reference
Back | Home
SetActiveControlWorkOrder.cpp
Go to the documentation of this file.
1 
22 
23 #include <QMessageBox>
24 #include <QtDebug>
25 
26 #include "Control.h"
27 #include "ControlNet.h"
28 #include "Directory.h"
29 #include "IException.h"
30 #include "Project.h"
31 
32 namespace Isis {
33 
39  WorkOrder(project) {
40 
41  QAction::setText(tr("Set Active Control Network") );
42  QUndoCommand::setText(tr("Set Active Control Network"));
43  }
44 
45 
51  WorkOrder(other) {
52  }
53 
54 
59  }
60 
61 
67  return new SetActiveControlWorkOrder(*this);
68  }
69 
70 
78  if (controls->size() != 1 || project()->activeControl() == controls->at(0)) {
79  return false;
80  }
81 
82  return true;
83  }
84 
85 
91  bool success = WorkOrder::execute();
92 
93  if (success) {
94 
95  if (project()->activeImageList()) {
97  project()->activeControl()->controlNet()->SetImages(*project()->activeImageList()->serialNumberList());
98  success = true;
99  }
100  else {
101  QMessageBox::critical(NULL, tr("Unable to set active control."),
102  tr("You must first choose an active Image List before setting "
103  "the active control net."));
104  success = false;
105  }
106 // internalData.append(activeControl()->displayProperties()->displayName());
107 // setInternalData(internalData);
108  }
109 
110  return success;
111  }
112 }
113 
The main project for cnetsuite.
Definition: Project.h:105
Maintains a list of Controls so that control nets can easily be copied from one Project to another...
Definition: ControlList.h:34
bool execute()
Attempt to set control as active control.
Project * project() const
Returns the Project this WorkOrder is attached to.
Definition: WorkOrder.cpp:1116
Control * activeControl()
Return the Active Control (control network)
Definition: Project.cpp:1182
This is a child of class WorkOrder which is used for anything that performs an action in a Project...
Parent class for anything that performs an action in Project.
Definition: WorkOrder.h:104
SetActiveControlWorkOrder(Project *project)
Creates a WorkOrder that will set the active Control in the project.
void SetImages(const QString &imageListFile)
Creates the ControlNet&#39;s image cameras based on an input file.
ControlNet * controlNet()
Open and return a pointer to the ControlNet for this Control.
Definition: Control.cpp:106
virtual SetActiveControlWorkOrder * clone() const
Returns a copy of this SetActiveControlWorkOrder instance.
virtual bool isExecutable(ControlList *controls)
Determines if we can set this control as active.
virtual bool execute()
The (child) implementation of this method should prompt the user/gather state by any means necessary...
Definition: WorkOrder.cpp:1078
QPointer< ControlList > controlList()
Returns the Control List for this WorkOrder (a list of control networks).
Definition: WorkOrder.cpp:637
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
void setActiveControl(Control *)
Set the Active Control (control network)
Definition: Project.cpp:1168

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