setiloc.h
Go to the documentation of this file.00001
00014 #ifndef SETILOC_H
00015 #define SETILOC_H
00016
00017 #include <kprocess.h>
00018
00019 #include <qstring.h>
00020 #include <qcolor.h>
00021
00022 #include "seticontainer.h"
00023
00024 class SetiGraph;
00025 class KTextBrowser;
00026
00028 struct LocSettings {
00030 QString description;
00032 QString directory;
00036 bool useCustomStartExe;
00042 QString customStartExe;
00046 bool useCustomStopExe;
00052 QString customStopExe;
00054 QColor color;
00057 QString arguments;
00060 bool startSeti;
00063 bool stopSeti;
00066 bool keepClientAlive;
00068 bool log;
00073 bool redirectLog;
00076 QString logDirectory;
00079 bool stopAfterProcess;
00082 bool stopAfterSend;
00085 bool email;
00088 bool graphics;
00092 int priority;
00095 bool useProxy;
00098 QString proxyServer;
00100 int proxyPort;
00101 };
00102
00117 class SetiLoc : public SetiContainer
00118 {
00119 Q_OBJECT
00120
00121 public:
00128 SetiLoc(const QString& dir = QString::null,
00129 const QString& loc = QString::null,
00130 const QColor& col = QColor::QColor(Qt::red));
00132 ~SetiLoc();
00139 const QString& id() const;
00144 void setOptions(const LocSettings& ls);
00146 LocSettings options() const {return(sets);}
00148 QString description() const {return sets.description;}
00150 QColor color() const {return sets.color;}
00153 bool optionStartSeti() const {return sets.startSeti;}
00156 bool optionStopSeti() const {return sets.stopSeti;}
00159 bool optionKeepClientAlive() const {return sets.keepClientAlive;}
00166 void setTimestamp(const QString& ts) {sresult_timestamp = ts;}
00168 QString timestamp() const {return sresult_timestamp;}
00170 QString logDirectory();
00172 enum GraphIds {GaussianGraph, PulseGraph, TripletGraph, ClientOutput};
00177 void showGraph(int id);
00182 bool isGraphVisible(int id) const {return(graphwidget[id] != 0);}
00187 bool startClient();
00194 int stopClient();
00196 bool isStoppedNormally() {return(stoppedNormally);}
00199 void initMaxScore();
00204 void setMaxScore(const WUScore& score) {mymax = score;}
00207 const WUScore& maxScore() const {return(mymax);}
00213 void storeTripletData(const TripletScore& triplet);
00220 void checkWUStatus();
00237 static SpikeScore loggedSpikeSignal(QString& line);
00247 static GaussianScore loggedGaussianSignal(QString& line);
00257 static PulseScore loggedPulseSignal(QString& line);
00267 static TripletScore loggedTripletSignal(QString& line);
00268
00269 protected:
00275 void logWorkUnit();
00288 QString constructEntry(const QString& entry, int type);
00296 void logResults();
00308 QString loggedTripletProfile(const QString& tdata);
00319 static int calcGaussianFFTIndex(GaussianScore* g);
00320
00321 protected slots:
00332 void slotInitMaxScore(WorkUnitData wud);
00334 void slotDumpClientOutput(KProcess*, char*, int);
00335
00336 protected:
00338 QString thisId;
00340 LocSettings sets;
00343 QString sresult_timestamp;
00345 KProcess client;
00347 KProcess stopProc;
00349 WUScore mymax;
00350 SetiGraph* graphwidget[3];
00352 KTextBrowser* clientOutput;
00355 bool stoppedNormally;
00356
00357 signals:
00365 void newWorkUnit(WorkUnitData wud, const QString& locname,
00366 const QColor& col);
00370 void workUnitLogged(SetiLoc* loc);
00371
00372 };
00373
00374 #endif
This file is part of the documentation for Ksetiwatch API Version 2.6.1.