# HG changeset patch # User Alexis Jeandet # Date 2015-04-01 16:14:49 # Node ID c8f8e77e323c2781e0db70638a68c2f992f31c7d # Parent 87980339c225822794d3d6ea353c31318cdf39c0 Removed deprecated genericPySysdriver interface. diff --git a/APBUARTPLUGIN/APBUARTPLUGIN.cpp b/APBUARTPLUGIN/APBUARTPLUGIN.cpp --- a/APBUARTPLUGIN/APBUARTPLUGIN.cpp +++ b/APBUARTPLUGIN/APBUARTPLUGIN.cpp @@ -31,7 +31,7 @@ ApbUartPlugin::ApbUartPlugin(QWidget *pa this->setWidget((QWidget*)this->UI); this->uartConnected = false; this->UartThread = new UARTPollingThread(this); - this->pyObject = new APBUartPyWrapper(this); +// this->pyObject = new APBUartPyWrapper(this); connect(this->UI,SIGNAL(loopbackChkBxStateChanged(int)),this,SLOT(fifoDebugChangeState(int))); connect(this->UartThread,SIGNAL(apbUartTextReceived(QString)),this->UI,SIGNAL(apbUartTextReceived(QString))); connect(this->UI,SIGNAL(connectPort()),this,SLOT(toggleUartState())); @@ -40,12 +40,12 @@ ApbUartPlugin::ApbUartPlugin(QWidget *pa connect(this->UI,SIGNAL(UartSpeedChanged(QString)),this->UartThread,SLOT(setPortSpeedStr(QString))); connect(this->UI,SIGNAL(updateAPBUartsList()),this,SLOT(updateAPBUartsList())); connect(this->UI,SIGNAL(curentAPBUartChanged(int)),this,SLOT(setCurentAPBUart(int))); - connect(((APBUartPyWrapper*)this->pyObject),SIGNAL(openUart()),this,SLOT(openUart())); - connect(((APBUartPyWrapper*)this->pyObject),SIGNAL(closeUart()),this,SLOT(closeUart())); - connect(((APBUartPyWrapper*)this->pyObject),SIGNAL(setFifoDebugEnabled(bool)),this,SLOT(setFifoDebugEnabled(bool))); - connect(((APBUartPyWrapper*)this->pyObject),SIGNAL(setUARTPortNane(QString)),this,SLOT(setUARTPortNane(QString))); - connect(((APBUartPyWrapper*)this->pyObject),SIGNAL(setUARTPortSpeed(int)),this,SLOT(setUARTPortSpeed(int))); - connect(((APBUartPyWrapper*)this->pyObject),SIGNAL(updateAPBUartsList()),this,SLOT(updateAPBUartsList())); +// connect(((APBUartPyWrapper*)this->pyObject),SIGNAL(openUart()),this,SLOT(openUart())); +// connect(((APBUartPyWrapper*)this->pyObject),SIGNAL(closeUart()),this,SLOT(closeUart())); +// connect(((APBUartPyWrapper*)this->pyObject),SIGNAL(setFifoDebugEnabled(bool)),this,SLOT(setFifoDebugEnabled(bool))); +// connect(((APBUartPyWrapper*)this->pyObject),SIGNAL(setUARTPortNane(QString)),this,SLOT(setUARTPortNane(QString))); +// connect(((APBUartPyWrapper*)this->pyObject),SIGNAL(setUARTPortSpeed(int)),this,SLOT(setUARTPortSpeed(int))); +// connect(((APBUartPyWrapper*)this->pyObject),SIGNAL(updateAPBUartsList()),this,SLOT(updateAPBUartsList())); this->UartThread->start(); } diff --git a/ahbuartplugin/ahbuartplugin.cpp b/ahbuartplugin/ahbuartplugin.cpp --- a/ahbuartplugin/ahbuartplugin.cpp +++ b/ahbuartplugin/ahbuartplugin.cpp @@ -41,11 +41,11 @@ ahbuartplugin::ahbuartplugin(QWidget *pa this->setWidget((QWidget*)this->UI); QObject::connect(this,SIGNAL(activateSig(bool)),this->UI,SLOT(setConnected(bool))); QObject::connect(this->UI,SIGNAL(connectPortsig(QString,int)),this,SLOT(togglePort(QString,int))); - this->pyObject = new ahbuartPywrapper(this); - QObject::connect(((ahbuartPywrapper*)this->pyObject),SIGNAL(open(QString,int)),this,SLOT(open(QString,int))); - QObject::connect(((ahbuartPywrapper*)this->pyObject),SIGNAL(close()),this,SLOT(close())); - QObject::connect(((ahbuartPywrapper*)this->pyObject),SIGNAL(ReadBytes(uint,uint)),this,SLOT(ReadBytes(uint,uint))); - QObject::connect(((ahbuartPywrapper*)this->pyObject),SIGNAL(WriteBytes(uint,QList)),this,SLOT(WriteBytes(uint,QList))); +// this->pyObject = new ahbuartPywrapper(this); +// QObject::connect(((ahbuartPywrapper*)this->pyObject),SIGNAL(open(QString,int)),this,SLOT(open(QString,int))); +// QObject::connect(((ahbuartPywrapper*)this->pyObject),SIGNAL(close()),this,SLOT(close())); +// QObject::connect(((ahbuartPywrapper*)this->pyObject),SIGNAL(ReadBytes(uint,uint)),this,SLOT(ReadBytes(uint,uint))); +// QObject::connect(((ahbuartPywrapper*)this->pyObject),SIGNAL(WriteBytes(uint,QList)),this,SLOT(WriteBytes(uint,QList))); QObject::connect(this->UI,SIGNAL(rescanPorts()),this,SLOT(updatePortList())); QObject::connect(this,SIGNAL(addReadBytes(int)),this->UI,SLOT(addReadBytes(int))); QObject::connect(this,SIGNAL(addWritenBytes(int)),this->UI,SLOT(addWritenBytes(int))); @@ -175,6 +175,7 @@ void ahbuartplugin::connectPort(QString socexplorerproxy::loadChildSysDriver(this,"AMBA_PLUGIN"); this->scanDone=true; } + this->UI->setSystemSpeed(this->detectSpeed()); break; } } @@ -490,6 +491,46 @@ void ahbuartplugin::WriteBytes(unsigned this->Write(data,dataList.count()/4,address); } +int ahbuartplugin::detectSpeed() +{ + //scaler = (((system_clk*10)/(baudrate*8))-5)/10 + unsigned int ahbUartBaseAddress = SocExplorerEngine::self()->getEnumDeviceBaseAddress(this,0x01,0x007,0); +// unsigned int dsuBaseAddress = SocExplorerEngine::self()->getEnumDeviceBaseAddress(this,0x01,0x0017,0); + unsigned int dsuBaseAddress = 0x90000000; + unsigned int scaler = 0,dsuVal1=0,dsuVal2=0; + int speed=0; + QElapsedTimer time; + if(dsuBaseAddress!=-1) + { + time.start(); + if( this->Read(&dsuVal1,1,dsuBaseAddress+0x08)==1) + { + usleep(1000*1000); + qint64 el = time.elapsed(); + this->Read(&dsuVal2,1,dsuBaseAddress+0x08); + if(dsuVal1!=dsuVal2) + return ((dsuVal2-dsuVal1)/el)*1000; + } + } + if(ahbUartBaseAddress!=-1) + { + if( this->Read(&scaler,1,ahbUartBaseAddress+0x0C)==1) + { + scaler&=0x3FFFF; + speed = (int)(((double)scaler*10.0)+5.0)*((double)this->UI->baudRate()/10.0)*8.0; +// speed = (int)((double)(scaler+1)*8.0*(double)this->UI->baudRate()); + } + } + return speed; +} + +void ahbuartplugin::postInstantiationTrigger() +{ + if(this->scanDone && this->Connected) + { + this->UI->setSystemSpeed(this->detectSpeed()); + } +} @@ -506,3 +547,4 @@ void ahbuartplugin::WriteBytes(unsigned + diff --git a/ahbuartplugin/ahbuartplugin.h b/ahbuartplugin/ahbuartplugin.h --- a/ahbuartplugin/ahbuartplugin.h +++ b/ahbuartplugin/ahbuartplugin.h @@ -78,6 +78,8 @@ public slots: void updatePortList(); QVariantList ReadBytes(unsigned int address,unsigned int count); void WriteBytes(unsigned int address,QList dataList); + int detectSpeed(); + void postInstantiationTrigger(); signals: void setProgressValue(int progress); void addWritenBytes(int count); diff --git a/ahbuartplugin/ahbuartplugin.pro b/ahbuartplugin/ahbuartplugin.pro --- a/ahbuartplugin/ahbuartplugin.pro +++ b/ahbuartplugin/ahbuartplugin.pro @@ -1,65 +1,62 @@ -# -# Project created by QtCreator 2011-09-20T08:15:30 -# -#------------------------------------------------- - -CONFIG += socexplorerplugin -TEMPLATE = lib -CONFIG += dll -CONFIG -= static -VERSION=1.4.0 -TARGET = ahbuartplugin #$${DEBUG_EXT} -DEFINES += PLUGIN=ahbuartplugin -DEFINES += PLUGINHEADER="\"\\\"ahbuartplugin.h"\\\"\" -DEFINES += driver_Name="\"\\\"AHBUARTplugin"\\\"\" -DEFINES += driver_Author="\"\\\"Alexis Jeandet alexis.jeandet@lpp.polytechnique.fr"\\\"\" -DEFINES += driver_Description="\"\\\"Gaisler's AHBUART driver, gives master access to AHB bus."\\\"\" -DEFINES += driver_can_be_root=1 -DEFINES += driver_can_be_child=0 -DEFINES += driver_VID=0 -DEFINES += driver_PID=0 - - - - -INCLUDEPATH += \ - $${PWD} - - -HEADERS += \ - ahbuartplugin.h \ - ahbuartpluginui.h \ - ahbuartpywrapper.h \ - ahbuartpywrapper.h - - - -SOURCES += \ - ahbuartplugin.cpp \ - ahbuartpluginui.cpp \ - ahbuartpywrapper.cpp - -FORMS += \ - ahbuartpluginui.ui - - - - - - - - - - - - - - - - - - - - - - +# +# Project created by QtCreator 2011-09-20T08:15:30 +# +#------------------------------------------------- + +CONFIG += socexplorerplugin +TEMPLATE = lib +CONFIG += dll +CONFIG -= static +VERSION=1.4.0 +TARGET = ahbuartplugin #$${DEBUG_EXT} +DEFINES += PLUGIN=ahbuartplugin +DEFINES += PLUGINHEADER="\"\\\"ahbuartplugin.h"\\\"\" +DEFINES += driver_Name="\"\\\"AHBUARTplugin"\\\"\" +DEFINES += driver_Author="\"\\\"Alexis Jeandet alexis.jeandet@lpp.polytechnique.fr"\\\"\" +DEFINES += driver_Description="\"\\\"Gaisler's AHBUART driver, gives master access to AHB bus."\\\"\" +DEFINES += driver_can_be_root=1 +DEFINES += driver_can_be_child=0 +DEFINES += driver_VID=0 +DEFINES += driver_PID=0 + + + + +INCLUDEPATH += \ + $${PWD} + + +HEADERS += \ + ahbuartplugin.h \ + ahbuartpluginui.h + + + +SOURCES += \ + ahbuartplugin.cpp \ + ahbuartpluginui.cpp + +FORMS += \ + ahbuartpluginui.ui + + + + + + + + + + + + + + + + + + + + + + diff --git a/ahbuartplugin/ahbuartpluginui.cpp b/ahbuartplugin/ahbuartpluginui.cpp --- a/ahbuartplugin/ahbuartpluginui.cpp +++ b/ahbuartplugin/ahbuartpluginui.cpp @@ -85,12 +85,30 @@ void ahbUartPluginUI::addReadBytes(int c this->ui->RdBytesLCD->display(this->readBytes); } +void ahbUartPluginUI::setSystemSpeed(int speed) +{ + QStringList frLst = QStringList()<<"Hz"<<"kHz"<<"MHz"<<"GHz"; + int ind=0; + double speedD = speed; + while(speedD>1000.0) + { + speedD/=1000.0; + ind++; + } + this->ui->detectedSpeedLbl->setText(QString::number(speedD)+frLst[ind]); +} + void ahbUartPluginUI::setCompleter(QCompleter *completer) { this->ui->PortName->setCompleter(completer); } +int ahbUartPluginUI::baudRate() +{ + return ui->portSpeed->text().toInt(); +} + void ahbUartPluginUI::closeEvent(QCloseEvent *event) { event->accept(); diff --git a/ahbuartplugin/ahbuartpluginui.h b/ahbuartplugin/ahbuartpluginui.h --- a/ahbuartplugin/ahbuartpluginui.h +++ b/ahbuartplugin/ahbuartpluginui.h @@ -43,12 +43,14 @@ public: ~ahbUartPluginUI(); void closeEvent(QCloseEvent *event); void setCompleter(QCompleter* completer); + int baudRate(); public slots: void setConnected(bool connected); void connectPort(); void setconfig(QString PortName,int baudrate); void addWritenBytes(int count); void addReadBytes(int count); + void setSystemSpeed(int speed); signals: void connectPortsig(QString PortName,int baudrate); diff --git a/ahbuartplugin/ahbuartpluginui.ui b/ahbuartplugin/ahbuartpluginui.ui --- a/ahbuartplugin/ahbuartpluginui.ui +++ b/ahbuartplugin/ahbuartpluginui.ui @@ -6,15 +6,15 @@ 0 0 - 884 - 221 + 902 + 256 Form - + Statistics @@ -111,6 +111,23 @@ + + + + Detected Speed + + + + + + + + + + Qt::AlignCenter + + + diff --git a/ahbuartplugin/ahbuartpywrapper.cpp b/ahbuartplugin/ahbuartpywrapper.cpp deleted file mode 100644 --- a/ahbuartplugin/ahbuartpywrapper.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the SocExplorer Software --- Copyright (C) 2011, Plasma Physics Laboratory - CNRS --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------------*/ -/*-- Author : Alexis Jeandet --- Mail : alexis.jeandet@lpp.polytechnique.fr -----------------------------------------------------------------------------*/ -#include "ahbuartpywrapper.h" -#include -#include -#include -#include -#include - -ahbuartPywrapper::ahbuartPywrapper(socexplorerplugin *parent) : - genericPySysdriver(parent) -{ -} diff --git a/ahbuartplugin/ahbuartpywrapper.h b/ahbuartplugin/ahbuartpywrapper.h deleted file mode 100644 --- a/ahbuartplugin/ahbuartpywrapper.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef AHBUARTPYWRAPPER_H -#define AHBUARTPYWRAPPER_H -#include -#include -#include -#include - -class ahbuartPywrapper : public genericPySysdriver -{ - Q_OBJECT -public: - explicit ahbuartPywrapper(socexplorerplugin *parent = 0); - -signals: - bool open(QString PortName,int baudrate); - void close(); - QVariantList ReadBytes(unsigned int address,unsigned int count); - void WriteBytes(unsigned int address,QList dataList); -public slots: -// bool dumpMemory(unsigned int address,unsigned int count,QString file); -// bool memSet(unsigned int address,int value, unsigned int count); -// bool loadbin(unsigned int address,QString file); -}; - -#endif // AHBUARTPYWRAPPER_H diff --git a/dsu3plugin/dsu3plugin.cpp b/dsu3plugin/dsu3plugin.cpp --- a/dsu3plugin/dsu3plugin.cpp +++ b/dsu3plugin/dsu3plugin.cpp @@ -48,14 +48,14 @@ dsu3plugin::dsu3plugin(QWidget *parent): this->UI = new dsu3pluginui(); this->setWidget((QWidget*)this->UI); this->elfparserInst = new elfparser(); - this->pyObject = new dsu3pluginPywrapper(this); - QObject::connect(((dsu3pluginPywrapper*)this->pyObject),SIGNAL(openFile(QString)),this,SLOT(openFile(QString))); - QObject::connect(((dsu3pluginPywrapper*)this->pyObject),SIGNAL(loadFile()),this,SLOT(flashTarget())); - QObject::connect(((dsu3pluginPywrapper*)this->pyObject),SIGNAL(run()),this,SLOT(run())); - QObject::connect(((dsu3pluginPywrapper*)this->pyObject),SIGNAL(stop()),this,SLOT(stop())); - QObject::connect(((dsu3pluginPywrapper*)this->pyObject),SIGNAL(cacheEnable()),this,SLOT(cacheEnable())); - QObject::connect(((dsu3pluginPywrapper*)this->pyObject),SIGNAL(cacheDisable()),this,SLOT(cacheDisable())); - QObject::connect(((dsu3pluginPywrapper*)this->pyObject),SIGNAL(setCacheEnable(bool)),this,SLOT(setCacheEnable(bool))); +// this->pyObject = new dsu3pluginPywrapper(this); +// QObject::connect(((dsu3pluginPywrapper*)this->pyObject),SIGNAL(openFile(QString)),this,SLOT(openFile(QString))); +// QObject::connect(((dsu3pluginPywrapper*)this->pyObject),SIGNAL(loadFile()),this,SLOT(flashTarget())); +// QObject::connect(((dsu3pluginPywrapper*)this->pyObject),SIGNAL(run()),this,SLOT(run())); +// QObject::connect(((dsu3pluginPywrapper*)this->pyObject),SIGNAL(stop()),this,SLOT(stop())); +// QObject::connect(((dsu3pluginPywrapper*)this->pyObject),SIGNAL(cacheEnable()),this,SLOT(cacheEnable())); +// QObject::connect(((dsu3pluginPywrapper*)this->pyObject),SIGNAL(cacheDisable()),this,SLOT(cacheDisable())); +// QObject::connect(((dsu3pluginPywrapper*)this->pyObject),SIGNAL(setCacheEnable(bool)),this,SLOT(setCacheEnable(bool))); connect(this->UI,SIGNAL(openFile()),this,SLOT(openFile())); connect(this->UI,SIGNAL(flashTarget()),this,SLOT(flashTarget())); diff --git a/dsu3plugin/dsu3plugin.h b/dsu3plugin/dsu3plugin.h --- a/dsu3plugin/dsu3plugin.h +++ b/dsu3plugin/dsu3plugin.h @@ -53,6 +53,8 @@ public slots: void run(); void stop(); void toggleRun(); + //added for python backward compatibility + void loadFile(){this->flashTarget();} signals: void updateInfo(elfparser* parser); private: diff --git a/dsu3plugin/dsu3plugin.pro b/dsu3plugin/dsu3plugin.pro --- a/dsu3plugin/dsu3plugin.pro +++ b/dsu3plugin/dsu3plugin.pro @@ -31,13 +31,11 @@ INCLUDEPATH += \ HEADERS += \ dsu3plugin.h \ - dsu3pluginui.h \ - dsu3pluginpywrapper.h + dsu3pluginui.h SOURCES += \ dsu3plugin.cpp \ - dsu3pluginui.cpp \ - dsu3pluginpywrapper.cpp + dsu3pluginui.cpp diff --git a/dsu3plugin/dsu3pluginpywrapper.cpp b/dsu3plugin/dsu3pluginpywrapper.cpp deleted file mode 100644 --- a/dsu3plugin/dsu3pluginpywrapper.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "dsu3pluginpywrapper.h" - -dsu3pluginPywrapper::dsu3pluginPywrapper(socexplorerplugin *parent) : - genericPySysdriver(parent) -{ -} diff --git a/dsu3plugin/dsu3pluginpywrapper.h b/dsu3plugin/dsu3pluginpywrapper.h deleted file mode 100644 --- a/dsu3plugin/dsu3pluginpywrapper.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef DSU3PLUGINPYWRAPPER_H -#define DSU3PLUGINPYWRAPPER_H -#include - -class dsu3pluginPywrapper : public genericPySysdriver -{ - Q_OBJECT -public: - explicit dsu3pluginPywrapper(socexplorerplugin *parent = 0); - -signals: - bool openFile(QString fileName); - bool loadFile(); - bool run(); - bool stop(); - bool cacheDisable(); - bool cacheEnable(); - bool setCacheEnable(bool enabled); -public slots: - -}; - -#endif // DSU3PLUGINPYWRAPPER_H diff --git a/genericrwplugin/genericrwplugin.cpp b/genericrwplugin/genericrwplugin.cpp --- a/genericrwplugin/genericrwplugin.cpp +++ b/genericrwplugin/genericrwplugin.cpp @@ -27,12 +27,12 @@ genericrwplugin::genericrwplugin(QWidget this->setWidget((QWidget*)this->UI); connect(this->UI,SIGNAL(ReadSig(uint*,uint,uint)),this,SLOT(Read(uint*,uint,uint))); connect(this->UI,SIGNAL(WriteSig(uint*,uint,uint)),this,SLOT(Write(uint*,uint,uint))); - this->pyObject = new genericRWpluginPyWrapper(this); - //QObject::connect(this->pyObject,SIGNAL(ReadSig(uint*,uint,uint)),this,SLOT(Read(uint*,uint,uint))); - //QObject::connect(this->pyObject,SIGNAL(WriteSig(uint*,uint,uint)),this,SLOT(Write(uint*,uint,uint))); - QObject::connect(((genericRWpluginPyWrapper*)this->pyObject),SIGNAL(refresh()),this->UI,SIGNAL(refresh())); - QObject::connect(((genericRWpluginPyWrapper*)this->pyObject),SIGNAL(setAddress(quint32)),this->UI,SIGNAL(setAddress(quint32))); - QObject::connect(((genericRWpluginPyWrapper*)this->pyObject),SIGNAL(setLength(quint32)),this->UI,SIGNAL(setLength(quint32))); +// this->pyObject = new genericRWpluginPyWrapper(this); +// //QObject::connect(this->pyObject,SIGNAL(ReadSig(uint*,uint,uint)),this,SLOT(Read(uint*,uint,uint))); +// //QObject::connect(this->pyObject,SIGNAL(WriteSig(uint*,uint,uint)),this,SLOT(Write(uint*,uint,uint))); +// QObject::connect(((genericRWpluginPyWrapper*)this->pyObject),SIGNAL(refresh()),this->UI,SIGNAL(refresh())); +// QObject::connect(((genericRWpluginPyWrapper*)this->pyObject),SIGNAL(setAddress(quint32)),this->UI,SIGNAL(setAddress(quint32))); +// QObject::connect(((genericRWpluginPyWrapper*)this->pyObject),SIGNAL(setLength(quint32)),this->UI,SIGNAL(setLength(quint32))); } genericrwplugin::~genericrwplugin() diff --git a/genericrwplugin/genericrwplugin.pro b/genericrwplugin/genericrwplugin.pro --- a/genericrwplugin/genericrwplugin.pro +++ b/genericrwplugin/genericrwplugin.pro @@ -28,14 +28,12 @@ INCLUDEPATH += \ HEADERS += \ genericrwplugin.h \ genericrwpluginui.h \ - memeditor.h \ - genericrwpluginpywrapper.h + memeditor.h SOURCES += \ genericrwplugin.cpp \ genericrwpluginui.cpp \ - memeditor.cpp \ - genericrwpluginpywrapper.cpp + memeditor.cpp diff --git a/genericrwplugin/genericrwpluginpywrapper.cpp b/genericrwplugin/genericrwpluginpywrapper.cpp deleted file mode 100644 --- a/genericrwplugin/genericrwpluginpywrapper.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the SocExplorer Software --- Copyright (C) 2014, Plasma Physics Laboratory - CNRS --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------------*/ -/*-- Author : Alexis Jeandet --- Mail : alexis.jeandet@member.fsf.org -----------------------------------------------------------------------------*/ -#include "genericrwpluginpywrapper.h" - -genericRWpluginPyWrapper::genericRWpluginPyWrapper(socexplorerplugin *parent) : - genericPySysdriver(parent) -{ -} diff --git a/genericrwplugin/genericrwpluginpywrapper.h b/genericrwplugin/genericrwpluginpywrapper.h deleted file mode 100644 --- a/genericrwplugin/genericrwpluginpywrapper.h +++ /dev/null @@ -1,40 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the SocExplorer Software --- Copyright (C) 2014, Plasma Physics Laboratory - CNRS --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------------*/ -/*-- Author : Alexis Jeandet --- Mail : alexis.jeandet@member.fsf.org -----------------------------------------------------------------------------*/ -#ifndef GENERICRWPLUGINPYWRAPPER_H -#define GENERICRWPLUGINPYWRAPPER_H -#include -class genericRWpluginPyWrapper : public genericPySysdriver -{ - Q_OBJECT -public: - explicit genericRWpluginPyWrapper(socexplorerplugin *parent = 0); - -signals: - void refresh(); - void setAddress(quint32 address); - void setLength(quint32 length); - -public slots: - -}; - -#endif // GENERICRWPLUGINPYWRAPPER_H diff --git a/memctrlrplugin/memctrlrplugin.cpp b/memctrlrplugin/memctrlrplugin.cpp --- a/memctrlrplugin/memctrlrplugin.cpp +++ b/memctrlrplugin/memctrlrplugin.cpp @@ -28,8 +28,8 @@ memctrlrplugin::memctrlrplugin(QWidget * this->setWidget((QWidget*)this->UI); connect(this->UI,SIGNAL(WriteSig(uint*,uint,uint)),this,SLOT(Write(uint*,uint,uint))); connect(this->UI,SIGNAL(ReadSig(uint*,uint,uint)),this,SLOT(Read(uint*,uint,uint))); - this->pyObject = new memctrlrPyWrapper(this); - connect(this->pyObject,SIGNAL(launchTest(uint,uint)),this,SLOT(launchTest(uint,uint))); +// this->pyObject = new memctrlrPyWrapper(this); +// connect(this->pyObject,SIGNAL(launchTest(uint,uint)),this,SLOT(launchTest(uint,uint))); } memctrlrplugin::~memctrlrplugin() diff --git a/memctrlrplugin/memctrlrplugin.pro b/memctrlrplugin/memctrlrplugin.pro --- a/memctrlrplugin/memctrlrplugin.pro +++ b/memctrlrplugin/memctrlrplugin.pro @@ -28,15 +28,13 @@ HEADERS += \ memctrlrplugin.h \ memctrlrpluginui.h \ memorycheck.h \ - genericmemoryspacecheck.h \ - memctrlrpywrapper.h + genericmemoryspacecheck.h SOURCES += \ memctrlrplugin.cpp \ memctrlrpluginui.cpp \ memorycheck.cpp \ - genericmemoryspacecheck.cpp \ - memctrlrpywrapper.cpp + genericmemoryspacecheck.cpp diff --git a/memctrlrplugin/memctrlrpywrapper.cpp b/memctrlrplugin/memctrlrpywrapper.cpp deleted file mode 100644 --- a/memctrlrplugin/memctrlrpywrapper.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "memctrlrpywrapper.h" - -memctrlrPyWrapper::memctrlrPyWrapper(socexplorerplugin *parent) : - genericPySysdriver(parent) -{ -} diff --git a/memctrlrplugin/memctrlrpywrapper.h b/memctrlrplugin/memctrlrpywrapper.h deleted file mode 100644 --- a/memctrlrplugin/memctrlrpywrapper.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef MEMCTRLRPYWRAPPER_H -#define MEMCTRLRPYWRAPPER_H -#include - -class memctrlrPyWrapper : public genericPySysdriver -{ - Q_OBJECT -public: - explicit memctrlrPyWrapper(socexplorerplugin *parent = 0); - -signals: - bool launchTest(unsigned int baseAddress,unsigned int size); -public slots: - -}; - -#endif // MEMCTRLRPYWRAPPER_H diff --git a/spwplugin/spwplugin.cpp b/spwplugin/spwplugin.cpp --- a/spwplugin/spwplugin.cpp +++ b/spwplugin/spwplugin.cpp @@ -32,7 +32,7 @@ spwplugin::spwplugin(QWidget *parent):so Q_UNUSED(parent) this->bridge = NULL; this->scanDone = false; - this->pyObject = new spwPyWrapper(this); +// this->pyObject = new spwPyWrapper(this); this->tcpServer = new SpwTcpPacketServer(this); this->mainGroupBox = new QGroupBox("SpaceWire Plugin Configuration",this); this->bridgeSelector = new QComboBox(this); @@ -47,11 +47,11 @@ spwplugin::spwplugin(QWidget *parent):so this->bridgeSelector->addItem("STAR-Dundee Spw USB Brick"); this->bridgeSelector->addItem("GR-ESB"); connect(this->bridgeSelector,SIGNAL(currentIndexChanged(QString)),this,SLOT(bridgeSelectionChanged(QString))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(selectBridge(QString)),this,SLOT(selectBridge(QString))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(TCPServerConnect()),this->tcpServer,SLOT(connectServer())); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(TCPServerDisconnect()),this->tcpServer,SLOT(disconnectServer())); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(TCPServerSetPort(qint32)),this->tcpServer,SLOT(setServerPort(qint32))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(TCPServerSetIP(QString)),this->tcpServer,SLOT(setServerSetIP(QString))); + connect(this,SIGNAL(selectBridge(QString)),this,SLOT(selectBridge(QString))); + connect(this,SIGNAL(TCPServerConnect()),this->tcpServer,SLOT(connectServer())); + connect(this,SIGNAL(TCPServerDisconnect()),this->tcpServer,SLOT(disconnectServer())); + connect(this,SIGNAL(TCPServerSetPort(qint32)),this->tcpServer,SLOT(setServerPort(qint32))); + connect(this,SIGNAL(TCPServerSetIP(QString)),this->tcpServer,SLOT(setServerSetIP(QString))); } @@ -95,31 +95,31 @@ void spwplugin::bridgeSelectionChanged(c this->bridge = new stardundeeSPW_USB(this); this->mainLayout->addWidget(this->bridge->getGUI(),1,0,1,2); connect(this->bridge,SIGNAL(setConnected(bool)),this,SLOT(setConnected(bool))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSelectBrick(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectBrick(int))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSelectLinkNumber(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectLinkNumber(int))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSelectLinkSpeed(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectLinkSpeed(int))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetSourceAddress(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetSourceAddress(QString))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetDestinationAddress(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetDestinationAddress(QString))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetDestinationKey(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetDestinationKey(QString))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetRmapTimeout(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetRmapTimeout(QString))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(connectBridge()),((stardundeeSPW_USB*)bridge),SLOT(connectBridge())); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(disconnectBridge()),((stardundeeSPW_USB*)bridge),SLOT(disconnectBridge())); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeGetAvailableBrickCount()), + connect(this,SIGNAL(StarDundeeSelectBrick(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectBrick(int))); + connect(this,SIGNAL(StarDundeeSelectLinkNumber(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectLinkNumber(int))); + connect(this,SIGNAL(StarDundeeSelectLinkSpeed(int)),((stardundeeSPW_USB*)bridge),SIGNAL(SelectLinkSpeed(int))); + connect(this,SIGNAL(StarDundeeSetSourceAddress(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetSourceAddress(QString))); + connect(this,SIGNAL(StarDundeeSetDestinationAddress(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetDestinationAddress(QString))); + connect(this,SIGNAL(StarDundeeSetDestinationKey(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetDestinationKey(QString))); + connect(this,SIGNAL(StarDundeeSetRmapTimeout(QString)),((stardundeeSPW_USB*)bridge),SIGNAL(SetRmapTimeout(QString))); + connect(this,SIGNAL(connectBridge()),((stardundeeSPW_USB*)bridge),SLOT(connectBridge())); + connect(this,SIGNAL(disconnectBridge()),((stardundeeSPW_USB*)bridge),SLOT(disconnectBridge())); + connect(this,SIGNAL(StarDundeeGetAvailableBrickCount()), ((stardundeeSPW_USB*)bridge),SIGNAL(GetAvailableBrickCount())); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeGetNbPacketsTransmittedToSpw()), + connect(this,SIGNAL(StarDundeeGetNbPacketsTransmittedToSpw()), ((stardundeeSPW_USB*)bridge),SIGNAL(GetNbPacketsTransmittedToSpw())); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeGetNbCCSDSPacketsTransmittedToSpw()), + connect(this,SIGNAL(StarDundeeGetNbCCSDSPacketsTransmittedToSpw()), ((stardundeeSPW_USB*)bridge),SIGNAL(GetNbCCSDSPacketsTransmittedToSpw())); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeGetLinkNumber()),((stardundeeSPW_USB*)bridge),SIGNAL(GetLinkNumber())); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetBrickAsAninterface(bool)), + connect(this,SIGNAL(StarDundeeGetLinkNumber()),((stardundeeSPW_USB*)bridge),SIGNAL(GetLinkNumber())); + connect(this->,SIGNAL(StarDundeeSetBrickAsAninterface(bool)), ((stardundeeSPW_USB*)bridge),SIGNAL(SetBrickAsAnInterface(bool))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetBrickAsARouter(bool)), + connect(this,SIGNAL(StarDundeeSetBrickAsARouter(bool)), ((stardundeeSPW_USB*)bridge),SIGNAL(SetBrickAsARouter(bool))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeStartTimecodes(bool)), + connect(this,SIGNAL(StarDundeeStartTimecodes(bool)), ((stardundeeSPW_USB*)bridge),SIGNAL(StartSendingTimecodes(bool))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSetTimecodeFrequency(double)), + connect(this,SIGNAL(StarDundeeSetTimecodeFrequency(double)), ((stardundeeSPW_USB*)bridge),SIGNAL(SetTimecodeFrequency(double))); - connect(((spwPyWrapper*)this->pyObject),SIGNAL(StarDundeeSendOneTimecode(unsigned char)), + connect(this,SIGNAL(StarDundeeSendOneTimecode(unsigned char)), ((stardundeeSPW_USB*)bridge),SIGNAL(SendOneTimecode(unsigned char))); connect(this->bridge,SIGNAL(pushPacketOverTCP(char*,int)),this->tcpServer,SLOT(pushPacket(char*,int))); connect(this->tcpServer, SIGNAL(sendSPWPacket(char*,int)), ((stardundeeSPW_USB*)bridge), SLOT(sendPacketComingFromTCPServer(char*,int))); diff --git a/spwplugin/spwplugin.h b/spwplugin/spwplugin.h --- a/spwplugin/spwplugin.h +++ b/spwplugin/spwplugin.h @@ -63,6 +63,30 @@ public slots: void setConnected(bool connected); signals: + void selectBridge(const QString &bridgeName); + bool connectBridge(); + bool disconnectBridge(); + void StarDundeeSelectBrick(int brickIndex); + void StarDundeeSelectLinkNumber(int linkIndex); + void StarDundeeSelectLinkSpeed(int linkSpeed); + void StarDundeeSetSourceAddress(const QString & destKey); + void StarDundeeSetDestinationAddress(const QString & address); + void StarDundeeSetDestinationKey(const QString & key); + void StarDundeeSetRmapTimeout(const QString & timeout); + int StarDundeeGetAvailableBrickCount(); + unsigned int StarDundeeGetNbPacketsTransmittedToSpw( void ); + unsigned int StarDundeeGetNbCCSDSPacketsTransmittedToSpw( void ); + int StarDundeeGetLinkNumber(); + void StarDundeeSetBrickAsAninterface( bool ); + void StarDundeeSetBrickAsARouter( bool ); + void StarDundeeSetTimecodeFrequency( double ); + void StarDundeeStartTimecodes( bool ); + void StarDundeeSendOneTimecode( unsigned char timecode ); + + void TCPServerConnect(); + void TCPServerDisconnect(); + void TCPServerSetPort(qint32 port); + void TCPServerSetIP(QString ip); private: SpwTcpPacketServer* tcpServer; diff --git a/spwplugin/spwplugin.pro b/spwplugin/spwplugin.pro --- a/spwplugin/spwplugin.pro +++ b/spwplugin/spwplugin.pro @@ -40,7 +40,6 @@ HEADERS += \ spw.h \ StarDundee/stardundeegui.h \ SpwTcpPacketServer/spwtcppacketserver.h \ - spwpywrapper.h \ GR-ESB/gr_esb_bridge.h \ GR-ESB/gr_esb_ui.h \ SpwTcpPacketServer/incomingpacketparser.h @@ -52,7 +51,6 @@ SOURCES += \ abstractspwbridge.cpp \ StarDundee/stardundeegui.cpp \ SpwTcpPacketServer/spwtcppacketserver.cpp \ - spwpywrapper.cpp \ GR-ESB/gr_esb_bridge.cpp \ GR-ESB/gr_esb_ui.cpp \ SpwTcpPacketServer/incomingpacketparser.cpp diff --git a/spwplugin/spwpywrapper.cpp b/spwplugin/spwpywrapper.cpp deleted file mode 100644 --- a/spwplugin/spwpywrapper.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the SocExplorer Software --- Copyright (C) 2014, Plasma Physics Laboratory - CNRS --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------------*/ -/*-- Author : Alexis Jeandet --- Mail : alexis.jeandet@member.fsf.org -----------------------------------------------------------------------------*/ -#include "spwpywrapper.h" - -spwPyWrapper::spwPyWrapper(socexplorerplugin *parent) : - genericPySysdriver(parent) -{ -} diff --git a/spwplugin/spwpywrapper.h b/spwplugin/spwpywrapper.h deleted file mode 100644 --- a/spwplugin/spwpywrapper.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef SPWPYWRAPPER_H -#define SPWPYWRAPPER_H -#include - -class spwPyWrapper : public genericPySysdriver -{ - Q_OBJECT -public: - explicit spwPyWrapper(socexplorerplugin *parent = 0); -signals: - void selectBridge(const QString &bridgeName); - bool connectBridge(); - bool disconnectBridge(); - void StarDundeeSelectBrick(int brickIndex); - void StarDundeeSelectLinkNumber(int linkIndex); - void StarDundeeSelectLinkSpeed(int linkSpeed); - void StarDundeeSetSourceAddress(const QString & destKey); - void StarDundeeSetDestinationAddress(const QString & address); - void StarDundeeSetDestinationKey(const QString & key); - void StarDundeeSetRmapTimeout(const QString & timeout); - int StarDundeeGetAvailableBrickCount(); - unsigned int StarDundeeGetNbPacketsTransmittedToSpw( void ); - unsigned int StarDundeeGetNbCCSDSPacketsTransmittedToSpw( void ); - int StarDundeeGetLinkNumber(); - void StarDundeeSetBrickAsAninterface( bool ); - void StarDundeeSetBrickAsARouter( bool ); - void StarDundeeSetTimecodeFrequency( double ); - void StarDundeeStartTimecodes( bool ); - void StarDundeeSendOneTimecode( unsigned char timecode ); - - void TCPServerConnect(); - void TCPServerDisconnect(); - void TCPServerSetPort(qint32 port); - void TCPServerSetIP(QString ip); - -public slots: -}; - -#endif // SPWPYWRAPPER_H