diff --git a/doc/PythonExamples/PythonPlugin.py b/doc/PythonExamples/PythonPlugin.py --- a/doc/PythonExamples/PythonPlugin.py +++ b/doc/PythonExamples/PythonPlugin.py @@ -1,10 +1,36 @@ #!/usr/bin/lppmon -e class test(PySocExplorerEngine.socexplorerplugin): - def hello(self): - print "hello" - def VID(self): - return 10 - def PID(self): - return 100 + m_Layout = QtGui.QGridLayout() + m_CenterWidget = QtGui.QWidget() + m_hexviewer = PySocExplorer.QHexEdit() + m_addressQSPB = PySocExplorer.QHexSpinBox() + m_readQPB = QtGui.QPushButton("read") + m_writeQPB = QtGui.QPushButton("write") + def postInstantiationTrigger(self): + print "building GUI" + self.setWidget(self.m_CenterWidget) + self.m_CenterWidget.setLayout(self.m_Layout) + self.m_Layout.addWidget(self.m_addressQSPB,0,0,1,1) + self.m_Layout.addWidget(self.m_readQPB,0,1,1,1) + self.m_Layout.addWidget(self.m_writeQPB,0,2,1,1) + self.m_Layout.addWidget(self.m_hexviewer,1,0,1,-1) + def hello(self): + print "hello" + def VID(self): + return 10 + def PID(self): + return 100 + def readData(self): + bufferQBA = QtCore.QByteArray() + buffer = self.parentPlugin().Read(self.m_addressQSPB.value,16*1024) + for i in range(0,16*1024): + bufferQBA.append(int(buffer[i])) + bufferQBA.append(int(buffer[i])) + bufferQBA.append(int(buffer[i])) + bufferQBA.append(int(buffer[i])) + self.m_hexviewer.setData(bufferQBA) + + + diff --git a/src/SocExplorerEngine/plugins/socexplorerplugin.h b/src/SocExplorerEngine/plugins/socexplorerplugin.h --- a/src/SocExplorerEngine/plugins/socexplorerplugin.h +++ b/src/SocExplorerEngine/plugins/socexplorerplugin.h @@ -162,6 +162,8 @@ public slots: virtual bool dumpMemory(unsigned int address,unsigned int count,QString file,const QString& format); QVariantList Read(unsigned int address, unsigned int count); void Write(unsigned int address, QList dataList); + socexplorerplugin* parentPlugin(){return this->parent;} + socexplorerplugin* toPlugin(){return (socexplorerplugin*)this;} protected: int BaseAddress; bool Connected; diff --git a/src/SocExplorerEngine/pythonQtgeneratorCfg.txt b/src/SocExplorerEngine/pythonQtgeneratorCfg.txt --- a/src/SocExplorerEngine/pythonQtgeneratorCfg.txt +++ b/src/SocExplorerEngine/pythonQtgeneratorCfg.txt @@ -4,7 +4,6 @@ - diff --git a/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.cpp b/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.cpp --- a/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.cpp +++ b/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.cpp @@ -4852,6 +4852,21 @@ void PythonQtWrapper_SocExplorerPlot::mo ( ((PythonQtPublicPromoter_SocExplorerPlot*)theWrappedObject)->promoted_mouseReleaseEvent(arg__1)); } +void PythonQtWrapper_SocExplorerPlot::removeAllGraphs(SocExplorerPlot* theWrappedObject) +{ + ( theWrappedObject->removeAllGraphs()); +} + +bool PythonQtWrapper_SocExplorerPlot::removeGraph(SocExplorerPlot* theWrappedObject, int graphIndex) +{ + return ( theWrappedObject->removeGraph(graphIndex)); +} + +void PythonQtWrapper_SocExplorerPlot::replot(SocExplorerPlot* theWrappedObject) +{ + ( theWrappedObject->replot()); +} + void PythonQtWrapper_SocExplorerPlot::rescaleAxis(SocExplorerPlot* theWrappedObject) { ( theWrappedObject->rescaleAxis()); @@ -4902,6 +4917,11 @@ void PythonQtWrapper_SocExplorerPlot::se ( theWrappedObject->setTitle(title)); } +void PythonQtWrapper_SocExplorerPlot::setXaxisDateTimeFormat(SocExplorerPlot* theWrappedObject, const QString& format) +{ + ( theWrappedObject->setXaxisDateTimeFormat(format)); +} + void PythonQtWrapper_SocExplorerPlot::setXaxisLabel(SocExplorerPlot* theWrappedObject, QString label) { ( theWrappedObject->setXaxisLabel(label)); diff --git a/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.h b/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.h --- a/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.h +++ b/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer0.h @@ -480,6 +480,9 @@ void delete_SocExplorerPlot(SocExplorerP void mouseMoveEvent(SocExplorerPlot* theWrappedObject, QMouseEvent* arg__1); void mousePressEvent(SocExplorerPlot* theWrappedObject, QMouseEvent* arg__1); void mouseReleaseEvent(SocExplorerPlot* theWrappedObject, QMouseEvent* arg__1); + void removeAllGraphs(SocExplorerPlot* theWrappedObject); + bool removeGraph(SocExplorerPlot* theWrappedObject, int graphIndex); + void replot(SocExplorerPlot* theWrappedObject); void rescaleAxis(SocExplorerPlot* theWrappedObject); void setAdaptativeSampling(SocExplorerPlot* theWrappedObject, int graphIndex, bool enable); void setGraphData(SocExplorerPlot* theWrappedObject, int graphIndex, QList x, QList y); @@ -490,6 +493,7 @@ void delete_SocExplorerPlot(SocExplorerP void setLegendFont(SocExplorerPlot* theWrappedObject, QFont font); void setLegendSelectedFont(SocExplorerPlot* theWrappedObject, QFont font); void setTitle(SocExplorerPlot* theWrappedObject, QString title); + void setXaxisDateTimeFormat(SocExplorerPlot* theWrappedObject, const QString& format); void setXaxisLabel(SocExplorerPlot* theWrappedObject, QString label); void setXaxisRange(SocExplorerPlot* theWrappedObject, double lower, double upper); void setYaxisLabel(SocExplorerPlot* theWrappedObject, QString label); diff --git a/src/src.pro b/src/src.pro --- a/src/src.pro +++ b/src/src.pro @@ -103,6 +103,15 @@ TRANSLATIONS = ../translations/socexplor FORMS += \ regsExplorer/regsexplorernew.ui +DISTFILES += \ + ../doc/PythonExamples/LEON3_LOAD.py \ + ../doc/PythonExamples/PythonPlugin.py \ + ../doc/PythonExamples/simpledemo1.py \ + ../doc/PythonExamples/SocExplorerPlot.py \ + ../doc/PythonExamples/SocExplorerPlot2.py \ + ../doc/PythonExamples/SocExplorerPlot3.py \ + ../doc/PythonExamples/tcpterminaldemo.py \ + ../doc/PythonExamples/tcpterminaldemo2.py @@ -111,3 +120,4 @@ FORMS += \ +