Isis Developer Reference
Isis::Control Class Reference

This represents an ISIS control net in a project-based GUI interface. More...

#include <Control.h>

Inheritance diagram for Isis::Control:
Inheritance graph
Collaboration diagram for Isis::Control:
Collaboration graph

Public Slots

void updateFileName (Project *)
 Change the on-disk file name for this control to be where the control ought to be in the given project.
 
void closeControlNet ()
 Cleans up the ControlNet pointer.
 

Public Member Functions

 Control (QString cnetFileName, QObject *parent=0)
 Create a Control from control net located on disk.
 
 Control (Project *project, QString cnetFileName, QObject *parent=0)
 Create a Control from control net located on disk associated with a Project.
 
 Control (ControlNet *controlNet, QString cnetFileName, QObject *parent=0)
 Create a Control from a control network that has already been created and read from disk.
 
 ~Control ()
 Destroys Control object.
 
ControlNetcontrolNet ()
 Open and return a pointer to the ControlNet for this Control.
 
void openControlNet ()
 Sets the ControlNet from the control net file name provided in the constructor.
 
ControlDisplayPropertiesdisplayProperties ()
 Access a pointer to the display properties for the control network.
 
const ControlDisplayPropertiesdisplayProperties () const
 Access a const pointer to the display properties for the control network.
 
QString fileName () const
 Access the name of the control network file associated with this Control.
 
QString id () const
 Access the unique ID associated with this Control.
 
bool isModified ()
 @description Has this control been modified?
 
void setModified (bool modified=true)
 @description Sets the modification state of this control.
 
bool write ()
 @description Write control net to disk.
 
void save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
 Method to write this Control object's member data to an XML stream.
 
void copyToNewProjectRoot (const Project *project, FileName newProjectRoot)
 Copies the files of the given Project to the given location.
 
void deleteFromDisk ()
 Delete the control net from disk.
 

Public Attributes

ControlNetm_controlNet
 A pointer to the ControlNet object associated with this Control object.
 

Detailed Description

This represents an ISIS control net in a project-based GUI interface.

This encapsulates ideas about a control net such as it's filename and display properties.

Author
2012-06-12 Ken Edmundson and Tracie Sucharski

Constructor & Destructor Documentation

◆ Control() [1/3]

Isis::Control::Control ( QString cNetFileName,
QObject * parent = 0 )
explicit

Create a Control from control net located on disk.

Parameters
cNetFileNameThe name of the control net on disk
parentThe Qt-relationship parent

References _FILEINFO_, m_controlNet, openControlNet(), and Isis::IException::Programmer.

◆ Control() [2/3]

Isis::Control::Control ( Project * project,
QString cNetFileName,
QObject * parent = 0 )
explicit

Create a Control from control net located on disk associated with a Project.

Parameters
cNetFileNameThe name of the control net on disk
parentThe Qt-relationship parent

References m_controlNet.

◆ Control() [3/3]

Isis::Control::Control ( ControlNet * controlNet,
QString cnetFileName,
QObject * parent = 0 )
explicit

Create a Control from a control network that has already been created and read from disk.

Parameters
controlNetThe actual control network
cnetFileNameThe name of the control net on disk
parentThe Qt-relationship parent

References controlNet(), and m_controlNet.

◆ ~Control()

Isis::Control::~Control ( )

Destroys Control object.

References m_controlNet.

Member Function Documentation

◆ closeControlNet

void Isis::Control::closeControlNet ( )
slot

Cleans up the ControlNet pointer.

This method should be called once there is no more need for this network because the OS will limit how many of these can be open.

References m_controlNet.

Referenced by Isis::Directory::cleanupCnetEditorViewWidgets(), and updateFileName().

◆ controlNet()

◆ copyToNewProjectRoot()

void Isis::Control::copyToNewProjectRoot ( const Project * project,
FileName newProjectRoot )

Copies the files of the given Project to the given location.

Parameters
projectA pointer to the Project.
newProjectRootThe name of the new root directory where the project will be copied.

