aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/coreview.cpp
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-12-15 22:45:28 +0100
committerKarel Kočí <cynerd@email.cz>2017-12-15 22:45:28 +0100
commite6ca4b4568e311b47239bfe83de15ed9e91c57b9 (patch)
tree3da2f72faf360058bae02c35b0c724233bd64d61 /qtmips_gui/coreview.cpp
parentbbea996112eb7ac81ec50d2af08f4bd681d0e50d (diff)
downloadqtmips-e6ca4b4568e311b47239bfe83de15ed9e91c57b9.tar.gz
qtmips-e6ca4b4568e311b47239bfe83de15ed9e91c57b9.tar.bz2
qtmips-e6ca4b4568e311b47239bfe83de15ed9e91c57b9.zip
Implement few initial graphic elements
Diffstat (limited to 'qtmips_gui/coreview.cpp')
-rw-r--r--qtmips_gui/coreview.cpp48
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) {
-
-}
-
-*/