source: src-qt4/life-preserver/LPWatcher.h @ 559e01f

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1
Last change on this file since 559e01f was 559e01f, checked in by Ken Moore <ken@…>, 15 months ago

Clean up LPWatcher so that it now compiles in with life-preserver. It should be ready for drop-in testing within LPTray.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1#ifndef _LP_WATCHER_H
2#define _LP_WATCHER_H
3
4#include <QObject>
5#include <QFileSystemWatcher>
6#include <QStringList>
7#include <QString>
8#include <QHash>
9#include <QTimer>
10#include <QFile>
11#include <QTextStream>
12#include <QDebug>
13
14class LPWatcher : public QObject{
15        Q_OBJECT
16public:
17        LPWatcher();
18        ~LPWatcher();
19
20        QStringList getMessages(QString type, QStringList msgList);
21        //Valid types - "critical"/"running"/"message"
22        //Valid messages - "dataset","message","summary","id", "timestamp", "time"
23
24public slots:
25        void start();
26        void stop();
27
28private:
29        //Internal paths for the lpreserver output files
30        QString FILE_LOG, FILE_ERROR, FILE_REPLICATION;
31        //Internal message Logs
32        QHash<unsigned int,QString> LOGS;
33        //File system watcher
34        QFileSystemWatcher *watcher;
35        QTimer *timer;
36        QFile *logfile, *repfile;
37        QTextStream *LFSTREAM, *RFSTREAM;
38        //Replication size variables
39        QString repTotK, lastSize;
40
41        void readLogFile(bool quiet = false);
42        void readReplicationFile(bool quiet = false);
43
44        void startRepFileWatcher();
45        void stopRepFileWatcher();
46
47        double displayToDoubleK(QString); // string->double conversion
48
49private slots:
50        void fileChanged(QString); //file system watcher saw a change
51        void checkErrorFile(); //check for serious system error file
52
53signals:
54        void CriticalMessageAvailable();
55        void ProcessUpdateAvailable();
56        void NotificationMessageAvailable();
57};
58
59#endif
Note: See TracBrowser for help on using the repository browser.