Subversion Repositories OpenInventory

Rev

Rev 241 | Rev 243 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

#ifndef WMITHREAD_H
#define WMITHREAD_H

#include <QThread>
#include <QProcess>
#include <QMutex>
#include <QDebug>

class WmiThread : public QThread
{
    Q_OBJECT
public:
    explicit WmiThread(QObject *parent = 0);
    void run();
    void stop();
    void setHost(QString new_host){host = new_host;}
    void setUser(QString new_user){user_name = new_user;}
    void setPassword(QString new_password){password = new_password;}
    QByteArray buffer(){return p_buffer;}
    void clearBuffer(){p_buffer.clear();}
    bool isError(){return error;}
    bool isStopped(){
        mutex.lock();
        return stopped;
        mutex.unlock();

                        };
    void setWmiString(QString new_wmi_string){wmi_string = new_wmi_string;}
private:
    volatile bool stopped;
    volatile bool error;
   QProcess process;
    QString host;
    QString user_name;
    QString password;
    QMutex mutex;
    QByteArray p_buffer; //çäåñü áóäåì õðàíèòü äàííûå, ñ÷èòàííûå èç ñòàíäàðòíîãî ïîòîêà äëÿ ÷òåíèÿ (ïðîöåññà)
    QString wmi_string;  //çäåñü áóäåì õðàíèòü wmi-çàïðîñ

signals:

public slots:
    void readStandartProcessOutput();
    void readStandartProcessError();

private slots:



};

#endif // WMITHREAD_H