Pre-0.7 partially back-ported.
Alexis Jeandet -
r106:7598f3bdb8ba 0.6
Not Reviewed
Show More
Add another comment
TODOs: 0 unresolved 0 Resolved
COMMENTS: 0 General 0 Inline
@@ -1,4 +1,4
1 1cb664ab4bb3c531d706b1948a378ed9810c0dda src/SocExplorerEngine/PeripheralWidget
1 1cb664ab4bb3c531d706b1948a378ed9810c0dda src/SocExplorerEngine/PeripheralWidget
2 1f143e4ae72a0bb4832b546eb76eb50e94049b80 src/common/genericBinaryFiles
2 1f143e4ae72a0bb4832b546eb76eb50e94049b80 src/common/genericBinaryFiles
3 2dce25b198558be573f56c1cf337aa95ddd666d6 src/common/lppserial
3 2b353bf8243cbfb3db44e196f33bd164c11c9949 src/common/lppserial
4 923afde9cc96bb419cf898560d080ec96991aeca src/common/qhexedit
4 923afde9cc96bb419cf898560d080ec96991aeca src/common/qhexedit
@@ -430,6 +430,23
430 <bitField name="DATA" size="32" mode="1" desc=""/>
430 <bitField name="DATA" size="32" mode="1" desc=""/>
431 </register>
431 </register>
432 </peripheral>
432 </peripheral>
433 <peripheral vid="1" name="SDCTRL" pid="9">
434 <register name="configuration" addOffset="0">
435 <bitField size="1" name="Refresh" offset="31" mode="3" desc="SDRAM refresh. If set, the SDRAM refresh will be enabled."/>
436 <bitField size="1" name="tRP" offset="30" mode="3" desc="SDRAM tRP timing. tRP will be equal to 2 or 3 system clocks (0/1). When mobile SDRAM support is enabled, this bit also represent the MSB in the tRFC timing."/>
437 <bitField name="tRFC" size="3" offset="27" mode="3" desc="SDRAM tRFC timing. tRFC will be equal to 3 + field-value system clocks. When mobile SDRAM support is enabled, this field is extended with the bit 30."/>
438 <bitField name="tCD" size="1" offset="26" mode="3" desc="SDRAM CAS delay. Selects 2 or 3 cycle CAS delay (0/1). When changed, a LOAD-COMMAND-REGISTER command must be issued at the same time. Also sets RAS/CAS delay (tRCD)."/>
439 <bitField name="SDRAM bank size" offset="23" size="3" mode="3" desc="SDRAM banks size. Defines the decoded memory size for each SDRAM chip select: “000”= 4 Mbyte, “001”= 8 Mbyte, “010”= 16 Mbyte .... “111”= 512 Mbyte."/>
440 <bitField name="SDRAM col. size" offset="21" size="2" mode="3" desc="SDRAM column size. “00”=256, “01”=512, “10”=1024, “11”=2048 except when bit[25:23]= ̆111 ̆then ̆11 ̆=4096"/>
441 <bitField name="SDRAM command" offset="18" size="3" mode="3" desc="SDRAM command. Writing a non-zero value will generate an SDRAM command: “010”=PRE-CHARGE, “100”=AUTO-REFRESH, “110”=LOAD-COMMAND-REGISTER, “111”=LOAD-EXTENDED-COMMAND-REGISTER. The field is reset after command has been executed."/>
442 <bitField name="Page-Burst" offset="17" size="1" mode="3" desc="1 = pageburst is used for read operations, 0 = line burst of length 8 is used for read operations. (Only available when VHDL generic pageburst i set to 2)"/>
443 <bitField name="MS" offset="16" size="1" mode="3" desc="Mobile SDR support enabled. ‘1’ = Enabled, ‘0’ = Disabled (read-only)"/>
444 <bitField name="D64" offset="15" size="1" mode="3" desc="64-bit data bus (D64) - Reads ‘1’ if memory controller is configured for 64-bit data bus, otherwise‘0’. Read-only."/>
445 <bitField name="SDRAM refresh load value" offset="0" size="15" mode="3" desc="The period between each AUTO-REFRESH command - Calculated as follows: tREFRESH = ((reload value) + 1) / SYSCLK"/>
446 </register>
447 <register name="Power-Saving configuration" addOffset="4">
448 </register>
449 </peripheral>
433 </soc>
450 </soc>
434
451
435
452
@@ -15,7 +15,6
15 PythonConsole::PythonConsole(socexplorerproxy *proxy, QWidget *parent) :
15 PythonConsole::PythonConsole(socexplorerproxy *proxy, QWidget *parent) :
16 QWidget(parent)
16 QWidget(parent)
17 {
17 {
18 //PythonQt::init();
19 PythonQt::init(PythonQt::RedirectStdOut);
18 PythonQt::init(PythonQt::RedirectStdOut);
20 PythonQt_QtAll::init();
19 PythonQt_QtAll::init();
21 this->proxy = proxy;
20 this->proxy = proxy;
@@ -25,7 +24,6
25 this->console = new PythonQtScriptingConsoleDandD(NULL, PythonQt::self()->getMainModule());
24 this->console = new PythonQtScriptingConsoleDandD(NULL, PythonQt::self()->getMainModule());
26 this->mainlayout->addWidget(this->console);
25 this->mainlayout->addWidget(this->console);
27 this->setWindowTitle(tr("Python Scripting Console"));
26 this->setWindowTitle(tr("Python Scripting Console"));
28 this->bussdriver = 0;
29 this->setAcceptDrops(true);
27 this->setAcceptDrops(true);
30 this->setLayout(this->mainlayout);
28 this->setLayout(this->mainlayout);
31 connect(this->console,SIGNAL(pyConsoleRunFiles(QStringList)),this,SLOT(pyConsoleRunFiles(QStringList)));
29 connect(this->console,SIGNAL(pyConsoleRunFiles(QStringList)),this,SLOT(pyConsoleRunFiles(QStringList)));
@@ -45,13 +43,6
45 this->mainContext->removeVariable(name);
43 this->mainContext->removeVariable(name);
46 }
44 }
47
45
48
49 void PythonConsole::setBussDriver(socexplorerplugin *driver)
50 {
51 this->bussdriver = driver;
52 this->mainContext->addObject("buss", this->bussdriver);
53 }
54
55 void PythonConsole::registerObject(QObject* object,const QString& instanceName)
46 void PythonConsole::registerObject(QObject* object,const QString& instanceName)
56 {
47 {
57 this->mainContext->addObject(instanceName,object);
48 this->mainContext->addObject(instanceName,object);
@@ -72,13 +63,6
72 this->mainContext->removeVariable(instanceName);
63 this->mainContext->removeVariable(instanceName);
73 }
64 }
74
65
75 void PythonConsole::removeBussDriver()
76 {
77 this->bussdriver = 0;
78 this->mainContext->removeVariable("buss");
79 emit this->rootDriverDelete();
80 }
81
82
66
83 void PythonConsole::pyConsoleRunFiles(const QStringList & pathList)
67 void PythonConsole::pyConsoleRunFiles(const QStringList & pathList)
84 {
68 {
@@ -49,8 +49,6
49 signals:
49 signals:
50 void rootDriverDelete();
50 void rootDriverDelete();
51 public slots:
51 public slots:
52 void setBussDriver(socexplorerplugin* driver);
53 void removeBussDriver();
54 void removeDriver(const QString& instanceName);
52 void removeDriver(const QString& instanceName);
55 void pyConsoleRunFiles(const QStringList&);
53 void pyConsoleRunFiles(const QStringList&);
56 void pyConsoleRunFile(const QString& fileName);
54 void pyConsoleRunFile(const QString& fileName);
@@ -63,11 +61,9
63
61
64 private:
62 private:
65 QHBoxLayout* mainlayout;
63 QHBoxLayout* mainlayout;
66 socexplorerplugin* bussdriver;
67 PythonQtScriptingConsoleDandD* console;
64 PythonQtScriptingConsoleDandD* console;
68 PythonQtObjectPtr* mainContext;
65 PythonQtObjectPtr* mainContext;
69 socexplorerproxy* proxy;
66 socexplorerproxy* proxy;
70 //LPMONMainWindow* mainwin;
71 };
67 };
72
68
73 #endif // PYTHONCONSOLE_H
69 #endif // PYTHONCONSOLE_H
@@ -67,7 +67,11
67 PeripheralWidget/src/registerwidget.h \
67 PeripheralWidget/src/registerwidget.h \
68 PeripheralWidget/src/socregsviewer.h \
68 PeripheralWidget/src/socregsviewer.h \
69 PeripheralWidget/src/socregsviewernew.h \
69 PeripheralWidget/src/socregsviewernew.h \
70 memtester/memtester.h
70 memtester/memtester.h \
71 engine/socexplorersettings.h \
72 engine/socexplorersettingsdialog.h \
73 engine/socexplorergui.h\
74 engine/socexplorerconfigkeys.h
71
75
72
76
73
77
@@ -125,7 +129,11
125 PySocExplorerEngine.h \
129 PySocExplorerEngine.h \
126 memtester/memtester.h\
130 memtester/memtester.h\
127 PeripheralWidget/src/socregsviewernew.h \
131 PeripheralWidget/src/socregsviewernew.h \
128 PeripheralWidget/src/collapsableperipheralwidget.h
132 PeripheralWidget/src/collapsableperipheralwidget.h \
133 engine/socexplorersettings.h \
134 engine/socexplorersettingsdialog.h \
135 engine/socexplorergui.h \
136 engine/socexplorerconfigkeys.h
129
137
130
138
131
139
@@ -155,7 +163,10
155 plugins/socexplorerplugin.cpp \
163 plugins/socexplorerplugin.cpp \
156 memtester/memtester.cpp \
164 memtester/memtester.cpp \
157 PeripheralWidget/src/socregsviewernew.cpp \
165 PeripheralWidget/src/socregsviewernew.cpp \
158 PeripheralWidget/src/collapsableperipheralwidget.cpp
166 PeripheralWidget/src/collapsableperipheralwidget.cpp \
167 engine/socexplorersettings.cpp \
168 engine/socexplorersettingsdialog.cpp \
169 engine/socexplorergui.cpp
159
170
160
171
161 OTHER_FILES += \
172 OTHER_FILES += \
@@ -167,7 +178,8
167
178
168 FORMS += \
179 FORMS += \
169 PeripheralWidget/src/socregsviewernew.ui \
180 PeripheralWidget/src/socregsviewernew.ui \
170 PeripheralWidget/src/collapsableperipheralwidget.ui
181 PeripheralWidget/src/collapsableperipheralwidget.ui \
182 engine/socexplorersettingsdialog.ui
171
183
172
184
173 RESOURCES += \
185 RESOURCES += \
@@ -21,13 +21,18
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "socexplorerengine.h"
22 #include "socexplorerengine.h"
23 #include <proxy/socexplorerproxy.h>
23 #include <proxy/socexplorerproxy.h>
24 #include <socexplorersettings.h>
25 #include <socexplorercoresettingsgui.h>
26 #include <socexplorerconfigkeys.h>
24
27
25 SocExplorerEngine* SocExplorerEngine::_self = NULL;
28 SocExplorerEngine* SocExplorerEngine::_self = NULL;
26 socExplorerXmlModel* SocExplorerEngine::p_xmlmodel=NULL;
29 socExplorerXmlModel* SocExplorerEngine::p_xmlmodel=NULL;
27 QMainWindow* SocExplorerEngine::mainWindow=NULL;
30 QMainWindow* SocExplorerEngine::mainWindow=NULL;
28 QList<SOCModel*>* SocExplorerEngine::SOCs=NULL;
31 QList<SOCModel*>* SocExplorerEngine::SOCs=NULL;
32 QSettings* SocExplorerEngine::m_settings=NULL;
29 int SocExplorerEngine::loglvl=1;
33 int SocExplorerEngine::loglvl=1;
30
34
35
31 SocExplorerEngine::SocExplorerEngine(QObject *parent) :
36 SocExplorerEngine::SocExplorerEngine(QObject *parent) :
32 QObject(parent)
37 QObject(parent)
33 {
38 {
@@ -35,7 +40,9
35 {
40 {
36 SOCs = new QList<SOCModel*>;
41 SOCs = new QList<SOCModel*>;
37 }
42 }
38
43 m_settings = new QSettings();
44 SocExplorerCoreSettingsGUI* cfggui=new SocExplorerCoreSettingsGUI();
45 SocExplorerSettings::registerConfigEntry(cfggui,QIcon(":/images/config.svg"),"SocExplorer Core");
39 }
46 }
40
47
41
48
@@ -88,6 +95,14
88 }
95 }
89 }
96 }
90 }
97 }
98 QStringList localCfg = SocExplorerSettings::value(SOCEXPLORERENGINE_SETTINGS_SCOPE,SOCEXPLORERENGINE_SETTINGS_PLUGINS_LOOKUP_PATH).toString().split(";");
99 QString dir;
100 foreach (dir, localCfg)
101 {
102 QDir plugDir(dir);
103 if(plugDir.exists())
104 folders.append(dir);
105 }
91 return folders;
106 return folders;
92 }
107 }
93
108
@@ -274,13 +289,29
274 delete soc;
289 delete soc;
275 }
290 }
276
291
292
277 void SocExplorerEngine::message(socexplorerplugin *sender, const QString &message, int debugLevel)
293 void SocExplorerEngine::message(socexplorerplugin *sender, const QString &message, int debugLevel)
278 {
294 {
295 if(!_self)
296 init();
297 SocExplorerEngine::message(sender->instanceName(),message,debugLevel);
298 }
299
300 void SocExplorerEngine::message(QObject *sender, const QString &message, int debugLevel)
301 {
302 if(!_self)
303 init();
304 SocExplorerEngine::message(sender->objectName(),message,debugLevel);
305 }
306
307 void SocExplorerEngine::message(const QString &sender, const QString &message, int debugLevel)
308 {
279 // TODO add multi output message manager IE also log in files
309 // TODO add multi output message manager IE also log in files
310 static QTextStream SocExplorerEngineStdout(stdout);
280 if(!_self)
311 if(!_self)
281 init();
312 init();
282 if(loglvl>=debugLevel)
313 if(loglvl>=debugLevel)
283 qDebug()<< QTime::currentTime().toString()+" " + sender->instanceName()+":"+message;
314 SocExplorerEngineStdout << QTime::currentTime().toString()+" " + sender+":"+message << endl;
284 }
315 }
285
316
286 void SocExplorerEngine::setLogLevel(int level)
317 void SocExplorerEngine::setLogLevel(int level)
@@ -42,6 +42,7
42 #include <registerwidget.h>
42 #include <registerwidget.h>
43 #include <socmodel.h>
43 #include <socmodel.h>
44 #include <memtester.h>
44 #include <memtester.h>
45 #include <QSettings>
45
46
46 #if defined(SOCEXPLORER_SDK_BUILD)
47 #if defined(SOCEXPLORER_SDK_BUILD)
47 # define SOCEXPLORER_SDK_EXPORT Q_DECL_EXPORT
48 # define SOCEXPLORER_SDK_EXPORT Q_DECL_EXPORT
@@ -83,6 +84,7
83 Q_OBJECT
84 Q_OBJECT
84 private:
85 private:
85 static SocExplorerEngine* _self;
86 static SocExplorerEngine* _self;
87 static QSettings* m_settings;
86 SocExplorerEngine(QObject *parent = 0);
88 SocExplorerEngine(QObject *parent = 0);
87 static void init();
89 static void init();
88
90
@@ -107,6 +109,8
107 static void addSOC(socexplorerplugin* rootPlugin);
109 static void addSOC(socexplorerplugin* rootPlugin);
108 static void removeSOC(socexplorerplugin* rootPlugin);
110 static void removeSOC(socexplorerplugin* rootPlugin);
109 static void message(socexplorerplugin* sender,const QString& message,int debugLevel=0);
111 static void message(socexplorerplugin* sender,const QString& message,int debugLevel=0);
112 static void message(QObject* sender,const QString& message,int debugLevel=0);
113 static void message(const QString& sender,const QString& message,int debugLevel=0);
110 static void setLogLevel(int level);
114 static void setLogLevel(int level);
111 static bool isSocLitleEndian(socexplorerplugin* plugin);
115 static bool isSocLitleEndian(socexplorerplugin* plugin);
112 signals:
116 signals:
@@ -97,47 +97,3
97
97
98
98
99
99
100 void pluginmanagerWDGT::addPlugin()
101 {
102 // /!\ TODO update it remove maximum operation from widget
103 // QString fileName = QFileDialog::getOpenFileName(this,tr("Open Plugin"), QDir::homePath(), tr("Plugin Files Files (*.dll *.so *.so.*)"));
104 // if(pluginloader::checklibrary(fileName))
105 // {
106 // QFile::copy(fileName,QString(SocExplorerEngine::pluginFolder())+"/"+ fileName.section('/',-1));
107 // }
108 // this->pluginTable->refreshPluginList();
109 }
110
111
112 void pluginmanagerWDGT::removePlugin()
113 {
114 // for(int i=0;i<this->pluginTable->selectedItems().count();i++)
115 // {
116 // QListWidgetItem* item = this->pluginTable->selectedItems().at(i);
117 // if(item!=NULL)
118 // {
119 // QFile::remove(QString(SocExplorerEngine::pluginFolder())+"/"+item->text());
120 // }
121 // }
122 // this->pluginTable->refreshPluginList();
123 }
124
125
126
127 void pluginmanagerWDGT::loadplugin()
128 {
129 // for(int i=0;i<this->pluginTable->selectedItems().count();i++)
130 // {
131 // QListWidgetItem* item = this->pluginTable->selectedItems().at(i);
132 // if(item!=NULL)
133 // {
134 // QString plugin = QString(SocExplorerEngine::pluginFolder())+"/"+item->text();
135 // emit this->loadSysDrviver(plugin);
136 // }
137 // }
138 // this->pluginTable->refreshPluginList();
139 }
140
141
142
143
@@ -66,11 +66,7
66 void pluginselected(const QString& instanceName);
66 void pluginselected(const QString& instanceName);
67
67
68 public slots:
68 public slots:
69 //void libselected(int row);
69
70 void addPlugin();
71 void removePlugin();
72 void loadplugin();
73 //void loadplugin(QListWidgetItem*);
74
70
75 private:
71 private:
76
72
@@ -13,6 +13,8
13 #ifdef SOCEXPLORER_CUSTOM_PLUGIN_LOADER
13 #ifdef SOCEXPLORER_CUSTOM_PLUGIN_LOADER
14 #include "unix/unixpluginloader.h"
14 #include "unix/unixpluginloader.h"
15 #endif
15 #endif
16 #include <socexplorerengine.h>
17 #include <socexplorersettings.h>
16
18
17 pluginloader* pluginloader::_self = NULL;
19 pluginloader* pluginloader::_self = NULL;
18 PluginsCache* pluginloader::_cache = NULL;
20 PluginsCache* pluginloader::_cache = NULL;
@@ -27,38 +29,6
27 scanFolders();
29 scanFolders();
28 }
30 }
29
31
30
31 QStringList pluginloader::readFoldersList(const QStringList confFiles)
32 {
33 QDir testDir;
34 QStringList folders;
35 QFile confFile;
36 for(int i=0;i<confFiles.count();i++)
37 {
38 confFile.setFileName(confFiles.at(i));
39 if(confFile.exists())
40 {
41 if (confFile.open(QIODevice::ReadOnly | QIODevice::Text))
42 {
43 QTextStream in(&confFile);
44 QString line = in.readLine();
45 while (!line.isNull())
46 {
47 testDir.setPath(line);
48 if(testDir.exists())
49 {
50 if(!folders.contains(line))
51 folders << line;
52 }
53 line = in.readLine();
54 }
55 }
56 }
57 }
58 return folders;
59 }
60
61
62 void pluginloader::scanFolders()
32 void pluginloader::scanFolders()
63 {
33 {
64 QDir dir;
34 QDir dir;
@@ -74,6 +44,7
74 for (int i = 0; i < list.size(); ++i)
44 for (int i = 0; i < list.size(); ++i)
75 {
45 {
76 QFileInfo fileInfo = list.at(i);
46 QFileInfo fileInfo = list.at(i);
47 SocExplorerEngine::message("pluginloader::scanFolders","Checking "+ fileInfo.filePath(),3);
77 if(checklibrary(fileInfo.filePath())!=0)
48 if(checklibrary(fileInfo.filePath())!=0)
78 {
49 {
79 _cache->append(fileInfo.fileName(),fileInfo.path(),_getlibName(fileInfo.filePath()),_getlibPID(fileInfo.filePath()),_getlibPID(fileInfo.filePath()));
50 _cache->append(fileInfo.fileName(),fileInfo.path(),_getlibName(fileInfo.filePath()),_getlibPID(fileInfo.filePath()),_getlibPID(fileInfo.filePath()));
@@ -90,7 +61,7
90 lib->load();
61 lib->load();
91 if(!lib->isLoaded())
62 if(!lib->isLoaded())
92 {
63 {
93 qDebug()<<lib->errorString();
64 SocExplorerEngine::message("pluginloader::p_checklibraryQlib",lib->errorString(),3);
94 lib->~QLibrary();
65 lib->~QLibrary();
95 lib = new QLibrary(fileName);
66 lib = new QLibrary(fileName);
96 lib->load();
67 lib->load();
@@ -81,7 +81,6
81 int p_checklibraryCustom(const QString fileName);
81 int p_checklibraryCustom(const QString fileName);
82 socexplorerplugin* p_newsocexplorerpluginQlib(const QString Name);
82 socexplorerplugin* p_newsocexplorerpluginQlib(const QString Name);
83 socexplorerplugin* p_newsocexplorerpluginCustom(const QString Name);
83 socexplorerplugin* p_newsocexplorerpluginCustom(const QString Name);
84 static QStringList readFoldersList(const QStringList confFiles);
85 static QString* _cacheLookup(const QString Name);
84 static QString* _cacheLookup(const QString Name);
86 static QString _getlibName(const QString fileName);
85 static QString _getlibName(const QString fileName);
87 static int _getlibPID(const QString fileName);
86 static int _getlibPID(const QString fileName);
@@ -1,5 +1,6
1 #include "pluginscache.h"
1 #include "pluginscache.h"
2 #include <QDebug>
2 #include <QDebug>
3 #include <socexplorerengine.h>
3
4
4 PluginsCacheItem::PluginsCacheItem(const QString &fileName, const QString &path, const QString &pluginName, int VID, int PID)
5 PluginsCacheItem::PluginsCacheItem(const QString &fileName, const QString &path, const QString &pluginName, int VID, int PID)
5 {
6 {
@@ -56,12 +57,12
56 {
57 {
57 if(this->items->at(i)->compare(item))
58 if(this->items->at(i)->compare(item))
58 {
59 {
59 qDebug()<< fileName << "already in the cache";
60 SocExplorerEngine::message("PluginsCache",fileName + " already in the cache",3);
60 delete item;
61 delete item;
61 return;
62 return;
62 }
63 }
63 }
64 }
64 qDebug()<< fileName << "added to cache";
65 SocExplorerEngine::message("PluginsCache",fileName + " added to cache",3);
65 this->items->append(item);
66 this->items->append(item);
66 }
67 }
67
68
@@ -1,15 +1,16
1 #include "unixpluginloader.h"
1 #include "unixpluginloader.h"
2 #include <stdio.h>
2 #include <stdio.h>
3 #include <QDebug>
3 #include <QDebug>
4 #include <socexplorerengine.h>
4
5
5 unixPluginLoader::unixPluginLoader(const QString &libPath)
6 unixPluginLoader::unixPluginLoader(const QString &libPath)
6 {
7 {
7 qDebug()<<"try to open "+libPath;
8 SocExplorerEngine::message("unixPluginLoader::unixPluginLoader","try to open "+libPath,3);
8 dlHandle = dlopen(libPath.toStdString().c_str(),RTLD_LAZY|RTLD_GLOBAL);
9 dlHandle = dlopen(libPath.toStdString().c_str(),RTLD_LAZY|RTLD_GLOBAL);
9 if(dlHandle==NULL)
10 if(dlHandle==NULL)
10 qDebug() << "Failed"<< dlerror();
11 SocExplorerEngine::message("unixPluginLoader::unixPluginLoader",QString("Failed ") + dlerror(),3);
11 else
12 else
12 qDebug() << "Success";
13 SocExplorerEngine::message("unixPluginLoader::unixPluginLoader","Success " ,3);
13 this->libPath = libPath;
14 this->libPath = libPath;
14 }
15 }
15
16
@@ -17,12 +18,12
17 {
18 {
18 if(dlHandle!=NULL)
19 if(dlHandle!=NULL)
19 {
20 {
20 qDebug()<<"try to resolve "+symbol+" in "+libPath;
21 SocExplorerEngine::message("unixPluginLoader::resolve","try to resolve "+symbol+" in "+libPath ,3);
21 void* sym = dlsym (dlHandle, symbol.toStdString().c_str());
22 void* sym = dlsym (dlHandle, symbol.toStdString().c_str());
22 if(sym==NULL)
23 if(sym==NULL)
23 qDebug() << "Failed"<< dlerror();
24 SocExplorerEngine::message("unixPluginLoader::resolve",QString("Failed")+ dlerror() ,3);
24 else
25 else
25 qDebug() << "Success";
26 SocExplorerEngine::message("unixPluginLoader::resolve","Success",3);
26 return sym;
27 return sym;
27 }
28 }
28 return NULL;
29 return NULL;
@@ -33,6 +34,6
33 if(dlHandle!=NULL)
34 if(dlHandle!=NULL)
34 {
35 {
35 dlclose(dlHandle);
36 dlclose(dlHandle);
36 qDebug() << dlerror();
37 SocExplorerEngine::message("unixPluginLoader::close",dlerror(),3);
37 }
38 }
38 }
39 }
@@ -108,6 +108,7
108 if(this->menu)
108 if(this->menu)
109 this->menu->setTitle(this->_instanceName);
109 this->menu->setTitle(this->_instanceName);
110 this->setWindowTitle(newName);
110 this->setWindowTitle(newName);
111 this->setObjectName(newName);
111 }
112 }
112
113
113 bool socexplorerplugin::dumpMemory(unsigned int address, unsigned int count, QString file)
114 bool socexplorerplugin::dumpMemory(unsigned int address, unsigned int count, QString file)
@@ -261,4 +262,3
261 return false;
262 return false;
262 }
263 }
263
264
264
@@ -85,6 +85,7
85 //! Default plugin constructor, any plugin should call this constructor.
85 //! Default plugin constructor, any plugin should call this constructor.
86 socexplorerplugin(QWidget *parent = 0,bool createPyObject=true):QDockWidget(parent)
86 socexplorerplugin(QWidget *parent = 0,bool createPyObject=true):QDockWidget(parent)
87 {
87 {
88 Q_UNUSED(createPyObject)
88 closeAction=NULL;
89 closeAction=NULL;
89 menu=NULL;
90 menu=NULL;
90 ChildsMenu=NULL;
91 ChildsMenu=NULL;
@@ -156,10 +157,10
156 virtual void setInstanceName(const QString& newName);
157 virtual void setInstanceName(const QString& newName);
157
158
158 virtual bool dumpMemory(unsigned int address,unsigned int count,QString file);
159 virtual bool dumpMemory(unsigned int address,unsigned int count,QString file);
160 virtual bool dumpMemory(unsigned int address,unsigned int count,QString file,const QString& format);
159 virtual bool memSet(unsigned int address,int value, unsigned int count);
161 virtual bool memSet(unsigned int address,int value, unsigned int count);
160 virtual bool loadbin(unsigned int address,QString file);
162 virtual bool loadbin(unsigned int address,QString file);
161 virtual bool loadfile(abstractBinFile* file);
163 virtual bool loadfile(abstractBinFile* file);
162 virtual bool dumpMemory(unsigned int address,unsigned int count,QString file,const QString& format);
163 QVariantList Read(unsigned int address, unsigned int count);
164 QVariantList Read(unsigned int address, unsigned int count);
164 void Write(unsigned int address, QList<QVariant> dataList);
165 void Write(unsigned int address, QList<QVariant> dataList);
165 socexplorerplugin* parentPlugin(){return this->parent;}
166 socexplorerplugin* parentPlugin(){return this->parent;}
@@ -32,6 +32,7
32 socexplorerplugin* socexplorerproxy::root=NULL;
32 socexplorerplugin* socexplorerproxy::root=NULL;
33 socexplorerplugin* socexplorerproxy::parent=NULL;
33 socexplorerplugin* socexplorerproxy::parent=NULL;
34 PluginsCache* socexplorerproxy::cache=NULL;
34 PluginsCache* socexplorerproxy::cache=NULL;
35 QStringList* socexplorerproxy::linearDriverPathList=NULL;
35
36
36 socexplorerproxy::socexplorerproxy(QObject *parent) :
37 socexplorerproxy::socexplorerproxy(QObject *parent) :
37 QObject(parent)
38 QObject(parent)
@@ -39,6 +40,7
39 cache = new PluginsCache;
40 cache = new PluginsCache;
40 drivers = new QList<socexplorerplugin*>;
41 drivers = new QList<socexplorerplugin*>;
41 linearDriverList=new QList<socexplorerplugin*>;
42 linearDriverList=new QList<socexplorerplugin*>;
43 linearDriverPathList=new QStringList;
42 root = NULL;
44 root = NULL;
43 }
45 }
44
46
@@ -50,6 +52,7
50 cache = new PluginsCache;
52 cache = new PluginsCache;
51 drivers = new QList<socexplorerplugin*>;
53 drivers = new QList<socexplorerplugin*>;
52 linearDriverList=new QList<socexplorerplugin*>;
54 linearDriverList=new QList<socexplorerplugin*>;
55 linearDriverPathList=new QStringList;
53 root = NULL;
56 root = NULL;
54 }
57 }
55
58
@@ -77,7 +80,7
77 {
80 {
78 socexplorerplugin* driver = pluginloader::newsocexplorerplugin(name);
81 socexplorerplugin* driver = pluginloader::newsocexplorerplugin(name);
79 QString driverName = _self->getinstanceName(driver->baseName());
82 QString driverName = _self->getinstanceName(driver->baseName());
80 loadSysDriver(driver,driverName);
83 loadSysDriver(driver,driverName,name);
81 }
84 }
82 }
85 }
83
86
@@ -87,18 +90,22
87 if(pluginloader::libcanberoot(name) && !_self->instanceExists(instanceName))
90 if(pluginloader::libcanberoot(name) && !_self->instanceExists(instanceName))
88 {
91 {
89 socexplorerplugin* driver = pluginloader::newsocexplorerplugin(name);
92 socexplorerplugin* driver = pluginloader::newsocexplorerplugin(name);
90 loadSysDriver(driver,instanceName);
93 loadSysDriver(driver,instanceName,name);
91 }
94 }
92 }
95 }
93
96
94
97
95 void socexplorerproxy::loadSysDriver(socexplorerplugin *driver, const QString instanceName)
98 void socexplorerproxy::loadSysDriver(socexplorerplugin *driver, const QString instanceName, const QString path)
96 {
99 {
97 if(!_self)init();
100 if(!_self)init();
98 driver->setInstanceName(instanceName);
101 driver->setInstanceName(instanceName);
99 driver->parent = NULL;
102 driver->parent = NULL;
100 drivers->append(driver);
103 drivers->append(driver);
101 linearDriverList->append(driver);
104 linearDriverList->append(driver);
105 if(path.isEmpty())
106 linearDriverPathList->append(driver->baseName());
107 else
108 linearDriverPathList->append(path);
102 connectChildToProxy(driver);
109 connectChildToProxy(driver);
103 emit _self->addPluginGUI(driver);
110 emit _self->addPluginGUI(driver);
104 emit _self->clearMenu();
111 emit _self->clearMenu();
@@ -117,7 +124,7
117 bool ok=true;
124 bool ok=true;
118 if(ok)
125 if(ok)
119 {
126 {
120 if(parent!=NULL)_self->loadSysDriverToParent(driver,parent,driverName);
127 if(parent!=NULL)_self->loadSysDriverToParent(driver,parent,driverName,child);
121 }
128 }
122 }
129 }
123 }
130 }
@@ -133,7 +140,7
133 if(ok)
140 if(ok)
134 {
141 {
135 socexplorerplugin* parent=_self->getSysDriver(ParentInst);
142 socexplorerplugin* parent=_self->getSysDriver(ParentInst);
136 if(parent!=NULL)loadSysDriverToParent(driver,parent,driverName);
143 if(parent!=NULL)loadSysDriverToParent(driver,parent,driverName,name);
137 }
144 }
138 }
145 }
139 }
146 }
@@ -149,15 +156,19
149 if(ok)
156 if(ok)
150 {
157 {
151 socexplorerplugin* parent=_self->getSysDriver(ParentInst);
158 socexplorerplugin* parent=_self->getSysDriver(ParentInst);
152 if(parent!=NULL)loadSysDriverToParent(driver,parent,instanceName);
159 if(parent!=NULL)loadSysDriverToParent(driver,parent,instanceName,name);
153 }
160 }
154 }
161 }
155 }
162 }
156
163
157 void socexplorerproxy::loadSysDriverToParent(socexplorerplugin *driver,socexplorerplugin *parent, const QString instanceName)
164 void socexplorerproxy::loadSysDriverToParent(socexplorerplugin *driver,socexplorerplugin *parent, const QString instanceName,const QString path)
158 {
165 {
159 if(!_self)init();
166 if(!_self)init();
160 linearDriverList->append(driver);
167 linearDriverList->append(driver);
168 if(path.isEmpty())
169 linearDriverPathList->append(driver->baseName());
170 else
171 linearDriverPathList->append(path);
161 driver->parent = parent;
172 driver->parent = parent;
162 driver->setInstanceName(instanceName);
173 driver->setInstanceName(instanceName);
163 parent->childs.append(driver);
174 parent->childs.append(driver);
@@ -264,6 +275,57
264 return NULL;
275 return NULL;
265 }
276 }
266
277
278 QStringList socexplorerproxy::getPluginsList()
279 {
280 if(!_self)init();
281 QStringList result;
282 socexplorerplugin* plugin;
283 for(int i=0; i<linearDriverList->count();i++)
284 {
285 QString parent="";
286 plugin=linearDriverList->at(i);
287 if(plugin->parent)parent=plugin->parent->instanceName();
288 result.append(linearDriverList->at(i)->instanceName()+":"+parent+":"+linearDriverPathList->at(i));
289 }
290 return result;
291 }
292
293 bool socexplorerproxy::loadPluginsList(QStringList plugins)