23 #include "ExportControlNetWorkOrder.h"
26 #include <QFileDialog>
27 #include <QInputDialog>
30 #include "ControlList.h"
39 ExportControlNetWorkOrder::ExportControlNetWorkOrder(Project *project) :
41 QAction::setText(tr(
"&Export Control Network..."));
45 ExportControlNetWorkOrder::ExportControlNetWorkOrder(
const ExportControlNetWorkOrder &other) :
50 ExportControlNetWorkOrder::~ExportControlNetWorkOrder() {
55 ExportControlNetWorkOrder *ExportControlNetWorkOrder::clone()
const {
56 return new ExportControlNetWorkOrder(*
this);
69 return (controls->count() == 1);
90 foreach (
Control *control, *list) {
91 cnetChoices[control] = tr(
"%1/%2").arg(list->
name())
99 QString choice = QInputDialog::getItem(NULL, tr(
"Select Control"),
100 tr(
"Please choose a control to export."), cnetNames, 0,
false, &success);
102 control = cnetChoices.key(choice);
103 internalData.append(control->
id());
109 QString destination =
110 QFileDialog::getSaveFileName(NULL, QString(
"Export Control Network"),
113 if (destination.isEmpty()) {
116 internalData.append(destination);
137 control =
project()->control(controlId);
157 if (!m_warning.isEmpty()) {
This represents an ISIS control net in a project-based GUI interface.
bool isExecutable(ControlList *controls)
Currently, this work order only works with either no data (file menu) or with a single control networ...
File name manipulation and expansion.
void asyncRedo()
Use internalData() and write the control network into the output file.
Maintains a list of Controls so that control nets can easily be copied from one Project to another...
Project * project() const
Returns the Project this WorkOrder is attached to.
QString id() const
Access the unique ID associated with this Control.
QStringList internalData() const
Gets the internal data for this WorkOrder.
void postSyncRedo()
Display any warnings that occurred during the asynchronous computations.
QString displayName() const
Returns the display name.
QString name() const
Get the human-readable name of this control list.
QString fileName() const
Access the name of the control network file associated with this Control.
ControlNet * controlNet()
Open and return a pointer to the ControlNet for this Control.
ControlDisplayProperties * displayProperties()
Access a pointer to the display properties for the control network.
QString toString() const
Returns a string representation of this exception.
bool execute()
Prompts the user for input.
virtual bool execute()
The (child) implementation of this method should prompt the user/gather state by any means necessary...
QPointer< ControlList > controlList()
Returns the Control List for this WorkOrder (a list of control networks).
void setInternalData(QStringList data)
Sets the internal data for this WorkOrder.
void Write(const QString &filename, bool pvl=false)
Writes out the control network.