Removed InsightWorker injection in Insight widgets
This commit is contained in:
@@ -77,7 +77,6 @@ namespace Bloom
|
||||
QApplication application;
|
||||
InsightWorker* insightWorker = new InsightWorker();
|
||||
InsightWindow* mainWindow = new InsightWindow(
|
||||
*(this->insightWorker),
|
||||
this->environmentConfig,
|
||||
this->insightConfig,
|
||||
this->insightProjectSettings
|
||||
|
||||
@@ -34,13 +34,11 @@ namespace Bloom
|
||||
using Bloom::Targets::TargetMemoryType;
|
||||
|
||||
InsightWindow::InsightWindow(
|
||||
InsightWorker& insightWorker,
|
||||
const EnvironmentConfig& environmentConfig,
|
||||
const InsightConfig& insightConfig,
|
||||
InsightProjectSettings& insightProjectSettings
|
||||
)
|
||||
: QMainWindow(nullptr)
|
||||
, insightWorker(insightWorker)
|
||||
, environmentConfig(environmentConfig)
|
||||
, targetConfig(environmentConfig.targetConfig)
|
||||
, insightConfig(insightConfig)
|
||||
@@ -525,14 +523,12 @@ namespace Bloom
|
||||
) {
|
||||
this->targetPackageWidget = new InsightTargetWidgets::Dip::DualInlinePackageWidget(
|
||||
*variant,
|
||||
this->insightWorker,
|
||||
this->ioContainerWidget
|
||||
);
|
||||
|
||||
} else if (variant->package == TargetPackage::QFP || variant->package == TargetPackage::QFN) {
|
||||
this->targetPackageWidget = new InsightTargetWidgets::Qfp::QuadFlatPackageWidget(
|
||||
*variant,
|
||||
this->insightWorker,
|
||||
this->ioContainerWidget
|
||||
);
|
||||
}
|
||||
@@ -560,7 +556,6 @@ namespace Bloom
|
||||
auto* leftPanelLayout = this->leftPanel->layout();
|
||||
this->targetRegistersSidePane = new TargetRegistersPaneWidget(
|
||||
this->targetDescriptor,
|
||||
this->insightWorker,
|
||||
*(this->insightProjectSettings.registersPaneState),
|
||||
this->leftPanel
|
||||
);
|
||||
@@ -601,7 +596,6 @@ namespace Bloom
|
||||
this->ramInspectionPane = new TargetMemoryInspectionPane(
|
||||
ramDescriptor,
|
||||
memoryInspectionPaneSettingsByMemoryType[TargetMemoryType::RAM],
|
||||
this->insightWorker,
|
||||
*(this->insightProjectSettings.ramInspectionPaneState),
|
||||
this->bottomPanel
|
||||
);
|
||||
@@ -645,7 +639,6 @@ namespace Bloom
|
||||
this->eepromInspectionPane = new TargetMemoryInspectionPane(
|
||||
eepromDescriptor,
|
||||
memoryInspectionPaneSettingsByMemoryType[TargetMemoryType::EEPROM],
|
||||
this->insightWorker,
|
||||
*(this->insightProjectSettings.eepromInspectionPaneState),
|
||||
this->bottomPanel
|
||||
);
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include "src/ProjectSettings.hpp"
|
||||
#include "src/ProjectConfig.hpp"
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
#include "src/Targets/TargetState.hpp"
|
||||
|
||||
#include "src/Targets/TargetDescriptor.hpp"
|
||||
@@ -33,7 +32,6 @@ namespace Bloom
|
||||
|
||||
public:
|
||||
InsightWindow(
|
||||
InsightWorker& insightWorker,
|
||||
const EnvironmentConfig& environmentConfig,
|
||||
const InsightConfig& insightConfig,
|
||||
InsightProjectSettings& insightProjectSettings
|
||||
@@ -65,8 +63,6 @@ namespace Bloom
|
||||
EnvironmentConfig environmentConfig;
|
||||
TargetConfig targetConfig;
|
||||
|
||||
InsightWorker& insightWorker;
|
||||
|
||||
bool activated = false;
|
||||
|
||||
Targets::TargetDescriptor targetDescriptor;
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace Bloom::Widgets
|
||||
const TargetMemoryDescriptor& targetMemoryDescriptor,
|
||||
std::vector<FocusedMemoryRegion>& focusedMemoryRegions,
|
||||
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions,
|
||||
InsightWorker& insightWorker,
|
||||
const HexViewerWidgetSettings& settings,
|
||||
Label* hoveredAddressLabel,
|
||||
QWidget* parent
|
||||
@@ -26,7 +25,6 @@ namespace Bloom::Widgets
|
||||
targetMemoryDescriptor,
|
||||
focusedMemoryRegions,
|
||||
excludedMemoryRegions,
|
||||
insightWorker,
|
||||
settings,
|
||||
hoveredAddressLabel,
|
||||
this
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
|
||||
#include "ByteItemGraphicsScene.hpp"
|
||||
#include "HexViewerWidgetSettings.hpp"
|
||||
@@ -24,7 +22,6 @@ namespace Bloom::Widgets
|
||||
const Targets::TargetMemoryDescriptor& targetMemoryDescriptor,
|
||||
std::vector<FocusedMemoryRegion>& focusedMemoryRegions,
|
||||
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions,
|
||||
InsightWorker& insightWorker,
|
||||
const HexViewerWidgetSettings& settings,
|
||||
Label* hoveredAddressLabel,
|
||||
QWidget* parent
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace Bloom::Widgets
|
||||
const TargetMemoryDescriptor& targetMemoryDescriptor,
|
||||
std::vector<FocusedMemoryRegion>& focusedMemoryRegions,
|
||||
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions,
|
||||
InsightWorker& insightWorker,
|
||||
const HexViewerWidgetSettings& settings,
|
||||
Label* hoveredAddressLabel,
|
||||
QGraphicsView* parent
|
||||
@@ -21,7 +20,6 @@ namespace Bloom::Widgets
|
||||
, targetMemoryDescriptor(targetMemoryDescriptor)
|
||||
, focusedMemoryRegions(focusedMemoryRegions)
|
||||
, excludedMemoryRegions(excludedMemoryRegions)
|
||||
, insightWorker(insightWorker)
|
||||
, settings(settings)
|
||||
, hoveredAddressLabel(hoveredAddressLabel)
|
||||
, parent(parent)
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
#include "src/Targets/TargetState.hpp"
|
||||
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
|
||||
|
||||
#include "ByteItem.hpp"
|
||||
@@ -46,7 +44,6 @@ namespace Bloom::Widgets
|
||||
const Targets::TargetMemoryDescriptor& targetMemoryDescriptor,
|
||||
std::vector<FocusedMemoryRegion>& focusedMemoryRegions,
|
||||
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions,
|
||||
InsightWorker& insightWorker,
|
||||
const HexViewerWidgetSettings& settings,
|
||||
Label* hoveredAddressLabel,
|
||||
QGraphicsView* parent
|
||||
@@ -92,7 +89,6 @@ namespace Bloom::Widgets
|
||||
std::map<std::size_t, std::vector<ByteItem*>> byteItemsByColumnIndex;
|
||||
|
||||
Targets::TargetState targetState = Targets::TargetState::UNKNOWN;
|
||||
InsightWorker& insightWorker;
|
||||
|
||||
const QMargins margins = QMargins(10, 10, 10, 10);
|
||||
const HexViewerWidgetSettings& settings;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "HexViewerWidget.hpp"
|
||||
|
||||
#include <QFile>
|
||||
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp"
|
||||
#include "src/Insight/InsightSignals.hpp"
|
||||
|
||||
@@ -17,7 +19,6 @@ namespace Bloom::Widgets
|
||||
HexViewerWidgetSettings& settings,
|
||||
std::vector<FocusedMemoryRegion>& focusedMemoryRegions,
|
||||
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
)
|
||||
: QWidget(parent)
|
||||
@@ -25,7 +26,6 @@ namespace Bloom::Widgets
|
||||
, settings(settings)
|
||||
, focusedMemoryRegions(focusedMemoryRegions)
|
||||
, excludedMemoryRegions(excludedMemoryRegions)
|
||||
, insightWorker(insightWorker)
|
||||
{
|
||||
this->setObjectName("hex-viewer-widget");
|
||||
this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||
@@ -76,7 +76,6 @@ namespace Bloom::Widgets
|
||||
this->targetMemoryDescriptor,
|
||||
this->focusedMemoryRegions,
|
||||
this->excludedMemoryRegions,
|
||||
this->insightWorker,
|
||||
this->settings,
|
||||
this->hoveredAddressLabel,
|
||||
this->byteItemGraphicsViewContainer
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
#include "src/Targets/TargetState.hpp"
|
||||
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/SvgToolButton.hpp"
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TextInput.hpp"
|
||||
@@ -33,7 +31,6 @@ namespace Bloom::Widgets
|
||||
HexViewerWidgetSettings& settings,
|
||||
std::vector<FocusedMemoryRegion>& focusedMemoryRegions,
|
||||
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
);
|
||||
|
||||
@@ -50,8 +47,6 @@ namespace Bloom::Widgets
|
||||
std::vector<FocusedMemoryRegion>& focusedMemoryRegions;
|
||||
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions;
|
||||
|
||||
InsightWorker& insightWorker;
|
||||
|
||||
HexViewerWidgetSettings& settings;
|
||||
|
||||
QWidget* container = nullptr;
|
||||
|
||||
@@ -24,14 +24,12 @@ namespace Bloom::Widgets
|
||||
TargetMemoryInspectionPane::TargetMemoryInspectionPane(
|
||||
const TargetMemoryDescriptor& targetMemoryDescriptor,
|
||||
TargetMemoryInspectionPaneSettings& settings,
|
||||
InsightWorker& insightWorker,
|
||||
PaneState& paneState,
|
||||
PanelWidget* parent
|
||||
)
|
||||
: PaneWidget(paneState, parent)
|
||||
, targetMemoryDescriptor(targetMemoryDescriptor)
|
||||
, settings(settings)
|
||||
, insightWorker(insightWorker)
|
||||
{
|
||||
this->setObjectName("target-memory-inspection-pane");
|
||||
|
||||
@@ -85,7 +83,6 @@ namespace Bloom::Widgets
|
||||
this->settings.hexViewerWidgetSettings,
|
||||
this->settings.focusedMemoryRegions,
|
||||
this->settings.excludedMemoryRegions,
|
||||
this->insightWorker,
|
||||
this
|
||||
);
|
||||
this->hexViewerWidget->setDisabled(true);
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.hpp"
|
||||
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
|
||||
#include "src/Targets/TargetState.hpp"
|
||||
@@ -31,7 +30,6 @@ namespace Bloom::Widgets
|
||||
TargetMemoryInspectionPane(
|
||||
const Targets::TargetMemoryDescriptor& targetMemoryDescriptor,
|
||||
TargetMemoryInspectionPaneSettings& settings,
|
||||
InsightWorker& insightWorker,
|
||||
PaneState& paneState,
|
||||
PanelWidget* parent
|
||||
);
|
||||
@@ -48,7 +46,6 @@ namespace Bloom::Widgets
|
||||
|
||||
private:
|
||||
const Targets::TargetMemoryDescriptor& targetMemoryDescriptor;
|
||||
InsightWorker& insightWorker;
|
||||
|
||||
std::optional<Targets::TargetMemoryBuffer> data;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "RegisterHistoryWidget.hpp"
|
||||
|
||||
#include <QFile>
|
||||
#include <QVBoxLayout>
|
||||
#include <QMargins>
|
||||
#include <QTableWidget>
|
||||
@@ -25,12 +26,10 @@ namespace Bloom::Widgets
|
||||
RegisterHistoryWidget::RegisterHistoryWidget(
|
||||
const Targets::TargetRegisterDescriptor& registerDescriptor,
|
||||
const Targets::TargetMemoryBuffer& currentValue,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
)
|
||||
: QWidget(parent)
|
||||
, registerDescriptor(registerDescriptor)
|
||||
, insightWorker(insightWorker)
|
||||
{
|
||||
this->setObjectName("target-register-history-widget");
|
||||
this->setFixedWidth(300);
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
#include "CurrentItem.hpp"
|
||||
#include "RegisterHistoryItem.hpp"
|
||||
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
|
||||
namespace Bloom::Widgets
|
||||
{
|
||||
class RegisterHistoryWidget: public QWidget
|
||||
@@ -28,7 +26,6 @@ namespace Bloom::Widgets
|
||||
RegisterHistoryWidget(
|
||||
const Targets::TargetRegisterDescriptor& registerDescriptor,
|
||||
const Targets::TargetMemoryBuffer& currentValue,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
);
|
||||
|
||||
@@ -50,7 +47,6 @@ namespace Bloom::Widgets
|
||||
|
||||
private:
|
||||
Targets::TargetRegisterDescriptor registerDescriptor;
|
||||
InsightWorker& insightWorker;
|
||||
|
||||
QWidget* container = nullptr;
|
||||
QWidget* itemContainer = nullptr;
|
||||
|
||||
@@ -26,14 +26,12 @@ namespace Bloom::Widgets
|
||||
|
||||
TargetRegisterInspectorWindow::TargetRegisterInspectorWindow(
|
||||
const Targets::TargetRegisterDescriptor& registerDescriptor,
|
||||
InsightWorker& insightWorker,
|
||||
TargetState currentTargetState,
|
||||
const std::optional<Targets::TargetMemoryBuffer>& registerValue,
|
||||
QWidget* parent
|
||||
)
|
||||
: QWidget(parent)
|
||||
, registerDescriptor(registerDescriptor)
|
||||
, insightWorker(insightWorker)
|
||||
, registerValue(registerValue.value_or(Targets::TargetMemoryBuffer(registerDescriptor.size, 0)))
|
||||
{
|
||||
this->setWindowFlag(Qt::Window);
|
||||
@@ -91,7 +89,6 @@ namespace Bloom::Widgets
|
||||
this->registerHistoryWidget = new RegisterHistoryWidget(
|
||||
this->registerDescriptor,
|
||||
this->registerValue,
|
||||
insightWorker,
|
||||
this->container
|
||||
);
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
#include "BitsetWidget/BitsetWidget.hpp"
|
||||
#include "RegisterHistoryWidget/RegisterHistoryWidget.hpp"
|
||||
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
|
||||
namespace Bloom::Widgets
|
||||
{
|
||||
class TargetRegisterInspectorWindow: public QWidget
|
||||
@@ -28,7 +26,6 @@ namespace Bloom::Widgets
|
||||
public:
|
||||
TargetRegisterInspectorWindow(
|
||||
const Targets::TargetRegisterDescriptor& registerDescriptor,
|
||||
InsightWorker& insightWorker,
|
||||
Targets::TargetState currentTargetState,
|
||||
const std::optional<Targets::TargetMemoryBuffer>& registerValue = std::nullopt,
|
||||
QWidget* parent = nullptr
|
||||
@@ -44,7 +41,6 @@ namespace Bloom::Widgets
|
||||
private:
|
||||
Targets::TargetRegisterDescriptor registerDescriptor;
|
||||
Targets::TargetMemoryBuffer registerValue;
|
||||
InsightWorker& insightWorker;
|
||||
|
||||
QWidget* container = nullptr;
|
||||
Label* registerNameLabel = nullptr;
|
||||
|
||||
@@ -10,16 +10,16 @@
|
||||
|
||||
namespace Bloom::Widgets
|
||||
{
|
||||
using namespace Bloom::Exceptions;
|
||||
|
||||
using Bloom::Targets::TargetRegisterDescriptor;
|
||||
|
||||
RegisterGroupWidget::RegisterGroupWidget(
|
||||
QString name,
|
||||
const std::set<TargetRegisterDescriptor>& registerDescriptors,
|
||||
InsightWorker& insightWorker,
|
||||
TargetRegistersPaneWidget* parent
|
||||
): ItemWidget(parent), name(std::move(name)) {
|
||||
)
|
||||
: ItemWidget(parent)
|
||||
, name(std::move(name))
|
||||
{
|
||||
this->setObjectName(this->name);
|
||||
|
||||
this->headerWidget->setObjectName("register-group-header");
|
||||
@@ -64,7 +64,7 @@ namespace Bloom::Widgets
|
||||
continue;
|
||||
}
|
||||
|
||||
auto* registerWidget = new RegisterWidget(descriptor, insightWorker, this->bodyWidget);
|
||||
auto* registerWidget = new RegisterWidget(descriptor, this->bodyWidget);
|
||||
bodyLayout->addWidget(registerWidget, 0, Qt::AlignmentFlag::AlignTop);
|
||||
|
||||
QObject::connect(
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include "TargetRegistersPaneWidget.hpp"
|
||||
#include "ItemWidget.hpp"
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.hpp"
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/SvgWidget.hpp"
|
||||
@@ -31,7 +30,6 @@ namespace Bloom::Widgets
|
||||
RegisterGroupWidget(
|
||||
QString name,
|
||||
const std::set<Targets::TargetRegisterDescriptor>& registerDescriptors,
|
||||
InsightWorker& insightWorker,
|
||||
TargetRegistersPaneWidget* parent
|
||||
);
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ namespace Bloom::Widgets
|
||||
|
||||
RegisterWidget::RegisterWidget(
|
||||
TargetRegisterDescriptor descriptor,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget *parent
|
||||
)
|
||||
: ItemWidget(parent)
|
||||
@@ -27,7 +26,6 @@ namespace Bloom::Widgets
|
||||
, searchKeywords(QString::fromStdString(
|
||||
this->descriptor.name.value_or("") + this->descriptor.description.value_or("")
|
||||
).toLower())
|
||||
, insightWorker(insightWorker)
|
||||
{
|
||||
this->setObjectName("register-item");
|
||||
this->setFixedHeight(25);
|
||||
@@ -139,7 +137,6 @@ namespace Bloom::Widgets
|
||||
if (this->inspectWindow == nullptr) {
|
||||
this->inspectWindow = new TargetRegisterInspectorWindow(
|
||||
this->descriptor,
|
||||
this->insightWorker,
|
||||
this->targetState,
|
||||
this->currentRegister.has_value() ? std::optional(this->currentRegister->value)
|
||||
: std::nullopt,
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <QString>
|
||||
|
||||
#include "ItemWidget.hpp"
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/SvgWidget.hpp"
|
||||
@@ -29,7 +28,6 @@ namespace Bloom::Widgets
|
||||
|
||||
RegisterWidget(
|
||||
Targets::TargetRegisterDescriptor descriptor,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget *parent
|
||||
);
|
||||
|
||||
@@ -52,7 +50,6 @@ namespace Bloom::Widgets
|
||||
void copyValueBinary();
|
||||
|
||||
private:
|
||||
InsightWorker& insightWorker;
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
SvgWidget* registerIcon = new SvgWidget(this);
|
||||
Label* nameLabel = new Label(this);
|
||||
|
||||
@@ -25,13 +25,11 @@ namespace Bloom::Widgets
|
||||
|
||||
TargetRegistersPaneWidget::TargetRegistersPaneWidget(
|
||||
const TargetDescriptor& targetDescriptor,
|
||||
InsightWorker& insightWorker,
|
||||
PaneState& paneState,
|
||||
PanelWidget* parent
|
||||
)
|
||||
: PaneWidget(paneState, parent)
|
||||
, targetDescriptor(targetDescriptor)
|
||||
, insightWorker(insightWorker)
|
||||
{
|
||||
this->setObjectName("target-registers-side-pane");
|
||||
|
||||
@@ -86,7 +84,6 @@ namespace Bloom::Widgets
|
||||
auto* generalPurposeRegisterGroupWidget = new RegisterGroupWidget(
|
||||
"CPU General Purpose",
|
||||
this->renderedDescriptors,
|
||||
insightWorker,
|
||||
this
|
||||
);
|
||||
|
||||
@@ -106,7 +103,6 @@ namespace Bloom::Widgets
|
||||
auto* registerGroupWidget = new RegisterGroupWidget(
|
||||
QString::fromStdString(groupName).toUpper(),
|
||||
registerDescriptors,
|
||||
insightWorker,
|
||||
this
|
||||
);
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
#include "ItemWidget.hpp"
|
||||
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/SvgToolButton.hpp"
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
#include "src/Targets/TargetState.hpp"
|
||||
#include "src/Targets/TargetDescriptor.hpp"
|
||||
|
||||
@@ -28,7 +27,6 @@ namespace Bloom::Widgets
|
||||
public:
|
||||
TargetRegistersPaneWidget(
|
||||
const Targets::TargetDescriptor& targetDescriptor,
|
||||
InsightWorker& insightWorker,
|
||||
PaneState& paneState,
|
||||
PanelWidget *parent
|
||||
);
|
||||
@@ -46,7 +44,6 @@ namespace Bloom::Widgets
|
||||
|
||||
private:
|
||||
const Targets::TargetDescriptor& targetDescriptor;
|
||||
InsightWorker& insightWorker;
|
||||
|
||||
QWidget* container = nullptr;
|
||||
|
||||
|
||||
@@ -10,16 +10,13 @@
|
||||
|
||||
namespace Bloom::Widgets::InsightTargetWidgets::Dip
|
||||
{
|
||||
using namespace Bloom::Exceptions;
|
||||
|
||||
using Bloom::Targets::TargetVariant;
|
||||
|
||||
DualInlinePackageWidget::DualInlinePackageWidget(
|
||||
const TargetVariant& targetVariant,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
)
|
||||
: TargetPackageWidget(targetVariant, insightWorker, parent)
|
||||
: TargetPackageWidget(targetVariant, parent)
|
||||
{
|
||||
auto stylesheetFile = QFile(QString::fromStdString(
|
||||
Paths::compiledResourcesPath()
|
||||
@@ -45,7 +42,7 @@ namespace Bloom::Widgets::InsightTargetWidgets::Dip
|
||||
this->bottomPinLayout->setAlignment(Qt::AlignmentFlag::AlignHCenter);
|
||||
|
||||
for (const auto& [targetPinNumber, targetPinDescriptor]: targetVariant.pinDescriptorsByNumber) {
|
||||
auto* pinWidget = new PinWidget(targetPinDescriptor, targetVariant, insightWorker, this);
|
||||
auto* pinWidget = new PinWidget(targetPinDescriptor, targetVariant, this);
|
||||
this->pinWidgets.push_back(pinWidget);
|
||||
TargetPackageWidget::pinWidgets.push_back(pinWidget);
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ namespace Bloom::Widgets::InsightTargetWidgets::Dip
|
||||
public:
|
||||
DualInlinePackageWidget(
|
||||
const Targets::TargetVariant& targetVariant,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
);
|
||||
|
||||
|
||||
@@ -7,10 +7,9 @@ namespace Bloom::Widgets::InsightTargetWidgets::Dip
|
||||
PinWidget::PinWidget(
|
||||
const TargetPinDescriptor& pinDescriptor,
|
||||
const TargetVariant& targetVariant,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
)
|
||||
: TargetPinWidget(pinDescriptor, targetVariant, insightWorker, parent)
|
||||
: TargetPinWidget(pinDescriptor, targetVariant, parent)
|
||||
{
|
||||
this->setFixedSize(PinWidget::MINIMUM_WIDTH, PinWidget::MAXIMUM_HEIGHT);
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@ namespace Bloom::Widgets::InsightTargetWidgets::Dip
|
||||
PinWidget(
|
||||
const Targets::TargetPinDescriptor& pinDescriptor,
|
||||
const Targets::TargetVariant& targetVariant,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
);
|
||||
|
||||
|
||||
@@ -14,9 +14,8 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
|
||||
PinWidget::PinWidget(
|
||||
const TargetPinDescriptor& pinDescriptor,
|
||||
const TargetVariant& targetVariant,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
): TargetPinWidget(pinDescriptor, targetVariant, insightWorker, parent) {
|
||||
): TargetPinWidget(pinDescriptor, targetVariant, parent) {
|
||||
this->layout = new QBoxLayout(QBoxLayout::TopToBottom);
|
||||
this->layout->setContentsMargins(0, 0, 0, 0);
|
||||
this->layout->setSpacing(0);
|
||||
|
||||
@@ -48,7 +48,6 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
|
||||
PinWidget(
|
||||
const Targets::TargetPinDescriptor& pinDescriptor,
|
||||
const Targets::TargetVariant& targetVariant,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
);
|
||||
|
||||
|
||||
@@ -17,9 +17,8 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
|
||||
|
||||
QuadFlatPackageWidget::QuadFlatPackageWidget(
|
||||
const TargetVariant& targetVariant,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
): TargetPackageWidget(targetVariant, insightWorker, parent) {
|
||||
): TargetPackageWidget(targetVariant, parent) {
|
||||
assert((targetVariant.pinDescriptorsByNumber.size() % 4) == 0);
|
||||
|
||||
auto stylesheetFile = QFile(QString::fromStdString(
|
||||
@@ -62,7 +61,7 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
|
||||
|
||||
const auto pinCountPerLayout = static_cast<int>(targetVariant.pinDescriptorsByNumber.size() / 4);
|
||||
for (const auto& [targetPinNumber, targetPinDescriptor]: targetVariant.pinDescriptorsByNumber) {
|
||||
auto* pinWidget = new PinWidget(targetPinDescriptor, targetVariant, insightWorker, this);
|
||||
auto* pinWidget = new PinWidget(targetPinDescriptor, targetVariant, this);
|
||||
this->pinWidgets.push_back(pinWidget);
|
||||
TargetPackageWidget::pinWidgets.push_back(pinWidget);
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
|
||||
public:
|
||||
QuadFlatPackageWidget(
|
||||
const Targets::TargetVariant& targetVariant,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
);
|
||||
|
||||
|
||||
@@ -12,12 +12,10 @@ namespace Bloom::Widgets::InsightTargetWidgets
|
||||
|
||||
TargetPackageWidget::TargetPackageWidget(
|
||||
Targets::TargetVariant targetVariant,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
)
|
||||
: QWidget(parent)
|
||||
, targetVariant(std::move(targetVariant))
|
||||
, insightWorker(insightWorker)
|
||||
{
|
||||
auto* insightSignals = InsightSignals::instance();
|
||||
|
||||
|
||||
@@ -5,11 +5,10 @@
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
|
||||
#include "TargetPinWidget.hpp"
|
||||
#include "src/Targets/TargetVariant.hpp"
|
||||
#include "src/Targets/TargetDescriptor.hpp"
|
||||
#include "src/Targets/TargetState.hpp"
|
||||
#include "src/Targets/TargetRegister.hpp"
|
||||
|
||||
namespace Bloom::Widgets::InsightTargetWidgets
|
||||
{
|
||||
@@ -21,7 +20,7 @@ namespace Bloom::Widgets::InsightTargetWidgets
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TargetPackageWidget(Targets::TargetVariant targetVariant, InsightWorker& insightWorker, QWidget* parent);
|
||||
TargetPackageWidget(Targets::TargetVariant targetVariant, QWidget* parent);
|
||||
virtual void refreshPinStates(std::optional<std::function<void(void)>> callback = std::nullopt);
|
||||
|
||||
virtual void setTargetState(Targets::TargetState targetState) {
|
||||
@@ -38,7 +37,6 @@ namespace Bloom::Widgets::InsightTargetWidgets
|
||||
|
||||
protected:
|
||||
Targets::TargetVariant targetVariant;
|
||||
InsightWorker& insightWorker;
|
||||
std::vector<TargetPinWidget*> pinWidgets;
|
||||
|
||||
Targets::TargetState targetState = Targets::TargetState::UNKNOWN;
|
||||
|
||||
@@ -13,11 +13,9 @@ namespace Bloom::Widgets::InsightTargetWidgets
|
||||
TargetPinWidget::TargetPinWidget(
|
||||
Targets::TargetPinDescriptor pinDescriptor,
|
||||
Targets::TargetVariant targetVariant,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
)
|
||||
: QWidget(parent)
|
||||
, insightWorker(insightWorker)
|
||||
, targetVariant(std::move(targetVariant))
|
||||
, pinDescriptor(std::move(pinDescriptor)
|
||||
) {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include <QWidget>
|
||||
#include <utility>
|
||||
|
||||
#include "src/Insight/InsightWorker/InsightWorker.hpp"
|
||||
#include "src/Targets/TargetVariant.hpp"
|
||||
#include "src/Targets/TargetPinDescriptor.hpp"
|
||||
|
||||
@@ -17,7 +16,6 @@ namespace Bloom::Widgets::InsightTargetWidgets
|
||||
TargetPinWidget(
|
||||
Targets::TargetPinDescriptor pinDescriptor,
|
||||
Targets::TargetVariant targetVariant,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
);
|
||||
|
||||
@@ -45,8 +43,6 @@ namespace Bloom::Widgets::InsightTargetWidgets
|
||||
virtual void onWidgetBodyClicked();
|
||||
|
||||
protected:
|
||||
InsightWorker& insightWorker;
|
||||
|
||||
Targets::TargetVariant targetVariant;
|
||||
Targets::TargetPinDescriptor pinDescriptor;
|
||||
std::optional<Targets::TargetPinState> pinState;
|
||||
|
||||
Reference in New Issue
Block a user