mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 16:43:33 +02:00
Remove Developer > Network > Bandwith Details dialog
This commit is contained in:
parent
38668b6ce5
commit
51739f2f99
9 changed files with 1 additions and 261 deletions
|
@ -4236,12 +4236,6 @@ void Application::updateDialogs(float deltaTime) const {
|
|||
PerformanceWarning warn(showWarnings, "Application::updateDialogs()");
|
||||
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
||||
|
||||
// Update bandwidth dialog, if any
|
||||
BandwidthDialog* bandwidthDialog = dialogsManager->getBandwidthDialog();
|
||||
if (bandwidthDialog) {
|
||||
bandwidthDialog->update();
|
||||
}
|
||||
|
||||
QPointer<OctreeStatsDialog> octreeStatsDialog = dialogsManager->getOctreeStatsDialog();
|
||||
if (octreeStatsDialog) {
|
||||
octreeStatsDialog->update();
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
#include <RunningMarker.h>
|
||||
|
||||
#include "avatar/MyAvatar.h"
|
||||
#include "BandwidthRecorder.h"
|
||||
#include "Bookmarks.h"
|
||||
#include "Camera.h"
|
||||
#include "ConnectionMonitor.h"
|
||||
|
@ -61,7 +62,6 @@
|
|||
#include "scripting/ControllerScriptingInterface.h"
|
||||
#include "scripting/DialogsManagerScriptingInterface.h"
|
||||
#include "ui/ApplicationOverlay.h"
|
||||
#include "ui/BandwidthDialog.h"
|
||||
#include "ui/EntityScriptServerLogDialog.h"
|
||||
#include "ui/LodToolsDialog.h"
|
||||
#include "ui/LogDialog.h"
|
||||
|
|
|
@ -566,8 +566,6 @@ Menu::Menu() {
|
|||
dialogsManager.data(), SLOT(toggleDiskCacheEditor()));
|
||||
addActionToQMenuAndActionHash(networkMenu, MenuOption::ShowDSConnectTable, 0,
|
||||
dialogsManager.data(), SLOT(showDomainConnectionDialog()));
|
||||
addActionToQMenuAndActionHash(networkMenu, MenuOption::BandwidthDetails, 0,
|
||||
dialogsManager.data(), SLOT(bandwidthDetails()));
|
||||
|
||||
#if (PR_BUILD || DEV_BUILD)
|
||||
addCheckableActionToQMenuAndActionHash(networkMenu, MenuOption::SendWrongProtocolVersion, 0, false,
|
||||
|
|
|
@ -49,7 +49,6 @@ namespace MenuOption {
|
|||
const QString AutoMuteAudio = "Auto Mute Microphone";
|
||||
const QString AvatarReceiveStats = "Show Receive Stats";
|
||||
const QString Back = "Back";
|
||||
const QString BandwidthDetails = "Bandwidth Details";
|
||||
const QString BinaryEyelidControl = "Binary Eyelid Control";
|
||||
const QString BookmarkLocation = "Bookmark Location";
|
||||
const QString Bookmarks = "Bookmarks";
|
||||
|
|
|
@ -1,135 +0,0 @@
|
|||
//
|
||||
// BandwidthDialog.cpp
|
||||
// interface/src/ui
|
||||
//
|
||||
// Created by Tobias Schwinger on 6/21/13.
|
||||
// Copyright 2013 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
|
||||
//
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "BandwidthRecorder.h"
|
||||
#include "ui/BandwidthDialog.h"
|
||||
|
||||
#include <QFormLayout>
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
#include <QPalette>
|
||||
#include <QColor>
|
||||
|
||||
|
||||
BandwidthChannelDisplay::BandwidthChannelDisplay(QVector<NodeType_t> nodeTypesToFollow,
|
||||
QFormLayout* form,
|
||||
char const* const caption, char const* unitCaption,
|
||||
const float unitScale, unsigned colorRGBA) :
|
||||
_nodeTypesToFollow(nodeTypesToFollow),
|
||||
_caption(caption),
|
||||
_unitCaption(unitCaption),
|
||||
_unitScale(unitScale),
|
||||
_colorRGBA(colorRGBA)
|
||||
{
|
||||
_label = new QLabel();
|
||||
_label->setAlignment(Qt::AlignRight);
|
||||
|
||||
QPalette palette = _label->palette();
|
||||
unsigned rgb = colorRGBA >> 8;
|
||||
rgb = ((rgb & 0xfefefeu) >> 1) + ((rgb & 0xf8f8f8) >> 3);
|
||||
palette.setColor(QPalette::WindowText, QColor::fromRgb(rgb));
|
||||
_label->setPalette(palette);
|
||||
|
||||
form->addRow(QString(" ") + _caption + " Bandwidth In/Out:", _label);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void BandwidthChannelDisplay::bandwidthAverageUpdated() {
|
||||
float inTotal = 0.;
|
||||
float outTotal = 0.;
|
||||
|
||||
QSharedPointer<BandwidthRecorder> bandwidthRecorder = DependencyManager::get<BandwidthRecorder>();
|
||||
|
||||
for (int i = 0; i < _nodeTypesToFollow.size(); ++i) {
|
||||
inTotal += bandwidthRecorder->getAverageInputKilobitsPerSecond(_nodeTypesToFollow.at(i));
|
||||
outTotal += bandwidthRecorder->getAverageOutputKilobitsPerSecond(_nodeTypesToFollow.at(i));
|
||||
}
|
||||
|
||||
_strBuf =
|
||||
QString("").setNum((int) (inTotal * _unitScale)) + "/" +
|
||||
QString("").setNum((int) (outTotal * _unitScale)) + " " + _unitCaption;
|
||||
}
|
||||
|
||||
|
||||
void BandwidthChannelDisplay::paint() {
|
||||
_label->setText(_strBuf);
|
||||
}
|
||||
|
||||
|
||||
BandwidthDialog::BandwidthDialog(QWidget* parent) :
|
||||
QDialog(parent, Qt::Window | Qt::WindowCloseButtonHint | Qt::WindowStaysOnTopHint) {
|
||||
|
||||
this->setWindowTitle("Bandwidth Details");
|
||||
|
||||
// Create layout
|
||||
QFormLayout* form = new QFormLayout();
|
||||
form->setSizeConstraint(QLayout::SetFixedSize);
|
||||
this->QDialog::setLayout(form);
|
||||
|
||||
QSharedPointer<BandwidthRecorder> bandwidthRecorder = DependencyManager::get<BandwidthRecorder>();
|
||||
|
||||
_allChannelDisplays[0] = _audioChannelDisplay =
|
||||
new BandwidthChannelDisplay({NodeType::AudioMixer}, form, "Audio", "Kbps", 1.0, COLOR0);
|
||||
_allChannelDisplays[1] = _avatarsChannelDisplay =
|
||||
new BandwidthChannelDisplay({NodeType::Agent, NodeType::AvatarMixer}, form, "Avatars", "Kbps", 1.0, COLOR1);
|
||||
_allChannelDisplays[2] = _octreeChannelDisplay =
|
||||
new BandwidthChannelDisplay({NodeType::EntityServer}, form, "Octree", "Kbps", 1.0, COLOR2);
|
||||
_allChannelDisplays[3] = _octreeChannelDisplay =
|
||||
new BandwidthChannelDisplay({NodeType::DomainServer}, form, "Domain", "Kbps", 1.0, COLOR2);
|
||||
_allChannelDisplays[4] = _otherChannelDisplay =
|
||||
new BandwidthChannelDisplay({NodeType::Unassigned}, form, "Other", "Kbps", 1.0, COLOR2);
|
||||
_allChannelDisplays[5] = _totalChannelDisplay =
|
||||
new BandwidthChannelDisplay({
|
||||
NodeType::DomainServer, NodeType::EntityServer,
|
||||
NodeType::AudioMixer, NodeType::Agent,
|
||||
NodeType::AvatarMixer, NodeType::Unassigned
|
||||
}, form, "Total", "Kbps", 1.0, COLOR2);
|
||||
|
||||
connect(averageUpdateTimer, SIGNAL(timeout()), this, SLOT(updateTimerTimeout()));
|
||||
averageUpdateTimer->start(1000);
|
||||
}
|
||||
|
||||
|
||||
BandwidthDialog::~BandwidthDialog() {
|
||||
for (unsigned int i = 0; i < _CHANNELCOUNT; i++) {
|
||||
delete _allChannelDisplays[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BandwidthDialog::updateTimerTimeout() {
|
||||
for (unsigned int i = 0; i < _CHANNELCOUNT; i++) {
|
||||
_allChannelDisplays[i]->bandwidthAverageUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BandwidthDialog::paintEvent(QPaintEvent* event) {
|
||||
for (unsigned int i=0; i<_CHANNELCOUNT; i++)
|
||||
_allChannelDisplays[i]->paint();
|
||||
this->QDialog::paintEvent(event);
|
||||
}
|
||||
|
||||
void BandwidthDialog::reject() {
|
||||
|
||||
// Just regularly close upon ESC
|
||||
this->QDialog::close();
|
||||
}
|
||||
|
||||
void BandwidthDialog::closeEvent(QCloseEvent* event) {
|
||||
|
||||
this->QDialog::closeEvent(event);
|
||||
emit closed();
|
||||
}
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
//
|
||||
// BandwidthDialog.h
|
||||
// interface/src/ui
|
||||
//
|
||||
// Created by Tobias Schwinger on 6/21/13.
|
||||
// Copyright 2013 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
|
||||
//
|
||||
|
||||
#ifndef hifi_BandwidthDialog_h
|
||||
#define hifi_BandwidthDialog_h
|
||||
|
||||
#include <QDialog>
|
||||
#include <QLabel>
|
||||
#include <QFormLayout>
|
||||
#include <QVector>
|
||||
#include <QTimer>
|
||||
|
||||
#include "Node.h"
|
||||
#include "BandwidthRecorder.h"
|
||||
|
||||
|
||||
const unsigned int COLOR0 = 0x33cc99ff;
|
||||
const unsigned int COLOR1 = 0xffef40c0;
|
||||
const unsigned int COLOR2 = 0xd0d0d0a0;
|
||||
|
||||
|
||||
class BandwidthChannelDisplay : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BandwidthChannelDisplay(QVector<NodeType_t> nodeTypesToFollow,
|
||||
QFormLayout* form,
|
||||
char const* const caption, char const* unitCaption, float unitScale, unsigned colorRGBA);
|
||||
void paint();
|
||||
|
||||
private:
|
||||
QVector<NodeType_t> _nodeTypesToFollow;
|
||||
QLabel* _label;
|
||||
QString _strBuf;
|
||||
char const* const _caption;
|
||||
char const* _unitCaption;
|
||||
float const _unitScale;
|
||||
unsigned _colorRGBA;
|
||||
|
||||
|
||||
public slots:
|
||||
void bandwidthAverageUpdated();
|
||||
};
|
||||
|
||||
|
||||
class BandwidthDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
BandwidthDialog(QWidget* parent);
|
||||
~BandwidthDialog();
|
||||
|
||||
void paintEvent(QPaintEvent*) override;
|
||||
|
||||
private:
|
||||
BandwidthChannelDisplay* _audioChannelDisplay;
|
||||
BandwidthChannelDisplay* _avatarsChannelDisplay;
|
||||
BandwidthChannelDisplay* _octreeChannelDisplay;
|
||||
BandwidthChannelDisplay* _domainChannelDisplay;
|
||||
BandwidthChannelDisplay* _otherChannelDisplay;
|
||||
BandwidthChannelDisplay* _totalChannelDisplay; // sums of all the other channels
|
||||
|
||||
static const unsigned int _CHANNELCOUNT = 6;
|
||||
BandwidthChannelDisplay* _allChannelDisplays[_CHANNELCOUNT];
|
||||
|
||||
|
||||
signals:
|
||||
|
||||
void closed();
|
||||
|
||||
public slots:
|
||||
|
||||
void reject() override;
|
||||
void updateTimerTimeout();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Emits a 'closed' signal when this dialog is closed.
|
||||
void closeEvent(QCloseEvent*) override;
|
||||
|
||||
private:
|
||||
QTimer* averageUpdateTimer = new QTimer(this);
|
||||
|
||||
};
|
||||
|
||||
#endif // hifi_BandwidthDialog_h
|
|
@ -19,7 +19,6 @@
|
|||
#include <PathUtils.h>
|
||||
|
||||
#include "AddressBarDialog.h"
|
||||
#include "BandwidthDialog.h"
|
||||
#include "CachesSizeDialog.h"
|
||||
#include "ConnectionFailureDialog.h"
|
||||
#include "DiskCacheEditor.h"
|
||||
|
@ -108,20 +107,6 @@ void DialogsManager::cachesSizeDialog() {
|
|||
_cachesSizeDialog->raise();
|
||||
}
|
||||
|
||||
void DialogsManager::bandwidthDetails() {
|
||||
if (! _bandwidthDialog) {
|
||||
_bandwidthDialog = new BandwidthDialog(qApp->getWindow());
|
||||
connect(_bandwidthDialog, SIGNAL(closed()), _bandwidthDialog, SLOT(deleteLater()));
|
||||
|
||||
if (_hmdToolsDialog) {
|
||||
_hmdToolsDialog->watchWindow(_bandwidthDialog->windowHandle());
|
||||
}
|
||||
|
||||
_bandwidthDialog->show();
|
||||
}
|
||||
_bandwidthDialog->raise();
|
||||
}
|
||||
|
||||
void DialogsManager::lodTools() {
|
||||
if (!_lodToolsDialog) {
|
||||
maybeCreateDialog(_lodToolsDialog);
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
class AnimationsDialog;
|
||||
class AttachmentsDialog;
|
||||
class BandwidthDialog;
|
||||
class CachesSizeDialog;
|
||||
class DiskCacheEditor;
|
||||
class LodToolsDialog;
|
||||
|
@ -36,7 +35,6 @@ class DialogsManager : public QObject, public Dependency {
|
|||
SINGLETON_DEPENDENCY
|
||||
|
||||
public:
|
||||
QPointer<BandwidthDialog> getBandwidthDialog() const { return _bandwidthDialog; }
|
||||
QPointer<HMDToolsDialog> getHMDToolsDialog() const { return _hmdToolsDialog; }
|
||||
QPointer<LodToolsDialog> getLodToolsDialog() const { return _lodToolsDialog; }
|
||||
QPointer<OctreeStatsDialog> getOctreeStatsDialog() const { return _octreeStatsDialog; }
|
||||
|
@ -53,7 +51,6 @@ public slots:
|
|||
void showLoginDialog();
|
||||
void octreeStatsDetails();
|
||||
void cachesSizeDialog();
|
||||
void bandwidthDetails();
|
||||
void lodTools();
|
||||
void hmdTools(bool showTools);
|
||||
void showScriptEditor();
|
||||
|
@ -79,7 +76,6 @@ private:
|
|||
|
||||
QPointer<AnimationsDialog> _animationsDialog;
|
||||
QPointer<AttachmentsDialog> _attachmentsDialog;
|
||||
QPointer<BandwidthDialog> _bandwidthDialog;
|
||||
QPointer<CachesSizeDialog> _cachesSizeDialog;
|
||||
QPointer<DiskCacheEditor> _diskCacheEditor;
|
||||
QPointer<QMessageBox> _ircInfoBox;
|
||||
|
|
|
@ -79,9 +79,6 @@ HMDToolsDialog::HMDToolsDialog(QWidget* parent) :
|
|||
// what screens we're allowed on
|
||||
watchWindow(windowHandle());
|
||||
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
||||
if (dialogsManager->getBandwidthDialog()) {
|
||||
watchWindow(dialogsManager->getBandwidthDialog()->windowHandle());
|
||||
}
|
||||
if (dialogsManager->getOctreeStatsDialog()) {
|
||||
watchWindow(dialogsManager->getOctreeStatsDialog()->windowHandle());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue