diff options
Diffstat (limited to 'qtmips_gui')
-rw-r--r-- | qtmips_gui/MainWindow.ui | 19 | ||||
-rw-r--r-- | qtmips_gui/mainwindow.cpp | 6 |
2 files changed, 24 insertions, 1 deletions
diff --git a/qtmips_gui/MainWindow.ui b/qtmips_gui/MainWindow.ui index 1c49fe3..b42b3c5 100644 --- a/qtmips_gui/MainWindow.ui +++ b/qtmips_gui/MainWindow.ui @@ -78,6 +78,7 @@ <addaction name="actionStep"/> <addaction name="separator"/> <addaction name="ips1"/> + <addaction name="ips2"/> <addaction name="ips5"/> <addaction name="ips10"/> <addaction name="ipsUnlimited"/> @@ -113,6 +114,7 @@ <addaction name="actionStep"/> <addaction name="separator"/> <addaction name="ips1"/> + <addaction name="ips2"/> <addaction name="ips5"/> <addaction name="ips10"/> </widget> @@ -307,6 +309,23 @@ <string>Ctrl+Shift+M</string> </property> </action> + <action name="ips2"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>2 instructions per second</string> + </property> + <property name="iconText"> + <string>2x</string> + </property> + <property name="toolTip"> + <string>Run CPU in speed of two instructions per second</string> + </property> + <property name="shortcut"> + <string>Ctrl+2</string> + </property> + </action> </widget> <layoutdefault spacing="6" margin="11"/> <resources> diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp index b61c0e5..b3a134b 100644 --- a/qtmips_gui/mainwindow.cpp +++ b/qtmips_gui/mainwindow.cpp @@ -28,6 +28,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { // Execution speed actions speed_group = new QActionGroup(this); speed_group->addAction(ui->ips1); + speed_group->addAction(ui->ips2); speed_group->addAction(ui->ips5); speed_group->addAction(ui->ips10); speed_group->addAction(ui->ipsUnlimited); @@ -43,6 +44,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { connect(ui->actionProgram_Cache, SIGNAL(triggered(bool)), this, SLOT(show_cache_program())); connect(ui->actionData_Cache, SIGNAL(triggered(bool)), this, SLOT(show_cache_data())); connect(ui->ips1, SIGNAL(toggled(bool)), this, SLOT(set_speed())); + connect(ui->ips2, SIGNAL(toggled(bool)), this, SLOT(set_speed())); connect(ui->ips5, SIGNAL(toggled(bool)), this, SLOT(set_speed())); connect(ui->ips10, SIGNAL(toggled(bool)), this, SLOT(set_speed())); connect(ui->ipsUnlimited, SIGNAL(toggled(bool)), this, SLOT(set_speed())); @@ -161,8 +163,10 @@ void MainWindow::set_speed() { if (ui->ips1->isChecked()) machine->set_speed(1000); - else if (ui->ips5->isChecked()) + else if (ui->ips2->isChecked()) machine->set_speed(500); + else if (ui->ips5->isChecked()) + machine->set_speed(200); else if (ui->ips10->isChecked()) machine->set_speed(100); else |