git-svn-id: svn://db.shs.com.ru/libs@558 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
#include "piintrospector.h"
|
||||
#include <QClipboard>
|
||||
#include <QScrollBar>
|
||||
#include "pifile.h"
|
||||
#include "pitime.h"
|
||||
#include "pidir.h"
|
||||
#include "pichunkstream.h"
|
||||
#include <QClipboard>
|
||||
#include <QScrollBar>
|
||||
#include "ccm_piintrospector.h"
|
||||
|
||||
#include <cxxabi.h>
|
||||
const QString demangle(const char * name) {
|
||||
@@ -34,6 +35,7 @@ enum ColumnObjects {
|
||||
|
||||
QPIIntrospector::QPIIntrospector(QWidget * parent): EMainWindow(parent), peer("__introspection_client__") {
|
||||
setupUi(this);
|
||||
request_timer = 0;
|
||||
session.setFile("qpiintrospector_session.conf");
|
||||
#if QT_VERSION >= 0x050000
|
||||
//treeContainers->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
@@ -46,6 +48,14 @@ QPIIntrospector::QPIIntrospector(QWidget * parent): EMainWindow(parent), peer("_
|
||||
CONNECTU(&peer, peerConnectedEvent, this, reqProcPIEvents);
|
||||
CONNECTU(&peer, peerDisconnectedEvent, this, reqProcPIEvents);
|
||||
CONNECTU(&peer, dataReceivedEvent, this, reqProcPIEvents);
|
||||
PICodeInfo::EnumInfo * ei = PICodeInfo::enumsInfo->value("PIIntrospection::InfoTypes");
|
||||
if (ei) {
|
||||
piForeachC (PICodeInfo::EnumeratorInfo & e, ei->members) {
|
||||
QCheckBox * cb = new QCheckBox(PI2QString(e.name.mid(2)));
|
||||
cb->setProperty("__value__", e.value);
|
||||
layoutRequestFlags->addWidget(cb);
|
||||
}
|
||||
}
|
||||
//startTimer(100);
|
||||
session.addEntry(this);
|
||||
session.load();
|
||||
@@ -71,7 +81,9 @@ void QPIIntrospector::changeEvent(QEvent * e) {
|
||||
}
|
||||
|
||||
|
||||
void QPIIntrospector::timerEvent(QTimerEvent * ) {
|
||||
void QPIIntrospector::timerEvent(QTimerEvent * e) {
|
||||
if (e->timerId() == request_timer)
|
||||
buttonRequest->click();
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +100,14 @@ void QPIIntrospector::buildTree(QByteArray d) {
|
||||
}
|
||||
|
||||
|
||||
void QPIIntrospector::procRequestTimer() {
|
||||
if (request_timer != 0) killTimer(request_timer);
|
||||
request_timer = 0;
|
||||
if (!checkRequestTimer->isChecked()) return;
|
||||
request_timer = startTimer(1000 / spinRequestTimerHz->value());
|
||||
}
|
||||
|
||||
|
||||
void QPIIntrospector::buildDumpSection(QTreeWidgetItem * pi, PIString & str) {
|
||||
}
|
||||
|
||||
@@ -203,3 +223,18 @@ void QPIIntrospector::peersChanged(const PIString & name) {
|
||||
peer.unlock();
|
||||
listApp->blockSignals(false);
|
||||
}
|
||||
|
||||
|
||||
void QPIIntrospector::on_buttonRequest_clicked() {
|
||||
if (cur_server.isEmpty()) return;
|
||||
PIIntrospection::RequiredInfo info;
|
||||
for (int i = 0; i < layoutRequestFlags->count(); ++i) {
|
||||
QCheckBox * cb = qobject_cast<QCheckBox*>(layoutRequestFlags->itemAt(i)->widget());
|
||||
if (!cb) continue;
|
||||
if (!cb->isChecked()) continue;
|
||||
info.types |= cb->property("__value__").toInt();
|
||||
}
|
||||
PIByteArray ba;
|
||||
ba << PIIntrospection::sign << info;
|
||||
peer.send(cur_server, ba);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user