File failed to load: https://isis.astrogeology.usgs.gov/9.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
CnetEditorViewWorkOrder.cpp
1
6
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "CnetEditorViewWorkOrder.h"
10
11#include <QtDebug>
12
13#include <QAction>
14#include <QUndoCommand>
15
16#include "CnetEditorView.h"
17#include "Control.h"
18#include "ControlList.h"
19#include "Directory.h"
20#include "Project.h"
21
22namespace Isis {
23
24 CnetEditorViewWorkOrder::CnetEditorViewWorkOrder(Project *project) :
25 WorkOrder(project) {
26 QAction::setText(tr("View &Network..."));
27 m_isSavedToHistory = false;
28 m_isUndoable = false;
29 }
30
31
32 CnetEditorViewWorkOrder::CnetEditorViewWorkOrder(const CnetEditorViewWorkOrder &other) :
33 WorkOrder(other) {
34 }
35
36
37 CnetEditorViewWorkOrder::~CnetEditorViewWorkOrder() {
38 }
39
40
41 CnetEditorViewWorkOrder *CnetEditorViewWorkOrder::clone() const {
42 return new CnetEditorViewWorkOrder(*this);
43 }
44
45
47
48
49 if (controls) {
50 return (controls->count() >= 1);
51 }
52 return false;
53 }
54
55
57 bool success = WorkOrder::setupExecution();
58
59 if (success) {
60 QUndoCommand::setText(tr("View control network [%1] in new cnet editor view")
61 .arg(controlList()->first()->displayProperties()->displayName()));
62 }
63
64 return success;
65 }
66
67
69 // depend on types of ourselves.
70 return dynamic_cast<CnetEditorViewWorkOrder *>(other);
71 }
72
73
75
76 for (int i = 0; i < controlList()->size(); i++) {
77 project()->directory()->addCnetEditorView(controlList()->at(i));
78 }
79 project()->setClean(false);
80 }
81
83 delete project()->directory()->cnetEditorViews().last();
84 }
85}
virtual bool isExecutable(ControlList *controls)
Re-implement this method if your work order utilizes a control for data in order to operate.
bool dependsOn(WorkOrder *other) const
Indicate workorder dependency This is a virtual function whose role in child classes is to determine ...
void undoExecution()
Execute the steps necessary to undo this workorder.
bool setupExecution()
This sets up the state for the work order.
void execute()
Execute the workorder.
Maintains a list of Controls so that control nets can easily be copied from one Project to another,...
Definition ControlList.h:42
The main project for ipce.
Definition Project.h:287
Provide Undo/redo abilities, serialization, and history for an operation.
Definition WorkOrder.h:311
virtual bool setupExecution()
This sets up the state for the work order.
QPointer< ControlList > controlList()
Returns the Control List for this WorkOrder (a list of control networks).
Project * project() const
Returns the Project this WorkOrder is attached to.
WorkOrder(Project *project)
Create a work order that will work with the given project.
Definition WorkOrder.cpp:38
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16