|
@@ -10,6 +10,7 @@
|
|
#include <QAbstractItemModel>
|
|
#include <QAbstractItemModel>
|
|
#include <QModelIndex>
|
|
#include <QModelIndex>
|
|
#include <QVector>
|
|
#include <QVector>
|
|
|
|
+#include <QProcess>
|
|
#include <vector>
|
|
#include <vector>
|
|
#include <gfa/gfaipc.h>
|
|
#include <gfa/gfaipc.h>
|
|
#include <gfa/ipcpriv.h>
|
|
#include <gfa/ipcpriv.h>
|
|
@@ -82,7 +83,7 @@ public:
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
|
|
QHash<int, QByteArray> roleNames(void) const Q_DECL_OVERRIDE;
|
|
QHash<int, QByteArray> roleNames(void) const Q_DECL_OVERRIDE;
|
|
-
|
|
|
|
|
|
+
|
|
void diskAdded(int nIndex, const GFA_SYSINFO_DISK &disk);
|
|
void diskAdded(int nIndex, const GFA_SYSINFO_DISK &disk);
|
|
void diskRemoved(int nIndex, const GFA_SYSINFO_DISK &disk);
|
|
void diskRemoved(int nIndex, const GFA_SYSINFO_DISK &disk);
|
|
void partitionAdded(int nIndex, const GFA_SYSINFO_PARTITION &part);
|
|
void partitionAdded(int nIndex, const GFA_SYSINFO_PARTITION &part);
|
|
@@ -101,7 +102,7 @@ private:
|
|
private:
|
|
private:
|
|
GFA_SYSINFO_STORAGE_DEVICE_MAP m_stgDevShadowCpy;
|
|
GFA_SYSINFO_STORAGE_DEVICE_MAP m_stgDevShadowCpy;
|
|
std::vector<STG_DEV_DISK_PART> m_partVec;
|
|
std::vector<STG_DEV_DISK_PART> m_partVec;
|
|
-
|
|
|
|
|
|
+
|
|
static const STG_DEV_ROLES m_roles[];
|
|
static const STG_DEV_ROLES m_roles[];
|
|
};
|
|
};
|
|
|
|
|
|
@@ -199,7 +200,7 @@ class QGfaMySqlInfo : public QObject
|
|
public:
|
|
public:
|
|
explicit QGfaMySqlInfo(QObject *pParent = NULL);
|
|
explicit QGfaMySqlInfo(QObject *pParent = NULL);
|
|
virtual ~QGfaMySqlInfo(void);
|
|
virtual ~QGfaMySqlInfo(void);
|
|
-
|
|
|
|
|
|
+
|
|
void onMySqlInitEvent(bool bInit);
|
|
void onMySqlInitEvent(bool bInit);
|
|
void onMySqlServerEvent(const GFA_MYSQL_SERVER &svr);
|
|
void onMySqlServerEvent(const GFA_MYSQL_SERVER &svr);
|
|
void onMySqlResourceEvent(const GFA_MYSQL_RESOURCE &res);
|
|
void onMySqlResourceEvent(const GFA_MYSQL_RESOURCE &res);
|
|
@@ -231,19 +232,19 @@ private:
|
|
|
|
|
|
bool svrInnoDbFilePerTableSpace(void) const;
|
|
bool svrInnoDbFilePerTableSpace(void) const;
|
|
void setSvrInnoDbFilePerTableSpace(bool val);
|
|
void setSvrInnoDbFilePerTableSpace(bool val);
|
|
-
|
|
|
|
|
|
+
|
|
qint32 svrPid(void) const;
|
|
qint32 svrPid(void) const;
|
|
void setSvrPid(pid_t val);
|
|
void setSvrPid(pid_t val);
|
|
-
|
|
|
|
|
|
+
|
|
quint64 svrUpTime(void) const;
|
|
quint64 svrUpTime(void) const;
|
|
void setSvrUpTime(time_t val);
|
|
void setSvrUpTime(time_t val);
|
|
-
|
|
|
|
|
|
+
|
|
quint64 svrDiscUsage(void) const;
|
|
quint64 svrDiscUsage(void) const;
|
|
void setSvrDiscUsage(size_t val);
|
|
void setSvrDiscUsage(size_t val);
|
|
-
|
|
|
|
|
|
+
|
|
QString svrVersion(void) const;
|
|
QString svrVersion(void) const;
|
|
void setSvrVersion(const char *val);
|
|
void setSvrVersion(const char *val);
|
|
-
|
|
|
|
|
|
+
|
|
QString svrDataDir(void) const;
|
|
QString svrDataDir(void) const;
|
|
void setSvrDataDir(const char *val);
|
|
void setSvrDataDir(const char *val);
|
|
|
|
|
|
@@ -270,7 +271,7 @@ private:
|
|
|
|
|
|
quint32 svrNumDataBases(void) const;
|
|
quint32 svrNumDataBases(void) const;
|
|
void setSvrNumDataBases(unsigned int val);
|
|
void setSvrNumDataBases(unsigned int val);
|
|
-
|
|
|
|
|
|
+
|
|
QGfaMySqlSchemaModel* schemaModel(void);
|
|
QGfaMySqlSchemaModel* schemaModel(void);
|
|
|
|
|
|
private:
|
|
private:
|
|
@@ -319,7 +320,7 @@ private:
|
|
int b2(void) const;
|
|
int b2(void) const;
|
|
int b3(void) const;
|
|
int b3(void) const;
|
|
QVariant addr(void) const;
|
|
QVariant addr(void) const;
|
|
-
|
|
|
|
|
|
+
|
|
void setAddress(const QVariant &addr);
|
|
void setAddress(const QVariant &addr);
|
|
void setB0(int b);
|
|
void setB0(int b);
|
|
void setB1(int b);
|
|
void setB1(int b);
|
|
@@ -405,7 +406,7 @@ class QDhcp : public QObject
|
|
public:
|
|
public:
|
|
explicit QDhcp(IFACE_INET_DHCP &itfd, NotificationSink ¬ifyer, QObject *pParent = 0);
|
|
explicit QDhcp(IFACE_INET_DHCP &itfd, NotificationSink ¬ifyer, QObject *pParent = 0);
|
|
virtual ~QDhcp(void);
|
|
virtual ~QDhcp(void);
|
|
-
|
|
|
|
|
|
+
|
|
void setDynamicAddr(const struct in_addr &addr, const struct in_addr &mask, bool bDelete);
|
|
void setDynamicAddr(const struct in_addr &addr, const struct in_addr &mask, bool bDelete);
|
|
|
|
|
|
private:
|
|
private:
|
|
@@ -421,11 +422,39 @@ private:
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
+class QManual : public QObject
|
|
|
|
+{
|
|
|
|
+ Q_OBJECT
|
|
|
|
+ Q_PROPERTY(QIPv4Address* ipAddress READ ipAddress CONSTANT)
|
|
|
|
+ Q_PROPERTY(QIPv4Address* netMask READ netMask CONSTANT)
|
|
|
|
+
|
|
|
|
+public:
|
|
|
|
+ explicit QManual(IFACE_INET_MANUAL &itfm, NotificationSink ¬ifyer, QObject *pParent = 0);
|
|
|
|
+ virtual ~QManual(void);
|
|
|
|
+
|
|
|
|
+ void setAddr(const struct in_addr &addr, const struct in_addr &mask, bool bDelete);
|
|
|
|
+
|
|
|
|
+private:
|
|
|
|
+ QIPv4Address* ipAddress(void);
|
|
|
|
+ QIPv4Address* netMask(void);
|
|
|
|
+
|
|
|
|
+private:
|
|
|
|
+ IFACE_INET_MANUAL &m_itfm;
|
|
|
|
+ struct in_addr m_addr;
|
|
|
|
+ struct in_addr m_mask;
|
|
|
|
+ QIPv4Address m_ipAddr; // dynamic address
|
|
|
|
+ QIPv4Address m_netMask; // dynamic mask
|
|
|
|
+ NotificationSink &m_rNotifyer;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
|
+
|
|
class QInet : public QObject
|
|
class QInet : public QObject
|
|
{
|
|
{
|
|
Q_OBJECT
|
|
Q_OBJECT
|
|
Q_PROPERTY(QStatic* stat READ stat CONSTANT)
|
|
Q_PROPERTY(QStatic* stat READ stat CONSTANT)
|
|
Q_PROPERTY(QDhcp* dhcp READ dhcp CONSTANT)
|
|
Q_PROPERTY(QDhcp* dhcp READ dhcp CONSTANT)
|
|
|
|
+ Q_PROPERTY(QManual* manu READ manu CONSTANT)
|
|
|
|
|
|
public:
|
|
public:
|
|
explicit QInet(ITF_IFACE_BLOCK &ifb, NotificationSink ¬ifyer, QObject *pParent = 0);
|
|
explicit QInet(ITF_IFACE_BLOCK &ifb, NotificationSink ¬ifyer, QObject *pParent = 0);
|
|
@@ -434,10 +463,12 @@ public:
|
|
public:
|
|
public:
|
|
QStatic* stat(void);
|
|
QStatic* stat(void);
|
|
QDhcp* dhcp(void);
|
|
QDhcp* dhcp(void);
|
|
|
|
+ QManual* manu(void);
|
|
|
|
|
|
private:
|
|
private:
|
|
QStatic m_static;
|
|
QStatic m_static;
|
|
QDhcp m_dhcp;
|
|
QDhcp m_dhcp;
|
|
|
|
+ QManual m_manual;
|
|
NotificationSink &m_rNotifyer;
|
|
NotificationSink &m_rNotifyer;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -475,13 +506,13 @@ public:
|
|
|
|
|
|
inline ITF_IFACE_BLOCK & getIface(void){
|
|
inline ITF_IFACE_BLOCK & getIface(void){
|
|
return m_ifb;}
|
|
return m_ifb;}
|
|
-
|
|
|
|
|
|
+
|
|
inline unsigned long getID(void) const {
|
|
inline unsigned long getID(void) const {
|
|
return m_ifb.id;}
|
|
return m_ifb.id;}
|
|
-
|
|
|
|
|
|
+
|
|
inline int getSelCfg(void) const {
|
|
inline int getSelCfg(void) const {
|
|
return m_selCfg;}
|
|
return m_selCfg;}
|
|
-
|
|
|
|
|
|
+
|
|
inline const char * getName(void) const {
|
|
inline const char * getName(void) const {
|
|
return m_ifb.cfgName.c_str();}
|
|
return m_ifb.cfgName.c_str();}
|
|
|
|
|
|
@@ -623,7 +654,7 @@ public:
|
|
|
|
|
|
private slots:
|
|
private slots:
|
|
void onValueChanged(const QVariant &val);
|
|
void onValueChanged(const QVariant &val);
|
|
-
|
|
|
|
|
|
+
|
|
private:
|
|
private:
|
|
QVector<QGfaNetInterfacesSchemaTreeItem*> m_childItems;
|
|
QVector<QGfaNetInterfacesSchemaTreeItem*> m_childItems;
|
|
QVector<QVariant> m_itemData;
|
|
QVector<QVariant> m_itemData;
|
|
@@ -698,7 +729,7 @@ class QNetworkInterfaces : public QObject,
|
|
Q_PROPERTY(int itfFilterMethod READ itfFilterMethod WRITE setItfFilterMethod NOTIFY itfFilterMethodChanged)
|
|
Q_PROPERTY(int itfFilterMethod READ itfFilterMethod WRITE setItfFilterMethod NOTIFY itfFilterMethodChanged)
|
|
Q_PROPERTY(bool ifUpDownInProgress READ ifUpDownInProgress CONSTANT)
|
|
Q_PROPERTY(bool ifUpDownInProgress READ ifUpDownInProgress CONSTANT)
|
|
Q_PROPERTY(QGfaNetInterfacesSchemaModel *schemaModel READ schemaModel CONSTANT)
|
|
Q_PROPERTY(QGfaNetInterfacesSchemaModel *schemaModel READ schemaModel CONSTANT)
|
|
-
|
|
|
|
|
|
+
|
|
public:
|
|
public:
|
|
explicit QNetworkInterfaces(QObject *pParent = 0);
|
|
explicit QNetworkInterfaces(QObject *pParent = 0);
|
|
virtual ~QNetworkInterfaces(void);
|
|
virtual ~QNetworkInterfaces(void);
|
|
@@ -730,19 +761,19 @@ public:
|
|
virtual void filterPropertyChanged(void) const;
|
|
virtual void filterPropertyChanged(void) const;
|
|
virtual void selConfigChanged(QInterface* pi, unsigned int cfgOld, unsigned int cfgNew);
|
|
virtual void selConfigChanged(QInterface* pi, unsigned int cfgOld, unsigned int cfgNew);
|
|
virtual int getInterfaceSelConfig(QInterface &ri);
|
|
virtual int getInterfaceSelConfig(QInterface &ri);
|
|
-
|
|
|
|
|
|
+
|
|
inline pid_t GetIfUpDownPid(void) const {
|
|
inline pid_t GetIfUpDownPid(void) const {
|
|
return m_ifUpDownPid;}
|
|
return m_ifUpDownPid;}
|
|
-
|
|
|
|
|
|
+
|
|
inline void SetIfUpDownPid(pid_t pid){
|
|
inline void SetIfUpDownPid(pid_t pid){
|
|
m_ifUpDownPid = pid;}
|
|
m_ifUpDownPid = pid;}
|
|
-
|
|
|
|
|
|
+
|
|
inline bool GetIfUpDownInProgress(void) const {
|
|
inline bool GetIfUpDownInProgress(void) const {
|
|
return m_bIfUpDownInProgress;}
|
|
return m_bIfUpDownInProgress;}
|
|
-
|
|
|
|
|
|
+
|
|
inline void SetIfUpDownInProgress(bool bVal){
|
|
inline void SetIfUpDownInProgress(bool bVal){
|
|
m_bIfUpDownInProgress = bVal;}
|
|
m_bIfUpDownInProgress = bVal;}
|
|
-
|
|
|
|
|
|
+
|
|
bool SetInterlockedIfUpDownInProgress(void);
|
|
bool SetInterlockedIfUpDownInProgress(void);
|
|
|
|
|
|
signals:
|
|
signals:
|
|
@@ -773,7 +804,7 @@ private:
|
|
static void onIfDownCompleted(int nExitCode, void *pCtx);
|
|
static void onIfDownCompleted(int nExitCode, void *pCtx);
|
|
static void onIfRestartCompleted(int nExitCode, void *pCtx);
|
|
static void onIfRestartCompleted(int nExitCode, void *pCtx);
|
|
static void onStaticNetmonEvent(unsigned int nEvtType, const void *pData, LPCRT_ATTRIBUTE pAtts, size_t nMaxAtts, void *pParam);
|
|
static void onStaticNetmonEvent(unsigned int nEvtType, const void *pData, LPCRT_ATTRIBUTE pAtts, size_t nMaxAtts, void *pParam);
|
|
-
|
|
|
|
|
|
+
|
|
QGfaNetInterfacesSchemaModel* schemaModel(void);
|
|
QGfaNetInterfacesSchemaModel* schemaModel(void);
|
|
|
|
|
|
private:
|
|
private:
|
|
@@ -855,6 +886,92 @@ private:
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
+class QGfaWlanMonSchemaModel : public QAbstractTableModel
|
|
|
|
+{
|
|
|
|
+ Q_OBJECT
|
|
|
|
+ Q_PROPERTY(bool scanning READ scanning NOTIFY scanningChanged)
|
|
|
|
+
|
|
|
|
+public:
|
|
|
|
+ typedef struct _WLAN_SCAN_RESULT
|
|
|
|
+ {
|
|
|
|
+ _WLAN_SCAN_RESULT(void) {
|
|
|
|
+ nwID = 0;
|
|
|
|
+ channel = 0;
|
|
|
|
+ freqHz = 0;
|
|
|
|
+ encrypted = false;
|
|
|
|
+ qualPerc = 0;
|
|
|
|
+ qualBars = 0;
|
|
|
|
+ }
|
|
|
|
+ int32_t nwID;
|
|
|
|
+ int32_t channel;
|
|
|
|
+ double freqHz;
|
|
|
|
+ bool encrypted;
|
|
|
|
+ bool connected;
|
|
|
|
+ QString essid;
|
|
|
|
+ QString macStr;
|
|
|
|
+ QString freqStr;
|
|
|
|
+ QString qualStr;
|
|
|
|
+ QString cipherStr;
|
|
|
|
+ uint32_t qualPerc;
|
|
|
|
+ int32_t qualBars;
|
|
|
|
+ }WLAN_SCAN_RESULT;
|
|
|
|
+
|
|
|
|
+ typedef struct WLAN_MON_ROLES
|
|
|
|
+ {
|
|
|
|
+ int nRole;
|
|
|
|
+ const char *pszRoleName;
|
|
|
|
+ }WLAN_MON_ROLES;
|
|
|
|
+
|
|
|
|
+ enum WlanModelRoles
|
|
|
|
+ {
|
|
|
|
+ WLR_ESSID = Qt::UserRole,
|
|
|
|
+ WLR_MAC_ADDR_STR,
|
|
|
|
+ WLR_NWID,
|
|
|
|
+ WLR_FREQ_HZ,
|
|
|
|
+ WLR_FREQ_STR,
|
|
|
|
+ WLR_CHANNEL,
|
|
|
|
+ WLR_MODE_STR,
|
|
|
|
+ WLR_ENCRYPTED,
|
|
|
|
+ WLR_QUALITY_STR,
|
|
|
|
+ WLR_QUALITY_PERC,
|
|
|
|
+ WLR_QUALITY_BARS,
|
|
|
|
+ WLR_IS_CONNECTED,
|
|
|
|
+ WLR_CIPHER_STR,
|
|
|
|
+ WLR_LAST
|
|
|
|
+ };
|
|
|
|
+ Q_ENUM(WlanModelRoles)
|
|
|
|
+
|
|
|
|
+public:
|
|
|
|
+ explicit QGfaWlanMonSchemaModel(QObject *pParent = NULL);
|
|
|
|
+ ~QGfaWlanMonSchemaModel(void);
|
|
|
|
+
|
|
|
|
+ Q_INVOKABLE void startScan(void);
|
|
|
|
+ Q_INVOKABLE void clearAll(void);
|
|
|
|
+ Q_INVOKABLE bool setWpaSuppConfig(int cellIndex, QString passphrase);
|
|
|
|
+ void updateModel(void);
|
|
|
|
+
|
|
|
|
+ int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
|
|
|
+ int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
|
|
|
|
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
|
|
|
|
+ QHash<int, QByteArray> roleNames(void) const Q_DECL_OVERRIDE;
|
|
|
|
+
|
|
|
|
+private:
|
|
|
|
+ bool scanning(void) const;
|
|
|
|
+
|
|
|
|
+signals:
|
|
|
|
+ void scanStarted(void);
|
|
|
|
+ void scanCompleted(void);
|
|
|
|
+ void scanningChanged(bool isScanning) const;
|
|
|
|
+
|
|
|
|
+private:
|
|
|
|
+ static const WLAN_MON_ROLES m_roles[];
|
|
|
|
+ std::vector<WLAN_SCAN_RESULT> m_scanRes;
|
|
|
|
+ CGfaWifiMon m_wlMon;
|
|
|
|
+ bool m_bScanning;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
|
+
|
|
class QGfaSysInfo : public QObject
|
|
class QGfaSysInfo : public QObject
|
|
{
|
|
{
|
|
Q_OBJECT
|
|
Q_OBJECT
|
|
@@ -865,6 +982,7 @@ class QGfaSysInfo : public QObject
|
|
Q_PROPERTY(quint64 memBuffers READ memBuffers NOTIFY memBuffersChanged)
|
|
Q_PROPERTY(quint64 memBuffers READ memBuffers NOTIFY memBuffersChanged)
|
|
Q_PROPERTY(quint64 memCached READ memCached NOTIFY memCachedChanged)
|
|
Q_PROPERTY(quint64 memCached READ memCached NOTIFY memCachedChanged)
|
|
Q_PROPERTY(QGfaStgDevList *stgDev READ stgDev CONSTANT)
|
|
Q_PROPERTY(QGfaStgDevList *stgDev READ stgDev CONSTANT)
|
|
|
|
+ Q_PROPERTY(QGfaWlanMonSchemaModel *wifiMon READ wifiMon CONSTANT)
|
|
Q_PROPERTY(QTivaInfo *tivaInfo READ tivaInfo CONSTANT)
|
|
Q_PROPERTY(QTivaInfo *tivaInfo READ tivaInfo CONSTANT)
|
|
Q_PROPERTY(QNetworkInterfaces *netInterfaceInfo READ netInterfaceInfo CONSTANT)
|
|
Q_PROPERTY(QNetworkInterfaces *netInterfaceInfo READ netInterfaceInfo CONSTANT)
|
|
Q_PROPERTY(bool bootFromEmmc READ bootFromEmmc NOTIFY bootFromEmmcChanged)
|
|
Q_PROPERTY(bool bootFromEmmc READ bootFromEmmc NOTIFY bootFromEmmcChanged)
|
|
@@ -891,6 +1009,7 @@ private:
|
|
quint64 memBuffers(void) const;
|
|
quint64 memBuffers(void) const;
|
|
quint64 memCached(void) const;
|
|
quint64 memCached(void) const;
|
|
QGfaStgDevList* stgDev(void);
|
|
QGfaStgDevList* stgDev(void);
|
|
|
|
+ QGfaWlanMonSchemaModel* wifiMon(void);
|
|
QTivaInfo* tivaInfo(void);
|
|
QTivaInfo* tivaInfo(void);
|
|
QNetworkInterfaces* netInterfaceInfo(void);
|
|
QNetworkInterfaces* netInterfaceInfo(void);
|
|
bool bootFromEmmc(void) const;
|
|
bool bootFromEmmc(void) const;
|
|
@@ -912,7 +1031,7 @@ public:
|
|
inline void partitionAdded(int nIndex, const GFA_SYSINFO_PARTITION &part) {
|
|
inline void partitionAdded(int nIndex, const GFA_SYSINFO_PARTITION &part) {
|
|
return m_stgDevList.partitionAdded(nIndex, part);
|
|
return m_stgDevList.partitionAdded(nIndex, part);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
inline void partitionRemoved(int nIndex, const GFA_SYSINFO_PARTITION &part) {
|
|
inline void partitionRemoved(int nIndex, const GFA_SYSINFO_PARTITION &part) {
|
|
return m_stgDevList.partitionRemoved(nIndex, part);
|
|
return m_stgDevList.partitionRemoved(nIndex, part);
|
|
}
|
|
}
|
|
@@ -932,7 +1051,7 @@ public:
|
|
inline void UpdateSpiInfo(const GFA_SYSINFO_SPI &spi, bool bReset) {
|
|
inline void UpdateSpiInfo(const GFA_SYSINFO_SPI &spi, bool bReset) {
|
|
return m_tivaInfo.UpdateSpiInfo(spi, bReset);
|
|
return m_tivaInfo.UpdateSpiInfo(spi, bReset);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
inline void ResetSpiInfo(void) {
|
|
inline void ResetSpiInfo(void) {
|
|
m_tivaInfo.ResetSpiInfo();
|
|
m_tivaInfo.ResetSpiInfo();
|
|
}
|
|
}
|
|
@@ -946,6 +1065,7 @@ private:
|
|
quint64 m_nMemBuffers;
|
|
quint64 m_nMemBuffers;
|
|
quint64 m_nMemCached;
|
|
quint64 m_nMemCached;
|
|
QGfaStgDevList m_stgDevList;
|
|
QGfaStgDevList m_stgDevList;
|
|
|
|
+ QGfaWlanMonSchemaModel m_wifiMon;
|
|
QTivaInfo m_tivaInfo;
|
|
QTivaInfo m_tivaInfo;
|
|
QNetworkInterfaces m_netInterfaces;
|
|
QNetworkInterfaces m_netInterfaces;
|
|
bool m_bootFromEmmc;
|
|
bool m_bootFromEmmc;
|
|
@@ -1009,7 +1129,7 @@ signals:
|
|
public:
|
|
public:
|
|
explicit QGfaAppInfo(int nIndex, QObject *pParent = NULL);
|
|
explicit QGfaAppInfo(int nIndex, QObject *pParent = NULL);
|
|
virtual ~QGfaAppInfo(void);
|
|
virtual ~QGfaAppInfo(void);
|
|
-
|
|
|
|
|
|
+
|
|
appid_t appId(void) const;
|
|
appid_t appId(void) const;
|
|
|
|
|
|
int state(void) const;
|
|
int state(void) const;
|
|
@@ -1020,7 +1140,7 @@ public:
|
|
|
|
|
|
QString name(void) const;
|
|
QString name(void) const;
|
|
void setName(const QString &val);
|
|
void setName(const QString &val);
|
|
-
|
|
|
|
|
|
+
|
|
quint64 cycInt(void) const;
|
|
quint64 cycInt(void) const;
|
|
quint64 cycCur(void) const;
|
|
quint64 cycCur(void) const;
|
|
quint64 cycMin(void) const;
|
|
quint64 cycMin(void) const;
|
|
@@ -1096,7 +1216,7 @@ public:
|
|
};
|
|
};
|
|
Q_ENUM(AppStates)
|
|
Q_ENUM(AppStates)
|
|
static_assert((STATE_INVALID - STATE_NOT_RUNNING) == (GIAS_Invalid - GIAS_StateNotRunning), "enum AppStates does not match enum GfaIpcAppStates!");
|
|
static_assert((STATE_INVALID - STATE_NOT_RUNNING) == (GIAS_Invalid - GIAS_StateNotRunning), "enum AppStates does not match enum GfaIpcAppStates!");
|
|
-
|
|
|
|
|
|
+
|
|
enum AppIndex
|
|
enum AppIndex
|
|
{
|
|
{
|
|
APP_INDEX_REMANENT = GAI_Remanent,
|
|
APP_INDEX_REMANENT = GAI_Remanent,
|
|
@@ -1162,6 +1282,125 @@ private:
|
|
struct timespec m_tsLastHeavyLoadUpdate;
|
|
struct timespec m_tsLastHeavyLoadUpdate;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+/////////////////////////////////////////////////////////////////////////////
|
|
|
|
+
|
|
|
|
+class QGfaAppLauncher : public QObject
|
|
|
|
+{
|
|
|
|
+ Q_OBJECT
|
|
|
|
+ Q_PROPERTY(bool normalExit READ normalExit CONSTANT)
|
|
|
|
+ Q_PROPERTY(int exitCode READ exitCode CONSTANT)
|
|
|
|
+ Q_PROPERTY(ProcessError error READ error CONSTANT)
|
|
|
|
+ Q_PROPERTY(qint64 processId READ processId CONSTANT)
|
|
|
|
+ Q_PROPERTY(ProcessState state READ state NOTIFY stateChanged)
|
|
|
|
+ Q_PROPERTY(QString workingDirectory READ workingDirectory WRITE setWorkingDirectory NOTIFY workingDirectoryChanged)
|
|
|
|
+ Q_PROPERTY(QString program READ program WRITE setProgram NOTIFY programChanged)
|
|
|
|
+ Q_PROPERTY(QString arguments READ arguments WRITE setArguments NOTIFY argumentsChanged)
|
|
|
|
+ Q_PROPERTY(QString shell READ shell WRITE setShell NOTIFY shellChanged)
|
|
|
|
+
|
|
|
|
+public:
|
|
|
|
+ enum ProcessState
|
|
|
|
+ {
|
|
|
|
+ NotRunning,
|
|
|
|
+ Starting,
|
|
|
|
+ Running
|
|
|
|
+ };
|
|
|
|
+ Q_ENUM(ProcessState)
|
|
|
|
+
|
|
|
|
+ enum ProcessError
|
|
|
|
+ {
|
|
|
|
+ FailedToStart,
|
|
|
|
+ Crashed,
|
|
|
|
+ Timedout,
|
|
|
|
+ ReadError,
|
|
|
|
+ WriteError,
|
|
|
|
+ UnknownError
|
|
|
|
+ };
|
|
|
|
+ Q_ENUM(ProcessError)
|
|
|
|
+
|
|
|
|
+ enum ExecReturnFilter
|
|
|
|
+ {
|
|
|
|
+ StdOut = 1,
|
|
|
|
+ StdErr = 2,
|
|
|
|
+ AllOut = 3
|
|
|
|
+ };
|
|
|
|
+ Q_ENUM(ExecReturnFilter)
|
|
|
|
+
|
|
|
|
+public:
|
|
|
|
+ explicit QGfaAppLauncher(QObject *pParent = nullptr);
|
|
|
|
+ virtual ~QGfaAppLauncher(void);
|
|
|
|
+
|
|
|
|
+ static void RegisterQmlTypes(QQmlEngine &rEng, int nVerMajor = 1, int nVerMinor = 0);
|
|
|
|
+ static QStringList SplitCmdLine(const QString &cmd);
|
|
|
|
+ static QString EscapeQuotes(const QString &cmd);
|
|
|
|
+
|
|
|
|
+public:
|
|
|
|
+ Q_INVOKABLE void start(const QString &program, const QStringList &arguments);
|
|
|
|
+ Q_INVOKABLE void start(const QString &program, const QString &arguments = "");
|
|
|
|
+ Q_INVOKABLE void start(void);
|
|
|
|
+
|
|
|
|
+ Q_INVOKABLE QByteArray exec(const QString &program, const QStringList &arguments, ExecReturnFilter rf = AllOut);
|
|
|
|
+ Q_INVOKABLE QByteArray exec(const QString &program, const QString &arguments = "", ExecReturnFilter rf = AllOut);
|
|
|
|
+ Q_INVOKABLE QByteArray exec(ExecReturnFilter rf = AllOut);
|
|
|
|
+
|
|
|
|
+ Q_INVOKABLE static QByteArray execChain(const QStringList &programs, const QStringList &arguments);
|
|
|
|
+
|
|
|
|
+ Q_INVOKABLE QByteArray shellExec(const QStringList &arguments, ExecReturnFilter rf = AllOut);
|
|
|
|
+ Q_INVOKABLE QByteArray shellExec(const QString &arguments = "", ExecReturnFilter rf = AllOut);
|
|
|
|
+ Q_INVOKABLE QByteArray shellExecList(const QStringList &strArgList, ExecReturnFilter rf = AllOut);
|
|
|
|
+
|
|
|
|
+ Q_INVOKABLE void setStandardInputFile(const QString &fileName);
|
|
|
|
+ Q_INVOKABLE void setStandardOutputFile(const QString &fileName);
|
|
|
|
+ Q_INVOKABLE void setStandardErrorFile(const QString &fileName);
|
|
|
|
+
|
|
|
|
+ bool normalExit(void) const;
|
|
|
|
+ int exitCode(void) const;
|
|
|
|
+ ProcessError error(void) const;
|
|
|
|
+ qint64 processId(void) const;
|
|
|
|
+ ProcessState state() const;
|
|
|
|
+
|
|
|
|
+ QString workingDirectory() const;
|
|
|
|
+ void setWorkingDirectory(const QString &dir);
|
|
|
|
+
|
|
|
|
+ QString program() const;
|
|
|
|
+ void setProgram(const QString &program);
|
|
|
|
+
|
|
|
|
+ QString arguments() const;
|
|
|
|
+ void setArguments(const QString &arguments);
|
|
|
|
+ void setArguments(const QStringList &arguments);
|
|
|
|
+
|
|
|
|
+ QString shell() const;
|
|
|
|
+ void setShell(const QString &shl);
|
|
|
|
+
|
|
|
|
+signals:
|
|
|
|
+ void started(void);
|
|
|
|
+ void finished(int exitCode, bool normalExit);
|
|
|
|
+ void standardOutputAvailable(const QByteArray &txt);
|
|
|
|
+ void standardErrorAvailable(const QByteArray &txt);
|
|
|
|
+ void stateChanged(ProcessState newState);
|
|
|
|
+ void errorOccurred(ProcessError error);
|
|
|
|
+
|
|
|
|
+ void normalExitChanged(bool val);
|
|
|
|
+ void workingDirectoryChanged(const QString &dir);
|
|
|
|
+ void programChanged(const QString &prog);
|
|
|
|
+ void argumentsChanged(const QString &prog);
|
|
|
|
+ void shellChanged(const QString &shl);
|
|
|
|
+
|
|
|
|
+private slots:
|
|
|
|
+ void onProcStarted(void);
|
|
|
|
+ void onProcFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
|
|
|
+ void onProcReadyReadStandardOutput(void);
|
|
|
|
+ void onProcReadyReadStandardError(void);
|
|
|
|
+ void onProcStateChanged(QProcess::ProcessState newState);
|
|
|
|
+ void onProcErrorOccurred(QProcess::ProcessError error);
|
|
|
|
+
|
|
|
|
+private:
|
|
|
|
+ QProcess m_qProc;
|
|
|
|
+ bool m_bIsSyncMode;
|
|
|
|
+ QByteArray m_execOutput;
|
|
|
|
+ QString m_strShell;
|
|
|
|
+ ExecReturnFilter m_rf;
|
|
|
|
+};
|
|
|
|
+
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
#endif // __cplusplus
|
|
#endif // __cplusplus
|
|
#endif // !defined(AGD_QAPPCTRL_H__ADD46467_F628_4A07_8844_613598E359DE__INCLUDED_)
|
|
#endif // !defined(AGD_QAPPCTRL_H__ADD46467_F628_4A07_8844_613598E359DE__INCLUDED_)
|