References _FILEINFO_, Isis::Project::cnetRoot(), controlNet(), Isis::FileName::dir(), Isis::IException::Io, isModified(), Isis::FileName::name(), Isis::Project::projectRoot(), setModified(), Isis::FileName::toString(), Isis::toString(), write(), and Isis::ControlNet::Write().

◆ deleteFromDisk()

void Isis::Control::deleteFromDisk ( )

Delete the control net from disk.

The control net will no longer be accessible until you call updateFileName().

Exceptions
IException::Io"Could not remove file."

References _FILEINFO_, and Isis::IException::Io.

Referenced by Isis::ControlList::deleteFromDisk().

◆ displayProperties() [1/2]

ControlDisplayProperties * Isis::Control::displayProperties ( )

Access a pointer to the display properties for the control network.

Returns
ControlDisplayProperties * A pointer to the display properties.

Referenced by Isis::Directory::addCnetEditorView(), Isis::JigsawSetupDialog::JigsawSetupDialog(), and Isis::ExportControlNetWorkOrder::setupExecution().

◆ displayProperties() [2/2]

const ControlDisplayProperties * Isis::Control::displayProperties ( ) const

Access a const pointer to the display properties for the control network.

Returns
ControlDisplayProperties * A pointer to the display properties.

◆ fileName()

◆ id()

QString Isis::Control::id ( ) const

Access the unique ID associated with this Control.

Returns
QString The Control ID.

Referenced by Isis::Project::addControl(), and Isis::ExportControlNetWorkOrder::setupExecution().

◆ isModified()

bool Isis::Control::isModified ( )

@description Has this control been modified?

Returns
bool Has this control been modified?

Referenced by copyToNewProjectRoot(), and Isis::Project::save().

◆ openControlNet()

void Isis::Control::openControlNet ( )

Sets the ControlNet from the control net file name provided in the constructor.

Exceptions
IException::Programmer"Error opening control net."

References _FILEINFO_, m_controlNet, Isis::Project::mutex(), Isis::IException::Programmer, and Isis::ControlNet::SetMutex().

Referenced by Control(), and controlNet().

◆ save()

void Isis::Control::save ( QXmlStreamWriter & stream,
const Project * project,
FileName newProjectRoot ) const

Method to write this Control object's member data to an XML stream.

Parameters
streamThe stream to which the Control will be saved.
projectThe Project to which this Control will be added.
newProjectRootThe location of the project root directory.

References Isis::ControlDisplayProperties::save().

Referenced by Isis::BundleSolutionInfo::save(), and Isis::ControlList::save().

◆ setModified()

void Isis::Control::setModified ( bool modified = true)

@description Sets the modification state of this control.

This is needed for now since many classes make changes to the control net contained in this object, but the control does not know the state of the control net. TODO: Change this class to always know the state of the control Net.

Referenced by copyToNewProjectRoot().

◆ updateFileName

void Isis::Control::updateFileName ( Project * project)
slot

Change the on-disk file name for this control to be where the control ought to be in the given project.

Parameters
projectThe project that this control is stored in

References closeControlNet(), Isis::Project::cnetRoot(), Isis::FileName::dir(), and Isis::FileName::name().

◆ write()

bool Isis::Control::write ( )

@description Write control net to disk.

This method is used instead of calling ControlNet::Write directly so that Control knows the modification state of the control net. Note that if there is not a control net opened, there should no be any changes to write.

Returns
bool Returns false if there is not a control net open to write
Exceptions
IException::Programmer"Cannot write control net to disk"

References _FILEINFO_, fileName(), m_controlNet, Isis::IException::Programmer, and Isis::ControlNet::Write().

Referenced by copyToNewProjectRoot(), and Isis::Project::save().

Member Data Documentation

◆ m_controlNet

ControlNet* Isis::Control::m_controlNet

A pointer to the ControlNet object associated with this Control object.

Referenced by closeControlNet(), Control(), Control(), Control(), controlNet(), openControlNet(), write(), and ~Control().


The documentation for this class was generated from the following files: