2017-11-30 22:21:08 +03:00
|
|
|
/************************************************************************
|
|
|
|
* file name : arbitrary_value_inspector.h
|
|
|
|
* ----------------- :
|
|
|
|
* creation time : 2017/11/30
|
|
|
|
* author : Victor Zarubkin
|
|
|
|
* email : v.s.zarubkin@gmail.com
|
|
|
|
* ----------------- :
|
|
|
|
* description : The file contains declaration of .
|
|
|
|
* ----------------- :
|
|
|
|
* change log : * 2017/11/30 Victor Zarubkin: initial commit.
|
|
|
|
* :
|
|
|
|
* : *
|
|
|
|
* ----------------- :
|
|
|
|
* license : Lightweight profiler library for c++
|
2019-10-20 16:12:37 +03:00
|
|
|
* : Copyright(C) 2016-2019 Sergey Yagovtsev, Victor Zarubkin
|
2017-11-30 22:21:08 +03:00
|
|
|
* :
|
|
|
|
* : Licensed under either of
|
|
|
|
* : * MIT license (LICENSE.MIT or http://opensource.org/licenses/MIT)
|
|
|
|
* : * Apache License, Version 2.0, (LICENSE.APACHE or http://www.apache.org/licenses/LICENSE-2.0)
|
|
|
|
* : at your option.
|
|
|
|
* :
|
|
|
|
* : The MIT License
|
|
|
|
* :
|
|
|
|
* : 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.
|
|
|
|
* :
|
|
|
|
* : The Apache License, Version 2.0 (the "License")
|
|
|
|
* :
|
|
|
|
* : You may not use this file except in compliance with the License.
|
|
|
|
* : You may obtain a copy of the License at
|
|
|
|
* :
|
|
|
|
* : http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* :
|
|
|
|
* : Unless required by applicable law or agreed to in writing, software
|
|
|
|
* : distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* : See the License for the specific language governing permissions and
|
|
|
|
* : limitations under the License.
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef EASY_PROFILER_GUI_ARBITRARY_VALUE_INSPECTOR_H
|
|
|
|
#define EASY_PROFILER_GUI_ARBITRARY_VALUE_INSPECTOR_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
2017-12-04 20:29:45 +03:00
|
|
|
#include <QTreeWidget>
|
|
|
|
#include <QTreeWidgetItem>
|
2017-11-30 22:21:08 +03:00
|
|
|
#include <QTimer>
|
|
|
|
#include <QPointF>
|
2017-12-28 00:23:14 +03:00
|
|
|
#include <QList>
|
|
|
|
#include <easy/serialized_block.h>
|
|
|
|
#include <easy/reader.h>
|
|
|
|
#include <easy/utility.h>
|
2017-11-30 22:21:08 +03:00
|
|
|
#include <unordered_map>
|
2018-02-09 21:06:18 +03:00
|
|
|
#include <map>
|
2017-11-30 22:21:08 +03:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2018-02-09 21:06:18 +03:00
|
|
|
#include <functional>
|
2017-11-30 22:21:08 +03:00
|
|
|
#include <atomic>
|
2017-12-28 00:23:14 +03:00
|
|
|
#include <memory>
|
2018-01-21 19:37:44 +03:00
|
|
|
#include "graphics_slider_area.h"
|
2018-01-28 20:52:17 +03:00
|
|
|
#include "thread_pool_task.h"
|
2017-11-30 22:21:08 +03:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-12-28 00:23:14 +03:00
|
|
|
using Points = std::vector<QPointF>;
|
2017-11-30 22:21:08 +03:00
|
|
|
using ArbitraryValues = std::vector<const profiler::ArbitraryValue*>;
|
2018-02-09 21:06:18 +03:00
|
|
|
using Durations = std::vector<profiler::timestamp_t>;
|
|
|
|
using ComplexityValuesMap = std::map<double, Durations>;
|
|
|
|
|
|
|
|
enum class ChartType : uint8_t
|
|
|
|
{
|
|
|
|
Regular = 0, ///< Regular chart; X axis = time, Y axis = value
|
|
|
|
Complexity ///< Complexity chart; X axis = value, Y axis = duration
|
|
|
|
};
|
|
|
|
|
2018-02-16 20:51:33 +03:00
|
|
|
enum class FilterType : uint8_t
|
|
|
|
{
|
|
|
|
None = 0,
|
|
|
|
Gauss,
|
|
|
|
Median,
|
|
|
|
};
|
|
|
|
|
2018-02-09 21:06:18 +03:00
|
|
|
enum class ChartPenStyle : uint8_t
|
|
|
|
{
|
|
|
|
Line = 0,
|
|
|
|
Points
|
|
|
|
};
|
2017-11-30 22:21:08 +03:00
|
|
|
|
|
|
|
class ArbitraryValuesCollection EASY_FINAL
|
|
|
|
{
|
2017-12-28 00:23:14 +03:00
|
|
|
public:
|
|
|
|
|
|
|
|
enum JobStatus : uint8_t { Idle = 0, Ready, InProgress };
|
|
|
|
enum JobType : uint8_t { None = 0, ValuesJob = 1 << 0, PointsJob = 1 << 1 };
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
using This = ArbitraryValuesCollection;
|
|
|
|
|
2018-02-27 21:48:15 +03:00
|
|
|
ArbitraryValues m_values;
|
2018-02-09 21:06:18 +03:00
|
|
|
ComplexityValuesMap m_complexityMap;
|
|
|
|
Points m_points;
|
|
|
|
ThreadPoolTask m_worker;
|
|
|
|
profiler::timestamp_t m_beginTime;
|
|
|
|
profiler::timestamp_t m_minDuration;
|
|
|
|
profiler::timestamp_t m_maxDuration;
|
|
|
|
qreal m_minValue;
|
|
|
|
qreal m_maxValue;
|
|
|
|
std::atomic<uint8_t> m_status;
|
|
|
|
std::atomic_bool m_bInterrupt;
|
|
|
|
ChartType m_chartType;
|
|
|
|
uint8_t m_jobType;
|
2017-11-30 22:21:08 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
explicit ArbitraryValuesCollection();
|
|
|
|
~ArbitraryValuesCollection();
|
|
|
|
|
2018-02-09 21:06:18 +03:00
|
|
|
ChartType chartType() const;
|
2018-02-27 21:48:15 +03:00
|
|
|
const ArbitraryValues& values() const;
|
2018-02-09 21:06:18 +03:00
|
|
|
const ComplexityValuesMap& complexityMap() const;
|
2017-12-28 00:23:14 +03:00
|
|
|
const Points& points() const;
|
|
|
|
JobStatus status() const;
|
2017-11-30 22:21:08 +03:00
|
|
|
|
2018-02-09 21:06:18 +03:00
|
|
|
profiler::timestamp_t minDuration() const;
|
|
|
|
profiler::timestamp_t maxDuration() const;
|
|
|
|
|
2017-12-28 00:23:14 +03:00
|
|
|
qreal minValue() const;
|
|
|
|
qreal maxValue() const;
|
|
|
|
|
2018-03-07 20:52:39 +03:00
|
|
|
void collectValues(ChartType _chartType, profiler::thread_id_t _threadId, profiler::vin_t _valueId
|
|
|
|
, const char* _valueName, profiler::block_id_t _parentBlockId, int _index = -1);
|
|
|
|
|
2017-12-28 00:23:14 +03:00
|
|
|
bool calculatePoints(profiler::timestamp_t _beginTime);
|
2018-02-09 21:06:18 +03:00
|
|
|
|
2018-03-07 20:52:39 +03:00
|
|
|
void collectValuesAndPoints(ChartType _chartType, profiler::thread_id_t _threadId, profiler::vin_t _valueId
|
|
|
|
, const char* _valueName, profiler::timestamp_t _beginTime, profiler::block_id_t _parentBlockId
|
|
|
|
, int _index = -1);
|
|
|
|
|
2017-11-30 22:21:08 +03:00
|
|
|
void interrupt();
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2017-12-28 00:23:14 +03:00
|
|
|
void setStatus(JobStatus _status);
|
2018-03-07 20:52:39 +03:00
|
|
|
|
|
|
|
void collectById(profiler::thread_id_t _threadId, profiler::vin_t _valueId
|
|
|
|
, profiler::block_id_t _parentBlockId, int _index);
|
|
|
|
|
|
|
|
void collectByName(profiler::thread_id_t _threadId, const std::string _valueName
|
|
|
|
, profiler::block_id_t _parentBlockId, int _index);
|
|
|
|
|
|
|
|
bool collectByIdForThread(const profiler::BlocksTreeRoot& _threadRoot, profiler::vin_t _valueId
|
|
|
|
, bool _calculatePoints, profiler::block_id_t _parentBlockId, int _index);
|
|
|
|
|
|
|
|
bool collectByNameForThread(const profiler::BlocksTreeRoot& _threadRoot, const std::string& _valueName
|
|
|
|
, bool _calculatePoints, profiler::block_id_t _parentBlockId, int _index);
|
2017-12-28 00:23:14 +03:00
|
|
|
|
2018-02-09 21:06:18 +03:00
|
|
|
bool depthFirstSearch(const profiler::BlocksTreeRoot& _threadRoot, bool _calculatePoints
|
2018-03-07 20:52:39 +03:00
|
|
|
, profiler::block_id_t _parentBlockId, int _index
|
|
|
|
, std::function<bool(profiler::vin_t, const char*)> _isSuitableValue);
|
2018-02-09 21:06:18 +03:00
|
|
|
|
2018-03-07 20:52:39 +03:00
|
|
|
double addPoint(const profiler::ArbitraryValue& _value, int _index);
|
|
|
|
QPointF point(const profiler::ArbitraryValue& _value, int _index) const;
|
2017-11-30 22:21:08 +03:00
|
|
|
|
|
|
|
}; // end of class ArbitraryValuesCollection.
|
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
struct CollectionPaintData EASY_FINAL
|
2017-12-28 00:23:14 +03:00
|
|
|
{
|
|
|
|
const ArbitraryValuesCollection* ptr;
|
|
|
|
QRgb color;
|
2018-02-09 21:06:18 +03:00
|
|
|
ChartPenStyle chartPenStyle;
|
2017-12-28 00:23:14 +03:00
|
|
|
bool selected;
|
|
|
|
};
|
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
using Collections = std::vector<CollectionPaintData>;
|
2017-12-28 00:23:14 +03:00
|
|
|
|
2017-11-30 22:21:08 +03:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
class ArbitraryValuesChartItem : public GraphicsImageItem
|
2017-11-30 22:21:08 +03:00
|
|
|
{
|
2018-01-21 19:37:44 +03:00
|
|
|
using Parent = GraphicsImageItem;
|
|
|
|
using This = ArbitraryValuesChartItem;
|
2017-11-30 22:21:08 +03:00
|
|
|
|
2018-02-09 21:06:18 +03:00
|
|
|
Collections m_collections;
|
|
|
|
qreal m_workerMaxValue;
|
|
|
|
qreal m_workerMinValue;
|
|
|
|
profiler::timestamp_t m_workerMaxDuration;
|
|
|
|
profiler::timestamp_t m_workerMinDuration;
|
|
|
|
profiler::timestamp_t m_maxDuration;
|
|
|
|
profiler::timestamp_t m_minDuration;
|
2018-02-16 20:51:33 +03:00
|
|
|
int m_filterWindowSize;
|
2018-02-09 21:06:18 +03:00
|
|
|
ChartType m_chartType;
|
2018-02-16 20:51:33 +03:00
|
|
|
FilterType m_filterType;
|
2017-11-30 22:21:08 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
explicit ArbitraryValuesChartItem();
|
|
|
|
~ArbitraryValuesChartItem() override;
|
2017-11-30 22:21:08 +03:00
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
void paint(QPainter* _painter, const QStyleOptionGraphicsItem* _option, QWidget* _widget) override;
|
2017-11-30 22:21:08 +03:00
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
bool updateImage() override;
|
2017-11-30 22:21:08 +03:00
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
protected:
|
|
|
|
|
|
|
|
void onImageUpdated() override;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
void clear();
|
2017-12-28 00:23:14 +03:00
|
|
|
void update(Collections _collections);
|
|
|
|
void update(const ArbitraryValuesCollection* _selected);
|
2018-02-09 21:06:18 +03:00
|
|
|
void setChartType(ChartType _chartType);
|
2018-02-16 20:51:33 +03:00
|
|
|
void setFilterType(FilterType _filterType);
|
|
|
|
void setFilterWindowSize(int _size);
|
|
|
|
|
2018-02-09 21:06:18 +03:00
|
|
|
ChartType chartType() const;
|
2018-02-16 20:51:33 +03:00
|
|
|
FilterType filterType() const;
|
|
|
|
int filterWindowSize() const;
|
2017-12-28 00:23:14 +03:00
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
private:
|
|
|
|
|
|
|
|
void paintMouseIndicator(QPainter* _painter, qreal _top, qreal _bottom, qreal _width, qreal _height, int _font_h,
|
|
|
|
qreal _visibleRegionLeft, qreal _visibleRegionWidth);
|
|
|
|
|
2018-02-09 21:06:18 +03:00
|
|
|
void updateRegularImageAsync(QRectF _boundingRect, qreal _current_scale, qreal _minimum, qreal _maximum
|
|
|
|
, qreal _range, qreal _value, qreal _width, bool _bindMode, profiler::timestamp_t _begin_time, bool _autoAdjust);
|
|
|
|
|
|
|
|
void updateComplexityImageAsync(QRectF _boundingRect, qreal _current_scale, qreal _minimum, qreal _maximum
|
|
|
|
, qreal _range, qreal _value, qreal _width, bool _bindMode, profiler::timestamp_t _begin_time, bool _autoAdjust);
|
|
|
|
|
|
|
|
void drawGrid(QPainter& _painter, int _width, int _height) const;
|
2018-01-21 19:37:44 +03:00
|
|
|
|
|
|
|
}; // end of class ArbitraryValuesChartItem.
|
2017-12-28 00:23:14 +03:00
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
class GraphicsChart : public GraphicsSliderArea
|
2017-11-30 22:21:08 +03:00
|
|
|
{
|
2017-12-28 00:23:14 +03:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
2017-11-30 22:21:08 +03:00
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
using Parent = GraphicsSliderArea;
|
|
|
|
using This = GraphicsChart;
|
2017-12-28 00:23:14 +03:00
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
ArbitraryValuesChartItem* m_chartItem;
|
2017-11-30 22:21:08 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
explicit GraphicsChart(QWidget* _parent = nullptr);
|
|
|
|
~GraphicsChart() override;
|
2017-11-30 22:21:08 +03:00
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
void clear() override;
|
2017-11-30 22:21:08 +03:00
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
public:
|
2017-11-30 22:21:08 +03:00
|
|
|
|
2018-01-28 02:01:49 +03:00
|
|
|
void cancelImageUpdate();
|
2017-12-28 00:23:14 +03:00
|
|
|
void update(Collections _collections);
|
|
|
|
void update(const ArbitraryValuesCollection* _selected);
|
2018-02-09 21:06:18 +03:00
|
|
|
void setChartType(ChartType _chartType);
|
2018-02-16 20:51:33 +03:00
|
|
|
void setFilterType(FilterType _filterType);
|
|
|
|
void setFilterWindowSize(int _size);
|
|
|
|
|
2018-02-09 21:06:18 +03:00
|
|
|
ChartType chartType() const;
|
2018-02-16 20:51:33 +03:00
|
|
|
FilterType filterType() const;
|
|
|
|
int filterWindowSize() const;
|
2017-12-28 00:23:14 +03:00
|
|
|
|
2018-02-22 20:56:28 +03:00
|
|
|
protected:
|
|
|
|
|
2019-10-28 19:14:05 +03:00
|
|
|
bool canShowSlider() const override;
|
2018-02-22 20:56:28 +03:00
|
|
|
|
2018-01-28 02:01:49 +03:00
|
|
|
private slots:
|
|
|
|
|
|
|
|
void onAutoAdjustChartChanged();
|
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
}; // end of class GraphicsChart.
|
2017-11-30 22:21:08 +03:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
class ArbitraryTreeWidgetItem : public QTreeWidgetItem
|
2017-12-04 20:29:45 +03:00
|
|
|
{
|
|
|
|
using Parent = QTreeWidgetItem;
|
2018-01-21 19:37:44 +03:00
|
|
|
using This = ArbitraryTreeWidgetItem;
|
2017-12-28 00:23:14 +03:00
|
|
|
using CollectionPtr = std::unique_ptr<ArbitraryValuesCollection>;
|
|
|
|
|
2018-03-12 01:47:20 +03:00
|
|
|
const profiler::ArbitraryValue& m_value;
|
2018-01-25 23:21:56 +03:00
|
|
|
QFont m_font;
|
2017-12-28 00:23:14 +03:00
|
|
|
CollectionPtr m_collection;
|
|
|
|
profiler::color_t m_color;
|
|
|
|
int m_widthHint;
|
2017-12-04 20:29:45 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2018-03-12 01:47:20 +03:00
|
|
|
explicit ArbitraryTreeWidgetItem(QTreeWidgetItem* _parent, bool _checkable, profiler::color_t _color, const profiler::ArbitraryValue& _value);
|
2018-01-21 19:37:44 +03:00
|
|
|
~ArbitraryTreeWidgetItem() override;
|
2017-12-04 20:29:45 +03:00
|
|
|
|
2017-12-28 00:23:14 +03:00
|
|
|
QVariant data(int _column, int _role) const override;
|
2017-12-04 20:29:45 +03:00
|
|
|
|
2018-03-12 01:47:20 +03:00
|
|
|
const profiler::ArbitraryValue& value() const;
|
|
|
|
|
2017-12-28 00:23:14 +03:00
|
|
|
void setWidthHint(int _width);
|
2018-01-25 23:21:56 +03:00
|
|
|
void setBold(bool _isBold);
|
2017-12-04 20:29:45 +03:00
|
|
|
|
2017-12-28 00:23:14 +03:00
|
|
|
const ArbitraryValuesCollection* collection() const;
|
2018-01-28 02:01:49 +03:00
|
|
|
ArbitraryValuesCollection* collection();
|
2018-02-09 21:06:18 +03:00
|
|
|
void collectValues(profiler::thread_id_t _threadId, ChartType _chartType);
|
2017-12-28 00:23:14 +03:00
|
|
|
void interrupt();
|
|
|
|
|
|
|
|
profiler::color_t color() const;
|
|
|
|
|
2018-03-07 20:52:39 +03:00
|
|
|
bool isArrayItem() const;
|
2018-03-12 01:47:20 +03:00
|
|
|
int getSelfIndexInArray() const;
|
2018-03-07 20:52:39 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
profiler::block_id_t getParentBlockId(QTreeWidgetItem* _item) const;
|
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
}; // end of class ArbitraryTreeWidgetItem.
|
2017-12-28 00:23:14 +03:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2017-12-04 20:29:45 +03:00
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
class ArbitraryValuesWidget : public QWidget
|
2017-12-04 20:29:45 +03:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
using Parent = QWidget;
|
2018-01-21 19:37:44 +03:00
|
|
|
using This = ArbitraryValuesWidget;
|
2017-12-04 20:29:45 +03:00
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
QTimer m_collectionsTimer;
|
|
|
|
QList<ArbitraryTreeWidgetItem*> m_checkedItems;
|
2019-10-20 16:12:37 +03:00
|
|
|
std::vector<int> m_columnsMinimumWidth;
|
2018-01-21 19:37:44 +03:00
|
|
|
class QSplitter* m_splitter;
|
|
|
|
QTreeWidget* m_treeWidget;
|
|
|
|
GraphicsChart* m_chart;
|
2018-02-16 20:51:33 +03:00
|
|
|
class QLabel* m_filterBoxLabel;
|
|
|
|
class QComboBox* m_filterComboBox;
|
|
|
|
class QLabel* m_filterWindowLabel;
|
|
|
|
class QSpinBox* m_filterWindowPicker;
|
2018-02-20 22:11:43 +03:00
|
|
|
class QAction* m_exportToCsvAction;
|
2018-01-25 23:21:56 +03:00
|
|
|
ArbitraryTreeWidgetItem* m_boldItem;
|
2018-03-13 01:28:58 +03:00
|
|
|
profiler::thread_id_t m_threadId;
|
|
|
|
profiler::block_index_t m_blockIndex;
|
|
|
|
profiler::block_id_t m_blockId;
|
2019-10-20 16:12:37 +03:00
|
|
|
bool m_bInitialized;
|
2018-03-13 01:28:58 +03:00
|
|
|
const bool m_bMainWidget;
|
|
|
|
|
|
|
|
explicit ArbitraryValuesWidget(bool _isMainWidget, profiler::thread_id_t _threadId
|
|
|
|
, profiler::block_index_t _blockIndex, profiler::block_id_t _blockId, QWidget* _parent);
|
|
|
|
explicit ArbitraryValuesWidget(const QList<ArbitraryTreeWidgetItem*>& _checkedItems
|
|
|
|
, QTreeWidgetItem* _currentItem, profiler::thread_id_t _threadId
|
|
|
|
, profiler::block_index_t _blockIndex, profiler::block_id_t _blockId, QWidget* _parent = nullptr);
|
2017-12-04 20:29:45 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
explicit ArbitraryValuesWidget(QWidget* _parent = nullptr);
|
|
|
|
~ArbitraryValuesWidget() override;
|
2017-12-04 20:29:45 +03:00
|
|
|
|
2019-10-20 16:12:37 +03:00
|
|
|
void showEvent(class QShowEvent* event) override;
|
2018-03-12 01:47:20 +03:00
|
|
|
void contextMenuEvent(QContextMenuEvent*) override { /* ignore context menu event */ }
|
2017-12-07 22:36:53 +03:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
2018-01-25 23:21:56 +03:00
|
|
|
void clear();
|
2017-12-07 22:36:53 +03:00
|
|
|
void rebuild();
|
2018-03-13 01:28:58 +03:00
|
|
|
void rebuild(profiler::thread_id_t _threadId, profiler::block_index_t _blockIndex, profiler::block_id_t _blockId);
|
2018-03-12 01:47:20 +03:00
|
|
|
void select(const profiler::ArbitraryValue& _value, bool _resetOthers = true);
|
2017-12-07 22:36:53 +03:00
|
|
|
|
2017-12-04 20:29:45 +03:00
|
|
|
private slots:
|
|
|
|
|
2019-10-20 16:12:37 +03:00
|
|
|
void onHeaderSectionResized(int logicalIndex, int oldSize, int newSize);
|
2018-03-13 01:28:58 +03:00
|
|
|
void onSelectedThreadChanged(profiler::thread_id_t);
|
2017-12-04 20:29:45 +03:00
|
|
|
void onSelectedBlockChanged(uint32_t _block_index);
|
|
|
|
void onSelectedBlockIdChanged(profiler::block_id_t _id);
|
2017-12-28 00:23:14 +03:00
|
|
|
void onItemDoubleClicked(QTreeWidgetItem* _item, int _column);
|
|
|
|
void onItemChanged(QTreeWidgetItem* _item, int _column);
|
|
|
|
void onCurrentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*);
|
|
|
|
void onCollectionsTimeout();
|
2018-02-09 21:06:18 +03:00
|
|
|
void onRegularChartTypeChecked(bool _checked);
|
|
|
|
void onComplexityChartTypeChecked(bool _checked);
|
2018-02-16 20:51:33 +03:00
|
|
|
void onFilterComboBoxChanged(int _index);
|
|
|
|
void onFilterWindowSizeChanged(int _size);
|
2018-02-20 22:11:43 +03:00
|
|
|
void onExportToCsvClicked(bool);
|
2018-03-13 01:28:58 +03:00
|
|
|
void onOpenInNewWindowClicked(bool);
|
2017-12-04 20:29:45 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2018-02-09 21:06:18 +03:00
|
|
|
void repaint();
|
|
|
|
|
2017-12-04 20:29:45 +03:00
|
|
|
void buildTree(profiler::thread_id_t _threadId, profiler::block_index_t _blockIndex, profiler::block_id_t _blockId);
|
2017-12-07 22:36:53 +03:00
|
|
|
QTreeWidgetItem* buildTreeForThread(const profiler::BlocksTreeRoot& _threadRoot, profiler::block_index_t _blockIndex, profiler::block_id_t _blockId);
|
2017-12-04 20:29:45 +03:00
|
|
|
|
2018-01-21 19:37:44 +03:00
|
|
|
void loadSettings();
|
|
|
|
void saveSettings();
|
|
|
|
|
|
|
|
}; // end of class ArbitraryValuesWidget.
|
2017-12-04 20:29:45 +03:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-11-30 22:21:08 +03:00
|
|
|
#endif // EASY_PROFILER_GUI_ARBITRARY_VALUE_INSPECTOR_H
|