VHISTlib  1.84.0.3018
/daten/ahuesgen/projects/vhist/code/vhistlib/include/vhistaddlib/vhistrunner.h
00001 /* $HEADERS
00002  $Id: vhistrunner.h 2179 2011-06-24 09:03:24Z ahuesgen $
00003  */
00004 
00005 #ifndef VL_VHISTRUNNER_INCLUDED
00006 #define VL_VHISTRUNNER_INCLUDED
00007 
00008 
00009 #include "../shared/misc_defines.h"
00010 #include "../shared/logsource.h"
00011 
00012 #include <QString>
00013 #include <QStringList>
00014 
00015 
00016 namespace vhist
00017 {
00018 
00024 class VHIST_EXTERN VhistRunner : public LogSource
00025 {
00026     public:
00027     Q_OBJECT
00028     
00029     public:
00033         enum VHISTADD_ERROR
00034         {
00036             VHISTADD_NOT_FOUND = -1000,
00038             VHISTADD_FAILED_TO_START = -1001
00039         };
00040     
00041     public:
00042         VhistRunner(const QString &vhistrunstump, QObject* listener = NULL);
00043         virtual ~VhistRunner();
00044     
00045     public:
00046         void setSearchPaths(const QStringList& paths);
00047         void setUsePy2Exe(bool state);
00048     
00049     public:
00050         QString findPython();
00051         QString findVhistrun();
00052 
00053         bool getUsePy2Exe() const
00054             {return m_usePy2Exe; }
00055         void clearOutputRest()
00056             {m_outputRest.clear(); }
00057         void processOutputLine(const QString& line);
00058         void processOutput(const QString& output, bool finish = false);
00059         
00060         virtual int runProcess(const QString& argfile) = 0;
00061     
00062     signals:
00063         void intercept();
00064     
00065     private:
00066         QString searchInPath(const QString& path, const QString& file);
00067     
00068     private:
00069         QString m_vhistrun;
00070         QString m_vhistrunstump;
00071         QString m_outputRest;
00072     
00073     private:
00074         bool m_usePy2Exe;
00075         QStringList m_searchPaths;
00076 };
00077 
00078 }
00079 
00080 #endif // VL_VHISTRUNNER_INCLUDED
00081 

VHISTlib 1.84.0.3018 of Jun 28 2013, generated by doxygen.