# HG changeset patch # User Alexis Jeandet # Date 2015-03-31 20:17:47 # Node ID 9b311fda241280fc777e5149628a911a83c0c647 # Parent 820d90d5d23258bf98e56cc3c6ce8de2786c62ec New register explorer WIP. diff --git a/.hgsubstate b/.hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,4 +1,4 @@ -2c82d72694590cbc2aebb946667f11f60ea89afe src/SocExplorerEngine/PeripheralWidget +9790824220ca06014e65a5c13aa4ed37f89d7593 src/SocExplorerEngine/PeripheralWidget cc958c79ba0939809a70e63b8bac798930160243 src/common/genericBinaryFiles 2dce25b198558be573f56c1cf337aa95ddd666d6 src/common/lppserial 923afde9cc96bb419cf898560d080ec96991aeca src/common/qhexedit diff --git a/ressources/Styles/SocExplorer.css b/ressources/Styles/SocExplorer.css --- a/ressources/Styles/SocExplorer.css +++ b/ressources/Styles/SocExplorer.css @@ -10,3 +10,7 @@ QGroupBox::title { padding: 0 3px 0 3px; } +QWidget#CollapsablePeripheralWidget { + border: 1px solid gray; + border-radius: 9px; +} diff --git a/src/SocExplorerEngine/SocExplorerEngine.pro b/src/SocExplorerEngine/SocExplorerEngine.pro --- a/src/SocExplorerEngine/SocExplorerEngine.pro +++ b/src/SocExplorerEngine/SocExplorerEngine.pro @@ -67,6 +67,7 @@ header.files = engine/socexplorerengine. PeripheralWidget/src/peripheralwidget.h \ PeripheralWidget/src/registerwidget.h \ PeripheralWidget/src/socregsviewer.h \ + PeripheralWidget/src/socregsviewernew.h \ memtester/memtester.h @@ -124,7 +125,9 @@ HEADERS += \ proxy/socexplorerproxy.h \ SOC/socexplorerenumdevice.h \ PySocExplorerEngine.h \ - memtester/memtester.h + memtester/memtester.h\ + PeripheralWidget/src/socregsviewernew.h \ + PeripheralWidget/src/collapsableperipheralwidget.h @@ -153,7 +156,9 @@ SOURCES += \ proxy/socexplorerproxy.cpp \ SOC/socexplorerenumdevice.cpp \ plugins/socexplorerplugin.cpp \ - memtester/memtester.cpp + memtester/memtester.cpp \ + PeripheralWidget/src/socregsviewernew.cpp \ + PeripheralWidget/src/collapsableperipheralwidget.cpp OTHER_FILES += \ @@ -163,4 +168,10 @@ OTHER_FILES += \ pythongenerator.sh \ pythonQtgeneratorCfg.txt +FORMS += \ + PeripheralWidget/src/socregsviewernew.ui \ + PeripheralWidget/src/collapsableperipheralwidget.ui + +RESOURCES += \ + PeripheralWidget/ressources/peripheralwidget.qrc diff --git a/src/SocExplorerEngine/proxy/socexplorerproxy.cpp b/src/SocExplorerEngine/proxy/socexplorerproxy.cpp --- a/src/SocExplorerEngine/proxy/socexplorerproxy.cpp +++ b/src/SocExplorerEngine/proxy/socexplorerproxy.cpp @@ -104,6 +104,7 @@ void socexplorerproxy::loadSysDriver(soc emit _self->clearMenu(); emit _self->treeChanged(QList(*drivers)); SocExplorerEngine::addSOC(driver); + driver->postInstantiationTrigger(); } void socexplorerproxy::loadChildSysDriver(socexplorerplugin *parent, const QString child) diff --git a/src/regsExplorer/regsexplorer.cpp b/src/regsExplorer/regsexplorer.cpp --- a/src/regsExplorer/regsexplorer.cpp +++ b/src/regsExplorer/regsexplorer.cpp @@ -6,7 +6,7 @@ regsExplorer::regsExplorer(QWidget *pare { mainWidget = new QTabWidget; cfg = new regsExplorerCfg; - socViewer = new socRegsViewer(tr("No soc Detected"),this); + socViewer = new SocRegsViewerNew(tr("No soc Detected"),this); this->setWidget(this->mainWidget); this->mainWidget->addTab(this->cfg,"Config"); this->mainWidget->addTab(this->socViewer,"View"); @@ -17,7 +17,8 @@ regsExplorer::regsExplorer(QWidget *pare void regsExplorer::addDev(socExplorerEnumDevice *device) { - peripheralWidget* peripheral=new peripheralWidget(device->name(),device->baseAddress(),this); + delegate.device = device; + peripheralWidget* peripheral=new peripheralWidget(device->name(),device->baseAddress(),&delegate,this); this->socViewer->addPeripheral(peripheral); peripheralModel periphM=SocExplorerEngine::xmlModel()->getPeripheral(device->name()); int startIndex,stopIndex; @@ -37,11 +38,11 @@ void regsExplorer::addDev(socExplorerEnu peripheral->registerAt(i)->setBitFieldAttribute(startIndex,stopIndex,name,desc,rw); } } - connect(peripheral,SIGNAL(readRegSig(qint32)),device,SLOT(readReg(qint32))); - connect(peripheral,SIGNAL(writeRegSig(qint32,qint32)),device,SLOT(writeReg(qint32,qint32))); - QCheckBox* chkbx = this->cfg->addDev(device); - chkbx->setChecked(true); - connect(chkbx,SIGNAL(toggled(bool)),peripheral,SLOT(setVisible(bool))); +// connect(peripheral,SIGNAL(readRegSig(qint32)),device,SLOT(readReg(qint32))); +// connect(peripheral,SIGNAL(writeRegSig(qint32,qint32)),device,SLOT(writeReg(qint32,qint32))); +// QCheckBox* chkbx = this->cfg->addDev(device); +// chkbx->setChecked(true); +// connect(chkbx,SIGNAL(toggled(bool)),peripheral,SLOT(setVisible(bool))); } diff --git a/src/regsExplorer/regsexplorer.h b/src/regsExplorer/regsexplorer.h --- a/src/regsExplorer/regsexplorer.h +++ b/src/regsExplorer/regsexplorer.h @@ -31,10 +31,21 @@ #include #include #include +#include + + class regsExplorer : public QDockWidget { Q_OBJECT + class regExplorerReadWriteDelegate: public peripheralWidget::readWriteProxy + { + public: + regExplorerReadWriteDelegate() {} + void writeReg(qint32 address,qint32 value){if(device)device->writeReg(address,value);} + qint32 readReg(qint32 address){if(device)return device->readReg(address);} + socExplorerEnumDevice* device; + }; public: explicit regsExplorer(QWidget *parent = 0); @@ -47,9 +58,9 @@ public slots: private: QTabWidget* mainWidget; regsExplorerCfg* cfg; - socRegsViewer* socViewer; - - +// socRegsViewer* socViewer; + SocRegsViewerNew* socViewer; + regExplorerReadWriteDelegate delegate; }; #endif // REGSEXPLORER_H diff --git a/src/src.pro b/src/src.pro --- a/src/src.pro +++ b/src/src.pro @@ -111,3 +111,4 @@ TRANSLATIONS = ../translations/socexplor +