![]() |
Isis 3 Programmer Reference
|
#include <Application.h>
Public Member Functions | |
Application (int &argc, char *argv[]) | |
Constuctor for the Application object. More... | |
~Application () | |
Destroys the Application object. More... | |
int | Run (void(*funct)()) |
Runs the program defined in the function funct. More... | |
PvlGroup | Accounting () |
Creates accounting PvlGroup. More... | |
PvlObject | History () |
Creates an application history PvlObject. More... | |
void | RegisterGuiHelpers (std::map< QString, void * > helpers) |
void * | GetGuiHelper (QString helper) |
void | GuiReportError (IException &e) |
Loads the error message into the gui, but does not write it to the session log. More... | |
Static Public Member Functions | |
static UserInterface & | GetUserInterface () |
Returns the UserInterface object. More... | |
static void | Log (PvlGroup &results) |
Writes Pvl results to sessionlog and printfile. More... | |
static void | GuiLog (const Pvl &results) |
Writes the Pvl results to the sessionlog, but not to the printfile. More... | |
static void | GuiLog (const PvlGroup &results) |
Writes the PvlGroup results to the sessionlog, but not to the printfile. More... | |
static void | GuiLog (const QString &results) |
Writes the results to the sessionlog, but not to the printfile. More... | |
static QString | Name () |
Returns the name of the application. More... | |
static QString | UserName () |
Returns the user name. More... | |
static QString | HostName () |
Returns the host name. More... | |
static QString | DateTime (time_t *curtime=0) |
Returns the date and time as a QString. More... | |
static QString | Version () |
The Isis Version for this application. More... | |
static bool | HasParent () |
Returns whether the application has a parent or not. More... | |
static QString | userName () |
@Returns the user name. More... | |
static QString | hostName () |
static QString | isisVersion () |
static QString | getEnvironmentValue (QString, QString) |
Static Public Attributes | |
static bool | p_applicationForceGuiApp = false |
Private Member Functions | |
int | DirectIO () |
Returns the current number of I/O's. More... | |
int | PageFaults () |
Returns the current number of faults. More... | |
int | ProcessSwaps () |
Returns the current number of swaps. More... | |
void | SendParentData (QString, const QString &) |
void | SendParentErrors (PvlObject &errors) |
Sends errors to the parent. More... | |
void | FunctionCleanup () |
Cleans up after the function by writing the log, saving the history, and either sending the log to the parent if it has one, printing the log data to the terminal or showing the log in the gui. More... | |
int | FunctionError (IException &e) |
Adds the error to the session log, sends the error to the parent if it has one, loads the error message into the gui or prints it to the command line, gets the error type and returns it. More... | |
void | UpdateProgress (const QString &text, bool print) |
Updates the progress bar in the gui. More... | |
void | UpdateProgress (int percent, bool print) |
Updates the progress bar percent. More... | |
void | ProcessGuiEvents () |
Processes the gui events. More... | |
void | SetParentConnection (QLocalSocket *p_connection) |
void | EstablishConnections () |
void | WaitForCommand (int childSocket) |
Static Private Member Functions | |
static PvlGroup | GetUnameInfo () |
Runs various system specific uname commands and returns the results. More... | |
static PvlGroup | GetEnviromentInfo () |
Runs some printenv commands that return Isis related Enviroment Variables. More... | |
static QString | GetSystemDiskSpace () |
Runs df to see the disk space availability. More... | |
static QString | GetLibraryDependencies (QString file) |
Runs ldd on linux and sun and otool on macs to get information about the applicaiton run. More... | |
Private Attributes | |
int | p_BatchlistPass |
QLocalSocket * | p_connectionToParent |
time_t | p_startTime |
clock_t | p_startClock |
QTime | m_connectTime |
Used to calculate program's run time. More... | |
QString | p_datetime |
int | p_startDirectIO |
int | p_startPageFaults |
int | p_startProcessSwaps |
pid_t | p_childPid |
bool | p_childCaught |
UserInterface * | p_ui |
Pointer to a User Interface object. More... | |
pid_t | p_pid |
std::map< QString, void * > | p_guiHelpers |
Static Private Attributes | |
static QString | p_appName |
static Environment | automaticEnvironmentSetup |
Construct an environment in static space to initialize some global Isis environment options. More... | |
Friends | |
class | Gui |
class | Progress |
class | ProgramLauncher |
Definition at line 101 of file Application.h.
Isis::Application::Application | ( | int & | argc, |
char * | argv[] | ||
) |
Constuctor for the Application object.
argc | Number of arguments in argv[]. This must be passed by reference!! |
*argv[] | An array containing the command line arguments |
Isis::iException::Io | - FileOpen error |
Definition at line 64 of file Application.cpp.
References Isis::IException::errorType(), Isis::FileName::expanded(), Isis::FileName::fileExists(), GetUserInterface(), Isis::FileName::name(), Isis::UserInterface::ParentId(), Isis::IException::print(), and Isis::toString().
Isis::Application::~Application | ( | ) |
Destroys the Application object.
Definition at line 163 of file Application.cpp.
PvlGroup Isis::Application::Accounting | ( | ) |
Creates accounting PvlGroup.
Definition at line 281 of file Application.cpp.
|
static |
Returns the date and time as a QString.
*curtime |
Definition at line 802 of file Application.cpp.
|
private |
Returns the current number of I/O's.
Definition at line 326 of file Application.cpp.
|
private |
Cleans up after the function by writing the log, saving the history, and either sending the log to the parent if it has one, printing the log data to the terminal or showing the log in the gui.
Definition at line 536 of file Application.cpp.
References SendParentData().
Referenced by Isis::Gui::StartProcess().
|
private |
Adds the error to the session log, sends the error to the parent if it has one, loads the error message into the gui or prints it to the command line, gets the error type and returns it.
e | The Isis::iException |
Definition at line 626 of file Application.cpp.
References Isis::IException::errorType(), Isis::IException::toPvl(), and Isis::IException::toString().
Referenced by Isis::Gui::StartProcess().
|
staticprivate |
Runs some printenv commands that return Isis related Enviroment Variables.
Definition at line 924 of file Application.cpp.
References Isis::PvlContainer::addKeyword(), and Isis::FileName::expanded().
|
staticinherited |
variable | The environment variable to get |
defaultValue | The returned value for variable if variable doesn't exist. |
Definition at line 92 of file Environment.cpp.
Referenced by Isis::Environment::hostName(), and Isis::Environment::userName().
|
inline |
helper |
Definition at line 129 of file Application.h.
Referenced by Isis::Gui::InvokeHelper().
|
staticprivate |
Runs ldd on linux and sun and otool on macs to get information about the applicaiton run.
Definition at line 993 of file Application.cpp.
References Isis::FileName::expanded().
|
staticprivate |
Runs df to see the disk space availability.
Definition at line 966 of file Application.cpp.
References Isis::FileName::expanded().
|
staticprivate |
Runs various system specific uname commands and returns the results.
Definition at line 844 of file Application.cpp.
References Isis::PvlContainer::addKeyword(), and Isis::FileName::expanded().
|
static |
Returns the UserInterface object.
Definition at line 463 of file Application.cpp.
References p_ui.
Referenced by Isis::PipelineApplication::AddParameter(), Application(), Isis::ProcessByQuickFilter::GetFilterParameters(), GuiLog(), Isis::Gui::InvokeHelper(), Log(), Isis::Gui::ResetParameters(), SendParentData(), Isis::Pipeline::SetInputFile(), Isis::Pipeline::SetInputListFile(), Isis::ProcessExport::SetInputRange(), Isis::ProcessImport::SetOutputCube(), Isis::Pipeline::SetOutputFile(), Isis::Pipeline::SetOutputListFile(), Isis::Gui::ShowWarning(), Isis::Gui::StartProcess(), Isis::Gui::StopProcessing(), Isis::Gui::UpdateCommandLine(), and Isis::Gui::UpdateHistory().
|
static |
Writes the Pvl results to the sessionlog, but not to the printfile.
results | Pvl containing the results to add to the session log |
Definition at line 395 of file Application.cpp.
References GetUserInterface(), Isis::UserInterface::IsInteractive(), Isis::Gui::Log(), SendParentData(), and Isis::UserInterface::TheGui().
Referenced by Isis::ProgramLauncher::ProcessIsisMessageFromChild(), and Isis::GuiCubeParameter::ViewLabel().
|
static |
Writes the PvlGroup results to the sessionlog, but not to the printfile.
results | PvlGroup containing the results to add to the session log |
Definition at line 420 of file Application.cpp.
References GetUserInterface(), Isis::UserInterface::IsInteractive(), Isis::Gui::Log(), SendParentData(), and Isis::UserInterface::TheGui().
|
static |
Writes the results to the sessionlog, but not to the printfile.
results | QString containing the results to add to the session log |
Definition at line 445 of file Application.cpp.
References GetUserInterface(), Isis::UserInterface::IsInteractive(), Isis::Gui::Log(), SendParentData(), and Isis::UserInterface::TheGui().
void Isis::Application::GuiReportError | ( | IException & | e | ) |
Loads the error message into the gui, but does not write it to the session log.
e | The Isis::iException |
Definition at line 708 of file Application.cpp.
References Isis::IException::toString().
Referenced by Isis::Gui::InvokeHelper(), Isis::GuiCubeParameter::ViewCube(), and Isis::GuiCubeParameter::ViewLabel().
|
static |
Returns whether the application has a parent or not.
Definition at line 472 of file Application.cpp.
References p_ui, and Isis::UserInterface::ParentId().
PvlObject Isis::Application::History | ( | ) |
Creates an application history PvlObject.
Definition at line 251 of file Application.cpp.
References Isis::PvlObject::addGroup(), and Isis::PvlObject::findGroup().
Referenced by Isis::History::AddEntry().
|
static |
Returns the host name.
Returns 'Unknown' if it cannot find the host name.
Definition at line 825 of file Application.cpp.
|
staticinherited |
Definition at line 80 of file Environment.cpp.
References Isis::Environment::getEnvironmentValue().
|
staticinherited |
Definition at line 108 of file Environment.cpp.
References Isis::TextFile::GetLine(), and Isis::IException::Programmer.
|
static |
Writes Pvl results to sessionlog and printfile.
results | PvlGroup of results to add to the session log |
Definition at line 353 of file Application.cpp.
References GetUserInterface(), Isis::UserInterface::IsInteractive(), Isis::Gui::Log(), SendParentData(), and Isis::UserInterface::TheGui().
Referenced by Isis::ProgramLauncher::ProcessIsisMessageFromChild().
|
static |
Returns the name of the application.
Returns 'Unknown' if the application or gui equal NULL
Definition at line 729 of file Application.cpp.
Referenced by Isis::Pipeline::Run(), and Isis::IException::toPvl().
|
private |
Returns the current number of faults.
Definition at line 335 of file Application.cpp.
|
private |
Processes the gui events.
If the event is cancel, it throws a cancel exception
Isis::iException::Cancel | - The event was cancelled |
Definition at line 786 of file Application.cpp.
Referenced by Isis::Progress::CheckStatus().
|
private |
Returns the current number of swaps.
Definition at line 344 of file Application.cpp.
|
inline |
helpers |
Definition at line 122 of file Application.h.
int Isis::Application::Run | ( | void(*)() | funct | ) |
Runs the program defined in the function funct.
*funct |
Definition at line 177 of file Application.cpp.
|
private |
code | |
message |
Definition at line 500 of file Application.cpp.
References GetUserInterface(), Isis::UserInterface::ParentId(), and Isis::toString().
Referenced by FunctionCleanup(), GuiLog(), Log(), SendParentErrors(), and UpdateProgress().
|
private |
Sends errors to the parent.
&errors | A PvlObject of the errors |
Definition at line 484 of file Application.cpp.
References Isis::PvlObject::group(), Isis::PvlObject::groups(), and SendParentData().
|
inlineprivate |
p_connection |
Definition at line 182 of file Application.h.
|
private |
Updates the progress bar in the gui.
text | Progress text |
Definition at line 740 of file Application.cpp.
References SendParentData().
Referenced by Isis::Progress::CheckStatus(), and Isis::ProgramLauncher::ProcessIsisMessageFromChild().
|
private |
Updates the progress bar percent.
percent | The percent of the application that is complete |
Definition at line 762 of file Application.cpp.
References SendParentData(), and Isis::toString().
|
static |
Returns the user name.
Returns 'Unknown' if it cannot find the user name.
Definition at line 816 of file Application.cpp.
Referenced by Isis::QnetTool::addMeasure(), Isis::ControlPointEditWidget::createControlPoint(), Isis::QnetTool::createFixedPoint(), Isis::QnetTool::createPoint(), Isis::StereoTool::createPoint(), Isis::MatchTool::createPoint(), Isis::ControlPointEditWidget::measureSaved(), Isis::MatchTool::measureSaved(), Isis::QnetTool::measureSaved(), Isis::QnetFileTool::open(), Isis::SocketThread::run(), Isis::ControlMeasureEditWidget::saveMeasure(), and Isis::ControlPointEdit::saveMeasure().
|
staticinherited |
@Returns the user name.
Returns 'Unknown' if it cannot find the user name.
Definition at line 72 of file Environment.cpp.
References Isis::Environment::getEnvironmentValue().
Referenced by Isis::Project::clear(), and Isis::Project::Project().
|
static |
The Isis Version for this application.
Definition at line 834 of file Application.cpp.
|
staticprivateinherited |
Construct an environment in static space to initialize some global Isis environment options.
This initialization applies to anything that links against the Isis library.
Definition at line 55 of file Environment.h.
|
private |
Used to calculate program's run time.
Definition at line 151 of file Application.h.
|
private |
Pointer to a User Interface object.
Definition at line 159 of file Application.h.
Referenced by GetUserInterface(), and HasParent().
U.S. Department of the Interior | U.S. Geological Survey ISIS | Privacy & Disclaimers | Astrogeology Research Program To contact us, please post comments and questions on the USGS Astrogeology Discussion Board To report a bug, or suggest a feature go to: ISIS Github File Modified: 07/13/2023 15:17:51 |