diff --git a/spwplugin/spwplugin.cpp b/spwplugin/spwplugin.cpp --- a/spwplugin/spwplugin.cpp +++ b/spwplugin/spwplugin.cpp @@ -40,6 +40,7 @@ spwplugin::spwplugin(QWidget *parent):so this->bridgeSelector->addItem("none"); this->bridgeSelector->addItem("STAR-Dundee Spw USB Brick"); connect(this->bridgeSelector,SIGNAL(currentIndexChanged(QString)),this,SLOT(bridgeSelectionChanged(QString))); + connect(((spwPyWrapper*)this->pyObject),SIGNAL(selectBridge(QString)),this,SLOT(selectBridge(QString))); } @@ -96,6 +97,19 @@ void spwplugin::bridgeSelectionChanged(c } +void spwplugin::selectBridge(const QString &text) +{ + + if(text=="none") + { + this->bridgeSelector->setCurrentIndex(0); + } + if(text=="STAR-Dundee Spw USB Brick") + { + this->bridgeSelector->setCurrentIndex(1); + } +} + void spwplugin::setConnected(bool connected) { this->bridgeSelector->setDisabled(connected); diff --git a/spwplugin/spwplugin.h b/spwplugin/spwplugin.h --- a/spwplugin/spwplugin.h +++ b/spwplugin/spwplugin.h @@ -55,6 +55,7 @@ public slots: unsigned int Read(unsigned int *Value,unsigned int count, unsigned int address=0); void bridgeSelectionChanged( const QString & text ); + void selectBridge( const QString & text ); void setConnected(bool connected); signals: diff --git a/spwplugin/spwpywrapper.h b/spwplugin/spwpywrapper.h --- a/spwplugin/spwpywrapper.h +++ b/spwplugin/spwpywrapper.h @@ -9,6 +9,7 @@ public: explicit spwPyWrapper(socexplorerplugin *parent = 0); signals: + void selectBridge(const QString &bridgeName); bool connectBridge(); bool disconnectBridge(); void StarDundeeSelectBrick(int brickIndex); diff --git a/spwplugin/stardundeespw_usb.cpp b/spwplugin/stardundeespw_usb.cpp --- a/spwplugin/stardundeespw_usb.cpp +++ b/spwplugin/stardundeespw_usb.cpp @@ -128,10 +128,6 @@ unsigned int stardundeeSPW_USB::Write(un qApp->processEvents(); } } -// if(progress!=NULL) -// { -// SocExplorerEngine::deleteProgressBar(progress); -// } return written; } @@ -208,10 +204,6 @@ unsigned int stardundeeSPW_USB::Read(uns qApp->processEvents(); } } -// if(progress!=NULL) -// { -// SocExplorerEngine::deleteProgressBar(progress); -// } return read; }