Show I/O symbol header in I/O tab
MODIFY
src/io/iomanager.cpp
src/io/iomanager.cpp
@@ -138,8 +138,8 @@ void IOManager::refreshMemoryMap() {
}
}
- emit memoryMapChanged();
updateSymbols();
+ emit memoryMapChanged();
}
std::vector<std::pair<Symbol, uint32_t>> IOManager::assemblerSymbolsForPeriph(IOBase* peripheral) const {

MODIFY
src/ioperipheraltab.cpp
src/ioperipheraltab.cpp
@@ -13,6 +13,7 @@ namespace Ripes {
IOPeripheralTab::IOPeripheralTab(QWidget* parent, IOBase* peripheral)
: QWidget(parent), m_ui(new Ui::IOPeripheralTab), m_peripheral(peripheral) {
m_ui->setupUi(this);
+ m_ui->exports->setFont(QFont("Inconsolata", 11));
m_ui->description->setText(m_peripheral->description());
m_ui->registerMapView->setModel(new RegisterMapModel(peripheral, this));

MODIFY
src/iotab.cpp
src/iotab.cpp
#include <QDockWidget>
#include <QGraphicsItem>
#include <QMdiSubWindow>
+#include <QScreen>
#include <QToolBar>
#include "io/memorymapmodel.h"
@@ -30,7 +31,7 @@ IOTab::IOTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolbar, parent), m_
m_ui->peripheralsTable->setRowCount(IOTypeTitles.size());
m_ui->peripheralsTable->setColumnCount(1);
m_ui->peripheralsTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
- m_ui->peripheralsTable->setHorizontalHeaderLabels({"Peripherals"});
+ m_ui->peripheralsTable->horizontalHeader()->hide();
m_ui->peripheralsTable->verticalHeader()->hide();
int row = 0;
for (const auto& it : IOTypeTitles) {
@@ -61,6 +62,7 @@ IOTab::IOTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolbar, parent), m_
connect(&IOManager::get(), &IOManager::peripheralRemoved, QPointer(this), &IOTab::removePeripheral);
connect(m_ui->peripheralsTab, &QTabWidget::currentChanged, this, &IOTab::setPeripheralMDIWindowActive);
+ connect(&IOManager::get(), &IOManager::memoryMapChanged, this, &IOTab::updateIOSymbolFilePreview);
// Disable instantiating new peripherals during processor running
connect(ProcessorHandler::get(), &ProcessorHandler::runStarted, this,
@@ -74,6 +76,24 @@ IOTab::IOTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolbar, parent), m_
// Reload peripheral state from the last graceful exit of the program
loadPeripheralState();
+
+ m_ui->ioSymbols->setFont(QFont("Inconsolata", 11));
+ m_ui->ioSymbols->setToolTip(
+ "Exported symbols for all I/O devices.\nThese symbols may be referenced in Assembly\nor C-language programs.");
+
+ // The default sizing of the splitter is fairly unuseable due to the MDIArea minimizing the left-hand side layout.
+ // Manually size it to ensure that the left-hand side layout is reasonably sized, and the right hand side is
+ // minimally sized.
+ const int largeWidth = QGuiApplication::primaryScreen()->size().width();
+ m_ui->splitter->setSizes({largeWidth, static_cast<int>(largeWidth * 3), 0});
+}
+
+void IOTab::updateIOSymbolFilePreview() {
+ const auto& headerPath = IOManager::get().cSymbolsHeaderpath();
+ auto headerFile = QFile(headerPath);
+ if (headerFile.open(QIODevice::ReadOnly)) {
+ m_ui->ioSymbols->document()->setPlainText(QString::fromLatin1(headerFile.readAll()));
+ }
}
IOBase* IOTab::createPeripheral(IOType type, int forcedID) {

MODIFY
src/iotab.h
src/iotab.h
@@ -47,6 +47,7 @@ private:
*/
void loadPeripheralState();
void storePeripheralState();
+ void updateIOSymbolFilePreview();
void tile();
Ui::IOTab* m_ui = nullptr;

MODIFY
src/iotab.ui
src/iotab.ui
<rect>
<x>0</x>
<y>0</y>
- <width>508</width>
- <height>216</height>
+ <width>545</width>
+ <height>225</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
- <layout class="QGridLayout" name="gridLayout">
+ <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QSplitter" name="splitter">
<property name="orientation">
<property name="childrenCollapsible">
<bool>false</bool>
</property>
+ <widget class="QWidget" name="verticalLayoutWidget">
+ <layout class="QVBoxLayout" name="lhsLayout">
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>Peripherals</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <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="QTableWidget" name="peripheralsTable">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
</sizepolicy>
</property>
</widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>I/O symbols</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <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="QPlainTextEdit" name="ioSymbols">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="lineWrapMode">
+ <enum>QPlainTextEdit::NoWrap</enum>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
<widget class="QWidget" name="gridLayoutWidget">
<layout class="QGridLayout" name="dockArea">
<item row="0" column="0">
- <widget class="QMdiArea" name="mdiArea"/>
+ <widget class="QMdiArea" name="mdiArea">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
</item>
</layout>
</widget>

Show I/O symbol header in I/O tab