Skip to content

Commit

Permalink
~ better tbl button placement
Browse files Browse the repository at this point in the history
  • Loading branch information
mellotanica committed Nov 26, 2014
1 parent 0197090 commit 155bbb1
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 33 deletions.
22 changes: 21 additions & 1 deletion qarm/mainbar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ mainBar::mainBar(QWidget *parent) :

ramB = new styledButton();
ramB->setToolButtonStyle(Qt::ToolButtonTextOnly);
ramB->setText("View Ram");
ramB->setText("RAM");

for (unsigned int i = 0; i < N_DEV_PER_IL; ++i) {
showTerminalActions[i] = new QAction(QString("Terminal %1").arg(i), this);
Expand All @@ -132,9 +132,17 @@ mainBar::mainBar(QWidget *parent) :
breakpB->setCheckable(true);
breakpB->setEnabled(true);

tlbB = new styledButton();
tlbB->setText("TLB");
tlbB->setCheckable(true);
tlbB->setEnabled(true);

utilsUpperL->addWidget(breakpB);
utilsUpperL->addWidget(new QWidget());
utilsUpperL->addWidget(ramB);
utilsLowerL->addWidget(windowB);
utilsLowerL->addWidget(new QWidget());
utilsLowerL->addWidget(tlbB);

utilsL->addLayout(utilsUpperL);
utilsL->addLayout(utilsLowerL);
Expand All @@ -152,6 +160,7 @@ mainBar::mainBar(QWidget *parent) :
connect(configB, SIGNAL(clicked()), this, SIGNAL(showConfig()));
connect(windowB, SIGNAL(clicked()), this, SLOT(showDropDownMenu()));
connect(breakpB, SIGNAL(toggled(bool)), this, SLOT(toggleBPButton(bool)));
connect(tlbB, SIGNAL(toggled(bool)), this, SLOT(toggleTlbViewer(bool)));

debugSignaler *debugger = debugSignaler::getInstance();
connect(debugger, SIGNAL(pause()), this, SLOT(stop()));
Expand Down Expand Up @@ -260,4 +269,15 @@ void mainBar::uncheckBPB(){
breakpB->setChecked(false);
}

void mainBar::toggleTlbViewer(bool status){
if(status)
emit showTLB();
else
emit hideTLB();
}

void mainBar::uncheckTLB(){
tlbB->setChecked(false);
}

#endif //QARM_MAINBAR_CC
6 changes: 5 additions & 1 deletion qarm/mainbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public slots:
void showTerminal(unsigned int devNo);
void showBPW();
void hideBPW();
void showTLB();
void hideTLB();

private slots:
void poweron();
Expand All @@ -73,9 +75,11 @@ private slots:
void showTerminalClicked();
void uncheckBPB();
void toggleBPButton(bool checked);
void uncheckTLB();
void toggleTlbViewer(bool status);

private:
styledButton *playB, *resetB, *stepB, *ramB, *plusB, *minusB, *configB, *windowB, *breakpB; //interactions
styledButton *playB, *resetB, *stepB, *ramB, *plusB, *minusB, *configB, *windowB, *breakpB, *tlbB; //interactions
QVBoxLayout *plusMinusL, *scrollerL, *utilsL;
QHBoxLayout *utilsUpperL, *utilsLowerL;
QWidget *plusMinusW, *scrollerW, *utilsW;
Expand Down
18 changes: 0 additions & 18 deletions qarm/procdisplay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ procDisplay::procDisplay(QWidget *parent) :
cpuReg[0][5]->setText("IRQ");
cpuReg[0][6]->setText("FIQ");

tlbB = new QPushButton("Show TLB");
tlbB->setCheckable(true);
tlbB->setEnabled(true);
connect(tlbB, SIGNAL(toggled(bool)), this, SLOT(toggleTlbViewer(bool)));

cp15Reg[0][0]->setText("CP15 registers:");
cp15Reg[1][1]->setText("ID (r0):");
cp15Reg[2][1]->setText("SCB (r1):");
Expand Down Expand Up @@ -154,8 +149,6 @@ procDisplay::procDisplay(QWidget *parent) :
for(int j = 0; j < CP15COLS; j++)
cp15L->addWidget(cp15Reg[i][j], i, j);

cp15L->addWidget(tlbB, CP15ROWS, 0);

for(int i = 0; i < INFOROWS; i++)
for(int j = 0; j < INFOCOLS; j++)
infoL->addWidget(infoReg[i][j], i, j);
Expand Down Expand Up @@ -271,15 +264,4 @@ QString procDisplay::convertHex(Word val){
return ret;
}

void procDisplay::toggleTlbViewer(bool status){
if(status)
emit showTLB();
else
emit hideTLB();
}

void procDisplay::uncheckTLB(){
tlbB->setChecked(false);
}

#endif //QARM_PROCDISPLAY_CC
10 changes: 0 additions & 10 deletions qarm/procdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <QWidget>
#include <QGridLayout>
#include <QLabel>
#include <QPushButton>
#include <sstream>
#include <iomanip>
#include "qarm/QLine.h"
Expand All @@ -44,17 +43,8 @@ class procDisplay : public QWidget
public slots:
void updateVals(Word *cpu, Word *cp15, Word *pipeline, Word todH, Word todL, Word timer, QString ass);
void reset();
void uncheckTLB();

signals:
void showTLB();
void hideTLB();

private slots:
void toggleTlbViewer(bool status);

private:
QPushButton *tlbB;
QVBoxLayout *mainLayout;
QGridLayout *pipeL, *cpuL, *cp15L, *infoL;
QHBoxLayout *lowLayout;
Expand Down
6 changes: 3 additions & 3 deletions qarm/qarm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ qarm::qarm(QApplication *app):
connect(bpWindow, SIGNAL(hiding()), toolbar, SLOT(uncheckBPB()));
connect(this, SIGNAL(resetMachine()), bpWindow, SLOT(reset()));

connect(display, SIGNAL(showTLB()), tlbWindow, SLOT(show()));
connect(display, SIGNAL(hideTLB()), tlbWindow, SLOT(hide()));
connect(tlbWindow, SIGNAL(hiding()), display, SLOT(uncheckTLB()));
connect(toolbar, SIGNAL(showTLB()), tlbWindow, SLOT(show()));
connect(toolbar, SIGNAL(hideTLB()), tlbWindow, SLOT(hide()));
connect(tlbWindow, SIGNAL(hiding()), toolbar, SLOT(uncheckTLB()));
connect(this, SIGNAL(resetMachine()), tlbWindow, SIGNAL(onMachineReset()));

connect(clock, SIGNAL(timeout()), this, SLOT(step()));
Expand Down

0 comments on commit 155bbb1

Please sign in to comment.