Isis 3 Programmer Reference
WorkOrder.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "IsisDebug.h"
10 
11 #include "WorkOrder.h"
12 
13 #include <QDebug>
14 #include <QFutureWatcher>
15 #include <QMutex>
16 #include <QMutexLocker>
17 #include <QtConcurrentRun>
18 #include <QTimer>
19 #include <QXmlStreamWriter>
20 
21 #include "ControlList.h"
22 #include "IException.h"
23 #include "ImageList.h"
24 #include "IString.h"
25 #include "ProgressBar.h"
26 #include "Project.h"
27 #include "ProjectItem.h"
28 #include "ShapeList.h"
29 #include "Template.h"
30 #include "XmlStackedHandlerReader.h"
31 
32 
33 namespace Isis {
41  WorkOrder::WorkOrder(Project *project) : QAction(project) {
43 
44  m_context = NoContext;
45  m_data = "";
46  m_imageList = new ImageList;
47  m_shapeList = new ShapeList;
48  m_controlList = NULL;
49  m_correlationMatrix = CorrelationMatrix();
52  m_template = NULL;
54 
55  m_isUndoable = true;
56  m_isSavedToHistory = true;
57  m_isSynchronous = true;
58 
59  m_createsCleanState = false;
60  m_modifiesDiskState = false;
61  m_status = WorkOrderNotStarted;
62  m_queuedAction = NoQueuedAction;
64  m_elapsedTimer = NULL;
65 
67  m_transparentConstMutex = new QMutex;
68 
71  m_progressValue = 0;
72 
73  m_secondsElapsed = 0.0;
74 
75  if (!m_project) {
77  tr("Work orders cannot be created without a project."), _FILEINFO_);
78  }
79 
80  connect(this, SIGNAL(triggered()),
81  this, SLOT(addCloneToProject()));
82  connect(m_futureWatcher, SIGNAL(finished()),
83  this, SLOT(executionFinished()));
84  }
85 
86 
94  QAction(other.icon(), ((QAction &)other).text(), other.parentWidget()),
95  QUndoCommand(((QUndoCommand &)other).text()) {
96  // Copy the action's what's this and tool tip (hover text).
97  QAction::setWhatsThis(other.whatsThis());
98  QAction::setToolTip(other.toolTip());
99 
101  m_elapsedTimer = NULL;
102  m_project = other.project();
103  m_context = other.m_context;
104  m_imageIds = other.m_imageIds;
105  m_imageList = new ImageList(*other.m_imageList);
106  m_shapeIds = other.m_shapeIds;
107  m_shapeList = new ShapeList(*other.m_shapeList);
108  m_correlationMatrix = other.m_correlationMatrix;
109  m_controlList = other.m_controlList;
110  m_guiCamera = other.m_guiCamera;
111  m_targetBody = other.m_targetBody;
112  m_fileItem = other.m_fileItem;
114  m_template = other.m_template;
115 
116  m_isUndoable = other.m_isUndoable;
119 
122 
124 
125  m_status = other.m_status;
126  m_queuedAction = other.m_queuedAction;
127 
129 
133 
135  m_transparentConstMutex = new QMutex;
136 
137  if (!other.isInStableState()) {
139  tr("Can not copy work order [%1] because it is currently running")
140  .arg(((QUndoCommand &)other).text()),
141  _FILEINFO_);
142  }
143 
144  connect(this, SIGNAL(triggered()),
145  this, SLOT(addCloneToProject()));
146  connect(m_futureWatcher, SIGNAL(finished()),
147  this, SLOT(executionFinished()));
148 
151  }
152 
153 
158 
159  delete m_imageList;
160  delete m_shapeList;
161  delete m_futureWatcher;
165 
166  m_nextWorkOrder = NULL;
167  m_previousWorkOrder = NULL;
168  m_project = NULL;
170  }
171 
172 
183  return false;
184  }
185 
186 
197  return false;
198  }
199 
200 
211  return false;
212  }
213 
214 
222 //bool WorkOrder::isExecutable(Control *control) {
223 // return false;
224 //}
225 
226 
235  return false;
236  }
237 
238 
239  bool WorkOrder::isExecutable(CorrelationMatrix correlationMatrix) {
240  return false;
241  }
242 
243 
248  void WorkOrder::setData(Context context) {
249  m_context = context;
250  }
251 
252  void WorkOrder::setData(QString data) {
253  m_data = data;
254  }
255 
256 
262  m_imageIds.clear();
263  delete m_imageList;
264 
265  m_imageList = new ImageList(*images);
267  }
268 
269 
275  m_shapeIds.clear();
276  delete m_shapeList;
277 
278  m_shapeList = new ShapeList(*shapes);
280  }
281 
282 
287 //void WorkOrder::setData(Control *control) {
288 // m_control = control;
289 //}
290 
291 
297  void WorkOrder::setData(ControlList *controls) {
298  m_controlList = controls;
299  }
300 
301 
306  void WorkOrder::setData(CorrelationMatrix correlationMatrix) {
307  m_correlationMatrix = correlationMatrix;
308  }
309 
310 
311 
312 
319  }
320 
321 
326  void WorkOrder::setData(Template *currentTemplate) {
327  m_template = currentTemplate;
328  }
329 
330 
337  }
338 
339 
346  }
347 
348 
354  if ( item->isProject() ) {
355  setData( ProjectContext );
356  }
357  else if ( item->isImageList() ) {
358  setData( item->imageList() );
359  }
360  else if ( item->isImage() ) {
361  ImageList *imageList = new ImageList(this);
362  imageList->append( item->image() );
364  }
365  else if ( item->isShapeList() ) {
366  setData( item->shapeList() );
367  }
368  else if ( item->isShape() ) {
369  ShapeList *shapeList = new ShapeList(this);
370  shapeList->append( item->shape() );
372  }
373  else if (item->isControlList()) {
374  setData( item->controlList() );
375  }
376  else if ( item->isControl() ) {
377  ControlList *controlList = new ControlList(this);
378  controlList->append( item->control() );
380 // //setData(*controlList);
381  }
382  else if ( item->isCorrelationMatrix() ) {
383  setData( item->correlationMatrix() );
384  }
385  else if ( item->isTargetBody() ) {
386  setData( item->targetBody() );
387  }
388  else if ( item->isGuiCamera() ) {
389  setData( item->guiCamera() );
390  }
391  else if ( item->isFileItem() ) {
392  setData( item->fileItem() );
393  }
394  else if ( item->isTemplate() ) {
395  setData( item->getTemplate() );
396  }
397  }
398 
399 
400 
401 
402 
411  return false;
412  }
413 
414 
422  bool WorkOrder::isExecutable(Template *currentTemplate) {
423  return false;
424  }
425 
426 
435  return false;
436  }
437 
438 
447  return false;
448  }
449 
450 
459  if ( !item ) {
460  return false;
461  }
462  else if ( item->isProject() ) {
463  return isExecutable( ProjectContext );
464  }
465  else if ( item->isImageList() ) {
466  return isExecutable( item->imageList() );
467  }
468  else if ( item->isImage() ) {
469  ImageList *imageList = new ImageList();
470  imageList->append( item->image() );
471  bool ret = isExecutable(imageList);
472  imageList->deleteLater();
473  return ret;
474  }
475  else if ( item->isShapeList() ) {
476  return isExecutable( item->shapeList() );
477  }
478  else if ( item->isShape() ) {
479  ShapeList *shapeList = new ShapeList();
480  shapeList->append( item->shape() );
481  bool ret = isExecutable(shapeList);
482  shapeList->deleteLater();
483  return ret;
484  }
485  else if ( item->isControlList() ) {
486  return isExecutable (item -> controlList() );
487  }
488  else if ( item->isControl() ) {
490  controlList->append( item->control() );
491  bool ret = isExecutable(controlList);
492  controlList->deleteLater();
493  return ret;
494  }
495  else if ( item->isCorrelationMatrix() ) {
496  return isExecutable( item->correlationMatrix() );
497  }
498  else if ( item->isTargetBody() ) {
499  //return isExecutable( item->targetBody() ) || isExecutable( item->targetBody().data() );
500  return isExecutable(item->targetBody());
501  }
502  else if ( item->isGuiCamera() ) {
503  //return isExecutable( item->guiCamera() ) || isExecutable( item->guiCamera().data() );
504  return isExecutable( item->guiCamera() );
505  }
506  else if ( item->isFileItem() ) {
507  return isExecutable( item->fileItem() );
508  }
509  else if ( item->isTemplate() ) {
510  return isExecutable( item->getTemplate() );
511  }
512 
513  return false;
514  }
515 
516 
521  xmlReader->pushContentHandler(new XmlHandler(this));
522  }
523 
524 
544  void WorkOrder::save(QXmlStreamWriter &stream) const {
545  if (!isInStableState()) {
547  tr("Can not store an unstable work order. The work order [%1] is currently "
548  "working").arg(bestText()),
549  _FILEINFO_);
550  }
551 
552  stream.writeStartElement("workOrder");
553 
554  stream.writeAttribute("actionText", QAction::text());
555  stream.writeAttribute("undoText", QUndoCommand::text());
556  stream.writeAttribute("executionTime", m_executionTime.toString());
557  stream.writeAttribute("type", metaObject()->className());
558  stream.writeAttribute("status", toString(m_status));
559 
560  if (m_imageIds.count()) {
561  stream.writeStartElement("images");
562 
563  foreach (QString imageId, m_imageIds) {
564  stream.writeStartElement("image");
565  stream.writeAttribute("id", imageId);
566  stream.writeEndElement();
567  }
568 
569  stream.writeEndElement();
570  }
571 
572  if (m_shapeIds.count()) {
573  stream.writeStartElement("shapes");
574 
575  foreach (QString shapeId, m_shapeIds) {
576  stream.writeStartElement("shape");
577  stream.writeAttribute("id", shapeId);
578  stream.writeEndElement();
579  }
580 
581  stream.writeEndElement();
582  }
583 
584  if (m_internalData.count()) {
585  stream.writeStartElement("internalDataValues");
586 
587  foreach (QString str, m_internalData) {
588  stream.writeStartElement("dataValue");
589  stream.writeAttribute("value", str);
590  stream.writeEndElement();
591  }
592 
593  stream.writeEndElement();
594  }
595 
596  if (m_context != NoContext) {
597  stream.writeStartElement("context");
598 
599  QString contextStr = "ProjectContext";
600  stream.writeAttribute("value", contextStr);
601 
602  stream.writeEndElement();
603  }
604 
605  stream.writeEndElement();
606  }
607 
608 
613  void WorkOrder::setNext(WorkOrder *nextWorkOrder) {
614  m_nextWorkOrder = nextWorkOrder;
615  }
616 
617 
622  void WorkOrder::setPrevious(WorkOrder *previousWorkOrder) {
623  m_previousWorkOrder = previousWorkOrder;
624  }
625 
626 
632  QMutexLocker locker(project()->workOrderMutex());
633  if (!m_imageList) {
634  bool anyImagesAreNull = false;
635 
636  m_imageList = new ImageList;
637 
638  foreach (QString id, m_imageIds) {
639  Image *image = project()->image(id);
640  m_imageList->append(image);
641 
642  if (!image) {
643  anyImagesAreNull = true;
644  }
645  }
646 
647  if (anyImagesAreNull) {
648  delete m_imageList;
649  }
650  else {
652  }
653  }
654 
655  return m_imageList;
656  }
657 
658 
664  QMutexLocker locker(project()->workOrderMutex());
665  if (!m_shapeList) {
666  bool anyShapesAreNull = false;
667 
668  m_shapeList = new ShapeList;
669 
670  foreach (QString id, m_shapeIds) {
671  Shape *shape = project()->shape(id);
672  m_shapeList->append(shape);
673 
674  if (!shape) {
675  anyShapesAreNull = true;
676  }
677  }
678 
679  if (anyShapesAreNull) {
680  delete m_shapeList;
681  }
682  else {
684  }
685  }
686 
687  return
688  m_shapeList;
689  }
690 
691 
697  QMutexLocker locker(project()->workOrderMutex());
698  return m_correlationMatrix;
699  }
700 
701 
706  QPointer<ControlList> WorkOrder::controlList() {
707  QMutexLocker locker(project()->workOrderMutex());
708  return m_controlList;
709  }
710 
711 
717  QMutexLocker lock(m_transparentConstMutex);
718  return const_cast<WorkOrder *>(this)->imageList();
719  }
720 
721 
727  QMutexLocker lock(m_transparentConstMutex);
728  return const_cast<WorkOrder *>(this)->shapeList();
729  }
730 
731 
737  QMutexLocker locker(project()->workOrderMutex());
738  return m_template;
739  }
740 
741 
747  QMutexLocker locker(project()->workOrderMutex());
748  return m_targetBody;
749  }
750 
751 
757  QMutexLocker locker(project()->workOrderMutex());
758  return m_guiCamera;
759  }
760 
761 
767  QMutexLocker locker(project()->workOrderMutex());
768  return m_fileItem;
769  }
770 
771 
782  return true;
783  }
784 
785 
795  QString WorkOrder::bestText() const {
796  QString result = QUndoCommand::text().remove("&").remove("...");
797 
798  // if the QUndoCommand has no text, create a warning
799  if (result.isEmpty()) {
800  // get the name of the work order
801  result = QString(metaObject()->className()).remove("Isis::").remove("WorkOrder")
802  .replace(QRegExp("([a-z0-9])([A-Z])"), "\\1 \\2");
803  qWarning() << QString("WorkOrder::bestText(): Work order [%1] has no QUndoCommand text")
804  .arg(result);
805  }
806 
807  return result;
808  }
809 
810 
819  bool WorkOrder::isUndoable() const {
820  QMutexLocker locker(project()->workOrderMutex());
821  return m_isUndoable;
822  }
823 
824 
831  QMutexLocker locker(project()->workOrderMutex());
832  return m_isSavedToHistory;
833  }
834 
835 
842  QMutexLocker locker(project()->workOrderMutex());
843  return m_isSynchronous;
844  }
845 
846 
855  QMutexLocker locker(project()->workOrderMutex());
856  return m_createsCleanState;
857  }
858 
859 
864  QDateTime WorkOrder::executionTime() const {
865  QMutexLocker locker(project()->workOrderMutex());
866  return m_executionTime;
867  }
868 
869 
874  bool WorkOrder::isFinished() const {
875  return m_status == WorkOrderFinished;
876  }
877 
878 
883  bool WorkOrder::isRedoing() const {
884  QMutexLocker locker(project()->workOrderMutex());
885  return m_status == WorkOrderRedoing;
886  }
887 
888 
893  bool WorkOrder::isRedone() const {
894  QMutexLocker locker(project()->workOrderMutex());
895  return m_status == WorkOrderRedone;
896  }
897 
898 
903  bool WorkOrder::isUndoing() const {
904  QMutexLocker locker(project()->workOrderMutex());
905  return m_status == WorkOrderUndoing;
906  }
907 
908 
913  bool WorkOrder::isUndone() const {
914  QMutexLocker locker(project()->workOrderMutex());
915  return m_status == WorkOrderUndone;
916  }
917 
918 
925  QMutexLocker locker(project()->workOrderMutex());
926  return m_modifiesDiskState;
927  }
928 
929 
935  QMutexLocker locker(project()->workOrderMutex());
936  return m_nextWorkOrder;
937  }
938 
939 
945  QMutexLocker locker(project()->workOrderMutex());
946  return m_previousWorkOrder;
947  }
948 
949 
954  QString WorkOrder::statusText() const {
955  QMutexLocker locker(project()->workOrderMutex());
956  QString result = toString(m_status);
957 
958  if (m_secondsElapsed) {
959  // QTime can't format in the way that I want (0-n minutes, 00-59 seconds, no hours
960  // displayed)... so do it manually.
961  // Expected output format examples: 0:01, 0:55, 1:30, 55:55, 90:00, 100:12
962  int seconds = qRound(m_secondsElapsed) % 60;
963  int minutes = qRound(m_secondsElapsed) / 60;
964  result += tr(" (elapsed: %1:%2)").arg(minutes).arg(seconds, 2, 10, QChar('0'));
965  }
966 
967  return result;
968  }
969 
970 
976  QMutexLocker locker(project()->workOrderMutex());
977  return m_progressBar;
978  }
979 
980 
989  statusString = statusString.toUpper();
990  WorkOrderStatus result = WorkOrderUnknownStatus;
991 
992  for (WorkOrderStatus possibleResult = WorkOrderUnknownStatus;
993  possibleResult <= WorkOrderLastStatus;
994  possibleResult = (WorkOrderStatus)(possibleResult + 1)) {
995  if (statusString == toString(possibleResult).toUpper()) {
996  result = possibleResult;
997  }
998  }
999 
1000  return result;
1001  }
1002 
1003 
1010  QString result;
1011 
1012  switch (status) {
1013  case WorkOrderUnknownStatus:
1014  result = tr("Unknown");
1015  break;
1016  case WorkOrderNotStarted:
1017  result = tr("Not Started");
1018  break;
1019  case WorkOrderRedoing:
1020  result = tr("In Progress");
1021  break;
1022  case WorkOrderRedone:
1023  result = tr("Completed");
1024  break;
1025  case WorkOrderUndoing:
1026  result = tr("Undoing");
1027  break;
1028  case WorkOrderUndone:
1029  result = tr("Undone");
1030  break;
1031  case WorkOrderFinished:
1032  result = tr("Finished");
1033  break;
1034  }
1035 
1036  return result;
1037  }
1038 
1039 
1044  if (!isInStableState()) {
1045  m_queuedAction = RedoQueuedAction;
1046  }
1047 
1048  if (!isRedone()) {
1049  bool mustQueueThisRedo = false;
1050 
1051  WorkOrder *dependency = NULL;
1052  WorkOrder *current = this;
1053  while (current->previous() && !dependency) {
1054  if (!current->previous()->isRedone() && !current->previous()->isFinished()) {
1055  WorkOrder *possibleDependency = current->previous();
1056 
1057  if (dependsOn(possibleDependency)) {
1058  connect(possibleDependency, SIGNAL(finished(WorkOrder *)),
1059  this, SLOT(attemptQueuedAction()));
1060  dependency = possibleDependency;
1061  mustQueueThisRedo = true;
1062  }
1063  }
1064 
1065  current = current->previous();
1066  }
1067 
1068  if (!imageList()) {
1069  connect(project(), SIGNAL(imagesAdded(ImageList *)),
1070  this, SLOT(attemptQueuedAction()));
1071  mustQueueThisRedo = true;
1072  }
1073 
1074  if (!shapeList()) {
1075  connect(project(), SIGNAL(shapesAdded(ShapeList *)),
1076  this, SLOT(attemptQueuedAction()));
1077  mustQueueThisRedo = true;
1078  }
1079 
1080  if (mustQueueThisRedo && !isUndoing() && !isRedoing()) {
1081 
1082  m_queuedAction = RedoQueuedAction;
1083 
1084  QString queueStatusText;
1085 
1086  if (dependency) {
1087  QString dependencyText = dependency->bestText();
1088 
1089  if (dependencyText.count() > 5) {
1090  dependencyText = dependencyText.mid(0, 5) + "...";
1091  }
1092 
1093  queueStatusText = tr("Wait for [%1]").arg(dependencyText);
1094  }
1095  else if (!imageList()) {
1096  queueStatusText = tr("Wait for images");
1097  }
1098  else if (!shapeList()) {
1099  queueStatusText = tr("Wait for shapes");
1100  }
1101 
1102  resetProgressBar();
1103  m_progressBar->setValue(m_progressBar->minimum());
1104  m_progressBar->setText(queueStatusText);
1105  m_progressBar->update();
1106  }
1107 
1108  if (m_queuedAction == NoQueuedAction) {
1109  m_status = WorkOrderRedoing;
1110  emit statusChanged(this);
1111 
1112  resetProgressBar();
1113  m_progressBar->setText("Starting...");
1114  m_progressBar->update();
1115 
1116  delete m_elapsedTimer;
1117  m_elapsedTimer = new QTime;
1118  m_elapsedTimer->start();
1119 
1120  if (isSynchronous()) {
1121  execute();
1123  }
1124  else {
1125  m_progressBar->setText("Running...");
1126  m_progressBar->update();
1127  // queue the workorder for asynchronous execution
1128  QFuture<void> future = QtConcurrent::run(this, &WorkOrder::execute);
1129  // executionFinished() is called via the finished signal. The
1130  // connection is setup in the constructor.
1131  m_futureWatcher->setFuture(future);
1132  }
1133  }
1134  }
1135  else {
1137  }
1138  }
1139 
1140 
1147  if (!isInStableState()) {
1148  m_queuedAction = UndoQueuedAction;
1149  }
1150 
1151  if (!isUndone() && m_status != WorkOrderNotStarted) {
1152  WorkOrder *dependency = NULL;
1153  WorkOrder *current = this;
1154  while (current->next() && !dependency) {
1155  if (!current->next()->isUndone() && !current->next()->isFinished() &&
1156  current->next()->m_status != WorkOrderNotStarted) {
1157  connect(current->next(), SIGNAL(finished(WorkOrder *)),
1158  this, SLOT(attemptQueuedAction()));
1159  m_queuedAction = UndoQueuedAction;
1160  dependency = current->next();
1161  }
1162 
1163  current = current->next();
1164  }
1165 
1166  if (dependency && !isUndoing() && !isRedoing()) {
1167  QString prevText = dependency->bestText();
1168 
1169  if (prevText.count() > 5) {
1170  prevText = prevText.mid(0, 5) + "...";
1171  }
1172 
1173  resetProgressBar();
1174  m_progressBar->setValue(m_progressBar->minimum());
1175  m_progressBar->setText(tr("Undo after [%1]").arg(prevText));
1176  m_progressBar->update();
1177  }
1178 
1179  if (m_queuedAction == NoQueuedAction) {
1180  m_status = WorkOrderUndoing;
1181  emit statusChanged(this);
1182 
1183  resetProgressBar();
1184  m_progressBar->setText("Starting Undo...");
1185  m_progressBar->update();
1186 
1187  delete m_elapsedTimer;
1188  m_elapsedTimer = new QTime;
1189  m_elapsedTimer->start();
1190 
1191  if (isSynchronous()) {
1192  undoExecution();
1194  }
1195  else {
1196  m_progressBar->setText("Undoing...");
1197  m_progressBar->update();
1198  // queue the workorder for asynchronous execution
1199  QFuture<void> future = QtConcurrent::run(this, &WorkOrder::undoExecution);
1200  // executionFinished() is called via the finished signal. The
1201  // connection is setup in the constructor.
1202  m_futureWatcher->setFuture(future);
1203  }
1204  }
1205  }
1206  else {
1208  }
1209  }
1210 
1219  setEnabled(true);
1220  }
1221 
1222 
1231  setEnabled(false);
1232  }
1233 
1234 
1262  // We're finished at this point if we save/open a project, we're not finished if we need to do
1263  // redo()
1264  if (createsCleanState() || !isUndoable()) {
1265  m_status = WorkOrderFinished;
1266 
1267  emit statusChanged(this);
1268  }
1269 
1270  m_executionTime = QDateTime::currentDateTime();
1271 
1272  resetProgressBar();
1273 
1274  if (createsCleanState() || !isUndoable()) {
1276  }
1277  else {
1278  m_progressBar->setText("Initializing...");
1279  }
1280 
1281  return true;
1282  }
1283 
1284 
1291  return project()->directory();
1292  }
1293 
1294 
1301  if (!m_project) {
1303  "This work order no longer has a project.", _FILEINFO_);
1304  }
1305 
1306  return m_project;
1307  }
1308 
1309 
1319  m_internalData = data;
1320  }
1321 
1322 
1328  QMutexLocker locker(project()->workOrderMutex());
1329  return m_progressRangeMinValue;
1330  }
1331 
1332 
1338  QMutexLocker locker(project()->workOrderMutex());
1339  return m_progressRangeMaxValue;
1340  }
1341 
1342 
1348  QMutexLocker locker(project()->workOrderMutex());
1349  return m_progressValue;
1350  }
1351 
1352 
1358  void WorkOrder::setProgressRange(int minValue, int maxValue) {
1359  m_progressRangeMinValue = minValue;
1360  m_progressRangeMaxValue = maxValue;
1361  }
1362 
1363 
1369  m_progressValue = value;
1370  }
1371 
1372 
1378  QMutexLocker locker(project()->workOrderMutex());
1379  return m_internalData;
1380  }
1381 
1382 
1404  }
1405 
1406 
1415  }
1416 
1417 
1435  }
1436 
1437 
1446  }
1447 
1448 
1453  if (project()) {
1454  project()->addToProject(clone());
1455  }
1456  }
1457 
1458 
1464  bool result = true;
1465 
1466  if (isRedoing() || isUndoing() || m_queuedAction != NoQueuedAction) {
1467  result = false;
1468  }
1469 
1470  return result;
1471  }
1472 
1473 
1480  m_imageIds.clear();
1481  foreach (Image *image, *m_imageList) {
1482  if (image) {
1483  m_imageIds.append(image->id());
1484 
1485  // If we lose any images, destroy the entire list. This will let us know that we need to
1486  // rebuild it, if needed, when requested.
1487  connect(image, SIGNAL(destroyed(QObject *)),
1488  this, SLOT(clearImageList()));
1489  }
1490  }
1491  }
1492 
1493 
1503  m_shapeIds.clear();
1504  foreach (Shape *shape, *m_shapeList) {
1505  if (shape) {
1506  m_shapeIds.append(shape->id());
1507 
1508  // If we lose any shapes, destroy the entire list. This will let us know that we need to
1509  // rebuild it, if needed, when requested.
1510  connect(shape, SIGNAL(destroyed(QObject *)),
1511  this, SLOT(clearShapeList()));
1512  }
1513  }
1514  }
1515 
1516 
1522 
1523  if (!m_progressBar) {
1524  m_progressBar = new ProgressBar;
1525  emit creatingProgress(this);
1526  }
1527 
1528  if (!m_progressBarUpdateTimer) {
1529  m_progressBarUpdateTimer = new QTimer;
1530  connect(m_progressBarUpdateTimer, SIGNAL(timeout()),
1531  this, SLOT(updateProgress()));
1532  m_progressBarUpdateTimer->start(100);
1533  }
1534 
1537  m_progressValue = 0;
1538  }
1539 
1540 
1545  if (m_progressBar) {
1546  if (isRedone()) {
1547  m_progressBar->setText(tr("Finished"));
1548  }
1549  else if (isUndone() || m_status == WorkOrderNotStarted) {
1550  m_progressBar->setText(tr("Undone"));
1551  }
1552 
1553  if (m_progressBar->minimum() != 0 || m_progressBar->maximum() != 0) {
1554  m_progressBar->setValue(m_progressBar->maximum());
1555  }
1556  else {
1557  m_progressBar->setRange(0, 100);
1558  m_progressBar->setValue(100);
1559  }
1560 
1562  m_progressBarDeletionTimer = new QTimer;
1563  m_progressBarDeletionTimer->setSingleShot(true);
1564 
1565  m_progressBarDeletionTimer->start(5 * 1000); // 5 seconds
1566 
1567  m_progressBar->update();
1568  }
1569  }
1570 
1571 
1576  QueuedWorkOrderAction queued = m_queuedAction;
1577  m_queuedAction = NoQueuedAction;
1578 
1579  if (queued == RedoQueuedAction && m_status != WorkOrderRedone) {
1580  redo();
1581  }
1582  else if (queued == UndoQueuedAction && m_status != WorkOrderUndone) {
1583  undo();
1584  }
1585  }
1586 
1587 
1593  delete m_progressBarUpdateTimer;
1594 
1595  WorkOrderStatus finishedStatus = WorkOrderRedone;
1596  void (WorkOrder::*postMethod)() = &WorkOrder::postExecution;
1597 
1598  if (isUndoing()) {
1599  finishedStatus = WorkOrderUndone;
1600  postMethod = &WorkOrder::postUndoExecution;
1601  }
1602 
1603  (this->*postMethod)();
1604 
1605  m_status = finishedStatus;
1606 
1607  m_secondsElapsed = m_elapsedTimer->elapsed() / 1000.0;
1608 
1609  delete m_elapsedTimer;
1610  m_elapsedTimer = NULL;
1611 
1612  emit statusChanged(this);
1614  emit finished(this);
1615 
1617  }
1618 
1619 
1624  delete m_imageList;
1625  }
1626 
1627 
1632  delete m_shapeList;
1633  }
1634 
1635 
1640  if (m_progressBar && (isRedoing() || isUndoing())) {
1642  m_progressBar->setValue(m_progressValue);
1643  }
1644  }
1645 
1646 
1651  }
1652 
1653 
1663  void WorkOrder::setCreatesCleanState(bool createsCleanState) {
1665  }
1666 
1667 
1674  void WorkOrder::setModifiesDiskState(bool changesProjectOnDisk) {
1675  m_modifiesDiskState = changesProjectOnDisk;
1676  }
1677 
1678 
1684  m_workOrder = workOrder;
1685  }
1686 
1687 
1702  bool WorkOrder::XmlHandler::startElement(const QString &namespaceURI, const QString &localName,
1703  const QString &qName, const QXmlAttributes &atts) {
1704  if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) {
1705  if (localName == "workOrder") {
1706  QString actionText = atts.value("actionText");
1707  QString undoText = atts.value("undoText");
1708  QString executionTime = atts.value("executionTime");
1709  QString statusStr = atts.value("status");
1710 
1711  if (!actionText.isEmpty()) {
1712  ((QAction *)m_workOrder)->setText(actionText);
1713  }
1714 
1715  if (!undoText.isEmpty()) {
1716  ((QUndoCommand *)m_workOrder)->setText(undoText);
1717  }
1718 
1719  if (!executionTime.isEmpty()) {
1720  m_workOrder->m_executionTime = QDateTime::fromString(executionTime);
1721  }
1722 
1723  if (!statusStr.isEmpty()) {
1724  m_workOrder->m_status = fromStatusString(statusStr);
1725  }
1726  else {
1727  if (m_workOrder->createsCleanState()) {
1728  m_workOrder->m_status = WorkOrderFinished;
1729  }
1730  else {
1731  m_workOrder->m_status = WorkOrderRedone;
1732  }
1733  }
1734  }
1735  else if (localName == "dataValue") {
1736  m_workOrder->m_internalData.append(atts.value("value"));
1737  }
1738  else if (localName == "context") {
1739  if (atts.value("value") == "ProjectContext") {
1740  m_workOrder->m_context = ProjectContext;
1741  }
1742  }
1743  }
1744 
1745  return true;
1746  }
1747 }
Isis::WorkOrder::setProgressToFinalText
void setProgressToFinalText()
Sets the ProgressBar to display the final status of the operation.
Definition: WorkOrder.cpp:1544
Isis::WorkOrder::isSynchronous
bool isSynchronous() const
Returns true if this work order is run synchronously, otherwise false.
Definition: WorkOrder.cpp:841
Isis::WorkOrder::isUndoable
bool isUndoable() const
Returns true if this work order is undoable, otherwise false.
Definition: WorkOrder.cpp:819
Isis::WorkOrder::dependsOn
virtual bool dependsOn(WorkOrder *other) const
Indicate workorder dependency This is a virtual function whose role in child classes is to determine ...
Definition: WorkOrder.cpp:781
Isis::WorkOrder::m_fileItem
FileItemQsp m_fileItem
A QSharedPointer to the FileItem.
Definition: WorkOrder.h:603
Isis::WorkOrder::isInStableState
bool isInStableState() const
Determines if the WorkOrder is in a stable state, or if it's busy doing something.
Definition: WorkOrder.cpp:1463
Isis::WorkOrder::setupExecution
virtual bool setupExecution()
This sets up the state for the work order.
Definition: WorkOrder.cpp:1261
Isis::WorkOrder::isRedone
bool isRedone() const
Returns the WorkOrder redone status.
Definition: WorkOrder.cpp:893
Isis::WorkOrder::addCloneToProject
void addCloneToProject()
Runs a copy of the current WorkOrder and stores it in the project.
Definition: WorkOrder.cpp:1452
Isis::Directory
Definition: Directory.h:271
Isis::ProjectItem::isGuiCamera
bool isGuiCamera() const
Returns true if a GuiCameraQsp is stored in the data of the item.
Definition: ProjectItem.cpp:735
Isis::WorkOrder::m_progressRangeMinValue
int m_progressRangeMinValue
The miniumum value of the Progess Bar.
Definition: WorkOrder.h:563
Isis::WorkOrder
Provide Undo/redo abilities, serialization, and history for an operation.
Definition: WorkOrder.h:311
Isis::ProgressBar
Definition: ProgressBar.h:15
Project.h
Isis::WorkOrder::m_imageIds
QStringList m_imageIds
A QStringList of unique image identifiers for all of the images this WorkOrder is dealing with.
Definition: WorkOrder.h:610
Isis::Project::shape
Shape * shape(QString id)
Return a shape given its id.
Definition: Project.cpp:1539
Isis::ProjectItem::isControl
bool isControl() const
Returns true if a Control is stored in the data of the item.
Definition: ProjectItem.cpp:690
Isis::WorkOrder::m_guiCamera
GuiCameraQsp m_guiCamera
A QSharedPointer to the GuiCamera (the Camera object but encapsulated within a Gui framework.
Definition: WorkOrder.h:583
Isis::ProjectItem::image
Image * image() const
Returns the Image stored in the data of the item.
Definition: ProjectItem.cpp:476
Isis::WorkOrder::m_progressBarUpdateTimer
QPointer< QTimer > m_progressBarUpdateTimer
A pointer to the QTimer which updates the ProgressBar.
Definition: WorkOrder.h:666
Isis::WorkOrder::progressMax
int progressMax() const
Gets the maximum value of the progress range of the WorkOrder.
Definition: WorkOrder.cpp:1337
Isis::WorkOrder::isRedoing
bool isRedoing() const
Returns the redoing status of this WorkOrder.
Definition: WorkOrder.cpp:883
Isis::WorkOrder::redo
virtual void redo()
Starts (or enqueues) a redo.
Definition: WorkOrder.cpp:1043
Isis::WorkOrder::controlList
QPointer< ControlList > controlList()
Returns the Control List for this WorkOrder (a list of control networks).
Definition: WorkOrder.cpp:706
Isis::WorkOrder::isExecutable
virtual bool isExecutable(Context)
Re-implement this method if your work order utilizes controls for data in order to operate.
Definition: WorkOrder.cpp:182
Isis::WorkOrder::imageList
ImageList * imageList()
Returns a pointer to the ImageList for this WorkOrder.
Definition: WorkOrder.cpp:631
Isis::ProjectItem::correlationMatrix
CorrelationMatrix correlationMatrix() const
Returns the CorrelationMatrix stored the item.
Definition: ProjectItem.cpp:556
Isis::WorkOrder::XmlHandler::m_workOrder
WorkOrder * m_workOrder
This is a pointer to the WorkOrder the XmlHandler is filling with information it parses from an XML f...
Definition: WorkOrder.h:511
Isis::WorkOrder::updateProgress
void updateProgress()
Updates the progress bar.
Definition: WorkOrder.cpp:1639
Isis::WorkOrder::m_isSavedToHistory
bool m_isSavedToHistory
Set the work order to be shown in the HistoryTreeWidget.
Definition: WorkOrder.h:537
Isis::WorkOrder::m_shapeIds
QStringList m_shapeIds
A QStringList of unique shape identifiers for all of the shapes this WorkOrder is dealing with.
Definition: WorkOrder.h:616
Isis::ControlList
Maintains a list of Controls so that control nets can easily be copied from one Project to another,...
Definition: ControlList.h:44
Isis::IException::Unknown
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition: IException.h:118
Isis::WorkOrder::postExecution
virtual void postExecution()
Perform any necessary actions after execution of a workorder.
Definition: WorkOrder.cpp:1414
Isis::XmlStackedHandlerReader::pushContentHandler
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
Definition: XmlStackedHandlerReader.cpp:55
Isis::WorkOrder::setInternalData
void setInternalData(QStringList data)
Sets the internal data for this WorkOrder.
Definition: WorkOrder.cpp:1318
Isis::ProjectItem::isTargetBody
bool isTargetBody() const
Returns true if a TargetBodyQsp is stored in the data of the item.
Definition: ProjectItem.cpp:746
Isis::ProjectItem::shape
Shape * shape() const
Returns the Shape stored in the data of the item.
Definition: ProjectItem.cpp:496
Isis::WorkOrder::progressMin
int progressMin() const
Gets the minimum value of the progress range of the WorkOrder.
Definition: WorkOrder.cpp:1327
Isis::WorkOrder::toString
static QString toString(WorkOrderStatus)
Gets the current status of the WorkOrder.
Definition: WorkOrder.cpp:1009
Isis::WorkOrder::save
void save(QXmlStreamWriter &stream) const
: Saves a WorkOrder to a data stream.
Definition: WorkOrder.cpp:544
Isis::WorkOrder::directory
Directory * directory() const
return the workorder project directory Returns the Directory object of the Project this WorkOrder is ...
Definition: WorkOrder.cpp:1290
Isis::WorkOrder::next
WorkOrder * next() const
Gets the next WorkOrder.
Definition: WorkOrder.cpp:934
Isis::ImageList::append
void append(Image *const &value)
Appends an image to the image list.
Definition: ImageList.cpp:153
Isis::ProjectItem::isCorrelationMatrix
bool isCorrelationMatrix() const
Returns true if a CorrelationMatrix is stored in the data of the item.
Definition: ProjectItem.cpp:713
Isis::WorkOrder::createsCleanState
bool createsCleanState() const
Returns the CleanState status (whether the Project has been saved to disk or not).
Definition: WorkOrder.cpp:854
Isis::TargetBodyQsp
QSharedPointer< TargetBody > TargetBodyQsp
Defines A smart pointer to a TargetBody obj.
Definition: TargetBody.h:216
Isis::WorkOrder::XmlHandler::XmlHandler
XmlHandler(WorkOrder *workOrder)
Passes a pointer to a WorkOrder to the WorkOrder::XmlHandler class.
Definition: WorkOrder.cpp:1683
Isis::ProjectItem::isControlList
bool isControlList() const
Returns true if a ControlList is stored in the data of the item.
Definition: ProjectItem.cpp:702
Isis::WorkOrder::modifiesDiskState
bool modifiesDiskState() const
Returns the modified disk state.
Definition: WorkOrder.cpp:924
Isis::ProjectItem::control
Control * control() const
Returns the Control stored in the data of the item.
Definition: ProjectItem.cpp:536
Isis::WorkOrder::read
void read(XmlStackedHandlerReader *xmlReader)
Read this work order's data from disk.
Definition: WorkOrder.cpp:520
QSharedPointer< TargetBody >
Isis::WorkOrder::listenForShapeDestruction
void listenForShapeDestruction()
Checks to see if we have lost any shapes in the ShapeList.
Definition: WorkOrder.cpp:1502
Isis::WorkOrder::m_isSynchronous
bool m_isSynchronous
This is defaulted to true.
Definition: WorkOrder.h:530
Isis::ProjectItem::isShape
bool isShape() const
Returns true if an Shape is stored in the data of the item.
Definition: ProjectItem.cpp:668
QStringList
Isis::XmlStackedHandlerReader
Manage a stack of content handlers for reading XML files.
Definition: XmlStackedHandlerReader.h:30
Isis::CorrelationMatrix
This is a container for the correlation matrix that comes from a bundle adjust.
Definition: CorrelationMatrix.h:61
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::Project::directory
Directory * directory() const
Returns the directory associated with this Project.
Definition: Project.cpp:1229
Isis::WorkOrder::isFinished
bool isFinished() const
Returns the finished state of this WorkOrder.
Definition: WorkOrder.cpp:874
Isis::ImageList
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:55
Isis::WorkOrder::shapeList
ShapeList * shapeList()
@briefReturns a pointer to the ShapeList for this WorkOrder.
Definition: WorkOrder.cpp:663
Isis::Project::addToProject
void addToProject(WorkOrder *)
This executes the WorkOrder and stores it in the project.
Definition: Project.cpp:2598
Isis::WorkOrder::disableWorkOrder
void disableWorkOrder()
Disables the work order.
Definition: WorkOrder.cpp:1230
Isis::WorkOrder::m_internalData
QStringList m_internalData
A QStringList of internal properties for this WorkOrder.
Definition: WorkOrder.h:621
Isis::ProjectItem::isImageList
bool isImageList() const
Returns true if an ImageList is stored in the data of the item.
Definition: ProjectItem.cpp:657
Isis::WorkOrder::m_previousWorkOrder
QPointer< WorkOrder > m_previousWorkOrder
A pointer to the previous WorkOrder in the queue.
Definition: WorkOrder.h:631
Isis::WorkOrder::WorkOrder
WorkOrder(Project *project)
Create a work order that will work with the given project.
Definition: WorkOrder.cpp:41
Isis::Shape::id
QString id() const
Get a unique, identifying string associated with this shape.
Definition: Shape.cpp:459
Isis::WorkOrder::m_futureWatcher
QPointer< QFutureWatcher< void > > m_futureWatcher
A pointer to a QFutureWatcher object which monitors a QFuture object using signals and slots.
Definition: WorkOrder.h:654
Isis::WorkOrder::XmlHandler
This class is used for processing an XML file containing information about a WorkOrder.
Definition: WorkOrder.h:497
Isis::WorkOrder::m_progressValue
int m_progressValue
The current value of the Progress Bar.
Definition: WorkOrder.h:571
Isis::WorkOrder::m_isUndoable
bool m_isUndoable
Set the workorder to be undoable/redoable This is defaulted to true - his will allow the workorder to...
Definition: WorkOrder.h:523
Isis::WorkOrder::isSavedToHistory
bool isSavedToHistory() const
Returns true if this work order is to be shown in History, otherwise false.
Definition: WorkOrder.cpp:830
Isis::ProjectItem::isShapeList
bool isShapeList() const
Returns true if an ShapeList is stored in the data of the item.
Definition: ProjectItem.cpp:679
QUndoCommand
Isis::WorkOrder::setData
virtual void setData(Context)
Sets the context data for this WorkOrder.
Definition: WorkOrder.cpp:248
Isis::ProjectItem::guiCamera
GuiCameraQsp guiCamera() const
Returns the GuiCameraQsp stored in the data of the item.
Definition: ProjectItem.cpp:576
Isis::ProjectItem::isImage
bool isImage() const
Returns true if an Image is stored in the data of the item.
Definition: ProjectItem.cpp:646
Isis::WorkOrder::statusText
QString statusText() const
WorkOrder::statusText.
Definition: WorkOrder.cpp:954
Isis::WorkOrder::isUndone
bool isUndone() const
Returns the WorkOrder undo status.
Definition: WorkOrder.cpp:913
Isis::WorkOrder::targetBody
TargetBodyQsp targetBody()
WorkOrder::targetBody.
Definition: WorkOrder.cpp:746
Isis::WorkOrder::m_elapsedTimer
QTime * m_elapsedTimer
A QTime object holding the excecution time of the WorkOrder.
Definition: WorkOrder.h:677
Isis::WorkOrder::m_executionTime
QDateTime m_executionTime
This is the date/time that setupExecution() was called.
Definition: WorkOrder.h:647
Isis::ProjectItem::shapeList
ShapeList * shapeList() const
Returns the ShapeList stored in the data of the item.
Definition: ProjectItem.cpp:506
Isis::ProjectItem::isFileItem
bool isFileItem() const
Returns true if a FileItemQsp is stored in the data of the item.
Definition: ProjectItem.cpp:757
Isis::WorkOrder::postUndoExecution
virtual void postUndoExecution()
Perform any steps necessary after an undo of a workorder.
Definition: WorkOrder.cpp:1445
Isis::WorkOrder::QueuedWorkOrderAction
QueuedWorkOrderAction
This enum describes the current state of a Queued WorkOrder.
Definition: WorkOrder.h:483
Isis::Template
Definition: Template.h:30
Isis::WorkOrder::undo
virtual void undo()
Starts (or enqueues) an undo.
Definition: WorkOrder.cpp:1146
Isis::WorkOrder::m_progressBarDeletionTimer
QPointer< QTimer > m_progressBarDeletionTimer
A pointer to the ProgressBar deletion timer.
Definition: WorkOrder.h:671
Isis::Shape
This represents a shape in a project-based GUI interface.
Definition: Shape.h:68
Isis::WorkOrder::getTemplate
Template * getTemplate()
WorkOrder::getTemplate.
Definition: WorkOrder.cpp:736
Isis::WorkOrder::project
Project * project() const
Returns the Project this WorkOrder is attached to.
Definition: WorkOrder.cpp:1300
Isis::ProjectItem::fileItem
FileItemQsp fileItem() const
Returns the FileItemQsp stored in the data of the item.
Definition: ProjectItem.cpp:597
Isis::WorkOrder::m_transparentConstMutex
QMutex * m_transparentConstMutex
This is used to protect the integrity of data the WorkOrder is working on so that only one thread at ...
Definition: WorkOrder.h:642
Isis::WorkOrder::m_template
Template * m_template
A QSharedPointer to the Template (A Template object but encapsulated within a Gui framework.
Definition: WorkOrder.h:590
Isis::WorkOrder::undoExecution
virtual void undoExecution()
Execute the steps necessary to undo this workorder.
Definition: WorkOrder.cpp:1434
Isis::WorkOrder::progressValue
int progressValue() const
Gets the current progress value of the WorkOrder.
Definition: WorkOrder.cpp:1347
Isis::WorkOrder::previous
WorkOrder * previous() const
Gets the previous WorkOrder.
Definition: WorkOrder.cpp:944
Isis::ShapeList
Internalizes a list of shapes and allows for operations on the entire list.
Definition: ShapeList.h:33
Isis::WorkOrder::m_createsCleanState
bool m_createsCleanState
This is defaulted to false.
Definition: WorkOrder.h:549
Isis::Image
This represents a cube in a project-based GUI interface.
Definition: Image.h:107
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::WorkOrder::fromStatusString
static WorkOrderStatus fromStatusString(QString)
Attempts to query the current status of the WorkOrder.
Definition: WorkOrder.cpp:988
Isis::WorkOrder::~WorkOrder
virtual ~WorkOrder()
The Destructor.
Definition: WorkOrder.cpp:157
Isis::WorkOrder::fileItem
FileItemQsp fileItem()
WorkOrder::fileItem.
Definition: WorkOrder.cpp:766
Isis::WorkOrder::setNext
void setNext(WorkOrder *nextWorkOrder)
Sets the next WorkOrder in the sequence.
Definition: WorkOrder.cpp:613
Isis::WorkOrder::m_progressBar
QPointer< ProgressBar > m_progressBar
A pointer to the ProgressBar.
Definition: WorkOrder.h:661
Isis::ProjectItem::controlList
ControlList * controlList() const
Returns the ControlList stored in the data of the item.
Definition: ProjectItem.cpp:546
Isis::WorkOrder::m_progressRangeMaxValue
int m_progressRangeMaxValue
The maximum value of the Progess Bar.
Definition: WorkOrder.h:567
Isis::ProjectItem::isProject
bool isProject() const
Returns true if a Project is stored in the data of the item.
Definition: ProjectItem.cpp:724
Isis::WorkOrder::clearImageList
void clearImageList()
Clears the list of images.
Definition: WorkOrder.cpp:1623
Isis::WorkOrder::setProgressRange
void setProgressRange(int, int)
Sets the progress range of the WorkOrder.
Definition: WorkOrder.cpp:1358
Isis::WorkOrder::startRedo
void startRedo()
WorkOrder::startRedo This function is currently empty.
Definition: WorkOrder.cpp:1650
Isis::WorkOrder::m_project
QPointer< Project > m_project
A pointer to the Project this WorkOrder is attached to.
Definition: WorkOrder.h:636
Isis::Project::image
Image * image(QString id)
Return an image given its id.
Definition: Project.cpp:1509
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::WorkOrder::listenForImageDestruction
void listenForImageDestruction()
Checks to see if we have lost any images in the ImageList.
Definition: WorkOrder.cpp:1479
Isis::WorkOrder::bestText
QString bestText() const
Generate unique action names We don't use action text anymore because Directory likes to rename our a...
Definition: WorkOrder.cpp:795
Isis::WorkOrder::m_nextWorkOrder
QPointer< WorkOrder > m_nextWorkOrder
A pointer to the next WorkOrder in the queue.
Definition: WorkOrder.h:626
Isis::WorkOrder::clearShapeList
void clearShapeList()
Clears the list of shapes.
Definition: WorkOrder.cpp:1631
Isis::WorkOrder::guiCamera
GuiCameraQsp guiCamera()
WorkOrder::guiCamera.
Definition: WorkOrder.cpp:756
Isis::WorkOrder::executionFinished
void executionFinished()
Signals the Project that the WorkOrder is finished, deletes the update time for the Progress bar,...
Definition: WorkOrder.cpp:1592
Isis::FileItemQsp
QSharedPointer< FileItem > FileItemQsp
A FileItem smart pointer.
Definition: FileItem.h:36
Isis::WorkOrder::WorkOrderFinished
@ WorkOrderFinished
This is used for work orders that will not undo or redo (See createsCleanState())
Definition: WorkOrder.h:331
Isis::Image::id
QString id() const
Get a unique, identifying string associated with this image.
Definition: Image.cpp:445
Isis::WorkOrder::setProgressValue
void setProgressValue(int)
Sets the current progress value for the WorkOrder.
Definition: WorkOrder.cpp:1368
Isis::WorkOrder::progressBar
ProgressBar * progressBar()
Returns the ProgressBar.
Definition: WorkOrder.cpp:975
Isis::ProjectItem::imageList
ImageList * imageList() const
Returns the ImageList stored in the data of the item.
Definition: ProjectItem.cpp:486
Isis::WorkOrder::m_targetBody
TargetBodyQsp m_targetBody
A QSharedPointer to the TargetBody (A Target object but encapsulated within a Gui framework.
Definition: WorkOrder.h:597
Isis::WorkOrder::WorkOrderStatus
WorkOrderStatus
This enumeration is used by other functions to set and retrieve the current state of the WorkOrder.
Definition: WorkOrder.h:321
QFutureWatcher
This is free and unencumbered software released into the public domain.
Definition: AbstractTableModel.h:24
Isis::WorkOrder::resetProgressBar
void resetProgressBar()
Resets the ProgressBar.
Definition: WorkOrder.cpp:1520
Isis::WorkOrder::internalData
QStringList internalData() const
Gets the internal data for this WorkOrder.
Definition: WorkOrder.cpp:1377
Isis::ShapeList::append
void append(Shape *const &value)
Appends an shape to the shape list.
Definition: ShapeList.cpp:133
Isis::WorkOrder::execute
virtual void execute()
Execute the workorder.
Definition: WorkOrder.cpp:1403
Isis::WorkOrder::setModifiesDiskState
void setModifiesDiskState(bool changesProjectOnDisk)
Definition: WorkOrder.cpp:1674
Isis::WorkOrder::correlationMatrix
CorrelationMatrix correlationMatrix()
Returns the CorrleationMatrix for this WorkOrder.
Definition: WorkOrder.cpp:696
Isis::WorkOrder::setPrevious
void setPrevious(WorkOrder *previousWorkOrder)
Sets the previous WorkOrder in the sequence.
Definition: WorkOrder.cpp:622
Isis::WorkOrder::setCreatesCleanState
void setCreatesCleanState(bool createsCleanState)
Declare that this work order is saving the project.
Definition: WorkOrder.cpp:1663
QObject
Isis::WorkOrder::attemptQueuedAction
void attemptQueuedAction()
Attempts to execute an action on the action queue.
Definition: WorkOrder.cpp:1575
Isis::WorkOrder::Context
Context
This enumeration is for recording the context of the current Workorder (whether it is part of a proje...
Definition: WorkOrder.h:339
Isis::WorkOrder::m_modifiesDiskState
bool m_modifiesDiskState
This is defaulted to false.
Definition: WorkOrder.h:556
Isis::GuiCameraQsp
QSharedPointer< GuiCamera > GuiCameraQsp
GuiCameraQsp Represents a smart pointer to a GuiCamera object.
Definition: GuiCamera.h:186
QAction
Isis::WorkOrder::XmlHandler::startElement
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
The XML reader invokes this method at the start of every element in the XML document.
Definition: WorkOrder.cpp:1702
Isis::ProjectItem::getTemplate
Template * getTemplate() const
Returns the Template stored in the data of the item.
Definition: ProjectItem.cpp:516
Isis::WorkOrder::isUndoing
bool isUndoing() const
Returns the WorkOrderUndoing state.
Definition: WorkOrder.cpp:903
Isis::WorkOrder::enableWorkOrder
void enableWorkOrder()
Enables the work order.
Definition: WorkOrder.cpp:1218
Isis::WorkOrder::executionTime
QDateTime executionTime() const
Gets the execution time of this WorkOrder.
Definition: WorkOrder.cpp:864
Isis::WorkOrder::m_secondsElapsed
double m_secondsElapsed
The seconds that have elapsed since the WorkOrder started executing.
Definition: WorkOrder.h:682
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ProjectItem::targetBody
TargetBodyQsp targetBody() const
Returns the TargetBodyQsp stored in the data of the item.
Definition: ProjectItem.cpp:587
Isis::ProjectItem
Represents an item of a ProjectItemModel in Qt's model-view framework.
Definition: ProjectItem.h:134