##// END OF EJS Templates
Merge
admin@pc-p-leroy3.LAB-LPP.LOCAL -
r30:80c27716b2cd merge default
parent child
Show More
@@ -1,6 +1,6
1 #############################################################################
1 #############################################################################
2 # Makefile for building: PAULs_LPPMON_PLUGINS
2 # Makefile for building: PAULs_LPPMON_PLUGINS
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Fri Feb 1 12:36:21 2013
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Fri Apr 5 15:41:42 2013
4 # Project: PAULs_LPPMON_PLUGINS.pro
4 # Project: PAULs_LPPMON_PLUGINS.pro
5 # Template: subdirs
5 # Template: subdirs
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile PAULs_LPPMON_PLUGINS.pro
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile PAULs_LPPMON_PLUGINS.pro
@@ -29,10 +29,10 SUBTARGETS = \
29
29
30 rmapplugin/$(MAKEFILE):
30 rmapplugin/$(MAKEFILE):
31 @$(CHK_DIR_EXISTS) rmapplugin/ || $(MKDIR) rmapplugin/
31 @$(CHK_DIR_EXISTS) rmapplugin/ || $(MKDIR) rmapplugin/
32 cd rmapplugin/ && $(QMAKE) /home/admin/opt/LPPMON_PLUGINS_PLE/rmapplugin/rmapplugin.pro -spec /usr/lib64/qt4/mkspecs/linux-g++ -o $(MAKEFILE)
32 cd rmapplugin/ && $(QMAKE) /opt/LPPMON_PLUGINS_PAUL/rmapplugin/rmapplugin.pro -spec /usr/lib64/qt4/mkspecs/linux-g++ -o $(MAKEFILE)
33 sub-rmapplugin-qmake_all: FORCE
33 sub-rmapplugin-qmake_all: FORCE
34 @$(CHK_DIR_EXISTS) rmapplugin/ || $(MKDIR) rmapplugin/
34 @$(CHK_DIR_EXISTS) rmapplugin/ || $(MKDIR) rmapplugin/
35 cd rmapplugin/ && $(QMAKE) /home/admin/opt/LPPMON_PLUGINS_PLE/rmapplugin/rmapplugin.pro -spec /usr/lib64/qt4/mkspecs/linux-g++ -o $(MAKEFILE)
35 cd rmapplugin/ && $(QMAKE) /opt/LPPMON_PLUGINS_PAUL/rmapplugin/rmapplugin.pro -spec /usr/lib64/qt4/mkspecs/linux-g++ -o $(MAKEFILE)
36 sub-rmapplugin: rmapplugin/$(MAKEFILE) FORCE
36 sub-rmapplugin: rmapplugin/$(MAKEFILE) FORCE
37 cd rmapplugin/ && $(MAKE) -f $(MAKEFILE)
37 cd rmapplugin/ && $(MAKE) -f $(MAKEFILE)
38 sub-rmapplugin-make_default-ordered: rmapplugin/$(MAKEFILE) FORCE
38 sub-rmapplugin-make_default-ordered: rmapplugin/$(MAKEFILE) FORCE
@@ -1,6 +1,6
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE QtCreatorProject>
2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by Qt Creator 2.4.1, 2013-03-09T22:08:02. -->
3 <!-- Written by Qt Creator 2.4.1, 2013-04-05T17:42:05. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -63,7 +63,7
63 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
63 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
64 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
64 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
65 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
65 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
66 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
66 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
67 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
67 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
68 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
68 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
69 </valuemap>
69 </valuemap>
@@ -97,15 +97,65
97 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
97 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
98 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
98 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
99 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
99 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
100 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.3 in PATH (System) Release</value>
100 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value>
101 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
101 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
102 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
102 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
103 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
103 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
104 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/home/admin/opt/LPPMON_PLUGINS_PLE</value>
104 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL</value>
105 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
105 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
106 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
106 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
107 </valuemap>
107 </valuemap>
108 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
108 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
109 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
110 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
111 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
112 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
115 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
116 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
117 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
118 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
119 </valuemap>
120 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
121 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
122 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
124 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
125 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
126 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
127 </valuemap>
128 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
129 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
130 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
131 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
132 </valuemap>
133 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
134 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
135 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
136 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
137 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
138 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
139 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
140 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
141 </valuemap>
142 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
143 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
144 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
145 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
146 </valuemap>
147 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
148 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
149 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
150 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value>
151 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
152 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
153 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
154 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL</value>
155 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
156 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
157 </valuemap>
158 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
109 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
159 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
110 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
160 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
111 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
161 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
@@ -196,7 +246,85
196 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
246 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
197 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
247 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
198 </valuemap>
248 </valuemap>
199 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
249 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
250 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
251 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
252 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
253 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
254 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
255 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
256 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
257 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
258 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
259 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
260 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
261 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
262 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
263 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
264 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
265 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
266 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
267 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
268 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
269 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
270 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
271 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
272 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
273 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
274 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
275 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
276 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
277 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
278 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
279 <value type="int">0</value>
280 <value type="int">1</value>
281 <value type="int">2</value>
282 <value type="int">3</value>
283 <value type="int">4</value>
284 <value type="int">5</value>
285 <value type="int">6</value>
286 <value type="int">7</value>
287 <value type="int">8</value>
288 <value type="int">9</value>
289 <value type="int">10</value>
290 <value type="int">11</value>
291 <value type="int">12</value>
292 <value type="int">13</value>
293 <value type="int">14</value>
294 </valuelist>
295 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
296 <value type="int">0</value>
297 <value type="int">1</value>
298 <value type="int">2</value>
299 <value type="int">3</value>
300 <value type="int">4</value>
301 <value type="int">5</value>
302 <value type="int">6</value>
303 <value type="int">7</value>
304 <value type="int">8</value>
305 <value type="int">9</value>
306 <value type="int">10</value>
307 <value type="int">11</value>
308 <value type="int">12</value>
309 <value type="int">13</value>
310 <value type="int">14</value>
311 </valuelist>
312 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">spwtimegenerator</value>
313 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
314 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration</value>
315 <value type="int" key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase">2</value>
316 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
317 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">spwtimegenerator/spwtimegenerator/spwtimegenerator.pro</value>
318 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
319 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
320 <valuelist type="QVariantList" key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges"/>
321 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
322 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
323 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
324 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
325 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
326 </valuemap>
327 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
200 </valuemap>
328 </valuemap>
201 </data>
329 </data>
202 <data>
330 <data>
@@ -205,7 +333,7
205 </data>
333 </data>
206 <data>
334 <data>
207 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
335 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
208 <value type="QString">{cdbf9cdc-1e84-406e-889b-c4feef49e75c}</value>
336 <value type="QString">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
209 </data>
337 </data>
210 <data>
338 <data>
211 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
339 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
@@ -59,11 +59,21 void QIPDialogBox::valueChanged() // SLO
59 gresbIP.append(addressPart3->cleanText());
59 gresbIP.append(addressPart3->cleanText());
60 gresbIP.append(".");
60 gresbIP.append(".");
61 gresbIP.append(addressPart4->cleanText());
61 gresbIP.append(addressPart4->cleanText());
62 //labelGRESBIP->setText("IP used for the gresb module: " + gresbIP);
63 }
62 }
64
63
65 QString QIPDialogBox::getGRESBIP()
64 QString QIPDialogBox::getIP()
66 {
65 {
67 return(gresbIP);
66 return(gresbIP);
68 }
67 }
69
68
69 void QIPDialogBox::setIP(unsigned char address1, unsigned char address2, unsigned char address3, unsigned char address4)
70 {
71 addressPart1->setValue(address1);
72 addressPart2->setValue(address2);
73 addressPart3->setValue(address3);
74 addressPart4->setValue(address4);
75 addressPart1->repaint();
76 addressPart2->repaint();
77 addressPart3->repaint();
78 addressPart4->repaint();
79 }
@@ -11,12 +11,13 class QIPDialogBox : public QWidget
11 Q_OBJECT
11 Q_OBJECT
12 public:
12 public:
13 explicit QIPDialogBox(QWidget *parent = 0);
13 explicit QIPDialogBox(QWidget *parent = 0);
14 QString getGRESBIP();
14 void setIP(unsigned char address1, unsigned char address2, unsigned char address3, unsigned char address4);
15
15
16 signals:
16 signals:
17
17
18 public slots:
18 public slots:
19 void valueChanged();
19 void valueChanged();
20 QString getIP();
20
21
21 private:
22 private:
22 QSpinBox *addressPart1;
23 QSpinBox *addressPart1;
@@ -1,6 +1,6
1 #############################################################################
1 #############################################################################
2 # Makefile for building: librmapplugin.so.1.0.0
2 # Makefile for building: librmapplugin.so.1.0.0
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Fri Feb 1 12:36:22 2013
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Fri Apr 5 15:41:42 2013
4 # Project: rmapplugin.pro
4 # Project: rmapplugin.pro
5 # Template: lib
5 # Template: lib
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro
@@ -10,13 +10,13
10
10
11 CC = gcc
11 CC = gcc
12 CXX = g++
12 CXX = g++
13 DEFINES = -DPLUGIN=rmapplugin -DPLUGINHEADER="\"rmapplugin.h\"" -Ddriver_Name="\"RMAPPlugin\"" -Ddriver_Author="\"Paul Leroy paul.leroy@lpp.polytechnique.fr\"" -Ddriver_Version="\"1.1.2\"" -Ddriver_Description="\"AHB bus controler, works with Gaisler's AHB plugn' play bus.\"" -Ddriver_can_be_root=1 -Ddriver_can_be_child=0 -Ddriver_VID=0 -Ddriver_PID=0 -DUNIXTRANSLATIONPATH -DLPPMON_PLUGINS_INSTALL_PATH="QDir::homePath()+\"/.lppmon/plugins\"" -DLPPMON_CONFIG_PATH="QDir::homePath()+\"/.lppmon/config\"" -DLPPMON_TRANSLATION_PATH="\"/etc/lppmon/translations\"" -DLPPMONPLUGIN_LIBRARY -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
13 DEFINES = -DPLUGIN=rmapplugin -DPLUGINHEADER="\"rmapplugin.h\"" -Ddriver_Name="\"RMAPPlugin\"" -Ddriver_Author="\"Paul Leroy paul.leroy@lpp.polytechnique.fr\"" -Ddriver_Version="\"1.1.2\"" -Ddriver_Description="\"AHB bus controler, works with Gaisler's AHB plugn' play bus.\"" -Ddriver_can_be_root=1 -Ddriver_can_be_child=0 -Ddriver_VID=0 -Ddriver_PID=0 -DLPPMON_VERSION="\"0.0.1\"" -DUNIXTRANSLATIONPATH -DLPPMON_PLUGINS_INSTALL_PATH="QDir::homePath()+\"/.lppmon/plugins\"" -DLPPMON_CONFIG_PATH="QDir::homePath()+\"/.lppmon/config\"" -DLPPMON_TRANSLATION_PATH="\"/etc/lppmon/translations\"" -DLPPMONPLUGIN_LIBRARY -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
14 CFLAGS = -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
14 CFLAGS = -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
15 CXXFLAGS = -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -O2 -I/usr/include/python2.7 -I/usr/include/python2.7 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
15 CXXFLAGS = -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -O2 -I/usr/include/python2.7 -I/usr/include/python2.7 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include -I. -I../common_PLE -I../spw_usb_driver_v2.61/inc -I/usr/include/lppmon/common -I/usr/include/lppmon -I/usr/include/lppmon/pluginsInterface -I/usr/include/PythonQt -Imoc
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include -I. -I../common_PLE -I../spw_usb_driver_v2.61/inc -I/usr/include/lppmon/common -I/usr/include/lppmon -I/usr/include/lppmon/pluginsInterface -I/usr/include/PythonQt -Imoc
17 LINK = g++
17 LINK = g++
18 LFLAGS = -Wl,-O1 -Wl,-z,relro -shared -Wl,-soname,librmapplugin.so.1
18 LFLAGS = -Wl,-O1 -Wl,-z,relro -shared -Wl,-soname,librmapplugin.so.1
19 LIBS = $(SUBLIBS) -L/usr/lib64 ../spw_usb_driver_v2.61/lib/x86_64/libSpaceWireUSBAPI.so ../spw_usb_driver_v2.61/lib/x86_64/libConfigLibraryUSB.so -ldl -lutil -lm -lpython2.7 -lPythonQt_QtAll -lPythonQt -lQtXml -lQtGui -lQtNetwork -lQtCore -lpthread
19 LIBS = $(SUBLIBS) -L/usr/lib64 ../spw_usb_driver_v2.62/lib/x86_64/libSpaceWireUSBAPI.so ../spw_usb_driver_v2.62/lib/x86_64/libConfigLibraryUSB.so -ldl -lutil -lm -lpython2.7 -lPythonQt_QtAll -lPythonQt -lQtXml -lQtGui -lQtNetwork -lQtCore -lpthread
20 AR = ar cqs
20 AR = ar cqs
21 RANLIB =
21 RANLIB =
22 QMAKE = /usr/bin/qmake-qt4
22 QMAKE = /usr/bin/qmake-qt4
@@ -53,7 +53,8 SOURCES = rmapplugin.cpp \
53 rmappluginpythonwrapper.cpp \
53 rmappluginpythonwrapper.cpp \
54 stardundee.cpp \
54 stardundee.cpp \
55 gresb.cpp \
55 gresb.cpp \
56 bridge.cpp \
56 tcpackettosend.cpp \
57 tmpackettoread.cpp \
57 /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp moc/moc_rmappluginui.cpp \
58 /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp moc/moc_rmappluginui.cpp \
58 moc/moc_rmapplugin.cpp \
59 moc/moc_rmapplugin.cpp \
59 moc/moc_qipdialogbox.cpp \
60 moc/moc_qipdialogbox.cpp \
@@ -62,7 +63,10 SOURCES = rmapplugin.cpp \
62 moc/moc_rmappluginpythonwrapper.cpp \
63 moc/moc_rmappluginpythonwrapper.cpp \
63 moc/moc_stardundee.cpp \
64 moc/moc_stardundee.cpp \
64 moc/moc_gresb.cpp \
65 moc/moc_gresb.cpp \
65 moc/moc_bridge.cpp
66 moc/moc_tcpackettosend.cpp \
67 moc/moc_tmpackettoread.cpp \
68 moc/moc_genericPySysdriver.cpp \
69 moc/moc_lppmonplugin.cpp
66 OBJECTS = obj/rmapplugin.o \
70 OBJECTS = obj/rmapplugin.o \
67 obj/rmappluginui.o \
71 obj/rmappluginui.o \
68 obj/rmapoperations.o \
72 obj/rmapoperations.o \
@@ -73,7 +77,8 OBJECTS = obj/rmapplugin.o \
73 obj/rmappluginpythonwrapper.o \
77 obj/rmappluginpythonwrapper.o \
74 obj/stardundee.o \
78 obj/stardundee.o \
75 obj/gresb.o \
79 obj/gresb.o \
76 obj/bridge.o \
80 obj/tcpackettosend.o \
81 obj/tmpackettoread.o \
77 obj/lppmonplugininterface.o \
82 obj/lppmonplugininterface.o \
78 obj/moc_rmappluginui.o \
83 obj/moc_rmappluginui.o \
79 obj/moc_rmapplugin.o \
84 obj/moc_rmapplugin.o \
@@ -83,7 +88,10 OBJECTS = obj/rmapplugin.o \
83 obj/moc_rmappluginpythonwrapper.o \
88 obj/moc_rmappluginpythonwrapper.o \
84 obj/moc_stardundee.o \
89 obj/moc_stardundee.o \
85 obj/moc_gresb.o \
90 obj/moc_gresb.o \
86 obj/moc_bridge.o
91 obj/moc_tcpackettosend.o \
92 obj/moc_tmpackettoread.o \
93 obj/moc_genericPySysdriver.o \
94 obj/moc_lppmonplugin.o
87 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
95 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
88 /usr/lib64/qt4/mkspecs/common/linux.conf \
96 /usr/lib64/qt4/mkspecs/common/linux.conf \
89 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
97 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
@@ -231,7 +239,7 qmake: FORCE
231
239
232 dist:
240 dist:
233 @$(CHK_DIR_EXISTS) obj/rmapplugin1.0.0 || $(MKDIR) obj/rmapplugin1.0.0
241 @$(CHK_DIR_EXISTS) obj/rmapplugin1.0.0 || $(MKDIR) obj/rmapplugin1.0.0
234 $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmappluginui.h rmapplugin.h rmapoperations.h ccsds.h ../common_PLE/qipdialogbox.h ../common_PLE/gresbstatusenquiry.h spectralmatricesdmasimulator.h rmappluginpythonwrapper.h stardundee.h ../spw_usb_driver_v2.61/inc/spw_usb_api.h ../spw_usb_driver_v2.61/inc/spw_config_library.h gresb.h bridge.h /usr/include/genericPySysdriver.h /usr/include/lppmonplugin.h obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmapplugin.cpp rmappluginui.cpp rmapoperations.cpp ccsds.cpp ../common_PLE/qipdialogbox.cpp ../common_PLE/gresbstatusenquiry.cpp spectralmatricesdmasimulator.cpp rmappluginpythonwrapper.cpp stardundee.cpp gresb.cpp bridge.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp obj/rmapplugin1.0.0/ && (cd `dirname obj/rmapplugin1.0.0` && $(TAR) rmapplugin1.0.0.tar rmapplugin1.0.0 && $(COMPRESS) rmapplugin1.0.0.tar) && $(MOVE) `dirname obj/rmapplugin1.0.0`/rmapplugin1.0.0.tar.gz . && $(DEL_FILE) -r obj/rmapplugin1.0.0
242 $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmappluginui.h rmapplugin.h rmapoperations.h ccsds.h ../common_PLE/qipdialogbox.h ../common_PLE/gresbstatusenquiry.h spectralmatricesdmasimulator.h rmappluginpythonwrapper.h stardundee.h ../spw_usb_driver_v2.61/inc/spw_usb_api.h ../spw_usb_driver_v2.61/inc/spw_config_library.h gresb.h tcpackettosend.h tmpackettoread.h /usr/include/lppmon/genericPySysdriver.h /usr/include/lppmon/lppmonplugin.h obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmapplugin.cpp rmappluginui.cpp rmapoperations.cpp ccsds.cpp ../common_PLE/qipdialogbox.cpp ../common_PLE/gresbstatusenquiry.cpp spectralmatricesdmasimulator.cpp rmappluginpythonwrapper.cpp stardundee.cpp gresb.cpp tcpackettosend.cpp tmpackettoread.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp obj/rmapplugin1.0.0/ && (cd `dirname obj/rmapplugin1.0.0` && $(TAR) rmapplugin1.0.0.tar rmapplugin1.0.0 && $(COMPRESS) rmapplugin1.0.0.tar) && $(MOVE) `dirname obj/rmapplugin1.0.0`/rmapplugin1.0.0.tar.gz . && $(DEL_FILE) -r obj/rmapplugin1.0.0
235
243
236
244
237 clean:compiler_clean
245 clean:compiler_clean
@@ -253,12 +261,14 mocclean: compiler_moc_header_clean comp
253
261
254 mocables: compiler_moc_header_make_all compiler_moc_source_make_all
262 mocables: compiler_moc_header_make_all compiler_moc_source_make_all
255
263
256 compiler_moc_header_make_all: moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_qipdialogbox.cpp moc/moc_gresbstatusenquiry.cpp moc/moc_spectralmatricesdmasimulator.cpp moc/moc_rmappluginpythonwrapper.cpp moc/moc_stardundee.cpp moc/moc_gresb.cpp moc/moc_bridge.cpp
264 compiler_moc_header_make_all: moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_qipdialogbox.cpp moc/moc_gresbstatusenquiry.cpp moc/moc_spectralmatricesdmasimulator.cpp moc/moc_rmappluginpythonwrapper.cpp moc/moc_stardundee.cpp moc/moc_gresb.cpp moc/moc_tcpackettosend.cpp moc/moc_tmpackettoread.cpp moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp
257 compiler_moc_header_clean:
265 compiler_moc_header_clean:
258 -$(DEL_FILE) moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_qipdialogbox.cpp moc/moc_gresbstatusenquiry.cpp moc/moc_spectralmatricesdmasimulator.cpp moc/moc_rmappluginpythonwrapper.cpp moc/moc_stardundee.cpp moc/moc_gresb.cpp moc/moc_bridge.cpp
266 -$(DEL_FILE) moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_qipdialogbox.cpp moc/moc_gresbstatusenquiry.cpp moc/moc_spectralmatricesdmasimulator.cpp moc/moc_rmappluginpythonwrapper.cpp moc/moc_stardundee.cpp moc/moc_gresb.cpp moc/moc_tcpackettosend.cpp moc/moc_tmpackettoread.cpp moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp
259 moc/moc_rmappluginui.cpp: rmapoperations.h \
267 moc/moc_rmappluginui.cpp: rmapoperations.h \
260 spectralmatricesdmasimulator.h \
268 spectralmatricesdmasimulator.h \
261 stardundee.h \
269 stardundee.h \
270 ccsds.h \
271 tmpackettoread.h \
262 gresb.h \
272 gresb.h \
263 rmappluginui.h
273 rmappluginui.h
264 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginui.h -o moc/moc_rmappluginui.cpp
274 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginui.h -o moc/moc_rmappluginui.cpp
@@ -267,8 +277,9 moc/moc_rmapplugin.cpp: rmappluginui.h \
267 rmapoperations.h \
277 rmapoperations.h \
268 spectralmatricesdmasimulator.h \
278 spectralmatricesdmasimulator.h \
269 stardundee.h \
279 stardundee.h \
280 ccsds.h \
281 tmpackettoread.h \
270 gresb.h \
282 gresb.h \
271 ccsds.h \
272 rmapplugin.h
283 rmapplugin.h
273 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmapplugin.h -o moc/moc_rmapplugin.cpp
284 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmapplugin.h -o moc/moc_rmapplugin.cpp
274
285
@@ -281,20 +292,36 moc/moc_gresbstatusenquiry.cpp: ../commo
281 moc/moc_spectralmatricesdmasimulator.cpp: spectralmatricesdmasimulator.h
292 moc/moc_spectralmatricesdmasimulator.cpp: spectralmatricesdmasimulator.h
282 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) spectralmatricesdmasimulator.h -o moc/moc_spectralmatricesdmasimulator.cpp
293 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) spectralmatricesdmasimulator.h -o moc/moc_spectralmatricesdmasimulator.cpp
283
294
284 moc/moc_rmappluginpythonwrapper.cpp: rmappluginpythonwrapper.h
295 moc/moc_rmappluginpythonwrapper.cpp: rmapoperations.h \
296 ccsds.h \
297 tcpackettosend.h \
298 tmpackettoread.h \
299 rmappluginpythonwrapper.h
285 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginpythonwrapper.h -o moc/moc_rmappluginpythonwrapper.cpp
300 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginpythonwrapper.h -o moc/moc_rmappluginpythonwrapper.cpp
286
301
287 moc/moc_stardundee.cpp: rmapoperations.h \
302 moc/moc_stardundee.cpp: rmapoperations.h \
303 ccsds.h \
304 tmpackettoread.h \
288 stardundee.h
305 stardundee.h
289 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) stardundee.h -o moc/moc_stardundee.cpp
306 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) stardundee.h -o moc/moc_stardundee.cpp
290
307
291 moc/moc_gresb.cpp: rmapoperations.h \
308 moc/moc_gresb.cpp: rmapoperations.h \
309 ccsds.h \
310 tmpackettoread.h \
292 gresb.h
311 gresb.h
293 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) gresb.h -o moc/moc_gresb.cpp
312 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) gresb.h -o moc/moc_gresb.cpp
294
313
295 moc/moc_bridge.cpp: rmapoperations.h \
314 moc/moc_tcpackettosend.cpp: tcpackettosend.h
296 bridge.h
315 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) tcpackettosend.h -o moc/moc_tcpackettosend.cpp
297 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) bridge.h -o moc/moc_bridge.cpp
316
317 moc/moc_tmpackettoread.cpp: tmpackettoread.h
318 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) tmpackettoread.h -o moc/moc_tmpackettoread.cpp
319
320 moc/moc_genericPySysdriver.cpp: /usr/include/lppmon/genericPySysdriver.h
321 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/lppmon/genericPySysdriver.h -o moc/moc_genericPySysdriver.cpp
322
323 moc/moc_lppmonplugin.cpp: /usr/include/lppmon/lppmonplugin.h
324 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/lppmon/lppmonplugin.h -o moc/moc_lppmonplugin.cpp
298
325
299 compiler_rcc_make_all:
326 compiler_rcc_make_all:
300 compiler_rcc_clean:
327 compiler_rcc_clean:
@@ -320,9 +347,11 obj/rmapplugin.o: rmapplugin.cpp rmapplu
320 rmapoperations.h \
347 rmapoperations.h \
321 spectralmatricesdmasimulator.h \
348 spectralmatricesdmasimulator.h \
322 stardundee.h \
349 stardundee.h \
350 ccsds.h \
351 tmpackettoread.h \
323 gresb.h \
352 gresb.h \
324 ccsds.h \
353 rmappluginpythonwrapper.h \
325 rmappluginpythonwrapper.h
354 tcpackettosend.h
326 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapplugin.o rmapplugin.cpp
355 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapplugin.o rmapplugin.cpp
327
356
328 obj/rmappluginui.o: rmappluginui.cpp rmapplugin.h \
357 obj/rmappluginui.o: rmappluginui.cpp rmapplugin.h \
@@ -330,8 +359,9 obj/rmappluginui.o: rmappluginui.cpp rma
330 rmapoperations.h \
359 rmapoperations.h \
331 spectralmatricesdmasimulator.h \
360 spectralmatricesdmasimulator.h \
332 stardundee.h \
361 stardundee.h \
333 gresb.h \
362 ccsds.h \
334 ccsds.h
363 tmpackettoread.h \
364 gresb.h
335 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginui.o rmappluginui.cpp
365 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginui.o rmappluginui.cpp
336
366
337 obj/rmapoperations.o: rmapoperations.cpp rmapoperations.h
367 obj/rmapoperations.o: rmapoperations.cpp rmapoperations.h
@@ -349,20 +379,30 obj/gresbstatusenquiry.o: ../common_PLE/
349 obj/spectralmatricesdmasimulator.o: spectralmatricesdmasimulator.cpp spectralmatricesdmasimulator.h
379 obj/spectralmatricesdmasimulator.o: spectralmatricesdmasimulator.cpp spectralmatricesdmasimulator.h
350 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/spectralmatricesdmasimulator.o spectralmatricesdmasimulator.cpp
380 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/spectralmatricesdmasimulator.o spectralmatricesdmasimulator.cpp
351
381
352 obj/rmappluginpythonwrapper.o: rmappluginpythonwrapper.cpp rmappluginpythonwrapper.h
382 obj/rmappluginpythonwrapper.o: rmappluginpythonwrapper.cpp rmappluginpythonwrapper.h \
383 rmapoperations.h \
384 ccsds.h \
385 tcpackettosend.h \
386 tmpackettoread.h
353 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginpythonwrapper.o rmappluginpythonwrapper.cpp
387 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginpythonwrapper.o rmappluginpythonwrapper.cpp
354
388
355 obj/stardundee.o: stardundee.cpp stardundee.h \
389 obj/stardundee.o: stardundee.cpp stardundee.h \
356 rmapoperations.h
390 rmapoperations.h \
391 ccsds.h \
392 tmpackettoread.h
357 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/stardundee.o stardundee.cpp
393 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/stardundee.o stardundee.cpp
358
394
359 obj/gresb.o: gresb.cpp gresb.h \
395 obj/gresb.o: gresb.cpp gresb.h \
360 rmapoperations.h
396 rmapoperations.h \
397 ccsds.h \
398 tmpackettoread.h
361 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/gresb.o gresb.cpp
399 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/gresb.o gresb.cpp
362
400
363 obj/bridge.o: bridge.cpp bridge.h \
401 obj/tcpackettosend.o: tcpackettosend.cpp tcpackettosend.h
364 rmapoperations.h
402 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tcpackettosend.o tcpackettosend.cpp
365 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/bridge.o bridge.cpp
403
404 obj/tmpackettoread.o: tmpackettoread.cpp tmpackettoread.h
405 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tmpackettoread.o tmpackettoread.cpp
366
406
367 obj/lppmonplugininterface.o: /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.h \
407 obj/lppmonplugininterface.o: /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.h \
368 /usr/include/lppmon/pluginsInterface/lppmonplugininterface_global.h
408 /usr/include/lppmon/pluginsInterface/lppmonplugininterface_global.h
@@ -392,24 +432,33 obj/moc_stardundee.o: moc/moc_stardundee
392 obj/moc_gresb.o: moc/moc_gresb.cpp
432 obj/moc_gresb.o: moc/moc_gresb.cpp
393 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_gresb.o moc/moc_gresb.cpp
433 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_gresb.o moc/moc_gresb.cpp
394
434
395 obj/moc_bridge.o: moc/moc_bridge.cpp
435 obj/moc_tcpackettosend.o: moc/moc_tcpackettosend.cpp
396 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_bridge.o moc/moc_bridge.cpp
436 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_tcpackettosend.o moc/moc_tcpackettosend.cpp
437
438 obj/moc_tmpackettoread.o: moc/moc_tmpackettoread.cpp
439 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_tmpackettoread.o moc/moc_tmpackettoread.cpp
440
441 obj/moc_genericPySysdriver.o: moc/moc_genericPySysdriver.cpp
442 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_genericPySysdriver.o moc/moc_genericPySysdriver.cpp
443
444 obj/moc_lppmonplugin.o: moc/moc_lppmonplugin.cpp
445 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_lppmonplugin.o moc/moc_lppmonplugin.cpp
397
446
398 ####### Install
447 ####### Install
399
448
400 install_target: first FORCE
449 install_target: first FORCE
401 @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/home/admin/.lppmon/plugins/ || $(MKDIR) $(INSTALL_ROOT)/home/admin/.lppmon/plugins/
450 @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/ || $(MKDIR) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/
402 -$(INSTALL_PROGRAM) "bin/$(TARGET)" "$(INSTALL_ROOT)/home/admin/.lppmon/plugins/$(TARGET)"
451 -$(INSTALL_PROGRAM) "bin/$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET)"
403 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/admin/.lppmon/plugins/$(TARGET0)"
452 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET0)"
404 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/admin/.lppmon/plugins/$(TARGET1)"
453 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET1)"
405 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/admin/.lppmon/plugins/$(TARGET2)"
454 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET2)"
406
455
407 uninstall_target: FORCE
456 uninstall_target: FORCE
408 -$(DEL_FILE) "$(INSTALL_ROOT)/home/admin/.lppmon/plugins/$(TARGET)"
457 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET)"
409 -$(DEL_FILE) "$(INSTALL_ROOT)/home/admin/.lppmon/plugins/$(TARGET0)"
458 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET0)"
410 -$(DEL_FILE) "$(INSTALL_ROOT)/home/admin/.lppmon/plugins/$(TARGET1)"
459 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET1)"
411 -$(DEL_FILE) "$(INSTALL_ROOT)/home/admin/.lppmon/plugins/$(TARGET2)"
460 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET2)"
412 -$(DEL_DIR) $(INSTALL_ROOT)/home/admin/.lppmon/plugins/
461 -$(DEL_DIR) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/
413
462
414
463
415 install: install_target FORCE
464 install: install_target FORCE
@@ -1,6 +1,15
1 #ifndef CCSDS_H
1 #ifndef CCSDS_H
2 #define CCSDS_H
2 #define CCSDS_H
3
3
4 #define CCSDS_MAX_PACKET_LENGTH 4412 // in bytes, specified in the LFR Software Requirements Specification
5
6 struct ccsdsPacketToProcess_str
7 {
8 unsigned int size;
9 unsigned char data[CCSDS_MAX_PACKET_LENGTH];
10 };
11 typedef ccsdsPacketToProcess_str ccsdsPacketToProcess_t;
12
4 struct ccsds_telecommand_source_packet_hdr_str
13 struct ccsds_telecommand_source_packet_hdr_str
5 {
14 {
6 unsigned char packetId1;
15 unsigned char packetId1;
@@ -16,12 +16,13 gresb::gresb(QWidget *parent) :
16 spwPacket = (char*) malloc( qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH) );
16 spwPacket = (char*) malloc( qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH) );
17
17
18 commandCode = invalid0; // initialization of the command code for the RMAP transfers
18 commandCode = invalid0; // initialization of the command code for the RMAP transfers
19 rmapTargetLogicalAddress = DEFAULT_TARGET;
20 rmapSourceLogicalAddress = DEFAULT_SOURCE;
19
21
20 //*** QLABEL ***//
22 //*** QLABEL ***//
21 gresbBridgeIPLabel = new QLabel(tr("GRESB Bridge IP: "));
23 gresbBridgeIPLabel = new QLabel(tr("GRESB Bridge IP: "));
22 gresbVirtualLinkLabel = new QLabel(tr("GRESB Virtual Link: "));
24 gresbVirtualLinkLabel = new QLabel(tr("GRESB Virtual Link: "));
23 spwLinkLabel = new QLabel(tr("GRESB SPW Link: "));
25 spwLinkLabel = new QLabel(tr("GRESB SPW Link: "));
24 rmapSourceLogicalAddressLabel = new QLabel(tr("RMAP Source Logical Address: "));
25 rmapSendStateLabel = new QLabel(tr("RMAP Send Socket State: waiting for connection"));
26 rmapSendStateLabel = new QLabel(tr("RMAP Send Socket State: waiting for connection"));
26 rmapReceiveStateLabel = new QLabel(tr("RMAP Receive Socket State: waiting for connection"));
27 rmapReceiveStateLabel = new QLabel(tr("RMAP Receive Socket State: waiting for connection"));
27 gresbStatusQueryLabel = new QLabel(tr("GRESB status query socket (port 3010): waiting for connection"));
28 gresbStatusQueryLabel = new QLabel(tr("GRESB status query socket (port 3010): waiting for connection"));
@@ -29,12 +30,9 gresb::gresb(QWidget *parent) :
29
30
30 //*** SPINBOX ***//
31 //*** SPINBOX ***//
31 gresbVirtualLinkSpinBox = new QSpinBox;
32 gresbVirtualLinkSpinBox = new QSpinBox;
32 rmapSourceLogicalAddressSpinBox = new QSpinBox;
33 spwLinkSpinBox = new QSpinBox;;
33 spwLinkSpinBox = new QSpinBox;;
34 gresbVirtualLinkSpinBox->setRange(0, 4);
34 gresbVirtualLinkSpinBox->setRange(0, 4);
35 gresbVirtualLinkSpinBox->setValue(1);
35 gresbVirtualLinkSpinBox->setValue(1);
36 rmapSourceLogicalAddressSpinBox->setRange(0, 255);
37 rmapSourceLogicalAddressSpinBox->setValue(33);
38 spwLinkSpinBox->setRange(0, 2);
36 spwLinkSpinBox->setRange(0, 2);
39 spwLinkSpinBox->setValue(0);
37 spwLinkSpinBox->setValue(0);
40
38
@@ -56,13 +54,11 gresb::gresb(QWidget *parent) :
56 connectionLayout->addWidget(gresbVirtualLinkSpinBox, 1, 1, 0);
54 connectionLayout->addWidget(gresbVirtualLinkSpinBox, 1, 1, 0);
57 connectionLayout->addWidget(spwLinkLabel, 2, 0, 0);
55 connectionLayout->addWidget(spwLinkLabel, 2, 0, 0);
58 connectionLayout->addWidget(spwLinkSpinBox, 2, 1, 0);
56 connectionLayout->addWidget(spwLinkSpinBox, 2, 1, 0);
59 connectionLayout->addWidget(rmapSourceLogicalAddressLabel, 3, 0, 0);
57 connectionLayout->addWidget(rmapSendStateLabel, 3, 0, 1, 2);
60 connectionLayout->addWidget(rmapSourceLogicalAddressSpinBox, 3, 1, 0);
58 connectionLayout->addWidget(rmapReceiveStateLabel, 4, 0, 1, 2);
61 connectionLayout->addWidget(rmapSendStateLabel, 4, 0, 1, 2);
59 connectionLayout->addWidget(gresbStatusQueryLabel, 5, 0, 1, 2);
62 connectionLayout->addWidget(rmapReceiveStateLabel, 5, 0, 1, 2);
63 connectionLayout->addWidget(gresbStatusQueryLabel, 6, 0, 1, 2);
64
60
65 connectionLayout->setRowStretch(7, 1);
61 connectionLayout->setRowStretch(6, 1);
66 connectionLayout->setColumnStretch(2, 1);
62 connectionLayout->setColumnStretch(2, 1);
67
63
68 // GRESB STATUS QUERY DIALOG
64 // GRESB STATUS QUERY DIALOG
@@ -80,7 +76,7 gresb::gresb(QWidget *parent) :
80 connect(gresbStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink()));
76 connect(gresbStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink()));
81 connect(gresbStatusQueryAbortButton, SIGNAL(clicked()), gresbStatusQueryDialog, SLOT(reject()));
77 connect(gresbStatusQueryAbortButton, SIGNAL(clicked()), gresbStatusQueryDialog, SLOT(reject()));
82 connect(spwLinkStatusEnquiry->readSPWStatusButton, SIGNAL(clicked()), this, SLOT(GRESBStatusQuery()));
78 connect(spwLinkStatusEnquiry->readSPWStatusButton, SIGNAL(clicked()), this, SLOT(GRESBStatusQuery()));
83 connect(this->RMAPReceive_SOCKET, SIGNAL(readyRead()), this, SLOT(receiveSPWPacket()));
79 connect(this->RMAPReceive_SOCKET, SIGNAL(readyRead()), this, SLOT(receiveSPWPacketLoop()));
84 }
80 }
85
81
86 gresb::~gresb()
82 gresb::~gresb()
@@ -238,7 +234,7 unsigned int gresb::WriteBLOCK(char *dat
238
234
239 RMAPCommand = new RMAP(commandCode,
235 RMAPCommand = new RMAP(commandCode,
240 rmapTargetLogicalAddress,
236 rmapTargetLogicalAddress,
241 rmapSourceLogicalAddressSpinBox->value(),
237 rmapSourceLogicalAddress,
242 address,
238 address,
243 nbBytes,
239 nbBytes,
244 data);
240 data);
@@ -353,7 +349,7 unsigned int gresb::ReadBLOCK(unsigned i
353 {
349 {
354 RMAPCommand = new RMAP(read_Inc,
350 RMAPCommand = new RMAP(read_Inc,
355 rmapTargetLogicalAddress,
351 rmapTargetLogicalAddress,
356 rmapSourceLogicalAddressSpinBox->value(),
352 rmapSourceLogicalAddress,
357 address,
353 address,
358 nbBytes,
354 nbBytes,
359 NULL);
355 NULL);
@@ -362,7 +358,7 unsigned int gresb::ReadBLOCK(unsigned i
362 {
358 {
363 RMAPCommand = new RMAP(read_Single,
359 RMAPCommand = new RMAP(read_Single,
364 rmapTargetLogicalAddress,
360 rmapTargetLogicalAddress,
365 rmapSourceLogicalAddressSpinBox->value(),
361 rmapSourceLogicalAddress,
366 address,
362 address,
367 nbBytes,
363 nbBytes,
368 NULL);
364 NULL);
@@ -458,6 +454,20 unsigned int gresb::WriteSPW(char *Value
458 return count;
454 return count;
459 }
455 }
460
456
457 int gresb::receiveSPWPacketLoop(unsigned char requestID)
458 {
459 int result = 0;
460 while (RMAPReceive_SOCKET->bytesAvailable())
461 {
462 result = receiveSPWPacket(requestID);
463 }
464 if (!ccsdsPacketStore.isEmpty())
465 {
466 emit packetStoreNotEmpty();
467 }
468 return result;
469 }
470
461 int gresb::receiveSPWPacket(unsigned char requestID) // SLOT
471 int gresb::receiveSPWPacket(unsigned char requestID) // SLOT
462 {
472 {
463 QTime spwPacketReceiverTimeout;
473 QTime spwPacketReceiverTimeout;
@@ -508,31 +518,42 int gresb::receiveSPWPacket(unsigned cha
508 return packetLength;
518 return packetLength;
509
519
510 case 2: // 0x02 is the protocole identifier for CCSDS packets
520 case 2: // 0x02 is the protocole identifier for CCSDS packets
511 if (ccsdsPacketSEMAPHORE->available()!=0) return -4; // ERROR === previous CCSDS packet not processed yet
521 /*if (ccsdsPacketSEMAPHORE->available()!=0)
522 {
523 emit sendMessage("in function [receiveSPWPacket] === ERROR === previous CCSDS packet not processed yet");
524 return -4; // ERROR === previous CCSDS packet not processed yet
525 }*/
512 for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i];
526 for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i];
513 ccsdsPacketSize = packetLength;
527 ccsdsPacketSize = packetLength;
514 ccsdsPacketSEMAPHORE->release();
528 storeCCSDSPacket(ccsdsPacket, packetLength);
515 emit(ccsdsPacketAvailable(ccsdsPacket, packetLength));
516 //emit sendMessage("CCSDS packet of size " + QString::number(packetLength) + " received");
517 return packetLength;
529 return packetLength;
518 }
530 }
519 return 0;
531 return 0;
520 }
532 }
521
533
534 unsigned int gresb::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
535 {
536 TMPacketToRead *packet;
537
538 packet = new TMPacketToRead(ccsdsPacket, size);
539 ccsdsPacketStore.append(packet);
540
541 return 1;
542 }
543
522 void gresb::Open() // SLOT
544 void gresb::Open() // SLOT
523 {
545 {
524 bool spwRunning = true;
546 bool spwRunning = true;
525 RMAPSend_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getGRESBIP()),
547 RMAPSend_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()),
526 3000 + gresbVirtualLinkSpinBox->value()*2,
548 3000 + gresbVirtualLinkSpinBox->value()*2,
527 QIODevice::WriteOnly);
549 QIODevice::WriteOnly);
528 RMAPReceive_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getGRESBIP()),
550 RMAPReceive_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()),
529 3000 + gresbVirtualLinkSpinBox->value()*2+1,
551 3000 + gresbVirtualLinkSpinBox->value()*2+1,
530 QIODevice::ReadOnly);
552 QIODevice::ReadOnly);
531 GRESBStatusQuery_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getGRESBIP()),
553 GRESBStatusQuery_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()),
532 3010,
554 3010,
533 QIODevice::ReadWrite);
555 QIODevice::ReadWrite);
534 GRESBStatusQuery_SOCKET->waitForConnected(10000);
556 GRESBStatusQuery_SOCKET->waitForConnected(10000);
535 RMAPReceive_SOCKET->readAll(); // read all remaining data from the reception socket
536 // initialize SPW packet semaphores
557 // initialize SPW packet semaphores
537 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
558 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
538 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
559 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
@@ -543,7 +564,8 void gresb::Open() // SLOT
543 if (spwRunning == false) this->Close();
564 if (spwRunning == false) this->Close();
544 else
565 else
545 {
566 {
546 emit appendToLog(QString("SpaceWire running on virtual link ")+ QString::number(spwLinkSpinBox->value()));
567 emit appendToLog(QString("SpaceWire running on link ")+ QString::number(spwLinkSpinBox->value()));
568 RMAPReceive_SOCKET->readAll(); // read all remaining data from the reception socket
547 emit isOpen(true);
569 emit isOpen(true);
548 }
570 }
549 }
571 }
@@ -764,3 +786,4 void gresb::GRESBConnectionState(QAbstra
764 }
786 }
765 gresbStatusQueryLabel->setText(socketMessage);
787 gresbStatusQueryLabel->setText(socketMessage);
766 }
788 }
789
@@ -13,6 +13,8
13 #include "gresbstatusenquiry.h"
13 #include "gresbstatusenquiry.h"
14 #include "rmapoperations.h"
14 #include "rmapoperations.h"
15 #include "qipdialogbox.h"
15 #include "qipdialogbox.h"
16 #include "ccsds.h"
17 #include "tmpackettoread.h"
16
18
17 class gresb : public QWidget
19 class gresb : public QWidget
18 {
20 {
@@ -24,25 +26,34 public:
24 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
26 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
25 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
27 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
26
28
29 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
30 QList<TMPacketToRead*> ccsdsPacketStore;
31
27 signals:
32 signals:
28 void sendMessage(QString message);
33 void sendMessage(QString message);
29 void isOpen(bool);
34 void isOpen(bool);
30 void RMAP_write_reply_setText(QString);
35 void RMAP_write_reply_setText(QString);
31 void appendToLog(QString);
36 void appendToLog(QString);
32 void ccsdsPacketAvailable(unsigned char*, unsigned int);
37 void ccsdsPacketAvailable(unsigned char*, unsigned int);
38 void packetStoreNotEmpty();
33
39
34 public slots:
40 public slots:
35 void Open();
41 void Open();
36 void Close();
42 void Close();
43 int receiveSPWPacketLoop(unsigned char requestID=0);
37 int receiveSPWPacket(unsigned char requestID=0);
44 int receiveSPWPacket(unsigned char requestID=0);
38 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
45 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
39 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
46 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
47 void sourceHasChanged(int source) {rmapSourceLogicalAddress = (unsigned char) source;}
40 void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();}
48 void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();}
41 void reTestSPWLink();
49 void reTestSPWLink();
42 //
50 //
43 void RMAPSendConnectionState(QAbstractSocket::SocketState socketState);
51 void RMAPSendConnectionState(QAbstractSocket::SocketState socketState);
44 void RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState);
52 void RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState);
45 void GRESBConnectionState(QAbstractSocket::SocketState socketState);
53 void GRESBConnectionState(QAbstractSocket::SocketState socketState);
54 //
55 void setIP(unsigned char address1, unsigned char address2, unsigned char address3, unsigned char address4)
56 {this->gresbBridgeIPDialogBox->setIP(address1, address2, address3, address4);}
46
57
47 private slots:
58 private slots:
48 int GRESBStatusQuery();
59 int GRESBStatusQuery();
@@ -65,7 +76,6 private:
65 QLabel *gresbBridgeIPLabel;
76 QLabel *gresbBridgeIPLabel;
66 QLabel *gresbVirtualLinkLabel;
77 QLabel *gresbVirtualLinkLabel;
67 QLabel *spwLinkLabel;
78 QLabel *spwLinkLabel;
68 QLabel *rmapSourceLogicalAddressLabel;
69 QLabel *rmapSendStateLabel;
79 QLabel *rmapSendStateLabel;
70 QLabel *rmapReceiveStateLabel;
80 QLabel *rmapReceiveStateLabel;
71 QLabel *gresbStatusQueryLabel;
81 QLabel *gresbStatusQueryLabel;
@@ -77,7 +87,6 private:
77
87
78 QSpinBox *gresbVirtualLinkSpinBox;
88 QSpinBox *gresbVirtualLinkSpinBox;
79 QSpinBox *spwLinkSpinBox;
89 QSpinBox *spwLinkSpinBox;
80 QSpinBox *rmapSourceLogicalAddressSpinBox;
81
90
82 QGridLayout *connectionLayout;
91 QGridLayout *connectionLayout;
83 QGridLayout *gresbStatusQueryDialogLayout;
92 QGridLayout *gresbStatusQueryDialogLayout;
@@ -1,6 +1,7
1 #include "rmapoperations.h"
1 #include "rmapoperations.h"
2
2
3 RMAP::RMAP(RMAP_command_codes commandCode, char targetLogicalAddress, char initiatorLogicalAddress, int startAddress, int nbBytes, char* data)
3 RMAP::RMAP(RMAP_command_codes commandCode, unsigned char targetLogicalAddress, unsigned char initiatorLogicalAddress,
4 int startAddress, int nbBytes, char* data)
4 {
5 {
5 char packetType; // 2 most Significant Bits
6 char packetType; // 2 most Significant Bits
6 char command; // 4 bits
7 char command; // 4 bits
@@ -39,7 +40,7 RMAP::RMAP(RMAP_command_codes commandCod
39 RMAPHeader.targetLogicalAddress = targetLogicalAddress ;
40 RMAPHeader.targetLogicalAddress = targetLogicalAddress ;
40 RMAPHeader.protocolIdentifier = 0x01; // 0x01 is the protocole identifier for RMAP
41 RMAPHeader.protocolIdentifier = 0x01; // 0x01 is the protocole identifier for RMAP
41 RMAPHeader.instruction = (packetType<<6) + (command<<2) + (replyAddressLength);
42 RMAPHeader.instruction = (packetType<<6) + (command<<2) + (replyAddressLength);
42 RMAPHeader.key = 0; // used for command authorization
43 RMAPHeader.key = initiatorLogicalAddress; // used for command authorization
43 RMAPHeader.initiatorLogicalAddress = initiatorLogicalAddress; // 0 is the default address for the GRESB module
44 RMAPHeader.initiatorLogicalAddress = initiatorLogicalAddress; // 0 is the default address for the GRESB module
44 RMAPHeader.transactionIdentifier1 = 0x00;
45 RMAPHeader.transactionIdentifier1 = 0x00;
45 RMAPHeader.transactionIdentifier0 = 0x01;
46 RMAPHeader.transactionIdentifier0 = 0x01;
@@ -9,7 +9,9
9 #define RMAP_READ_COMMAND_HEADER_LENGTH 16 // in bytes => ECSS
9 #define RMAP_READ_COMMAND_HEADER_LENGTH 16 // in bytes => ECSS
10 #define RMAP_DATA_CRC_LENGTH 1 // in bytes => ECSS
10 #define RMAP_DATA_CRC_LENGTH 1 // in bytes => ECSS
11 #define RMAP_MAX_PACKET_LENGTH RMAP_READ_REPLY_HEADER_LENGTH + RMAP_MAX_DATA_LENGTH + RMAP_DATA_CRC_LENGTH
11 #define RMAP_MAX_PACKET_LENGTH RMAP_READ_REPLY_HEADER_LENGTH + RMAP_MAX_DATA_LENGTH + RMAP_DATA_CRC_LENGTH
12 #define CCSDS_MAX_PACKET_LENGTH 4412 // in bytes, specified in the LFR Software Requirements Specification
12
13 #define DEFAULT_SOURCE 0
14 #define DEFAULT_TARGET 254
13
15
14 static const unsigned char RMAP_CRCTable[] = {
16 static const unsigned char RMAP_CRCTable[] = {
15 0x00, 0x91, 0xe3, 0x72, 0x07, 0x96, 0xe4, 0x75,
17 0x00, 0x91, 0xe3, 0x72, 0x07, 0x96, 0xe4, 0x75,
@@ -71,9 +73,9 struct rmap_command_format_str
71 char targetLogicalAddress;
73 char targetLogicalAddress;
72 char protocolIdentifier;
74 char protocolIdentifier;
73 char instruction;
75 char instruction;
74 char key; // used for command authorization => check Gaisler GRSPW for compliance
76 unsigned char key; // used for command authorization => check Gaisler GRSPW for compliance
75 //char replyAddress[]; // not needed if logical addressing is used (replyAddressLength = 0b00)
77 //char replyAddress[]; // not needed if logical addressing is used (replyAddressLength = 0b00)
76 char initiatorLogicalAddress;
78 unsigned char initiatorLogicalAddress;
77 char transactionIdentifier1;
79 char transactionIdentifier1;
78 char transactionIdentifier0;
80 char transactionIdentifier0;
79 char extendedAddress;
81 char extendedAddress;
@@ -132,8 +134,8 class RMAP
132 {
134 {
133 public:
135 public:
134 RMAP(RMAP_command_codes commandCode,
136 RMAP(RMAP_command_codes commandCode,
135 char targetLogicalAddress,
137 unsigned char targetLogicalAddress,
136 char initiatorLogicalAddress,
138 unsigned char initiatorLogicalAddress,
137 int startAddress,
139 int startAddress,
138 int nbBytes,
140 int nbBytes,
139 char *data);
141 char *data);
@@ -24,6 +24,8
24 #include <QIODevice>
24 #include <QIODevice>
25 #include <QApplication>
25 #include <QApplication>
26 #include <rmappluginpythonwrapper.h>
26 #include <rmappluginpythonwrapper.h>
27 #include <PythonQt.h>
28 #include <QTimer>
27
29
28 rmapplugin::rmapplugin(QWidget *parent)
30 rmapplugin::rmapplugin(QWidget *parent)
29 :lppmonplugin(parent,false)
31 :lppmonplugin(parent,false)
@@ -37,11 +39,38 rmapplugin::rmapplugin(QWidget *parent)
37 time_FINE = 0;
39 time_FINE = 0;
38 currentBridge = selectedBridgeIsUnknown;
40 currentBridge = selectedBridgeIsUnknown;
39
41
40 /*Python wrapper*/
42 //**************
43 //Python wrapper
41 this->pyObject = new rmappluginPythonWrapper();
44 this->pyObject = new rmappluginPythonWrapper();
42 connect(this->pyObject,SIGNAL(ReadSig(uint*,uint,uint)),this,SLOT(Read(uint*,uint,uint)));
45 connect(this->pyObject,SIGNAL(ReadSig(uint*,uint,uint)),this,SLOT(Read(uint*,uint,uint)));
43 connect(this->pyObject,SIGNAL(WriteSig(uint*,uint,uint)),this,SLOT(Write(uint*,uint,uint)));
46 connect(this->pyObject,SIGNAL(WriteSig(uint*,uint,uint)),this,SLOT(Write(uint*,uint,uint)));
44 /*==============*/
47 //**
48 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL( WriteSPWSig(char*,uint,char,char) ),
49 this, SLOT( WriteSPW(char*,uint,char,char)), Qt::DirectConnection );
50 //**
51 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL( updateTargetAddress(unsigned char) ),
52 this, SLOT( setValueTargetAddress(unsigned char)) );
53 //**
54 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL( updateSourceAddress(unsigned char) ),
55 this, SLOT( setValueSourceAddress(unsigned char)) );
56 //**
57 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sendMessage(QString)),
58 this, SLOT(displayOnConsole(QString)) );
59 //**
60 connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(fetchPacketSig()),
61 this, SLOT(fetchPacket()), Qt::DirectConnection );
62 //**************
63
64 //**************
65 // get a smart pointer to the __main__ module of the Python interpreter
66 PythonQtObjectPtr context = PythonQt::self()->getMainModule();
67 // add a QObject as variable of name "BUTTON_rmapOpenCommunication" to the namespace of the __main__ module
68 context.addObject("BUTTON_rmapOpenCommunication", UI->rmapOpenCommunicationButton);
69 context.addObject("BUTTON_rmapCloseCommunication", UI->rmapCloseCommunicationButton);
70 context.addObject("BUTTON_selectStarDundee", UI->selectStarDundee_BUTTON);
71 context.addObject("BUTTON_selectGRESB", UI->selectGRESB_BUTTON);
72 context.addObject("GRESB_Bridge", UI->gresbBridge);
73 //**************
45
74
46 connect(UI->rmapOpenCommunicationButton, SIGNAL(clicked()), this, SLOT(openBridge()));
75 connect(UI->rmapOpenCommunicationButton, SIGNAL(clicked()), this, SLOT(openBridge()));
47 connect(UI->rmapCloseCommunicationButton, SIGNAL(clicked()), this, SLOT(closeBridge()));
76 connect(UI->rmapCloseCommunicationButton, SIGNAL(clicked()), this, SLOT(closeBridge()));
@@ -64,6 +93,12 rmapplugin::rmapplugin(QWidget *parent)
64 connect(this->UI->gresbBridge, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)),
93 connect(this->UI->gresbBridge, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)),
65 this, SLOT(processCCSDSPacket(unsigned char*,uint)));
94 this, SLOT(processCCSDSPacket(unsigned char*,uint)));
66 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->gresbBridge, SLOT(ccsdsPacketIsProcessed()));
95 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->gresbBridge, SLOT(ccsdsPacketIsProcessed()));
96 connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
97 this->UI->gresbBridge, SLOT(targetHasChanged(int)));
98 connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
99 this->UI->gresbBridge, SLOT(sourceHasChanged(int)));
100 connect(this->UI->gresbBridge, SIGNAL(packetStoreNotEmpty()),
101 this, SLOT(processPacketStore()));
67
102
68 // Star Dundee
103 // Star Dundee
69 connect(this->UI->starDundee, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
104 connect(this->UI->starDundee, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
@@ -73,15 +108,32 rmapplugin::rmapplugin(QWidget *parent)
73 connect(this->UI->starDundee, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)),
108 connect(this->UI->starDundee, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)),
74 this, SLOT(processCCSDSPacket(unsigned char*,uint)));
109 this, SLOT(processCCSDSPacket(unsigned char*,uint)));
75 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->starDundee, SLOT(ccsdsPacketIsProcessed()));
110 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->starDundee, SLOT(ccsdsPacketIsProcessed()));
111 connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
112 this->UI->starDundee, SLOT(targetHasChanged(int)));
113 connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
114 this->UI->starDundee, SLOT(sourceHasChanged(int)));
115 connect(this->UI->starDundee, SIGNAL(packetStoreNotEmpty()),
116 this, SLOT(processPacketStore()));
76
117
77 connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(bridgeHasChanged(selectedBridge)));
118 connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(bridgeHasChanged(selectedBridge)));
119 connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(updatePacketStore(selectedBridge)));
120
78 }
121 }
79
122
80 rmapplugin::~rmapplugin()
123 rmapplugin::~rmapplugin()
81 {
124 {
82 if (!RMAPSend_SOCKET->isOpen()) RMAPSend_SOCKET->disconnectFromHost();
125 switch(currentBridge)
83 if (!RMAPReceive_SOCKET->isOpen()) RMAPReceive_SOCKET->disconnectFromHost();
126 {
84 if (!GRESBStatusQuery_SOCKET->isOpen()) GRESBStatusQuery_SOCKET->disconnectFromHost();
127 case selectedBridgeIsGRESB :
128 if (RMAPSend_SOCKET->isOpen()) RMAPSend_SOCKET->disconnectFromHost();
129 if (RMAPReceive_SOCKET->isOpen()) RMAPReceive_SOCKET->disconnectFromHost();
130 if (GRESBStatusQuery_SOCKET->isOpen()) GRESBStatusQuery_SOCKET->disconnectFromHost();
131 break;
132 case selectedBridgeIsStarDundee :
133 break;
134 default:
135 break;
136 }
85 }
137 }
86
138
87 unsigned int rmapplugin::Write(unsigned int *Value, unsigned int count, unsigned int address)
139 unsigned int rmapplugin::Write(unsigned int *Value, unsigned int count, unsigned int address)
@@ -279,6 +331,16 void rmapplugin::appendToLog(QString tex
279 APPENDTOLOG(text);
331 APPENDTOLOG(text);
280 }
332 }
281
333
334 void rmapplugin::setValueTargetAddress(unsigned char newAddress)
335 {
336 this->UI->rmapTargetLogicalAddressSpinBox->setValue(newAddress);
337 }
338
339 void rmapplugin::setValueSourceAddress(unsigned char newAddress)
340 {
341 this->UI->rmapSourceLogicalAddressSpinBox->setValue(newAddress);
342 }
343
282 /////////////////////
344 /////////////////////
283 // INTERNAL FUNCTIONS
345 // INTERNAL FUNCTIONS
284
346
@@ -311,6 +373,44 void rmapplugin::processCCSDSPacket(unsi
311 //+" "
373 //+" "
312 //+ QString::number(ccsdsPacket[7], 16));
374 //+ QString::number(ccsdsPacket[7], 16));
313 displayOnConsole(message);
375 displayOnConsole(message);
376 //((rmappluginPythonWrapper*)this->pyObject)->storeCCSDSPacket(ccsdsPacket, size);
314 emit ccsdsPacketIsProcessed();
377 emit ccsdsPacketIsProcessed();
315 }
378 }
316
379
380 void rmapplugin::processPacketStore()
381 {
382 ((rmappluginPythonWrapper*)this->pyObject)->processPacketStore();
383 }
384
385 void rmapplugin::updatePacketStore(selectedBridge bridge)
386 {
387 switch(bridge)
388 {
389 case selectedBridgeIsGRESB :
390 ((rmappluginPythonWrapper*)this->pyObject)->ccsdsPacketStore = &(this->UI->gresbBridge->ccsdsPacketStore);
391 break;
392 case selectedBridgeIsStarDundee :
393 ((rmappluginPythonWrapper*)this->pyObject)->ccsdsPacketStore = &(this->UI->starDundee->ccsdsPacketStore);
394 break;
395 default:
396 break;
397 }
398 }
399
400 int rmapplugin::fetchPacket()
401 {
402 int ret = 0;
403
404 switch(currentBridge)
405 {
406 case selectedBridgeIsGRESB :
407 break;
408 case selectedBridgeIsStarDundee :
409 ret = this->UI->starDundee->receiveSPWPacketLoop();
410 break;
411 default:
412 break;
413 }
414
415 return ret;
416 }
@@ -54,9 +54,14 public slots:
54 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
54 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
55 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
55 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
56 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
56 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
57 void setValueTargetAddress(unsigned char newAddress);
58 void setValueSourceAddress(unsigned char newAddress);
57 void openBridge();
59 void openBridge();
58 void closeBridge();
60 void closeBridge();
59 void processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
61 void processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
62 void processPacketStore();
63 void updatePacketStore(selectedBridge bridge);
64 int fetchPacket();
60 //
65 //
61 void sendCCSDS();
66 void sendCCSDS();
62 void send_TC_LFR_UPDATE_TIME();
67 void send_TC_LFR_UPDATE_TIME();
@@ -20,8 +20,8 DEFINES += driver_PID=0
20
20
21 QT += network
21 QT += network
22
22
23 LIBS += ../spw_usb_driver_v2.61/lib/x86_64/libSpaceWireUSBAPI.so \
23 LIBS += ../spw_usb_driver_v2.62/lib/x86_64/libSpaceWireUSBAPI.so \
24 ../spw_usb_driver_v2.61/lib/x86_64/libConfigLibraryUSB.so
24 ../spw_usb_driver_v2.62/lib/x86_64/libConfigLibraryUSB.so
25
25
26
26
27 INCLUDEPATH += \
27 INCLUDEPATH += \
@@ -43,7 +43,8 HEADERS += \
43 ../spw_usb_driver_v2.61/inc/spw_usb_api.h \
43 ../spw_usb_driver_v2.61/inc/spw_usb_api.h \
44 ../spw_usb_driver_v2.61/inc/spw_config_library.h \
44 ../spw_usb_driver_v2.61/inc/spw_config_library.h \
45 gresb.h \
45 gresb.h \
46 bridge.h
46 tcpackettosend.h \
47 tmpackettoread.h
47
48
48
49
49 SOURCES += \
50 SOURCES += \
@@ -57,7 +58,8 SOURCES += \
57 rmappluginpythonwrapper.cpp \
58 rmappluginpythonwrapper.cpp \
58 stardundee.cpp \
59 stardundee.cpp \
59 gresb.cpp \
60 gresb.cpp \
60 bridge.cpp
61 tcpackettosend.cpp \
62 tmpackettoread.cpp
61
63
62
64
63
65
@@ -1,19 +1,165
1 #include "rmappluginpythonwrapper.h"
1 #include "rmappluginpythonwrapper.h"
2 #include <math.h>
2 #include <math.h>
3 #include <QApplication>
3
4
4 rmappluginPythonWrapper::rmappluginPythonWrapper(QObject *parent) :
5 rmappluginPythonWrapper::rmappluginPythonWrapper(QObject *parent) :
5 genericPySysdriver(parent)
6 genericPySysdriver(parent)
6 {
7 {
8 timer = new QTimer;
9 timer->setSingleShot(true);
10 connect(timer, SIGNAL(timeout()), this, SLOT(sendTC()));
11 connect(this, SIGNAL(activateTCLoopSig()), this, SLOT(sendTCLoop()));
12 }
13
14 QList<QVariant> rmappluginPythonWrapper::ReadSPW(unsigned int size) // size is not used
15 {
16 QList<QVariant> result;
17 TMPacketToRead *ccsdsPacket;
18
19 if (!ccsdsPacketStore->isEmpty())
20 {
21 ccsdsPacket = ccsdsPacketStore->takeFirst();
22 for(unsigned int i = 0;i<ccsdsPacket->size;i++)
23 {
24 result.append((QVariant)ccsdsPacket->Value[i]);
25 }
26 delete(ccsdsPacket);
27 }
28
29 return result;
30 }
31
32 void rmappluginPythonWrapper::WriteSPW(QList<int> dataList)
33 {
34 char targetLogicalAddress;
35 char userApplication;
36 unsigned int count;
37 char *Value;
38
39 unsigned char data[dataList.count()];
40
41 for(int i = 0; i<dataList.count(); i++) // get the data as unsigned char
42 {
43 data[i] = (unsigned char)dataList.at(i);
44 }
45 // read the first bytes of the data to get the targetLogicalAddress and the userApplication parameters
46 targetLogicalAddress = data[0];
47 userApplication = data[3];
48
49 count = dataList.count() - 4; // the CCSDS header (4 bytes) is added by LPPMON
50 Value = (char*) &data[4];
51
52 emit WriteSPWSig(Value, count, targetLogicalAddress, userApplication);
53 }
54
55 void rmappluginPythonWrapper::WriteSPWDelay(QList<int> dataList, unsigned int delay)
56 {
57 char targetLogicalAddress;
58 char userApplication;
59 unsigned int count;
60 char *Value;
61 TCPacketToSend *packet;
62
63 unsigned char data[dataList.count()];
64
65 for(int i = 0; i<dataList.count(); i++) // get the data as unsigned char
66 {
67 data[i] = (unsigned char)dataList.at(i);
68 }
69 // read the first bytes of the data to get the targetLogicalAddress and the userApplication parameters
70 targetLogicalAddress = data[0];
71 userApplication = data[3];
72
73 count = dataList.count() - 4; // the CCSDS header (4 bytes) is added by LPPMON
74 Value = (char*) &data[4];
75
76 packet = new TCPacketToSend(Value, count, targetLogicalAddress, userApplication, delay);
77 TCPacketStore.append(packet);
78
79 emit(activateTCLoopSig());
80
7 }
81 }
8
82
83 void rmappluginPythonWrapper::processPacketStoreLater(unsigned int delay)
84 {
85 emit sendMessage(
86 "*** process packet store in " + QString::number(delay) + " ms"
87 );
88 QTimer::singleShot(delay, this, SLOT(sendProcessPacketStoreNowSig()));
89 }
9
90
10 QList<QVariant> rmappluginPythonWrapper::getData()
91 void rmappluginPythonWrapper::sendTCLoop()
92 {
93 unsigned int delay;
94
95 if (!timer->isActive())
96 {
97 if (!TCPacketStore.isEmpty())
11 {
98 {
12 QList<QVariant> data;
99 delay = TCPacketStore.at(0)->delay;
13 for (int i = 0; i<1024; i++)
100 timer->setInterval(delay);
101 timer->start();
102 }
103 }
104 }
105
106 void rmappluginPythonWrapper::sendTC()
107 {
108 TCPacketToSend *packet;
109 unsigned int delay;
110
111 packet = TCPacketStore.takeFirst();
112 // the signal is connected with the option Qt::DirectConnection, thus it is processed immediately
113 emit(WriteSPWSig(packet->Value, packet->count,packet->targetLogicalAddress, packet->userApplication));
114 delete(packet);
115 if (!TCPacketStore.isEmpty())
116 {
117 delay = TCPacketStore.at(0)->delay;
118 timer->setInterval(delay);
119 timer->start();
120 }
121 }
122
123 /*unsigned int rmappluginPythonWrapper::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
14 {
124 {
15 QVariant t(1000*cos(0.1*i));
125 unsigned int i;
16 data.append(t);
126 TMPacketToRead ccsdsPacketToStore;
127
128 ccsdsPacketToStore.size = size;
129 for(i=0; i<size; i++)
130 {
131 //ccsdsPacket0[i] = ccsdsPacket[i];
132 ccsdsPacketToStore.data[i] = ccsdsPacket[i];
133 }
134 ccsdsPacketStore->append(ccsdsPacketToStore);
135 emit ccsdsPacketIsAvailable(size);
136 return 1;
137 }*/
138
139 void rmappluginPythonWrapper::processPacketStore()
140 {
141 while (!ccsdsPacketStore->isEmpty())
142 {
143 emit ccsdsPacketIsAvailable(ccsdsPacketStore->at(0)->size);
144 }
17 }
145 }
18 return data;
146
147 void rmappluginPythonWrapper::setTargetAddressValue(unsigned int address)
148 {
149 unsigned char newAddress;
150 newAddress = (unsigned char) address;
151 emit updateTargetAddress(newAddress);
19 }
152 }
153
154 void rmappluginPythonWrapper::setSourceAddressValue(unsigned int address)
155 {
156 unsigned char newAddress;
157 newAddress = (unsigned char) address;
158 emit updateSourceAddress(newAddress);
159 }
160
161 void rmappluginPythonWrapper::ProcessPendingEvents()
162 {
163 QCoreApplication::processEvents();
164 }
165
@@ -5,6 +5,11
5 #include <genericPySysdriver.h>
5 #include <genericPySysdriver.h>
6 #include <QList>
6 #include <QList>
7 #include <QVariant>
7 #include <QVariant>
8 #include "rmapoperations.h"
9 #include "ccsds.h"
10 #include <tcpackettosend.h>
11 #include <tmpackettoread.h>
12 #include <QTimer>
8
13
9 class rmappluginPythonWrapper : public genericPySysdriver
14 class rmappluginPythonWrapper : public genericPySysdriver
10 {
15 {
@@ -12,10 +17,40 class rmappluginPythonWrapper : public g
12 public:
17 public:
13 explicit rmappluginPythonWrapper(QObject *parent = 0);
18 explicit rmappluginPythonWrapper(QObject *parent = 0);
14
19
20 QList<TMPacketToRead*> *ccsdsPacketStore;
21 void processPacketStore();
22 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
23
24 QList<TCPacketToSend*> TCPacketStore;
25 QTimer *timer;
26
15 signals:
27 signals:
28 void ccsdsPacketIsAvailable(unsigned int size);
29 void wakeUpCallingThread();
30 unsigned int WriteSPWSig(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
31 void updateTargetAddress(unsigned char newAddress);
32 void updateSourceAddress(unsigned char newAddress);
33 void activateTCLoopSig();
34 void processPacketStoreNowSig();
35 void sendMessage(QString message);
36 int fetchPacketSig();
16
37
17 public slots:
38 public slots:
18 QList<QVariant> getData();
39 QList<QVariant> ReadSPW(unsigned int size=0);
40 int fetchPacket() {return emit fetchPacketSig();}
41 void WriteSPW(QList<int> dataList);
42 void WriteSPWDelay(QList<int> dataList, unsigned int delay=0);
43 void processPacketStoreLater(unsigned int delay);
44 void sendProcessPacketStoreNowSig(){emit processPacketStoreNowSig();}
45 void sendTCLoop();
46 void sendTC();
47 void reEmitWriteSPWSig(char *Value, unsigned int count, char targetLogicalAddress, char userApplication)
48 {emit WriteSPWSig(Value, count, targetLogicalAddress, userApplication);}
49
50 void setTargetAddressValue(unsigned int address);
51 void setSourceAddressValue(unsigned int address);
52 void ProcessPendingEvents();
53 void BlockAllSignals();
19
54
20 };
55 };
21
56
@@ -55,6 +55,7 rmapPluginUI::rmapPluginUI(QWidget *pare
55 gresbStatusQueryLabel = new QLabel(tr("Status query socket (port 3010): waiting for connection"));
55 gresbStatusQueryLabel = new QLabel(tr("Status query socket (port 3010): waiting for connection"));
56 gresbStatusQueryDialogLabel = new QLabel(tr("sockets opened but SpaceWire link not running"));
56 gresbStatusQueryDialogLabel = new QLabel(tr("sockets opened but SpaceWire link not running"));
57 sendCCSDSCommandLabel = new QLabel(tr("Address of the target"));
57 sendCCSDSCommandLabel = new QLabel(tr("Address of the target"));
58 nbPacketInStore = new QLabel(tr("nb packets in store: -"));
58
59
59 //*** QPUSHBUTTON ***//
60 //*** QPUSHBUTTON ***//
60 rmapOpenCommunicationButton = new QPushButton(tr("Open selected bridge"));
61 rmapOpenCommunicationButton = new QPushButton(tr("Open selected bridge"));
@@ -81,18 +82,18 rmapPluginUI::rmapPluginUI(QWidget *pare
81 gresbVirtualLinkSpinBox->setRange(0, 4);
82 gresbVirtualLinkSpinBox->setRange(0, 4);
82 gresbVirtualLinkSpinBox->setValue(1);
83 gresbVirtualLinkSpinBox->setValue(1);
83 rmapSourceLogicalAddressSpinBox->setRange(0, 255);
84 rmapSourceLogicalAddressSpinBox->setRange(0, 255);
84 rmapSourceLogicalAddressSpinBox->setValue(33);
85 rmapSourceLogicalAddressSpinBox->setValue(0);
85 rmapTargetLogicalAddressSpinBox->setRange(0, 255);
86 rmapTargetLogicalAddressSpinBox->setRange(0, 255);
86 spwLinkSpinBox->setRange(0, 2);
87 spwLinkSpinBox->setRange(0, 2);
87 spwLinkSpinBox->setValue(0);
88 spwLinkSpinBox->setValue(0);
88 CCSDSTargetLogicalAddressSpinBox->setRange(0,255);
89 CCSDSTargetLogicalAddressSpinBox->setRange(0,255);
89 CCSDSTargetLogicalAddressSpinBox->setValue(254);
90 CCSDSTargetLogicalAddressSpinBox->setValue(0);
90
91
91 //*** MISC **//
92 //*** MISC **//
92 starDundee = new StarDundee;
93 starDundee = new StarDundee;
93 gresbBridge = new gresb;
94 gresbBridge = new gresb;
94 console = new QTextEdit;
95 console = new QTextEdit;
95 gresbBridgeIPDialogBox = new QIPDialogBox;
96 //gresbBridgeIPDialogBox = new QIPDialogBox;
96 gresbStatusQueryDialog = new QDialog;
97 gresbStatusQueryDialog = new QDialog;
97 logEnableCheckBox = new QCheckBox(tr("Enable Logs"));
98 logEnableCheckBox = new QCheckBox(tr("Enable Logs"));
98 RMAP_write_verify = new QCheckBox(tr("data checked before write\nlimited to 4 bytes\nNOT IMPLEMENTED"));
99 RMAP_write_verify = new QCheckBox(tr("data checked before write\nlimited to 4 bytes\nNOT IMPLEMENTED"));
@@ -112,13 +113,16 rmapPluginUI::rmapPluginUI(QWidget *pare
112
113
113 generalParameters_LAYOUT->addWidget(logEnableCheckBox, 0, 0, 1, 1);
114 generalParameters_LAYOUT->addWidget(logEnableCheckBox, 0, 0, 1, 1);
114 generalParameters_LAYOUT->addWidget(logFileChooseButton, 0, 1, 1, 1);
115 generalParameters_LAYOUT->addWidget(logFileChooseButton, 0, 1, 1, 1);
115 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressLabel, 1, 0, 0);
116 generalParameters_LAYOUT->addWidget(rmapSourceLogicalAddressLabel, 1, 0, 0);
116 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressSpinBox, 1, 1, 0);
117 generalParameters_LAYOUT->addWidget(rmapSourceLogicalAddressSpinBox, 1, 1, 0);
117 generalParameters_LAYOUT->addWidget(rmapOpenCommunicationButton, 2, 0, 1, 1);
118 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressLabel, 2, 0, 0);
118 generalParameters_LAYOUT->addWidget(rmapCloseCommunicationButton, 2, 1, 1, 1);
119 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressSpinBox, 2, 1, 0);
119 generalParameters_LAYOUT->addWidget(RMAP_write_verify, 3, 0, 1, 2);
120 generalParameters_LAYOUT->addWidget(rmapOpenCommunicationButton, 3, 0, 1, 1);
120 generalParameters_LAYOUT->addWidget(RMAP_write_reply, 4, 0, 1, 2);
121 generalParameters_LAYOUT->addWidget(rmapCloseCommunicationButton, 3, 1, 1, 1);
121 generalParameters_LAYOUT->setRowStretch(5, 1);
122 generalParameters_LAYOUT->addWidget(RMAP_write_verify, 4, 0, 1, 2);
123 generalParameters_LAYOUT->addWidget(RMAP_write_reply, 5, 0, 1, 2);
124
125 generalParameters_LAYOUT->setRowStretch(6, 1);
122 generalParameters_LAYOUT->setColumnStretch(2, 1);
126 generalParameters_LAYOUT->setColumnStretch(2, 1);
123
127
124 gresb_GROUPBOX->setLayout(gresbBridge->layout());
128 gresb_GROUPBOX->setLayout(gresbBridge->layout());
@@ -140,6 +144,7 rmapPluginUI::rmapPluginUI(QWidget *pare
140
144
141 consoleLayout->addWidget(console);
145 consoleLayout->addWidget(console);
142 consoleLayout->addWidget(clearConsoleButton);
146 consoleLayout->addWidget(clearConsoleButton);
147 consoleLayout->addWidget(nbPacketInStore);
143
148
144 connect(this->logFileChooseButton, SIGNAL(clicked()), this, SLOT(chooseLogFile()));
149 connect(this->logFileChooseButton, SIGNAL(clicked()), this, SLOT(chooseLogFile()));
145 connect(this, SIGNAL(setLogFileName(QString)), this->logFileName, SLOT(setText(QString)));
150 connect(this, SIGNAL(setLogFileName(QString)), this->logFileName, SLOT(setText(QString)));
@@ -168,8 +173,10 rmapPluginUI::rmapPluginUI(QWidget *pare
168 connect(this->starDundee, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
173 connect(this->starDundee, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
169 connect(this->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
174 connect(this->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
170
175
176 connect(this->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(sourceHasChanged(int)));
177 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(targetHasChanged(int)));
178 connect(this->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(sourceHasChanged(int)));
171 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(targetHasChanged(int)));
179 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(targetHasChanged(int)));
172 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(targetHasChanged(int)));
173
180
174 // command code
181 // command code
175 connect(this->RMAP_write_reply, SIGNAL(clicked()), this, SLOT(getCommandCode()));
182 connect(this->RMAP_write_reply, SIGNAL(clicked()), this, SLOT(getCommandCode()));
@@ -180,7 +187,8 rmapPluginUI::rmapPluginUI(QWidget *pare
180 this->gresbBridge, SLOT(commandCodeHasChanged(RMAP_command_codes)));
187 this->gresbBridge, SLOT(commandCodeHasChanged(RMAP_command_codes)));
181
188
182 getCommandCode(); // init the command code value
189 getCommandCode(); // init the command code value
183 rmapTargetLogicalAddressSpinBox->setValue(254);
190 rmapSourceLogicalAddressSpinBox->setValue(DEFAULT_SOURCE);
191 rmapTargetLogicalAddressSpinBox->setValue(DEFAULT_TARGET);
184 }
192 }
185
193
186 rmapPluginUI::~rmapPluginUI()
194 rmapPluginUI::~rmapPluginUI()
@@ -81,7 +81,7 public:
81 QSpinBox* rmapTargetLogicalAddressSpinBox;
81 QSpinBox* rmapTargetLogicalAddressSpinBox;
82 QSpinBox* CCSDSTargetLogicalAddressSpinBox;
82 QSpinBox* CCSDSTargetLogicalAddressSpinBox;
83
83
84 QIPDialogBox* gresbBridgeIPDialogBox;
84 //QIPDialogBox* gresbBridgeIPDialogBox;
85
85
86 QCheckBox *logEnableCheckBox;
86 QCheckBox *logEnableCheckBox;
87 QCheckBox *RMAP_write_verify;
87 QCheckBox *RMAP_write_verify;
@@ -92,6 +92,7 public:
92 QLabel* gresbStatusQueryLabel;
92 QLabel* gresbStatusQueryLabel;
93 QLabel* gresbStatusQueryDialogLabel;
93 QLabel* gresbStatusQueryDialogLabel;
94 QLabel* sendCCSDSCommandLabel;
94 QLabel* sendCCSDSCommandLabel;
95 QLabel* nbPacketInStore;
95
96
96 QDialog* gresbStatusQueryDialog;
97 QDialog* gresbStatusQueryDialog;
97
98
@@ -101,8 +102,8 public:
101
102
102 QTextEdit* console;
103 QTextEdit* console;
103
104
105 // SPACEWIRE BRIDGES
104 StarDundee *starDundee;
106 StarDundee *starDundee;
105
106 gresb *gresbBridge;
107 gresb *gresbBridge;
107
108
108 bool islogfileenable();
109 bool islogfileenable();
@@ -124,6 +125,7 signals:
124 void commandCodeHasChanged(RMAP_command_codes commandCode);
125 void commandCodeHasChanged(RMAP_command_codes commandCode);
125 void bridgeHasChanged(selectedBridge bridge);
126 void bridgeHasChanged(selectedBridge bridge);
126 void targetHasChanged(unsigned char target);
127 void targetHasChanged(unsigned char target);
128 void sourceHasChanged(unsigned char source);
127
129
128 private:
130 private:
129 QLabel *gresbBridgeIPLabel;
131 QLabel *gresbBridgeIPLabel;
@@ -1,6 +1,7
1 #include "stardundee.h"
1 #include "stardundee.h"
2 #include <QTime>
2 #include <QTime>
3 #include <math.h>
3 #include <math.h>
4 #include "ccsds.h"
4
5
5 StarDundee::StarDundee(QWidget *parent) :
6 StarDundee::StarDundee(QWidget *parent) :
6 QWidget(parent)
7 QWidget(parent)
@@ -16,13 +17,13 StarDundee::StarDundee(QWidget *parent)
16 starDundeeStatusQueryDialog = new QDialog;
17 starDundeeStatusQueryDialog = new QDialog;
17
18
18 commandCode = invalid0; // initialization of the cmmand code for the RMAP transfers
19 commandCode = invalid0; // initialization of the cmmand code for the RMAP transfers
20 rmapTargetLogicalAddress = DEFAULT_TARGET;
21 rmapSourceLogicalAddress = DEFAULT_SOURCE;
19
22
20 rmapSourceLogicalAddress = 0x20;
21 connection_LAYOUT = new QGridLayout;
23 connection_LAYOUT = new QGridLayout;
22
24
23 usbDeviceNumber_LABEL = new QLabel(tr("USB device number: "));
25 usbDeviceNumber_LABEL = new QLabel(tr("USB device number: "));
24 linkNumber_LABEL = new QLabel(tr("SpaceWire link number: "));
26 linkNumber_LABEL = new QLabel(tr("SpaceWire link number: "));
25 sourceLogicalAddress_LABEL = new QLabel(tr("Source logical address: "));
26 starDundeeStatusQueryDialogLabel = new QLabel(tr("SpaceWire link not running"));
27 starDundeeStatusQueryDialogLabel = new QLabel(tr("SpaceWire link not running"));
27
28
28 //*** QPUSHBUTTON ***//
29 //*** QPUSHBUTTON ***//
@@ -35,9 +36,6 StarDundee::StarDundee(QWidget *parent)
35 linkNumber_SPINBOX = new QSpinBox;
36 linkNumber_SPINBOX = new QSpinBox;
36 linkNumber_SPINBOX->setRange(1,2);
37 linkNumber_SPINBOX->setRange(1,2);
37 linkNumber_SPINBOX->setValue(1);
38 linkNumber_SPINBOX->setValue(1);
38 sourceLogicalAddress_SPINBOX = new QSpinBox;
39 sourceLogicalAddress_SPINBOX->setRange(0,254);
40 sourceLogicalAddress_SPINBOX->setValue(32);
41
39
42 // STAR DUNDEE STATUS QUERY DIALOG
40 // STAR DUNDEE STATUS QUERY DIALOG
43 starDundeeStatusQueryDialogLayout = new QGridLayout;
41 starDundeeStatusQueryDialogLayout = new QGridLayout;
@@ -50,21 +48,16 StarDundee::StarDundee(QWidget *parent)
50 connection_LAYOUT->addWidget(usbDeviceNumber_SPINBOX, 0, 1, 1, 1);
48 connection_LAYOUT->addWidget(usbDeviceNumber_SPINBOX, 0, 1, 1, 1);
51 connection_LAYOUT->addWidget(linkNumber_LABEL, 1, 0, 1, 1);
49 connection_LAYOUT->addWidget(linkNumber_LABEL, 1, 0, 1, 1);
52 connection_LAYOUT->addWidget(linkNumber_SPINBOX, 1, 1, 1, 1);
50 connection_LAYOUT->addWidget(linkNumber_SPINBOX, 1, 1, 1, 1);
53 connection_LAYOUT->addWidget(sourceLogicalAddress_LABEL, 2, 0, 1, 1);
54 connection_LAYOUT->addWidget(sourceLogicalAddress_SPINBOX, 2, 1, 1, 1);
55
51
56 connection_LAYOUT->setRowStretch(3, 1);
52 connection_LAYOUT->setRowStretch(2, 1);
57 connection_LAYOUT->setColumnStretch(2, 1);
53 connection_LAYOUT->setColumnStretch(2, 1);
58
54
59 this->setLayout(connection_LAYOUT);
55 this->setLayout(connection_LAYOUT);
60
56
61 connect(this->sourceLogicalAddress_SPINBOX, SIGNAL(valueChanged(int)), this, SLOT(sourceHasChanged(int)));
62
63 connect(starDundeeStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink()));
57 connect(starDundeeStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink()));
64 connect(starDundeeStatusQueryAbortButton, SIGNAL(clicked()), starDundeeStatusQueryDialog, SLOT(reject()));
58 connect(starDundeeStatusQueryAbortButton, SIGNAL(clicked()), starDundeeStatusQueryDialog, SLOT(reject()));
65
59
66 connect(this->timer, SIGNAL(timeout()), this, SLOT(receivePollingLoop()));
60 connect(this->timer, SIGNAL(timeout()), this, SLOT(receivePollingLoop()));
67 timer->start(100); // starts the periodical timer, perdio = 100ms
68 }
61 }
69
62
70 StarDundee::~StarDundee()
63 StarDundee::~StarDundee()
@@ -89,7 +82,7 void StarDundee::Open()
89 + QString::number(usbDeviceNumber_SPINBOX->value()));
82 + QString::number(usbDeviceNumber_SPINBOX->value()));
90
83
91 USBSpaceWire_EnableNetworkMode(hDevice, 0); // deactivate the network mode
84 USBSpaceWire_EnableNetworkMode(hDevice, 0); // deactivate the network mode
92 CFGSpaceWire_EnableRMAP(1); // Enable the use of RMAP
85 CFGSpaceWire_EnableRMAP(1); // Enable the use of RMAP for the StarDundee brick configuration
93 CFGSpaceWire_SetRMAPDestinationKey(0x20); // Set the destination key expected by STAR-Dundee devices
86 CFGSpaceWire_SetRMAPDestinationKey(0x20); // Set the destination key expected by STAR-Dundee devices
94
87
95 // Set the path and return path to the device
88 // Set the path and return path to the device
@@ -129,15 +122,27 void StarDundee::Open()
129 else emit sendMessage("Set the link status control for link " + QString::number(linkNumber_SPINBOX->value()));
122 else emit sendMessage("Set the link status control for link " + QString::number(linkNumber_SPINBOX->value()));
130 }
123 }
131
124
132 setRoutingTableEntry(rmapTargetLogicalAddress, (1<<linkNumber_SPINBOX->value()));
125 if (CFGSpaceWire_SetAsInterface(hDevice, 1, 0) != CFG_TRANSFER_SUCCESS)
133 setRoutingTableEntry(sourceLogicalAddress_SPINBOX->value(), (1<<3));
126 {
134 //setRoutingTableEntry(33, (1<<3));
127 emit sendMessage("Could not set the device to be an interface");
128 }
129 else
130 {
131 emit sendMessage("Device set to be an interface");
132 }
135
133
136 emit sendMessage("The driver's current send buffer size is " + QString::number(USBSpaceWire_GetDriverSendBufferSize(hDevice)) + " bytes");
134 //setRoutingTableEntry(rmapTargetLogicalAddress, (1<<linkNumber_SPINBOX->value()));
135 //setRoutingTableEntry(rmapSourceLogicalAddress, (1<<3));
136 //GetRoutingTableEntry(rmapTargetLogicalAddress);
137 //GetRoutingTableEntry(rmapSourceLogicalAddress);
137
138
138 USBSpaceWire_RegisterReceiveOnAllPorts(hDevice); // Register to receive on all ports
139 USBSpaceWire_RegisterReceiveOnAllPorts(hDevice); // Register to receive on all ports
139 USBSpaceWire_ClearEndpoints(hDevice); // clear the USB endpoints
140 USBSpaceWire_ClearEndpoints(hDevice); // clear the USB endpoints
140
141
142 emit sendMessage("The driver's current send buffer size is " + QString::number(USBSpaceWire_GetDriverSendBufferSize(hDevice)) + " bytes");
143 emit sendMessage("The driver's current read buffer size is " + QString::number(USBSpaceWire_GetDriverReadBufferSize(hDevice)) + " bytes");
144 emit sendMessage("USBSpaceWire_IsReadThrottling is " + QString::number(USBSpaceWire_IsReadThrottling(hDevice)));
145
141 // initialize SPW packet semaphores
146 // initialize SPW packet semaphores
142 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
147 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
143 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
148 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
@@ -145,10 +150,11 void StarDundee::Open()
145 if (getLinkStatus(linkNumber_SPINBOX->value()))
150 if (getLinkStatus(linkNumber_SPINBOX->value()))
146 {
151 {
147 emit isOpen(true);
152 emit isOpen(true);
153 timer->start(100); // starts the periodical timer, period = 100ms
148 }
154 }
149 else
155 else
150 {
156 {
151
157 starDundeeStatusQueryDialog->exec();
152 }
158 }
153 }
159 }
154
160
@@ -162,21 +168,35 void StarDundee::Close()
162 emit isOpen(false);
168 emit isOpen(false);
163 }
169 }
164
170
165 unsigned int StarDundee::GetRoutingTableEntry()
171 unsigned char StarDundee::setRoutingTableEntry(int tableEntry, U32 dwOutputPorts)
172 {
173 U32 routingTableEntry;
174 // SET THE ROUTING TABLE ENTRY FOR LOGICAL ADDRESSING, TARGET entryNumber
175 if (CFGSpaceWire_ClearRoutingTableEntry(hDevice, tableEntry) != CFG_TRANSFER_SUCCESS)
176 {
177 emit sendMessage("Could not clear routing table entry " + QString::number(tableEntry));
178 }
179 // Build the routing table entry
180 CFGSpaceWire_RTBuildRoutingTableEntry(&routingTableEntry,
181 dwOutputPorts, // route out of port dwOutputPorts
182 0, // header deletion disabled
183 0); // priority normal
184 // Set the routing table entry for logical address tableEntry
185 if (CFGSpaceWire_SetRoutingTableEntry(hDevice, tableEntry, routingTableEntry) != CFG_TRANSFER_SUCCESS)
186 {
187 emit sendMessage("Could not set routing table entry [" + QString::number(tableEntry) + "]");
188 }
189 else emit sendMessage("Routing table entry [" + QString::number(tableEntry) + "] set" );
190 return 1;
191 }
192
193 unsigned int StarDundee::GetRoutingTableEntry(int tableEntry)
166 {
194 {
167 U32 routingTableEntry, outputPorts;
195 U32 routingTableEntry, outputPorts;
168 char enabled, delHead, priority;
196 char enabled, delHead, priority;
169 int portNum;
197 int portNum;
170 int tableEntry;
171
198
172 tableEntry = rmapTargetLogicalAddress;
199 emit sendMessage("GetRoutingTableEntry [" + QString::number(tableEntry) + "]");
173
174 // Set the path and return path to the device
175 CFGSpaceWire_StackClear();
176 CFGSpaceWire_AddrStackPush(0);
177 CFGSpaceWire_AddrStackPush(254);
178 CFGSpaceWire_RetAddrStackPush(254);
179
180 // Read the routing table entry
200 // Read the routing table entry
181 if (CFGSpaceWire_GetRoutingTableEntry(hDevice, tableEntry, &routingTableEntry) != CFG_TRANSFER_SUCCESS)
201 if (CFGSpaceWire_GetRoutingTableEntry(hDevice, tableEntry, &routingTableEntry) != CFG_TRANSFER_SUCCESS)
182 {
202 {
@@ -343,8 +363,8 unsigned int StarDundee::WriteBLOCK(char
343 {
363 {
344 RMAP *RMAPCommand;
364 RMAP *RMAPCommand;
345 char * packet;
365 char * packet;
366 char* aux;
346 unsigned char offset, headerSize, CRCSize;
367 unsigned char offset, headerSize, CRCSize;
347 char* aux;
348 unsigned int totalSize;
368 unsigned int totalSize;
349 int errorCode;
369 int errorCode;
350 QString console_message;
370 QString console_message;
@@ -366,16 +386,17 unsigned int StarDundee::WriteBLOCK(char
366
386
367 //*************************
387 //*************************
368 // BUILD THE PACKET TO SEND
388 // BUILD THE PACKET TO SEND
369 totalSize = headerSize + nbBytes + CRCSize;
389 totalSize = headerSize + nbBytes + CRCSize + PATH_ADDRESSING_OFFSET;
370 packet = (char*) malloc( totalSize );
390 packet = (char*) malloc( totalSize );
371 aux = (char*) ((void*) &RMAPCommand->RMAPHeader);
391 aux = (char*) ((void*) &RMAPCommand->RMAPHeader);
372 for(unsigned int i = 0; i<headerSize; i++) packet[i] = aux[i];
392 packet[0] = this->linkNumber_SPINBOX->value();
393 for(unsigned int i = 0; i<headerSize; i++) packet[i+PATH_ADDRESSING_OFFSET] = aux[i];
373 offset = headerSize;
394 offset = headerSize;
374 for(unsigned int i = 0; i<nbBytes; i++)
395 for(unsigned int i = 0; i<nbBytes; i++)
375 {
396 {
376 packet[i+offset] = data[i];
397 packet[i+offset+PATH_ADDRESSING_OFFSET] = data[i];
377 }
398 }
378 packet[nbBytes+offset] = RMAPCommand->dataCRC;
399 packet[nbBytes+offset+PATH_ADDRESSING_OFFSET] = RMAPCommand->dataCRC;
379
400
380 //****************
401 //****************
381 // SEND THE PACKET
402 // SEND THE PACKET
@@ -480,7 +501,10 unsigned int StarDundee::ReadBLOCK(unsig
480 {
501 {
481 int errorCode;
502 int errorCode;
482 RMAP *RMAPCommand;
503 RMAP *RMAPCommand;
483 unsigned int dataLength;
504 char *packet;
505 char *aux;
506 unsigned int dataLength = 0;
507 unsigned int totalSize = 0;
484
508
485 //**********************
509 //**********************
486 // Check the link status
510 // Check the link status
@@ -511,12 +535,39 unsigned int StarDundee::ReadBLOCK(unsig
511 nbBytes,
535 nbBytes,
512 NULL);
536 NULL);
513 }
537 }
538
539 //*************************
540 // BUILD THE PACKET TO SEND
541 totalSize = sizeof(RMAPCommand->RMAPHeader) + PATH_ADDRESSING_OFFSET;
542 packet = (char*) malloc( totalSize );
543 aux = (char*) ((void*) &RMAPCommand->RMAPHeader);
544 packet[0] = this->linkNumber_SPINBOX->value();
545 for (unsigned int i = 0; i<sizeof(RMAPCommand->RMAPHeader); i++)
546 packet[i+PATH_ADDRESSING_OFFSET] = aux[i];
547
548 //****************
549 // SEND THE PACKET
514 result = USBSpaceWire_SendPacket(hDevice,
550 result = USBSpaceWire_SendPacket(hDevice,
515 (unsigned char*) ((void*) &RMAPCommand->RMAPHeader),
551 packet,
516 sizeof(RMAPCommand->RMAPHeader),
552 totalSize,
517 BWAIT_1, &pIdentifier);
553 BWAIT_1, &pIdentifier);
518 if (result != TRANSFER_SUCCESS) emit sendMessage("ERR *** ReadStarDundee *** ReadBLOCK *** sending the READ command ");
554 if (result != TRANSFER_SUCCESS) emit sendMessage("ERR *** ReadStarDundee *** ReadBLOCK *** sending the READ command ");
519 else emit sendMessage("OK *** ReadStarDundee *** ReadBLOCK *** sending the READ command");
555 else
556 {
557 emit sendMessage("OK *** ReadStarDundee *** ReadBLOCK *** sending the READ command");
558 emit appendToLog("packet sent, B0 = " + QString::number(packet[0], 16)
559 + " *** B1 = " + QString::number(packet[1], 16)
560 + " *** B2 = " + QString::number(packet[2], 16)
561 + " *** B3 = " + QString::number(packet[3], 16)
562 + " *** B4 = " + QString::number(packet[4], 16)
563 + " *** B5 = " + QString::number(packet[5], 16)
564 );
565 }
566
567 //**************
568 // Free the send
569 USBSpaceWire_FreeSend(hDevice, pIdentifier);
570 free(packet);
520
571
521 //*********************************
572 //*********************************
522 // RECEIVE THE INCOMING RMAP PACKET
573 // RECEIVE THE INCOMING RMAP PACKET
@@ -561,20 +612,21 unsigned int StarDundee::WriteSPW(char *
561 return 1;
612 return 1;
562 }
613 }
563
614
564 totalSize = count + 4;
615 totalSize = count + 4 + PATH_ADDRESSING_OFFSET; // The StarDundee brick is in PATH addressing
565 SPWData = (char*) malloc(totalSize);
616 SPWData = (char*) malloc(totalSize);
566 // SPW HEADER
617 // SPW HEADER
567 SPWData[0] = targetLogicalAddress;
618 SPWData[0] = this->linkNumber_SPINBOX->value(); // 1 by default, value can be 1 or 2
568 SPWData[1] = protocoleIdentifier;
619 SPWData[0+PATH_ADDRESSING_OFFSET] = targetLogicalAddress;
569 SPWData[2] = reserved;
620 SPWData[1+PATH_ADDRESSING_OFFSET] = protocoleIdentifier;
570 SPWData[3] = userApplication;
621 SPWData[2+PATH_ADDRESSING_OFFSET] = reserved;
622 SPWData[3+PATH_ADDRESSING_OFFSET] = userApplication;
571 // CCSDS PACKET
623 // CCSDS PACKET
572 for (unsigned int i = 0; i<count; i++)
624 for (unsigned int i = 0; i<count; i++)
573 {
625 {
574 SPWData[i+4] = Value[i];
626 SPWData[i+4+PATH_ADDRESSING_OFFSET] = Value[i];
575 }
627 }
576
628
577 //************
629 //****************
578 // SEND THE PACKET
630 // SEND THE PACKET
579 result = USBSpaceWire_SendPacket(hDevice,
631 result = USBSpaceWire_SendPacket(hDevice,
580 SPWData,
632 SPWData,
@@ -588,7 +640,21 unsigned int StarDundee::WriteSPW(char *
588 free(SPWData);
640 free(SPWData);
589 return 0;
641 return 0;
590 }
642 }
591 else emit sendMessage("OK *** WriteSPW when sending packet of size " + QString::number(totalSize));
643 else emit sendMessage("OK *** WriteSPW when sending packet of size " + QString::number(totalSize-1));
644 emit appendToLog("packet sent, B0 = " + QString::number(SPWData[0])
645 + " *** B1 = " + QString::number(SPWData[1])
646 + " *** B2 = " + QString::number(SPWData[2])
647 + " *** B3 = " + QString::number(SPWData[3])
648 + " *** B4 = " + QString::number(SPWData[4])
649 + " *** B5 = " + QString::number(SPWData[5])
650 + " *** B6 = " + QString::number(SPWData[6])
651 + " *** B7 = " + QString::number(SPWData[7])
652 + " *** B8 = " + QString::number(SPWData[8])
653 + " *** B9 = " + QString::number(SPWData[9])
654 + " *** B10 = " + QString::number(SPWData[10])
655 + " *** B11 = " + QString::number(SPWData[11])
656 + " *** B12 = " + QString::number(SPWData[12])
657 );
592
658
593 //**************
659 //**************
594 // Free the send
660 // Free the send
@@ -651,6 +717,30 unsigned int StarDundee::getLinkStatus(u
651 else return 0;
717 else return 0;
652 }
718 }
653
719
720 void StarDundee::receivePollingLoop()
721 {
722 timer->blockSignals(true);
723 if (USBSpaceWire_WaitOnReadPacketAvailable(hDevice, 0)) receiveSPWPacketLoop(0);
724 timer->blockSignals(false);
725 }
726
727 int StarDundee::receiveSPWPacketLoop(unsigned char requestID)
728 {
729 int result = 0;
730 emit appendToLog("Number of packets dropped by the driver: " +
731 QString::number(USBSpaceWire_GetDriverDroppedPackets(hDevice)));
732
733 while (USBSpaceWire_WaitOnReadPacketAvailable(hDevice, 0))
734 {
735 result = receiveSPWPacket(requestID);
736 }
737 if (!ccsdsPacketStore.isEmpty())
738 {
739 emit packetStoreNotEmpty();
740 }
741 return result;
742 }
743
654 int StarDundee::receiveSPWPacket(unsigned char requestID) // SLOT
744 int StarDundee::receiveSPWPacket(unsigned char requestID) // SLOT
655 {
745 {
656 unsigned int packetLength;
746 unsigned int packetLength;
@@ -670,16 +760,30 int StarDundee::receiveSPWPacket(unsigne
670 // TRY TO RECEIVE DATA
760 // TRY TO RECEIVE DATA
671 nbBytes = qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH); // maximum size of the packet to receive
761 nbBytes = qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH); // maximum size of the packet to receive
672 nPacketNum = 1;
762 nPacketNum = 1;
673 result = USBSpaceWire_ReadPackets(hDevice, spwPacket, nbBytes, nPacketNum, BWAIT_1, &properties, &pIdentifier);
763 result = USBSpaceWire_ReadPackets(hDevice, spwPacket, nbBytes, nPacketNum, BWAIT_1, &properties, &pIdentifierRead);
674 if (result != TRANSFER_SUCCESS)
764 if (result != TRANSFER_SUCCESS)
675 {
765 {
676 emit sendMessage("Error: Could not receive the packet");
766 emit sendMessage("Error: Could not receive the packet");
767 USBSpaceWire_FreeRead(hDevice, pIdentifierRead); // Free the read buffer
677 return 0;
768 return 0;
678 }
769 }
679 else
770 else
680 {
771 {
681 packetLength = properties.len;
772 packetLength = properties.len;
682 USBSpaceWire_FreeRead(hDevice, pIdentifier); // Free the receive
773 if (properties.eop == SPACEWIRE_USB_NO_EOP)
774 {
775 emit appendToLog("No end of packet marker received");
776 }
777 else if (properties.eop == SPACEWIRE_USB_EOP)
778 {
779 emit appendToLog("Normal end of packet marker received");
780 }
781 else if (properties.eop == SPACEWIRE_USB_EEP)
782 {
783 emit appendToLog("Error end of packet marker received");
784 }
785
786 USBSpaceWire_FreeRead(hDevice, pIdentifierRead); // Free the read buffer
683 }
787 }
684
788
685 switch(spwPacket[1]) // byte 1 is the protocole identifier in the SPW packet
789 switch(spwPacket[1]) // byte 1 is the protocole identifier in the SPW packet
@@ -690,45 +794,57 int StarDundee::receiveSPWPacket(unsigne
690 rmapPacketSize = packetLength;
794 rmapPacketSize = packetLength;
691 rmapPacketSEMAPHORE->release();
795 rmapPacketSEMAPHORE->release();
692 emit appendToLog("RMAP packet of size " + QString::number(packetLength) + " received");
796 emit appendToLog("RMAP packet of size " + QString::number(packetLength) + " received");
797 emit appendToLog("packet received, B0 = " + QString::number(spwPacket[0], 16)
798 + " *** B1 = " + QString::number(spwPacket[1], 16)
799 + " *** B2 = " + QString::number(spwPacket[2], 16)
800 + " *** B3 = " + QString::number(spwPacket[3], 16)
801 + " *** B4 = " + QString::number(spwPacket[4], 16)
802 + " *** B5 = " + QString::number(spwPacket[5], 16)
803 );
693 return packetLength;
804 return packetLength;
694
805
695 case 2: // 0x02 is the protocole identifier for CCSDS packets
806 case 2: // 0x02 is the protocole identifier for CCSDS packets
696 if (ccsdsPacketSEMAPHORE->available()!=0) return -4; // ERROR === previous CCSDS packet not processed yet
807 if (ccsdsPacketSEMAPHORE->available()!=0)
808 {
809 emit sendMessage("in function [receiveSPWPacket] === ERROR === previous CCSDS packet not processed yet");
810 return -4; // ERROR === previous CCSDS packet not processed yet
811 }
697 for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i];
812 for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i];
698 ccsdsPacketSize = packetLength;
813 ccsdsPacketSize = packetLength;
699 ccsdsPacketSEMAPHORE->release();
814 //ccsdsPacketSEMAPHORE->release();
815 //emit(ccsdsPacketAvailable(ccsdsPacket, packetLength));
700 emit appendToLog("CCSDS packet of size " + QString::number(packetLength) + " received");
816 emit appendToLog("CCSDS packet of size " + QString::number(packetLength) + " received");
701 emit(ccsdsPacketAvailable(ccsdsPacket, packetLength));
817 emit appendToLog("packet received, byte0 " + QString::number(spwPacket[0], 16)
818 + " *** byte1 " + QString::number(spwPacket[1], 16)
819 + " *** byte2 " + QString::number(spwPacket[2], 16)
820 + " *** byte3 " + QString::number(spwPacket[3], 16));
821 storeCCSDSPacket(ccsdsPacket, packetLength);
702 return packetLength;
822 return packetLength;
823 default:
824 emit appendToLog("packet received, byte0 " + QString::number(spwPacket[0], 16)
825 + " *** byte1 " + QString::number(spwPacket[1], 16)
826 + " *** byte2 " + QString::number(spwPacket[2], 16)
827 + " *** byte3 " + QString::number(spwPacket[3], 16));
828 return 0;
703 }
829 }
704 return 0;
830 return 0;
705 }
831 }
706
832
707 void StarDundee::receivePollingLoop()
833 unsigned int StarDundee::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
708 {
834 {
709 timer->blockSignals(true);
835 TMPacketToRead *packet;
710 if (USBSpaceWire_WaitOnReadPacketAvailable(hDevice, 0)) receiveSPWPacket(0);
836
711 timer->blockSignals(false);
837 packet = new TMPacketToRead(ccsdsPacket, size);
838 ccsdsPacketStore.append(packet);
839
840 return 1;
712 }
841 }
713
842
714 unsigned char StarDundee::setRoutingTableEntry(int tableEntry, U32 dwOutputPorts)
843 void StarDundee::reTestSPWLink() // SLOT
715 {
844 {
716 U32 routingTableEntry;
845 if (getLinkStatus(linkNumber_SPINBOX->value()))
717 // SET THE ROUTING TABLE ENTRY FOR LOGICAL ADDRESSING, TARGET entryNumber
718 if (CFGSpaceWire_ClearRoutingTableEntry(hDevice, tableEntry) != CFG_TRANSFER_SUCCESS)
719 {
846 {
720 emit sendMessage("Could not clear routing table entry " + QString::number(tableEntry));
847 emit isOpen(true);
848 starDundeeStatusQueryDialog->accept();
721 }
849 }
722 // Build the routing table entry
723 CFGSpaceWire_RTBuildRoutingTableEntry(&routingTableEntry,
724 dwOutputPorts, // route out of port dwOutputPorts
725 0, // header deletion disabled
726 0); // priority normal
727 // Set the routing table entry for logical address tableEntry
728 if (CFGSpaceWire_SetRoutingTableEntry(hDevice, tableEntry, routingTableEntry) != CFG_TRANSFER_SUCCESS)
729 {
730 emit sendMessage("Could not set routing table entry [" + QString::number(tableEntry) + "]");
731 }
850 }
732 else emit sendMessage("Routing table entry [" + QString::number(tableEntry) + "] set" );
733
734 }
@@ -13,9 +13,12
13 #include "rmapoperations.h"
13 #include "rmapoperations.h"
14 #include "spw_usb_api.h"
14 #include "spw_usb_api.h"
15 #include "spw_config_library.h"
15 #include "spw_config_library.h"
16 #include "ccsds.h"
17 #include "tmpackettoread.h"
16
18
17 #define BWAIT_0 0
19 #define BWAIT_0 0
18 #define BWAIT_1 1
20 #define BWAIT_1 1
21 #define PATH_ADDRESSING_OFFSET 1
19
22
20 class StarDundee : public QWidget
23 class StarDundee : public QWidget
21 {
24 {
@@ -27,23 +30,28 public:
27 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
30 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
28 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
31 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
29
32
33 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
34 QList<TMPacketToRead*> ccsdsPacketStore;
35
30 signals:
36 signals:
31 void sendMessage(QString message);
37 void sendMessage(QString message);
32 void isOpen(bool);
38 void isOpen(bool);
33 void RMAP_write_reply_setText(QString);
39 void RMAP_write_reply_setText(QString);
34 void appendToLog(QString);
40 void appendToLog(QString);
35 void ccsdsPacketAvailable(unsigned char*, unsigned int);
41 void ccsdsPacketAvailable(unsigned char*, unsigned int);
42 void packetStoreNotEmpty();
36
43
37 public slots:
44 public slots:
38 void Open();
45 void Open();
39 void Close();
46 void Close();
40 int receiveSPWPacket(unsigned char requestID);
47 void reTestSPWLink();
48 int receiveSPWPacketLoop(unsigned char requestID=0);
49 int receiveSPWPacket(unsigned char requestID=0);
41 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
50 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
42 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
51 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
52 void sourceHasChanged(int source) {rmapSourceLogicalAddress = (unsigned char) source;}
43 void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();}
53 void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();}
44 void reTestSPWLink() {getLinkStatus(linkNumber_SPINBOX->value());}
45 //
54 //
46 void sourceHasChanged(int target) {rmapSourceLogicalAddress = (unsigned char) target;}
47 void receivePollingLoop();
55 void receivePollingLoop();
48
56
49 private:
57 private:
@@ -54,7 +62,7 private:
54 unsigned char setRoutingTableEntry(int tableEntry, U32 dwOutputPorts);
62 unsigned char setRoutingTableEntry(int tableEntry, U32 dwOutputPorts);
55
63
56 unsigned int getLinkStatus(unsigned char link);
64 unsigned int getLinkStatus(unsigned char link);
57 unsigned int GetRoutingTableEntry();
65 unsigned int GetRoutingTableEntry(int tableEntry);
58
66
59 unsigned char rmapTargetLogicalAddress ;
67 unsigned char rmapTargetLogicalAddress ;
60 unsigned char rmapSourceLogicalAddress ;
68 unsigned char rmapSourceLogicalAddress ;
@@ -63,12 +71,10 private:
63
71
64 QLabel *usbDeviceNumber_LABEL;
72 QLabel *usbDeviceNumber_LABEL;
65 QLabel *linkNumber_LABEL;
73 QLabel *linkNumber_LABEL;
66 QLabel *sourceLogicalAddress_LABEL;
67 QLabel *starDundeeStatusQueryDialogLabel;
74 QLabel *starDundeeStatusQueryDialogLabel;
68
75
69 QSpinBox *usbDeviceNumber_SPINBOX;
76 QSpinBox *usbDeviceNumber_SPINBOX;
70 QSpinBox *linkNumber_SPINBOX;
77 QSpinBox *linkNumber_SPINBOX;
71 QSpinBox *sourceLogicalAddress_SPINBOX;
72
78
73 QGridLayout *connection_LAYOUT;
79 QGridLayout *connection_LAYOUT;
74 QGridLayout *starDundeeStatusQueryDialogLayout;
80 QGridLayout *starDundeeStatusQueryDialogLayout;
@@ -81,7 +87,8 private:
81 QTimer *timer;
87 QTimer *timer;
82
88
83 unsigned char pBuffer[10]; // Pointer to the start of the user buffer from which to transmit data
89 unsigned char pBuffer[10]; // Pointer to the start of the user buffer from which to transmit data
84 USB_SPACEWIRE_ID pIdentifier; // A pointer to a variable which will be set to contain a unique identifier for the send
90 USB_SPACEWIRE_ID pIdentifierRead; // A pointer to a variable which will be set to contain a unique identifier for the read
91 USB_SPACEWIRE_ID pIdentifier;
85
92
86 star_device_handle hDevice; // Handle to the SpaceWire device
93 star_device_handle hDevice; // Handle to the SpaceWire device
87 USB_SPACEWIRE_STATUS result; // The result of the send operation
94 USB_SPACEWIRE_STATUS result; // The result of the send operation
General Comments 0
You need to be logged in to leave comments. Login now