git-svn-id: svn://db.shs.com.ru/pip@514 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2017-06-21 18:23:53 +00:00
parent ed1a89508a
commit 96d67076dc
6 changed files with 62 additions and 47 deletions

View File

@@ -78,9 +78,10 @@ public:
mt->hide(); mt->name() = "peer diag";
center->addTile(mt); mtiles << mt;
TilePICout * outt = new TilePICout();
outt->size_policy = PIScreenTypes::Expanding;
screen->rootTile()->addTile(outt);
tpicout = new TilePICout();
tpicout->hide();
tpicout->size_policy = PIScreenTypes::Expanding;
screen->rootTile()->addTile(tpicout);
CONNECTU(screen, tileEvent, this, tileEvent)
CONNECTU(screen, keyPressed, this, keyEvent)
@@ -219,7 +220,7 @@ public:
piForeachC (PISystemMonitor::ThreadStats & t, ts)
maxlen = piMaxi(maxlen, t.name.length());
piForeachC (PISystemMonitor::ThreadStats & t, ts) {
PIString line = PIString(num++).expandLeftTo(2, ' ') + ": ";
PIString line = PIString(++num).expandLeftTo(2, ' ') + ": ";
line += PIString(t.name).expandRightTo(maxlen, ' ') + ": k ";
PIString ns = PIString::fromNumber(t.cpu_load_kernel); ns = ns.left(ns.find('.') + 2);
line += ns.expandLeftTo(5, ' ') + " %, u ";
@@ -280,6 +281,10 @@ public:
}
}
EVENT_HANDLER1(void, keyEvent, PIKbdListener::KeyEvent, e) {
if (e.key == PIKbdListener::F9) {
tpicout->visible = !tpicout->visible;
return;
}
if (e.key == PIKbdListener::Esc && e.modifiers[PIKbdListener::Shift]) {
PIKbdListener::exiting = true;
return;
@@ -296,6 +301,7 @@ public:
Daemon & daemon_;
PIScreenTile * tmenu, * tinfo, * tfm, * tdaemon, * tpeer, * tpeerdiag;
TileList * peers_tl, * addrs_tl, * peermap_tl;
TilePICout * tpicout;
TileSimple * title;
TileSimple * peerinfo_tl, * peerinfo_header;
TileSimple * peerdiagdata_tl, * peerdiagservice_tl;
@@ -380,6 +386,7 @@ int main(int argc, char * argv[]) {
Daemon * daemon = new Daemon();
if (!sip.isEmpty()) daemon->setTcpServerIP(sip);
sys_mon.startOnSelf();
//sys_mon.startOnProcess(12404);
screen->enableExitCapture(PIKbdListener::F10);
if (!name.isEmpty())
daemon->changeName(pisd_prefix + name);