Prepare everything for the performance counter viewer window.

This commit is contained in:
Matthäus G. Chajdas
2017-08-24 13:21:02 +01:00
committed by baldurk
parent 29376f34cc
commit ba4c9d6837
7 changed files with 235 additions and 6 deletions
+16
View File
@@ -405,6 +405,22 @@ protected:
DECLARE_REFLECTION_STRUCT(IStatisticsViewer);
DOCUMENT("The performance counter view window.");
struct IPerformanceCounterViewer
{
DOCUMENT(
"Retrieves the QWidget for this :class:`PerformanceCounterViewer` if PySide2 is available, "
"or "
"``None``.");
virtual QWidget *Widget() = 0;
protected:
IPerformanceCounterViewer() = default;
~IPerformanceCounterViewer() = default;
};
DECLARE_REFLECTION_STRUCT(IPerformanceCounterViewer);
DOCUMENT("The interactive python shell.");
struct IPythonShell
{
@@ -0,0 +1,50 @@
/******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2017 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/
#include "PerformanceCounterViewer.h"
#include "ui_PerformanceCounterViewer.h"
PerformanceCounterViewer::PerformanceCounterViewer(ICaptureContext &ctx, QWidget *parent)
: QFrame(parent), ui(new Ui::PerformanceCounterViewer), m_Ctx(ctx)
{
ui->setupUi(this);
m_Ctx.AddLogViewer(this);
}
PerformanceCounterViewer::~PerformanceCounterViewer()
{
m_Ctx.BuiltinWindowClosed(this);
m_Ctx.RemoveLogViewer(this);
delete ui;
}
void PerformanceCounterViewer::OnLogfileClosed()
{
}
void PerformanceCounterViewer::OnLogfileLoaded()
{
}
@@ -0,0 +1,53 @@
/******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2017 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/
#pragma once
#include <QFrame>
#include "Code/CaptureContext.h"
namespace Ui
{
class PerformanceCounterViewer;
}
class PerformanceCounterViewer : public QFrame, public IPerformanceCounterViewer, public ILogViewer
{
Q_OBJECT
public:
explicit PerformanceCounterViewer(ICaptureContext &ctx, QWidget *parent = 0);
~PerformanceCounterViewer();
// IStatisticsViewer
QWidget *Widget() override { return this; }
// ILogViewerForm
void OnLogfileLoaded() override;
void OnLogfileClosed() override;
void OnSelectedEventChanged(uint32_t eventID) override {}
void OnEventChanged(uint32_t eventID) override {}
private:
Ui::PerformanceCounterViewer *ui;
ICaptureContext &m_Ctx;
};
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PerformanceCounterViewer</class>
<widget class="QFrame" name="PerformanceCounterViewer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>320</width>
<height>240</height>
</rect>
</property>
<property name="windowTitle">
<string>Performance Counter viewer</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>3</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="leftMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<item>
<widget class="QToolButton" name="captureCounters">
<property name="text">
<string>Capture counters</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTableWidget" name="counterResults"/>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
+6 -3
View File
@@ -217,7 +217,8 @@ SOURCES += Code/qrenderdoc.cpp \
Widgets/Extended/RDSplitter.cpp \
Windows/Dialogs/TipsDialog.cpp \
Windows/PythonShell.cpp \
Windows/Dialogs/PerformanceCounterSelection.cpp
Windows/Dialogs/PerformanceCounterSelection.cpp \
Windows/PerformanceCounterViewer.cpp
HEADERS += Code/CaptureContext.h \
Code/qprocessinfo.h \
Code/ReplayManager.h \
@@ -282,7 +283,8 @@ HEADERS += Code/CaptureContext.h \
Widgets/Extended/RDSplitter.h \
Windows/Dialogs/TipsDialog.h \
Windows/PythonShell.h \
Windows/Dialogs/PerformanceCounterSelection.h
Windows/Dialogs/PerformanceCounterSelection.h \
Windows/PerformanceCounterViewer.h
FORMS += Windows/Dialogs/AboutDialog.ui \
Windows/MainWindow.ui \
Windows/EventBrowser.ui \
@@ -314,7 +316,8 @@ FORMS += Windows/Dialogs/AboutDialog.ui \
Widgets/FindReplace.ui \
Windows/Dialogs/TipsDialog.ui \
Windows/PythonShell.ui \
Windows/Dialogs/PerformanceCounterSelection.ui
Windows/Dialogs/PerformanceCounterSelection.ui \
Windows/PerformanceCounterViewer.ui
RESOURCES += Resources/resources.qrc
+15
View File
@@ -593,6 +593,7 @@
<ClCompile Include="$(IntDir)generated\moc_OrderedListEditor.cpp" />
<ClCompile Include="$(IntDir)generated\moc_RemoteManager.cpp" />
<ClCompile Include="$(IntDir)generated\moc_PerformanceCounterSelection.cpp" />
<ClCompile Include="$(IntDir)generated\moc_PerformanceCounterViewer.cpp" />
<ClCompile Include="$(IntDir)generated\moc_PipelineStateViewer.cpp" />
<ClCompile Include="$(IntDir)generated\moc_PythonContext.cpp" />
<ClCompile Include="$(IntDir)generated\moc_QRDUtils.cpp" />
@@ -709,6 +710,7 @@
<ClCompile Include="Windows\ShaderViewer.cpp" />
<ClCompile Include="Windows\PythonShell.cpp" />
<ClCompile Include="Windows\PixelHistoryView.cpp" />
<ClCompile Include="Windows\PerformanceCounterViewer.cpp" />
<ClCompile Include="Windows\StatisticsViewer.cpp" />
<ClCompile Include="Windows\TimelineBar.cpp" />
<ClCompile Include="Windows\TextureViewer.cpp" />
@@ -891,6 +893,7 @@
<ClInclude Include="$(IntDir)generated\ui_ShaderViewer.h" />
<ClInclude Include="$(IntDir)generated\ui_PythonShell.h" />
<ClInclude Include="$(IntDir)generated\ui_PixelHistoryView.h" />
<ClInclude Include="$(IntDir)generated\ui_PerformanceCounterViewer.h" />
<ClInclude Include="$(IntDir)generated\ui_StatisticsViewer.h" />
<ClInclude Include="$(IntDir)generated\ui_SuggestRemoteDialog.h" />
<ClInclude Include="$(IntDir)generated\ui_TextureSaveDialog.h" />
@@ -1211,6 +1214,12 @@
<Message>MOC %(Filename).h</Message>
<Outputs>$(IntDir)generated\moc_%(Filename).cpp</Outputs>
</CustomBuild>
<CustomBuild Include="Windows\PerformanceCounterViewer.h">
<AdditionalInputs>%(Fullpath);$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe;%(AdditionalInputs)</AdditionalInputs>
<Command>$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe -DUNICODE -DWIN32 -DWIN64 -D_WIN32 -D_WIN64 -DRENDERDOC_PLATFORM_WIN32 -DSCINTILLA_QT=1 -DSCI_LEXER=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1900 -I$(ProjectDir) -I$(SolutionDir)\renderdoc\api\replay -I$(ProjectDir)3rdparty\qt\$(Platform)\mkspecs/win32-msvc2015 -I$(ProjectDir)3rdparty\qt\$(Platform)\include -I$(ProjectDir)3rdparty\qt\$(Platform)\include\QtWidgets -I$(ProjectDir)3rdparty\qt\$(Platform)\include\QtGui -I$(ProjectDir)3rdparty\qt\$(Platform)\include\QtCore %(Fullpath) -o $(IntDir)generated\moc_%(Filename).cpp</Command>
<Message>MOC %(Filename).h</Message>
<Outputs>$(IntDir)generated\moc_%(Filename).cpp</Outputs>
</CustomBuild>
<CustomBuild Include="Windows\StatisticsViewer.h">
<AdditionalInputs>%(Fullpath);$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe;%(AdditionalInputs)</AdditionalInputs>
<Command>"$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe" -DUNICODE -DWIN32 -DWIN64 -D_WIN32 -D_WIN64 -DRENDERDOC_PLATFORM_WIN32 -DSCINTILLA_QT=1 -DSCI_LEXER=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1900 -I"$(ProjectDir)." -I"$(SolutionDir)\renderdoc\api\replay" -I"$(ProjectDir)3rdparty\qt\$(Platform)\mkspecs/win32-msvc2015" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include\QtWidgets" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include\QtGui" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include\QtCore" "%(Fullpath)" -o "$(IntDir)generated\moc_%(Filename).cpp"</Command>
@@ -1417,6 +1426,12 @@
<Message>UIC %(Filename).ui</Message>
<Outputs>$(IntDir)generated\ui_%(Filename).h</Outputs>
</CustomBuild>
<CustomBuild Include="Windows\PerformanceCounterViewer.ui">
<AdditionalInputs>%(Fullpath);$(ProjectDir)3rdparty\qt\$(Platform)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
<Command>$(ProjectDir)3rdparty\qt\$(Platform)\bin\uic.exe %(Fullpath) -o $(IntDir)generated\ui_%(Filename).h</Command>
<Message>UIC %(Filename).ui</Message>
<Outputs>$(IntDir)generated\ui_%(Filename).h</Outputs>
</CustomBuild>
<CustomBuild Include="Windows\StatisticsViewer.ui">
<AdditionalInputs>%(Fullpath);$(ProjectDir)3rdparty\qt\$(Platform)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
<Command>"$(ProjectDir)3rdparty\qt\$(Platform)\bin\uic.exe" "%(Fullpath)" -o "$(IntDir)generated\ui_%(Filename).h"</Command>
+27 -3
View File
@@ -654,6 +654,15 @@
<ClCompile Include="Windows\Dialogs\PerformanceCounterSelection.cpp">
<Filter>Windows\Dialogs</Filter>
</ClCompile>
<ClCompile Include="Windows\PerformanceCounterViewer.cpp">
<Filter>Windows</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)generated\moc_PerformanceCounterSelection.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)generated\moc_PerformanceCounterViewer.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="3rdparty\flowlayout\FlowLayout.h">
@@ -971,6 +980,12 @@
<ClInclude Include="Windows\Dialogs\PerformanceCounterSelection.h">
<Filter>Windows\Dialogs</Filter>
</ClInclude>
<ClInclude Include="$(IntDir)generated\ui_PerformanceCounterSelection.h">
<Filter>Generated Files</Filter>
</ClInclude>
<ClInclude Include="$(IntDir)generated\ui_PerformanceCounterViewer.h">
<Filter>Generated Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="Resources\128.png">
@@ -1153,9 +1168,6 @@
<None Include="Code\pyrenderdoc\pyconversion.i">
<Filter>Code\pyrenderdoc</Filter>
</None>
<None Include="Windows\Dialogs\PerformanceCounterSelection.ui">
<Filter>Windows\Dialogs</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Resources\qrenderdoc.rc">
@@ -1454,5 +1466,17 @@
<CustomBuild Include="Styles\RDTweakedNativeStyle\RDTweakedNativeStyle.h">
<Filter>Styles\RDTweakedNativeStyle</Filter>
</CustomBuild>
<CustomBuild Include="Windows\Dialogs\PerformanceCounterSelection.h">
<Filter>Windows\Dialogs</Filter>
</CustomBuild>
<CustomBuild Include="Windows\Dialogs\PerformanceCounterSelection.ui">
<Filter>Windows\Dialogs</Filter>
</CustomBuild>
<CustomBuild Include="Windows\PerformanceCounterViewer.h">
<Filter>Windows</Filter>
</CustomBuild>
<CustomBuild Include="Windows\PerformanceCounterViewer.ui">
<Filter>Windows</Filter>
</CustomBuild>
</ItemGroup>
</Project>