diff --git a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp index e582d980..4e0fd7d0 100644 --- a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp @@ -131,8 +131,10 @@ InsightWindow::InsightWindow(InsightWorker& insightWorker): QMainWindow(nullptr) this->bottomPanel = this->container->findChild("bottom-panel"); this->ramInspectionButton = this->container->findChild("ram-inspection-btn"); + this->eepromInspectionButton = this->container->findChild("eeprom-inspection-btn"); connect(this->ramInspectionButton, &QToolButton::clicked, this, &InsightWindow::toggleRamInspectionPane); + connect(this->eepromInspectionButton, &QToolButton::clicked, this, &InsightWindow::toggleEepromInspectionPane); this->footer = this->windowContainer->findChild("footer"); this->targetStatusLabel = this->footer->findChild("target-state"); @@ -239,18 +241,39 @@ void InsightWindow::toggleTargetRegistersPane() { } void InsightWindow::toggleRamInspectionPane() { - if (this->bottomPanel->isVisible()) { + if (this->ramInspectionPane->activated) { this->ramInspectionPane->deactivate(); this->bottomPanel->hide(); this->ramInspectionButton->setChecked(false); } else { + if (this->eepromInspectionPane != nullptr && this->eepromInspectionPane->activated) { + this->toggleEepromInspectionPane(); + } + this->ramInspectionPane->activate(); this->bottomPanel->show(); this->ramInspectionButton->setChecked(true); } } +void InsightWindow::toggleEepromInspectionPane() { + if (this->eepromInspectionPane->activated) { + this->eepromInspectionPane->deactivate(); + this->bottomPanel->hide(); + this->eepromInspectionButton->setChecked(false); + + } else { + if (this->ramInspectionPane != nullptr && this->ramInspectionPane->activated) { + this->toggleRamInspectionPane(); + } + + this->eepromInspectionPane->activate(); + this->bottomPanel->show(); + this->eepromInspectionButton->setChecked(true); + } +} + void InsightWindow::resizeEvent(QResizeEvent* event) { const auto windowSize = this->size(); @@ -509,6 +532,18 @@ void InsightWindow::activate() { this->ramInspectionButton->setDisabled(false); } + if (this->targetDescriptor.memoryDescriptorsByType.contains(TargetMemoryType::EEPROM)) { + auto& eepromDescriptor = this->targetDescriptor.memoryDescriptorsByType.at(TargetMemoryType::EEPROM); + this->eepromInspectionPane = new TargetMemoryInspectionPane( + eepromDescriptor, + this->insightWorker, + this->bottomPanel + ); + bottomPanelLayout->addWidget(this->eepromInspectionPane); + this->ramInspectionButton->setChecked(false); + this->ramInspectionButton->setDisabled(false); + } + this->toggleUi(this->targetState != TargetState::STOPPED); this->activated = true; } diff --git a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.hpp b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.hpp index 7ea4747f..442c4f3f 100644 --- a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.hpp @@ -51,6 +51,7 @@ namespace Bloom void openAboutWindow(); void toggleTargetRegistersPane(); void toggleRamInspectionPane(); + void toggleEepromInspectionPane(); signals: void refreshTargetPinStates(int variantId); @@ -93,7 +94,9 @@ namespace Bloom QWidget* bottomMenuBar = nullptr; Widgets::PanelWidget* bottomPanel = nullptr; Widgets::TargetMemoryInspectionPane* ramInspectionPane = nullptr; + Widgets::TargetMemoryInspectionPane* eepromInspectionPane = nullptr; QToolButton* ramInspectionButton = nullptr; + QToolButton* eepromInspectionButton = nullptr; QWidget* footer = nullptr; QLabel* targetStatusLabel = nullptr; diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp index bf35dec9..9c33f0cb 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp @@ -126,7 +126,9 @@ void TargetMemoryInspectionPane::resizeEvent(QResizeEvent* event) { void TargetMemoryInspectionPane::postActivate() { if (this->targetState == Targets::TargetState::STOPPED) { - this->refreshMemoryValues(); + this->refreshMemoryValues([this] { + this->hexViewerWidget->setDisabled(false); + }); } }