# HG changeset patch # User Jeandet Alexis # Date 2014-06-03 17:17:11 # Node ID c6b44a3b51fa89ed65fd314ad4de9fb6e21fdc87 # Parent 81145171ec94a35d559dd185cfb3591015c3bab6 SREC File parser working. SREC Viewer working. Added toSREC function in elfFile class. codeFragment to SREC converter also working. All these objects also have Python bindings. diff --git a/src/common/PySocExplorer.h b/src/common/PySocExplorer.h --- a/src/common/PySocExplorer.h +++ b/src/common/PySocExplorer.h @@ -6,9 +6,10 @@ #include "SocExplorerPlot.h" #include "tcp_terminal_client.h" #include "elf/elfparser.h" -#include "abstractexecfile.h" +#include "abstractbinfile.h" #include "elf/elffile.h" #include "elf/elffilewidget.h" #include "elf/elfinfowdgt.h" #include "QCustomPlot/qcustomplot.h" #include "srec/srecfile.h" +#include "srec/srecfilewidget.h" diff --git a/src/common/abstractexecfile.cpp b/src/common/abstractbinfile.cpp rename from src/common/abstractexecfile.cpp rename to src/common/abstractbinfile.cpp --- a/src/common/abstractexecfile.cpp +++ b/src/common/abstractbinfile.cpp @@ -19,7 +19,7 @@ /*-- Author : Alexis Jeandet -- Mail : alexis.jeandet@member.fsf.org ----------------------------------------------------------------------------*/ -#include "abstractexecfile.h" +#include "abstractbinfile.h" codeFragment::codeFragment() diff --git a/src/common/abstractexecfile.h b/src/common/abstractbinfile.h rename from src/common/abstractexecfile.h rename to src/common/abstractbinfile.h --- a/src/common/abstractexecfile.h +++ b/src/common/abstractbinfile.h @@ -19,8 +19,8 @@ /*-- Author : Alexis Jeandet -- Mail : alexis.jeandet@member.fsf.org ----------------------------------------------------------------------------*/ -#ifndef ABSTRACTEXECFILE_H -#define ABSTRACTEXECFILE_H +#ifndef ABSTRACTBINFILE_H +#define ABSTRACTBINFILE_H #include @@ -28,13 +28,14 @@ class codeFragment { public: codeFragment(); - codeFragment(char* data, quint32 size, quint32 address):data(data),size(size),address(address){} + codeFragment(char* data, quint64 size, quint64 address):data(data),size(size),address(address){} + QString header; char* data; - quint32 size; - quint32 address; + quint64 size; + quint64 address; }; -class abstractExecFile : public QObject +class abstractBinFile : public QObject { Q_OBJECT public: @@ -48,4 +49,4 @@ protected: QString p_fileName; }; -#endif // ABSTRACTEXECFILE_H +#endif // ABSTRACTBINFILE_H diff --git a/src/common/common.pro b/src/common/common.pro --- a/src/common/common.pro +++ b/src/common/common.pro @@ -42,7 +42,9 @@ header.files = \ qipdialogbox.h \ lppserial/src/RS232.h \ qtablewidgetintitem.h \ - srec/srecfile.h + srec/srecfile.h \ + srec/srecfilewidget.h \ + abstractbinfile.cpp win32{ elfheader.path = $$[QT_INSTALL_HEADERS]/SocExplorer/common/libelf @@ -68,7 +70,7 @@ isEmpty(header.path) { INSTALLS += target header -INCLUDEPATH += QCustomPlot qhexedit +INCLUDEPATH += QCustomPlot qhexedit srec HEADERS += \ memsizewdgt.h \ @@ -82,14 +84,15 @@ HEADERS += \ tcp_terminal_client.h \ elf/elfinfowdgt.h \ elf/elfparser.h \ - abstractexecfile.h \ elf/elffile.h \ qipdialogbox.h \ PySocExplorer.h \ SocExplorerPlot.h \ elf/elffilewidget.h \ qtablewidgetintitem.h \ - srec/srecfile.h + srec/srecfile.h \ + srec/srecfilewidget.h \ + abstractbinfile.h SOURCES += \ @@ -104,16 +107,18 @@ SOURCES += \ tcp_terminal_client.cpp \ elf/elfinfowdgt.cpp \ elf/elfparser.cpp \ - abstractexecfile.cpp \ elf/elffile.cpp \ qipdialogbox.cpp \ SocExplorerPlot.cpp \ elf/elffilewidget.cpp \ qtablewidgetintitem.cpp \ - srec/srecfile.cpp + srec/srecfile.cpp \ + srec/srecfilewidget.cpp \ + abstractbinfile.cpp FORMS += \ - elf/elffilewidget.ui + elf/elffilewidget.ui \ + srec/srecfilewidget.ui OTHER_FILES += \ ./pythongenerator.sh \ diff --git a/src/common/elf/elffile.cpp b/src/common/elf/elffile.cpp --- a/src/common/elf/elffile.cpp +++ b/src/common/elf/elffile.cpp @@ -22,9 +22,10 @@ alexis.jeandet@member.fsf.org ----------------------------------------------------------------------------*/ #include "elffile.h" +#include "srec/srecfile.h" ElfFile::ElfFile() - :abstractExecFile() + :abstractBinFile() { this->opened = false; this->type_elf = false; @@ -33,7 +34,7 @@ ElfFile::ElfFile() } ElfFile::ElfFile(const QString &File) - :abstractExecFile() + :abstractBinFile() { this->opened = false; this->type_elf = false; @@ -141,7 +142,7 @@ codeFragment *ElfFile::getFragment(const getSectionData(i,&fragment->data); } } - + return fragment; } @@ -1039,3 +1040,8 @@ bool ElfFile::isElf(const QString &File) } return false; } + +bool ElfFile::toSrec(const QString &File) +{ + return srecFile::toSrec(this->getFragments(),File); +} diff --git a/src/common/elf/elffile.h b/src/common/elf/elffile.h --- a/src/common/elf/elffile.h +++ b/src/common/elf/elffile.h @@ -19,7 +19,7 @@ /*-- Author : Alexis Jeandet -- Mail : alexis.jeandet@member.fsf.org ----------------------------------------------------------------------------*/ -#include +#include #include #include #include @@ -58,7 +58,7 @@ public: GElf_Sym* sym; }; -class ElfFile : public abstractExecFile +class ElfFile : public abstractBinFile { Q_OBJECT public: @@ -109,6 +109,8 @@ public: bool iself(); static bool isElf(const QString& File); + bool toSrec(const QString& File); + private: codeFragment* getFragment(const QString& name); void updateSections(); 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 @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -46,6 +46,7 @@ #include #include #include +#include PythonQtShell_ElfFile::~PythonQtShell_ElfFile() { PythonQtPrivate* priv = PythonQt::priv(); @@ -361,6 +362,11 @@ bool PythonQtWrapper_ElfFile::openFile( return ( ((PythonQtPublicPromoter_ElfFile*)theWrappedObject)->promoted_openFile(File)); } +bool PythonQtWrapper_ElfFile::toSrec(ElfFile* theWrappedObject, const QString& File) +{ + return ( theWrappedObject->toSrec(File)); +} + PythonQtShell_MemSizeWdgt::~PythonQtShell_MemSizeWdgt() { @@ -4704,11 +4710,11 @@ QString PythonQtWrapper_XByteArray::toR -PythonQtShell_abstractExecFile::~PythonQtShell_abstractExecFile() { +PythonQtShell_abstractBinFile::~PythonQtShell_abstractBinFile() { PythonQtPrivate* priv = PythonQt::priv(); if (priv) { priv->shellClassDeleted(this); } } -void PythonQtShell_abstractExecFile::childEvent(QChildEvent* arg__1) +void PythonQtShell_abstractBinFile::childEvent(QChildEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); @@ -4723,9 +4729,9 @@ if (_wrapper) { return; } } - abstractExecFile::childEvent(arg__1); -} -int PythonQtShell_abstractExecFile::closeFile() + abstractBinFile::childEvent(arg__1); +} +int PythonQtShell_abstractBinFile::closeFile() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeFile"); @@ -4753,7 +4759,7 @@ if (_wrapper) { } return int(); } -void PythonQtShell_abstractExecFile::customEvent(QEvent* arg__1) +void PythonQtShell_abstractBinFile::customEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); @@ -4768,9 +4774,9 @@ if (_wrapper) { return; } } - abstractExecFile::customEvent(arg__1); -} -bool PythonQtShell_abstractExecFile::event(QEvent* arg__1) + abstractBinFile::customEvent(arg__1); +} +bool PythonQtShell_abstractBinFile::event(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); @@ -4796,9 +4802,9 @@ if (_wrapper) { return returnValue; } } - return abstractExecFile::event(arg__1); -} -bool PythonQtShell_abstractExecFile::eventFilter(QObject* arg__1, QEvent* arg__2) + return abstractBinFile::event(arg__1); +} +bool PythonQtShell_abstractBinFile::eventFilter(QObject* arg__1, QEvent* arg__2) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); @@ -4824,9 +4830,9 @@ if (_wrapper) { return returnValue; } } - return abstractExecFile::eventFilter(arg__1, arg__2); -} -QList PythonQtShell_abstractExecFile::getFragments() + return abstractBinFile::eventFilter(arg__1, arg__2); +} +QList PythonQtShell_abstractBinFile::getFragments() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "getFragments"); @@ -4854,7 +4860,7 @@ if (_wrapper) { } return QList(); } -bool PythonQtShell_abstractExecFile::isopened() +bool PythonQtShell_abstractBinFile::isopened() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "isopened"); @@ -4882,7 +4888,7 @@ if (_wrapper) { } return bool(); } -bool PythonQtShell_abstractExecFile::openFile(const QString& File) +bool PythonQtShell_abstractBinFile::openFile(const QString& File) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "openFile"); @@ -4910,7 +4916,7 @@ if (_wrapper) { } return bool(); } -void PythonQtShell_abstractExecFile::timerEvent(QTimerEvent* arg__1) +void PythonQtShell_abstractBinFile::timerEvent(QTimerEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); @@ -4925,11 +4931,11 @@ if (_wrapper) { return; } } - abstractExecFile::timerEvent(arg__1); -} -abstractExecFile* PythonQtWrapper_abstractExecFile::new_abstractExecFile() + abstractBinFile::timerEvent(arg__1); +} +abstractBinFile* PythonQtWrapper_abstractBinFile::new_abstractBinFile() { -return new PythonQtShell_abstractExecFile(); } +return new PythonQtShell_abstractBinFile(); } @@ -4941,7 +4947,7 @@ codeFragment* PythonQtWrapper_codeFragme { return new PythonQtShell_codeFragment(); } -codeFragment* PythonQtWrapper_codeFragment::new_codeFragment(char* data, unsigned int size, unsigned int address) +codeFragment* PythonQtWrapper_codeFragment::new_codeFragment(char* data, quint64 size, quint64 address) { return new PythonQtShell_codeFragment(data, size, address); } @@ -7045,16 +7051,56 @@ int PythonQtWrapper_srecFile::closeFile return ( ((PythonQtPublicPromoter_srecFile*)theWrappedObject)->promoted_closeFile()); } +int PythonQtWrapper_srecFile::getFragmentAddress(srecFile* theWrappedObject, int index) +{ + return ( theWrappedObject->getFragmentAddress(index)); +} + +bool PythonQtWrapper_srecFile::getFragmentData(srecFile* theWrappedObject, int index, char** buffer) +{ + return ( theWrappedObject->getFragmentData(index, buffer)); +} + +QString PythonQtWrapper_srecFile::getFragmentHeader(srecFile* theWrappedObject, int index) +{ + return ( theWrappedObject->getFragmentHeader(index)); +} + +int PythonQtWrapper_srecFile::getFragmentSize(srecFile* theWrappedObject, int index) +{ + return ( theWrappedObject->getFragmentSize(index)); +} + QList PythonQtWrapper_srecFile::getFragments(srecFile* theWrappedObject) { return ( ((PythonQtPublicPromoter_srecFile*)theWrappedObject)->promoted_getFragments()); } +int PythonQtWrapper_srecFile::getFragmentsCount(srecFile* theWrappedObject) +{ + return ( theWrappedObject->getFragmentsCount()); +} + +bool PythonQtWrapper_srecFile::isSREC(srecFile* theWrappedObject) +{ + return ( theWrappedObject->isSREC()); +} + +bool PythonQtWrapper_srecFile::static_srecFile_isSREC(const QString& File) +{ + return (srecFile::isSREC(File)); +} + bool PythonQtWrapper_srecFile::isopened(srecFile* theWrappedObject) { return ( ((PythonQtPublicPromoter_srecFile*)theWrappedObject)->promoted_isopened()); } +int PythonQtWrapper_srecFile::lineCount(srecFile* theWrappedObject) +{ + return ( theWrappedObject->lineCount()); +} + bool PythonQtWrapper_srecFile::openFile(srecFile* theWrappedObject, const QString& File) { return ( ((PythonQtPublicPromoter_srecFile*)theWrappedObject)->promoted_openFile(File)); @@ -7065,4 +7111,921 @@ bool PythonQtWrapper_srecFile::openFile return ( theWrappedObject->openFiles(Files)); } - +bool PythonQtWrapper_srecFile::static_srecFile_toSrec(QList fragments, const QString& File) +{ + return (srecFile::toSrec(fragments, File)); +} + + + +PythonQtShell_srecFileWidget::~PythonQtShell_srecFileWidget() { + PythonQtPrivate* priv = PythonQt::priv(); + if (priv) { priv->shellClassDeleted(this); } +} +void PythonQtShell_srecFileWidget::actionEvent(QActionEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "actionEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QActionEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::actionEvent(arg__1); +} +void PythonQtShell_srecFileWidget::changeEvent(QEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "changeEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::changeEvent(arg__1); +} +void PythonQtShell_srecFileWidget::childEvent(QChildEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QChildEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::childEvent(arg__1); +} +void PythonQtShell_srecFileWidget::closeEvent(QCloseEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QCloseEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::closeEvent(arg__1); +} +void PythonQtShell_srecFileWidget::contextMenuEvent(QContextMenuEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "contextMenuEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QContextMenuEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::contextMenuEvent(arg__1); +} +void PythonQtShell_srecFileWidget::customEvent(QEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::customEvent(arg__1); +} +int PythonQtShell_srecFileWidget::devType() const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "devType"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"int"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + int returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("devType", methodInfo, result); + } else { + returnValue = *((int*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return srecFileWidget::devType(); +} +void PythonQtShell_srecFileWidget::dragEnterEvent(QDragEnterEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragEnterEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QDragEnterEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::dragEnterEvent(arg__1); +} +void PythonQtShell_srecFileWidget::dragLeaveEvent(QDragLeaveEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragLeaveEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QDragLeaveEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::dragLeaveEvent(arg__1); +} +void PythonQtShell_srecFileWidget::dragMoveEvent(QDragMoveEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragMoveEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QDragMoveEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::dragMoveEvent(arg__1); +} +void PythonQtShell_srecFileWidget::dropEvent(QDropEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dropEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QDropEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::dropEvent(arg__1); +} +void PythonQtShell_srecFileWidget::enterEvent(QEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "enterEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::enterEvent(arg__1); +} +bool PythonQtShell_srecFileWidget::event(QEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"bool" , "QEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + bool returnValue; + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); + } else { + returnValue = *((bool*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return srecFileWidget::event(arg__1); +} +bool PythonQtShell_srecFileWidget::eventFilter(QObject* arg__1, QEvent* arg__2) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); + bool returnValue; + void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); + } else { + returnValue = *((bool*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return srecFileWidget::eventFilter(arg__1, arg__2); +} +void PythonQtShell_srecFileWidget::focusInEvent(QFocusEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusInEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QFocusEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::focusInEvent(arg__1); +} +bool PythonQtShell_srecFileWidget::focusNextPrevChild(bool next) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusNextPrevChild"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"bool" , "bool"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + bool returnValue; + void* args[2] = {NULL, (void*)&next}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("focusNextPrevChild", methodInfo, result); + } else { + returnValue = *((bool*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return srecFileWidget::focusNextPrevChild(next); +} +void PythonQtShell_srecFileWidget::focusOutEvent(QFocusEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusOutEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QFocusEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::focusOutEvent(arg__1); +} +bool PythonQtShell_srecFileWidget::hasHeightForWidth() const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "hasHeightForWidth"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"bool"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + bool returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("hasHeightForWidth", methodInfo, result); + } else { + returnValue = *((bool*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return srecFileWidget::hasHeightForWidth(); +} +int PythonQtShell_srecFileWidget::heightForWidth(int arg__1) const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "heightForWidth"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"int" , "int"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + int returnValue; + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("heightForWidth", methodInfo, result); + } else { + returnValue = *((int*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return srecFileWidget::heightForWidth(arg__1); +} +void PythonQtShell_srecFileWidget::hideEvent(QHideEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "hideEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QHideEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::hideEvent(arg__1); +} +void PythonQtShell_srecFileWidget::initPainter(QPainter* painter) const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "initPainter"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QPainter*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&painter}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::initPainter(painter); +} +void PythonQtShell_srecFileWidget::inputMethodEvent(QInputMethodEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QInputMethodEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::inputMethodEvent(arg__1); +} +QVariant PythonQtShell_srecFileWidget::inputMethodQuery(Qt::InputMethodQuery arg__1) const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodQuery"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"QVariant" , "Qt::InputMethodQuery"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + QVariant returnValue; + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("inputMethodQuery", methodInfo, result); + } else { + returnValue = *((QVariant*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return srecFileWidget::inputMethodQuery(arg__1); +} +void PythonQtShell_srecFileWidget::keyPressEvent(QKeyEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyPressEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QKeyEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::keyPressEvent(arg__1); +} +void PythonQtShell_srecFileWidget::keyReleaseEvent(QKeyEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyReleaseEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QKeyEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::keyReleaseEvent(arg__1); +} +void PythonQtShell_srecFileWidget::leaveEvent(QEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "leaveEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::leaveEvent(arg__1); +} +int PythonQtShell_srecFileWidget::metric(QPaintDevice::PaintDeviceMetric arg__1) const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "metric"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"int" , "QPaintDevice::PaintDeviceMetric"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + int returnValue; + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("metric", methodInfo, result); + } else { + returnValue = *((int*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return srecFileWidget::metric(arg__1); +} +QSize PythonQtShell_srecFileWidget::minimumSizeHint() const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "getMinimumSizeHint"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"QSize"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + QSize returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("getMinimumSizeHint", methodInfo, result); + } else { + returnValue = *((QSize*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return srecFileWidget::minimumSizeHint(); +} +void PythonQtShell_srecFileWidget::mouseDoubleClickEvent(QMouseEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseDoubleClickEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QMouseEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::mouseDoubleClickEvent(arg__1); +} +void PythonQtShell_srecFileWidget::mouseMoveEvent(QMouseEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseMoveEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QMouseEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::mouseMoveEvent(arg__1); +} +void PythonQtShell_srecFileWidget::mousePressEvent(QMouseEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mousePressEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QMouseEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::mousePressEvent(arg__1); +} +void PythonQtShell_srecFileWidget::mouseReleaseEvent(QMouseEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseReleaseEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QMouseEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::mouseReleaseEvent(arg__1); +} +void PythonQtShell_srecFileWidget::moveEvent(QMoveEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "moveEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QMoveEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::moveEvent(arg__1); +} +bool PythonQtShell_srecFileWidget::nativeEvent(const QByteArray& eventType, void* message, long* result) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "nativeEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"bool" , "const QByteArray&" , "void*" , "long*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); + bool returnValue; + void* args[4] = {NULL, (void*)&eventType, (void*)&message, (void*)&result}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("nativeEvent", methodInfo, result); + } else { + returnValue = *((bool*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return srecFileWidget::nativeEvent(eventType, message, result); +} +QPaintEngine* PythonQtShell_srecFileWidget::paintEngine() const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEngine"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"QPaintEngine*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + QPaintEngine* returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("paintEngine", methodInfo, result); + } else { + returnValue = *((QPaintEngine**)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return srecFileWidget::paintEngine(); +} +void PythonQtShell_srecFileWidget::paintEvent(QPaintEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QPaintEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::paintEvent(arg__1); +} +QPaintDevice* PythonQtShell_srecFileWidget::redirected(QPoint* offset) const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "redirected"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"QPaintDevice*" , "QPoint*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + QPaintDevice* returnValue; + void* args[2] = {NULL, (void*)&offset}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("redirected", methodInfo, result); + } else { + returnValue = *((QPaintDevice**)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return srecFileWidget::redirected(offset); +} +void PythonQtShell_srecFileWidget::resizeEvent(QResizeEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "resizeEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QResizeEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::resizeEvent(arg__1); +} +QPainter* PythonQtShell_srecFileWidget::sharedPainter() const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "sharedPainter"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"QPainter*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + QPainter* returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("sharedPainter", methodInfo, result); + } else { + returnValue = *((QPainter**)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return srecFileWidget::sharedPainter(); +} +void PythonQtShell_srecFileWidget::showEvent(QShowEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "showEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QShowEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::showEvent(arg__1); +} +QSize PythonQtShell_srecFileWidget::sizeHint() const +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "getSizeHint"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"QSize"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); + QSize returnValue; + void* args[1] = {NULL}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { + args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); + if (args[0]!=&returnValue) { + if (args[0]==NULL) { + PythonQt::priv()->handleVirtualOverloadReturnError("getSizeHint", methodInfo, result); + } else { + returnValue = *((QSize*)args[0]); + } + } + } + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return returnValue; + } +} + return srecFileWidget::sizeHint(); +} +void PythonQtShell_srecFileWidget::tabletEvent(QTabletEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "tabletEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QTabletEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::tabletEvent(arg__1); +} +void PythonQtShell_srecFileWidget::timerEvent(QTimerEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QTimerEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::timerEvent(arg__1); +} +void PythonQtShell_srecFileWidget::wheelEvent(QWheelEvent* arg__1) +{ +if (_wrapper) { + PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "wheelEvent"); + PyErr_Clear(); + if (obj && !PythonQtSlotFunction_Check(obj)) { + static const char* argumentList[] ={"" , "QWheelEvent*"}; + static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); + void* args[2] = {NULL, (void*)&arg__1}; + PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); + if (result) { Py_DECREF(result); } + Py_DECREF(obj); + return; + } +} + srecFileWidget::wheelEvent(arg__1); +} +srecFileWidget* PythonQtWrapper_srecFileWidget::new_srecFileWidget(QWidget* parent) +{ +return new PythonQtShell_srecFileWidget(parent); } + + 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 @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -124,6 +125,7 @@ void delete_ElfFile(ElfFile* obj) { dele bool iself(ElfFile* theWrappedObject); bool isopened(ElfFile* theWrappedObject); bool openFile(ElfFile* theWrappedObject, const QString& File); + bool toSrec(ElfFile* theWrappedObject, const QString& File); }; @@ -549,12 +551,12 @@ void delete_XByteArray(XByteArray* obj) -class PythonQtShell_abstractExecFile : public abstractExecFile +class PythonQtShell_abstractBinFile : public abstractBinFile { public: - PythonQtShell_abstractExecFile():abstractExecFile(),_wrapper(NULL) {}; + PythonQtShell_abstractBinFile():abstractBinFile(),_wrapper(NULL) {}; - ~PythonQtShell_abstractExecFile(); + ~PythonQtShell_abstractBinFile(); virtual void childEvent(QChildEvent* arg__1); virtual int closeFile(); @@ -569,12 +571,12 @@ virtual void timerEvent(QTimerEvent* ar PythonQtInstanceWrapper* _wrapper; }; -class PythonQtWrapper_abstractExecFile : public QObject +class PythonQtWrapper_abstractBinFile : public QObject { Q_OBJECT public: public slots: -abstractExecFile* new_abstractExecFile(); -void delete_abstractExecFile(abstractExecFile* obj) { delete obj; } +abstractBinFile* new_abstractBinFile(); +void delete_abstractBinFile(abstractBinFile* obj) { delete obj; } }; @@ -585,7 +587,7 @@ class PythonQtShell_codeFragment : publi { public: PythonQtShell_codeFragment():codeFragment(),_wrapper(NULL) {}; - PythonQtShell_codeFragment(char* data, unsigned int size, unsigned int address):codeFragment(data, size, address),_wrapper(NULL) {}; + PythonQtShell_codeFragment(char* data, quint64 size, quint64 address):codeFragment(data, size, address),_wrapper(NULL) {}; ~PythonQtShell_codeFragment(); @@ -598,14 +600,16 @@ class PythonQtWrapper_codeFragment : pub public: public slots: codeFragment* new_codeFragment(); -codeFragment* new_codeFragment(char* data, unsigned int size, unsigned int address); +codeFragment* new_codeFragment(char* data, quint64 size, quint64 address); void delete_codeFragment(codeFragment* obj) { delete obj; } -void py_set_address(codeFragment* theWrappedObject, unsigned int address){ theWrappedObject->address = address; } -unsigned int py_get_address(codeFragment* theWrappedObject){ return theWrappedObject->address; } +void py_set_size(codeFragment* theWrappedObject, quint64 size){ theWrappedObject->size = size; } +quint64 py_get_size(codeFragment* theWrappedObject){ return theWrappedObject->size; } +void py_set_header(codeFragment* theWrappedObject, QString header){ theWrappedObject->header = header; } +QString py_get_header(codeFragment* theWrappedObject){ return theWrappedObject->header; } +void py_set_address(codeFragment* theWrappedObject, quint64 address){ theWrappedObject->address = address; } +quint64 py_get_address(codeFragment* theWrappedObject){ return theWrappedObject->address; } void py_set_data(codeFragment* theWrappedObject, char* data){ theWrappedObject->data = data; } char* py_get_data(codeFragment* theWrappedObject){ return theWrappedObject->data; } -void py_set_size(codeFragment* theWrappedObject, unsigned int size){ theWrappedObject->size = size; } -unsigned int py_get_size(codeFragment* theWrappedObject){ return theWrappedObject->size; } }; @@ -819,10 +823,86 @@ srecFile* new_srecFile(const QString& F srecFile* new_srecFile(const QStringList& Files); void delete_srecFile(srecFile* obj) { delete obj; } int closeFile(srecFile* theWrappedObject); + int getFragmentAddress(srecFile* theWrappedObject, int index); + bool getFragmentData(srecFile* theWrappedObject, int index, char** buffer); + QString getFragmentHeader(srecFile* theWrappedObject, int index); + int getFragmentSize(srecFile* theWrappedObject, int index); QList getFragments(srecFile* theWrappedObject); + int getFragmentsCount(srecFile* theWrappedObject); + bool isSREC(srecFile* theWrappedObject); + bool static_srecFile_isSREC(const QString& File); bool isopened(srecFile* theWrappedObject); + int lineCount(srecFile* theWrappedObject); bool openFile(srecFile* theWrappedObject, const QString& File); bool openFiles(srecFile* theWrappedObject, const QStringList& Files); + bool static_srecFile_toSrec(QList fragments, const QString& File); }; + + + +class PythonQtShell_srecFileWidget : public srecFileWidget +{ +public: + PythonQtShell_srecFileWidget(QWidget* parent = 0):srecFileWidget(parent),_wrapper(NULL) {}; + + ~PythonQtShell_srecFileWidget(); + +virtual void actionEvent(QActionEvent* arg__1); +virtual void changeEvent(QEvent* arg__1); +virtual void childEvent(QChildEvent* arg__1); +virtual void closeEvent(QCloseEvent* arg__1); +virtual void contextMenuEvent(QContextMenuEvent* arg__1); +virtual void customEvent(QEvent* arg__1); +virtual int devType() const; +virtual void dragEnterEvent(QDragEnterEvent* arg__1); +virtual void dragLeaveEvent(QDragLeaveEvent* arg__1); +virtual void dragMoveEvent(QDragMoveEvent* arg__1); +virtual void dropEvent(QDropEvent* arg__1); +virtual void enterEvent(QEvent* arg__1); +virtual bool event(QEvent* arg__1); +virtual bool eventFilter(QObject* arg__1, QEvent* arg__2); +virtual void focusInEvent(QFocusEvent* arg__1); +virtual bool focusNextPrevChild(bool next); +virtual void focusOutEvent(QFocusEvent* arg__1); +virtual bool hasHeightForWidth() const; +virtual int heightForWidth(int arg__1) const; +virtual void hideEvent(QHideEvent* arg__1); +virtual void initPainter(QPainter* painter) const; +virtual void inputMethodEvent(QInputMethodEvent* arg__1); +virtual QVariant inputMethodQuery(Qt::InputMethodQuery arg__1) const; +virtual void keyPressEvent(QKeyEvent* arg__1); +virtual void keyReleaseEvent(QKeyEvent* arg__1); +virtual void leaveEvent(QEvent* arg__1); +virtual int metric(QPaintDevice::PaintDeviceMetric arg__1) const; +virtual QSize minimumSizeHint() const; +virtual void mouseDoubleClickEvent(QMouseEvent* arg__1); +virtual void mouseMoveEvent(QMouseEvent* arg__1); +virtual void mousePressEvent(QMouseEvent* arg__1); +virtual void mouseReleaseEvent(QMouseEvent* arg__1); +virtual void moveEvent(QMoveEvent* arg__1); +virtual bool nativeEvent(const QByteArray& eventType, void* message, long* result); +virtual QPaintEngine* paintEngine() const; +virtual void paintEvent(QPaintEvent* arg__1); +virtual QPaintDevice* redirected(QPoint* offset) const; +virtual void resizeEvent(QResizeEvent* arg__1); +virtual QPainter* sharedPainter() const; +virtual void showEvent(QShowEvent* arg__1); +virtual QSize sizeHint() const; +virtual void tabletEvent(QTabletEvent* arg__1); +virtual void timerEvent(QTimerEvent* arg__1); +virtual void wheelEvent(QWheelEvent* arg__1); + + PythonQtInstanceWrapper* _wrapper; +}; + +class PythonQtWrapper_srecFileWidget : public QObject +{ Q_OBJECT +public: +public slots: +srecFileWidget* new_srecFileWidget(QWidget* parent = 0); +void delete_srecFileWidget(srecFileWidget* obj) { delete obj; } +}; + + diff --git a/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer_init.cpp b/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer_init.cpp --- a/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer_init.cpp +++ b/src/common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer_init.cpp @@ -4,19 +4,20 @@ void PythonQt_init_PySocExplorer(PyObject* module) { PythonQt::priv()->registerClass(&ElfFile::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); -PythonQt::self()->addParentClass("ElfFile", "abstractExecFile",PythonQtUpcastingOffset()); +PythonQt::self()->addParentClass("ElfFile", "abstractBinFile",PythonQtUpcastingOffset()); PythonQt::priv()->registerClass(&MemSizeWdgt::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); PythonQt::priv()->registerClass(&QHexEdit::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); PythonQt::priv()->registerClass(&QHexSpinBox::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); PythonQt::priv()->registerClass(&SocExplorerPlot::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); PythonQt::priv()->registerClass(&TCP_Terminal_Client::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); PythonQt::priv()->registerCPPClass("XByteArray", "", "PySocExplorer", PythonQtCreateObject, NULL, module, 0); -PythonQt::priv()->registerClass(&abstractExecFile::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); +PythonQt::priv()->registerClass(&abstractBinFile::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); PythonQt::priv()->registerCPPClass("codeFragment", "", "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); PythonQt::priv()->registerClass(&elfFileWidget::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); PythonQt::priv()->registerClass(&elfInfoWdgt::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); PythonQt::priv()->registerCPPClass("elfparser", "", "PySocExplorer", PythonQtCreateObject, NULL, module, 0); PythonQt::priv()->registerClass(&srecFile::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); -PythonQt::self()->addParentClass("srecFile", "abstractExecFile",PythonQtUpcastingOffset()); +PythonQt::self()->addParentClass("srecFile", "abstractBinFile",PythonQtUpcastingOffset()); +PythonQt::priv()->registerClass(&srecFileWidget::staticMetaObject, "PySocExplorer", PythonQtCreateObject, PythonQtSetInstanceWrapperOnShell, module, 0); } diff --git a/src/common/pythonQtgeneratorCfg.txt b/src/common/pythonQtgeneratorCfg.txt --- a/src/common/pythonQtgeneratorCfg.txt +++ b/src/common/pythonQtgeneratorCfg.txt @@ -20,7 +20,7 @@ - + @@ -38,6 +38,12 @@ + + + + + + diff --git a/src/common/srec/srecfile.cpp b/src/common/srec/srecfile.cpp --- a/src/common/srec/srecfile.cpp +++ b/src/common/srec/srecfile.cpp @@ -1,4 +1,5 @@ #include "srecfile.h" +#include srecFile::srecFile() { @@ -21,7 +22,7 @@ srecFile::~srecFile() bool srecFile::openFile(const QString &File) { - openFiles(QStringList()<p_files.clear(); for(int i=0;ip_isSrec=true; + this->p_isSrec &= isSREC(Files.at(i)); this->p_files.append(new QFile(Files.at(i))); this->p_files.at(i)->open(QIODevice::ReadOnly); parseFile(this->p_files.at(i)); } + return true; } bool srecFile::isopened() @@ -53,7 +57,12 @@ bool srecFile::isopened() int srecFile::closeFile() { - + for(int i=0;i srecFile::getFragments() @@ -61,18 +70,152 @@ QList srecFile::getFragm return p_fragments; } +bool srecFile::toSrec(QList fragments, const QString &File) +{ + QString line; + QFile file(File); + file.open(QIODevice::WriteOnly); + if(file.isOpen()) + { + QTextStream stream( &file ); + //First build header + line.append("S0"); + line.append(QString("%1").arg(File.count()+3,2,16).replace(' ','0')); + line.append("0000"); + for(int i=0;isize);j+=16) + { + line.clear(); + line.append("S315"); + line.append(QString("%1").arg(fragment->address+j,8,16).replace(' ','0')); + for(int k=0;k<16;k++) + { + line.append(QString("%1").arg((uchar)fragment->data[j+k],2,16).replace(' ','0')); + } + line.append(QString("%1").arg((uchar)srecFile::lineCheckSum(line),2,16).replace(' ','0')); + line.append('\n'); + stream << line.toUpper(); + } + int rem = fragment->size%16; + if(rem) + { + line.clear(); + line.append("S3"); + line.append(QString("%1").arg(rem,2,16).replace(' ','0')); + line.append(QString("%1").arg(fragment->address+fragment->size-rem,8,16).replace(' ','0')); + for(int k=0;kdata[fragment->size-rem+k],2,16).replace(' ','0')); + } + line.append(QString("%1").arg((uchar)srecFile::lineCheckSum(line),2,16).replace(' ','0')); + line.append('\n'); + stream << line.toUpper(); + } + line.clear(); + line.append("S705"); + line.append(QString("%1").arg(fragment->address,8,16).replace(' ','0')); + line.append(QString("%1").arg((uchar)srecFile::lineCheckSum(line),2,16).replace(' ','0')); + line.append('\n'); + stream << line.toUpper(); + } + file.close(); + return true; + } + + return false; +} + +int srecFile::lineCount() +{ + return p_lineCount; +} + +int srecFile::getFragmentsCount() +{ + return p_fragments.count(); +} + +int srecFile::getFragmentAddress(int index) +{ + if((index < p_fragments.count()) && (index>=0)) + { + return p_fragments.at(index)->address; + } + return 0; +} + +int srecFile::getFragmentSize(int index) +{ + if((index < p_fragments.count()) && (index>=0)) + { + return p_fragments.at(index)->size; + } + return 0; +} + +QString srecFile::getFragmentHeader(int index) +{ + if((index < p_fragments.count()) && (index>=0)) + { + return p_fragments.at(index)->header; + } + return ""; +} + +bool srecFile::getFragmentData(int index, char **buffer) +{ + + if((index < p_fragments.count()) && (index>=0)) + { + *buffer = (char *)this->p_fragments.at(index)->data; + return true; + } + return false; +} + +bool srecFile::isSREC() +{ + return p_isSrec & isopened(); +} + +bool srecFile::isSREC(const QString &File) +{ + QFile file(File); + file.open(QIODevice::ReadOnly); + if(file.isOpen()) + { + file.seek(0); + QString line=file.readLine(); + file.close(); + return ((line.at(0)=='S')&&(line.at(1)=='0')); + } + return false; +} + void srecFile::parseFile(QFile *file) { if(file->isOpen()) { + this->p_lineCount = 0; file->seek(0); codeFragment* fragment=NULL; QByteArray data; - quint32 size=0; - quint32 address=0; + quint64 size=0; + quint64 address=-1; + QString header; while (!file->atEnd()) { QString line = file->readLine(); + p_lineCount++; if(line.count()>4) { if(line.at(0)=='S') @@ -81,6 +224,11 @@ void srecFile::parseFile(QFile *file) int count = line.mid(2,2).toInt(&ok,16); if(line.at(1)=='0') { + header.clear(); + for(int i=0;i<(count-3);i++) + { + header.append((char)line.mid((2*i)+8,2).toInt(&ok,16)); + } } if(line.at(1)=='1') { @@ -107,11 +255,12 @@ void srecFile::parseFile(QFile *file) } fragment = new codeFragment(); fragment->address = naddress; + fragment->header = header; } address = naddress+count-5; for(int i=0;i<(count-5);i++) { - data.append((char)line.mid((2*i)+8,2).toInt(&ok,16)); + data.append((char)line.mid((2*i)+12,2).toInt(&ok,16)); } } if(line.at(1)=='5') @@ -152,3 +301,19 @@ void srecFile::parseFile(QFile *file) } } +char srecFile::lineCheckSum(const QString &line) +{ + char sum=0; + QString localLine = line; + bool ok; + if(localLine.at(0)=='S') // then should skip the first two digits + { + localLine.remove(0,2); + } + for(int i=0;i -#include +#include #include #include -class srecFile : public abstractExecFile +class srecFile : public abstractBinFile { Q_OBJECT public: @@ -19,15 +19,27 @@ public: bool isopened(); int closeFile(); QList getFragments(); + static bool toSrec(QList fragments,const QString& File); + int lineCount(); + int getFragmentsCount(); + int getFragmentAddress(int index); + int getFragmentSize(int index); + QString getFragmentHeader(int index); + bool getFragmentData(int index, char **buffer); + bool isSREC(); + static bool isSREC(const QString& File); signals: public slots: private: void parseFile(QFile* file); + static char lineCheckSum(const QString& line); QStringList p_fileNames; QListp_files; QList p_fragments; + int p_lineCount; + bool p_isSrec; }; diff --git a/src/common/srec/srecfilewidget.cpp b/src/common/srec/srecfilewidget.cpp new file mode 100644 --- /dev/null +++ b/src/common/srec/srecfilewidget.cpp @@ -0,0 +1,68 @@ +#include "srecfilewidget.h" +#include "ui_srecfilewidget.h" +#include +#include + +srecFileWidget::srecFileWidget(QWidget *parent) : + QWidget(parent), + ui(new Ui::srecFileWidget) +{ + ui->setupUi(this); + connect(this->ui->fragmentsList,SIGNAL(cellActivated(int,int)),this,SLOT(recordCellActivated(int,int))); +} + +srecFileWidget::~srecFileWidget() +{ + delete ui; +} + +void srecFileWidget::updatSrecFile(srecFile *file) +{ + this->p_srec = file; + if(p_srec->isopened() && p_srec->isSREC()) + { + updateRecords(); + } +} + +void srecFileWidget::updateRecords() +{ + this->ui->fragmentsList->clear(); + this->ui->fragmentsList->setRowCount(p_srec->getFragmentsCount()); + this->ui->fragmentsList->setHorizontalHeaderLabels(QStringList()<<"Index"<<"Address"<<"Size"<<"Header"); + for(int i=0;igetFragmentsCount();i++) + { + QTableWidgetItem *newItem = (QTableWidgetItem*)new QTableWidgetIntItem(QString("%1").arg(i),DecimalItem); + newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable); + this->ui->fragmentsList->setItem(i, 0, newItem); + + newItem = (QTableWidgetItem*)new QTableWidgetIntItem(QString("0x%1").arg(p_srec->getFragmentAddress(i),8,16).replace(" ","0"),HexaDecimalItem); + newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable); + this->ui->fragmentsList->setItem(i, 1, newItem); + + newItem = (QTableWidgetItem*)new QTableWidgetIntItem(QString("%1").arg(p_srec->getFragmentSize(i)),DecimalItem); + newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable); + this->ui->fragmentsList->setItem(i, 2, newItem); + + newItem = new QTableWidgetItem(p_srec->getFragmentHeader(i)); + newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable); + this->ui->fragmentsList->setItem(i, 3, newItem); + + } + this->ui->fragmentsList->resizeColumnsToContents(); +} + +void srecFileWidget::recordCellActivated(int row, int column) +{ + Q_UNUSED(column) + char* buff=NULL; + int index = this->ui->fragmentsList->item(row,0)->text().toInt(); + if(index!=-1) + { + this->p_srec->getFragmentData(index,&buff); + this->ui->fragmentHexView->setData(QByteArray(buff,this->p_srec->getFragmentSize(index))); + } + +} + + diff --git a/src/common/srec/srecfilewidget.h b/src/common/srec/srecfilewidget.h new file mode 100644 --- /dev/null +++ b/src/common/srec/srecfilewidget.h @@ -0,0 +1,31 @@ +#ifndef SRECFILEWIDGET_H +#define SRECFILEWIDGET_H + +#include +#include "srecfile.h" + +namespace Ui { +class srecFileWidget; +} + +class srecFileWidget : public QWidget +{ + Q_OBJECT + +public: + explicit srecFileWidget(QWidget *parent = 0); + ~srecFileWidget(); + +public slots: + void updatSrecFile(srecFile* file); + void updateRecords(); + +private slots: + void recordCellActivated(int row, int column); + +private: + Ui::srecFileWidget *ui; + srecFile* p_srec; +}; + +#endif // SRECFILEWIDGET_H diff --git a/src/common/srec/srecfilewidget.ui b/src/common/srec/srecfilewidget.ui new file mode 100644 --- /dev/null +++ b/src/common/srec/srecfilewidget.ui @@ -0,0 +1,81 @@ + + + srecFileWidget + + + + 0 + 0 + 740 + 516 + + + + Form + + + + + + SREC records list + + + + + + + Index + + + + + Address + + + + + Size + + + + + Header + + + + + + + + + + + Hexadecimal Viewer + + + + + + + 256 + 0 + + + + + + + + + + + + QHexEdit + QWidget +
qhexedit.h
+ 1 +
+
+ + +