Isis 3 Programmer Reference
UserInterface.h
1 #ifndef UserInterface_h
2 #define UserInterface_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include "FileName.h"
10 #include "Gui.h"
11 #include "IsisAml.h"
12 #include "PvlTokenizer.h"
13 
14 class Gui;
15 
16 namespace Isis {
140  class UserInterface : public IsisAml {
141  public:
142  UserInterface(const QString &xmlfile, int &argc, char *argv[]);
143  UserInterface(const QString &xmlfile, QVector<QString> &args);
144  ~UserInterface();
145 
152  bool AbortOnError() {
153  return p_abortOnError;
154  };
155 
163  return p_batchList.size();
164  };
165 
171  bool IsInteractive() {
172  return p_gui != NULL;
173  };
174 
180  int ParentId() {
181  return p_parentId;
182  };
183 
187  Gui *TheGui() {
188  return p_gui;
189  };
190 
191  QString GetInfoFileName();
192  bool GetInfoFlag();
193 
194  void SetBatchList(int i);
195  void SetErrorList(int i);
196 
197  void SaveHistory();
198 
199  private:
200  void loadBatchList(const QString file);
201  void loadCommandLine(QVector<QString> &args, bool ignoreAppName=true);
202 
203  void loadCommandLine(int argc, char *argv[]);
204  void loadHistory(const QString file);
205 
206  void evaluateOption(const QString name, const QString value);
207  void getNextParameter(unsigned int &curPos,
208  QString &unresolvedParam,
209  std::vector<QString> &value);
210  void preProcess(QString fullReservedName, std::vector<QString> &reservedParams);
211  std::vector<QString> readArray(QString arrayString);
212  QString resolveParameter(QString &name,
213  std::vector<QString> &reservedParams,
214  bool handleNoMatches = true);
215 
219  std::vector<std::vector<QString> > p_batchList;
221  std::vector<char *> p_cmdline;
223  QString p_errList;
227  bool p_info;
229  QString p_infoFileName;
235  QString p_progName;
237  QString p_saveFile;
238  };
239 };
240 
241 #endif
Isis::UserInterface::IsInteractive
bool IsInteractive()
Indicates if the Isis Graphical User Interface is operating.
Definition: UserInterface.h:171
Isis::UserInterface::GetInfoFileName
QString GetInfoFileName()
This method returns the filename where the debugging info is stored when the "-info" tag is used.
Definition: UserInterface.cpp:119
Isis::UserInterface::evaluateOption
void evaluateOption(const QString name, const QString value)
This interprets the "-" options for reserved parameters.
Definition: UserInterface.cpp:649
Isis::UserInterface::p_errList
QString p_errList
FileName to write batchlist line that caused error on.
Definition: UserInterface.h:223
Isis::UserInterface::p_info
bool p_info
Boolean value representing if it's in debug mode.
Definition: UserInterface.h:227
Isis::UserInterface::SetErrorList
void SetErrorList(int i)
This method adds the line specified in the BatchList that the error occured on.
Definition: UserInterface.cpp:234
Isis::UserInterface::p_batchList
std::vector< std::vector< QString > > p_batchList
Vector of batchlist data.
Definition: UserInterface.h:219
Isis::UserInterface::p_interactive
bool p_interactive
Boolean value representing whether the program is interactive or not.
Definition: UserInterface.h:231
Isis::UserInterface::ParentId
int ParentId()
Returns the parent id.
Definition: UserInterface.h:180
Isis::UserInterface::GetInfoFlag
bool GetInfoFlag()
This method returns the flag state of info.
Definition: UserInterface.cpp:130
Isis::Gui
Gui for Isis Applications.
Definition: Gui.h:73
Isis::UserInterface::p_infoFileName
QString p_infoFileName
FileName to save debugging info.
Definition: UserInterface.h:229
Isis::UserInterface::readArray
std::vector< QString > readArray(QString arrayString)
This interprets an array value from the command line.
Definition: UserInterface.cpp:1067
Isis::UserInterface::loadBatchList
void loadBatchList(const QString file)
Loads the user entered batchlist file into a private variable for later use.
Definition: UserInterface.cpp:322
Isis::UserInterface::BatchListSize
int BatchListSize()
Returns the size of the batchlist.
Definition: UserInterface.h:162
Isis::UserInterface::p_parentId
int p_parentId
This is a status to indicate if the GUI is running or not.
Definition: UserInterface.h:233
Isis::UserInterface::~UserInterface
~UserInterface()
Destroys the UserInterface object.
Definition: UserInterface.cpp:105
Isis::UserInterface::p_gui
Gui * p_gui
Pointer to the gui object.
Definition: UserInterface.h:225
Isis::UserInterface::loadCommandLine
void loadCommandLine(QVector< QString > &args, bool ignoreAppName=true)
This is used to load the command line into p_cmdline and the Aml object using information contained i...
Definition: UserInterface.cpp:390
Isis::UserInterface::p_progName
QString p_progName
Name of program to run.
Definition: UserInterface.h:235
IsisAml
Application program XML file parameter manager.
Definition: IsisAml.h:138
Isis::UserInterface::SetBatchList
void SetBatchList(int i)
Clears the gui parameters and sets the batch list information at line i as the new parameters.
Definition: UserInterface.cpp:143
Isis::UserInterface::p_cmdline
std::vector< char * > p_cmdline
This variable will contain argv.
Definition: UserInterface.h:221
Isis::UserInterface::AbortOnError
bool AbortOnError()
Returns true if the program should abort on error, and false if it should continue.
Definition: UserInterface.h:152
Isis::UserInterface::getNextParameter
void getNextParameter(unsigned int &curPos, QString &unresolvedParam, std::vector< QString > &value)
This gets the next parameter in the list of arguments.
Definition: UserInterface.cpp:934
Isis::UserInterface::preProcess
void preProcess(QString fullReservedName, std::vector< QString > &reservedParams)
This parses the command line and looks for the specified reserved parameter name passed.
Definition: UserInterface.cpp:1021
Isis::UserInterface::p_saveFile
QString p_saveFile
FileName to save last history to.
Definition: UserInterface.h:237
Isis::UserInterface::TheGui
Gui * TheGui()
Definition: UserInterface.h:187
Isis::UserInterface::SaveHistory
void SaveHistory()
Saves the user parameter information in the history of the program for later use.
Definition: UserInterface.cpp:261
Isis::UserInterface
Command Line and Xml loader, validation, and access.
Definition: UserInterface.h:140
Isis::UserInterface::resolveParameter
QString resolveParameter(QString &name, std::vector< QString > &reservedParams, bool handleNoMatches=true)
This resolves a reserved parameter token on the command line to its fullname.
Definition: UserInterface.cpp:1194
Isis::UserInterface::p_abortOnError
bool p_abortOnError
Boolean value representing whether to abort or continue on error.
Definition: UserInterface.h:217
Isis::UserInterface::UserInterface
UserInterface(const QString &xmlfile, int &argc, char *argv[])
Constructs an UserInterface object.
Definition: UserInterface.cpp:71
QVector< QString >
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::UserInterface::loadHistory
void loadHistory(const QString file)
Loads the previous history for the program.
Definition: UserInterface.cpp:550