Isis 3 Programmer Reference
UserInterface.h
Go to the documentation of this file.
1 #ifndef UserInterface_h
2 #define UserInterface_h
3 
25 #include "FileName.h"
26 #include "Gui.h"
27 #include "IsisAml.h"
28 #include "PvlTokenizer.h"
29 
30 class Gui;
31 
32 namespace Isis {
155  class UserInterface : public IsisAml {
156  public:
157  UserInterface(const QString &xmlfile, int &argc, char *argv[]);
158  ~UserInterface();
159 
166  bool AbortOnError() {
167  return p_abortOnError;
168  };
169 
177  return p_batchList.size();
178  };
179 
185  bool IsInteractive() {
186  return p_gui != NULL;
187  };
188 
194  int ParentId() {
195  return p_parentId;
196  };
197 
201  Gui *TheGui() {
202  return p_gui;
203  };
204 
205  QString GetInfoFileName();
206  bool GetInfoFlag();
207 
208  void SetBatchList(int i);
209  void SetErrorList(int i);
210 
211  void SaveHistory();
212 
213  private:
214  void loadBatchList(const QString file);
215  void loadCommandLine(int argc, char *argv[]);
216  void loadHistory(const QString file);
217 
218  void evaluateOption(const QString name, const QString value);
219  void getNextParameter(unsigned int &curPos,
220  QString &unresolvedParam,
221  std::vector<QString> &value);
222  void preProcess(QString fullReservedName, std::vector<QString> &reservedParams);
223  std::vector<QString> readArray(QString arrayString);
224  QString resolveParameter(QString &name,
225  std::vector<QString> &reservedParams,
226  bool handleNoMatches = true);
227 
231  std::vector<std::vector<QString> > p_batchList;
233  std::vector<char *> p_cmdline;
235  QString p_errList;
239  bool p_info;
241  QString p_infoFileName;
247  QString p_progName;
249  QString p_saveFile;
250  };
251 };
252 
253 #endif
bool IsInteractive()
Indicates if the Isis Graphical User Interface is operating.
QString resolveParameter(QString &name, std::vector< QString > &reservedParams, bool handleNoMatches=true)
This resolves a reserved parameter token on the command line to its fullname.
void loadHistory(const QString file)
Loads the previous history for the program.
int BatchListSize()
Returns the size of the batchlist.
int p_parentId
This is a status to indicate if the GUI is running or not.
Gui * p_gui
Pointer to the gui object.
QString GetInfoFileName()
This method returns the filename where the debugging info is stored when the "-info" tag is used...
QString p_saveFile
FileName to save last history to.
std::vector< char * > p_cmdline
This variable will contain argv.
void SaveHistory()
Saves the user parameter information in the history of the program for later use. ...
void evaluateOption(const QString name, const QString value)
This interprets the "-" options for reserved parameters.
int ParentId()
Returns the parent id.
QString p_infoFileName
FileName to save debugging info.
void loadBatchList(const QString file)
Loads the user entered batchlist file into a private variable for later use.
bool GetInfoFlag()
This method returns the flag state of info.
std::vector< std::vector< QString > > p_batchList
Vector of batchlist data.
~UserInterface()
Destroys the UserInterface object.
bool p_interactive
Boolean value representing whether the program is interactive or not.
void loadCommandLine(int argc, char *argv[])
This is used to load the command line into p_cmdline and the Aml object using information contained i...
QString p_progName
Name of program to run.
Application program XML file parameter manager.
Definition: IsisAml.h:154
QString p_errList
FileName to write batchlist line that caused error on.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Command Line and Xml loader, validation, and access.
bool p_info
Boolean value representing if it&#39;s in debug mode.
bool AbortOnError()
Returns true if the program should abort on error, and false if it should continue.
std::vector< QString > readArray(QString arrayString)
This interprets an array value from the command line.
void SetBatchList(int i)
Clears the gui parameters and sets the batch list information at line i as the new parameters...
void SetErrorList(int i)
This method adds the line specified in the BatchList that the error occured on.
void getNextParameter(unsigned int &curPos, QString &unresolvedParam, std::vector< QString > &value)
This gets the next parameter in the list of arguments.
void preProcess(QString fullReservedName, std::vector< QString > &reservedParams)
This parses the command line and looks for the specified reserved parameter name passed.
bool p_abortOnError
Boolean value representing whether to abort or continue on error.
Gui for Isis Applications.
Definition: Gui.h:90
UserInterface(const QString &xmlfile, int &argc, char *argv[])
Constructs an UserInterface object.