TabletEntityStatistics.qml refactored. Text now wrapped. TODO: coloring, server stats

This commit is contained in:
Vladyslav Stelmakhovskyi 2017-03-14 17:02:09 +01:00
parent 99c74cec41
commit d9ca8a826d
3 changed files with 74 additions and 119 deletions

View file

@ -55,179 +55,91 @@ Rectangle {
y: hifi.dimensions.tabletMenuHeader //-bgNavBar
spacing: 20
HifiControls.Label {
size: 20
TabletEntityStatisticsItem {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Elements on Servers:")
colorScheme: root.colorScheme
}
HifiControls.Label {
id: elementsOnServerLabel
size: 16
titleText: qsTr("Elements on Servers:")
text: OctreeStats.serverElements
anchors.left: parent.left
anchors.right: parent.right
colorScheme: root.colorScheme
}
HifiControls.Label {
size: 20
TabletEntityStatisticsItem {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Local Elements:")
colorScheme: root.colorScheme
}
HifiControls.Label {
id: localElementsLabel
size: 16
titleText: qsTr("Local Elements:")
text: OctreeStats.localElements
anchors.left: parent.left
anchors.right: parent.right
colorScheme: root.colorScheme
}
HifiControls.Label {
size: 20
TabletEntityStatisticsItem {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Elements Memory:")
colorScheme: root.colorScheme
}
HifiControls.Label {
id: elementsMemoryLabel
size: 16
titleText: qsTr("Elements Memory:")
text: OctreeStats.localElementsMemory
anchors.left: parent.left
anchors.right: parent.right
colorScheme: root.colorScheme
}
HifiControls.Label {
size: 20
TabletEntityStatisticsItem {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Sending Mode:")
colorScheme: root.colorScheme
}
HifiControls.Label {
id: sendingModeLabel
size: 16
titleText: qsTr("Sending Mode:")
text: OctreeStats.sendingMode
anchors.left: parent.left
anchors.right: parent.right
colorScheme: root.colorScheme
}
HifiControls.Label {
size: 20
TabletEntityStatisticsItem {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Incoming Entity Packets:")
colorScheme: root.colorScheme
}
HifiControls.Label {
id: incomingEntityPacketsLabel
size: 16
titleText: qsTr("Incoming Entity Packets:")
text: OctreeStats.processedPackets
anchors.left: parent.left
anchors.right: parent.right
colorScheme: root.colorScheme
}
HifiControls.Label {
size: 20
TabletEntityStatisticsItem {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Processed Packets Elements:")
colorScheme: root.colorScheme
}
HifiControls.Label {
id: processedPacketsElementsLabel
size: 16
titleText: qsTr("Processed Packets Elements:")
text: OctreeStats.processedPacketsElements
anchors.left: parent.left
anchors.right: parent.right
colorScheme: root.colorScheme
}
HifiControls.Label {
size: 20
TabletEntityStatisticsItem {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Processed Packets Entities:")
colorScheme: root.colorScheme
}
HifiControls.Label {
id: processedPacketsEntitiesLabel
size: 16
titleText: qsTr("Processed Packets Entities:")
text: OctreeStats.processedPacketsEntities
anchors.left: parent.left
anchors.right: parent.right
colorScheme: root.colorScheme
}
HifiControls.Label {
size: 20
TabletEntityStatisticsItem {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Processed Packets Timing:")
colorScheme: root.colorScheme
}
HifiControls.Label {
id: processedPacketsTimingLabel
size: 16
titleText: qsTr("Processed Packets Timing:")
text: OctreeStats.processedPacketsTiming
anchors.left: parent.left
anchors.right: parent.right
colorScheme: root.colorScheme
}
HifiControls.Label {
size: 20
TabletEntityStatisticsItem {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Outbound Entity Packets:")
colorScheme: root.colorScheme
}
HifiControls.Label {
id: outboundEntityPacketsLabel
size: 16
titleText: qsTr("Outbound Entity Packets:")
text: OctreeStats.outboundEditPackets
anchors.left: parent.left
anchors.right: parent.right
colorScheme: root.colorScheme
}
HifiControls.Label {
size: 20
TabletEntityStatisticsItem {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Entity Update Time:")
colorScheme: root.colorScheme
}
HifiControls.Label {
id: entityUpdateTimeLabel
size: 16
titleText: qsTr("Entity Update Time:")
text: OctreeStats.entityUpdateTime
anchors.left: parent.left
anchors.right: parent.right
colorScheme: root.colorScheme
}
HifiControls.Label {
size: 20
TabletEntityStatisticsItem {
anchors.left: parent.left
anchors.right: parent.right
text: qsTr("Entity Updates:")
colorScheme: root.colorScheme
}
HifiControls.Label {
id: entityUpdatesLabel
size: 16
titleText: qsTr("Entity Updates:")
text: OctreeStats.entityUpdates
anchors.left: parent.left
anchors.right: parent.right
colorScheme: root.colorScheme
}
@ -242,18 +154,12 @@ Rectangle {
state: "less"
HifiControls.Label {
size: 20
width: parent.width
text: qsTr("Entity Server ") + (index+1) + ":"
colorScheme: root.colorScheme
}
HifiControls.Label {
id: entityServer1Label
size: 20
TabletEntityStatisticsItem {
width: parent.width
titleText: qsTr("Entity Server ") + (index+1) + ":"
colorScheme: root.colorScheme
}
Row {
id: buttonsRow
width: parent.width

View file

@ -0,0 +1,48 @@
//
// TabletEntityStatistics.qml
//
// Created by Vlad Stelmahovsky on 3/11/17
// Copyright 2017 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
import QtQuick 2.5
import QtQuick.Controls 1.4
import Qt.labs.settings 1.0
import "../../styles-uit"
import "../../controls-uit" as HifiControls
Column {
id: root
property int colorScheme: hifi.colorSchemes.dark
property alias titleText: titleLabel.text
property alias text: valueLabel.text
HifiConstants { id: hifi }
anchors.left: parent.left
anchors.right: parent.right
spacing: 10
HifiControls.Label {
id: titleLabel
size: 20
anchors.left: parent.left
anchors.right: parent.right
colorScheme: root.colorScheme
}
RalewaySemiBold {
id: valueLabel
anchors.left: parent.left
anchors.right: parent.right
wrapMode: Text.WordWrap
size: 16
color: enabled ? (root.colorScheme == hifi.colorSchemes.light ? hifi.colors.lightGray : hifi.colors.lightGrayText)
: (root.colorScheme == hifi.colorSchemes.light ? hifi.colors.lightGrayText : hifi.colors.baseGrayHighlight);
}
}

View file

@ -151,6 +151,7 @@ void OctreeStatsProvider::updateOctreeStatsData() {
unsigned long totalInternal = 0;
unsigned long totalLeaves = 0;
m_sendingMode.clear();
NodeToOctreeSceneStats* sceneStats = qApp->getOcteeSceneStats();
sceneStats->withReadLock([&] {
for (NodeToOctreeSceneStatsIterator i = sceneStats->begin(); i != sceneStats->end(); i++) {