![]() |
Isis 3 Programmer Reference
|
Maintains a list of Controls so that control nets can easily be copied from one Project to another, saved to disk, or deleted from disk. More...
#include <ControlList.h>


Classes | |
| class | CopyControlDataFunctor |
| This functor is used for copying the control nets between two projects quickly. More... | |
Signals | |
| void | countChanged (int newCount) |
| void | deletingList (ControlList *list) |
Public Member Functions | |
| ControlList (QString name, QString path, QObject *parent=NULL) | |
| Create an control list from a control list name and path (does not read Controls). | |
| ControlList (QObject *parent=NULL) | |
| Create a blank control list. | |
| ControlList (QList< Control * >, QObject *parent=NULL) | |
| Create an control list from a list of controls. | |
| ControlList (QStringList &) | |
| Create an control list from a list of control net file names. | |
| ControlList (const ControlList &) | |
| Copy constructor. | |
| ~ControlList () | |
| Destructor. | |
| void | append (Control *const &value) |
| Appends a control pointer to the control list. | |
| void | append (const QList< Control * > &value) |
| Appends a list of control pointers to the control list. | |
| void | clear () |
| Clears the control list. | |
| iterator | erase (iterator pos) |
| Erases a control pointer from the control list at the specified position. | |
| iterator | erase (iterator begin, iterator end) |
| Erases all control pointers starting at "begin" up to (but not including) end. | |
| void | insert (int i, Control *const &value) |
| Inserts a control pointer at the specified position in the control list. | |
| iterator | insert (iterator before, Control *const &value) |
| Inserts a control pointer before the specified iterator position. | |
| void | prepend (Control *const &value) |
| Prepends a control pointer to the control list. | |
| void | push_back (Control *const &value) |
| Equivalent to append(value) | |
| void | push_front (Control *const &value) |
| Equivalent to prepend(value) | |
| int | removeAll (Control *const &value) |
| Removes all occurences of the control pointer in the control list. | |
| void | removeAt (int i) |
| Removes the control pointer at the specified index. | |
| void | removeFirst () |
| Removes the first control pointer from the control list. | |
| void | removeLast () |
| Removes the last control pointer from the control list. | |
| bool | removeOne (Control *const &value) |
| Removes the first occurence of the control pointer from the control list. | |
| void | swap (QList< Control * > &other) |
| Swaps this control list's control pointers with the other list of control pointers. | |
| Control * | takeAt (int i) |
| Remove the control pointer at the specified index and returns it. | |
| Control * | takeFirst () |
| Removes the first control pointer from the control list and returns it. | |
| Control * | takeLast () |
| Removes the last control pointer from the control list and returns it. | |
| ControlList & | operator+= (const QList< Control * > &other) |
| Appends control pointers from the other list to this control list. | |
| ControlList & | operator+= (Control *const &other) |
| Appends a control pointer to this control list. | |
| ControlList & | operator<< (const QList< Control * > &other) |
| Appends a list of other control pointers to this control list. | |
| ControlList & | operator<< (Control *const &other) |
| Appends a control pointer to this control list. | |
| ControlList & | operator= (const QList< Control * > &rhs) |
| Assigns another list of control pointers to this control list. | |
| ControlList & | operator= (const ControlList &rhs) |
| Assignment operator. | |
| QList< QAction * > | supportedActions (Project *project=NULL) |
| bool | allSupport (ControlDisplayProperties::Property prop) |
| void | setName (QString newName) |
| Set the human-readable name of this control list. | |
| void | setPath (QString newPath) |
| Set the relative path (from the project root) to this control list's folder. | |
| QString | name () const |
| Get the human-readable name of this control list. | |
| QString | path () const |
| Get the path to these controls in the control list (relative to project root). | |
| void | deleteFromDisk (Project *project) |
| Delete all of the contained Controls from disk. | |
| void | save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const |
| Convert this control list into XML format for saving/restoring capabilities. | |
Private Attributes | |
| QString | m_name |
| Name of the ControlList. | |
| QString | m_path |
| This stores the directory name that contains the controls in this control list. | |
Maintains a list of Controls so that control nets can easily be copied from one Project to another, saved to disk, or deleted from disk.
Overrides several common QList methods for managing a list of Controls as well. Adapted from ImageList
2012-09-01 Tracie Sucharski - Original version.
2015-10-14 Jeffrey Covington - Declared ControlList * as a Qt metatype for use with QVariant.
2016-06-06 Ian Humphrey - Updated documentation and coding standards. Fixes #3959.
2017-05-05 Tracie Sucharski - Removed Workorder.h, never used.
2017-12-08 Tracie Sucharski - When saving project only copy the control if project is being saved to a new location.
Definition at line 42 of file ControlList.h.
| Isis::ControlList::ControlList | ( | QString | name, |
| QString | path, | ||
| QObject * | parent = NULL ) |
Create an control list from a control list name and path (does not read Controls).
| name | The ControlList's name (i.e. import1, import2, ...) |
| path | The ControlList's folder name (i.e. import1, import2, ...) |
| parent | The Qt-relationship parent |
Definition at line 36 of file ControlList.cpp.
|
explicit |
Create a blank control list.
| parent | The Qt-relationship parent |
Definition at line 47 of file ControlList.cpp.
Create an control list from a list of controls.
| controls | The list of controls |
| parent | The Qt-relationship parent |
Definition at line 57 of file ControlList.cpp.
References append().
|
explicit |
Create an control list from a list of control net file names.
This is slow (serial) and not recommended.
| fileNames | Control net file names |
Definition at line 79 of file ControlList.cpp.
References append().
| Isis::ControlList::ControlList | ( | const ControlList & | other | ) |
Copy constructor.
| other | The ControlList to copy |
Definition at line 66 of file ControlList.cpp.
| Isis::ControlList::~ControlList | ( | ) |
Destructor.
This does not free the Controls from memory.
Definition at line 94 of file ControlList.cpp.
Appends a list of control pointers to the control list.
| value | The list of control pointers to append |
Definition at line 119 of file ControlList.cpp.
| void Isis::ControlList::append | ( | Control *const & | value | ) |
Appends a control pointer to the control list.
| value | The control pointer to append |
Definition at line 106 of file ControlList.cpp.
Referenced by Isis::Project::addControl(), ControlList(), and ControlList().
| void Isis::ControlList::clear | ( | ) |
Clears the control list.
Definition at line 130 of file ControlList.cpp.
| void Isis::ControlList::deleteFromDisk | ( | Project * | project | ) |
Delete all of the contained Controls from disk.
| project | Project to delete controls from |
Definition at line 547 of file ControlList.cpp.
References Isis::Project::cnetRoot(), Isis::Control::deleteFromDisk(), and m_path.
Erases all control pointers starting at "begin" up to (but not including) end.
| begin | Iterator to the first control pointer to erase from the list |
| end | Iterator to the end control pointer (which will not be erased) |
Definition at line 165 of file ControlList.cpp.
Erases a control pointer from the control list at the specified position.
| pos | The position to erase at |
Definition at line 148 of file ControlList.cpp.
| void Isis::ControlList::insert | ( | int | i, |
| Control *const & | value ) |
Inserts a control pointer at the specified position in the control list.
| i | The index to insert at |
| value | The control pointer to insert |
Definition at line 180 of file ControlList.cpp.
Inserts a control pointer before the specified iterator position.
| before | Iterator to the item to insert the control pointer before |
| value | The control pointer to insert |
Definition at line 197 of file ControlList.cpp.
| QString Isis::ControlList::name | ( | ) | const |
Get the human-readable name of this control list.
Definition at line 524 of file ControlList.cpp.
References m_name.
Referenced by Isis::Project::controlList(), ControlList(), Isis::ProjectItemModel::onControlListAdded(), Isis::ProjectItem::setControlList(), and Isis::ExportControlNetWorkOrder::setupExecution().
| ControlList & Isis::ControlList::operator+= | ( | const QList< Control * > & | other | ) |
Appends control pointers from the other list to this control list.
| The | list of other control pointers to append |
Definition at line 389 of file ControlList.cpp.
| ControlList & Isis::ControlList::operator+= | ( | Control *const & | other | ) |
Appends a control pointer to this control list.
| other | The control pointer to append |
Definition at line 409 of file ControlList.cpp.
| ControlList & Isis::ControlList::operator<< | ( | const QList< Control * > & | other | ) |
Appends a list of other control pointers to this control list.
| other | The list of other control pointers to append |
Definition at line 425 of file ControlList.cpp.
| ControlList & Isis::ControlList::operator<< | ( | Control *const & | other | ) |
Appends a control pointer to this control list.
| other | The control pointer to append |
Definition at line 445 of file ControlList.cpp.
| ControlList & Isis::ControlList::operator= | ( | const ControlList & | rhs | ) |
Assignment operator.
| rhs | The right hand side of the '=' operator |
Definition at line 482 of file ControlList.cpp.
| ControlList & Isis::ControlList::operator= | ( | const QList< Control * > & | rhs | ) |
Assigns another list of control pointers to this control list.
| rhs | The other list of control pointers to assign |
Definition at line 461 of file ControlList.cpp.
| QString Isis::ControlList::path | ( | ) | const |
Get the path to these controls in the control list (relative to project root).
This only applies to a control list from the project.
Definition at line 535 of file ControlList.cpp.
References m_path.
Referenced by ControlList().
| void Isis::ControlList::prepend | ( | Control *const & | value | ) |
Prepends a control pointer to the control list.
| value | The control pointer to prepend to the control list |
Definition at line 211 of file ControlList.cpp.
| void Isis::ControlList::push_back | ( | Control *const & | value | ) |
Equivalent to append(value)
| value | The control pointer to append to the control list |
Definition at line 225 of file ControlList.cpp.
| void Isis::ControlList::push_front | ( | Control *const & | value | ) |
Equivalent to prepend(value)
| value | The control pointer to prepend to the control list |
Definition at line 239 of file ControlList.cpp.
| int Isis::ControlList::removeAll | ( | Control *const & | value | ) |
Removes all occurences of the control pointer in the control list.
| value | The control pointer value to remove |
Definition at line 254 of file ControlList.cpp.
| void Isis::ControlList::removeAt | ( | int | i | ) |
Removes the control pointer at the specified index.
| i | The index of the control pointer to remove |
Definition at line 272 of file ControlList.cpp.
| void Isis::ControlList::removeFirst | ( | ) |
Removes the first control pointer from the control list.
Definition at line 283 of file ControlList.cpp.
| void Isis::ControlList::removeLast | ( | ) |
Removes the last control pointer from the control list.
Definition at line 294 of file ControlList.cpp.
| bool Isis::ControlList::removeOne | ( | Control *const & | value | ) |
Removes the first occurence of the control pointer from the control list.
| value | The control pointer to remove |
Definition at line 309 of file ControlList.cpp.
| void Isis::ControlList::save | ( | QXmlStreamWriter & | stream, |
| const Project * | project, | ||
| FileName | newProjectRoot ) const |
Convert this control list into XML format for saving/restoring capabilities.
This writes:
<controlList name="..." path="...">
to the given xml stream, and creates an 'controls.xml' inside the folder with the controls. Inside the controlNetworks.xml, this writes:
<controls>
...
</controls>
| stream | XML stream that contains the control list data |
| project | Project to save control list from |
| newProjectRoot | Filename root to save control list to |
| IException::Io | "Unable Failed to create directory" |
| IException::Io | "Unable to save control information, could not be opened for writing" |
Definition at line 584 of file ControlList.cpp.
References Isis::Project::cnetRoot(), Isis::FileName::dir(), Isis::IException::Io, m_name, m_path, Isis::Project::newProjectRoot(), Isis::FileName::original(), Isis::FileName::path(), Isis::Project::projectRoot(), Isis::Control::save(), and Isis::FileName::toString().
| void Isis::ControlList::setName | ( | QString | newName | ) |
Set the human-readable name of this control list.
This is really only useful for project control lists (not anonymous temporary ones).
| newName | The name to give this control list |
Definition at line 503 of file ControlList.cpp.
References m_name.
Referenced by Isis::ProjectItemModel::setData().
| void Isis::ControlList::setPath | ( | QString | newPath | ) |
Set the relative path (from the project root) to this control list's folder.
This is really only useful for project control lists (not anonymous temporary ones).
| newPath | The path to the controls in this control list |
Definition at line 514 of file ControlList.cpp.
References m_path.
Swaps this control list's control pointers with the other list of control pointers.
| other | The list of control pointers to swap |
Definition at line 327 of file ControlList.cpp.
| Control * Isis::ControlList::takeAt | ( | int | i | ) |
Remove the control pointer at the specified index and returns it.
| i | The index of the control pointer to take |
Definition at line 345 of file ControlList.cpp.
| Control * Isis::ControlList::takeFirst | ( | ) |
Removes the first control pointer from the control list and returns it.
Definition at line 359 of file ControlList.cpp.
| Control * Isis::ControlList::takeLast | ( | ) |
Removes the last control pointer from the control list and returns it.
Definition at line 373 of file ControlList.cpp.
|
private |
Name of the ControlList.
Definition at line 138 of file ControlList.h.
Referenced by ControlList(), ControlList(), name(), operator=(), save(), and setName().
|
private |
This stores the directory name that contains the controls in this control list.
For example: import1 or import2
This path is relative to Project::controlNetRoot()
Definition at line 150 of file ControlList.h.
Referenced by ControlList(), ControlList(), deleteFromDisk(), operator=(), path(), save(), and setPath().