Move memory map view to memory tab
MODIFY
src/iotab.cpp
src/iotab.cpp
@@ -64,11 +64,6 @@ IOTab::IOTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolbar, parent), m_
connect(&IOManager::get(), &IOManager::peripheralRemoved, this, &IOTab::removePeripheral);
connect(m_ui->peripheralsTab, &QTabWidget::currentChanged, this, &IOTab::setPeripheralMDIWindowActive);
- m_ui->memoryMapView->setModel(new MemoryMapModel(&IOManager::get(), this));
- m_ui->memoryMapView->horizontalHeader()->setSectionResizeMode(MemoryMapModel::Name, QHeaderView::ResizeToContents);
- m_ui->memoryMapView->horizontalHeader()->setSectionResizeMode(MemoryMapModel::AddressRange,
- QHeaderView::ResizeToContents);
- m_ui->memoryMapView->horizontalHeader()->setSectionResizeMode(MemoryMapModel::Size, QHeaderView::ResizeToContents);
}
void IOTab::createPeripheral(IOType type) {

MODIFY
src/iotab.ui
src/iotab.ui
<rect>
<x>0</x>
<y>0</y>
- <width>672</width>
- <height>466</height>
+ <width>508</width>
+ <height>216</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
- <layout class="QGridLayout" name="gridLayout_4">
- <item row="0" column="1">
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
<widget class="QSplitter" name="splitter">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <widget class="QTabWidget" name="tabWidget">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
- <horstretch>2</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>400</width>
- <height>0</height>
- </size>
- </property>
- <property name="currentIndex">
- <number>0</number>
- </property>
- <widget class="QWidget" name="peripherals">
- <attribute name="title">
- <string>Peripherals</string>
- </attribute>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <widget class="QSplitter" name="splitter_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="childrenCollapsible">
- <bool>false</bool>
- </property>
<widget class="QTableWidget" name="peripheralsTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
</sizepolicy>
</property>
</widget>
+ <widget class="QWidget" name="gridLayoutWidget">
+ <layout class="QGridLayout" name="dockArea">
+ <item row="0" column="0">
+ <widget class="QMdiArea" name="mdiArea"/>
+ </item>
+ </layout>
+ </widget>
<widget class="QTabWidget" name="peripheralsTab">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="currentIndex">
<number>0</number>
</property>
</item>
</layout>
</widget>
- <widget class="QWidget" name="mmap">
- <attribute name="title">
- <string>Memory Map</string>
- </attribute>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="0" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <widget class="QTableView" name="memoryMapView">
- <attribute name="horizontalHeaderStretchLastSection">
- <bool>true</bool>
- </attribute>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </widget>
- <widget class="QWidget" name="gridLayoutWidget">
- <layout class="QGridLayout" name="dockArea">
- <item row="0" column="0">
- <widget class="QMdiArea" name="mdiArea"/>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- </layout>
- </widget>
<resources/>
<connections/>
</ui>

MODIFY
src/memorytab.cpp
src/memorytab.cpp
#include <QToolBar>
#include "cachesim/cachesim.h"
+#include "io/iomanager.h"
+#include "io/memorymapmodel.h"
#include "processorhandler.h"
namespace Ripes {
@@ -31,6 +33,14 @@ MemoryTab::MemoryTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolbar, par
// During processor running, it should not be possible to interact with the memory viewer or cache widgets
connect(ProcessorHandler::get(), &ProcessorHandler::runStarted, [=] { setEnabled(false); });
connect(ProcessorHandler::get(), &ProcessorHandler::runFinished, [=] { setEnabled(true); });
+
+ m_ui->memoryMapView->setModel(new MemoryMapModel(&IOManager::get(), this));
+ m_ui->memoryMapView->horizontalHeader()->setSectionResizeMode(MemoryMapModel::Name, QHeaderView::ResizeToContents);
+ m_ui->memoryMapView->horizontalHeader()->setSectionResizeMode(MemoryMapModel::AddressRange,
+ QHeaderView::ResizeToContents);
+ m_ui->memoryMapView->horizontalHeader()->setSectionResizeMode(MemoryMapModel::Size, QHeaderView::ResizeToContents);
+ m_ui->splitter->setStretchFactor(0, 1);
+ m_ui->splitter->setStretchFactor(1, 0);
}
void MemoryTab::update() {

MODIFY
src/memorytab.ui
src/memorytab.ui
<property name="windowTitle">
<string>Form</string>
</property>
- <layout class="QGridLayout" name="gridLayout_2">
+ <layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
+ <widget class="QTabWidget" name="tabWidget_2">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Memory</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <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 row="0" column="0">
<widget class="MemoryViewerWidget" name="memoryViewerWidget" native="true">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>Memory map</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <property name="leftMargin">
+ <number>9</number>
+ </property>
+ <property name="topMargin">
+ <number>9</number>
+ </property>
+ <property name="rightMargin">
+ <number>9</number>
+ </property>
+ <property name="bottomMargin">
+ <number>9</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QTableView" name="memoryMapView">
+ <attribute name="horizontalHeaderStretchLastSection">
+ <bool>true</bool>
+ </attribute>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
<widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">

Move memory map view to memory tab