| 1 | /* |
| 2 | * File: MainPanel.cpp |
| 3 | * |
| 4 | * Author: Jacob Dekel |
| 5 | * Created on: Aug 7, 2009 |
| 6 | * |
| 7 | * Copyright (c) 2009-2013 Jacob Dekel |
| 8 | * $Id$ |
| 9 | * |
| 10 | * This program is free software: you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation, either version 3 of the License, or |
| 13 | * (at your option) any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | * |
| 23 | */ |
| 24 | |
| 25 | #include "HerculesStudio.h"cxx . . $ `<file>/HercStudio/HerculesStudio.h`/ |
| 26 | #include "MainPanel.h"cxx . . $ `<file>/HercStudio/MainPanel.h`/ |
| 27 | #include "MainPanelClassic.h"cxx . . $ `<file>/HercStudio/MainPanelClassic.h`/ |
| 28 | #include "Preferences.h"cxx . . $ `<file>/HercStudio/Preferences.h`/ |
| 29 | #include "Environment.h"cxx . . $ `<file>/HercStudio/Environment.h`/ |
| 30 | #include "ConfigurationEditor.h"cxx . . $ `<file>/HercConfiguration/ConfigurationEditor.h`/ |
| 31 | |
| 32 | #include <QResizeEvent> |
| 33 | #include <QColor> |
| 34 | #include <iostream> |
| 35 | |
| 36 | MainPanelcxx . . $ MainPanel#::MainPanelcxx . . $ MainPanel#MainPanel(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *parent) |
| 37 | :QWidgetcxx . . $ QWidget#QWidget(872e7b0c281abd8d).(parent), |
| 38 | mMipsHWMcxx . . $ MainPanel#mMipsHWM.(0) |
| 39 | { |
| 40 | QStringcxx . . $ QString# iconsPathcxx . . $ QString#QString(e1217c004a86c950). = Environmentcxx . . $ QString#QString(85c52e162fed56f9).::getIconsPathcxx . . $ Environment#getIconsPath(75da78375bc7a3dd).().c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(); |
| 41 | mYellowLowcxx . . $ MainPanel#mYellowLow. = new QPixmapcxx . . $ QPixmap#QPixmap(dec4543235ec9b46).(iconsPath +cxx . . $ operator+(3d22f08efddf8107). "/yellow.png"); |
| 42 | mYellowHighcxx . . $ MainPanel#mYellowHigh. = new QPixmapcxx . . $ QPixmap#QPixmap(dec4543235ec9b46).(iconsPath +cxx . . $ operator+(3d22f08efddf8107). "/yellowhigh.png"); |
| 43 | } |
| 44 | |
| 45 | MainPanelcxx . . $ MainPanel#::~cxx . . $ MainPanel#`~MainPanel`(49f6e7a06ebc5aa8).MainPanelcxx . . $ MainPanel#() |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | void MainPanelcxx . . $ MainPanel#::doConnectcxx . . $ MainPanel#doConnect(49f6e7a06ebc5aa8).() |
| 50 | { |
| 51 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(powerOnButtoncxx . . $ MainPanel#powerOnButton(aa0e4e1b7d59b5f2).(), SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(powerOnClickedSlot())); |
| 52 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(powerOffButtoncxx . . $ MainPanel#powerOffButton(aa0e4e1b7d59b5f2).(), SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(powerOffClickedSlot())); |
| 53 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(interruptButtoncxx . . $ MainPanel#interruptButton(aa0e4e1b7d59b5f2).(), SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(interruptClickedSlot())); |
| 54 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(loadButtoncxx . . $ MainPanel#loadButton(aa0e4e1b7d59b5f2).(), SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(loadClickedSlot())); |
| 55 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(stopButtoncxx . . $ MainPanel#stopButton(aa0e4e1b7d59b5f2).(), SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(stopClickedSlot())); |
| 56 | |
| 57 | checkedConnectcxx . . $ `HercStudio/HerculesStudio.h:51:9`!(mRestartButton,restartClickedSlot()); |
| 58 | checkedConnectcxx . . $ `HercStudio/HerculesStudio.h:51:9`!(mStoreButton,storeClickedSlot()); |
| 59 | checkedConnectcxx . . $ `HercStudio/HerculesStudio.h:51:9`!(mStartButton,startClickedSlot()); |
| 60 | } |
| 61 | |
| 62 | void MainPanelcxx . . $ MainPanel#::powerOnClickedSlotcxx . . $ MainPanel#powerOnClickedSlot(49f6e7a06ebc5aa8).() |
| 63 | { |
| 64 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! powerOnClickedcxx . . $ MainPanel#powerOnClicked(49f6e7a06ebc5aa8).(); |
| 65 | } |
| 66 | void MainPanelcxx . . $ MainPanel#::powerOffClickedSlotcxx . . $ MainPanel#powerOffClickedSlot(49f6e7a06ebc5aa8).() |
| 67 | { |
| 68 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! powerOffClickedcxx . . $ MainPanel#powerOffClicked(49f6e7a06ebc5aa8).(); |
| 69 | } |
| 70 | |
| 71 | void MainPanelcxx . . $ MainPanel#::loadClickedSlotcxx . . $ MainPanel#loadClickedSlot(49f6e7a06ebc5aa8).() |
| 72 | { |
| 73 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! loadClickedcxx . . $ MainPanel#loadClicked(49f6e7a06ebc5aa8).(); |
| 74 | } |
| 75 | |
| 76 | void MainPanelcxx . . $ MainPanel#::restartClickedSlotcxx . . $ MainPanel#restartClickedSlot(49f6e7a06ebc5aa8).() |
| 77 | { |
| 78 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! restartClickedcxx . . $ MainPanel#restartClicked(49f6e7a06ebc5aa8).(); |
| 79 | } |
| 80 | |
| 81 | void MainPanelcxx . . $ MainPanel#::storeClickedSlotcxx . . $ MainPanel#storeClickedSlot(49f6e7a06ebc5aa8).() |
| 82 | { |
| 83 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! storeClickedcxx . . $ MainPanel#storeClicked(49f6e7a06ebc5aa8).(); |
| 84 | } |
| 85 | |
| 86 | void MainPanelcxx . . $ MainPanel#::startClickedSlotcxx . . $ MainPanel#startClickedSlot(49f6e7a06ebc5aa8).() |
| 87 | { |
| 88 | mStoppedcxx . . $ MainPanel#mStopped.=false; |
| 89 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! startClickedcxx . . $ MainPanel#startClicked(49f6e7a06ebc5aa8).(); |
| 90 | } |
| 91 | |
| 92 | void MainPanelcxx . . $ MainPanel#::stopClickedSlotcxx . . $ MainPanel#stopClickedSlot(49f6e7a06ebc5aa8).() |
| 93 | { |
| 94 | mStoppedcxx . . $ MainPanel#mStopped.=true; |
| 95 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! stopClickedcxx . . $ MainPanel#stopClicked(49f6e7a06ebc5aa8).(); |
| 96 | } |
| 97 | |
| 98 | void MainPanelcxx . . $ MainPanel#::interruptClickedSlotcxx . . $ MainPanel#interruptClickedSlot(49f6e7a06ebc5aa8).() |
| 99 | { |
| 100 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! interruptClickedcxx . . $ MainPanel#interruptClicked(49f6e7a06ebc5aa8).(); |
| 101 | } |
| 102 | |
| 103 | |
| 104 | |
| 105 | ClickLabelcxx . . $ ClickLabel#::ClickLabelcxx . . $ ClickLabel#ClickLabel(b930821657a4938d).(MainPanelcxx . . $ MainPanel# * parent, QObjectcxx . . $ QObject# * lcd) |
| 106 | : QLabelcxx . . $ QLabel#(parent), mPanelcxx . . $ ClickLabel#mPanel.(parent), mLcdcxx . . $ ClickLabel#mLcd.(lcd) |
| 107 | { |
| 108 | } |
| 109 | |
| 110 | void ClickLabelcxx . . $ ClickLabel#::mousePressEventcxx . . $ ClickLabel#mousePressEvent(702858a82d06265c).(QMouseEventcxx . . $ QMouseEvent# * event) |
| 111 | { |
| 112 | mPanelcxx . . $ ClickLabel#mPanel.->updateLcdcxx . . $ MainPanel#updateLcd(83a52b9a967847f9).((QLCDNumbercxx . . $ QLCDNumber#*)(mLcdcxx . . $ ClickLabel#mLcd.), event->xcxx . . $ QMouseEvent#x(455f465bc33b4cdf).() > 30 ? 1 : -1); |
| 113 | Preferencescxx . . $ Preferences#::getInstancecxx . . $ Preferences#getInstance(2e7be89de0a5bc0).().setIplDevicecxx . . $ Preferences#setIplDevice(9c546c94e5fcce4e).( stdcxx . . $ std/::stringcxx . . $ std/string#(QByteArraycxx . . $ QByteArray#::numbercxx . . $ QByteArray#number(4869bc8897d11479).(mPanelcxx . . $ ClickLabel#mPanel.->getLoadAddresscxx . . $ MainPanel#getLoadAddress(b126dc7c1de90089).(),16).datacxx . . $ QByteArray#data(41208ce6ca65dd58).()) ); |
| 114 | } |
| 115 | |
| 116 | int MainPanelcxx . . $ MainPanel#::getLoadAddresscxx . . $ MainPanel#getLoadAddress(b126dc7c1de90089).() |
| 117 | { |
| 118 | return mLcd0cxx . . $ MainPanel#mLcd0.->intValuecxx . . $ QLCDNumber#intValue(455f465bc33b4cdf).() + 16*mLcd1cxx . . $ MainPanel#mLcd1.->intValuecxx . . $ QLCDNumber#intValue(455f465bc33b4cdf).() + |
| 119 | (16*16)*mLcd2cxx . . $ MainPanel#mLcd2.->intValuecxx . . $ QLCDNumber#intValue(455f465bc33b4cdf).() + (16*16*16)*mLcd3cxx . . $ MainPanel#mLcd3.->intValuecxx . . $ QLCDNumber#intValue(455f465bc33b4cdf).(); |
| 120 | } |
| 121 | |
| 122 | void MainPanelcxx . . $ MainPanel#::setLoadAddresscxx . . $ MainPanel#setLoadAddress(85c52e162fed56f9).(const char *devNo) |
| 123 | { |
| 124 | int addr = ConfigurationEditorcxx . . $ ConfigurationEditor#::parseNumcxx . . $ ConfigurationEditor#parseNum(7b1020165ab78f0a).(devNocxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,16); |
| 125 | QLCDNumbercxx . . $ QLCDNumber# *nums[4] = {mLcd0cxx . . $ MainPanel#mLcd0., mLcd1cxx . . $ MainPanel#mLcd1., mLcd2cxx . . $ MainPanel#mLcd2., mLcd3cxx . . $ MainPanel#mLcd3.}; |
| 126 | for (int i=0; i< 4; i++) |
| 127 | { |
| 128 | int dig = addr%16; |
| 129 | addr /= 16; |
| 130 | nums[i]->displaycxx . . $ QLCDNumber#display(d4f767463ce0a6b3).(dig); |
| 131 | } |
| 132 | Preferencescxx . . $ Preferences#::getInstancecxx . . $ Preferences#getInstance(2e7be89de0a5bc0).().setIplDevicecxx . . $ Preferences#setIplDevice(9c546c94e5fcce4e).( stdcxx . . $ std/::stringcxx . . $ std/string#(QByteArraycxx . . $ QByteArray#::numbercxx . . $ QByteArray#number(4869bc8897d11479).(getLoadAddresscxx . . $ MainPanel#getLoadAddress(b126dc7c1de90089).(),16).datacxx . . $ QByteArray#data(41208ce6ca65dd58).()) ); |
| 133 | } |
| 134 |