diff options
Diffstat (limited to 'qtmips_gui/coreview.cpp')
-rw-r--r-- | qtmips_gui/coreview.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/qtmips_gui/coreview.cpp b/qtmips_gui/coreview.cpp index 4d23bd8..660f78d 100644 --- a/qtmips_gui/coreview.cpp +++ b/qtmips_gui/coreview.cpp @@ -1,35 +1,35 @@ #include "coreview.h" -CoreView::CoreView(QWidget *parent) : QGraphicsView(parent) { +CoreView::CoreView(QWidget *parent, QtMipsMachine *machine) : QGraphicsView(parent) { + setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); -} - -/* -CoreViewBlock::CoreViewBlock() { -} - -CoreViewLine::CoreViewLine() { - -} - -CoreViewLine::CoreViewLine(struct point start, struct point end, QList<struct point> axis) { + this->machine = machine; + // Identification cross + scene.addLine(400, 0, 400, 800); + scene.addLine(0, 400, 800, 400); -} + pc = new coreview::ProgramCounter(machine); + pc_multiplexer = new coreview::Multiplexer(4); + testlatch = new coreview::Latch(machine, 300); -CoreViewLine::~CoreViewLine() { + pc2pc = new coreview::Connection(pc_multiplexer->connector_out(), pc->connector_in()); -} + scene.addItem(pc); + scene.addItem(pc_multiplexer); + scene.addItem(testlatch); + scene.addItem(pc2pc); -void CoreViewLine::set_start(struct point p) { + pc->setPos(100,100); + pc_multiplexer->setPos(60, 100); + pc_multiplexer->set(2); + setScene(&scene); + // TODO fitInView doesn't work as I want so reimplement or do something with it + //fitInView(0, 0, 201, 201, Qt::KeepAspectRatioByExpanding); } -void CoreViewLine::set_end(struct point p) { - +void CoreView::resizeEvent(QResizeEvent *event) { + // fitInView(0, 0, 201, 201, Qt::KeepAspectRatioByExpanding); } - -void CoreViewLine::set_axis(QList<struct point> axs) { - -} - -*/ |