@@ -0,0 +1,10 | |||||
|
1 | class SocExplorerRegister: | |||
|
2 | plugin=0 | |||
|
3 | address=0 | |||
|
4 | def __init__(self, plugin,address): | |||
|
5 | self.plugin = plugin | |||
|
6 | self.address = address | |||
|
7 | def value(self): | |||
|
8 | return self.plugin.Read(self.address,1)[0] | |||
|
9 | def set(self, value): | |||
|
10 | return self.plugin.Write(self.address,[value]) |
@@ -0,0 +1,27 | |||||
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |||
|
2 | <!-- Copyright 2014 Alexis Jeandet <alexis.jeandet@member.fsf.org> --> | |||
|
3 | <application> | |||
|
4 | <id type="desktop">SocExplorer.desktop</id> | |||
|
5 | <metadata_license>CC0-1.0</metadata_license> | |||
|
6 | <project_license>GPL-2.0</project_license> | |||
|
7 | <name>SocExplorer</name> | |||
|
8 | <summary>SocExplorer is an open source generic System On Chip testing software/framework.</summary> | |||
|
9 | <description> | |||
|
10 | <p> | |||
|
11 | SocExplorer is an open source generic System On Chip testing software/framework. | |||
|
12 | We write this software for the development and the validation of our instrument, | |||
|
13 | the Low Frequency Receiver(LFR) for the Solar Orbiter mission. This instrument is | |||
|
14 | based on an actel FPGA hosting a LEON3FT processor and some peripherals. To | |||
|
15 | make it more collaborative, we use a plugin based system, the main executable is | |||
|
16 | SocExplorer then all the functionality are provided by plugins. Like this | |||
|
17 | everybody can provide his set of plugins to handle a new SOC or just a new | |||
|
18 | peripheral. SocExplorer uses PythonQt to allow user to automate some tasks such | |||
|
19 | as loading some plugins, configuring them and talking with his device. | |||
|
20 | </p> | |||
|
21 | </description> | |||
|
22 | <screenshots> | |||
|
23 | <screenshot type="default" width="800" height="600">https://hephaistos.lpp.polytechnique.fr/redmine/attachments/download/384/SocExplorer_ScreenShot1.png</screenshot> | |||
|
24 | </screenshots> | |||
|
25 | <url type="homepage">http://www.gnome.org/projects/en_US/gnome-power-manager</url> | |||
|
26 | <updatecontact>alexis.jeandet@member.fsf.org</updatecontact> | |||
|
27 | </application> |
@@ -1,89 +1,91 | |||||
1 | #------------------------------------------------- |
|
1 | #------------------------------------------------- | |
2 | # |
|
2 | # | |
3 | # Project created by QtCreator 2011-09-19T22:52:10 |
|
3 | # Project created by QtCreator 2011-09-19T22:52:10 | |
4 | # |
|
4 | # | |
5 | #------------------------------------------------- |
|
5 | #------------------------------------------------- | |
6 |
|
6 | |||
7 | TEMPLATE = subdirs |
|
7 | TEMPLATE = subdirs | |
8 | CONFIG += ordered release |
|
8 | CONFIG += ordered release | |
9 |
|
9 | |||
10 | SUBDIRS = \ |
|
10 | SUBDIRS = \ | |
11 | src/common \ |
|
11 | src/common \ | |
12 | src/SocExplorerEngine \ |
|
12 | src/SocExplorerEngine \ | |
13 | src \ |
|
13 | src \ | |
14 | src/SocExplorer_TCP_Terminal |
|
14 | src/SocExplorer_TCP_Terminal | |
15 |
|
15 | |||
16 |
|
16 | |||
17 | socexplorercfg.path = $$[QT_INSTALL_PREFIX]/mkspecs/features |
|
17 | socexplorercfg.path = $$[QT_INSTALL_PREFIX]/mkspecs/features | |
18 | socexplorercfg.files = \ |
|
18 | socexplorercfg.files = \ | |
19 | src/SocExplorerEngine/plugins/socexplorerplugin.prf |
|
19 | src/SocExplorerEngine/plugins/socexplorerplugin.prf | |
20 |
|
20 | |||
21 |
|
21 | |||
22 | unix{ |
|
22 | unix{ | |
23 | SocExplorer.path = /usr/share/applications/ |
|
23 | SocExplorerLauncher.path = /usr/share/applications/ | |
24 | SocExplorer.files = unixcfg/SocExplorer.desktop |
|
24 | SocExplorerLauncher.files = unixcfg/SocExplorer.desktop | |
|
25 | SocExplorerAppData.path = /usr/share/appdata/ | |||
|
26 | SocExplorerAppData.files = unixcfg/SocExplorer.appdata.xml | |||
25 | PluginConfPath.path = /etc/SocExplorer/plugin.conf.d/ |
|
27 | PluginConfPath.path = /etc/SocExplorer/plugin.conf.d/ | |
26 | PluginConfPath.files = unixcfg/plugins.conf |
|
28 | PluginConfPath.files = unixcfg/plugins.conf | |
27 | share.path = /usr/share/SocExplorer |
|
29 | share.path = /usr/share/SocExplorer | |
28 | share.files = ressources/images/Indiana_Jones_cappello.png \ |
|
30 | share.files = ressources/images/Indiana_Jones_cappello.png \ | |
29 | ressources/Grlib.xml |
|
31 | ressources/Grlib.xml | |
30 | Wizard.path = /usr/share/qtcreator/templates/wizards/SocExplorerPlugin |
|
32 | Wizard.path = /usr/share/qtcreator/templates/wizards/SocExplorerPlugin | |
31 | Wizard.files = Qt_Creator_Wizard/SocExplorerPlugin/logo-lpp-cutted.png \ |
|
33 | Wizard.files = Qt_Creator_Wizard/SocExplorerPlugin/logo-lpp-cutted.png \ | |
32 | Qt_Creator_Wizard/SocExplorerPlugin/plugin.cpp \ |
|
34 | Qt_Creator_Wizard/SocExplorerPlugin/plugin.cpp \ | |
33 | Qt_Creator_Wizard/SocExplorerPlugin/plugin.h \ |
|
35 | Qt_Creator_Wizard/SocExplorerPlugin/plugin.h \ | |
34 | Qt_Creator_Wizard/SocExplorerPlugin/project.pro \ |
|
36 | Qt_Creator_Wizard/SocExplorerPlugin/project.pro \ | |
35 | Qt_Creator_Wizard/SocExplorerPlugin/wizard.xml |
|
37 | Qt_Creator_Wizard/SocExplorerPlugin/wizard.xml | |
36 | INSTALLS+=Wizard SocExplorer share PluginConfPath |
|
38 | INSTALLS+=Wizard SocExplorerLauncher share PluginConfPath SocExplorerAppData | |
37 | } |
|
39 | } | |
38 | INSTALLS+=socexplorercfg |
|
40 | INSTALLS+=socexplorercfg | |
39 |
|
41 | |||
40 |
|
42 | |||
41 |
|
43 | |||
42 |
|
44 | |||
43 |
|
45 | |||
44 |
|
46 | |||
45 |
|
47 | |||
46 |
|
48 | |||
47 |
|
49 | |||
48 |
|
50 | |||
49 |
|
51 | |||
50 |
|
52 | |||
51 |
|
53 | |||
52 |
|
54 | |||
53 |
|
55 | |||
54 |
|
56 | |||
55 |
|
57 | |||
56 |
|
58 | |||
57 |
|
59 | |||
58 |
|
60 | |||
59 |
|
61 | |||
60 |
|
62 | |||
61 |
|
63 | |||
62 |
|
64 | |||
63 |
|
65 | |||
64 |
|
66 | |||
65 |
|
67 | |||
66 |
|
68 | |||
67 |
|
69 | |||
68 |
|
70 | |||
69 |
|
71 | |||
70 |
|
72 | |||
71 |
|
73 | |||
72 |
|
74 | |||
73 |
|
75 | |||
74 |
|
76 | |||
75 |
|
77 | |||
76 |
|
78 | |||
77 |
|
79 | |||
78 |
|
80 | |||
79 |
|
81 | |||
80 |
|
82 | |||
81 |
|
83 | |||
82 |
|
84 | |||
83 |
|
85 | |||
84 |
|
86 | |||
85 |
|
87 | |||
86 |
|
88 | |||
87 |
|
89 | |||
88 |
|
90 | |||
89 |
|
91 |
@@ -1,107 +1,82 | |||||
1 | /*------------------------------------------------------------------------------ |
|
1 | /*------------------------------------------------------------------------------ | |
2 | -- This file is a part of the SocExplorer Software |
|
2 | -- This file is a part of the SocExplorer Software | |
3 | -- Copyright (C) 2013, Plasma Physics Laboratory - CNRS |
|
3 | -- Copyright (C) 2013, Plasma Physics Laboratory - CNRS | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 2 of the License, or |
|
7 | -- the Free Software Foundation; either version 2 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | -------------------------------------------------------------------------------*/ |
|
18 | -------------------------------------------------------------------------------*/ | |
19 | /*-- Author : Alexis Jeandet |
|
19 | /*-- Author : Alexis Jeandet | |
20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr |
|
20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr | |
21 | ----------------------------------------------------------------------------*/ |
|
21 | ----------------------------------------------------------------------------*/ | |
22 | #ifndef REGISTERDATA_H |
|
22 | #ifndef REGISTERDATA_H | |
23 | #define REGISTERDATA_H |
|
23 | #define REGISTERDATA_H | |
24 | #include <QString> |
|
24 | #include <QString> | |
25 | #include <QList> |
|
25 | #include <QList> | |
26 | #include <QObject> |
|
26 | #include <QObject> | |
27 |
|
27 | |||
28 | //class ucBitfield: public QObject |
|
|||
29 | //{ |
|
|||
30 | // Q_OBJECT |
|
|||
31 | //public: |
|
|||
32 | // explicit ucBitfield(QObject* parent =0); |
|
|||
33 | // explicit ucBitfield(const QString& name,int offset,const QString& description,QObject* parent =0); |
|
|||
34 | // QString name(); |
|
|||
35 | // int offset(); |
|
|||
36 | // QString description(); |
|
|||
37 | //public slots: |
|
|||
38 | // void setName(const QString& name); |
|
|||
39 | // void setOffset(int offset); |
|
|||
40 | // void setDescription(const QString& description); |
|
|||
41 |
|
||||
42 | //signals: |
|
|||
43 | // void nameChanged(const QString& name); |
|
|||
44 | // void offsetChanged(int offset); |
|
|||
45 | // void descriptionChanged(const QString& description); |
|
|||
46 | //private: |
|
|||
47 |
|
||||
48 | // QString p_name; |
|
|||
49 | // int p_offset; |
|
|||
50 | // QString p_description; |
|
|||
51 | //}; |
|
|||
52 |
|
||||
53 | class ucRegister :public QObject |
|
28 | class ucRegister :public QObject | |
54 | { |
|
29 | { | |
55 | Q_OBJECT |
|
30 | Q_OBJECT | |
56 | public: |
|
31 | public: | |
57 | ucRegister(QObject* parent=0); |
|
32 | ucRegister(QObject* parent=0); | |
58 | quint32 value(); |
|
33 | quint32 value(); | |
59 | public slots: |
|
34 | public slots: | |
60 | void setName(const QString& name); |
|
35 | void setName(const QString& name); | |
61 | void setValue(quint32 value); |
|
36 | void setValue(quint32 value); | |
62 | void setOffset(qint64 offset); |
|
37 | void setOffset(qint64 offset); | |
63 | signals: |
|
38 | signals: | |
64 | void nameChanged(const QString& name); |
|
39 | void nameChanged(const QString& name); | |
65 | void offsetChanged(qint64 offset); |
|
40 | void offsetChanged(qint64 offset); | |
66 | void valueChanged(quint32 value); |
|
41 | void valueChanged(quint32 value); | |
67 | private: |
|
42 | private: | |
68 | QString p_name; |
|
43 | QString p_name; | |
69 | qint64 p_addressOffset; |
|
44 | qint64 p_addressOffset; | |
70 | quint32 p_value; |
|
45 | quint32 p_value; | |
71 | }; |
|
46 | }; | |
72 |
|
47 | |||
73 | class ucPeripheral: public QObject,public QList<ucRegister*> |
|
48 | class ucPeripheral: public QObject,public QList<ucRegister*> | |
74 | { |
|
49 | { | |
75 | Q_OBJECT |
|
50 | Q_OBJECT | |
76 | public: |
|
51 | public: | |
77 | ucPeripheral(QObject* parent=0); |
|
52 | ucPeripheral(QObject* parent=0); | |
78 | private: |
|
53 | private: | |
79 | QString p_name; |
|
54 | QString p_name; | |
80 | qint64 p_baseAddress; |
|
55 | qint64 p_baseAddress; | |
81 | }; |
|
56 | }; | |
82 |
|
57 | |||
83 |
|
58 | |||
84 |
|
59 | |||
85 | class ucSystemOnChip : public QObject,public QList<ucPeripheral*> |
|
60 | class ucSystemOnChip : public QObject,public QList<ucPeripheral*> | |
86 | { |
|
61 | { | |
87 | Q_OBJECT |
|
62 | Q_OBJECT | |
88 | public: |
|
63 | public: | |
89 | ucSystemOnChip(QObject* parent=0); |
|
64 | ucSystemOnChip(QObject* parent=0); | |
90 | public slots: |
|
65 | public slots: | |
91 | void setName(const QString& name); |
|
66 | void setName(const QString& name); | |
92 | signals: |
|
67 | signals: | |
93 | void nameChanged(const QString& name); |
|
68 | void nameChanged(const QString& name); | |
94 | private: |
|
69 | private: | |
95 | QString p_name; |
|
70 | QString p_name; | |
96 | }; |
|
71 | }; | |
97 |
|
72 | |||
98 |
|
73 | |||
99 |
|
74 | |||
100 | #endif // REGISTERDATA_H |
|
75 | #endif // REGISTERDATA_H | |
101 |
|
76 | |||
102 |
|
77 | |||
103 |
|
78 | |||
104 |
|
79 | |||
105 |
|
80 | |||
106 |
|
81 | |||
107 |
|
82 |
@@ -1,116 +1,113 | |||||
1 | /*------------------------------------------------------------------------------ |
|
1 | /*------------------------------------------------------------------------------ | |
2 | -- This file is a part of the SocExplorer Software |
|
2 | -- This file is a part of the SocExplorer Software | |
3 | -- Copyright (C) 2013, Plasma Physics Laboratory - CNRS |
|
3 | -- Copyright (C) 2013, Plasma Physics Laboratory - CNRS | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 2 of the License, or |
|
7 | -- the Free Software Foundation; either version 2 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | -------------------------------------------------------------------------------*/ |
|
18 | -------------------------------------------------------------------------------*/ | |
19 | /*-- Author : Alexis Jeandet |
|
19 | /*-- Author : Alexis Jeandet | |
20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr |
|
20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr | |
21 | ----------------------------------------------------------------------------*/ |
|
21 | ----------------------------------------------------------------------------*/ | |
22 |
|
22 | |||
23 | #ifndef REGISTERSMODEL_H |
|
23 | #ifndef REGISTERSMODEL_H | |
24 | #define REGISTERSMODEL_H |
|
24 | #define REGISTERSMODEL_H | |
25 | #include <QString> |
|
25 | #include <QString> | |
26 | #include <QList> |
|
26 | #include <QList> | |
27 | #include <QObject> |
|
27 | #include <QObject> | |
28 | #include <QDomDocument> |
|
28 | #include <QDomDocument> | |
29 | #include <QDomElement> |
|
29 | #include <QDomElement> | |
30 | #include "registerdata.h" |
|
30 | #include "registerdata.h" | |
31 | #include <socclk.h> |
|
31 | #include <socclk.h> | |
32 | #include <socexplorerplugin.h> |
|
32 | #include <socexplorerplugin.h> | |
33 | //#include <socexplorerenumdevice.h> |
|
|||
34 | class socExplorerEnumDevice; |
|
33 | class socExplorerEnumDevice; | |
35 |
|
34 | |||
36 | class registerBitFieldModel |
|
35 | class registerBitFieldModel | |
37 | { |
|
36 | { | |
38 | public: |
|
37 | public: | |
39 | registerBitFieldModel(const QString& name,const QString& description, |
|
38 | registerBitFieldModel(const QString& name,const QString& description, | |
40 | int size, int offset, bool rw) |
|
39 | int size, int offset, bool rw) | |
41 | { |
|
40 | { | |
42 | this->name = name; |
|
41 | this->name = name; | |
43 | this->description = description; |
|
42 | this->description = description; | |
44 | this->size = size; |
|
43 | this->size = size; | |
45 | this->offset = offset; |
|
44 | this->offset = offset; | |
46 | this->rw = rw; |
|
45 | this->rw = rw; | |
47 | } |
|
46 | } | |
48 | QString name; |
|
47 | QString name; | |
49 | QString description; |
|
48 | QString description; | |
50 | int size; |
|
49 | int size; | |
51 | int offset; |
|
50 | int offset; | |
52 | bool rw; |
|
51 | bool rw; | |
53 | }; |
|
52 | }; | |
54 |
|
53 | |||
55 | class registerModel |
|
54 | class registerModel | |
56 | { |
|
55 | { | |
57 | public: |
|
56 | public: | |
58 | registerModel(const QString& name,qint32 offset) |
|
57 | registerModel(const QString& name,qint32 offset) | |
59 | { |
|
58 | { | |
60 | this->name = name; |
|
59 | this->name = name; | |
61 | this->offset = offset; |
|
60 | this->offset = offset; | |
62 | } |
|
61 | } | |
63 | QString name; |
|
62 | QString name; | |
64 | qint32 offset; |
|
63 | qint32 offset; | |
65 | QList<registerBitFieldModel> bitfields; |
|
64 | QList<registerBitFieldModel> bitfields; | |
66 | }; |
|
65 | }; | |
67 |
|
66 | |||
68 | class peripheralModel |
|
67 | class peripheralModel | |
69 | { |
|
68 | { | |
70 | public: |
|
69 | public: | |
71 | peripheralModel(const QString& name) |
|
70 | peripheralModel(const QString& name) | |
72 | { |
|
71 | { | |
73 | this->name = name; |
|
72 | this->name = name; | |
74 | } |
|
73 | } | |
75 | QString name; |
|
74 | QString name; | |
76 | QList<registerModel> registers; |
|
75 | QList<registerModel> registers; | |
77 | }; |
|
76 | }; | |
78 |
|
77 | |||
79 |
|
78 | |||
80 | class SOCEXPLORER_EXPORT SOCModel :public QObject |
|
79 | class SOCEXPLORER_EXPORT SOCModel :public QObject | |
81 | { |
|
80 | { | |
82 | Q_OBJECT |
|
81 | Q_OBJECT | |
83 | public: |
|
82 | public: | |
84 | SOCModel(socexplorerplugin* rootDev,QObject* parent=0); |
|
83 | SOCModel(socexplorerplugin* rootDev,QObject* parent=0); | |
85 | // qint32 getRegValue(qint32 baseAddress); |
|
|||
86 | bool isRootDev(socexplorerplugin* rootDev) |
|
84 | bool isRootDev(socexplorerplugin* rootDev) | |
87 | { |
|
85 | { | |
88 | return rootDev==p_rootDev; |
|
86 | return rootDev==p_rootDev; | |
89 | } |
|
87 | } | |
90 | bool enumDeviceExists(qint32 baseAddress); |
|
88 | bool enumDeviceExists(qint32 baseAddress); | |
91 | socExplorerEnumDevice *getEnumDevice(qint32 baseAddress); |
|
89 | socExplorerEnumDevice *getEnumDevice(qint32 baseAddress); | |
92 | public slots: |
|
90 | public slots: | |
93 | //void setRegValue(qint32 baseAddress,qint32 value); |
|
|||
94 | qint32 getEnumDeviceBaseAddress(int VID,int PID,int count=0); |
|
91 | qint32 getEnumDeviceBaseAddress(int VID,int PID,int count=0); | |
95 | qint32 getEnumDeviceCount(int VID,int PID); |
|
92 | qint32 getEnumDeviceCount(int VID,int PID); | |
96 | socExplorerEnumDevice* addEnumDevice(int VID, int PID, qint32 baseAddress, const QString& name); |
|
93 | socExplorerEnumDevice* addEnumDevice(int VID, int PID, qint32 baseAddress, const QString& name); | |
97 | int addEnumDevice(socExplorerEnumDevice* device); |
|
94 | int addEnumDevice(socExplorerEnumDevice* device); | |
98 | void writeReg(qint32 address,qint32 value); |
|
95 | void writeReg(qint32 address,qint32 value); | |
99 | qint32 readReg(qint32 address); |
|
96 | qint32 readReg(qint32 address); | |
100 | private: |
|
97 | private: | |
101 | socexplorerplugin* p_rootDev; |
|
98 | socexplorerplugin* p_rootDev; | |
102 | QList<socExplorerEnumDevice*> p_enumeratedDevices; |
|
99 | QList<socExplorerEnumDevice*> p_enumeratedDevices; | |
103 | QList<SOCclk*> clktree; |
|
100 | QList<SOCclk*> clktree; | |
104 | }; |
|
101 | }; | |
105 |
|
102 | |||
106 |
|
103 | |||
107 |
|
104 | |||
108 |
|
105 | |||
109 | #endif // REGISTERSMODEL_H |
|
106 | #endif // REGISTERSMODEL_H | |
110 |
|
107 | |||
111 |
|
108 | |||
112 |
|
109 | |||
113 |
|
110 | |||
114 |
|
111 | |||
115 |
|
112 | |||
116 |
|
113 |
@@ -1,138 +1,137 | |||||
1 | /*------------------------------------------------------------------------------ |
|
1 | /*------------------------------------------------------------------------------ | |
2 | -- This file is a part of the SocExplorer Software |
|
2 | -- This file is a part of the SocExplorer Software | |
3 | -- Copyright (C) 2012, Plasma Physics Laboratory - CNRS |
|
3 | -- Copyright (C) 2012, Plasma Physics Laboratory - CNRS | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 2 of the License, or |
|
7 | -- the Free Software Foundation; either version 2 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | -------------------------------------------------------------------------------*/ |
|
18 | -------------------------------------------------------------------------------*/ | |
19 | /*-- Author : Alexis Jeandet |
|
19 | /*-- Author : Alexis Jeandet | |
20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr |
|
20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr | |
21 | ----------------------------------------------------------------------------*/ |
|
21 | ----------------------------------------------------------------------------*/ | |
22 | #ifndef SOCEXPLORERENGINE_H |
|
22 | #ifndef SOCEXPLORERENGINE_H | |
23 | #define SOCEXPLORERENGINE_H |
|
23 | #define SOCEXPLORERENGINE_H | |
24 |
|
24 | |||
25 | #include <stdint.h> |
|
25 | #include <stdint.h> | |
26 | #include <QObject> |
|
26 | #include <QObject> | |
27 | #include <QtWidgets> |
|
27 | #include <QtWidgets> | |
28 | #include <QStringList> |
|
28 | #include <QStringList> | |
29 | #include <QDomDocument> |
|
29 | #include <QDomDocument> | |
30 | #include <QDomElement> |
|
30 | #include <QDomElement> | |
31 | #include <QDomNodeList> |
|
31 | #include <QDomNodeList> | |
32 | #include <QFile> |
|
32 | #include <QFile> | |
33 | #include <QTextStream> |
|
33 | #include <QTextStream> | |
34 | #include <QDir> |
|
34 | #include <QDir> | |
35 | #include <QApplication> |
|
35 | #include <QApplication> | |
36 | #include <QtCore/qglobal.h> |
|
36 | #include <QtCore/qglobal.h> | |
37 | #include <QFileDialog> |
|
37 | #include <QFileDialog> | |
38 | #include <socexplorerxmlfile.h> |
|
38 | #include <socexplorerxmlfile.h> | |
39 | #include <socexplorerenumdevice.h> |
|
39 | #include <socexplorerenumdevice.h> | |
40 | #include <XMLmodel.h> |
|
40 | #include <XMLmodel.h> | |
41 | #include <peripheralwidget.h> |
|
41 | #include <peripheralwidget.h> | |
42 | #include <registerwidget.h> |
|
42 | #include <registerwidget.h> | |
43 | #include <socmodel.h> |
|
43 | #include <socmodel.h> | |
44 |
|
44 | |||
45 | #if defined(SOCEXPLORER_SDK_BUILD) |
|
45 | #if defined(SOCEXPLORER_SDK_BUILD) | |
46 | # define SOCEXPLORER_SDK_EXPORT Q_DECL_EXPORT |
|
46 | # define SOCEXPLORER_SDK_EXPORT Q_DECL_EXPORT | |
47 | #else |
|
47 | #else | |
48 | # define SOCEXPLORER_SDK_EXPORT Q_DECL_IMPORT |
|
48 | # define SOCEXPLORER_SDK_EXPORT Q_DECL_IMPORT | |
49 | #endif |
|
49 | #endif | |
50 |
|
50 | |||
51 |
|
51 | |||
52 | class SOCEXPLORER_SDK_EXPORT SocExplorerAutoProgressBar |
|
52 | class SOCEXPLORER_SDK_EXPORT SocExplorerAutoProgressBar | |
53 | { |
|
53 | { | |
54 | public: |
|
54 | public: | |
55 | SocExplorerAutoProgressBar(QProgressBar* progressBar=NULL) |
|
55 | SocExplorerAutoProgressBar(QProgressBar* progressBar=NULL) | |
56 | { |
|
56 | { | |
57 | this->p_progressbar=progressBar; |
|
57 | this->p_progressbar=progressBar; | |
58 | } |
|
58 | } | |
59 | ~SocExplorerAutoProgressBar() |
|
59 | ~SocExplorerAutoProgressBar() | |
60 | { |
|
60 | { | |
61 | if(p_progressbar) |
|
61 | if(p_progressbar) | |
62 | { |
|
62 | { | |
63 | delete p_progressbar; |
|
63 | delete p_progressbar; | |
64 | } |
|
64 | } | |
65 | } |
|
65 | } | |
66 | void setProgressBar(QProgressBar* progressBar) |
|
66 | void setProgressBar(QProgressBar* progressBar) | |
67 | { |
|
67 | { | |
68 | this->p_progressbar=progressBar; |
|
68 | this->p_progressbar=progressBar; | |
69 | } |
|
69 | } | |
70 | void setValue(int value) |
|
70 | void setValue(int value) | |
71 | { |
|
71 | { | |
72 | p_progressbar->setValue(value); |
|
72 | p_progressbar->setValue(value); | |
73 | } |
|
73 | } | |
74 | private: |
|
74 | private: | |
75 | QProgressBar* p_progressbar; |
|
75 | QProgressBar* p_progressbar; | |
76 | }; |
|
76 | }; | |
77 |
|
77 | |||
78 | //! SocExplorerEngine is a pure static class which aims to provide services for both SocExplorer software and plugins. |
|
78 | //! SocExplorerEngine is a pure static class which aims to provide services for both SocExplorer software and plugins. | |
79 |
|
79 | |||
80 | class SOCEXPLORER_SDK_EXPORT SocExplorerEngine : public QObject |
|
80 | class SOCEXPLORER_SDK_EXPORT SocExplorerEngine : public QObject | |
81 | { |
|
81 | { | |
82 | Q_OBJECT |
|
82 | Q_OBJECT | |
83 | private: |
|
83 | private: | |
84 | static SocExplorerEngine* _self; |
|
84 | static SocExplorerEngine* _self; | |
85 | SocExplorerEngine(QObject *parent = 0); |
|
85 | SocExplorerEngine(QObject *parent = 0); | |
86 | static void init(); |
|
86 | static void init(); | |
87 |
|
87 | |||
88 | public: |
|
88 | public: | |
89 | static SocExplorerEngine* self(){ if(!_self){_self= new SocExplorerEngine;}return _self;} |
|
89 | static SocExplorerEngine* self(){ if(!_self){_self= new SocExplorerEngine;}return _self;} | |
90 | //! Return the configuration folder path, OS dependant. |
|
90 | //! Return the configuration folder path, OS dependant. | |
91 | SOCEXPLORER_SDK_EXPORT static QString configFolder(); |
|
91 | SOCEXPLORER_SDK_EXPORT static QString configFolder(); | |
92 | //! Return the default plugin folder path, OS dependant. |
|
92 | //! Return the default plugin folder path, OS dependant. | |
93 | //static QString pluginFolder(){return QString(SOCEXPLORER_PLUGINS_INSTALL_PATH);} |
|
|||
94 | static QStringList pluginFolders(); |
|
93 | static QStringList pluginFolders(); | |
95 | static QString configPath(){return QString(SOCEXPLORER_CONFIG_PATH);} |
|
94 | static QString configPath(){return QString(SOCEXPLORER_CONFIG_PATH);} | |
96 | static QString sharePath(){return QString(SOCEXPLORER_SHARE_PATH);} |
|
95 | static QString sharePath(){return QString(SOCEXPLORER_SHARE_PATH);} | |
97 | static int addEnumDevice(socexplorerplugin* rootPlugin,int VID,int PID,qint32 baseAddress,const QString& name); |
|
96 | static int addEnumDevice(socexplorerplugin* rootPlugin,int VID,int PID,qint32 baseAddress,const QString& name); | |
98 | static QList<SOCModel*>* getSOCs(); |
|
97 | static QList<SOCModel*>* getSOCs(); | |
99 | static QString getDevName(int VID, int PID); |
|
98 | static QString getDevName(int VID, int PID); | |
100 | static QString SocExplorerVersion(); |
|
99 | static QString SocExplorerVersion(); | |
101 | static QString SocExplorerChangeset(); |
|
100 | static QString SocExplorerChangeset(); | |
102 | static QString SocExplorerBranch(); |
|
101 | static QString SocExplorerBranch(); | |
103 | static socExplorerXmlModel* xmlModel(); |
|
102 | static socExplorerXmlModel* xmlModel(); | |
104 | static void setMainWindow(QMainWindow* Mainwindow); |
|
103 | static void setMainWindow(QMainWindow* Mainwindow); | |
105 | static QProgressBar* getProgressBar(const QString &format, int max); |
|
104 | static QProgressBar* getProgressBar(const QString &format, int max); | |
106 | static void deleteProgressBar(QProgressBar* progressBar); |
|
105 | static void deleteProgressBar(QProgressBar* progressBar); | |
107 | static void addSOC(socexplorerplugin* rootPlugin); |
|
106 | static void addSOC(socexplorerplugin* rootPlugin); | |
108 | static void removeSOC(socexplorerplugin* rootPlugin); |
|
107 | static void removeSOC(socexplorerplugin* rootPlugin); | |
109 | static void message(socexplorerplugin* sender,const QString& message,int debugLevel=0); |
|
108 | static void message(socexplorerplugin* sender,const QString& message,int debugLevel=0); | |
110 | static void setLogLevel(int level); |
|
109 | static void setLogLevel(int level); | |
111 | signals: |
|
110 | signals: | |
112 | void enumDeviceAdded(socExplorerEnumDevice* device); |
|
111 | void enumDeviceAdded(socExplorerEnumDevice* device); | |
113 | public slots: |
|
112 | public slots: | |
114 | QString getSocExplorerVersion(){return SocExplorerEngine::SocExplorerVersion();} |
|
113 | QString getSocExplorerVersion(){return SocExplorerEngine::SocExplorerVersion();} | |
115 | QString getSocExplorerChangeset(){return SocExplorerEngine::SocExplorerChangeset();} |
|
114 | QString getSocExplorerChangeset(){return SocExplorerEngine::SocExplorerChangeset();} | |
116 | QString getSocExplorerBranch(){return SocExplorerEngine::SocExplorerBranch();} |
|
115 | QString getSocExplorerBranch(){return SocExplorerEngine::SocExplorerBranch();} | |
117 | qint32 getEnumDeviceBaseAddress(const QString& rootPlugin,int VID,int PID,int count=0); |
|
116 | qint32 getEnumDeviceBaseAddress(const QString& rootPlugin,int VID,int PID,int count=0); | |
118 | qint32 getEnumDeviceBaseAddress(socexplorerplugin* plugin,int VID,int PID,int count=0); |
|
117 | qint32 getEnumDeviceBaseAddress(socexplorerplugin* plugin,int VID,int PID,int count=0); | |
119 | qint32 getEnumDeviceCount(socexplorerplugin* plugin,int VID,int PID); |
|
118 | qint32 getEnumDeviceCount(socexplorerplugin* plugin,int VID,int PID); | |
120 | qint32 getEnumDeviceCount(const QString& rootPlugin,int VID,int PID); |
|
119 | qint32 getEnumDeviceCount(const QString& rootPlugin,int VID,int PID); | |
121 | int addEnumDevice(const QString& rootPlugin,int VID,int PID,qint32 baseAddress,const QString& name); |
|
120 | int addEnumDevice(const QString& rootPlugin,int VID,int PID,qint32 baseAddress,const QString& name); | |
122 |
|
121 | |||
123 | private: |
|
122 | private: | |
124 | static SOCModel* plugin2Soc(socexplorerplugin* plugin); |
|
123 | static SOCModel* plugin2Soc(socexplorerplugin* plugin); | |
125 | static socExplorerXmlModel* p_xmlmodel; |
|
124 | static socExplorerXmlModel* p_xmlmodel; | |
126 | static QMainWindow* mainWindow; |
|
125 | static QMainWindow* mainWindow; | |
127 | static QList<SOCModel*>* SOCs; |
|
126 | static QList<SOCModel*>* SOCs; | |
128 | static int loglvl; |
|
127 | static int loglvl; | |
129 | }; |
|
128 | }; | |
130 |
|
129 | |||
131 | #endif // SOCEXPLORERENGINE_H |
|
130 | #endif // SOCEXPLORERENGINE_H | |
132 |
|
131 | |||
133 |
|
132 | |||
134 |
|
133 | |||
135 |
|
134 | |||
136 |
|
135 | |||
137 |
|
136 | |||
138 |
|
137 |
General Comments 0
You need to be logged in to leave comments.
Login now