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... | |
class | XmlHandler |
Nested class used to write the ControlList object information to an XML file for the purposes of saving an restoring the state of the object. 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). More... | |
ControlList (QObject *parent=NULL) | |
Create a blank control list. More... | |
ControlList (QList< Control *>, QObject *parent=NULL) | |
Create an control list from a list of controls. More... | |
ControlList (Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent=NULL) | |
Create an control list from XML. More... | |
ControlList (QStringList &) | |
Create an control list from a list of control net file names. More... | |
ControlList (const ControlList &) | |
Copy constructor. More... | |
~ControlList () | |
Destructor. More... | |
void | append (Control *const &value) |
Appends a control pointer to the control list. More... | |
void | append (const QList< Control *> &value) |
Appends a list of control pointers to the control list. More... | |
void | clear () |
Clears the control list. More... | |
iterator | erase (iterator pos) |
Erases a control pointer from the control list at the specified position. More... | |
iterator | erase (iterator begin, iterator end) |
Erases all control pointers starting at "begin" up to (but not including) end. More... | |
void | insert (int i, Control *const &value) |
Inserts a control pointer at the specified position in the control list. More... | |
iterator | insert (iterator before, Control *const &value) |
Inserts a control pointer before the specified iterator position. More... | |
void | prepend (Control *const &value) |
Prepends a control pointer to the control list. More... | |
void | push_back (Control *const &value) |
Equivalent to append(value) More... | |
void | push_front (Control *const &value) |
Equivalent to prepend(value) More... | |
int | removeAll (Control *const &value) |
Removes all occurences of the control pointer in the control list. More... | |
void | removeAt (int i) |
Removes the control pointer at the specified index. More... | |
void | removeFirst () |
Removes the first control pointer from the control list. More... | |
void | removeLast () |
Removes the last control pointer from the control list. More... | |
bool | removeOne (Control *const &value) |
Removes the first occurence of the control pointer from the control list. More... | |
void | swap (QList< Control *> &other) |
Swaps this control list's control pointers with the other list of control pointers. More... | |
Control * | takeAt (int i) |
Remove the control pointer at the specified index and returns it. More... | |
Control * | takeFirst () |
Removes the first control pointer from the control list and returns it. More... | |
Control * | takeLast () |
Removes the last control pointer from the control list and returns it. More... | |
ControlList & | operator+= (const QList< Control *> &other) |
Appends control pointers from the other list to this control list. More... | |
ControlList & | operator+= (Control *const &other) |
Appends a control pointer to this control list. More... | |
ControlList & | operator<< (const QList< Control *> &other) |
Appends a list of other control pointers to this control list. More... | |
ControlList & | operator<< (Control *const &other) |
Appends a control pointer to this control list. More... | |
ControlList & | operator= (const QList< Control *> &rhs) |
Assigns another list of control pointers to this control list. More... | |
ControlList & | operator= (const ControlList &rhs) |
Assignment operator. More... | |
QList< QAction * > | supportedActions (Project *project=NULL) |
bool | allSupport (ControlDisplayProperties::Property prop) |
void | setName (QString newName) |
Set the human-readable name of this control list. More... | |
void | setPath (QString newPath) |
Set the relative path (from the project root) to this control list's folder. More... | |
QString | name () const |
Get the human-readable name of this control list. More... | |
QString | path () const |
Get the path to these controls in the control list (relative to project root). More... | |
void | deleteFromDisk (Project *project) |
Delete all of the contained Controls from disk. More... | |
void | save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const |
Convert this control list into XML format for saving/restoring capabilities. More... | |
Private Attributes | |
QString | m_name |
Name of the ControlList. More... | |
QString | m_path |
This stores the directory name that contains the controls in this control list. More... | |
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 36 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 51 of file ControlList.cpp.
|
explicit |
Create a blank control list.
parent | The Qt-relationship parent |
Definition at line 62 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 72 of file ControlList.cpp.
References append().
|
explicit |
Create an control list from XML.
project | The project with the control list |
xmlReader | The XML reader currently at an <controlList> tag. |
parent | The Qt-relationship parent |
Definition at line 84 of file ControlList.cpp.
References Isis::XmlStackedHandlerReader::pushContentHandler().
|
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 108 of file ControlList.cpp.
References append().
Isis::ControlList::ControlList | ( | const ControlList & | other | ) |
Copy constructor.
other | The ControlList to copy |
Definition at line 95 of file ControlList.cpp.
Isis::ControlList::~ControlList | ( | ) |
Destructor.
This does not free the Controls from memory.
Definition at line 123 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 135 of file ControlList.cpp.
Referenced by ControlList().
Appends a list of control pointers to the control list.
value | The list of control pointers to append |
Definition at line 148 of file ControlList.cpp.
void Isis::ControlList::clear | ( | ) |
Clears the control list.
Definition at line 159 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 576 of file ControlList.cpp.
References Isis::Project::cnetRoot(), Isis::Control::deleteFromDisk(), and m_path.
Referenced by Isis::Project::deleteAllProjectFiles().
Erases a control pointer from the control list at the specified position.
pos | The position to erase at |
Definition at line 177 of file ControlList.cpp.
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 194 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 209 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 226 of file ControlList.cpp.
QString Isis::ControlList::name | ( | ) | const |
Get the human-readable name of this control list.
Definition at line 553 of file ControlList.cpp.
References m_name.
Referenced by ControlList(), Isis::Project::controlList(), Isis::ProjectItemModel::onControlListAdded(), Isis::ProjectItem::setControlList(), Isis::ExportControlNetWorkOrder::setupExecution(), and Isis::ControlList::XmlHandler::startElement().
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 418 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 438 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 454 of file ControlList.cpp.
References operator<<().
ControlList & Isis::ControlList::operator<< | ( | Control *const & | other | ) |
Appends a control pointer to this control list.
other | The control pointer to append |
Definition at line 474 of file ControlList.cpp.
References operator<<().
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 490 of file ControlList.cpp.
ControlList & Isis::ControlList::operator= | ( | const ControlList & | rhs | ) |
Assignment operator.
rhs | The right hand side of the '=' operator |
Definition at line 511 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 564 of file ControlList.cpp.
References m_path.
Referenced by ControlList(), and Isis::ControlList::XmlHandler::startElement().
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 240 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 254 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 268 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 283 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 301 of file ControlList.cpp.
void Isis::ControlList::removeFirst | ( | ) |
Removes the first control pointer from the control list.
Definition at line 312 of file ControlList.cpp.
void Isis::ControlList::removeLast | ( | ) |
Removes the last control pointer from the control list.
Definition at line 323 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 338 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 613 of file ControlList.cpp.
References _FILEINFO_, Isis::Project::cnetRoot(), Isis::FileName::dir(), Isis::IException::Io, m_name, m_path, Isis::FileName::path(), 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 532 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 543 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 356 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 374 of file ControlList.cpp.
Control * Isis::ControlList::takeFirst | ( | ) |
Removes the first control pointer from the control list and returns it.
Definition at line 388 of file ControlList.cpp.
Control * Isis::ControlList::takeLast | ( | ) |
Removes the last control pointer from the control list and returns it.
Definition at line 402 of file ControlList.cpp.
|
private |
Name of the ControlList.
Definition at line 162 of file ControlList.h.
Referenced by 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 174 of file ControlList.h.
Referenced by ControlList(), deleteFromDisk(), operator=(), path(), save(), and setPath().