Subversion Repositories OpenInventory

Rev

Rev 242 | Rev 248 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
239 pingvin 1
#ifndef WMITHREAD_H
2
#define WMITHREAD_H
3
 
4
#include <QThread>
5
#include <QProcess>
6
#include <QMutex>
242 pingvin 7
#include <QDebug>
243 pingvin 8
#include <QEventLoop>
9
#include "woker.h"
239 pingvin 10
 
11
class WmiThread : public QThread
12
{
13
    Q_OBJECT
14
public:
15
    explicit WmiThread(QObject *parent = 0);
16
    void run();
17
    void stop();
18
    void setHost(QString new_host){host = new_host;}
19
    void setUser(QString new_user){user_name = new_user;}
20
    void setPassword(QString new_password){password = new_password;}
21
    QByteArray buffer(){return p_buffer;}
22
    void clearBuffer(){p_buffer.clear();}
241 pingvin 23
    bool isError(){return error;}
242 pingvin 24
    bool isStopped(){
25
        mutex.lock();
26
        return stopped;
27
        mutex.unlock();
28
 
29
                        };
241 pingvin 30
    void setWmiString(QString new_wmi_string){wmi_string = new_wmi_string;}
243 pingvin 31
volatile bool stopped;
239 pingvin 32
private:
243 pingvin 33
 
239 pingvin 34
    volatile bool error;
243 pingvin 35
 
242 pingvin 36
   QProcess process;
239 pingvin 37
    QString host;
38
    QString user_name;
39
    QString password;
40
    QMutex mutex;
41
    QByteArray p_buffer; //   ,       ()
241 pingvin 42
    QString wmi_string;  //   wmi-
239 pingvin 43
 
44
signals:
45
 
46
public slots:
241 pingvin 47
    void readStandartProcessOutput();
48
    void readStandartProcessError();
243 pingvin 49
    void wokerIsStopped();
239 pingvin 50
 
51
private slots:
52
 
53
 
241 pingvin 54
 
239 pingvin 55
};
56
 
57
#endif // WMITHREAD_H