|
Isis 3.0 Object Programmers' Reference |
Home |
#include <Application.h>


Public Member Functions | |
| Application (int &argc, char *argv[]) | |
| Constuctor for the Application object. | |
| ~Application () | |
| Destroys the Application object. | |
| int | Run (void(*funct)()) |
| Runs the program defined in the function funct. | |
| PvlGroup | Accounting () |
| Creates accounting PvlGroup. | |
| PvlObject | History () |
| Creates an application history PvlObject. | |
| 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. | |
Static Public Member Functions | |
| static UserInterface & | GetUserInterface () |
| Returns the UserInterface object. | |
| static void | Log (PvlGroup &results) |
| Writes Pvl results to sessionlog and printfile. | |
| static void | GuiLog (const Pvl &results) |
| Writes the Pvl results to the sessionlog, but not to the printfile. | |
| static void | GuiLog (const PvlGroup &results) |
| Writes the PvlGroup results to the sessionlog, but not to the printfile. | |
| static void | GuiLog (const QString &results) |
| Writes the results to the sessionlog, but not to the printfile. | |
| static QString | Name () |
| Returns the name of the application. | |
| static QString | UserName () |
| Returns the user name. | |
| static QString | HostName () |
| Returns the host name. | |
| static QString | DateTime (time_t *curtime=0) |
| Returns the date and time as a QString. | |
| static QString | Version () |
| The Isis Version for this application. | |
| static bool | HasParent () |
| Returns whether the application has a parent or not. | |
| static QString | userName () |
| the user name. | |
| static QString | hostName () |
| static QString | isisVersion () |
Static Public Attributes | |
| static bool | p_applicationForceGuiApp = false |
Private Member Functions | |
| int | DirectIO () |
| Returns the current number of I/O's. | |
| int | PageFaults () |
| Returns the current number of faults. | |
| int | ProcessSwaps () |
| Returns the current number of swaps. | |
| void | SendParentData (QString, const QString &) |
| void | SendParentErrors (PvlObject &errors) |
| Sends errors to the parent. | |
| 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. | |
| 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. | |
| void | UpdateProgress (const QString &text, bool print) |
| Updates the progress bar in the gui. | |
| void | UpdateProgress (int percent, bool print) |
| Updates the progress bar percent. | |
| void | ProcessGuiEvents () |
| Processes the gui events. | |
| 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. | |
| static PvlGroup | GetEnviromentInfo () |
| Runs some printenv commands that return Isis related Enviroment Variables. | |
| static QString | GetSystemDiskSpace () |
| Runs df to see the disk space availability. | |
| static QString | GetLibraryDependencies (QString file) |
| Runs ldd on linux and sun and otool on macs to get information about the applicaiton run. | |
Private Attributes | |
| int | p_BatchlistPass |
| QLocalSocket * | p_connectionToParent |
| time_t | p_startTime |
| clock_t | p_startClock |
| 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. | |
| pid_t | p_pid |
| std::map< QString, void * > | p_guiHelpers |
Static Private Attributes | |
| static QString | p_appName |
Friends | |
| class | Gui |
| class | Progress |
| class | ProgramLauncher |
For internal use only.
Definition at line 112 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 78 of file Application.cpp.
References _FILEINFO_, DateTime(), DirectIO(), Isis::IException::errorType(), exit(), Isis::Message::FileOpen(), GetUserInterface(), Isis::IException::Io, Isis::UserInterface::IsInteractive(), p_ui, PageFaults(), Isis::UserInterface::ParentId(), Isis::IException::print(), ProcessSwaps(), Isis::toString(), and UserName().
| Isis::Application::~Application | ( | ) |
| PvlGroup Isis::Application::Accounting | ( | ) |
Creates accounting PvlGroup.
Definition at line 287 of file Application.cpp.
| QString Isis::Application::DateTime | ( | time_t * | curtime = 0 |
) | [static] |
Returns the date and time as a QString.
| *curtime |
Definition at line 809 of file Application.cpp.
Referenced by Application(), Isis::ControlNet::ControlNet(), Isis::ControlMeasure::GetDateTime(), History(), Run(), and Isis::ControlMeasure::SetDateTime().
| int Isis::Application::DirectIO | ( | ) | [private] |
Returns the current number of I/O's.
Definition at line 334 of file Application.cpp.
Referenced by Application(), and Run().
| void Isis::Application::FunctionCleanup | ( | ) | [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 542 of file Application.cpp.
References _FILEINFO_, Isis::CubeManager::CleanUp(), GetEnviromentInfo(), Isis::UserInterface::GetInfoFileName(), Isis::UserInterface::GetInfoFlag(), GetLibraryDependencies(), GetSystemDiskSpace(), GetUnameInfo(), HasParent(), Isis::IException::Io, Isis::UserInterface::IsInteractive(), Isis::Gui::Log(), p_ui, SendParentData(), ss, and Isis::UserInterface::TheGui().
Referenced by Run(), and Isis::Gui::StartProcess().
| int Isis::Application::FunctionError | ( | IException & | e | ) | [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 633 of file Application.cpp.
References _FILEINFO_, errors, Isis::IException::errorType(), GetEnviromentInfo(), Isis::UserInterface::GetInfoFileName(), Isis::UserInterface::GetInfoFlag(), GetLibraryDependencies(), GetSystemDiskSpace(), GetUnameInfo(), HasParent(), Isis::IException::Io, Isis::UserInterface::IsInteractive(), Isis::Gui::LoadMessage(), p_ui, SendParentErrors(), ss, Isis::UserInterface::TheGui(), Isis::IException::toPvl(), Isis::IException::toString(), and Isis::Pvl::Write().
Referenced by Run(), and Isis::Gui::StartProcess().
| PvlGroup Isis::Application::GetEnviromentInfo | ( | ) | [static, private] |
Runs some printenv commands that return Isis related Enviroment Variables.
Definition at line 931 of file Application.cpp.
References Isis::PvlContainer::AddKeyword(), and Isis::ProgramLauncher::RunSystemCommand().
Referenced by FunctionCleanup(), and FunctionError().
| void* Isis::Application::GetGuiHelper | ( | QString | helper | ) | [inline] |
| helper |
Definition at line 140 of file Application.h.
Referenced by Isis::Gui::InvokeHelper().
| QString Isis::Application::GetLibraryDependencies | ( | QString | file | ) | [static, private] |
Runs ldd on linux and sun and otool on macs to get information about the applicaiton run.
Definition at line 1000 of file Application.cpp.
References results(), and Isis::ProgramLauncher::RunSystemCommand().
Referenced by FunctionCleanup(), and FunctionError().
| QString Isis::Application::GetSystemDiskSpace | ( | ) | [static, private] |
Runs df to see the disk space availability.
Definition at line 973 of file Application.cpp.
References results(), and Isis::ProgramLauncher::RunSystemCommand().
Referenced by FunctionCleanup(), and FunctionError().
| PvlGroup Isis::Application::GetUnameInfo | ( | ) | [static, private] |
Runs various system specific uname commands and returns the results.
Definition at line 851 of file Application.cpp.
References Isis::PvlContainer::AddKeyword(), and Isis::ProgramLauncher::RunSystemCommand().
Referenced by FunctionCleanup(), and FunctionError().
| Isis::UserInterface & Isis::Application::GetUserInterface | ( | ) | [static] |
Returns the UserInterface object.
Definition at line 469 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::Process::SetInputCube(), Isis::Pipeline::SetInputFile(), Isis::Pipeline::SetInputListFile(), Isis::ProcessExport::SetInputRange(), Isis::ProcessPolygons::SetOutputCube(), Isis::ProcessMosaic::SetOutputCube(), Isis::ProcessImport::SetOutputCube(), Isis::ProcessGroundPolygons::SetOutputCube(), Isis::Process::SetOutputCube(), Isis::Pipeline::SetOutputFile(), Isis::Pipeline::SetOutputListFile(), Isis::Gui::ShowWarning(), Isis::Gui::StartProcess(), Isis::Gui::StopProcessing(), Isis::Gui::UpdateCommandLine(), and Isis::Gui::UpdateHistory().
| void Isis::Application::GuiLog | ( | const QString & | results | ) | [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 451 of file Application.cpp.
References GetUserInterface(), HasParent(), Isis::UserInterface::IsInteractive(), Isis::Gui::Log(), SendParentData(), and Isis::UserInterface::TheGui().
| void Isis::Application::GuiLog | ( | const PvlGroup & | results | ) | [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 426 of file Application.cpp.
References GetUserInterface(), HasParent(), Isis::UserInterface::IsInteractive(), Isis::Gui::Log(), SendParentData(), and Isis::UserInterface::TheGui().
| void Isis::Application::GuiLog | ( | const Pvl & | results | ) | [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 401 of file Application.cpp.
References GetUserInterface(), HasParent(), Isis::UserInterface::IsInteractive(), Isis::Gui::Log(), SendParentData(), and Isis::UserInterface::TheGui().
Referenced by Isis::ProgramLauncher::ProcessIsisMessageFromChild(), and Isis::GuiCubeParameter::ViewLabel().
| 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 715 of file Application.cpp.
References exit(), Isis::Gui::LoadMessage(), p_ui, Isis::Gui::ProgressText(), Isis::Gui::ShowWarning(), Isis::UserInterface::TheGui(), and Isis::IException::toString().
Referenced by Isis::Gui::InvokeHelper(), Isis::GuiCubeParameter::ViewCube(), and Isis::GuiCubeParameter::ViewLabel().
| bool Isis::Application::HasParent | ( | ) | [static] |
Returns whether the application has a parent or not.
Definition at line 478 of file Application.cpp.
References p_ui, and Isis::UserInterface::ParentId().
Referenced by FunctionCleanup(), FunctionError(), GuiLog(), Log(), SendParentErrors(), and UpdateProgress().
| PvlObject Isis::Application::History | ( | ) |
Creates an application history PvlObject.
Definition at line 258 of file Application.cpp.
References IsisAml::Brief(), IsisAml::CommandLine(), DateTime(), HostName(), Isis::UserInterface::IsInteractive(), p_ui, IsisAml::ProgramName(), UserName(), IsisAml::Version(), and Version().
Referenced by Isis::History::AddEntry().
| QString Isis::Environment::hostName | ( | ) | [static, inherited] |
Definition at line 71 of file Environment.cpp.
References Isis::Environment::getEnvironmentValue().
Referenced by HostName().
| QString Isis::Application::HostName | ( | ) | [static] |
Returns the host name.
Returns 'Unknown' if it cannot find the host name.
Definition at line 832 of file Application.cpp.
References Isis::Environment::hostName().
Referenced by History().
| QString Isis::Environment::isisVersion | ( | ) | [static, inherited] |
Definition at line 99 of file Environment.cpp.
References _FILEINFO_, Isis::TextFile::GetLine(), and Isis::IException::Programmer.
Referenced by Version().
| void Isis::Application::Log | ( | PvlGroup & | results | ) | [static] |
Writes Pvl results to sessionlog and printfile.
| results | PvlGroup of results to add to the session log |
Definition at line 361 of file Application.cpp.
References GetUserInterface(), HasParent(), Isis::UserInterface::IsInteractive(), Isis::Gui::Log(), SendParentData(), and Isis::UserInterface::TheGui().
Referenced by Isis::BundleAdjust::IterationSummary(), and Isis::ProgramLauncher::ProcessIsisMessageFromChild().
| QString Isis::Application::Name | ( | ) | [static] |
Returns the name of the application.
Returns 'Unknown' if the application or gui equal NULL
Definition at line 736 of file Application.cpp.
Referenced by Isis::ControlMeasure::GetChooserName(), and Isis::IException::toPvl().
| int Isis::Application::PageFaults | ( | ) | [private] |
Returns the current number of faults.
Definition at line 343 of file Application.cpp.
Referenced by Application(), and Run().
| void Isis::Application::ProcessGuiEvents | ( | ) | [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 793 of file Application.cpp.
References Isis::UserInterface::IsInteractive(), p_ui, Isis::Gui::ProcessEvents(), and Isis::UserInterface::TheGui().
Referenced by Isis::Progress::CheckStatus(), and UpdateProgress().
| int Isis::Application::ProcessSwaps | ( | ) | [private] |
Returns the current number of swaps.
Definition at line 352 of file Application.cpp.
Referenced by Application(), and Run().
| void Isis::Application::RegisterGuiHelpers | ( | std::map< QString, void * > | helpers | ) | [inline] |
| int Isis::Application::Run | ( | void(*)() | funct | ) |
Runs the program defined in the function funct.
| *funct |
Definition at line 185 of file Application.cpp.
References _FILEINFO_, Isis::UserInterface::AbortOnError(), Isis::UserInterface::BatchListSize(), DateTime(), DirectIO(), Isis::Gui::Exec(), FunctionCleanup(), FunctionError(), Isis::UserInterface::IsInteractive(), p_ui, PageFaults(), ProcessSwaps(), Isis::UserInterface::SaveHistory(), Isis::UserInterface::SetBatchList(), Isis::UserInterface::SetErrorList(), Isis::UserInterface::TheGui(), and IsisAml::VerifyAll().
Referenced by main().
| void Isis::Application::SendParentData | ( | QString | code, | |
| const QString & | message | |||
| ) | [private] |
| code | ||
| message |
Definition at line 506 of file Application.cpp.
References _FILEINFO_, GetUserInterface(), Isis::UserInterface::ParentId(), Isis::toString(), and Isis::IException::Unknown.
Referenced by FunctionCleanup(), GuiLog(), Log(), SendParentErrors(), and UpdateProgress().
| void Isis::Application::SendParentErrors | ( | Isis::PvlObject & | errors | ) | [private] |
Sends errors to the parent.
| &errors | A PvlObject of the errors |
Definition at line 490 of file Application.cpp.
References Isis::PvlObject::Group(), Isis::PvlObject::Groups(), HasParent(), and SendParentData().
Referenced by FunctionError().
| void Isis::Application::SetParentConnection | ( | QLocalSocket * | p_connection | ) | [inline, private] |
| p_connection |
Definition at line 192 of file Application.h.
| void Isis::Application::UpdateProgress | ( | int | percent, | |
| bool | ||||
| ) | [private] |
Updates the progress bar percent.
| percent | The percent of the application that is complete | |
Definition at line 769 of file Application.cpp.
References HasParent(), Isis::UserInterface::IsInteractive(), p_ui, Isis::Gui::Progress(), SendParentData(), Isis::UserInterface::TheGui(), and Isis::toString().
| void Isis::Application::UpdateProgress | ( | const QString & | text, | |
| bool | ||||
| ) | [private] |
Updates the progress bar in the gui.
| text | Progress text | |
Definition at line 747 of file Application.cpp.
References HasParent(), Isis::UserInterface::IsInteractive(), p_ui, ProcessGuiEvents(), IsisAml::ProgramName(), Isis::Gui::ProgressText(), SendParentData(), and Isis::UserInterface::TheGui().
Referenced by Isis::Progress::CheckStatus(), and Isis::ProgramLauncher::ProcessIsisMessageFromChild().
| QString Isis::Environment::userName | ( | ) | [static, inherited] |
the user name.
Returns 'Unknown' if it cannot find the user name.
Definition at line 63 of file Environment.cpp.
References Isis::Environment::getEnvironmentValue().
Referenced by UserName().
| QString Isis::Application::UserName | ( | ) | [static] |
Returns the user name.
Returns 'Unknown' if it cannot find the user name.
Definition at line 823 of file Application.cpp.
References Isis::Environment::userName().
Referenced by Application(), Isis::StereoTool::createPoint(), Isis::MatchTool::createPoint(), History(), Isis::MatchTool::measureSaved(), Isis::SocketThread::run(), Isis::ProgramLauncher::RunIsisProgram(), and Isis::ControlPointEdit::saveMeasure().
| QString Isis::Application::Version | ( | ) | [static] |
The Isis Version for this application.
Definition at line 841 of file Application.cpp.
References Isis::Environment::isisVersion().
Referenced by History().
UserInterface* Isis::Application::p_ui [private] |
Pointer to a User Interface object.
Definition at line 169 of file Application.h.
Referenced by Application(), FunctionCleanup(), FunctionError(), GetUserInterface(), GuiReportError(), HasParent(), History(), ProcessGuiEvents(), Run(), UpdateProgress(), and ~Application().