##// END OF EJS Templates
the two bridges, Star Dundee and GRESB are fully functional
leroy -
r10:74729fe49979 default
parent child
Show More
@@ -1,264 +1,264
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, 2012-12-10T15:32:54. -->
3 <!-- Written by Qt Creator 2.4.1, 2012-12-11T14:32:09. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
7 <value type="int">0</value>
7 <value type="int">0</value>
8 </data>
8 </data>
9 <data>
9 <data>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
11 <valuemap type="QVariantMap">
11 <valuemap type="QVariantMap">
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
14 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
14 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
15 <value type="QString" key="language">Cpp</value>
15 <value type="QString" key="language">Cpp</value>
16 <valuemap type="QVariantMap" key="value">
16 <valuemap type="QVariantMap" key="value">
17 <value type="QString" key="CurrentPreferences">CppGlobal</value>
17 <value type="QString" key="CurrentPreferences">CppGlobal</value>
18 </valuemap>
18 </valuemap>
19 </valuemap>
19 </valuemap>
20 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
20 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
21 <value type="QString" key="language">QmlJS</value>
21 <value type="QString" key="language">QmlJS</value>
22 <valuemap type="QVariantMap" key="value">
22 <valuemap type="QVariantMap" key="value">
23 <value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
23 <value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
24 </valuemap>
24 </valuemap>
25 </valuemap>
25 </valuemap>
26 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
26 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
27 <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
27 <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
28 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
28 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
29 <value type="int" key="EditorConfiguration.IndentSize">4</value>
29 <value type="int" key="EditorConfiguration.IndentSize">4</value>
30 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
30 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
31 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
31 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
32 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
32 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
33 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
33 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
34 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
34 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
35 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
35 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
36 <value type="int" key="EditorConfiguration.TabSize">8</value>
36 <value type="int" key="EditorConfiguration.TabSize">8</value>
37 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
37 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
38 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
38 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
39 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
39 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
40 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
40 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
41 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
41 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
42 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
42 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
43 </valuemap>
43 </valuemap>
44 </data>
44 </data>
45 <data>
45 <data>
46 <variable>ProjectExplorer.Project.PluginSettings</variable>
46 <variable>ProjectExplorer.Project.PluginSettings</variable>
47 <valuemap type="QVariantMap"/>
47 <valuemap type="QVariantMap"/>
48 </data>
48 </data>
49 <data>
49 <data>
50 <variable>ProjectExplorer.Project.Target.0</variable>
50 <variable>ProjectExplorer.Project.Target.0</variable>
51 <valuemap type="QVariantMap">
51 <valuemap type="QVariantMap">
52 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
52 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
53 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
53 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value>
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value>
55 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
55 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
56 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
56 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
58 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
58 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
59 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
59 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
60 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
60 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
61 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
61 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
62 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
62 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
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">true</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>
70 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
70 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
71 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
71 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
72 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
72 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
73 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
73 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
74 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
74 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
75 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
75 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
76 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
76 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
77 </valuemap>
77 </valuemap>
78 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
78 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
79 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
79 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
80 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
80 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
81 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
81 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
82 </valuemap>
82 </valuemap>
83 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
83 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
84 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
84 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
85 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
85 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
86 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
86 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
88 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
88 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
89 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
89 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
90 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
90 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
91 </valuemap>
91 </valuemap>
92 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
92 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
93 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
93 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
96 </valuemap>
96 </valuemap>
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.2 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">/opt/LPPMON_PLUGINS_PAUL</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 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
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>
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">
110 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
111 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
111 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
112 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
112 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
115 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
115 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
116 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
116 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
117 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
117 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
118 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
118 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
119 </valuemap>
119 </valuemap>
120 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
120 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
121 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
121 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
122 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
122 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
124 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
124 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
125 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
125 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
126 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
126 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
127 </valuemap>
127 </valuemap>
128 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
128 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
129 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
129 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
130 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
130 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
131 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
131 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
132 </valuemap>
132 </valuemap>
133 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
133 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
134 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
134 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
135 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
135 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
136 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
136 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
137 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
137 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
138 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
138 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
139 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
139 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
140 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
140 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
141 </valuemap>
141 </valuemap>
142 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
142 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
143 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
143 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
144 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
144 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
145 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
145 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
146 </valuemap>
146 </valuemap>
147 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
147 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
148 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
148 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
149 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
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>
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>
151 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
152 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
152 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
153 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
153 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
154 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL</value>
154 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL</value>
155 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
155 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
156 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
156 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
157 </valuemap>
157 </valuemap>
158 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
158 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
159 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
159 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
160 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
160 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
161 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
161 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
162 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
162 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
163 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
163 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
164 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
164 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
165 </valuemap>
165 </valuemap>
166 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
166 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
167 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
167 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
168 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
168 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
169 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
169 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
170 </valuemap>
170 </valuemap>
171 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
171 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
172 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
172 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
173 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
173 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
174 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
174 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
175 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
175 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
176 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
176 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
177 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
177 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
178 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
178 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
179 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
179 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
180 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
180 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
181 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
181 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
182 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
182 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
183 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
183 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
184 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
184 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
185 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
185 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
186 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
186 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
187 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
187 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
188 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
188 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
189 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
189 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
190 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
190 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
191 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
191 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
192 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
192 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
193 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
193 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
194 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
194 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
195 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
195 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
196 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
196 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
197 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
197 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
198 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
198 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
199 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
199 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
200 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
200 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
201 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
201 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
202 <value type="int">0</value>
202 <value type="int">0</value>
203 <value type="int">1</value>
203 <value type="int">1</value>
204 <value type="int">2</value>
204 <value type="int">2</value>
205 <value type="int">3</value>
205 <value type="int">3</value>
206 <value type="int">4</value>
206 <value type="int">4</value>
207 <value type="int">5</value>
207 <value type="int">5</value>
208 <value type="int">6</value>
208 <value type="int">6</value>
209 <value type="int">7</value>
209 <value type="int">7</value>
210 <value type="int">8</value>
210 <value type="int">8</value>
211 <value type="int">9</value>
211 <value type="int">9</value>
212 <value type="int">10</value>
212 <value type="int">10</value>
213 <value type="int">11</value>
213 <value type="int">11</value>
214 <value type="int">12</value>
214 <value type="int">12</value>
215 <value type="int">13</value>
215 <value type="int">13</value>
216 <value type="int">14</value>
216 <value type="int">14</value>
217 </valuelist>
217 </valuelist>
218 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
218 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
219 <value type="int">0</value>
219 <value type="int">0</value>
220 <value type="int">1</value>
220 <value type="int">1</value>
221 <value type="int">2</value>
221 <value type="int">2</value>
222 <value type="int">3</value>
222 <value type="int">3</value>
223 <value type="int">4</value>
223 <value type="int">4</value>
224 <value type="int">5</value>
224 <value type="int">5</value>
225 <value type="int">6</value>
225 <value type="int">6</value>
226 <value type="int">7</value>
226 <value type="int">7</value>
227 <value type="int">8</value>
227 <value type="int">8</value>
228 <value type="int">9</value>
228 <value type="int">9</value>
229 <value type="int">10</value>
229 <value type="int">10</value>
230 <value type="int">11</value>
230 <value type="int">11</value>
231 <value type="int">12</value>
231 <value type="int">12</value>
232 <value type="int">13</value>
232 <value type="int">13</value>
233 <value type="int">14</value>
233 <value type="int">14</value>
234 </valuelist>
234 </valuelist>
235 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
235 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
236 <value type="int" key="ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase">2</value>
236 <value type="int" key="ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase">2</value>
237 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">lppmon</value>
237 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">lppmon</value>
238 <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">false</value>
238 <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">false</value>
239 <valuelist type="QVariantList" key="ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges"/>
239 <valuelist type="QVariantList" key="ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges"/>
240 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value>
240 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value>
241 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Run lppmon</value>
241 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Run lppmon</value>
242 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
242 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
243 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
243 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
244 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
244 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
245 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
245 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
246 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
246 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
247 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
247 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
248 </valuemap>
248 </valuemap>
249 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
249 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
250 </valuemap>
250 </valuemap>
251 </data>
251 </data>
252 <data>
252 <data>
253 <variable>ProjectExplorer.Project.TargetCount</variable>
253 <variable>ProjectExplorer.Project.TargetCount</variable>
254 <value type="int">1</value>
254 <value type="int">1</value>
255 </data>
255 </data>
256 <data>
256 <data>
257 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
257 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
258 <value type="QString">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
258 <value type="QString">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
259 </data>
259 </data>
260 <data>
260 <data>
261 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
261 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
262 <value type="int">10</value>
262 <value type="int">10</value>
263 </data>
263 </data>
264 </qtcreator>
264 </qtcreator>
@@ -1,452 +1,434
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.3) on: Mon Dec 10 09:02:30 2012
3 # Generated by qmake (2.01a) (Qt 4.8.3) on: Mon Dec 10 16:03:39 2012
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
7 #############################################################################
7 #############################################################################
8
8
9 ####### Compiler, tools and options
9 ####### Compiler, tools and options
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_TRANSLATION_PATH="\"/etc/lppmon/translations\"" -DLPPMONPLUGIN_LIBRARY -DQT_NO_DEBUG -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 -DUNIXTRANSLATIONPATH -DLPPMON_PLUGINS_INSTALL_PATH="QDir::homePath()+\"/.lppmon/plugins\"" -DLPPMON_TRANSLATION_PATH="\"/etc/lppmon/translations\"" -DLPPMONPLUGIN_LIBRARY -DQT_NO_DEBUG -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 -I. -I../common_PLE -I../spw_usb_driver_v2.61/inc -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 -I. -I../common_PLE -I../spw_usb_driver_v2.61/inc -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 -lQtGui -lQtNetwork -lQtCore -lpthread
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 -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
23 TAR = tar -cf
23 TAR = tar -cf
24 COMPRESS = gzip -9f
24 COMPRESS = gzip -9f
25 COPY = cp -f
25 COPY = cp -f
26 SED = sed
26 SED = sed
27 COPY_FILE = $(COPY)
27 COPY_FILE = $(COPY)
28 COPY_DIR = $(COPY) -r
28 COPY_DIR = $(COPY) -r
29 STRIP =
29 STRIP =
30 INSTALL_FILE = install -m 644 -p
30 INSTALL_FILE = install -m 644 -p
31 INSTALL_DIR = $(COPY_DIR)
31 INSTALL_DIR = $(COPY_DIR)
32 INSTALL_PROGRAM = install -m 755 -p
32 INSTALL_PROGRAM = install -m 755 -p
33 DEL_FILE = rm -f
33 DEL_FILE = rm -f
34 SYMLINK = ln -f -s
34 SYMLINK = ln -f -s
35 DEL_DIR = rmdir
35 DEL_DIR = rmdir
36 MOVE = mv -f
36 MOVE = mv -f
37 CHK_DIR_EXISTS= test -d
37 CHK_DIR_EXISTS= test -d
38 MKDIR = mkdir -p
38 MKDIR = mkdir -p
39
39
40 ####### Output directory
40 ####### Output directory
41
41
42 OBJECTS_DIR = obj/
42 OBJECTS_DIR = obj/
43
43
44 ####### Files
44 ####### Files
45
45
46 SOURCES = rmapplugin.cpp \
46 SOURCES = rmapplugin.cpp \
47 rmappluginui.cpp \
47 rmappluginui.cpp \
48 rmapoperations.cpp \
48 rmapoperations.cpp \
49 ccsds.cpp \
49 ccsds.cpp \
50 spwpacketreceiver.cpp \
51 ../common_PLE/qipdialogbox.cpp \
50 ../common_PLE/qipdialogbox.cpp \
52 ../common_PLE/gresbstatusenquiry.cpp \
51 ../common_PLE/gresbstatusenquiry.cpp \
53 spectralmatricesdmasimulator.cpp \
52 spectralmatricesdmasimulator.cpp \
54 rmappluginpythonwrapper.cpp \
53 rmappluginpythonwrapper.cpp \
55 stardundee.cpp \
54 stardundee.cpp \
56 gresb.cpp \
55 gresb.cpp \
57 bridge.cpp \
56 bridge.cpp \
58 /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp moc/moc_rmappluginui.cpp \
57 /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp moc/moc_rmappluginui.cpp \
59 moc/moc_rmapplugin.cpp \
58 moc/moc_rmapplugin.cpp \
60 moc/moc_spwpacketreceiver.cpp \
61 moc/moc_qipdialogbox.cpp \
59 moc/moc_qipdialogbox.cpp \
62 moc/moc_gresbstatusenquiry.cpp \
60 moc/moc_gresbstatusenquiry.cpp \
63 moc/moc_spectralmatricesdmasimulator.cpp \
61 moc/moc_spectralmatricesdmasimulator.cpp \
64 moc/moc_rmappluginpythonwrapper.cpp \
62 moc/moc_rmappluginpythonwrapper.cpp \
65 moc/moc_stardundee.cpp \
63 moc/moc_stardundee.cpp \
66 moc/moc_gresb.cpp \
64 moc/moc_gresb.cpp \
67 moc/moc_bridge.cpp \
65 moc/moc_bridge.cpp \
68 moc/moc_genericPySysdriver.cpp \
66 moc/moc_genericPySysdriver.cpp \
69 moc/moc_lppmonplugin.cpp
67 moc/moc_lppmonplugin.cpp
70 OBJECTS = obj/rmapplugin.o \
68 OBJECTS = obj/rmapplugin.o \
71 obj/rmappluginui.o \
69 obj/rmappluginui.o \
72 obj/rmapoperations.o \
70 obj/rmapoperations.o \
73 obj/ccsds.o \
71 obj/ccsds.o \
74 obj/spwpacketreceiver.o \
75 obj/qipdialogbox.o \
72 obj/qipdialogbox.o \
76 obj/gresbstatusenquiry.o \
73 obj/gresbstatusenquiry.o \
77 obj/spectralmatricesdmasimulator.o \
74 obj/spectralmatricesdmasimulator.o \
78 obj/rmappluginpythonwrapper.o \
75 obj/rmappluginpythonwrapper.o \
79 obj/stardundee.o \
76 obj/stardundee.o \
80 obj/gresb.o \
77 obj/gresb.o \
81 obj/bridge.o \
78 obj/bridge.o \
82 obj/lppmonplugininterface.o \
79 obj/lppmonplugininterface.o \
83 obj/moc_rmappluginui.o \
80 obj/moc_rmappluginui.o \
84 obj/moc_rmapplugin.o \
81 obj/moc_rmapplugin.o \
85 obj/moc_spwpacketreceiver.o \
86 obj/moc_qipdialogbox.o \
82 obj/moc_qipdialogbox.o \
87 obj/moc_gresbstatusenquiry.o \
83 obj/moc_gresbstatusenquiry.o \
88 obj/moc_spectralmatricesdmasimulator.o \
84 obj/moc_spectralmatricesdmasimulator.o \
89 obj/moc_rmappluginpythonwrapper.o \
85 obj/moc_rmappluginpythonwrapper.o \
90 obj/moc_stardundee.o \
86 obj/moc_stardundee.o \
91 obj/moc_gresb.o \
87 obj/moc_gresb.o \
92 obj/moc_bridge.o \
88 obj/moc_bridge.o \
93 obj/moc_genericPySysdriver.o \
89 obj/moc_genericPySysdriver.o \
94 obj/moc_lppmonplugin.o
90 obj/moc_lppmonplugin.o
95 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
91 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
96 /usr/lib64/qt4/mkspecs/common/linux.conf \
92 /usr/lib64/qt4/mkspecs/common/linux.conf \
97 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
93 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
98 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
94 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
99 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
95 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
100 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
96 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
101 /usr/lib64/qt4/mkspecs/qconfig.pri \
97 /usr/lib64/qt4/mkspecs/qconfig.pri \
102 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \
98 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \
103 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
99 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
104 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
100 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
105 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
101 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
106 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
102 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
107 /usr/lib64/qt4/mkspecs/features/release.prf \
103 /usr/lib64/qt4/mkspecs/features/release.prf \
108 /usr/lib64/qt4/mkspecs/features/default_post.prf \
104 /usr/lib64/qt4/mkspecs/features/default_post.prf \
109 /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf \
105 /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf \
110 /usr/lib64/qt4/mkspecs/features/pythonqt.prf \
106 /usr/lib64/qt4/mkspecs/features/pythonqt.prf \
111 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
107 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
112 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
108 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
113 /usr/lib64/qt4/mkspecs/features/qt.prf \
109 /usr/lib64/qt4/mkspecs/features/qt.prf \
114 /usr/lib64/qt4/mkspecs/features/unix/thread.prf \
110 /usr/lib64/qt4/mkspecs/features/unix/thread.prf \
115 /usr/lib64/qt4/mkspecs/features/moc.prf \
111 /usr/lib64/qt4/mkspecs/features/moc.prf \
116 /usr/lib64/qt4/mkspecs/features/resources.prf \
112 /usr/lib64/qt4/mkspecs/features/resources.prf \
117 /usr/lib64/qt4/mkspecs/features/uic.prf \
113 /usr/lib64/qt4/mkspecs/features/uic.prf \
118 /usr/lib64/qt4/mkspecs/features/yacc.prf \
114 /usr/lib64/qt4/mkspecs/features/yacc.prf \
119 /usr/lib64/qt4/mkspecs/features/lex.prf \
115 /usr/lib64/qt4/mkspecs/features/lex.prf \
120 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
116 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
121 rmapplugin.pro
117 rmapplugin.pro
122 QMAKE_TARGET = rmapplugin
118 QMAKE_TARGET = rmapplugin
123 DESTDIR = bin/
119 DESTDIR = bin/
124 TARGET = librmapplugin.so.1.0.0
120 TARGET = librmapplugin.so.1.0.0
125 TARGETA = bin/librmapplugin.a
121 TARGETA = bin/librmapplugin.a
126 TARGETD = librmapplugin.so.1.0.0
122 TARGETD = librmapplugin.so.1.0.0
127 TARGET0 = librmapplugin.so
123 TARGET0 = librmapplugin.so
128 TARGET1 = librmapplugin.so.1
124 TARGET1 = librmapplugin.so.1
129 TARGET2 = librmapplugin.so.1.0
125 TARGET2 = librmapplugin.so.1.0
130
126
131 first: all
127 first: all
132 ####### Implicit rules
128 ####### Implicit rules
133
129
134 .SUFFIXES: .o .c .cpp .cc .cxx .C
130 .SUFFIXES: .o .c .cpp .cc .cxx .C
135
131
136 .cpp.o:
132 .cpp.o:
137 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
133 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
138
134
139 .cc.o:
135 .cc.o:
140 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
136 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
141
137
142 .cxx.o:
138 .cxx.o:
143 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
139 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
144
140
145 .C.o:
141 .C.o:
146 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
142 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
147
143
148 .c.o:
144 .c.o:
149 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
145 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
150
146
151 ####### Build rules
147 ####### Build rules
152
148
153 all: Makefile bin/$(TARGET)
149 all: Makefile bin/$(TARGET)
154
150
155 bin/$(TARGET): $(OBJECTS) $(SUBLIBS) $(OBJCOMP)
151 bin/$(TARGET): $(OBJECTS) $(SUBLIBS) $(OBJCOMP)
156 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
152 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
157 -$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)
153 -$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)
158 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP)
154 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP)
159 -ln -s $(TARGET) $(TARGET0)
155 -ln -s $(TARGET) $(TARGET0)
160 -ln -s $(TARGET) $(TARGET1)
156 -ln -s $(TARGET) $(TARGET1)
161 -ln -s $(TARGET) $(TARGET2)
157 -ln -s $(TARGET) $(TARGET2)
162 -$(DEL_FILE) bin/$(TARGET)
158 -$(DEL_FILE) bin/$(TARGET)
163 -$(DEL_FILE) bin/$(TARGET0)
159 -$(DEL_FILE) bin/$(TARGET0)
164 -$(DEL_FILE) bin/$(TARGET1)
160 -$(DEL_FILE) bin/$(TARGET1)
165 -$(DEL_FILE) bin/$(TARGET2)
161 -$(DEL_FILE) bin/$(TARGET2)
166 -$(MOVE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) bin/
162 -$(MOVE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) bin/
167
163
168
164
169
165
170 staticlib: $(TARGETA)
166 staticlib: $(TARGETA)
171
167
172 $(TARGETA): $(OBJECTS) $(OBJCOMP)
168 $(TARGETA): $(OBJECTS) $(OBJCOMP)
173 -$(DEL_FILE) $(TARGETA)
169 -$(DEL_FILE) $(TARGETA)
174 $(AR) $(TARGETA) $(OBJECTS)
170 $(AR) $(TARGETA) $(OBJECTS)
175
171
176 Makefile: rmapplugin.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
172 Makefile: rmapplugin.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
177 /usr/lib64/qt4/mkspecs/common/linux.conf \
173 /usr/lib64/qt4/mkspecs/common/linux.conf \
178 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
174 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
179 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
175 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
180 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
176 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
181 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
177 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
182 /usr/lib64/qt4/mkspecs/qconfig.pri \
178 /usr/lib64/qt4/mkspecs/qconfig.pri \
183 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \
179 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \
184 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
180 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
185 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
181 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
186 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
182 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
187 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
183 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
188 /usr/lib64/qt4/mkspecs/features/release.prf \
184 /usr/lib64/qt4/mkspecs/features/release.prf \
189 /usr/lib64/qt4/mkspecs/features/default_post.prf \
185 /usr/lib64/qt4/mkspecs/features/default_post.prf \
190 /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf \
186 /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf \
191 /usr/lib64/qt4/mkspecs/features/pythonqt.prf \
187 /usr/lib64/qt4/mkspecs/features/pythonqt.prf \
192 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
188 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
193 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
189 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
194 /usr/lib64/qt4/mkspecs/features/qt.prf \
190 /usr/lib64/qt4/mkspecs/features/qt.prf \
195 /usr/lib64/qt4/mkspecs/features/unix/thread.prf \
191 /usr/lib64/qt4/mkspecs/features/unix/thread.prf \
196 /usr/lib64/qt4/mkspecs/features/moc.prf \
192 /usr/lib64/qt4/mkspecs/features/moc.prf \
197 /usr/lib64/qt4/mkspecs/features/resources.prf \
193 /usr/lib64/qt4/mkspecs/features/resources.prf \
198 /usr/lib64/qt4/mkspecs/features/uic.prf \
194 /usr/lib64/qt4/mkspecs/features/uic.prf \
199 /usr/lib64/qt4/mkspecs/features/yacc.prf \
195 /usr/lib64/qt4/mkspecs/features/yacc.prf \
200 /usr/lib64/qt4/mkspecs/features/lex.prf \
196 /usr/lib64/qt4/mkspecs/features/lex.prf \
201 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
197 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
202 /usr/lib64/libQtGui.prl \
198 /usr/lib64/libQtGui.prl \
203 /usr/lib64/libQtCore.prl \
199 /usr/lib64/libQtCore.prl \
204 /usr/lib64/libQtNetwork.prl
200 /usr/lib64/libQtNetwork.prl
205 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro
201 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro
206 /usr/lib64/qt4/mkspecs/common/unix.conf:
202 /usr/lib64/qt4/mkspecs/common/unix.conf:
207 /usr/lib64/qt4/mkspecs/common/linux.conf:
203 /usr/lib64/qt4/mkspecs/common/linux.conf:
208 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
204 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
209 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
205 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
210 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
206 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
211 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
207 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
212 /usr/lib64/qt4/mkspecs/qconfig.pri:
208 /usr/lib64/qt4/mkspecs/qconfig.pri:
213 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri:
209 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri:
214 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
210 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
215 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
211 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
216 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
212 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
217 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
213 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
218 /usr/lib64/qt4/mkspecs/features/release.prf:
214 /usr/lib64/qt4/mkspecs/features/release.prf:
219 /usr/lib64/qt4/mkspecs/features/default_post.prf:
215 /usr/lib64/qt4/mkspecs/features/default_post.prf:
220 /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf:
216 /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf:
221 /usr/lib64/qt4/mkspecs/features/pythonqt.prf:
217 /usr/lib64/qt4/mkspecs/features/pythonqt.prf:
222 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
218 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
223 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
219 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
224 /usr/lib64/qt4/mkspecs/features/qt.prf:
220 /usr/lib64/qt4/mkspecs/features/qt.prf:
225 /usr/lib64/qt4/mkspecs/features/unix/thread.prf:
221 /usr/lib64/qt4/mkspecs/features/unix/thread.prf:
226 /usr/lib64/qt4/mkspecs/features/moc.prf:
222 /usr/lib64/qt4/mkspecs/features/moc.prf:
227 /usr/lib64/qt4/mkspecs/features/resources.prf:
223 /usr/lib64/qt4/mkspecs/features/resources.prf:
228 /usr/lib64/qt4/mkspecs/features/uic.prf:
224 /usr/lib64/qt4/mkspecs/features/uic.prf:
229 /usr/lib64/qt4/mkspecs/features/yacc.prf:
225 /usr/lib64/qt4/mkspecs/features/yacc.prf:
230 /usr/lib64/qt4/mkspecs/features/lex.prf:
226 /usr/lib64/qt4/mkspecs/features/lex.prf:
231 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
227 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
232 /usr/lib64/libQtGui.prl:
228 /usr/lib64/libQtGui.prl:
233 /usr/lib64/libQtCore.prl:
229 /usr/lib64/libQtCore.prl:
234 /usr/lib64/libQtNetwork.prl:
230 /usr/lib64/libQtNetwork.prl:
235 qmake: FORCE
231 qmake: FORCE
236 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro
232 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro
237
233
238 dist:
234 dist:
239 @$(CHK_DIR_EXISTS) obj/rmapplugin1.0.0 || $(MKDIR) obj/rmapplugin1.0.0
235 @$(CHK_DIR_EXISTS) obj/rmapplugin1.0.0 || $(MKDIR) obj/rmapplugin1.0.0
240 $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmappluginui.h rmapplugin.h rmapoperations.h ccsds.h spwpacketreceiver.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 spwpacketreceiver.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
236 $(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
241
237
242
238
243 clean:compiler_clean
239 clean:compiler_clean
244 -$(DEL_FILE) $(OBJECTS)
240 -$(DEL_FILE) $(OBJECTS)
245 -$(DEL_FILE) *~ core *.core
241 -$(DEL_FILE) *~ core *.core
246
242
247
243
248 ####### Sub-libraries
244 ####### Sub-libraries
249
245
250 distclean: clean
246 distclean: clean
251 -$(DEL_FILE) bin/$(TARGET)
247 -$(DEL_FILE) bin/$(TARGET)
252 -$(DEL_FILE) bin/$(TARGET0) bin/$(TARGET1) bin/$(TARGET2) $(TARGETA)
248 -$(DEL_FILE) bin/$(TARGET0) bin/$(TARGET1) bin/$(TARGET2) $(TARGETA)
253 -$(DEL_FILE) Makefile
249 -$(DEL_FILE) Makefile
254
250
255
251
256 check: first
252 check: first
257
253
258 mocclean: compiler_moc_header_clean compiler_moc_source_clean
254 mocclean: compiler_moc_header_clean compiler_moc_source_clean
259
255
260 mocables: compiler_moc_header_make_all compiler_moc_source_make_all
256 mocables: compiler_moc_header_make_all compiler_moc_source_make_all
261
257
262 compiler_moc_header_make_all: moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_spwpacketreceiver.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 moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp
258 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 moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp
263 compiler_moc_header_clean:
259 compiler_moc_header_clean:
264 -$(DEL_FILE) moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_spwpacketreceiver.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 moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp
260 -$(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 moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp
265 moc/moc_rmappluginui.cpp: rmapoperations.h \
261 moc/moc_rmappluginui.cpp: rmapoperations.h \
266 spectralmatricesdmasimulator.h \
262 spectralmatricesdmasimulator.h \
267 stardundee.h \
263 stardundee.h \
268 gresb.h \
264 gresb.h \
269 spwpacketreceiver.h \
270 rmappluginui.h
265 rmappluginui.h
271 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginui.h -o moc/moc_rmappluginui.cpp
266 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginui.h -o moc/moc_rmappluginui.cpp
272
267
273 moc/moc_rmapplugin.cpp: rmappluginui.h \
268 moc/moc_rmapplugin.cpp: rmappluginui.h \
274 rmapoperations.h \
269 rmapoperations.h \
275 spectralmatricesdmasimulator.h \
270 spectralmatricesdmasimulator.h \
276 stardundee.h \
271 stardundee.h \
277 gresb.h \
272 gresb.h \
278 spwpacketreceiver.h \
279 ccsds.h \
273 ccsds.h \
280 rmapplugin.h
274 rmapplugin.h
281 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmapplugin.h -o moc/moc_rmapplugin.cpp
275 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmapplugin.h -o moc/moc_rmapplugin.cpp
282
276
283 moc/moc_spwpacketreceiver.cpp: spwpacketreceiver.h
284 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) spwpacketreceiver.h -o moc/moc_spwpacketreceiver.cpp
285
286 moc/moc_qipdialogbox.cpp: ../common_PLE/qipdialogbox.h
277 moc/moc_qipdialogbox.cpp: ../common_PLE/qipdialogbox.h
287 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../common_PLE/qipdialogbox.h -o moc/moc_qipdialogbox.cpp
278 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../common_PLE/qipdialogbox.h -o moc/moc_qipdialogbox.cpp
288
279
289 moc/moc_gresbstatusenquiry.cpp: ../common_PLE/gresbstatusenquiry.h
280 moc/moc_gresbstatusenquiry.cpp: ../common_PLE/gresbstatusenquiry.h
290 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../common_PLE/gresbstatusenquiry.h -o moc/moc_gresbstatusenquiry.cpp
281 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../common_PLE/gresbstatusenquiry.h -o moc/moc_gresbstatusenquiry.cpp
291
282
292 moc/moc_spectralmatricesdmasimulator.cpp: spectralmatricesdmasimulator.h
283 moc/moc_spectralmatricesdmasimulator.cpp: spectralmatricesdmasimulator.h
293 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) spectralmatricesdmasimulator.h -o moc/moc_spectralmatricesdmasimulator.cpp
284 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) spectralmatricesdmasimulator.h -o moc/moc_spectralmatricesdmasimulator.cpp
294
285
295 moc/moc_rmappluginpythonwrapper.cpp: rmappluginpythonwrapper.h
286 moc/moc_rmappluginpythonwrapper.cpp: rmappluginpythonwrapper.h
296 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginpythonwrapper.h -o moc/moc_rmappluginpythonwrapper.cpp
287 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginpythonwrapper.h -o moc/moc_rmappluginpythonwrapper.cpp
297
288
298 moc/moc_stardundee.cpp: rmapoperations.h \
289 moc/moc_stardundee.cpp: rmapoperations.h \
299 stardundee.h
290 stardundee.h
300 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) stardundee.h -o moc/moc_stardundee.cpp
291 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) stardundee.h -o moc/moc_stardundee.cpp
301
292
302 moc/moc_gresb.cpp: spwpacketreceiver.h \
293 moc/moc_gresb.cpp: rmapoperations.h \
303 rmapoperations.h \
304 gresb.h
294 gresb.h
305 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) gresb.h -o moc/moc_gresb.cpp
295 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) gresb.h -o moc/moc_gresb.cpp
306
296
307 moc/moc_bridge.cpp: bridge.h
297 moc/moc_bridge.cpp: rmapoperations.h \
298 bridge.h
308 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) bridge.h -o moc/moc_bridge.cpp
299 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) bridge.h -o moc/moc_bridge.cpp
309
300
310 moc/moc_genericPySysdriver.cpp: /usr/include/genericPySysdriver.h
301 moc/moc_genericPySysdriver.cpp: /usr/include/genericPySysdriver.h
311 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/genericPySysdriver.h -o moc/moc_genericPySysdriver.cpp
302 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/genericPySysdriver.h -o moc/moc_genericPySysdriver.cpp
312
303
313 moc/moc_lppmonplugin.cpp: /usr/include/lppmonplugin.h
304 moc/moc_lppmonplugin.cpp: /usr/include/lppmonplugin.h
314 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/lppmonplugin.h -o moc/moc_lppmonplugin.cpp
305 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/lppmonplugin.h -o moc/moc_lppmonplugin.cpp
315
306
316 compiler_rcc_make_all:
307 compiler_rcc_make_all:
317 compiler_rcc_clean:
308 compiler_rcc_clean:
318 compiler_image_collection_make_all: qmake_image_collection.cpp
309 compiler_image_collection_make_all: qmake_image_collection.cpp
319 compiler_image_collection_clean:
310 compiler_image_collection_clean:
320 -$(DEL_FILE) qmake_image_collection.cpp
311 -$(DEL_FILE) qmake_image_collection.cpp
321 compiler_moc_source_make_all:
312 compiler_moc_source_make_all:
322 compiler_moc_source_clean:
313 compiler_moc_source_clean:
323 compiler_uic_make_all:
314 compiler_uic_make_all:
324 compiler_uic_clean:
315 compiler_uic_clean:
325 compiler_yacc_decl_make_all:
316 compiler_yacc_decl_make_all:
326 compiler_yacc_decl_clean:
317 compiler_yacc_decl_clean:
327 compiler_yacc_impl_make_all:
318 compiler_yacc_impl_make_all:
328 compiler_yacc_impl_clean:
319 compiler_yacc_impl_clean:
329 compiler_lex_make_all:
320 compiler_lex_make_all:
330 compiler_lex_clean:
321 compiler_lex_clean:
331 compiler_clean: compiler_moc_header_clean
322 compiler_clean: compiler_moc_header_clean
332
323
333 ####### Compile
324 ####### Compile
334
325
335 obj/rmapplugin.o: rmapplugin.cpp rmapplugin.h \
326 obj/rmapplugin.o: rmapplugin.cpp rmapplugin.h \
336 rmappluginui.h \
327 rmappluginui.h \
337 rmapoperations.h \
328 rmapoperations.h \
338 spectralmatricesdmasimulator.h \
329 spectralmatricesdmasimulator.h \
339 stardundee.h \
330 stardundee.h \
340 gresb.h \
331 gresb.h \
341 spwpacketreceiver.h \
342 ccsds.h \
332 ccsds.h \
343 rmappluginpythonwrapper.h
333 rmappluginpythonwrapper.h
344 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapplugin.o rmapplugin.cpp
334 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapplugin.o rmapplugin.cpp
345
335
346 obj/rmappluginui.o: rmappluginui.cpp rmapplugin.h \
336 obj/rmappluginui.o: rmappluginui.cpp rmapplugin.h \
347 rmappluginui.h \
337 rmappluginui.h \
348 rmapoperations.h \
338 rmapoperations.h \
349 spectralmatricesdmasimulator.h \
339 spectralmatricesdmasimulator.h \
350 stardundee.h \
340 stardundee.h \
351 gresb.h \
341 gresb.h \
352 spwpacketreceiver.h \
353 ccsds.h
342 ccsds.h
354 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginui.o rmappluginui.cpp
343 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginui.o rmappluginui.cpp
355
344
356 obj/rmapoperations.o: rmapoperations.cpp rmapoperations.h
345 obj/rmapoperations.o: rmapoperations.cpp rmapoperations.h
357 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapoperations.o rmapoperations.cpp
346 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapoperations.o rmapoperations.cpp
358
347
359 obj/ccsds.o: ccsds.cpp ccsds.h
348 obj/ccsds.o: ccsds.cpp ccsds.h
360 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/ccsds.o ccsds.cpp
349 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/ccsds.o ccsds.cpp
361
350
362 obj/spwpacketreceiver.o: spwpacketreceiver.cpp spwpacketreceiver.h \
363 rmapoperations.h
364 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/spwpacketreceiver.o spwpacketreceiver.cpp
365
366 obj/qipdialogbox.o: ../common_PLE/qipdialogbox.cpp ../common_PLE/qipdialogbox.h
351 obj/qipdialogbox.o: ../common_PLE/qipdialogbox.cpp ../common_PLE/qipdialogbox.h
367 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/qipdialogbox.o ../common_PLE/qipdialogbox.cpp
352 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/qipdialogbox.o ../common_PLE/qipdialogbox.cpp
368
353
369 obj/gresbstatusenquiry.o: ../common_PLE/gresbstatusenquiry.cpp ../common_PLE/gresbstatusenquiry.h
354 obj/gresbstatusenquiry.o: ../common_PLE/gresbstatusenquiry.cpp ../common_PLE/gresbstatusenquiry.h
370 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/gresbstatusenquiry.o ../common_PLE/gresbstatusenquiry.cpp
355 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/gresbstatusenquiry.o ../common_PLE/gresbstatusenquiry.cpp
371
356
372 obj/spectralmatricesdmasimulator.o: spectralmatricesdmasimulator.cpp spectralmatricesdmasimulator.h
357 obj/spectralmatricesdmasimulator.o: spectralmatricesdmasimulator.cpp spectralmatricesdmasimulator.h
373 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/spectralmatricesdmasimulator.o spectralmatricesdmasimulator.cpp
358 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/spectralmatricesdmasimulator.o spectralmatricesdmasimulator.cpp
374
359
375 obj/rmappluginpythonwrapper.o: rmappluginpythonwrapper.cpp rmappluginpythonwrapper.h
360 obj/rmappluginpythonwrapper.o: rmappluginpythonwrapper.cpp rmappluginpythonwrapper.h
376 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginpythonwrapper.o rmappluginpythonwrapper.cpp
361 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginpythonwrapper.o rmappluginpythonwrapper.cpp
377
362
378 obj/stardundee.o: stardundee.cpp stardundee.h \
363 obj/stardundee.o: stardundee.cpp stardundee.h \
379 rmapoperations.h
364 rmapoperations.h
380 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/stardundee.o stardundee.cpp
365 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/stardundee.o stardundee.cpp
381
366
382 obj/gresb.o: gresb.cpp gresb.h \
367 obj/gresb.o: gresb.cpp gresb.h \
383 spwpacketreceiver.h \
384 rmapoperations.h
368 rmapoperations.h
385 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/gresb.o gresb.cpp
369 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/gresb.o gresb.cpp
386
370
387 obj/bridge.o: bridge.cpp bridge.h
371 obj/bridge.o: bridge.cpp bridge.h \
372 rmapoperations.h
388 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/bridge.o bridge.cpp
373 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/bridge.o bridge.cpp
389
374
390 obj/lppmonplugininterface.o: /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.h \
375 obj/lppmonplugininterface.o: /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.h \
391 /usr/include/lppmon/pluginsInterface/lppmonplugininterface_global.h
376 /usr/include/lppmon/pluginsInterface/lppmonplugininterface_global.h
392 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/lppmonplugininterface.o /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp
377 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/lppmonplugininterface.o /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp
393
378
394 obj/moc_rmappluginui.o: moc/moc_rmappluginui.cpp
379 obj/moc_rmappluginui.o: moc/moc_rmappluginui.cpp
395 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmappluginui.o moc/moc_rmappluginui.cpp
380 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmappluginui.o moc/moc_rmappluginui.cpp
396
381
397 obj/moc_rmapplugin.o: moc/moc_rmapplugin.cpp
382 obj/moc_rmapplugin.o: moc/moc_rmapplugin.cpp
398 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmapplugin.o moc/moc_rmapplugin.cpp
383 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmapplugin.o moc/moc_rmapplugin.cpp
399
384
400 obj/moc_spwpacketreceiver.o: moc/moc_spwpacketreceiver.cpp
401 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_spwpacketreceiver.o moc/moc_spwpacketreceiver.cpp
402
403 obj/moc_qipdialogbox.o: moc/moc_qipdialogbox.cpp
385 obj/moc_qipdialogbox.o: moc/moc_qipdialogbox.cpp
404 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_qipdialogbox.o moc/moc_qipdialogbox.cpp
386 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_qipdialogbox.o moc/moc_qipdialogbox.cpp
405
387
406 obj/moc_gresbstatusenquiry.o: moc/moc_gresbstatusenquiry.cpp
388 obj/moc_gresbstatusenquiry.o: moc/moc_gresbstatusenquiry.cpp
407 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_gresbstatusenquiry.o moc/moc_gresbstatusenquiry.cpp
389 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_gresbstatusenquiry.o moc/moc_gresbstatusenquiry.cpp
408
390
409 obj/moc_spectralmatricesdmasimulator.o: moc/moc_spectralmatricesdmasimulator.cpp
391 obj/moc_spectralmatricesdmasimulator.o: moc/moc_spectralmatricesdmasimulator.cpp
410 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_spectralmatricesdmasimulator.o moc/moc_spectralmatricesdmasimulator.cpp
392 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_spectralmatricesdmasimulator.o moc/moc_spectralmatricesdmasimulator.cpp
411
393
412 obj/moc_rmappluginpythonwrapper.o: moc/moc_rmappluginpythonwrapper.cpp
394 obj/moc_rmappluginpythonwrapper.o: moc/moc_rmappluginpythonwrapper.cpp
413 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmappluginpythonwrapper.o moc/moc_rmappluginpythonwrapper.cpp
395 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmappluginpythonwrapper.o moc/moc_rmappluginpythonwrapper.cpp
414
396
415 obj/moc_stardundee.o: moc/moc_stardundee.cpp
397 obj/moc_stardundee.o: moc/moc_stardundee.cpp
416 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_stardundee.o moc/moc_stardundee.cpp
398 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_stardundee.o moc/moc_stardundee.cpp
417
399
418 obj/moc_gresb.o: moc/moc_gresb.cpp
400 obj/moc_gresb.o: moc/moc_gresb.cpp
419 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_gresb.o moc/moc_gresb.cpp
401 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_gresb.o moc/moc_gresb.cpp
420
402
421 obj/moc_bridge.o: moc/moc_bridge.cpp
403 obj/moc_bridge.o: moc/moc_bridge.cpp
422 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_bridge.o moc/moc_bridge.cpp
404 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_bridge.o moc/moc_bridge.cpp
423
405
424 obj/moc_genericPySysdriver.o: moc/moc_genericPySysdriver.cpp
406 obj/moc_genericPySysdriver.o: moc/moc_genericPySysdriver.cpp
425 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_genericPySysdriver.o moc/moc_genericPySysdriver.cpp
407 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_genericPySysdriver.o moc/moc_genericPySysdriver.cpp
426
408
427 obj/moc_lppmonplugin.o: moc/moc_lppmonplugin.cpp
409 obj/moc_lppmonplugin.o: moc/moc_lppmonplugin.cpp
428 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_lppmonplugin.o moc/moc_lppmonplugin.cpp
410 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_lppmonplugin.o moc/moc_lppmonplugin.cpp
429
411
430 ####### Install
412 ####### Install
431
413
432 install_target: first FORCE
414 install_target: first FORCE
433 @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/ || $(MKDIR) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/
415 @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/ || $(MKDIR) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/
434 -$(INSTALL_PROGRAM) "bin/$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET)"
416 -$(INSTALL_PROGRAM) "bin/$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET)"
435 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET0)"
417 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET0)"
436 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET1)"
418 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET1)"
437 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET2)"
419 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET2)"
438
420
439 uninstall_target: FORCE
421 uninstall_target: FORCE
440 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET)"
422 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET)"
441 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET0)"
423 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET0)"
442 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET1)"
424 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET1)"
443 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET2)"
425 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET2)"
444 -$(DEL_DIR) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/
426 -$(DEL_DIR) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/
445
427
446
428
447 install: install_target FORCE
429 install: install_target FORCE
448
430
449 uninstall: uninstall_target FORCE
431 uninstall: uninstall_target FORCE
450
432
451 FORCE:
433 FORCE:
452
434
@@ -1,799 +1,766
1 #include "gresb.h"
1 #include "gresb.h"
2 #include <QTime>
2 #include <QTime>
3 #include <QHostAddress>
3 #include <QHostAddress>
4
4
5 gresb::gresb(QWidget *parent) :
5 gresb::gresb(QWidget *parent) :
6 QWidget(parent)
6 QWidget(parent)
7 {
7 {
8 RMAPSend_SOCKET = new QTcpSocket;
8 RMAPSend_SOCKET = new QTcpSocket;
9 RMAPReceive_SOCKET = new QTcpSocket;
9 RMAPReceive_SOCKET = new QTcpSocket;
10 GRESBStatusQuery_SOCKET = new QTcpSocket;
10 GRESBStatusQuery_SOCKET = new QTcpSocket;
11
11
12 rmapPacketSEMAPHORE = new QSemaphore;
12 rmapPacketSEMAPHORE = new QSemaphore;
13 ccsdsPacketSEMAPHORE = new QSemaphore;
13 ccsdsPacketSEMAPHORE = new QSemaphore;
14 rmapPacket = (char*) malloc(RMAP_MAX_PACKET_LENGTH);
14 rmapPacket = (char*) malloc(RMAP_MAX_PACKET_LENGTH);
15 ccsdsPacket = (unsigned char*) malloc(CCSDS_MAX_PACKET_LENGTH);
15 ccsdsPacket = (unsigned char*) malloc(CCSDS_MAX_PACKET_LENGTH);
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
19
20 //*** QLABEL ***//
20 //*** QLABEL ***//
21 gresbBridgeIPLabel = new QLabel(tr("GRESB Bridge IP: "));
21 gresbBridgeIPLabel = new QLabel(tr("GRESB Bridge IP: "));
22 gresbVirtualLinkLabel = new QLabel(tr("GRESB Virtual Link: "));
22 gresbVirtualLinkLabel = new QLabel(tr("GRESB Virtual Link: "));
23 spwLinkLabel = new QLabel(tr("GRESB SPW Link: "));
23 spwLinkLabel = new QLabel(tr("GRESB SPW Link: "));
24 rmapSourceLogicalAddressLabel = new QLabel(tr("RMAP Source Logical Address: "));
24 rmapSourceLogicalAddressLabel = new QLabel(tr("RMAP Source Logical Address: "));
25 rmapSendStateLabel = new QLabel(tr("RMAP Send Socket State: waiting for connection"));
25 rmapSendStateLabel = new QLabel(tr("RMAP Send Socket State: waiting for connection"));
26 rmapReceiveStateLabel = new QLabel(tr("RMAP Receive Socket State: waiting for connection"));
26 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"));
27 gresbStatusQueryLabel = new QLabel(tr("GRESB status query socket (port 3010): waiting for connection"));
28 gresbStatusQueryDialogLabel = new QLabel(tr("sockets opened but SpaceWire link not running"));
28 gresbStatusQueryDialogLabel = new QLabel(tr("sockets opened but SpaceWire link not running"));
29
29
30 //*** SPINBOX ***//
30 //*** SPINBOX ***//
31 gresbVirtualLinkSpinBox = new QSpinBox;
31 gresbVirtualLinkSpinBox = new QSpinBox;
32 rmapSourceLogicalAddressSpinBox = 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);
36 rmapSourceLogicalAddressSpinBox->setRange(0, 255);
37 rmapSourceLogicalAddressSpinBox->setValue(33);
37 rmapSourceLogicalAddressSpinBox->setValue(33);
38 spwLinkSpinBox->setRange(0, 2);
38 spwLinkSpinBox->setRange(0, 2);
39 spwLinkSpinBox->setValue(0);
39 spwLinkSpinBox->setValue(0);
40
40
41 //*** QPUSHBUTTON ***//
41 //*** QPUSHBUTTON ***//
42 gresbStatusQueryRetryButton = new QPushButton(tr("Retry"));
42 gresbStatusQueryRetryButton = new QPushButton(tr("Retry"));
43 gresbStatusQueryAbortButton = new QPushButton(tr("Abort"));
43 gresbStatusQueryAbortButton = new QPushButton(tr("Abort"));
44
44
45 //*** LAYOUT ***//
45 //*** LAYOUT ***//
46 connectionLayout = new QGridLayout;
46 connectionLayout = new QGridLayout;
47
47
48 //*** MISC ***//
48 //*** MISC ***//
49 gresbStatusQueryDialog = new QDialog;
49 gresbStatusQueryDialog = new QDialog;
50 gresbBridgeIPDialogBox = new QIPDialogBox;
50 gresbBridgeIPDialogBox = new QIPDialogBox;
51 spwLinkStatusEnquiry = new gresbStatusEnquiry;
51 spwLinkStatusEnquiry = new gresbStatusEnquiry;
52
52
53 connectionLayout->addWidget(gresbBridgeIPLabel, 0, 0, 0);
53 connectionLayout->addWidget(gresbBridgeIPLabel, 0, 0, 0);
54 connectionLayout->addWidget(gresbBridgeIPDialogBox, 0, 1, 0);
54 connectionLayout->addWidget(gresbBridgeIPDialogBox, 0, 1, 0);
55 connectionLayout->addWidget(gresbVirtualLinkLabel, 1, 0, 0);
55 connectionLayout->addWidget(gresbVirtualLinkLabel, 1, 0, 0);
56 connectionLayout->addWidget(gresbVirtualLinkSpinBox, 1, 1, 0);
56 connectionLayout->addWidget(gresbVirtualLinkSpinBox, 1, 1, 0);
57 connectionLayout->addWidget(spwLinkLabel, 2, 0, 0);
57 connectionLayout->addWidget(spwLinkLabel, 2, 0, 0);
58 connectionLayout->addWidget(spwLinkSpinBox, 2, 1, 0);
58 connectionLayout->addWidget(spwLinkSpinBox, 2, 1, 0);
59 connectionLayout->addWidget(rmapSourceLogicalAddressLabel, 3, 0, 0);
59 connectionLayout->addWidget(rmapSourceLogicalAddressLabel, 3, 0, 0);
60 connectionLayout->addWidget(rmapSourceLogicalAddressSpinBox, 3, 1, 0);
60 connectionLayout->addWidget(rmapSourceLogicalAddressSpinBox, 3, 1, 0);
61 connectionLayout->addWidget(rmapSendStateLabel, 4, 0, 1, 2);
61 connectionLayout->addWidget(rmapSendStateLabel, 4, 0, 1, 2);
62 connectionLayout->addWidget(rmapReceiveStateLabel, 5, 0, 1, 2);
62 connectionLayout->addWidget(rmapReceiveStateLabel, 5, 0, 1, 2);
63 connectionLayout->addWidget(gresbStatusQueryLabel, 6, 0, 1, 2);
63 connectionLayout->addWidget(gresbStatusQueryLabel, 6, 0, 1, 2);
64
64
65 connectionLayout->setRowStretch(7, 1);
65 connectionLayout->setRowStretch(7, 1);
66 connectionLayout->setColumnStretch(2, 1);
66 connectionLayout->setColumnStretch(2, 1);
67
67
68 // GRESB STATUS QUERY DIALOG
68 // GRESB STATUS QUERY DIALOG
69 gresbStatusQueryDialogLayout = new QGridLayout;
69 gresbStatusQueryDialogLayout = new QGridLayout;
70 gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryDialogLabel, 0, 0, 1, 2);
70 gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryDialogLabel, 0, 0, 1, 2);
71 gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryRetryButton, 1, 0, 0);
71 gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryRetryButton, 1, 0, 0);
72 gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryAbortButton, 1, 1, 0);
72 gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryAbortButton, 1, 1, 0);
73 gresbStatusQueryDialog->setLayout(gresbStatusQueryDialogLayout);
73 gresbStatusQueryDialog->setLayout(gresbStatusQueryDialogLayout);
74
74
75 this->setLayout(connectionLayout);
75 this->setLayout(connectionLayout);
76
76
77 connect(RMAPSend_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(RMAPSendConnectionState(QAbstractSocket::SocketState)));
77 connect(RMAPSend_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(RMAPSendConnectionState(QAbstractSocket::SocketState)));
78 connect(RMAPReceive_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(RMAPReceiveConnectionState(QAbstractSocket::SocketState)));
78 connect(RMAPReceive_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(RMAPReceiveConnectionState(QAbstractSocket::SocketState)));
79 connect(GRESBStatusQuery_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(GRESBConnectionState(QAbstractSocket::SocketState)));
79 connect(GRESBStatusQuery_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(GRESBConnectionState(QAbstractSocket::SocketState)));
80 connect(gresbStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink()));
80 connect(gresbStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink()));
81 connect(gresbStatusQueryAbortButton, SIGNAL(clicked()), gresbStatusQueryDialog, SLOT(reject()));
81 connect(spwLinkStatusEnquiry->readSPWStatusButton, SIGNAL(clicked()), this, SLOT(GRESBStatusQuery()));
82 connect(spwLinkStatusEnquiry->readSPWStatusButton, SIGNAL(clicked()), this, SLOT(GRESBStatusQuery()));
82 connect(this->RMAPReceive_SOCKET, SIGNAL(readyRead()), this, SLOT(receiveSPWPacket()));
83 connect(this->RMAPReceive_SOCKET, SIGNAL(readyRead()), this, SLOT(receiveSPWPacket()));
83
84 connect(gresbStatusQueryAbortButton, SIGNAL(clicked()), gresbStatusQueryDialog, SLOT(reject()));
85 connect(this->RMAPReceive_SOCKET, SIGNAL(readyRead()), this, SLOT(receiveSPWPacket()));
86 }
84 }
87
85
88 gresb::~gresb()
86 gresb::~gresb()
89 {
87 {
90 free(rmapPacket);
88 free(rmapPacket);
91 free(ccsdsPacket);
89 free(ccsdsPacket);
92 free(spwPacket);
90 free(spwPacket);
93 }
91 }
94
92
95 unsigned int gresb::Write(unsigned int *Value, unsigned int count, unsigned int address)
93 unsigned int gresb::Write(unsigned int *Value, unsigned int count, unsigned int address)
96 {
94 {
97 unsigned int remainingCount = count;
95 unsigned int remainingCount = count;
98 unsigned int iOffset = 0;
96 unsigned int iOffset = 0;
99 QString console_message;
97 QString console_message;
100 char* data;
98 char* data;
101
99
102 if(rmapPacketSEMAPHORE->available()!=0)
100 if(rmapPacketSEMAPHORE->available()!=0)
103 {
101 {
104 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP request already running, WRITE access stopped");
102 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP request already running, WRITE access stopped");
105 return 1;
103 return 1;
106 }
104 }
107
105
108 RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable");
106 RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable");
109
107
110 data = (char*) malloc(READ_WRITE_MAX_COUNTS*4);
108 data = (char*) malloc(READ_WRITE_MAX_COUNTS*4);
111
109
112 emit appendToLog(QString("*** START *** WRITE ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
110 emit appendToLog(QString("*** START *** WRITE ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
113
111
114 while (remainingCount > READ_WRITE_MAX_COUNTS)
112 while (remainingCount > READ_WRITE_MAX_COUNTS)
115 {
113 {
116 for (int i = 0; i<READ_WRITE_MAX_COUNTS; i++)
114 for (int i = 0; i<READ_WRITE_MAX_COUNTS; i++)
117 {
115 {
118 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
116 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
119 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
117 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
120 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
118 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
121 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
119 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
122 }
120 }
123
121
124 console_message.sprintf("remainingCount: %d => ", remainingCount);
122 console_message.sprintf("remainingCount: %d => ", remainingCount);
125 emit appendToLog(console_message + QString("Write ")+ QString::number(READ_WRITE_MAX_COUNTS*4) + QString(" byte(s) @0x")+ QString::number(address,16));
123 emit appendToLog(console_message + QString("Write ")+ QString::number(READ_WRITE_MAX_COUNTS*4) + QString(" byte(s) @0x")+ QString::number(address,16));
126
124
127 if(WriteBLOCK(data, READ_WRITE_MAX_COUNTS*4, address)==0)
125 if(WriteBLOCK(data, READ_WRITE_MAX_COUNTS*4, address)==0)
128 {
126 {
129 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
127 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
130 return 1;
128 return 1;
131 }
129 }
132
130
133 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
131 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
134 address = address + READ_WRITE_MAX_COUNTS * 4;
132 address = address + READ_WRITE_MAX_COUNTS * 4;
135 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
133 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
136 }
134 }
137
135
138 if (remainingCount > 0)
136 if (remainingCount > 0)
139 {
137 {
140 for (unsigned int i = 0; i<remainingCount; i++)
138 for (unsigned int i = 0; i<remainingCount; i++)
141 {
139 {
142 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
140 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
143 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
141 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
144 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
142 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
145 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
143 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
146 }
144 }
147
145
148 console_message.sprintf("remainingCount: %d => ", remainingCount);
146 console_message.sprintf("remainingCount: %d => ", remainingCount);
149 emit appendToLog(console_message + QString("Write ")+ QString::number(remainingCount*4) + QString(" byte(s) @0x")+ QString::number(address,16));
147 emit appendToLog(console_message + QString("Write ")+ QString::number(remainingCount*4) + QString(" byte(s) @0x")+ QString::number(address,16));
150
148
151 if (WriteBLOCK(data, remainingCount*4, address)==0)
149 if (WriteBLOCK(data, remainingCount*4, address)==0)
152 {
150 {
153 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
151 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
154 return 1;
152 return 1;
155 }
153 }
156 }
154 }
157
155
158 emit appendToLog(QString("*** STOP *** WRITE"));
156 emit appendToLog(QString("*** STOP *** WRITE"));
159 free(data);
157 free(data);
160 return count;
158 return count;
161 }
159 }
162
160
163 unsigned int gresb::Read(unsigned int *Value, unsigned int count, unsigned int address)
161 unsigned int gresb::Read(unsigned int *Value, unsigned int count, unsigned int address)
164 {
162 {
165 unsigned int remainingCount = count;
163 unsigned int remainingCount = count;
166 unsigned int iOffset = 0;
164 unsigned int iOffset = 0;
167 QString console_message;
165 QString console_message;
168
166
169 if(rmapPacketSEMAPHORE->available()!=0)
167 if(rmapPacketSEMAPHORE->available()!=0)
170 {
168 {
171 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP request already running, READ access stopped");
169 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP request already running, READ access stopped");
172 return 1;
170 return 1;
173 }
171 }
174 emit appendToLog(QString("*** START *** READ ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
172 emit appendToLog(QString("*** START *** READ ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
175
173
176 while (remainingCount > READ_WRITE_MAX_COUNTS)
174 while (remainingCount > READ_WRITE_MAX_COUNTS)
177 {
175 {
178 console_message.sprintf("remainingCount: %d => ", remainingCount);
176 console_message.sprintf("remainingCount: %d => ", remainingCount);
179 emit appendToLog(console_message + QString("Read ")+ QString::number(4*READ_WRITE_MAX_COUNTS) + QString(" byte(s) @0x")+ QString::number(address,16));
177 emit appendToLog(console_message + QString("Read ")+ QString::number(4*READ_WRITE_MAX_COUNTS) + QString(" byte(s) @0x")+ QString::number(address,16));
180
178
181 if (ReadBLOCK(READ_WRITE_MAX_COUNTS*4, address)==0)
179 if (ReadBLOCK(READ_WRITE_MAX_COUNTS*4, address)==0)
182 {
180 {
183 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
181 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
184 return 1;
182 return 1;
185 }
183 }
186
184
187 for(int i=0;i<READ_WRITE_MAX_COUNTS;i++)
185 for(int i=0;i<READ_WRITE_MAX_COUNTS;i++)
188 {
186 {
189 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
187 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
190 for(int j=1;j<4;j++)
188 for(int j=1;j<4;j++)
191 {
189 {
192 Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256;
190 Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256;
193 }
191 }
194 }
192 }
195
193
196 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
194 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
197 address = address + READ_WRITE_MAX_COUNTS * 4;
195 address = address + READ_WRITE_MAX_COUNTS * 4;
198 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
196 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
199 acquireRMAPSemaphore();
197 rmapPacketSEMAPHORE->acquire();
200 }
198 }
201
199
202 if (remainingCount > 0)
200 if (remainingCount > 0)
203 {
201 {
204 console_message.sprintf("remainingCount: %d => ", remainingCount);
202 console_message.sprintf("remainingCount: %d => ", remainingCount);
205 emit appendToLog(console_message + QString("Read ")+ QString::number(4*remainingCount) + QString(" byte(s) @0x")+ QString::number(address,16));
203 emit appendToLog(console_message + QString("Read ")+ QString::number(4*remainingCount) + QString(" byte(s) @0x")+ QString::number(address,16));
206
204
207 if (ReadBLOCK(4*remainingCount, address)==0)
205 if (ReadBLOCK(4*remainingCount, address)==0)
208 {
206 {
209 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
207 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
210 return 1;
208 return 1;
211 }
209 }
212
210
213 for(unsigned int i=0;i<remainingCount;i++)
211 for(unsigned int i=0;i<remainingCount;i++)
214 {
212 {
215 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
213 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
216 for(int j=1;j<4;j++)
214 for(int j=1;j<4;j++)
217 {
215 {
218 Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256;
216 Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256;
219 }
217 }
220 }
218 }
221 acquireRMAPSemaphore();
219 rmapPacketSEMAPHORE->acquire();
222 }
220 }
223
221
224 emit appendToLog(QString("*** STOP *** READ "));
222 emit appendToLog(QString("*** STOP *** READ "));
225 return count;
223 return count;
226 }
224 }
227
225
228 unsigned int gresb::WriteBLOCK(char *data, unsigned int nbBytes, unsigned int address)
226 unsigned int gresb::WriteBLOCK(char *data, unsigned int nbBytes, unsigned int address)
229 {
227 {
230 QTime RMAPTimeout;
228 QTime RMAPTimeout;
231 RMAP *RMAPCommand;
229 RMAP *RMAPCommand;
232 int errorCode;
230 int errorCode;
233 QString console_message;
231 QString console_message;
234
232
235 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1)
233 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1)
236 {
234 {
237 this->Close();
235 this->Close();
238 return 1;
236 return 1;
239 }
237 }
240
238
241 RMAPCommand = new RMAP(commandCode,
239 RMAPCommand = new RMAP(commandCode,
242 rmapTargetLogicalAddress,
240 rmapTargetLogicalAddress,
243 rmapSourceLogicalAddressSpinBox->value(),
241 rmapSourceLogicalAddressSpinBox->value(),
244 address,
242 address,
245 nbBytes,
243 nbBytes,
246 data);
244 data);
247
245
248 // SEND GRESB HEADER
246 // SEND GRESB HEADER
249 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->GRESBHeader), 4);
247 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->GRESBHeader), 4);
250 // SEND SPACEWIRE PACKET HEADER
248 // SEND SPACEWIRE PACKET HEADER
251 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->RMAPHeader), sizeof(RMAPCommand->RMAPHeader));
249 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->RMAPHeader), sizeof(RMAPCommand->RMAPHeader));
252 // SEND DATA
250 // SEND DATA
253 RMAPSend_SOCKET->write( data, nbBytes);
251 RMAPSend_SOCKET->write( data, nbBytes);
254 // SEND DATA CRC
252 // SEND DATA CRC
255 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->dataCRC), 1);
253 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->dataCRC), 1);
256 RMAPTimeout.start();
254 RMAPTimeout.start();
257 while(RMAPSend_SOCKET->bytesToWrite() > 0)
255 while(RMAPSend_SOCKET->bytesToWrite() > 0)
258 {
256 {
259 RMAPSend_SOCKET->waitForBytesWritten(100);
257 RMAPSend_SOCKET->waitForBytesWritten(100);
260 if(RMAPTimeout.elapsed()>1000)
258 if(RMAPTimeout.elapsed()>1000)
261 {
259 {
262 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** sending Write RMAP Command timeout");
260 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** sending Write RMAP Command timeout");
263 return 0;
261 return 0;
264 }
262 }
265 }
263 }
266
264
267 if ( (commandCode == writeSingle_noVer_Rep) | (commandCode == writeInc_noVer_Rep) |
265 if ( (commandCode == writeSingle_noVer_Rep) | (commandCode == writeInc_noVer_Rep) |
268 (commandCode == writeSingle_ver_rep) | (commandCode == writeInc_ver_rep) )
266 (commandCode == writeSingle_ver_rep) | (commandCode == writeInc_ver_rep) )
269 {
267 {
270 // WAIT FOR THE RMAP REPLY PACKET
268 // WAIT FOR THE RMAP REPLY PACKET
271 errorCode = receiveSPWPacket(1);
269 errorCode = receiveSPWPacket(1);
272 if (errorCode<=0)
270 if (errorCode<=0)
273 {
271 {
274 emit appendToLog("WARNING === in function WriteBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode));
272 emit appendToLog("WARNING === in function WriteBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode));
275 return 0;
273 return 0;
276 }
274 }
277 if(rmapPacketSize != 8)
275 if(rmapPacketSize != 8)
278 {
276 {
279 console_message.sprintf("WARNING === in function WRITE (with reply) of rmapplugin *** write reply format not compliant\n");
277 console_message.sprintf("WARNING === in function WRITE (with reply) of rmapplugin *** write reply format not compliant\n");
280 emit appendToLog(console_message);
278 emit appendToLog(console_message);
281 return 0;
279 return 0;
282 }
280 }
283 switch (rmapPacket[3]) // byte 4 is the status byte in the reply
281 switch (rmapPacket[3]) // byte 4 is the status byte in the reply
284 {
282 {
285 case 0:
283 case 0:
286 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 0 Successfull");
284 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 0 Successfull");
287 break;
285 break;
288 case 1:
286 case 1:
289 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** General error code");
287 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** General error code");
290 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 1 General error code");
288 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 1 General error code");
291 break;
289 break;
292 case 2:
290 case 2:
293 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Unused RMAP packet type or command code");
291 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Unused RMAP packet type or command code");
294 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 2 Unused RMAP packet type or command code");
292 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 2 Unused RMAP packet type or command code");
295 break;
293 break;
296 case 3:
294 case 3:
297 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid key");
295 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid key");
298 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 3 Invalid key");
296 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 3 Invalid key");
299 break;
297 break;
300 case 4:
298 case 4:
301 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid data CRC");
299 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid data CRC");
302 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 4 Invalid data CRC");
300 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 4 Invalid data CRC");
303 break;
301 break;
304 case 5:
302 case 5:
305 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Early EOP");
303 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Early EOP");
306 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 5 Early EOP");
304 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 5 Early EOP");
307 break;
305 break;
308 case 6:
306 case 6:
309 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Too much data");
307 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Too much data");
310 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 6 Too much data");
308 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 6 Too much data");
311 break;
309 break;
312 case 7:
310 case 7:
313 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** EEP");
311 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** EEP");
314 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 7 EEP");
312 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 7 EEP");
315 break;
313 break;
316 case 8:
314 case 8:
317 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Reserved");
315 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Reserved");
318 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 8 Reserved");
316 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 8 Reserved");
319 break;
317 break;
320 case 9:
318 case 9:
321 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Verify buffer overrun");
319 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Verify buffer overrun");
322 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 9 Verify buffer overrun");
320 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 9 Verify buffer overrun");
323 break;
321 break;
324 case 10:
322 case 10:
325 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMAP command not implemented or not authorised");
323 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMAP command not implemented or not authorised");
326 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 10 RMAP command not implemented or not authorised");
324 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 10 RMAP command not implemented or not authorised");
327 break;
325 break;
328 case 11:
326 case 11:
329 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMW data length error");
327 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMW data length error");
330 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 11 RMAP RMW data length error");
328 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 11 RMAP RMW data length error");
331 break;
329 break;
332 case 12:
330 case 12:
333 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid target logical address");
331 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid target logical address");
334 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 12 Invalid target logical address");
332 RMAP_write_reply_setText("reply to the write command required\nlast reply status: 12 Invalid target logical address");
335 break;
333 break;
336 }
334 }
337 acquireRMAPSemaphore();
335 acquireRMAPSemaphore();
338 }
336 }
339 return nbBytes;
337 return nbBytes;
340 }
338 }
341
339
342 unsigned int gresb::ReadBLOCK(unsigned int nbBytes, unsigned int address)
340 unsigned int gresb::ReadBLOCK(unsigned int nbBytes, unsigned int address)
343 {
341 {
344 int errorCode;
342 int errorCode;
345 RMAP *RMAPCommand;
343 RMAP *RMAPCommand;
346 QTime RMAPTimeout;
344 QTime RMAPTimeout;
347 unsigned int dataLength;
345 unsigned int dataLength;
348 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1)
346 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1)
349 {
347 {
350 this->Close();
348 this->Close();
351 return 1;
349 return 1;
352 }
350 }
353
351
354 if (nbBytes > 4)
352 if (nbBytes > 4)
355 {
353 {
356 RMAPCommand = new RMAP(read_Inc,
354 RMAPCommand = new RMAP(read_Inc,
357 rmapTargetLogicalAddress,
355 rmapTargetLogicalAddress,
358 rmapSourceLogicalAddressSpinBox->value(),
356 rmapSourceLogicalAddressSpinBox->value(),
359 address,
357 address,
360 nbBytes,
358 nbBytes,
361 NULL);
359 NULL);
362 }
360 }
363 else
361 else
364 {
362 {
365 RMAPCommand = new RMAP(read_Single,
363 RMAPCommand = new RMAP(read_Single,
366 rmapTargetLogicalAddress,
364 rmapTargetLogicalAddress,
367 rmapSourceLogicalAddressSpinBox->value(),
365 rmapSourceLogicalAddressSpinBox->value(),
368 address,
366 address,
369 nbBytes,
367 nbBytes,
370 NULL);
368 NULL);
371 }
369 }
372
370
373 // SEND THE GRESB HEADER FOR THE RMAP READ COMMAND
371 // SEND THE GRESB HEADER FOR THE RMAP READ COMMAND
374 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->GRESBHeader), 4);
372 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->GRESBHeader), 4);
375 // SEND THE SPACEWIRE PACKET FOR THE RMAP READ COMMAND
373 // SEND THE SPACEWIRE PACKET FOR THE RMAP READ COMMAND
376 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->RMAPHeader), sizeof(RMAPCommand->RMAPHeader));
374 RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->RMAPHeader), sizeof(RMAPCommand->RMAPHeader));
377 RMAPSend_SOCKET->waitForBytesWritten(100);
375 RMAPSend_SOCKET->waitForBytesWritten(100);
378 RMAPTimeout.start();
376 RMAPTimeout.start();
379 // write timeout
377 // write timeout
380 while(RMAPSend_SOCKET->bytesToWrite() > 0)
378 while(RMAPSend_SOCKET->bytesToWrite() > 0)
381 {
379 {
382 RMAPSend_SOCKET->waitForBytesWritten(100);
380 RMAPSend_SOCKET->waitForBytesWritten(100);
383 if(RMAPTimeout.elapsed()>1000)
381 if(RMAPTimeout.elapsed()>1000)
384 {
382 {
385 emit appendToLog("WARNING === in function READ of rmapplugin *** sending Read RMAP Command timeout\n");
383 emit appendToLog("WARNING === in function READ of rmapplugin *** sending Read RMAP Command timeout\n");
386 return 0;
384 return 0;
387 }
385 }
388 }
386 }
389
387
390 // RECEIVE THE INCOMING RMAP PACKET
388 // RECEIVE THE INCOMING RMAP PACKET
391 errorCode = receiveSPWPacket(1); // request ID 1 is for RMAP packet
389 errorCode = receiveSPWPacket(1); // request ID 1 is for RMAP packet
392 if (errorCode<=0)
390 if (errorCode<=0)
393 {
391 {
394 emit appendToLog("WARNING === in function ReadBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode));
392 emit appendToLog("WARNING === in function ReadBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode));
395 return 0;
393 return 0;
396 }
394 }
397 dataLength = rmapPacketSize - RMAP_READ_REPLY_HEADER_LENGTH - RMAP_DATA_CRC_LENGTH;
395 dataLength = rmapPacketSize - RMAP_READ_REPLY_HEADER_LENGTH - RMAP_DATA_CRC_LENGTH;
398 if(dataLength != nbBytes)
396 if(dataLength != nbBytes)
399 {
397 {
400 emit appendToLog("WARNING === in function READ of rmapplugin *** number of data received ("
398 emit appendToLog("WARNING === in function READ of rmapplugin *** number of data received ("
401 +QString::number(dataLength)
399 +QString::number(dataLength)
402 +") not equal to number of data requested ("
400 +") not equal to number of data requested ("
403 +QString::number(READ_WRITE_MAX_COUNTS*4)
401 +QString::number(nbBytes)
404 +")");
402 +")");
405 return 0;
403 return 0;
406 }
404 }
407 return dataLength;
405 return dataLength;
408 }
406 }
409
407
410 unsigned int gresb::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication)
408 unsigned int gresb::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication)
411 {
409 {
412 char protocoleIdentifier = 0x02;
410 char protocoleIdentifier = 0x02;
413 char reserved = 0x00;
411 char reserved = 0x00;
414 char gresbProtocole = 0x00;
412 char gresbProtocole = 0x00;
415 unsigned char size[3];
413 unsigned char size[3];
416 unsigned int spwPacketSize = count + 4;
414 unsigned int spwPacketSize = count + 4;
417 QTime SPWTimeout;
415 QTime SPWTimeout;
418
416
419 if (count>248)
417 if (count>248)
420 {
418 {
421 appendToLog("WARNING === in function WRITE of rmapplugin *** CCSDS packet size > 248 bytes\n");
419 appendToLog("WARNING === in function WRITE of rmapplugin *** CCSDS packet size > 248 bytes\n");
422 return 1;
420 return 1;
423 }
421 }
424
422
425 appendToLog(QString("*** START *** Send CCSDS packet of ")+ QString::number(count) + QString(" byte(s)"));
423 appendToLog(QString("*** START *** Send CCSDS packet of ")+ QString::number(count) + QString(" byte(s)"));
426
424
427 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1)
425 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1)
428 {
426 {
429 this->Close();
427 this->Close();
430 appendToLog("WARNING === in function WRITE of rmapplugin *** SPW link not running\n");
428 appendToLog("WARNING === in function WRITE of rmapplugin *** SPW link not running\n");
431 return 1;
429 return 1;
432 }
430 }
433
431
434 // SEND GRESB HEADER
432 // SEND GRESB HEADER
435 size[0] = (unsigned char) ((unsigned int) spwPacketSize>>16);
433 size[0] = (unsigned char) ((unsigned int) spwPacketSize>>16);
436 size[1] = (unsigned char) ((unsigned int) spwPacketSize>>8);
434 size[1] = (unsigned char) ((unsigned int) spwPacketSize>>8);
437 size[2] = (unsigned char) ((unsigned int) spwPacketSize);
435 size[2] = (unsigned char) ((unsigned int) spwPacketSize);
438 RMAPSend_SOCKET->write(&gresbProtocole, 1);
436 RMAPSend_SOCKET->write(&gresbProtocole, 1);
439 RMAPSend_SOCKET->write((char*) size, 3);
437 RMAPSend_SOCKET->write((char*) size, 3);
440 // SEND SPW HEADER
438 // SEND SPW HEADER
441 RMAPSend_SOCKET->write(&targetLogicalAddress, 1);
439 RMAPSend_SOCKET->write(&targetLogicalAddress, 1);
442 RMAPSend_SOCKET->write(&protocoleIdentifier, 1);
440 RMAPSend_SOCKET->write(&protocoleIdentifier, 1);
443 RMAPSend_SOCKET->write(&reserved, 1);
441 RMAPSend_SOCKET->write(&reserved, 1);
444 RMAPSend_SOCKET->write(&userApplication, 1);
442 RMAPSend_SOCKET->write(&userApplication, 1);
445 // SEND CCSDS PACKET
443 // SEND CCSDS PACKET
446 RMAPSend_SOCKET->write(Value, count);
444 RMAPSend_SOCKET->write(Value, count);
447 SPWTimeout.start();
445 SPWTimeout.start();
448 while(RMAPSend_SOCKET->bytesToWrite() > 0)
446 while(RMAPSend_SOCKET->bytesToWrite() > 0)
449 {
447 {
450 RMAPSend_SOCKET->waitForBytesWritten(100);
448 RMAPSend_SOCKET->waitForBytesWritten(100);
451 if(SPWTimeout.elapsed()>1000)
449 if(SPWTimeout.elapsed()>1000)
452 {
450 {
453 appendToLog("WARNING === in function WRITE of rmapplugin *** sending CCSDS packet timeout\n");
451 appendToLog("WARNING === in function WRITE of rmapplugin *** sending CCSDS packet timeout\n");
454 return 1;
452 return 1;
455 }
453 }
456 }
454 }
457
455
458 appendToLog(QString("*** CCSDS packet sent"));
456 appendToLog(QString("*** CCSDS packet sent"));
459
457
460 return count;
458 return count;
461 }
459 }
462
460
463 int gresb::receiveSPWPacket(unsigned char requestID) // SLOT
461 int gresb::receiveSPWPacket(unsigned char requestID) // SLOT
464 {
462 {
465 QTime spwPacketReceiverTimeout;
463 QTime spwPacketReceiverTimeout;
466 // GRESB HEADER
464 // GRESB HEADER
467 char RES_TR_EP; // 6 bits REserved + 1 bit TRuncated + 1 bit EP error end of packet
465 char RES_TR_EP; // 6 bits REserved + 1 bit TRuncated + 1 bit EP error end of packet
468 unsigned char packetLength2;
466 unsigned char packetLength2;
469 unsigned char packetLength1;
467 unsigned char packetLength1;
470 unsigned char packetLength0;
468 unsigned char packetLength0;
471 unsigned int packetLength;
469 unsigned int packetLength;
472
470
473 if (requestID==1)
471 if (requestID==1)
474 {
472 {
475 if (rmapPacketSEMAPHORE->available()) return rmapPacketSize;
473 if (rmapPacketSEMAPHORE->available()) return rmapPacketSize;
476 }
474 }
477
475
478 RMAPReceive_SOCKET->blockSignals(1); // block the signals of the socket during packet reception
476 RMAPReceive_SOCKET->blockSignals(1); // block the signals of the socket during packet reception
479 // READ THE GRESB HEADER OF THE INCOMING PACKET
477 // READ THE GRESB HEADER OF THE INCOMING PACKET
480 spwPacketReceiverTimeout.start();
478 spwPacketReceiverTimeout.start();
481 while(RMAPReceive_SOCKET->bytesAvailable() < 4)
479 while(RMAPReceive_SOCKET->bytesAvailable() < 4)
482 {
480 {
483 RMAPReceive_SOCKET->waitForReadyRead(100);
481 RMAPReceive_SOCKET->waitForReadyRead(100);
484 if(spwPacketReceiverTimeout.elapsed()>1000) return -1; // ERROR === read GRSEB header TIMEOUT
482 if(spwPacketReceiverTimeout.elapsed()>1000) return -1; // ERROR === read GRSEB header TIMEOUT
485 }
483 }
486 RMAPReceive_SOCKET->read(&RES_TR_EP, 1);
484 RMAPReceive_SOCKET->read(&RES_TR_EP, 1);
487 RMAPReceive_SOCKET->read( (char*) &packetLength2, 1);
485 RMAPReceive_SOCKET->read( (char*) &packetLength2, 1);
488 RMAPReceive_SOCKET->read( (char*) &packetLength1, 1);
486 RMAPReceive_SOCKET->read( (char*) &packetLength1, 1);
489 RMAPReceive_SOCKET->read( (char*) &packetLength0, 1);
487 RMAPReceive_SOCKET->read( (char*) &packetLength0, 1);
490 packetLength = (packetLength2<<16) + (packetLength1<<8) + (packetLength0);
488 packetLength = (packetLength2<<16) + (packetLength1<<8) + (packetLength0);
491 spwPacket = (char*) malloc(packetLength);
492
489
493 // READ THE SPW PACKET
490 // READ THE SPW PACKET
494 while(RMAPReceive_SOCKET->bytesAvailable() < packetLength)
491 while(RMAPReceive_SOCKET->bytesAvailable() < packetLength)
495 {
492 {
496 RMAPReceive_SOCKET->waitForReadyRead(100);
493 RMAPReceive_SOCKET->waitForReadyRead(100);
497 if(spwPacketReceiverTimeout.elapsed()>1000) return -2; // ERROR === read SPW packet TIMEOUT
494 if(spwPacketReceiverTimeout.elapsed()>1000) return -2; // ERROR === read SPW packet TIMEOUT
498 }
495 }
499 RMAPReceive_SOCKET->read( spwPacket, packetLength );
496 RMAPReceive_SOCKET->read( spwPacket, packetLength );
500 RMAPReceive_SOCKET->blockSignals(0);
497 RMAPReceive_SOCKET->blockSignals(0);
498 //emit sendMessage("Packet of size " + QString::number(packetLength) + " received");
501
499
502 switch(spwPacket[1]) // byte 1 is the protocole identifier in the SPW packet
500 switch(spwPacket[1]) // byte 1 is the protocole identifier in the SPW packet
503 {
501 {
504 case 1: // 0x01 is the protocole identifier for RMAP packets
502 case 1: // 0x01 is the protocole identifier for RMAP packets
505 if (rmapPacketSEMAPHORE->available()!=0) return -3; // ERROR === previous RMAP packet not processed yet
503 if (rmapPacketSEMAPHORE->available()!=0) return -3; // ERROR === previous RMAP packet not processed yet
506 for(unsigned int i=0; i<packetLength; i++) rmapPacket[i] = spwPacket[i];
504 for(unsigned int i=0; i<packetLength; i++) rmapPacket[i] = spwPacket[i];
507 rmapPacketSize = packetLength;
505 rmapPacketSize = packetLength;
508 rmapPacketSEMAPHORE->release();
506 rmapPacketSEMAPHORE->release();
509 //emit sendMessage("RMAP packet of size " + QString::number(packetLength) + " received");
507 emit sendMessage("RMAP packet of size " + QString::number(packetLength) + " received");
510 return packetLength;
508 return packetLength;
511
509
512 case 2: // 0x02 is the protocole identifier for CCSDS packets
510 case 2: // 0x02 is the protocole identifier for CCSDS packets
513 if (ccsdsPacketSEMAPHORE->available()!=0) return -4; // ERROR === previous CCSDS packet not processed yet
511 if (ccsdsPacketSEMAPHORE->available()!=0) return -4; // ERROR === previous CCSDS packet not processed yet
514 for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i];
512 for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i];
515 ccsdsPacketSize = packetLength;
513 ccsdsPacketSize = packetLength;
516 ccsdsPacketSEMAPHORE->release();
514 ccsdsPacketSEMAPHORE->release();
517 emit(ccsdsPacketAvailable(ccsdsPacket, packetLength));
515 emit(ccsdsPacketAvailable(ccsdsPacket, packetLength));
516 //emit sendMessage("CCSDS packet of size " + QString::number(packetLength) + " received");
518 return packetLength;
517 return packetLength;
519 }
518 }
520 return 0;
519 return 0;
521 }
520 }
522
521
523 void gresb::Open() // SLOT
522 void gresb::Open() // SLOT
524 {
523 {
525 bool spwRunning = true;
524 bool spwRunning = true;
526 RMAPSend_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getGRESBIP()),
525 RMAPSend_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getGRESBIP()),
527 3000 + gresbVirtualLinkSpinBox->value()*2,
526 3000 + gresbVirtualLinkSpinBox->value()*2,
528 QIODevice::WriteOnly);
527 QIODevice::WriteOnly);
529 RMAPReceive_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getGRESBIP()),
528 RMAPReceive_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getGRESBIP()),
530 3000 + gresbVirtualLinkSpinBox->value()*2+1,
529 3000 + gresbVirtualLinkSpinBox->value()*2+1,
531 QIODevice::ReadOnly);
530 QIODevice::ReadOnly);
532 GRESBStatusQuery_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getGRESBIP()),
531 GRESBStatusQuery_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getGRESBIP()),
533 3010,
532 3010,
534 QIODevice::ReadWrite);
533 QIODevice::ReadWrite);
535 GRESBStatusQuery_SOCKET->waitForConnected(10000);
534 GRESBStatusQuery_SOCKET->waitForConnected(10000);
536 RMAPReceive_SOCKET->readAll(); // read all remaining data from the reception socket
535 RMAPReceive_SOCKET->readAll(); // read all remaining data from the reception socket
537 // initialize SPW packet semaphores
536 // initialize SPW packet semaphores
538 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
537 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
539 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
538 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
540 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) != 0)
539 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) != 0)
541 {
540 {
542 spwRunning = gresbStatusQueryDialog->exec();
541 spwRunning = gresbStatusQueryDialog->exec();
543 }
542 }
544 if (spwRunning == false) this->Close();
543 if (spwRunning == false) this->Close();
545 else
544 else
546 {
545 {
547 emit appendToLog(QString("SpaceWire running on virtual link ")+ QString::number(spwLinkSpinBox->value()));
546 emit appendToLog(QString("SpaceWire running on virtual link ")+ QString::number(spwLinkSpinBox->value()));
548 emit isOpen(true);
547 emit isOpen(true);
549 }
548 }
550 }
549 }
551
550
552 void gresb::Close() // SLOT
551 void gresb::Close() // SLOT
553 {
552 {
554 RMAPSend_SOCKET->disconnectFromHost();
553 RMAPSend_SOCKET->disconnectFromHost();
555 RMAPReceive_SOCKET->disconnectFromHost();
554 RMAPReceive_SOCKET->disconnectFromHost();
556 GRESBStatusQuery_SOCKET->disconnectFromHost();
555 GRESBStatusQuery_SOCKET->disconnectFromHost();
557 emit isOpen(false);
556 emit isOpen(false);
558 }
557 }
559
558
560 int gresb::GRESBStatusQuery() // SLOT
559 int gresb::GRESBStatusQuery() // SLOT
561 {
560 {
562 GRESBStatusQueryRequest(LinkStatus, 0);
561 GRESBStatusQueryRequest(LinkStatus, 0);
563 GRESBStatusQueryRequest(LinkStatus, 1);
562 GRESBStatusQueryRequest(LinkStatus, 1);
564 GRESBStatusQueryRequest(LinkStatus, 2);
563 GRESBStatusQueryRequest(LinkStatus, 2);
565 GRESBStatusQueryRequest(LinkStatistics, 0);
564 GRESBStatusQueryRequest(LinkStatistics, 0);
566 GRESBStatusQueryRequest(LinkStatistics, 1);
565 GRESBStatusQueryRequest(LinkStatistics, 1);
567 GRESBStatusQueryRequest(LinkStatistics, 2);
566 GRESBStatusQueryRequest(LinkStatistics, 2);
568 return 0;
567 return 0;
569 }
568 }
570
569
571 int gresb::GRESBStatusQueryRequest(GresbStatusQueryOption option, char link)
570 int gresb::GRESBStatusQueryRequest(GresbStatusQueryOption option, char link)
572 {
571 {
573 gresb_status_query_t statusQueryCommand;
572 gresb_status_query_t statusQueryCommand;
574 gresb_link_status_reply_t linkStatusReply;
573 gresb_link_status_reply_t linkStatusReply;
575 gresb_link_statistics_reply_t linkStatisticsReply;
574 gresb_link_statistics_reply_t linkStatisticsReply;
576 QTime statusQueryTimeout;
575 QTime statusQueryTimeout;
577 QString console_message;
576 QString console_message;
578
577
579 statusQueryCommand.protocolIdentifier = (char) 0x02;
578 statusQueryCommand.protocolIdentifier = (char) 0x02;
580 statusQueryCommand.reserved1 = (char) 0x00;
579 statusQueryCommand.reserved1 = (char) 0x00;
581 statusQueryCommand.reserved0 = (char) 0x00;
580 statusQueryCommand.reserved0 = (char) 0x00;
582 statusQueryCommand.option = (char) option;
581 statusQueryCommand.option = (char) option;
583 statusQueryCommand.value3 = (char) 0x00;
582 statusQueryCommand.value3 = (char) 0x00;
584 statusQueryCommand.value2 = (char) 0x00;
583 statusQueryCommand.value2 = (char) 0x00;
585 statusQueryCommand.value1 = (char) 0x00;
584 statusQueryCommand.value1 = (char) 0x00;
586 statusQueryCommand.value0 = (char) link;
585 statusQueryCommand.value0 = (char) link;
587
586
588 GRESBStatusQuery_SOCKET->write((char*) ((void*) &statusQueryCommand), sizeof(statusQueryCommand));
587 GRESBStatusQuery_SOCKET->write((char*) ((void*) &statusQueryCommand), sizeof(statusQueryCommand));
589 GRESBStatusQuery_SOCKET->flush();
588 GRESBStatusQuery_SOCKET->flush();
590 GRESBStatusQuery_SOCKET->waitForBytesWritten(1000);
589 GRESBStatusQuery_SOCKET->waitForBytesWritten(1000);
591
590
592 statusQueryTimeout.start();
591 statusQueryTimeout.start();
593 while(GRESBStatusQuery_SOCKET->bytesToWrite() > 0)
592 while(GRESBStatusQuery_SOCKET->bytesToWrite() > 0)
594 {
593 {
595 GRESBStatusQuery_SOCKET->waitForBytesWritten(100);
594 GRESBStatusQuery_SOCKET->waitForBytesWritten(100);
596 if(statusQueryTimeout.elapsed()>1000)
595 if(statusQueryTimeout.elapsed()>1000)
597 {
596 {
598 emit appendToLog("WARNING === in function GRESBStatusQueryRequest of rmapplugin *** sending StatusQueryCommand timeout");
597 emit appendToLog("WARNING === in function GRESBStatusQueryRequest of rmapplugin *** sending StatusQueryCommand timeout");
599 return 1;
598 return 1;
600 }
599 }
601 }
600 }
602
601
603 switch (option)
602 switch (option)
604 {
603 {
605 case LinkStatus:
604 case LinkStatus:
606 {
605 {
607 statusQueryTimeout.start();
606 statusQueryTimeout.start();
608 while(GRESBStatusQuery_SOCKET->bytesAvailable() < (int) sizeof(linkStatusReply))
607 while(GRESBStatusQuery_SOCKET->bytesAvailable() < (int) sizeof(linkStatusReply))
609 {
608 {
610 GRESBStatusQuery_SOCKET->waitForReadyRead(100);
609 GRESBStatusQuery_SOCKET->waitForReadyRead(100);
611 if(statusQueryTimeout.elapsed()>1000)
610 if(statusQueryTimeout.elapsed()>1000)
612 {
611 {
613 console_message.sprintf("GRESBStatusQueryRequest / LinkStatus => error timeout bytesAvailable()\n");
612 console_message.sprintf("GRESBStatusQueryRequest / LinkStatus => error timeout bytesAvailable()\n");
614 emit appendToLog(console_message);
613 emit appendToLog(console_message);
615 return 1;
614 return 1;
616 }
615 }
617 }
616 }
618 GRESBStatusQuery_SOCKET->read((char*) ((void*) &linkStatusReply), (int) sizeof(linkStatusReply));
617 GRESBStatusQuery_SOCKET->read((char*) ((void*) &linkStatusReply), (int) sizeof(linkStatusReply));
619 console_message.sprintf("%x", linkStatusReply.byte0);
618 console_message.sprintf("%x", linkStatusReply.byte0);
620 spwLinkStatusEnquiry->statusQueryTable->item(0, link)->setText(console_message);
619 spwLinkStatusEnquiry->statusQueryTable->item(0, link)->setText(console_message);
621 console_message.sprintf("%d", linkStatusReply.byte1);
620 console_message.sprintf("%d", linkStatusReply.byte1);
622 spwLinkStatusEnquiry->statusQueryTable->item(1, link)->setText(console_message);
621 spwLinkStatusEnquiry->statusQueryTable->item(1, link)->setText(console_message);
623 if (linkStatusReply.byte0 == 0) return 1;
622 if (linkStatusReply.byte0 == 0) return 1;
624 break;
623 break;
625 }
624 }
626 case LinkStatistics:
625 case LinkStatistics:
627 {
626 {
628 statusQueryTimeout.start();
627 statusQueryTimeout.start();
629 while(GRESBStatusQuery_SOCKET->bytesAvailable() < (int) sizeof(linkStatisticsReply))
628 while(GRESBStatusQuery_SOCKET->bytesAvailable() < (int) sizeof(linkStatisticsReply))
630 {
629 {
631 GRESBStatusQuery_SOCKET->waitForReadyRead(100);
630 GRESBStatusQuery_SOCKET->waitForReadyRead(100);
632 if(statusQueryTimeout.elapsed()>1000)
631 if(statusQueryTimeout.elapsed()>1000)
633 {
632 {
634 console_message.sprintf("GRESBStatusQueryRequest / LinkStatistics => error timeout bytesAvailable()\n");
633 console_message.sprintf("GRESBStatusQueryRequest / LinkStatistics => error timeout bytesAvailable()\n");
635 emit appendToLog(console_message);
634 emit appendToLog(console_message);
636 return 1;
635 return 1;
637 }
636 }
638 }
637 }
639 GRESBStatusQuery_SOCKET->read((char*) ((void*) &linkStatisticsReply), sizeof(linkStatisticsReply));
638 GRESBStatusQuery_SOCKET->read((char*) ((void*) &linkStatisticsReply), sizeof(linkStatisticsReply));
640 /*console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.sizeOfDataTransmitted));
639 /*console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.sizeOfDataTransmitted));
641 UI->spwLinkStatusEnquiry->statusQueryTable->item(9, link)->setText(console_message);
640 UI->spwLinkStatusEnquiry->statusQueryTable->item(9, link)->setText(console_message);
642 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsTransmitted));
641 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsTransmitted));
643 UI->spwLinkStatusEnquiry->statusQueryTable->item(8, link)->setText(console_message);
642 UI->spwLinkStatusEnquiry->statusQueryTable->item(8, link)->setText(console_message);
644 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfTruncatedPacketsReceived));
643 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfTruncatedPacketsReceived));
645 UI->spwLinkStatusEnquiry->statusQueryTable->item(6, link)->setText(console_message);
644 UI->spwLinkStatusEnquiry->statusQueryTable->item(6, link)->setText(console_message);
646 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsWithEEPReceived));
645 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsWithEEPReceived));
647 UI->spwLinkStatusEnquiry->statusQueryTable->item(5, link)->setText(console_message);
646 UI->spwLinkStatusEnquiry->statusQueryTable->item(5, link)->setText(console_message);
648 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.sizeOfDataReceived));
647 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.sizeOfDataReceived));
649 UI->spwLinkStatusEnquiry->statusQueryTable->item(4, link)->setText(console_message);
648 UI->spwLinkStatusEnquiry->statusQueryTable->item(4, link)->setText(console_message);
650 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsReceived));
649 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsReceived));
651 UI->spwLinkStatusEnquiry->statusQueryTable->item(3, link)->setText(console_message);*/
650 UI->spwLinkStatusEnquiry->statusQueryTable->item(3, link)->setText(console_message);*/
652 break;
651 break;
653 }
652 }
654 case NodeAddressStatistics:
653 case NodeAddressStatistics:
655 {
654 {
656 break;
655 break;
657 }
656 }
658 case GetRoute:
657 case GetRoute:
659 {
658 {
660 break;
659 break;
661 }
660 }
662 }
661 }
663 return 0;
662 return 0;
664 }
663 }
665
664
666 void gresb::processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size) // SLOT
667 {
668 QString message;
669 unsigned int fine_time_value = 0;
670 fine_time_value = ((unsigned int) ccsdsPacket[7]<<24)
671 + ((unsigned int) ccsdsPacket[6]<<16)
672 + ((unsigned int) ccsdsPacket[5]<<8)
673 + ((unsigned int) ccsdsPacket[4]);
674 message.append(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": ");
675 message.append("size "
676 + QString::number(size)
677 +" *** header "
678 + QString::number(ccsdsPacket[0], 16)
679 + " "
680 + QString::number(ccsdsPacket[1], 16)
681 + " "
682 + QString::number(ccsdsPacket[2], 16)
683 + " "
684 + QString::number(ccsdsPacket[3], 16)
685 + " *** coarse time "
686 + QString::number(fine_time_value));
687 //+ QString::number(ccsdsPacket[4], 16)
688 //+" "
689 //+ QString::number(ccsdsPacket[5], 16)
690 //+" "
691 //+ QString::number(ccsdsPacket[6], 16)
692 //+" "
693 //+ QString::number(ccsdsPacket[7], 16));
694 ccsdsPacketSEMAPHORE->acquire();
695 emit sendMessage(message);
696 }
697
698 void gresb::reTestSPWLink() // SLOT
665 void gresb::reTestSPWLink() // SLOT
699 {
666 {
700 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 0)
667 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 0)
701 {
668 {
702 gresbStatusQueryDialog->accept();
669 gresbStatusQueryDialog->accept();
703 }
670 }
704 }
671 }
705
672
706 void gresb::RMAPSendConnectionState(QAbstractSocket::SocketState socketState) // SLOT
673 void gresb::RMAPSendConnectionState(QAbstractSocket::SocketState socketState) // SLOT
707 {
674 {
708 rmapSendStateLabel->setText("");
675 rmapSendStateLabel->setText("");
709 QString socketMessage = "RMAP Send Socket State: ";
676 QString socketMessage = "RMAP Send Socket State: ";
710 switch(socketState)
677 switch(socketState)
711 {
678 {
712 case QAbstractSocket::UnconnectedState :
679 case QAbstractSocket::UnconnectedState :
713 socketMessage.append("0 => Unconnected");
680 socketMessage.append("0 => Unconnected");
714 break;
681 break;
715 case 1:
682 case 1:
716 socketMessage.append("1 => HostLookup");
683 socketMessage.append("1 => HostLookup");
717 break;
684 break;
718 case 2:
685 case 2:
719 socketMessage.append("2 => Connecting");
686 socketMessage.append("2 => Connecting");
720 break;
687 break;
721 case 3:
688 case 3:
722 socketMessage.append("3 => Connected");
689 socketMessage.append("3 => Connected");
723 break;
690 break;
724 case 4:
691 case 4:
725 socketMessage.append("4 => Bound");
692 socketMessage.append("4 => Bound");
726 break;
693 break;
727 case 5:
694 case 5:
728 socketMessage.append("5 => Closing");
695 socketMessage.append("5 => Closing");
729 break;
696 break;
730 case 6:
697 case 6:
731 socketMessage.append("6 => Listening");
698 socketMessage.append("6 => Listening");
732 break;
699 break;
733 }
700 }
734 rmapSendStateLabel->setText(socketMessage);
701 rmapSendStateLabel->setText(socketMessage);
735 emit appendToLog(socketMessage);
702 emit appendToLog(socketMessage);
736 }
703 }
737
704
738 void gresb::RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState) // SLOT
705 void gresb::RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState) // SLOT
739 {
706 {
740 rmapReceiveStateLabel->setText("");
707 rmapReceiveStateLabel->setText("");
741 QString socketMessage = "RMAP Receive Socket State: ";
708 QString socketMessage = "RMAP Receive Socket State: ";
742 switch(socketState)
709 switch(socketState)
743 {
710 {
744 case QAbstractSocket::UnconnectedState :
711 case QAbstractSocket::UnconnectedState :
745 socketMessage.append("0 => Unconnected");
712 socketMessage.append("0 => Unconnected");
746 break;
713 break;
747 case 1:
714 case 1:
748 socketMessage.append("1 => HostLookup");
715 socketMessage.append("1 => HostLookup");
749 break;
716 break;
750 case 2:
717 case 2:
751 socketMessage.append("2 => Connecting");
718 socketMessage.append("2 => Connecting");
752 break;
719 break;
753 case 3:
720 case 3:
754 socketMessage.append("3 => Connected");
721 socketMessage.append("3 => Connected");
755 break;
722 break;
756 case 4:
723 case 4:
757 socketMessage.append("4 => Bound");
724 socketMessage.append("4 => Bound");
758 break;
725 break;
759 case 5:
726 case 5:
760 socketMessage.append("5 => Closing");
727 socketMessage.append("5 => Closing");
761 break;
728 break;
762 case 6:
729 case 6:
763 socketMessage.append("6 => Listening");
730 socketMessage.append("6 => Listening");
764 break;
731 break;
765 }
732 }
766 rmapReceiveStateLabel->setText(socketMessage);
733 rmapReceiveStateLabel->setText(socketMessage);
767 emit appendToLog(socketMessage);
734 emit appendToLog(socketMessage);
768 }
735 }
769
736
770 void gresb::GRESBConnectionState(QAbstractSocket::SocketState socketState) // SLOT
737 void gresb::GRESBConnectionState(QAbstractSocket::SocketState socketState) // SLOT
771 {
738 {
772 gresbStatusQueryLabel->setText("");
739 gresbStatusQueryLabel->setText("");
773 QString socketMessage = "GRESB status query socket (port 3010): ";
740 QString socketMessage = "GRESB status query socket (port 3010): ";
774 switch(socketState)
741 switch(socketState)
775 {
742 {
776 case QAbstractSocket::UnconnectedState :
743 case QAbstractSocket::UnconnectedState :
777 socketMessage.append("0 => Unconnected");
744 socketMessage.append("0 => Unconnected");
778 break;
745 break;
779 case 1:
746 case 1:
780 socketMessage.append("1 => HostLookup");
747 socketMessage.append("1 => HostLookup");
781 break;
748 break;
782 case 2:
749 case 2:
783 socketMessage.append("2 => Connecting");
750 socketMessage.append("2 => Connecting");
784 break;
751 break;
785 case 3:
752 case 3:
786 socketMessage.append("3 => Connected");
753 socketMessage.append("3 => Connected");
787 break;
754 break;
788 case 4:
755 case 4:
789 socketMessage.append("4 => Bound");
756 socketMessage.append("4 => Bound");
790 break;
757 break;
791 case 5:
758 case 5:
792 socketMessage.append("5 => Closing");
759 socketMessage.append("5 => Closing");
793 break;
760 break;
794 case 6:
761 case 6:
795 socketMessage.append("6 => Listening");
762 socketMessage.append("6 => Listening");
796 break;
763 break;
797 }
764 }
798 gresbStatusQueryLabel->setText(socketMessage);
765 gresbStatusQueryLabel->setText(socketMessage);
799 }
766 }
@@ -1,101 +1,101
1 #ifndef GRESB_H
1 #ifndef GRESB_H
2 #define GRESB_H
2 #define GRESB_H
3
3
4 #include <QWidget>
4 #include <QWidget>
5 #include <QLabel>
5 #include <QLabel>
6 #include <QPushButton>
6 #include <QPushButton>
7 #include <QSpinBox>
7 #include <QSpinBox>
8 #include <QGridLayout>
8 #include <QGridLayout>
9 #include <QTcpSocket>
9 #include <QTcpSocket>
10 #include <QDialog>
10 #include <QDialog>
11 #include <QSemaphore>
11 #include <QSemaphore>
12
12
13 #include "gresbstatusenquiry.h"
13 #include "gresbstatusenquiry.h"
14 #include "spwpacketreceiver.h"
15 #include "rmapoperations.h"
14 #include "rmapoperations.h"
16 #include "qipdialogbox.h"
15 #include "qipdialogbox.h"
17
16
18 class gresb : public QWidget
17 class gresb : public QWidget
19 {
18 {
20 Q_OBJECT
19 Q_OBJECT
21 public:
20 public:
22 explicit gresb(QWidget *parent = 0);
21 explicit gresb(QWidget *parent = 0);
23 ~gresb();
22 ~gresb();
24 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
23 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
25 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
24 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
26 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
25 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
27
26
28 signals:
27 signals:
29 void sendMessage(QString message);
28 void sendMessage(QString message);
30 void isOpen(bool);
29 void isOpen(bool);
31 void RMAP_write_reply_setText(QString);
30 void RMAP_write_reply_setText(QString);
32 void appendToLog(QString);
31 void appendToLog(QString);
33 void ccsdsPacketAvailable(unsigned char*, unsigned int);
32 void ccsdsPacketAvailable(unsigned char*, unsigned int);
34
33
35 public slots:
34 public slots:
36 void Open();
35 void Open();
37 void Close();
36 void Close();
38 int receiveSPWPacket(unsigned char requestID=0);
37 int receiveSPWPacket(unsigned char requestID=0);
39 void processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
38 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
39 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
40 void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();}
40 void reTestSPWLink();
41 void reTestSPWLink();
42 //
41 void RMAPSendConnectionState(QAbstractSocket::SocketState socketState);
43 void RMAPSendConnectionState(QAbstractSocket::SocketState socketState);
42 void RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState);
44 void RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState);
43 void GRESBConnectionState(QAbstractSocket::SocketState socketState);
45 void GRESBConnectionState(QAbstractSocket::SocketState socketState);
44 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
45 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
46
46
47 private slots:
47 private slots:
48 int GRESBStatusQuery();
48 int GRESBStatusQuery();
49
49
50 private:
50 private:
51 unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0);
51 unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0);
52 unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0);
52 unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0);
53 void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->acquire();}
53 void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->tryAcquire();}
54 void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->acquire();}
54 void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->tryAcquire();}
55 int GRESBStatusQueryRequest(GresbStatusQueryOption option, char link);
55 int GRESBStatusQueryRequest(GresbStatusQueryOption option, char link);
56
56
57 unsigned char rmapTargetLogicalAddress ;
57 unsigned char rmapTargetLogicalAddress ;
58 unsigned char rmapSourceLogicalAddress ;
58 unsigned char rmapSourceLogicalAddress ;
59
59
60 RMAP_command_codes commandCode;
60 RMAP_command_codes commandCode;
61
61
62 QPushButton *gresbStatusQueryRetryButton;
62 QPushButton *gresbStatusQueryRetryButton;
63 QPushButton *gresbStatusQueryAbortButton;
63 QPushButton *gresbStatusQueryAbortButton;
64
64
65 QLabel *gresbBridgeIPLabel;
65 QLabel *gresbBridgeIPLabel;
66 QLabel *gresbVirtualLinkLabel;
66 QLabel *gresbVirtualLinkLabel;
67 QLabel *spwLinkLabel;
67 QLabel *spwLinkLabel;
68 QLabel *rmapSourceLogicalAddressLabel;
68 QLabel *rmapSourceLogicalAddressLabel;
69 QLabel *rmapSendStateLabel;
69 QLabel *rmapSendStateLabel;
70 QLabel *rmapReceiveStateLabel;
70 QLabel *rmapReceiveStateLabel;
71 QLabel *gresbStatusQueryLabel;
71 QLabel *gresbStatusQueryLabel;
72 QLabel *gresbStatusQueryDialogLabel;
72 QLabel *gresbStatusQueryDialogLabel;
73
73
74 QDialog *gresbStatusQueryDialog;
74 QDialog *gresbStatusQueryDialog;
75
75
76 QIPDialogBox* gresbBridgeIPDialogBox;
76 QIPDialogBox* gresbBridgeIPDialogBox;
77
77
78 QSpinBox *gresbVirtualLinkSpinBox;
78 QSpinBox *gresbVirtualLinkSpinBox;
79 QSpinBox *spwLinkSpinBox;
79 QSpinBox *spwLinkSpinBox;
80 QSpinBox *rmapSourceLogicalAddressSpinBox;
80 QSpinBox *rmapSourceLogicalAddressSpinBox;
81
81
82 QGridLayout *connectionLayout;
82 QGridLayout *connectionLayout;
83 QGridLayout *gresbStatusQueryDialogLayout;
83 QGridLayout *gresbStatusQueryDialogLayout;
84
84
85 QTcpSocket *RMAPSend_SOCKET;
85 QTcpSocket *RMAPSend_SOCKET;
86 QTcpSocket *RMAPReceive_SOCKET;
86 QTcpSocket *RMAPReceive_SOCKET;
87 QTcpSocket *GRESBStatusQuery_SOCKET;
87 QTcpSocket *GRESBStatusQuery_SOCKET;
88
88
89 gresbStatusEnquiry* spwLinkStatusEnquiry;
89 gresbStatusEnquiry* spwLinkStatusEnquiry;
90
90
91 // Packet receiver
91 // Packet receiver
92 QSemaphore *rmapPacketSEMAPHORE;
92 QSemaphore *rmapPacketSEMAPHORE;
93 QSemaphore *ccsdsPacketSEMAPHORE;
93 QSemaphore *ccsdsPacketSEMAPHORE;
94 char* rmapPacket; // The buffer to receive RMAP READ packets
94 char* rmapPacket; // The buffer to receive RMAP READ packets
95 unsigned char *ccsdsPacket;
95 unsigned char *ccsdsPacket;
96 char *spwPacket;
96 char *spwPacket;
97 unsigned int rmapPacketSize;
97 unsigned int rmapPacketSize;
98 unsigned int ccsdsPacketSize;
98 unsigned int ccsdsPacketSize;
99 };
99 };
100
100
101 #endif // GRESB_H
101 #endif // GRESB_H
@@ -1,286 +1,316
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the LPPMON Software
2 -- This file is a part of the LPPMON Software
3 -- Copyright (C) 2012, Laboratory of Plasma Physics - CNRS
3 -- Copyright (C) 2012, Laboratory of Plasma Physics - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Paul LEROY
19 /*-- Author : Paul LEROY
20 -- Mail : paul.leroy@lpp.polytechnique.fr
20 -- Mail : paul.leroy@lpp.polytechnique.fr
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "rmapplugin.h"
22 #include "rmapplugin.h"
23 #include <QHostAddress>
23 #include <QHostAddress>
24 #include <QIODevice>
24 #include <QIODevice>
25 #include <QApplication>
25 #include <QApplication>
26 #include <rmappluginpythonwrapper.h>
26 #include <rmappluginpythonwrapper.h>
27
27
28 rmapplugin::rmapplugin(QWidget *parent)
28 rmapplugin::rmapplugin(QWidget *parent)
29 :lppmonplugin(parent,false)
29 :lppmonplugin(parent,false)
30 {
30 {
31 this->UI = new rmapPluginUI();
31 this->UI = new rmapPluginUI();
32 this->setWindowTitle(tr("RMAP and SPW Communication"));
32 this->setWindowTitle(tr("RMAP and SPW Communication"));
33 this->setWidget((QWidget*)this->UI);
33 this->setWidget((QWidget*)this->UI);
34
34
35 timeCode = 0;
35 timeCode = 0;
36 time_COARSE = 0;
36 time_COARSE = 0;
37 time_FINE = 0;
37 time_FINE = 0;
38 currentBridge = selectedBridgeIsUnknown;
38 currentBridge = selectedBridgeIsUnknown;
39
39
40 /*Python wrapper*/
40 /*Python wrapper*/
41 this->pyObject = new rmappluginPythonWrapper();
41 this->pyObject = new rmappluginPythonWrapper();
42 connect(this->pyObject,SIGNAL(ReadSig(uint*,uint,uint)),this,SLOT(Read(uint*,uint,uint)));
42 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)));
43 connect(this->pyObject,SIGNAL(WriteSig(uint*,uint,uint)),this,SLOT(Write(uint*,uint,uint)));
44 /*==============*/
44 /*==============*/
45
45
46 connect(UI->rmapOpenCommunicationButton, SIGNAL(clicked()), this, SLOT(openBridge()));
46 connect(UI->rmapOpenCommunicationButton, SIGNAL(clicked()), this, SLOT(openBridge()));
47 connect(UI->rmapCloseCommunicationButton, SIGNAL(clicked()), this, SLOT(closeBridge()));
47 connect(UI->rmapCloseCommunicationButton, SIGNAL(clicked()), this, SLOT(closeBridge()));
48
48
49 // CCSDS
49 // CCSDS
50 connect(this->UI->sendCCSDSCommandButton, SIGNAL(clicked()), this, SLOT(sendCCSDS()));
50 connect(this->UI->sendCCSDSCommandButton, SIGNAL(clicked()), this, SLOT(sendCCSDS()));
51 connect(this->UI->send_TC_LFR_UPDATE_TIME_Button, SIGNAL(clicked()), this, SLOT(send_TC_LFR_UPDATE_TIME()));
51 connect(this->UI->send_TC_LFR_UPDATE_TIME_Button, SIGNAL(clicked()), this, SLOT(send_TC_LFR_UPDATE_TIME()));
52 connect(this->UI->reset_TC_LFR_UPDATE_TIME_Button, SIGNAL(clicked()), this, SLOT(reset_TC_LFR_UPDATE_TIME()));
52 connect(this->UI->reset_TC_LFR_UPDATE_TIME_Button, SIGNAL(clicked()), this, SLOT(reset_TC_LFR_UPDATE_TIME()));
53
53
54 // spectralMAtricesDMASimulator
54 // spectralMAtricesDMASimulator
55 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(rmapplugginRead(uint*,uint,uint)), this, SLOT(Read(uint*,uint,uint)));
55 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(rmapplugginRead(uint*,uint,uint)), this, SLOT(Read(uint*,uint,uint)));
56 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(rmapplugginWrite(uint*,uint,uint)), this, SLOT(Write(uint*,uint,uint)));
56 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(rmapplugginWrite(uint*,uint,uint)), this, SLOT(Write(uint*,uint,uint)));
57 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
57 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
58
58
59 // GRESB
59 // GRESB
60 connect(this->UI->gresbBridge, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
60 connect(this->UI->gresbBridge, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
61 connect(this->UI->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool)));
61 connect(this->UI->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool)));
62 connect(this->UI->gresbBridge, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString)));
62 connect(this->UI->gresbBridge, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString)));
63 connect(this->UI->gresbBridge, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString)));
63 connect(this->UI->gresbBridge, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString)));
64 connect(this->UI->gresbBridge, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)),
65 this, SLOT(processCCSDSPacket(unsigned char*,uint)));
66 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->gresbBridge, SLOT(ccsdsPacketIsProcessed()));
64
67
65 // Star Dundee
68 // Star Dundee
66 connect(this->UI->starDundee, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
69 connect(this->UI->starDundee, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
67 connect(this->UI->starDundee, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool)));
70 connect(this->UI->starDundee, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool)));
68 connect(this->UI->starDundee, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString)));
71 connect(this->UI->starDundee, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString)));
69 connect(this->UI->starDundee, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString)));
72 connect(this->UI->starDundee, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString)));
73 connect(this->UI->starDundee, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)),
74 this, SLOT(processCCSDSPacket(unsigned char*,uint)));
75 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->starDundee, SLOT(ccsdsPacketIsProcessed()));
70
76
71 connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(bridgeHasChanged(selectedBridge)));
77 connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(bridgeHasChanged(selectedBridge)));
72 }
78 }
73
79
74 rmapplugin::~rmapplugin()
80 rmapplugin::~rmapplugin()
75 {
81 {
76 if (!RMAPSend_SOCKET->isOpen()) RMAPSend_SOCKET->disconnectFromHost();
82 if (!RMAPSend_SOCKET->isOpen()) RMAPSend_SOCKET->disconnectFromHost();
77 if (!RMAPReceive_SOCKET->isOpen()) RMAPReceive_SOCKET->disconnectFromHost();
83 if (!RMAPReceive_SOCKET->isOpen()) RMAPReceive_SOCKET->disconnectFromHost();
78 if (!GRESBStatusQuery_SOCKET->isOpen()) GRESBStatusQuery_SOCKET->disconnectFromHost();
84 if (!GRESBStatusQuery_SOCKET->isOpen()) GRESBStatusQuery_SOCKET->disconnectFromHost();
79 }
85 }
80
86
81 unsigned int rmapplugin::Write(unsigned int *Value, unsigned int count, unsigned int address)
87 unsigned int rmapplugin::Write(unsigned int *Value, unsigned int count, unsigned int address)
82 {
88 {
83 unsigned int result;
89 unsigned int result;
84 switch(currentBridge)
90 switch(currentBridge)
85 {
91 {
86 case selectedBridgeIsGRESB :
92 case selectedBridgeIsGRESB :
87 result = UI->gresbBridge->Write(Value, count, address);
93 result = UI->gresbBridge->Write(Value, count, address);
88 break;
94 break;
89 case selectedBridgeIsStarDundee :
95 case selectedBridgeIsStarDundee :
90 result = UI->starDundee->Write(Value, count, address);
96 result = UI->starDundee->Write(Value, count, address);
91 break;
97 break;
92 default:
98 default:
93 result = 1;
99 result = 1;
94 break;
100 break;
95 }
101 }
96 return result;
102 return result;
97 }
103 }
98
104
99 unsigned int rmapplugin::Read(unsigned int *Value, unsigned int count, unsigned int address)
105 unsigned int rmapplugin::Read(unsigned int *Value, unsigned int count, unsigned int address)
100 {
106 {
101 unsigned int result;
107 unsigned int result;
102 switch(currentBridge)
108 switch(currentBridge)
103 {
109 {
104 case selectedBridgeIsGRESB :
110 case selectedBridgeIsGRESB :
105 result = UI->gresbBridge->Read(Value, count, address);
111 result = UI->gresbBridge->Read(Value, count, address);
106 break;
112 break;
107 case selectedBridgeIsStarDundee :
113 case selectedBridgeIsStarDundee :
108 result = UI->starDundee->Read(Value, count, address);
114 result = UI->starDundee->Read(Value, count, address);
109 break;
115 break;
110 default:
116 default:
111 result = 1;
117 result = 1;
112 break;
118 break;
113 }
119 }
114 return result;
120 return result;
115 }
121 }
116
122
117 ////////
123 ////////
118 // SLOTS
124 // SLOTS
119
125
120 unsigned int rmapplugin::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication) // SLOT
126 unsigned int rmapplugin::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication) // SLOT
121 {
127 {
122 unsigned int result;
128 unsigned int result;
123 switch(currentBridge)
129 switch(currentBridge)
124 {
130 {
125 case selectedBridgeIsGRESB :
131 case selectedBridgeIsGRESB :
126 result = UI->gresbBridge->WriteSPW(Value, count, targetLogicalAddress, userApplication);
132 result = UI->gresbBridge->WriteSPW(Value, count, targetLogicalAddress, userApplication);
127 break;
133 break;
128 case selectedBridgeIsStarDundee :
134 case selectedBridgeIsStarDundee :
129 result = UI->starDundee->WriteSPW(Value, count, targetLogicalAddress, userApplication);
135 result = UI->starDundee->WriteSPW(Value, count, targetLogicalAddress, userApplication);
130 break;
136 break;
131 default:
137 default:
132 result = 1;
138 result = 1;
133 break;
139 break;
134 }
140 }
135 return result;
141 return result;
136 }
142 }
137
143
138 void rmapplugin::sendCCSDS() // SLOT
144 void rmapplugin::sendCCSDS() // SLOT
139 {
145 {
140 unsigned int nbBYTES_application_data = 8;
146 unsigned int nbBYTES_application_data = 8;
141 unsigned int count;
147 unsigned int count;
142 char *tab;
148 char *tab;
143 unsigned char packetErrorControl1 = 0xaa;
149 unsigned char packetErrorControl1 = 0xaa;
144 unsigned char packetErrorControl0 = 0xbb;
150 unsigned char packetErrorControl0 = 0xbb;
145
151
146 ccsds_command = new ccsds(1, 0, 0, nbBYTES_application_data+12, 0, 0, 0, 0, 0); // +12 => packet header 6 bytes + data field header 4 bytes + packet error control 2 bytes
152 ccsds_command = new ccsds(1, 0, 0, nbBYTES_application_data+12, 0, 0, 0, 0, 0); // +12 => packet header 6 bytes + data field header 4 bytes + packet error control 2 bytes
147 /* unsigned char data_field_header,
153 /* unsigned char data_field_header,
148 unsigned char processID,
154 unsigned char processID,
149 unsigned int sequence_count,
155 unsigned int sequence_count,
150 unsigned int packet_length,
156 unsigned int packet_length,
151 unsigned char acceptance,
157 unsigned char acceptance,
152 unsigned int completion,
158 unsigned int completion,
153 unsigned char service_type,
159 unsigned char service_type,
154 unsigned char service_subtype,
160 unsigned char service_subtype,
155 unsigned char sourceID*/
161 unsigned char sourceID*/
156
162
157 count = nbBYTES_application_data+12; // 12 is the size in bytes of the header
163 count = nbBYTES_application_data+12; // 12 is the size in bytes of the header
158 tab = (char*) malloc(count);
164 tab = (char*) malloc(count);
159 tab[0] = ccsds_command->ccsds_header->packetId1;
165 tab[0] = ccsds_command->ccsds_header->packetId1;
160 tab[1] = ccsds_command->ccsds_header->packetId0;
166 tab[1] = ccsds_command->ccsds_header->packetId0;
161 tab[2] = ccsds_command->ccsds_header->packetSequenceControl1;
167 tab[2] = ccsds_command->ccsds_header->packetSequenceControl1;
162 tab[3] = ccsds_command->ccsds_header->packetSequenceControl0;
168 tab[3] = ccsds_command->ccsds_header->packetSequenceControl0;
163 tab[4] = ccsds_command->ccsds_header->packetLength1;
169 tab[4] = ccsds_command->ccsds_header->packetLength1;
164 tab[5] = ccsds_command->ccsds_header->packetLength0;
170 tab[5] = ccsds_command->ccsds_header->packetLength0;
165 tab[6] = ccsds_command->ccsds_header->dataFieldHeader3;
171 tab[6] = ccsds_command->ccsds_header->dataFieldHeader3;
166 tab[7] = ccsds_command->ccsds_header->dataFieldHeader2;
172 tab[7] = ccsds_command->ccsds_header->dataFieldHeader2;
167 tab[8] = ccsds_command->ccsds_header->dataFieldHeader1;
173 tab[8] = ccsds_command->ccsds_header->dataFieldHeader1;
168 tab[9] = ccsds_command->ccsds_header->dataFieldHeader0;
174 tab[9] = ccsds_command->ccsds_header->dataFieldHeader0;
169 tab[10]=0x00;
175 tab[10]=0x00;
170 tab[11]=0x00;
176 tab[11]=0x00;
171 tab[12]=0x00;
177 tab[12]=0x00;
172 tab[13]=0x00;
178 tab[13]=0x00;
173 tab[14]=0x00;
179 tab[14]=0x00;
174 tab[15]=0x00;
180 tab[15]=0x00;
175 tab[nbBYTES_application_data+10] = packetErrorControl1;
181 tab[nbBYTES_application_data+10] = packetErrorControl1;
176 tab[nbBYTES_application_data+11] = packetErrorControl0;
182 tab[nbBYTES_application_data+11] = packetErrorControl0;
177
183
178 WriteSPW(tab, count, UI->CCSDSTargetLogicalAddressSpinBox->value(), 0x00);
184 WriteSPW(tab, count, UI->CCSDSTargetLogicalAddressSpinBox->value(), 0x00);
179
185
180 free(tab);
186 free(tab);
181 }
187 }
182
188
183 void rmapplugin::openBridge()
189 void rmapplugin::openBridge()
184 {
190 {
185 switch(currentBridge)
191 switch(currentBridge)
186 {
192 {
187 case selectedBridgeIsGRESB :
193 case selectedBridgeIsGRESB :
188 this->UI->gresbBridge->Open();
194 this->UI->gresbBridge->Open();
189 break;
195 break;
190 case selectedBridgeIsStarDundee :
196 case selectedBridgeIsStarDundee :
191 this->UI->starDundee->Open();
197 this->UI->starDundee->Open();
192 break;
198 break;
193 default:
199 default:
194 break;
200 break;
195 }
201 }
196 }
202 }
197
203
198 void rmapplugin::closeBridge()
204 void rmapplugin::closeBridge()
199 {
205 {
200 switch(currentBridge)
206 switch(currentBridge)
201 {
207 {
202 case selectedBridgeIsGRESB :
208 case selectedBridgeIsGRESB :
203 this->UI->gresbBridge->Close();
209 this->UI->gresbBridge->Close();
204 break;
210 break;
205 case selectedBridgeIsStarDundee :
211 case selectedBridgeIsStarDundee :
206 this->UI->starDundee->Close();
212 this->UI->starDundee->Close();
207 break;
213 break;
208 default:
214 default:
209 break;
215 break;
210 }
216 }
211 }
217 }
212
218
213 void rmapplugin::send_TC_LFR_UPDATE_TIME()
219 void rmapplugin::send_TC_LFR_UPDATE_TIME()
214 {
220 {
215 unsigned int nbBYTES_application_data = 6; // Time at CUC format is on 48 bits / 6 bytes
221 unsigned int nbBYTES_application_data = 6; // Time at CUC format is on 48 bits / 6 bytes
216 unsigned int count;
222 unsigned int count;
217 char *tab;
223 char *tab;
218 unsigned char packetErrorControl1 = 0xaa;
224 unsigned char packetErrorControl1 = 0xaa;
219 unsigned char packetErrorControl0 = 0xbb;
225 unsigned char packetErrorControl0 = 0xbb;
220
226
221 ccsds_command = new ccsds(1, 11, 0, nbBYTES_application_data, 1, 1, 9, 129, 0);
227 ccsds_command = new ccsds(1, 11, 0, nbBYTES_application_data, 1, 1, 9, 129, 0);
222 /* unsigned char data_field_header,
228 /* unsigned char data_field_header,
223 unsigned char processID,
229 unsigned char processID,
224 unsigned int sequence_count,
230 unsigned int sequence_count,
225 unsigned int packet_length,
231 unsigned int packet_length,
226 unsigned char acceptance,
232 unsigned char acceptance,
227 unsigned int completion,
233 unsigned int completion,
228 unsigned char service_type,
234 unsigned char service_type,
229 unsigned char service_subtype,
235 unsigned char service_subtype,
230 unsigned char sourceID*/
236 unsigned char sourceID*/
231
237
232 count = nbBYTES_application_data+12; // +12 => packet header 6 bytes + data field header 4 bytes + packet error control 2 bytes
238 count = nbBYTES_application_data+12; // +12 => packet header 6 bytes + data field header 4 bytes + packet error control 2 bytes
233 tab = (char*) malloc(count);
239 tab = (char*) malloc(count);
234 tab[0] = ccsds_command->ccsds_header->packetId1;
240 tab[0] = ccsds_command->ccsds_header->packetId1;
235 tab[1] = ccsds_command->ccsds_header->packetId0;
241 tab[1] = ccsds_command->ccsds_header->packetId0;
236 tab[2] = ccsds_command->ccsds_header->packetSequenceControl1;
242 tab[2] = ccsds_command->ccsds_header->packetSequenceControl1;
237 tab[3] = ccsds_command->ccsds_header->packetSequenceControl0;
243 tab[3] = ccsds_command->ccsds_header->packetSequenceControl0;
238 tab[4] = ccsds_command->ccsds_header->packetLength1;
244 tab[4] = ccsds_command->ccsds_header->packetLength1;
239 tab[5] = ccsds_command->ccsds_header->packetLength0;
245 tab[5] = ccsds_command->ccsds_header->packetLength0;
240 tab[6] = ccsds_command->ccsds_header->dataFieldHeader3;
246 tab[6] = ccsds_command->ccsds_header->dataFieldHeader3;
241 tab[7] = ccsds_command->ccsds_header->dataFieldHeader2;
247 tab[7] = ccsds_command->ccsds_header->dataFieldHeader2;
242 tab[8] = ccsds_command->ccsds_header->dataFieldHeader1;
248 tab[8] = ccsds_command->ccsds_header->dataFieldHeader1;
243 tab[9] = ccsds_command->ccsds_header->dataFieldHeader0;
249 tab[9] = ccsds_command->ccsds_header->dataFieldHeader0;
244 tab[10] = (unsigned char) (time_COARSE>>24);
250 tab[10] = (unsigned char) (time_COARSE>>24);
245 tab[11] = (unsigned char) (time_COARSE>>18);
251 tab[11] = (unsigned char) (time_COARSE>>18);
246 tab[12] = (unsigned char) (time_COARSE>>8);
252 tab[12] = (unsigned char) (time_COARSE>>8);
247 tab[13] = (unsigned char) (time_COARSE);
253 tab[13] = (unsigned char) (time_COARSE);
248 tab[14] = (unsigned char) (time_FINE>>8);
254 tab[14] = (unsigned char) (time_FINE>>8);
249 tab[15] = (unsigned char) (time_FINE);
255 tab[15] = (unsigned char) (time_FINE);
250 tab[nbBYTES_application_data+10] = packetErrorControl1;
256 tab[nbBYTES_application_data+10] = packetErrorControl1;
251 tab[nbBYTES_application_data+11] = packetErrorControl0;
257 tab[nbBYTES_application_data+11] = packetErrorControl0;
252
258
253 WriteSPW(tab, count, UI->CCSDSTargetLogicalAddressSpinBox->value(), 0x00);
259 WriteSPW(tab, count, UI->CCSDSTargetLogicalAddressSpinBox->value(), 0x00);
254
260
255 time_COARSE = time_COARSE+1;
261 time_COARSE = time_COARSE+1;
256
262
257 free(tab);
263 free(tab);
258 }
264 }
259
265
260 void rmapplugin::reset_TC_LFR_UPDATE_TIME()
266 void rmapplugin::reset_TC_LFR_UPDATE_TIME()
261 {
267 {
262 time_COARSE = 0;
268 time_COARSE = 0;
263 time_FINE = 0;
269 time_FINE = 0;
264 }
270 }
265
271
266 void rmapplugin::RMAP_write_reply_setText(QString text)
272 void rmapplugin::RMAP_write_reply_setText(QString text)
267 {
273 {
268 this->UI->RMAP_write_reply->setText(text);
274 this->UI->RMAP_write_reply->setText(text);
269 }
275 }
270
276
271 void rmapplugin::appendToLog(QString text)
277 void rmapplugin::appendToLog(QString text)
272 {
278 {
273 APPENDTOLOG(text);
279 APPENDTOLOG(text);
274 }
280 }
275
281
276 /////////////////////
282 /////////////////////
277 // INTERNAL FUNCTIONS
283 // INTERNAL FUNCTIONS
278
284
279 void rmapplugin::gresbSelection(bool flag)
285 void rmapplugin::processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size) // SLOT
280 {
286 {
281 if (flag == true) UI->selection_GROUPBOX->setEnabled(false);
287 QString message;
282 if (flag == false) UI->selection_GROUPBOX->setEnabled(true);
288 unsigned int fine_time_value = 0;
289 fine_time_value = ((unsigned int) ccsdsPacket[7]<<24)
290 + ((unsigned int) ccsdsPacket[6]<<16)
291 + ((unsigned int) ccsdsPacket[5]<<8)
292 + ((unsigned int) ccsdsPacket[4]);
293 message.append(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": ");
294 message.append("size "
295 + QString::number(size)
296 +" *** header "
297 + QString::number(ccsdsPacket[0], 16)
298 + " "
299 + QString::number(ccsdsPacket[1], 16)
300 + " "
301 + QString::number(ccsdsPacket[2], 16)
302 + " "
303 + QString::number(ccsdsPacket[3], 16)
304 + " *** coarse time "
305 + QString::number(fine_time_value));
306 //+ QString::number(ccsdsPacket[4], 16)
307 //+" "
308 //+ QString::number(ccsdsPacket[5], 16)
309 //+" "
310 //+ QString::number(ccsdsPacket[6], 16)
311 //+" "
312 //+ QString::number(ccsdsPacket[7], 16));
313 displayOnConsole(message);
314 emit ccsdsPacketIsProcessed();
283 }
315 }
284
316
285
286
@@ -1,89 +1,88
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the LPPMON Software
2 -- This file is a part of the LPPMON Software
3 -- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
3 -- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #ifndef DRIVER1_H
22 #ifndef DRIVER1_H
23 #define DRIVER1_H
23 #define DRIVER1_H
24 #include <rmappluginui.h>
24 #include <rmappluginui.h>
25 #include <rmapoperations.h>
25 #include <rmapoperations.h>
26 #include <QMenuBar>
26 #include <QMenuBar>
27 #include <QMenu>
27 #include <QMenu>
28 #include <QAction>
28 #include <QAction>
29 #include <QMainWindow>
29 #include <QMainWindow>
30 #include <QTcpSocket>
30 #include <QTcpSocket>
31 #include <QTime>
31 #include <QTime>
32 #include <ccsds.h>
32 #include <ccsds.h>
33 #include <QSemaphore>
33 #include <QSemaphore>
34 #include <spwpacketreceiver.h>
35
34
36 #include <lppmonplugin.h>
35 #include <lppmonplugin.h>
37
36
38 #define APPENDTOLOG(message) this->UI->appendToLogFile(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": " + message)
37 #define APPENDTOLOG(message) this->UI->appendToLogFile(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": " + message)
39
38
40 #define READ_WRITE_MAX_COUNTS 4096 // in words
39 #define READ_WRITE_MAX_COUNTS 4096 // in words
41 #define RMAP_MAX_DATA_LENGTH 4*READ_WRITE_MAX_COUNTS // in bytes, shall be lower than the limit size of SPW packet of the GRESB bridge
40 #define RMAP_MAX_DATA_LENGTH 4*READ_WRITE_MAX_COUNTS // in bytes, shall be lower than the limit size of SPW packet of the GRESB bridge
42 #define RMAP_READ_REPLY_HEADER_LENGTH 12 // in bytes => ECSS
41 #define RMAP_READ_REPLY_HEADER_LENGTH 12 // in bytes => ECSS
43 #define RMAP_READ_COMMAND_HEADER_LENGTH 16 // in bytes => ECSS
42 #define RMAP_READ_COMMAND_HEADER_LENGTH 16 // in bytes => ECSS
44 #define RMAP_DATA_CRC_LENGTH 1 // in bytes => ECSS
43 #define RMAP_DATA_CRC_LENGTH 1 // in bytes => ECSS
45 #define CCSDS_MAX_PACKET_LENGTH 4412 // in bytes, specified in the LFR Software Requirements Specification
44 #define CCSDS_MAX_PACKET_LENGTH 4412 // in bytes, specified in the LFR Software Requirements Specification
46
45
47 class rmapplugin : public lppmonplugin
46 class rmapplugin : public lppmonplugin
48 {
47 {
49 Q_OBJECT
48 Q_OBJECT
50 public:
49 public:
51 explicit rmapplugin(QWidget *parent = 0);
50 explicit rmapplugin(QWidget *parent = 0);
52 ~rmapplugin();
51 ~rmapplugin();
53
52
54 public slots:
53 public slots:
55 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);
56 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);
57 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);
58 void openBridge();
57 void openBridge();
59 void closeBridge();
58 void closeBridge();
59 void processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
60 //
60 //
61 void sendCCSDS();
61 void sendCCSDS();
62 void send_TC_LFR_UPDATE_TIME();
62 void send_TC_LFR_UPDATE_TIME();
63 void reset_TC_LFR_UPDATE_TIME();
63 void reset_TC_LFR_UPDATE_TIME();
64 void displayOnConsole(QString message) {this->UI->console->append(message);}
64 void displayOnConsole(QString message) {this->UI->console->append(message);}
65 //
65 //
66 void gresbSelection(bool flag);
67 void RMAP_write_reply_setText(QString text);
66 void RMAP_write_reply_setText(QString text);
68 void appendToLog(QString text);
67 void appendToLog(QString text);
69 //
68 //
70 void activatePlugin(bool flag) {emit activateSig(flag);}
69 void activatePlugin(bool flag) {emit activateSig(flag);}
71 void bridgeHasChanged(selectedBridge bridge) {currentBridge = bridge;}
70 void bridgeHasChanged(selectedBridge bridge) {currentBridge = bridge;}
72
71
73 signals:
72 signals:
73 void ccsdsPacketIsProcessed();
74
74
75 private:
75 private:
76 selectedBridge currentBridge;
76 selectedBridge currentBridge;
77 rmapPluginUI* UI;
77 rmapPluginUI* UI;
78 QTcpSocket* GRESBStatusQuery_SOCKET;
78 QTcpSocket* GRESBStatusQuery_SOCKET;
79 QTcpSocket* RMAPSend_SOCKET;
79 QTcpSocket* RMAPSend_SOCKET;
80 QTcpSocket* RMAPReceive_SOCKET;
80 QTcpSocket* RMAPReceive_SOCKET;
81 ccsds* ccsds_command;
81 ccsds* ccsds_command;
82 unsigned int rmapPacketSize;
82 unsigned int rmapPacketSize;
83 unsigned int time_COARSE;
83 unsigned int time_COARSE;
84 unsigned int time_FINE;
84 unsigned int time_FINE;
85 spwpacketreceiver* spwPacketReceiverOBJECT;
86 char timeCode;
85 char timeCode;
87 };
86 };
88
87
89 #endif // DRIVER1_H
88 #endif // DRIVER1_H
@@ -1,72 +1,70
1 #
1 #
2 # Project created by QtCreator 2011-09-20T08:15:30
2 # Project created by QtCreator 2011-09-20T08:15:30
3 #
3 #
4 #-------------------------------------------------
4 #-------------------------------------------------
5
5
6 #include(/etc/lppmon/lppmonplugin.prf)
6 #include(/etc/lppmon/lppmonplugin.prf)
7 CONFIG += lppmonplugin
7 CONFIG += lppmonplugin
8 TARGET = rmapplugin
8 TARGET = rmapplugin
9
9
10 DEFINES += PLUGIN=rmapplugin
10 DEFINES += PLUGIN=rmapplugin
11 DEFINES += PLUGINHEADER="\"\\\"rmapplugin.h"\\\"\"
11 DEFINES += PLUGINHEADER="\"\\\"rmapplugin.h"\\\"\"
12 DEFINES += driver_Name="\"\\\"RMAPPlugin"\\\"\"
12 DEFINES += driver_Name="\"\\\"RMAPPlugin"\\\"\"
13 DEFINES += driver_Author="\"\\\"Paul Leroy paul.leroy@lpp.polytechnique.fr"\\\"\"
13 DEFINES += driver_Author="\"\\\"Paul Leroy paul.leroy@lpp.polytechnique.fr"\\\"\"
14 DEFINES += driver_Version="\"\\\"1.1.2"\\\"\"
14 DEFINES += driver_Version="\"\\\"1.1.2"\\\"\"
15 DEFINES += driver_Description="\"\\\"AHB bus controler, works with Gaisler's AHB plugn' play bus."\\\"\"
15 DEFINES += driver_Description="\"\\\"AHB bus controler, works with Gaisler's AHB plugn' play bus."\\\"\"
16 DEFINES += driver_can_be_root=1
16 DEFINES += driver_can_be_root=1
17 DEFINES += driver_can_be_child=0
17 DEFINES += driver_can_be_child=0
18 DEFINES += driver_VID=0
18 DEFINES += driver_VID=0
19 DEFINES += driver_PID=0
19 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.61/lib/x86_64/libSpaceWireUSBAPI.so \
24 ../spw_usb_driver_v2.61/lib/x86_64/libConfigLibraryUSB.so
24 ../spw_usb_driver_v2.61/lib/x86_64/libConfigLibraryUSB.so
25
25
26
26
27 INCLUDEPATH += \
27 INCLUDEPATH += \
28 $${PWD} \
28 $${PWD} \
29 ../common_PLE \
29 ../common_PLE \
30 ../spw_usb_driver_v2.61/inc
30 ../spw_usb_driver_v2.61/inc
31
31
32
32
33 HEADERS += \
33 HEADERS += \
34 rmappluginui.h \
34 rmappluginui.h \
35 rmapplugin.h \
35 rmapplugin.h \
36 rmapoperations.h \
36 rmapoperations.h \
37 ccsds.h \
37 ccsds.h \
38 spwpacketreceiver.h \
39 ../common_PLE/qipdialogbox.h \
38 ../common_PLE/qipdialogbox.h \
40 ../common_PLE/gresbstatusenquiry.h \
39 ../common_PLE/gresbstatusenquiry.h \
41 spectralmatricesdmasimulator.h \
40 spectralmatricesdmasimulator.h \
42 rmappluginpythonwrapper.h \
41 rmappluginpythonwrapper.h \
43 stardundee.h \
42 stardundee.h \
44 ../spw_usb_driver_v2.61/inc/spw_usb_api.h \
43 ../spw_usb_driver_v2.61/inc/spw_usb_api.h \
45 ../spw_usb_driver_v2.61/inc/spw_config_library.h \
44 ../spw_usb_driver_v2.61/inc/spw_config_library.h \
46 gresb.h \
45 gresb.h \
47 bridge.h
46 bridge.h
48
47
49
48
50 SOURCES += \
49 SOURCES += \
51 rmapplugin.cpp \
50 rmapplugin.cpp \
52 rmappluginui.cpp \
51 rmappluginui.cpp \
53 rmapoperations.cpp \
52 rmapoperations.cpp \
54 ccsds.cpp \
53 ccsds.cpp \
55 spwpacketreceiver.cpp \
56 ../common_PLE/qipdialogbox.cpp \
54 ../common_PLE/qipdialogbox.cpp \
57 ../common_PLE/gresbstatusenquiry.cpp \
55 ../common_PLE/gresbstatusenquiry.cpp \
58 spectralmatricesdmasimulator.cpp \
56 spectralmatricesdmasimulator.cpp \
59 rmappluginpythonwrapper.cpp \
57 rmappluginpythonwrapper.cpp \
60 stardundee.cpp \
58 stardundee.cpp \
61 gresb.cpp \
59 gresb.cpp \
62 bridge.cpp
60 bridge.cpp
63
61
64
62
65
63
66
64
67
65
68
66
69
67
70
68
71
69
72
70
@@ -1,293 +1,293
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the LPPMON Software
2 -- This file is a part of the LPPMON Software
3 -- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
3 -- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "rmapplugin.h"
22 #include "rmapplugin.h"
23
23
24 rmapPluginUI::rmapPluginUI(QWidget *parent) :
24 rmapPluginUI::rmapPluginUI(QWidget *parent) :
25 QWidget(parent)
25 QWidget(parent)
26 {
26 {
27 spectralMatricesDMASimulator = new SpectralMatricesDMASimulator;
27 spectralMatricesDMASimulator = new SpectralMatricesDMASimulator;
28 spwTabWidget = new QTabWidget;
28 spwTabWidget = new QTabWidget;
29 QWidget* spwTabWidgetPage0 = new QWidget;
29 QWidget* spwTabWidgetPage0 = new QWidget;
30 QWidget* spwTabWidgetPage1 = new QWidget;
30 QWidget* spwTabWidgetPage1 = new QWidget;
31 QWidget* spwTabWidgetPage2 = new QWidget;
31 QWidget* spwTabWidgetPage2 = new QWidget;
32 QWidget* spwTabWidgetPage3 = new QWidget;
32 QWidget* spwTabWidgetPage3 = new QWidget;
33 QWidget* spwTabWidgetPage4 = new QWidget;
33 QWidget* spwTabWidgetPage4 = new QWidget;
34 bridgeWidget = new QWidget;
34 bridgeWidget = new QWidget;
35 mainLayout = new QVBoxLayout;
35 mainLayout = new QVBoxLayout;
36 connectionLayout = new QGridLayout;
36 connectionLayout = new QGridLayout;
37 ccsdsLayout = new QVBoxLayout;
37 ccsdsLayout = new QVBoxLayout;
38 consoleLayout = new QVBoxLayout;
38 consoleLayout = new QVBoxLayout;
39 selectionLayout = new QVBoxLayout;
39 selectionLayout = new QVBoxLayout;
40 bridgeSelection_LAYOUT = new QGridLayout;
40 bridgeSelection_LAYOUT = new QGridLayout;
41 generalParameters_LAYOUT = new QGridLayout;
41 generalParameters_LAYOUT = new QGridLayout;
42
42
43 gresb_GROUPBOX = new QGroupBox(tr("GRESB bridge parameters"));
43 gresb_GROUPBOX = new QGroupBox(tr("GRESB bridge parameters"));
44 stardundee_GROUPBOX = new QGroupBox(tr("Star Dundee brick parameters"));
44 stardundee_GROUPBOX = new QGroupBox(tr("Star Dundee brick parameters"));
45 selection_GROUPBOX = new QGroupBox(tr("Bridge selection"));
45 selection_GROUPBOX = new QGroupBox(tr("Bridge selection"));
46 generalParameters_GROUPBOX = new QGroupBox(tr("General parameters"));
46 generalParameters_GROUPBOX = new QGroupBox(tr("General parameters"));
47
47
48 //*** QLABEL ***//
48 //*** QLABEL ***//
49 gresbBridgeIPLabel = new QLabel(tr("Bridge IP: "));
49 gresbBridgeIPLabel = new QLabel(tr("Bridge IP: "));
50 gresbVirtualLinkLabel = new QLabel(tr("Virtual Link: "));
50 gresbVirtualLinkLabel = new QLabel(tr("Virtual Link: "));
51 spwLinkLabel = new QLabel(tr("SPW Link: "));
51 spwLinkLabel = new QLabel(tr("SPW Link: "));
52 rmapSourceLogicalAddressLabel = new QLabel(tr("RMAP Source Logical Address: "));
52 rmapSourceLogicalAddressLabel = new QLabel(tr("RMAP Source Logical Address: "));
53 rmapTargetLogicalAddressLabel = new QLabel(tr("RMAP Target Logical Address: "));
53 rmapTargetLogicalAddressLabel = new QLabel(tr("RMAP Target Logical Address: "));
54 logFileName = new QLabel;
54 logFileName = new QLabel;
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
58
59 //*** QPUSHBUTTON ***//
59 //*** QPUSHBUTTON ***//
60 rmapOpenCommunicationButton = new QPushButton(tr("Open selected bridge"));
60 rmapOpenCommunicationButton = new QPushButton(tr("Open selected bridge"));
61 rmapCloseCommunicationButton = new QPushButton(tr("Close selected bridge"));
61 rmapCloseCommunicationButton = new QPushButton(tr("Close selected bridge"));
62 rmapOpenCommunicationButton->setEnabled(false);
62 rmapOpenCommunicationButton->setEnabled(false);
63 rmapCloseCommunicationButton->setEnabled(false);
63 rmapCloseCommunicationButton->setEnabled(false);
64 logFileChooseButton = new QPushButton(tr("Choose file"));
64 logFileChooseButton = new QPushButton(tr("Choose file"));
65 gresbStatusQueryRetryButton = new QPushButton(tr("Retry"));
65 gresbStatusQueryRetryButton = new QPushButton(tr("Retry"));
66 gresbStatusQueryAbortButton = new QPushButton(tr("Abort"));
66 gresbStatusQueryAbortButton = new QPushButton(tr("Abort"));
67 sendCCSDSCommandButton = new QPushButton(tr("Send CCSDS Command"));
67 sendCCSDSCommandButton = new QPushButton(tr("Send CCSDS Command"));
68 send_TC_LFR_UPDATE_TIME_Button = new QPushButton(tr("Send TC_LFR_UPDATE_TIME Packet"));
68 send_TC_LFR_UPDATE_TIME_Button = new QPushButton(tr("Send TC_LFR_UPDATE_TIME Packet"));
69 reset_TC_LFR_UPDATE_TIME_Button = new QPushButton(tr("reset the TC_LFR_UPDATE_TIME Packet coarse and fine times"));
69 reset_TC_LFR_UPDATE_TIME_Button = new QPushButton(tr("reset the TC_LFR_UPDATE_TIME Packet coarse and fine times"));
70 clearConsoleButton = new QPushButton(tr("Clear"));
70 clearConsoleButton = new QPushButton(tr("Clear"));
71
71
72 selectGRESB_BUTTON = new QRadioButton(tr("GRESB"));
72 selectGRESB_BUTTON = new QRadioButton(tr("GRESB"));
73 selectStarDundee_BUTTON = new QRadioButton(tr("Star Dundee"));
73 selectStarDundee_BUTTON = new QRadioButton(tr("Star Dundee"));
74
74
75 //*** SPINBOX ***//
75 //*** SPINBOX ***//
76 gresbVirtualLinkSpinBox = new QSpinBox;
76 gresbVirtualLinkSpinBox = new QSpinBox;
77 rmapSourceLogicalAddressSpinBox = new QSpinBox;
77 rmapSourceLogicalAddressSpinBox = new QSpinBox;
78 rmapTargetLogicalAddressSpinBox = new QSpinBox;
78 rmapTargetLogicalAddressSpinBox = new QSpinBox;
79 spwLinkSpinBox = new QSpinBox;;
79 spwLinkSpinBox = new QSpinBox;;
80 CCSDSTargetLogicalAddressSpinBox = new QSpinBox;
80 CCSDSTargetLogicalAddressSpinBox = new QSpinBox;
81 gresbVirtualLinkSpinBox->setRange(0, 4);
81 gresbVirtualLinkSpinBox->setRange(0, 4);
82 gresbVirtualLinkSpinBox->setValue(1);
82 gresbVirtualLinkSpinBox->setValue(1);
83 rmapSourceLogicalAddressSpinBox->setRange(0, 255);
83 rmapSourceLogicalAddressSpinBox->setRange(0, 255);
84 rmapSourceLogicalAddressSpinBox->setValue(33);
84 rmapSourceLogicalAddressSpinBox->setValue(33);
85 rmapTargetLogicalAddressSpinBox->setRange(0, 255);
85 rmapTargetLogicalAddressSpinBox->setRange(0, 255);
86 spwLinkSpinBox->setRange(0, 2);
86 spwLinkSpinBox->setRange(0, 2);
87 spwLinkSpinBox->setValue(0);
87 spwLinkSpinBox->setValue(0);
88 CCSDSTargetLogicalAddressSpinBox->setRange(0,255);
88 CCSDSTargetLogicalAddressSpinBox->setRange(0,255);
89 CCSDSTargetLogicalAddressSpinBox->setValue(254);
89 CCSDSTargetLogicalAddressSpinBox->setValue(254);
90
90
91 //*** MISC **//
91 //*** MISC **//
92 starDundee = new StarDundee;
92 starDundee = new StarDundee;
93 gresbBridge = new gresb;
93 gresbBridge = new gresb;
94 console = new QTextEdit;
94 console = new QTextEdit;
95 gresbBridgeIPDialogBox = new QIPDialogBox;
95 gresbBridgeIPDialogBox = new QIPDialogBox;
96 gresbStatusQueryDialog = new QDialog;
96 gresbStatusQueryDialog = new QDialog;
97 logEnableCheckBox = new QCheckBox(tr("Enable Logs"));
97 logEnableCheckBox = new QCheckBox(tr("Enable Logs"));
98 RMAP_write_verify = new QCheckBox(tr("data checked before write\nlimited to 4 bytes\nNOT IMPLEMENTED"));
98 RMAP_write_verify = new QCheckBox(tr("data checked before write\nlimited to 4 bytes\nNOT IMPLEMENTED"));
99 RMAP_write_reply = new QCheckBox(tr("reply to the write command required\nlast reply status: unavailable"));
99 RMAP_write_reply = new QCheckBox(tr("reply to the write command required\nlast reply status: unavailable"));
100 spwLinkStatusEnquiry = new gresbStatusEnquiry;
100 spwLinkStatusEnquiry = new gresbStatusEnquiry;
101 logFile = new QFile();
101 logFile = new QFile();
102
102
103 logFileEn = false;
103 logFileEn = false;
104
104
105 connectionLayout->setRowStretch(7, 1);
105 connectionLayout->setRowStretch(7, 1);
106 connectionLayout->setColumnStretch(2, 1);
106 connectionLayout->setColumnStretch(2, 1);
107
107
108 bridgeSelection_LAYOUT->addWidget(selectGRESB_BUTTON, 0, 0, 1, 1);
108 bridgeSelection_LAYOUT->addWidget(selectGRESB_BUTTON, 0, 0, 1, 1);
109 bridgeSelection_LAYOUT->addWidget(selectStarDundee_BUTTON, 0, 1, 1, 1);
109 bridgeSelection_LAYOUT->addWidget(selectStarDundee_BUTTON, 0, 1, 1, 1);
110 bridgeSelection_LAYOUT->setRowStretch(1, 1);
110 bridgeSelection_LAYOUT->setRowStretch(1, 1);
111 bridgeSelection_LAYOUT->setColumnStretch(2, 1);
111 bridgeSelection_LAYOUT->setColumnStretch(2, 1);
112
112
113 generalParameters_LAYOUT->addWidget(logEnableCheckBox, 0, 0, 1, 1);
113 generalParameters_LAYOUT->addWidget(logEnableCheckBox, 0, 0, 1, 1);
114 generalParameters_LAYOUT->addWidget(logFileChooseButton, 0, 1, 1, 1);
114 generalParameters_LAYOUT->addWidget(logFileChooseButton, 0, 1, 1, 1);
115 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressLabel, 1, 0, 0);
115 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressLabel, 1, 0, 0);
116 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressSpinBox, 1, 1, 0);
116 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressSpinBox, 1, 1, 0);
117 generalParameters_LAYOUT->addWidget(rmapOpenCommunicationButton, 2, 0, 1, 1);
117 generalParameters_LAYOUT->addWidget(rmapOpenCommunicationButton, 2, 0, 1, 1);
118 generalParameters_LAYOUT->addWidget(rmapCloseCommunicationButton, 2, 1, 1, 1);
118 generalParameters_LAYOUT->addWidget(rmapCloseCommunicationButton, 2, 1, 1, 1);
119 generalParameters_LAYOUT->addWidget(RMAP_write_verify, 3, 0, 1, 2);
119 generalParameters_LAYOUT->addWidget(RMAP_write_verify, 3, 0, 1, 2);
120 generalParameters_LAYOUT->addWidget(RMAP_write_reply, 4, 0, 1, 2);
120 generalParameters_LAYOUT->addWidget(RMAP_write_reply, 4, 0, 1, 2);
121 generalParameters_LAYOUT->setRowStretch(5, 1);
121 generalParameters_LAYOUT->setRowStretch(5, 1);
122 generalParameters_LAYOUT->setColumnStretch(2, 1);
122 generalParameters_LAYOUT->setColumnStretch(2, 1);
123
123
124 gresb_GROUPBOX->setLayout(gresbBridge->layout());
124 gresb_GROUPBOX->setLayout(gresbBridge->layout());
125 gresb_GROUPBOX->setVisible(false);
125 gresb_GROUPBOX->setVisible(false);
126 stardundee_GROUPBOX->setLayout(starDundee->layout());
126 stardundee_GROUPBOX->setLayout(starDundee->layout());
127 stardundee_GROUPBOX->setVisible(false);
127 stardundee_GROUPBOX->setVisible(false);
128 selection_GROUPBOX->setLayout(bridgeSelection_LAYOUT);
128 selection_GROUPBOX->setLayout(bridgeSelection_LAYOUT);
129 generalParameters_GROUPBOX->setLayout(generalParameters_LAYOUT);
129 generalParameters_GROUPBOX->setLayout(generalParameters_LAYOUT);
130 selectionLayout->addWidget(selection_GROUPBOX);
130 selectionLayout->addWidget(selection_GROUPBOX);
131 selectionLayout->addWidget(generalParameters_GROUPBOX);
131 selectionLayout->addWidget(generalParameters_GROUPBOX);
132 selectionLayout->addWidget(gresb_GROUPBOX);
132 selectionLayout->addWidget(gresb_GROUPBOX);
133 selectionLayout->addWidget(stardundee_GROUPBOX);
133 selectionLayout->addWidget(stardundee_GROUPBOX);
134
134
135 ccsdsLayout->addWidget(sendCCSDSCommandButton);
135 ccsdsLayout->addWidget(sendCCSDSCommandButton);
136 ccsdsLayout->addWidget(send_TC_LFR_UPDATE_TIME_Button);
136 ccsdsLayout->addWidget(send_TC_LFR_UPDATE_TIME_Button);
137 ccsdsLayout->addWidget(reset_TC_LFR_UPDATE_TIME_Button);
137 ccsdsLayout->addWidget(reset_TC_LFR_UPDATE_TIME_Button);
138 ccsdsLayout->addWidget(sendCCSDSCommandLabel);
138 ccsdsLayout->addWidget(sendCCSDSCommandLabel);
139 ccsdsLayout->addWidget(CCSDSTargetLogicalAddressSpinBox);
139 ccsdsLayout->addWidget(CCSDSTargetLogicalAddressSpinBox);
140
140
141 consoleLayout->addWidget(console);
141 consoleLayout->addWidget(console);
142 consoleLayout->addWidget(clearConsoleButton);
142 consoleLayout->addWidget(clearConsoleButton);
143
143
144 connect(this->logFileChooseButton, SIGNAL(clicked()), this, SLOT(chooseLogFile()));
144 connect(this->logFileChooseButton, SIGNAL(clicked()), this, SLOT(chooseLogFile()));
145 connect(this, SIGNAL(setLogFileName(QString)), this->logFileName, SLOT(setText(QString)));
145 connect(this, SIGNAL(setLogFileName(QString)), this->logFileName, SLOT(setText(QString)));
146 connect(this->logEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(logFileEnDisable(int)));
146 connect(this->logEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(logFileEnDisable(int)));
147
147
148 spwTabWidget->addTab(spwTabWidgetPage0, tr("connection"));
148 spwTabWidget->addTab(spwTabWidgetPage0, tr("connection"));
149 spwTabWidget->addTab(spwTabWidgetPage1, tr("ccsds"));
149 spwTabWidget->addTab(spwTabWidgetPage1, tr("ccsds"));
150 spwTabWidget->addTab(spwTabWidgetPage2, tr("status"));
150 spwTabWidget->addTab(spwTabWidgetPage2, tr("status"));
151 spwTabWidget->addTab(spwTabWidgetPage3, tr("console"));
151 spwTabWidget->addTab(spwTabWidgetPage3, tr("console"));
152 spwTabWidget->addTab(spwTabWidgetPage4, tr("DMA"));
152 spwTabWidget->addTab(spwTabWidgetPage4, tr("DMA"));
153
153
154 spwTabWidgetPage0->setLayout(selectionLayout);
154 spwTabWidgetPage0->setLayout(selectionLayout);
155 spwTabWidgetPage1->setLayout(ccsdsLayout);
155 spwTabWidgetPage1->setLayout(ccsdsLayout);
156 spwTabWidgetPage2->setLayout(this->spwLinkStatusEnquiry->mainLayout);
156 spwTabWidgetPage2->setLayout(this->spwLinkStatusEnquiry->mainLayout);
157 spwTabWidgetPage3->setLayout(consoleLayout);
157 spwTabWidgetPage3->setLayout(consoleLayout);
158 spwTabWidgetPage4->setLayout(spectralMatricesDMASimulator->mainLayout);
158 spwTabWidgetPage4->setLayout(spectralMatricesDMASimulator->mainLayout);
159
159
160 mainLayout->addWidget(spwTabWidget);
160 mainLayout->addWidget(spwTabWidget);
161 setLayout(mainLayout);
161 setLayout(mainLayout);
162
162
163 //connect(gresbStatusQueryAbortButton, SIGNAL(clicked()), gresbStatusQueryDialog, SLOT(reject()));
164 connect(this->clearConsoleButton, SIGNAL(clicked()), this->console, SLOT(clear()));
163 connect(this->clearConsoleButton, SIGNAL(clicked()), this->console, SLOT(clear()));
164
165 // briges
165 // briges
166 connect(this->selectGRESB_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee()));
166 connect(this->selectGRESB_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee()));
167 connect(this->selectStarDundee_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee()));
167 connect(this->selectStarDundee_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee()));
168 connect(this->starDundee, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
168 connect(this->starDundee, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
169 connect(this->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
169 connect(this->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
170
170
171 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(targetHasChanged(int)));
171 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(targetHasChanged(int)));
172 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(targetHasChanged(int)));
172 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(targetHasChanged(int)));
173
173
174 // command code
174 // command code
175 connect(this->RMAP_write_reply, SIGNAL(clicked()), this, SLOT(getCommandCode()));
175 connect(this->RMAP_write_reply, SIGNAL(clicked()), this, SLOT(getCommandCode()));
176 connect(this->RMAP_write_verify, SIGNAL(clicked()), this, SLOT(getCommandCode()));
176 connect(this->RMAP_write_verify, SIGNAL(clicked()), this, SLOT(getCommandCode()));
177 connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)),
177 connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)),
178 this->starDundee, SLOT(commandCodeHasChanged(RMAP_command_codes)));
178 this->starDundee, SLOT(commandCodeHasChanged(RMAP_command_codes)));
179 connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)),
179 connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)),
180 this->gresbBridge, SLOT(commandCodeHasChanged(RMAP_command_codes)));
180 this->gresbBridge, SLOT(commandCodeHasChanged(RMAP_command_codes)));
181
181
182 getCommandCode(); // init the command code value
182 getCommandCode(); // init the command code value
183 rmapTargetLogicalAddressSpinBox->setValue(254);
183 rmapTargetLogicalAddressSpinBox->setValue(254);
184 }
184 }
185
185
186 rmapPluginUI::~rmapPluginUI()
186 rmapPluginUI::~rmapPluginUI()
187 {
187 {
188 //delete ui;
188 //delete ui;
189 }
189 }
190
190
191 void rmapPluginUI::chooseLogFile()
191 void rmapPluginUI::chooseLogFile()
192 {
192 {
193 if(this->logFile->isOpen())
193 if(this->logFile->isOpen())
194 this->logFile->close();
194 this->logFile->close();
195 this->logFile->setFileName(QFileDialog::getSaveFileName(this,tr("Open Log file"),
195 this->logFile->setFileName(QFileDialog::getSaveFileName(this,tr("Open Log file"),
196 QDir::homePath()
196 QDir::homePath()
197 + "/"
197 + "/"
198 + QDate::currentDate().toString()
198 + QDate::currentDate().toString()
199 + "_"
199 + "_"
200 + QTime::currentTime().toString()
200 + QTime::currentTime().toString()
201 + "_rmapPluginUI.log",
201 + "_rmapPluginUI.log",
202 tr("Log Files (*.txt *.log)")));
202 tr("Log Files (*.txt *.log)")));
203 if(this->logFile->open(QIODevice::WriteOnly))
203 if(this->logFile->open(QIODevice::WriteOnly))
204 {
204 {
205 this->logFileStrm = new QTextStream(this->logFile);
205 this->logFileStrm = new QTextStream(this->logFile);
206 emit this->setLogFileName(this->logFile->fileName());
206 emit this->setLogFileName(this->logFile->fileName());
207 }
207 }
208 }
208 }
209
209
210 void rmapPluginUI::logFileEnDisable(int state)
210 void rmapPluginUI::logFileEnDisable(int state)
211 {
211 {
212 if(state==Qt::Checked)
212 if(state==Qt::Checked)
213 {
213 {
214 this->logFileEn = true;
214 this->logFileEn = true;
215 }
215 }
216 else if(state==Qt::Unchecked)
216 else if(state==Qt::Unchecked)
217 {
217 {
218 this->logFileEn = false;
218 this->logFileEn = false;
219 }
219 }
220 }
220 }
221
221
222 bool rmapPluginUI::islogfileenable()
222 bool rmapPluginUI::islogfileenable()
223 {
223 {
224 return this->logFileEn;
224 return this->logFileEn;
225 }
225 }
226
226
227 void rmapPluginUI::appendToLogFile(const QString & text)
227 void rmapPluginUI::appendToLogFile(const QString & text)
228 {
228 {
229 if(this->logFileEn && this->logFile->isOpen())
229 if(this->logFileEn && this->logFile->isOpen())
230 {
230 {
231 *(this->logFileStrm) << text << endl;
231 *(this->logFileStrm) << text << endl;
232 }
232 }
233 }
233 }
234
234
235 void rmapPluginUI::closeEvent(QCloseEvent *event)
235 void rmapPluginUI::closeEvent(QCloseEvent *event)
236 {
236 {
237 if(this->logFile->isOpen())
237 if(this->logFile->isOpen())
238 {
238 {
239 this->logFileStrm->flush();
239 this->logFileStrm->flush();
240 this->logFile->waitForBytesWritten(3000);
240 this->logFile->waitForBytesWritten(3000);
241 this->logFile->close();
241 this->logFile->close();
242 }
242 }
243 event->accept();
243 event->accept();
244 }
244 }
245
245
246 RMAP_command_codes rmapPluginUI::getCommandCode()
246 RMAP_command_codes rmapPluginUI::getCommandCode()
247 {
247 {
248 RMAP_command_codes commandCode = invalid0;
248 RMAP_command_codes commandCode = invalid0;
249 if (RMAP_write_verify->isChecked() and RMAP_write_reply->isChecked()) commandCode = writeSingle_ver_rep;
249 if (RMAP_write_verify->isChecked() and RMAP_write_reply->isChecked()) commandCode = writeSingle_ver_rep;
250 if (RMAP_write_verify->isChecked() and !RMAP_write_reply->isChecked()) commandCode = writeSingle_ver_noRep;
250 if (RMAP_write_verify->isChecked() and !RMAP_write_reply->isChecked()) commandCode = writeSingle_ver_noRep;
251 if (!RMAP_write_verify->isChecked() and RMAP_write_reply->isChecked()) commandCode = writeSingle_noVer_Rep;
251 if (!RMAP_write_verify->isChecked() and RMAP_write_reply->isChecked()) commandCode = writeSingle_noVer_Rep;
252 if (!RMAP_write_verify->isChecked() and !RMAP_write_reply->isChecked()) commandCode = writeSingle_noVer_noRep;
252 if (!RMAP_write_verify->isChecked() and !RMAP_write_reply->isChecked()) commandCode = writeSingle_noVer_noRep;
253 emit commandCodeHasChanged(commandCode);
253 emit commandCodeHasChanged(commandCode);
254 return commandCode;
254 return commandCode;
255 }
255 }
256
256
257 // SLOT
257 // SLOT
258
258
259 void rmapPluginUI::selectionBetweenGresbAndStarDundee() //SLOT
259 void rmapPluginUI::selectionBetweenGresbAndStarDundee() //SLOT
260 {
260 {
261 if (selectGRESB_BUTTON->isChecked())
261 if (selectGRESB_BUTTON->isChecked())
262 {
262 {
263 gresb_GROUPBOX->setVisible(true);
263 gresb_GROUPBOX->setVisible(true);
264 stardundee_GROUPBOX->setVisible(false);
264 stardundee_GROUPBOX->setVisible(false);
265 rmapOpenCommunicationButton->setEnabled(true);
265 rmapOpenCommunicationButton->setEnabled(true);
266 emit bridgeHasChanged(selectedBridgeIsGRESB);
266 emit bridgeHasChanged(selectedBridgeIsGRESB);
267 }
267 }
268 if (selectStarDundee_BUTTON->isChecked())
268 if (selectStarDundee_BUTTON->isChecked())
269 {
269 {
270 stardundee_GROUPBOX->setVisible(true);
270 stardundee_GROUPBOX->setVisible(true);
271 gresb_GROUPBOX->setVisible(false);
271 gresb_GROUPBOX->setVisible(false);
272 rmapOpenCommunicationButton->setEnabled(true);
272 rmapOpenCommunicationButton->setEnabled(true);
273 emit bridgeHasChanged(selectedBridgeIsStarDundee);
273 emit bridgeHasChanged(selectedBridgeIsStarDundee);
274 }
274 }
275 }
275 }
276
276
277 void rmapPluginUI::isOpen(bool flag)
277 void rmapPluginUI::isOpen(bool flag)
278 {
278 {
279 if (flag == true)
279 if (flag == true)
280 {
280 {
281 selection_GROUPBOX->setEnabled(false);
281 selection_GROUPBOX->setEnabled(false);
282 this->rmapOpenCommunicationButton->setEnabled(false);
282 this->rmapOpenCommunicationButton->setEnabled(false);
283 this->rmapCloseCommunicationButton->setEnabled(true);
283 this->rmapCloseCommunicationButton->setEnabled(true);
284 }
284 }
285 if (flag == false)
285 if (flag == false)
286 {
286 {
287 selection_GROUPBOX->setEnabled(true);
287 selection_GROUPBOX->setEnabled(true);
288 this->rmapOpenCommunicationButton->setEnabled(true);
288 this->rmapOpenCommunicationButton->setEnabled(true);
289 this->rmapCloseCommunicationButton->setEnabled(false);
289 this->rmapCloseCommunicationButton->setEnabled(false);
290 }
290 }
291 }
291 }
292
292
293
293
@@ -1,709 +1,734
1 #include "stardundee.h"
1 #include "stardundee.h"
2 #include <QTime>
2 #include <QTime>
3 #include <math.h>
3 #include <math.h>
4
4
5 StarDundee::StarDundee(QWidget *parent) :
5 StarDundee::StarDundee(QWidget *parent) :
6 QWidget(parent)
6 QWidget(parent)
7 {
7 {
8 // Packet receiver
8 // Packet receiver
9 timer = new QTimer;
9 rmapPacketSEMAPHORE = new QSemaphore;
10 rmapPacketSEMAPHORE = new QSemaphore;
10 ccsdsPacketSEMAPHORE = new QSemaphore;
11 ccsdsPacketSEMAPHORE = new QSemaphore;
11 rmapPacket = (char*) malloc(RMAP_MAX_PACKET_LENGTH);
12 rmapPacket = (char*) malloc(RMAP_MAX_PACKET_LENGTH);
12 ccsdsPacket = (unsigned char*) malloc(CCSDS_MAX_PACKET_LENGTH);
13 ccsdsPacket = (unsigned char*) malloc(CCSDS_MAX_PACKET_LENGTH);
13 spwPacket = (char*) malloc( qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH) );
14 spwPacket = (char*) malloc( qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH) );
14
15
16 starDundeeStatusQueryDialog = new QDialog;
17
15 commandCode = invalid0; // initialization of the cmmand code for the RMAP transfers
18 commandCode = invalid0; // initialization of the cmmand code for the RMAP transfers
16
19
17 rmapSourceLogicalAddress = 0x20;
20 rmapSourceLogicalAddress = 0x20;
18 connection_LAYOUT = new QGridLayout;
21 connection_LAYOUT = new QGridLayout;
19
22
20 usbDeviceNumber_LABEL = new QLabel(tr("USB device number: "));
23 usbDeviceNumber_LABEL = new QLabel(tr("USB device number: "));
21 linkNumber_LABEL = new QLabel(tr("SpaceWire link number: "));
24 linkNumber_LABEL = new QLabel(tr("SpaceWire link number: "));
22 sourceLogicalAddress_LABEL = new QLabel(tr("Source logical address: "));
25 sourceLogicalAddress_LABEL = new QLabel(tr("Source logical address: "));
26 starDundeeStatusQueryDialogLabel = new QLabel(tr("SpaceWire link not running"));
27
28 //*** QPUSHBUTTON ***//
29 starDundeeStatusQueryRetryButton = new QPushButton(tr("Retry"));
30 starDundeeStatusQueryAbortButton = new QPushButton(tr("Abort"));
23
31
24 usbDeviceNumber_SPINBOX = new QSpinBox;
32 usbDeviceNumber_SPINBOX = new QSpinBox;
25 usbDeviceNumber_SPINBOX->setRange(0,32);
33 usbDeviceNumber_SPINBOX->setRange(0,32);
26 usbDeviceNumber_SPINBOX->setValue(0);
34 usbDeviceNumber_SPINBOX->setValue(0);
27 linkNumber_SPINBOX = new QSpinBox;
35 linkNumber_SPINBOX = new QSpinBox;
28 linkNumber_SPINBOX->setRange(1,2);
36 linkNumber_SPINBOX->setRange(1,2);
29 linkNumber_SPINBOX->setValue(1);
37 linkNumber_SPINBOX->setValue(1);
30 sourceLogicalAddress_SPINBOX = new QSpinBox;
38 sourceLogicalAddress_SPINBOX = new QSpinBox;
31 sourceLogicalAddress_SPINBOX->setRange(0,254);
39 sourceLogicalAddress_SPINBOX->setRange(0,254);
32 sourceLogicalAddress_SPINBOX->setValue(32);
40 sourceLogicalAddress_SPINBOX->setValue(32);
33
41
42 // STAR DUNDEE STATUS QUERY DIALOG
43 starDundeeStatusQueryDialogLayout = new QGridLayout;
44 starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryDialogLabel, 0, 0, 1, 2);
45 starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryRetryButton, 1, 0, 0);
46 starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryAbortButton, 1, 1, 0);
47 starDundeeStatusQueryDialog->setLayout(starDundeeStatusQueryDialogLayout);
48
34 connection_LAYOUT->addWidget(usbDeviceNumber_LABEL, 0, 0, 1, 1);
49 connection_LAYOUT->addWidget(usbDeviceNumber_LABEL, 0, 0, 1, 1);
35 connection_LAYOUT->addWidget(usbDeviceNumber_SPINBOX, 0, 1, 1, 1);
50 connection_LAYOUT->addWidget(usbDeviceNumber_SPINBOX, 0, 1, 1, 1);
36 connection_LAYOUT->addWidget(linkNumber_LABEL, 1, 0, 1, 1);
51 connection_LAYOUT->addWidget(linkNumber_LABEL, 1, 0, 1, 1);
37 connection_LAYOUT->addWidget(linkNumber_SPINBOX, 1, 1, 1, 1);
52 connection_LAYOUT->addWidget(linkNumber_SPINBOX, 1, 1, 1, 1);
38 connection_LAYOUT->addWidget(sourceLogicalAddress_LABEL, 2, 0, 1, 1);
53 connection_LAYOUT->addWidget(sourceLogicalAddress_LABEL, 2, 0, 1, 1);
39 connection_LAYOUT->addWidget(sourceLogicalAddress_SPINBOX, 2, 1, 1, 1);
54 connection_LAYOUT->addWidget(sourceLogicalAddress_SPINBOX, 2, 1, 1, 1);
40
55
41 connection_LAYOUT->setRowStretch(3, 1);
56 connection_LAYOUT->setRowStretch(3, 1);
42 connection_LAYOUT->setColumnStretch(2, 1);
57 connection_LAYOUT->setColumnStretch(2, 1);
43
58
44 this->setLayout(connection_LAYOUT);
59 this->setLayout(connection_LAYOUT);
45
60
46 connect(this->sourceLogicalAddress_SPINBOX, SIGNAL(valueChanged(int)), this, SLOT(sourceHasChanged(int)));
61 connect(this->sourceLogicalAddress_SPINBOX, SIGNAL(valueChanged(int)), this, SLOT(sourceHasChanged(int)));
62
63 connect(starDundeeStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink()));
64 connect(starDundeeStatusQueryAbortButton, SIGNAL(clicked()), starDundeeStatusQueryDialog, SLOT(reject()));
65
66 connect(this->timer, SIGNAL(timeout()), this, SLOT(receivePollingLoop()));
67 timer->start(100); // starts the periodical timer, perdio = 100ms
47 }
68 }
48
69
49 StarDundee::~StarDundee()
70 StarDundee::~StarDundee()
50 {
71 {
51 free(rmapPacket);
72 free(rmapPacket);
52 free(ccsdsPacket);
73 free(ccsdsPacket);
53 free(spwPacket);
74 free(spwPacket);
54 USBSpaceWire_Close(hDevice); // Close the device
75 USBSpaceWire_Close(hDevice); // Close the device
55 }
76 }
56
77
57 void StarDundee::Open()
78 void StarDundee::Open()
58 {
79 {
59 int status;
80 int status;
60 U32 statusControl;
81 U32 statusControl;
61 U32 routingTableEntry;
62 int tableEntry;
63
82
64 if (!USBSpaceWire_Open(&hDevice, usbDeviceNumber_SPINBOX->value())) // Open the USB device
83 if (!USBSpaceWire_Open(&hDevice, usbDeviceNumber_SPINBOX->value())) // Open the USB device
65 {
84 {
66 emit sendMessage("stardundee *** Open *** ERROR: USBSpaceWire_Open(&hDevice, 0))");
85 emit sendMessage("stardundee *** Open *** ERROR: USBSpaceWire_Open(&hDevice, 0))");
67 return;
86 return;
68 }
87 }
69 emit sendMessage("stardundee *** Open *** USBSpaceWire_Open successful, device number: "
88 emit sendMessage("stardundee *** Open *** USBSpaceWire_Open successful, device number: "
70 + QString::number(usbDeviceNumber_SPINBOX->value()));
89 + QString::number(usbDeviceNumber_SPINBOX->value()));
71
90
72 USBSpaceWire_EnableNetworkMode(hDevice, 0); // deactivate the network mode
91 USBSpaceWire_EnableNetworkMode(hDevice, 0); // deactivate the network mode
73 CFGSpaceWire_EnableRMAP(1); // Enable the use of RMAP
92 CFGSpaceWire_EnableRMAP(1); // Enable the use of RMAP
74 CFGSpaceWire_SetRMAPDestinationKey(0x20); // Set the destination key expected by STAR-Dundee devices
93 CFGSpaceWire_SetRMAPDestinationKey(0x20); // Set the destination key expected by STAR-Dundee devices
75
94
76 // Set the path and return path to the device
95 // Set the path and return path to the device
77 CFGSpaceWire_StackClear();
96 CFGSpaceWire_StackClear();
78 CFGSpaceWire_AddrStackPush(0);
97 CFGSpaceWire_AddrStackPush(0);
79 CFGSpaceWire_AddrStackPush(254);
98 CFGSpaceWire_AddrStackPush(254);
80 CFGSpaceWire_RetAddrStackPush(254);
99 CFGSpaceWire_RetAddrStackPush(254);
81
100
82 // set the base transmit rate to 100 MHz
101 // set the base transmit rate to 100 MHz
83 status = CFGSpaceWire_SetBrickBaseTransmitRate( hDevice, CFG_BRK_CLK_100_MHZ, CFG_BRK_DVDR_1, 0xff);
102 status = CFGSpaceWire_SetBrickBaseTransmitRate( hDevice, CFG_BRK_CLK_100_MHZ, CFG_BRK_DVDR_1, 0xff);
84 if (status != CFG_TRANSFER_SUCCESS)
103 if (status != CFG_TRANSFER_SUCCESS)
85 {
104 {
86 emit sendMessage("ERROR CFGSpaceWire_SetBrickBaseTransmitRate");
105 emit sendMessage("ERROR CFGSpaceWire_SetBrickBaseTransmitRate");
87 }
106 }
88 else emit sendMessage("OK CFGSpaceWire_SetBrickBaseTransmitRate, base rate = 100 MHz");
107 else emit sendMessage("OK CFGSpaceWire_SetBrickBaseTransmitRate, base rate = 100 MHz");
89 // read the link status
108 // read the link status
90 if (CFGSpaceWire_GetLinkStatusControl(hDevice, linkNumber_SPINBOX->value(), &statusControl) != CFG_TRANSFER_SUCCESS)
109 if (CFGSpaceWire_GetLinkStatusControl(hDevice, linkNumber_SPINBOX->value(), &statusControl) != CFG_TRANSFER_SUCCESS)
91 {
110 {
92 emit sendMessage("Could not read link status control for link " + QString::number(linkNumber_SPINBOX->value()));
111 emit sendMessage("Could not read link status control for link " + QString::number(linkNumber_SPINBOX->value()));
93 }
112 }
94 else
113 else
95 {
114 {
96 emit sendMessage("OK CFGSpaceWire_GetLinkStatusControl of link " + QString::number(linkNumber_SPINBOX->value()));
115 emit sendMessage("OK CFGSpaceWire_GetLinkStatusControl of link " + QString::number(linkNumber_SPINBOX->value()));
97
116
98 // Set the link status control register properties
117 // Set the link status control register properties
99 CFGSpaceWire_LSEnableAutoStart(&statusControl, 1);
118 CFGSpaceWire_LSEnableAutoStart(&statusControl, 1);
100 CFGSpaceWire_LSEnableStart(&statusControl, 1);
119 CFGSpaceWire_LSEnableStart(&statusControl, 1);
101 CFGSpaceWire_LSEnableDisabled(&statusControl, 0);
120 CFGSpaceWire_LSEnableDisabled(&statusControl, 0);
102 CFGSpaceWire_LSEnableTristate(&statusControl, 0);
121 CFGSpaceWire_LSEnableTristate(&statusControl, 0);
103 CFGSpaceWire_LSSetOperatingSpeed(&statusControl, 9); // sets the link speed to ( 100 MHz / (9+1) ) = 10 MHz
122 CFGSpaceWire_LSSetOperatingSpeed(&statusControl, 9); // sets the link speed to ( 100 MHz / (9+1) ) = 10 MHz
104
123
105 // Set the link status control register
124 // Set the link status control register
106 if (CFGSpaceWire_SetLinkStatusControl(hDevice, linkNumber_SPINBOX->value(), statusControl) != CFG_TRANSFER_SUCCESS)
125 if (CFGSpaceWire_SetLinkStatusControl(hDevice, linkNumber_SPINBOX->value(), statusControl) != CFG_TRANSFER_SUCCESS)
107 {
126 {
108 emit sendMessage("Could not set the link status control for link " + QString::number(linkNumber_SPINBOX->value()));
127 emit sendMessage("Could not set the link status control for link " + QString::number(linkNumber_SPINBOX->value()));
109 }
128 }
110 else emit sendMessage("Set the link status control for link " + QString::number(linkNumber_SPINBOX->value()));
129 else emit sendMessage("Set the link status control for link " + QString::number(linkNumber_SPINBOX->value()));
111 }
130 }
112
131
113 // SET THE ROUTING TABLE ENTRY FOR LOGICAL ADDRESSING, TARGET 254 <=> 0xfe
132 setRoutingTableEntry(rmapTargetLogicalAddress, (1<<linkNumber_SPINBOX->value()));
114 tableEntry = rmapTargetLogicalAddress;
133 setRoutingTableEntry(sourceLogicalAddress_SPINBOX->value(), (1<<3));
115 if (CFGSpaceWire_ClearRoutingTableEntry(hDevice, tableEntry) != CFG_TRANSFER_SUCCESS)
134 //setRoutingTableEntry(33, (1<<3));
116 {
117 emit sendMessage("Could not clear routing table entry " + QString::number(tableEntry));
118 }
119 else emit sendMessage("Routing table entry [" + QString::number(tableEntry) + "] cleared");
120 // Build the routing table entry to route out of port 1 with header deletion disabled and priority normal
121 CFGSpaceWire_RTBuildRoutingTableEntry(&routingTableEntry,
122 (1<<linkNumber_SPINBOX->value()), // 0x02 = 0000 0010
123 0,
124 0);
125 // Set the routing table entry for logical address tableEntry
126 if (CFGSpaceWire_SetRoutingTableEntry(hDevice, tableEntry, routingTableEntry) != CFG_TRANSFER_SUCCESS)
127 {
128 emit sendMessage("Could not set routing table entry [" + QString::number(tableEntry) + "]");
129 }
130 else emit sendMessage("Routing table entry [" + QString::number(tableEntry) + "] set" );
131
132 // SET THE ROUTING TABLE ENTRY FOR LOGICAL ADDRESSING, TARGET 32 <=> 0x20
133 tableEntry = sourceLogicalAddress_SPINBOX->value();
134 if (CFGSpaceWire_ClearRoutingTableEntry(hDevice, tableEntry) != CFG_TRANSFER_SUCCESS)
135 {
136 emit sendMessage("Could not clear routing table entry " + QString::number(tableEntry));
137 }
138 else emit sendMessage("Routing table entry [" + QString::number(tableEntry) + "] cleared");
139
140 // Build the routing table entry to route out of port 3 with header deletion disabled and priority normal
141 CFGSpaceWire_RTBuildRoutingTableEntry(&routingTableEntry,
142 (1<<3), // 0x02 = 0000 0010
143 0,
144 0);
145 // Set the routing table entry for logical address tableEntry
146 if (CFGSpaceWire_SetRoutingTableEntry(hDevice, tableEntry, routingTableEntry) != CFG_TRANSFER_SUCCESS)
147 {
148 emit sendMessage("Could not set routing table entry [" + QString::number(tableEntry) + "]");
149 }
150 else emit sendMessage("Routing table entry [" + QString::number(tableEntry) + "] set" );
151
135
152 emit sendMessage("The driver's current send buffer size is " + QString::number(USBSpaceWire_GetDriverSendBufferSize(hDevice)) + " bytes");
136 emit sendMessage("The driver's current send buffer size is " + QString::number(USBSpaceWire_GetDriverSendBufferSize(hDevice)) + " bytes");
153
137
154 USBSpaceWire_RegisterReceiveOnAllPorts(hDevice); // Register to receive on all ports
138 USBSpaceWire_RegisterReceiveOnAllPorts(hDevice); // Register to receive on all ports
155 USBSpaceWire_ClearEndpoints(hDevice); // clear the USB endpoints
139 USBSpaceWire_ClearEndpoints(hDevice); // clear the USB endpoints
156
140
157 // initialize SPW packet semaphores
141 // initialize SPW packet semaphores
158 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
142 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
159 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
143 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
160
144
161 emit isOpen(true);
145 if (getLinkStatus(linkNumber_SPINBOX->value()))
146 {
147 emit isOpen(true);
148 }
149 else
150 {
151
152 }
162 }
153 }
163
154
164 void StarDundee::Close()
155 void StarDundee::Close()
165 {
156 {
166 USBSpaceWire_Close(hDevice); // Close the device
157 USBSpaceWire_Close(hDevice); // Close the device
167 emit sendMessage("stardundee *** Close *** USBSpaceWire_Close, device: " + QString::number(usbDeviceNumber_SPINBOX->value()));
158 emit sendMessage("stardundee *** Close *** USBSpaceWire_Close, device: " + QString::number(usbDeviceNumber_SPINBOX->value()));
168
159
169 USBSpaceWire_UnregisterReceiveOnAllPorts(hDevice); // Stop receiving on all ports
160 USBSpaceWire_UnregisterReceiveOnAllPorts(hDevice); // Stop receiving on all ports
170
161
171 emit isOpen(false);
162 emit isOpen(false);
172 }
163 }
173
164
174 unsigned int StarDundee::GetRoutingTableEntry()
165 unsigned int StarDundee::GetRoutingTableEntry()
175 {
166 {
176 U32 routingTableEntry, outputPorts;
167 U32 routingTableEntry, outputPorts;
177 char enabled, delHead, priority;
168 char enabled, delHead, priority;
178 int portNum;
169 int portNum;
179 int tableEntry;
170 int tableEntry;
180
171
181 tableEntry = rmapTargetLogicalAddress;
172 tableEntry = rmapTargetLogicalAddress;
182
173
183 // Set the path and return path to the device
174 // Set the path and return path to the device
184 CFGSpaceWire_StackClear();
175 CFGSpaceWire_StackClear();
185 CFGSpaceWire_AddrStackPush(0);
176 CFGSpaceWire_AddrStackPush(0);
186 CFGSpaceWire_AddrStackPush(254);
177 CFGSpaceWire_AddrStackPush(254);
187 CFGSpaceWire_RetAddrStackPush(254);
178 CFGSpaceWire_RetAddrStackPush(254);
188
179
189 // Read the routing table entry
180 // Read the routing table entry
190 if (CFGSpaceWire_GetRoutingTableEntry(hDevice, tableEntry, &routingTableEntry) != CFG_TRANSFER_SUCCESS)
181 if (CFGSpaceWire_GetRoutingTableEntry(hDevice, tableEntry, &routingTableEntry) != CFG_TRANSFER_SUCCESS)
191 {
182 {
192 emit sendMessage("Could not read routing table entry [" + QString::number(tableEntry) + "]");
183 emit sendMessage("Could not read routing table entry [" + QString::number(tableEntry) + "]");
193 }
184 }
194 else
185 else
195 {
186 {
196 // Display the routing table entry properties
187 // Display the routing table entry properties
197 CFGSpaceWire_RTIsEnabled(routingTableEntry, &enabled);
188 CFGSpaceWire_RTIsEnabled(routingTableEntry, &enabled);
198 CFGSpaceWire_RTIsDelHead(routingTableEntry, &delHead);
189 CFGSpaceWire_RTIsDelHead(routingTableEntry, &delHead);
199 CFGSpaceWire_RTIsPriority(routingTableEntry, &priority);
190 CFGSpaceWire_RTIsPriority(routingTableEntry, &priority);
200 CFGSpaceWire_RTGetOutputPorts(routingTableEntry, &outputPorts);
191 CFGSpaceWire_RTGetOutputPorts(routingTableEntry, &outputPorts);
201 emit sendMessage("CFGSpaceWire_RTIsEnabled : " + QString::number(enabled));
192 emit sendMessage("CFGSpaceWire_RTIsEnabled : " + QString::number(enabled));
202 emit sendMessage("CFGSpaceWire_RTIsDelHead : " + QString::number(delHead));
193 emit sendMessage("CFGSpaceWire_RTIsDelHead : " + QString::number(delHead));
203 emit sendMessage("CFGSpaceWire_RTIsPriority : " + QString::number(priority));
194 emit sendMessage("CFGSpaceWire_RTIsPriority : " + QString::number(priority));
204 emit sendMessage("CFGSpaceWire_RTGetOutputPorts : ");
195 emit sendMessage("CFGSpaceWire_RTGetOutputPorts : ");
205 for (portNum = 0; portNum < 32; portNum++)
196 for (portNum = 0; portNum < 32; portNum++)
206 {
197 {
207 if (outputPorts & (1 << portNum))
198 if (outputPorts & (1 << portNum))
208 {
199 {
209 emit sendMessage(QString::number(portNum));
200 emit sendMessage(QString::number(portNum));
210 }
201 }
211 }
202 }
212 }
203 }
213
204
214 return 1;
205 return 1;
215 }
206 }
216
207
217 unsigned int StarDundee::Write(unsigned int *Value, unsigned int count, unsigned int address)
208 unsigned int StarDundee::Write(unsigned int *Value, unsigned int count, unsigned int address)
218 {
209 {
219 unsigned int remainingCount = count;
210 unsigned int remainingCount = count;
220 unsigned int iOffset = 0;
211 unsigned int iOffset = 0;
221 QString console_message;
212 QString console_message;
222 char* data;
213 char* data;
223
214
224 if(rmapPacketSEMAPHORE->available()!=0)
215 if(rmapPacketSEMAPHORE->available()!=0)
225 {
216 {
226 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP request already running, WRITE access stopped");
217 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP request already running, WRITE access stopped");
227 return 1;
218 return 1;
228 }
219 }
229
220
230 emit this->RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable");
221 emit this->RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable");
231
222
232 data = (char*) malloc(READ_WRITE_MAX_COUNTS*4);
223 data = (char*) malloc(READ_WRITE_MAX_COUNTS*4);
233
224
234 emit appendToLog(QString("*** START *** WRITE ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
225 emit appendToLog(QString("*** START *** WRITE ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
235
226
236 while (remainingCount > READ_WRITE_MAX_COUNTS)
227 while (remainingCount > READ_WRITE_MAX_COUNTS)
237 {
228 {
238 for (int i = 0; i<READ_WRITE_MAX_COUNTS; i++)
229 for (int i = 0; i<READ_WRITE_MAX_COUNTS; i++)
239 {
230 {
240 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
231 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
241 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
232 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
242 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
233 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
243 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
234 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
244 }
235 }
245
236
246 console_message.sprintf("remainingCount: %d => ", remainingCount);
237 console_message.sprintf("remainingCount: %d => ", remainingCount);
247 emit appendToLog(console_message + QString("Write ")+ QString::number(READ_WRITE_MAX_COUNTS*4) + QString(" byte(s) @0x")+ QString::number(address,16));
238 emit appendToLog(console_message + QString("Write ")+ QString::number(READ_WRITE_MAX_COUNTS*4) + QString(" byte(s) @0x")+ QString::number(address,16));
248
239
249 if(WriteBLOCK(data, READ_WRITE_MAX_COUNTS*4, address)==0)
240 if(WriteBLOCK(data, READ_WRITE_MAX_COUNTS*4, address)==0)
250 {
241 {
251 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
242 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
252 return 1;
243 return 1;
253 }
244 }
254
245
255 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
246 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
256 address = address + READ_WRITE_MAX_COUNTS * 4;
247 address = address + READ_WRITE_MAX_COUNTS * 4;
257 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
248 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
258 }
249 }
259
250
260 if (remainingCount > 0)
251 if (remainingCount > 0)
261 {
252 {
262 for (unsigned int i = 0; i<remainingCount; i++)
253 for (unsigned int i = 0; i<remainingCount; i++)
263 {
254 {
264 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
255 data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]);
265 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
256 data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8);
266 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
257 data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16);
267 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
258 data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24);
268 }
259 }
269
260
270 console_message.sprintf("remainingCount: %d => ", remainingCount);
261 console_message.sprintf("remainingCount: %d => ", remainingCount);
271 emit appendToLog(console_message + QString("Write ")+ QString::number(remainingCount*4) + QString(" byte(s) @0x")+ QString::number(address,16));
262 emit appendToLog(console_message + QString("Write ")+ QString::number(remainingCount*4) + QString(" byte(s) @0x")+ QString::number(address,16));
272
263
273 if (WriteBLOCK(data, remainingCount*4, address)==0)
264 if (WriteBLOCK(data, remainingCount*4, address)==0)
274 {
265 {
275 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
266 emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed");
276 return 1;
267 return 1;
277 }
268 }
278 }
269 }
279
270
280 emit appendToLog(QString("*** STOP *** WRITE"));
271 emit appendToLog(QString("*** STOP *** WRITE"));
281 free(data);
272 free(data);
282 return count;
273 return count;
283 }
274 }
284
275
285 unsigned int StarDundee::Read(unsigned int *Value, unsigned int count, unsigned int address)
276 unsigned int StarDundee::Read(unsigned int *Value, unsigned int count, unsigned int address)
286 {
277 {
287 unsigned int remainingCount = count;
278 unsigned int remainingCount = count;
288 unsigned int iOffset = 0;
279 unsigned int iOffset = 0;
289 QString console_message;
280 QString console_message;
290
281
291 if(rmapPacketSEMAPHORE->available()!=0)
282 if(rmapPacketSEMAPHORE->available()!=0)
292 {
283 {
293 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP request already running, READ access stopped");
284 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP request already running, READ access stopped");
294 return 1;
285 return 1;
295 }
286 }
296 emit appendToLog(QString("*** START *** READ ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
287 emit appendToLog(QString("*** START *** READ ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16));
297
288
298 while (remainingCount > READ_WRITE_MAX_COUNTS)
289 while (remainingCount > READ_WRITE_MAX_COUNTS)
299 {
290 {
300 console_message.sprintf("remainingCount: %d => ", remainingCount);
291 console_message.sprintf("remainingCount: %d => ", remainingCount);
301 emit appendToLog(console_message + QString("Read ")+ QString::number(4*READ_WRITE_MAX_COUNTS) + QString(" byte(s) @0x")+ QString::number(address,16));
292 emit appendToLog(console_message + QString("Read ")+ QString::number(4*READ_WRITE_MAX_COUNTS) + QString(" byte(s) @0x")+ QString::number(address,16));
302
293
303 if (this->ReadBLOCK(READ_WRITE_MAX_COUNTS*4, address)==0)
294 if (this->ReadBLOCK(READ_WRITE_MAX_COUNTS*4, address)==0)
304 {
295 {
305 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
296 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
306 return 1;
297 return 1;
307 }
298 }
308
299
309 for(int i=0;i<READ_WRITE_MAX_COUNTS;i++)
300 for(int i=0;i<READ_WRITE_MAX_COUNTS;i++)
310 {
301 {
311 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
302 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
312 for(int j=1;j<4;j++)
303 for(int j=1;j<4;j++)
313 {
304 {
314 Value[i+iOffset]= ((unsigned char) (rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH]))
305 Value[i+iOffset]= ((unsigned char) (rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH]))
315 + Value[i+iOffset]*256;
306 + Value[i+iOffset]*256;
316 }
307 }
317 }
308 }
318
309
319 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
310 remainingCount = remainingCount - READ_WRITE_MAX_COUNTS;
320 address = address + READ_WRITE_MAX_COUNTS * 4;
311 address = address + READ_WRITE_MAX_COUNTS * 4;
321 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
312 iOffset = iOffset + READ_WRITE_MAX_COUNTS;
322 this->acquireRMAPSemaphore();
313 this->acquireRMAPSemaphore();
323 }
314 }
324
315
325 if (remainingCount > 0)
316 if (remainingCount > 0)
326 {
317 {
327 console_message.sprintf("remainingCount: %d => ", remainingCount);
318 console_message.sprintf("remainingCount: %d => ", remainingCount);
328 emit appendToLog(console_message + QString("Read ")+ QString::number(4*remainingCount) + QString(" byte(s) @0x")+ QString::number(address,16));
319 emit appendToLog(console_message + QString("Read ")+ QString::number(4*remainingCount) + QString(" byte(s) @0x")+ QString::number(address,16));
329
320
330 if (this->ReadBLOCK(4*remainingCount, address)==0)
321 if (this->ReadBLOCK(4*remainingCount, address)==0)
331 {
322 {
332 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
323 emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received");
333 return 1;
324 return 1;
334 }
325 }
335
326
336 for(unsigned int i=0;i<remainingCount;i++)
327 for(unsigned int i=0;i<remainingCount;i++)
337 {
328 {
338 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
329 Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH];
339 for(int j=1;j<4;j++)
330 for(int j=1;j<4;j++)
340 {
331 {
341 Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256;
332 Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256;
342 }
333 }
343 }
334 }
344 this->acquireRMAPSemaphore();
335 this->acquireRMAPSemaphore();
345 }
336 }
346
337
347 emit appendToLog(QString("*** STOP *** READ "));
338 emit appendToLog(QString("*** STOP *** READ "));
348 return count;
339 return count;
349 }
340 }
350
341
351 unsigned int StarDundee::WriteBLOCK(char *data, unsigned int nbBytes, unsigned int address)
342 unsigned int StarDundee::WriteBLOCK(char *data, unsigned int nbBytes, unsigned int address)
352 {
343 {
353 RMAP *RMAPCommand;
344 RMAP *RMAPCommand;
354 char * packet;
345 char * packet;
355 unsigned char offset, headerSize, CRCSize;
346 unsigned char offset, headerSize, CRCSize;
356 char* aux;
347 char* aux;
357 unsigned int totalSize;
348 unsigned int totalSize;
358 int errorCode;
349 int errorCode;
359 QString console_message;
350 QString console_message;
360
351
361 if (getLinkStatus(this->linkNumber_SPINBOX->value()) == 0)
352 if (getLinkStatus(this->linkNumber_SPINBOX->value()) == 0)
362 {
353 {
363 this->Close();
354 this->Close();
364 return 1;
355 return 1;
365 }
356 }
366
357
367 RMAPCommand = new RMAP(this->commandCode,
358 RMAPCommand = new RMAP(this->commandCode,
368 rmapTargetLogicalAddress,
359 rmapTargetLogicalAddress,
369 rmapSourceLogicalAddress,
360 rmapSourceLogicalAddress,
370 address,
361 address,
371 nbBytes,
362 nbBytes,
372 data);
363 data);
373 headerSize = sizeof(RMAPCommand->RMAPHeader);
364 headerSize = sizeof(RMAPCommand->RMAPHeader);
374 CRCSize = 1;
365 CRCSize = 1;
375
366
376 //*************************
367 //*************************
377 // BUILD THE PACKET TO SEND
368 // BUILD THE PACKET TO SEND
378 totalSize = headerSize + nbBytes + CRCSize;
369 totalSize = headerSize + nbBytes + CRCSize;
379 packet = (char*) malloc( totalSize );
370 packet = (char*) malloc( totalSize );
380 aux = (char*) ((void*) &RMAPCommand->RMAPHeader);
371 aux = (char*) ((void*) &RMAPCommand->RMAPHeader);
381 for(unsigned int i = 0; i<headerSize; i++) packet[i] = aux[i];
372 for(unsigned int i = 0; i<headerSize; i++) packet[i] = aux[i];
382 offset = headerSize;
373 offset = headerSize;
383 for(unsigned int i = 0; i<nbBytes; i++)
374 for(unsigned int i = 0; i<nbBytes; i++)
384 {
375 {
385 packet[i+offset] = data[i];
376 packet[i+offset] = data[i];
386 }
377 }
387 packet[nbBytes+offset] = RMAPCommand->dataCRC;
378 packet[nbBytes+offset] = RMAPCommand->dataCRC;
388
379
389 //****************
380 //****************
390 // SEND THE PACKET
381 // SEND THE PACKET
391 result = USBSpaceWire_SendPacket(hDevice,
382 result = USBSpaceWire_SendPacket(hDevice,
392 packet,
383 packet,
393 totalSize,
384 totalSize,
394 BWAIT_1, &pIdentifier);
385 BWAIT_1, &pIdentifier);
395 if (result != TRANSFER_SUCCESS)
386 if (result != TRANSFER_SUCCESS)
396 {
387 {
397 emit sendMessage("ERROR *** WriteStarDundee when sending packet of size "
388 emit sendMessage("ERROR *** WriteStarDundee when sending packet of size "
398 + QString::number(totalSize) +", with code: " + QString::number(result));
389 + QString::number(totalSize) +", with code: " + QString::number(result));
399 USBSpaceWire_FreeSend(hDevice, pIdentifier);
390 USBSpaceWire_FreeSend(hDevice, pIdentifier);
400 free(data);
391 free(data);
401 return 1;
392 return 1;
402 }
393 }
403 else emit sendMessage("OK *** WriteStarDundee when sending packet of size " + QString::number(totalSize));
394 else emit sendMessage("OK *** WriteStarDundee when sending packet of size " + QString::number(totalSize));
404
395
405 //**************
396 //**************
406 // Free the send
397 // Free the send
407 USBSpaceWire_FreeSend(hDevice, pIdentifier);
398 USBSpaceWire_FreeSend(hDevice, pIdentifier);
408 free(packet);
399 free(packet);
409
400
410 if ( (commandCode == writeSingle_noVer_Rep) | (commandCode == writeInc_noVer_Rep) |
401 if ( (commandCode == writeSingle_noVer_Rep) | (commandCode == writeInc_noVer_Rep) |
411 (commandCode == writeSingle_ver_rep) | (commandCode == writeInc_ver_rep) )
402 (commandCode == writeSingle_ver_rep) | (commandCode == writeInc_ver_rep) )
412 {
403 {
413 // WAIT FOR THE RMAP REPLY PACKET
404 // WAIT FOR THE RMAP REPLY PACKET
414 errorCode = this->receiveSPWPacket(1);
405 errorCode = this->receiveSPWPacket(1);
415 if (errorCode<=0)
406 if (errorCode<=0)
416 {
407 {
417 emit appendToLog("WARNING === in function WriteBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode));
408 emit appendToLog("WARNING === in function WriteBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode));
418 return 0;
409 return 0;
419 }
410 }
420 if(rmapPacketSize != 8)
411 if(rmapPacketSize != 8)
421 {
412 {
422 console_message.sprintf("WARNING === in function WRITE (with reply) of rmapplugin *** write reply format not compliant\n");
413 console_message.sprintf("WARNING === in function WRITE (with reply) of rmapplugin *** write reply format not compliant\n");
423 emit appendToLog(console_message);
414 emit appendToLog(console_message);
424 return 0;
415 return 0;
425 }
416 }
426 switch (this->rmapPacket[3]) // byte 4 is the status byte in the reply
417 switch (this->rmapPacket[3]) // byte 4 is the status byte in the reply
427 {
418 {
428 case 0:
419 case 0:
429 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 0 Successfull");
420 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 0 Successfull");
430 break;
421 break;
431 case 1:
422 case 1:
432 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** General error code");
423 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** General error code");
433 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 1 General error code");
424 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 1 General error code");
434 break;
425 break;
435 case 2:
426 case 2:
436 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Unused RMAP packet type or command code");
427 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Unused RMAP packet type or command code");
437 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 2 Unused RMAP packet type or command code");
428 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 2 Unused RMAP packet type or command code");
438 break;
429 break;
439 case 3:
430 case 3:
440 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid key");
431 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid key");
441 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 3 Invalid key");
432 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 3 Invalid key");
442 break;
433 break;
443 case 4:
434 case 4:
444 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid data CRC");
435 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid data CRC");
445 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 4 Invalid data CRC");
436 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 4 Invalid data CRC");
446 break;
437 break;
447 case 5:
438 case 5:
448 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Early EOP");
439 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Early EOP");
449 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 5 Early EOP");
440 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 5 Early EOP");
450 break;
441 break;
451 case 6:
442 case 6:
452 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Too much data");
443 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Too much data");
453 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 6 Too much data");
444 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 6 Too much data");
454 break;
445 break;
455 case 7:
446 case 7:
456 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** EEP");
447 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** EEP");
457 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 7 EEP");
448 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 7 EEP");
458 break;
449 break;
459 case 8:
450 case 8:
460 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Reserved");
451 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Reserved");
461 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 8 Reserved");
452 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 8 Reserved");
462 break;
453 break;
463 case 9:
454 case 9:
464 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Verify buffer overrun");
455 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Verify buffer overrun");
465 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 9 Verify buffer overrun");
456 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 9 Verify buffer overrun");
466 break;
457 break;
467 case 10:
458 case 10:
468 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMAP command not implemented or not authorised");
459 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMAP command not implemented or not authorised");
469 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 10 RMAP command not implemented or not authorised");
460 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 10 RMAP command not implemented or not authorised");
470 break;
461 break;
471 case 11:
462 case 11:
472 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMW data length error");
463 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMW data length error");
473 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 11 RMAP RMW data length error");
464 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 11 RMAP RMW data length error");
474 break;
465 break;
475 case 12:
466 case 12:
476 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid target logical address");
467 emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid target logical address");
477 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 12 Invalid target logical address");
468 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 12 Invalid target logical address");
478 break;
469 break;
479 }
470 }
480 this->acquireRMAPSemaphore();
471 this->acquireRMAPSemaphore();
481 }
472 }
482 else
473 else
483 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable");
474 emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable");
484
475
485 return nbBytes;
476 return nbBytes;
486 }
477 }
487
478
488 unsigned int StarDundee::ReadBLOCK(unsigned int nbBytes, unsigned int address)
479 unsigned int StarDundee::ReadBLOCK(unsigned int nbBytes, unsigned int address)
489 {
480 {
490 int errorCode;
481 int errorCode;
491 RMAP *RMAPCommand;
482 RMAP *RMAPCommand;
492 unsigned int dataLength;
483 unsigned int dataLength;
493
484
494 //**********************
485 //**********************
495 // Check the link status
486 // Check the link status
496 if ( getLinkStatus( this->linkNumber_SPINBOX->value() ) == 0 )
487 if ( getLinkStatus( this->linkNumber_SPINBOX->value() ) == 0 )
497 {
488 {
498 this->Close();
489 this->Close();
499 emit appendToLog("WARNING === in function WriteSPW of StarDundee *** SPW link not running\n");
490 emit appendToLog("WARNING === in function WriteSPW of StarDundee *** SPW link not running\n");
500 return 0;
491 return 0;
501 }
492 }
502
493
503 //**********************
494 //**********************
504 // SEND THE READ COMMAND
495 // SEND THE READ COMMAND
505 if (nbBytes > 4)
496 if (nbBytes > 4)
506 {
497 {
507 RMAPCommand = new RMAP(read_Inc,
498 RMAPCommand = new RMAP(read_Inc,
508 rmapTargetLogicalAddress,
499 rmapTargetLogicalAddress,
509 rmapSourceLogicalAddress,
500 rmapSourceLogicalAddress,
510 address,
501 address,
511 nbBytes,
502 nbBytes,
512 NULL);
503 NULL);
513 }
504 }
514 else
505 else
515 {
506 {
516 RMAPCommand = new RMAP(read_Single,
507 RMAPCommand = new RMAP(read_Single,
517 rmapTargetLogicalAddress,
508 rmapTargetLogicalAddress,
518 rmapSourceLogicalAddress,
509 rmapSourceLogicalAddress,
519 address,
510 address,
520 nbBytes,
511 nbBytes,
521 NULL);
512 NULL);
522 }
513 }
523 result = USBSpaceWire_SendPacket(hDevice,
514 result = USBSpaceWire_SendPacket(hDevice,
524 (unsigned char*) ((void*) &RMAPCommand->RMAPHeader),
515 (unsigned char*) ((void*) &RMAPCommand->RMAPHeader),
525 sizeof(RMAPCommand->RMAPHeader),
516 sizeof(RMAPCommand->RMAPHeader),
526 BWAIT_1, &pIdentifier);
517 BWAIT_1, &pIdentifier);
527 if (result != TRANSFER_SUCCESS) emit sendMessage("ERR *** ReadStarDundee *** ReadBLOCK *** sending the READ command ");
518 if (result != TRANSFER_SUCCESS) emit sendMessage("ERR *** ReadStarDundee *** ReadBLOCK *** sending the READ command ");
528 else emit sendMessage("OK *** ReadStarDundee *** ReadBLOCK *** sending the READ command");
519 else emit sendMessage("OK *** ReadStarDundee *** ReadBLOCK *** sending the READ command");
529
520
530 //*********************************
521 //*********************************
531 // RECEIVE THE INCOMING RMAP PACKET
522 // RECEIVE THE INCOMING RMAP PACKET
532 errorCode = this->receiveSPWPacket(1); // request ID 1 is for RMAP packet
523 errorCode = this->receiveSPWPacket(1); // request ID 1 is for RMAP packet
533 if (errorCode<=0)
524 if (errorCode<=0)
534 {
525 {
535 emit appendToLog("WARNING === in function ReadBLOCK of StarDundee *** RMAP packet reception failed with code " + QString::number(errorCode));
526 emit appendToLog("WARNING === in function ReadBLOCK of StarDundee *** RMAP packet reception failed with code " + QString::number(errorCode));
536 return 0;
527 return 0;
537 }
528 }
538 dataLength = rmapPacketSize - RMAP_READ_REPLY_HEADER_LENGTH - RMAP_DATA_CRC_LENGTH;
529 dataLength = rmapPacketSize - RMAP_READ_REPLY_HEADER_LENGTH - RMAP_DATA_CRC_LENGTH;
539 if(dataLength != nbBytes)
530 if(dataLength != nbBytes)
540 {
531 {
541 emit appendToLog("WARNING === in function READ of StarDundee *** number of data received ("
532 emit appendToLog("WARNING === in function READ of StarDundee *** number of data received ("
542 +QString::number(dataLength)
533 +QString::number(dataLength)
543 +") not equal to number of data requested ("
534 +") not equal to number of data requested ("
544 +QString::number(nbBytes)
535 +QString::number(nbBytes)
545 +")");
536 +")");
546 return 0;
537 return 0;
547 }
538 }
548 return dataLength;
539 return dataLength;
549 }
540 }
550
541
551 unsigned int StarDundee::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication)
542 unsigned int StarDundee::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication)
552 {
543 {
553 char protocoleIdentifier = 0x02;
544 char protocoleIdentifier = 0x02;
554 char reserved = 0x00;
545 char reserved = 0x00;
555 char *SPWData;
546 char *SPWData;
556 unsigned int totalSize;
547 unsigned int totalSize;
557
548
558 if (count>248)
549 if (count>248)
559 {
550 {
560 emit appendToLog("WARNING === in function WRITE of rmapplugin *** CCSDS packet size > 248 bytes\n");
551 emit appendToLog("WARNING === in function WRITE of rmapplugin *** CCSDS packet size > 248 bytes\n");
561 return 1;
552 return 1;
562 }
553 }
563
554
564 emit appendToLog("*** START *** Send CCSDS packet of "+ QString::number(count) + " byte(s)");
555 emit appendToLog("*** START *** Send CCSDS packet of "+ QString::number(count) + " byte(s)");
565
556
566 if ( getLinkStatus( this->linkNumber_SPINBOX->value() ) == 0 )
557 if ( getLinkStatus( this->linkNumber_SPINBOX->value() ) == 0 )
567 {
558 {
568 this->Close();
559 this->Close();
569 emit appendToLog("WARNING === in function WriteSPW of StarDundee *** SPW link not running\n");
560 emit appendToLog("WARNING === in function WriteSPW of StarDundee *** SPW link not running\n");
570 return 1;
561 return 1;
571 }
562 }
572
563
573 totalSize = count + 4;
564 totalSize = count + 4;
574 SPWData = (char*) malloc(totalSize);
565 SPWData = (char*) malloc(totalSize);
575 // SPW HEADER
566 // SPW HEADER
576 SPWData[0] = targetLogicalAddress;
567 SPWData[0] = targetLogicalAddress;
577 SPWData[1] = protocoleIdentifier;
568 SPWData[1] = protocoleIdentifier;
578 SPWData[2] = reserved;
569 SPWData[2] = reserved;
579 SPWData[3] = userApplication;
570 SPWData[3] = userApplication;
580 // CCSDS PACKET
571 // CCSDS PACKET
581 for (unsigned int i = 0; i<count; i++)
572 for (unsigned int i = 0; i<count; i++)
582 {
573 {
583 SPWData[i+4] = Value[i];
574 SPWData[i+4] = Value[i];
584 }
575 }
585
576
586 //************
577 //************
587 // SEND THE PACKET
578 // SEND THE PACKET
588 result = USBSpaceWire_SendPacket(hDevice,
579 result = USBSpaceWire_SendPacket(hDevice,
589 SPWData,
580 SPWData,
590 totalSize,
581 totalSize,
591 BWAIT_1, &pIdentifier);
582 BWAIT_1, &pIdentifier);
592 if (result != TRANSFER_SUCCESS)
583 if (result != TRANSFER_SUCCESS)
593 {
584 {
594 emit sendMessage("ERROR *** WriteSPW when sending packet of size "
585 emit sendMessage("ERROR *** WriteSPW when sending packet of size "
595 + QString::number(totalSize) +", with code: " + QString::number(result));
586 + QString::number(totalSize) +", with code: " + QString::number(result));
596 USBSpaceWire_FreeSend(hDevice, pIdentifier);
587 USBSpaceWire_FreeSend(hDevice, pIdentifier);
597 free(SPWData);
588 free(SPWData);
598 return 0;
589 return 0;
599 }
590 }
600 else emit sendMessage("OK *** WriteSPW when sending packet of size " + QString::number(totalSize));
591 else emit sendMessage("OK *** WriteSPW when sending packet of size " + QString::number(totalSize));
601
592
602 //**************
593 //**************
603 // Free the send
594 // Free the send
604 USBSpaceWire_FreeSend(hDevice, pIdentifier);
595 USBSpaceWire_FreeSend(hDevice, pIdentifier);
605 free(SPWData);
596 free(SPWData);
606
597
607 emit appendToLog(QString("*** CCSDS packet sent"));
598 emit appendToLog(QString("*** CCSDS packet sent"));
608
599
609 return 1;
600 return 1;
610 }
601 }
611
602
612 unsigned int StarDundee::getLinkStatus(unsigned char link)
603 unsigned int StarDundee::getLinkStatus(unsigned char link)
613 {
604 {
614 U32 statusControl, errorStatus, portType;
605 U32 statusControl, errorStatus, portType;
615 U32 linkStatus, operatingSpeed, outputPortConnection;
606 U32 linkStatus, operatingSpeed, outputPortConnection;
616 char isLinkRunning, isAutoStart, isStart, isDisabled, isTristate;
607 char isLinkRunning, isAutoStart, isStart, isDisabled, isTristate;
617
608
618 // Read the link status control register
609 // Read the link status control register
619 if (CFGSpaceWire_GetLinkStatusControl(hDevice, 1, &statusControl) != CFG_TRANSFER_SUCCESS)
610 if (CFGSpaceWire_GetLinkStatusControl(hDevice, 1, &statusControl) != CFG_TRANSFER_SUCCESS)
620 {
611 {
621 emit appendToLog("Could not read link status control for link" + QString::number(link));
612 emit appendToLog("Could not read link status control for link" + QString::number(link));
622 }
613 }
623 else
614 else
624 {
615 {
625 // Display the link status control register properties
616 // Display the link status control register properties
626 CFGSpaceWire_LSPortType(statusControl, &portType);
617 CFGSpaceWire_LSPortType(statusControl, &portType);
627 if (portType == CFG_CONFIGURATION_PORT)
618 if (portType == CFG_CONFIGURATION_PORT)
628 {
619 {
629 CFGSpaceWire_LSConfigErrorStatus(statusControl, &errorStatus);
620 CFGSpaceWire_LSConfigErrorStatus(statusControl, &errorStatus);
630 //emit appendToLog("Configuration port error status = " + QString::number(errorStatus));
621 //emit appendToLog("Configuration port error status = " + QString::number(errorStatus));
631 }
622 }
632 else if (portType == CFG_SPACEWIRE_EXTERNAL_PORT)
623 else if (portType == CFG_SPACEWIRE_EXTERNAL_PORT)
633 {
624 {
634 CFGSpaceWire_LSExternalErrorStatus(statusControl, &errorStatus);
625 CFGSpaceWire_LSExternalErrorStatus(statusControl, &errorStatus);
635 //emit appendToLog("External port error status = " + QString::number(errorStatus));
626 //emit appendToLog("External port error status = " + QString::number(errorStatus));
636 }
627 }
637 else
628 else
638 {
629 {
639 CFGSpaceWire_LSErrorStatus(statusControl, &errorStatus);
630 CFGSpaceWire_LSErrorStatus(statusControl, &errorStatus);
640 //emit appendToLog("SpaceWire link error status = " + QString::number(errorStatus));
631 //emit appendToLog("SpaceWire link error status = " + QString::number(errorStatus));
641 }
632 }
642 CFGSpaceWire_LSLinkState(statusControl, &linkStatus);
633 CFGSpaceWire_LSLinkState(statusControl, &linkStatus);
643 CFGSpaceWire_LSIsLinkRunning(statusControl, &isLinkRunning);
634 CFGSpaceWire_LSIsLinkRunning(statusControl, &isLinkRunning);
644 CFGSpaceWire_LSIsAutoStart(statusControl, &isAutoStart);
635 CFGSpaceWire_LSIsAutoStart(statusControl, &isAutoStart);
645 CFGSpaceWire_LSIsStart(statusControl, &isStart);
636 CFGSpaceWire_LSIsStart(statusControl, &isStart);
646 CFGSpaceWire_LSIsDisabled(statusControl, &isDisabled);
637 CFGSpaceWire_LSIsDisabled(statusControl, &isDisabled);
647 CFGSpaceWire_LSIsTristate(statusControl, &isTristate);
638 CFGSpaceWire_LSIsTristate(statusControl, &isTristate);
648 CFGSpaceWire_LSOperatingSpeed(statusControl, &operatingSpeed);
639 CFGSpaceWire_LSOperatingSpeed(statusControl, &operatingSpeed);
649 CFGSpaceWire_LSOutputPortConnection(statusControl, &outputPortConnection);
640 CFGSpaceWire_LSOutputPortConnection(statusControl, &outputPortConnection);
650 //emit appendToLog("The link state is = " + QString::number(linkStatus));
641 //emit appendToLog("The link state is = " + QString::number(linkStatus));
651 //emit appendToLog("The link is running = " + QString::number(isLinkRunning));
642 //emit appendToLog("The link is running = " + QString::number(isLinkRunning));
652 //emit appendToLog("The autostart bit is enabled = " + QString::number(isAutoStart));
643 //emit appendToLog("The autostart bit is enabled = " + QString::number(isAutoStart));
653 //emit appendToLog("The start bit is enabled = " + QString::number(isStart));
644 //emit appendToLog("The start bit is enabled = " + QString::number(isStart));
654 //emit appendToLog("The link is disabled = " + QString::number(isDisabled));
645 //emit appendToLog("The link is disabled = " + QString::number(isDisabled));
655 //emit appendToLog("The tri-state bit is enabled = " + QString::number(isAutoStart));
646 //emit appendToLog("The tri-state bit is enabled = " + QString::number(isAutoStart));
656 //emit appendToLog("The operating speed is = " + QString::number(operatingSpeed));
647 //emit appendToLog("The operating speed is = " + QString::number(operatingSpeed));
657 //emit appendToLog("This port is currently connected to output port = " + QString::number(outputPortConnection));
648 //emit appendToLog("This port is currently connected to output port = " + QString::number(outputPortConnection));
658 }
649 }
659 if (linkStatus == 5) return 1;
650 if (linkStatus == 5) return 1;
660 else return 0;
651 else return 0;
661 }
652 }
662
653
663 int StarDundee::receiveSPWPacket(unsigned char requestID) // SLOT
654 int StarDundee::receiveSPWPacket(unsigned char requestID) // SLOT
664 {
655 {
665 unsigned int packetLength;
656 unsigned int packetLength;
666 unsigned int nbBytes;
657 unsigned int nbBytes;
667 unsigned nPacketNum;
658 unsigned nPacketNum;
668 USB_SPACEWIRE_PACKET_PROPERTIES properties; // The properties of the read
659 USB_SPACEWIRE_PACKET_PROPERTIES properties; // The properties of the read
669
660
670 if (requestID==1)
661 if (requestID==1)
671 {
662 {
672 if (rmapPacketSEMAPHORE->available()) return rmapPacketSize;
663 if (rmapPacketSEMAPHORE->available())
664 {
665 return rmapPacketSize;
666 }
673 }
667 }
674
668
675 //********************
669 //********************
676 // TRY TO RECEIVE DATA
670 // TRY TO RECEIVE DATA
677 nbBytes = qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH); // maximum size of the packet to receive
671 nbBytes = qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH); // maximum size of the packet to receive
678 nPacketNum = 1;
672 nPacketNum = 1;
679 result = USBSpaceWire_ReadPackets(hDevice, spwPacket, nbBytes, nPacketNum, BWAIT_1, &properties, &pIdentifier);
673 result = USBSpaceWire_ReadPackets(hDevice, spwPacket, nbBytes, nPacketNum, BWAIT_1, &properties, &pIdentifier);
680 if (result != TRANSFER_SUCCESS) emit sendMessage("Error: Could not receive the packet");
674 if (result != TRANSFER_SUCCESS)
675 {
676 emit sendMessage("Error: Could not receive the packet");
677 return 0;
678 }
681 else
679 else
682 {
680 {
683 emit sendMessage("A packet of length " + QString::number(properties.len) + " has been successfully received");
681 packetLength = properties.len;
684 USBSpaceWire_FreeRead(hDevice, pIdentifier); // Free the receive
682 USBSpaceWire_FreeRead(hDevice, pIdentifier); // Free the receive
685 }
683 }
686 packetLength = properties.len;
687
684
688 switch(spwPacket[1]) // byte 1 is the protocole identifier in the SPW packet
685 switch(spwPacket[1]) // byte 1 is the protocole identifier in the SPW packet
689 {
686 {
690 case 1: // 0x01 is the protocole identifier for RMAP packets
687 case 1: // 0x01 is the protocole identifier for RMAP packets
691 if (rmapPacketSEMAPHORE->available()!=0) return -3; // ERROR === previous RMAP packet not processed yet
688 if (rmapPacketSEMAPHORE->available()!=0) return -3; // ERROR === previous RMAP packet not processed yet
692 for(unsigned int i=0; i<packetLength; i++) rmapPacket[i] = spwPacket[i];
689 for(unsigned int i=0; i<packetLength; i++) rmapPacket[i] = spwPacket[i];
693 rmapPacketSize = packetLength;
690 rmapPacketSize = packetLength;
694 rmapPacketSEMAPHORE->release();
691 rmapPacketSEMAPHORE->release();
695 emit sendMessage("RMAP packet of size " + QString::number(packetLength) + " received");
692 emit appendToLog("RMAP packet of size " + QString::number(packetLength) + " received");
696 return packetLength;
693 return packetLength;
697
694
698 case 2: // 0x02 is the protocole identifier for CCSDS packets
695 case 2: // 0x02 is the protocole identifier for CCSDS packets
699 if (ccsdsPacketSEMAPHORE->available()!=0) return -4; // ERROR === previous CCSDS packet not processed yet
696 if (ccsdsPacketSEMAPHORE->available()!=0) return -4; // ERROR === previous CCSDS packet not processed yet
700 for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i];
697 for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i];
701 ccsdsPacketSize = packetLength;
698 ccsdsPacketSize = packetLength;
702 ccsdsPacketSEMAPHORE->release();
699 ccsdsPacketSEMAPHORE->release();
700 emit appendToLog("CCSDS packet of size " + QString::number(packetLength) + " received");
703 emit(ccsdsPacketAvailable(ccsdsPacket, packetLength));
701 emit(ccsdsPacketAvailable(ccsdsPacket, packetLength));
704 return packetLength;
702 return packetLength;
705 }
703 }
706 return 0;
704 return 0;
707 }
705 }
708
706
707 void StarDundee::receivePollingLoop()
708 {
709 timer->blockSignals(true);
710 if (USBSpaceWire_WaitOnReadPacketAvailable(hDevice, 0)) receiveSPWPacket(0);
711 timer->blockSignals(false);
712 }
709
713
714 unsigned char StarDundee::setRoutingTableEntry(int tableEntry, U32 dwOutputPorts)
715 {
716 U32 routingTableEntry;
717 // SET THE ROUTING TABLE ENTRY FOR LOGICAL ADDRESSING, TARGET entryNumber
718 if (CFGSpaceWire_ClearRoutingTableEntry(hDevice, tableEntry) != CFG_TRANSFER_SUCCESS)
719 {
720 emit sendMessage("Could not clear routing table entry " + QString::number(tableEntry));
721 }
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 }
732 else emit sendMessage("Routing table entry [" + QString::number(tableEntry) + "] set" );
733
734 }
@@ -1,82 +1,99
1 #ifndef STARDUNDEE_H
1 #ifndef STARDUNDEE_H
2 #define STARDUNDEE_H
2 #define STARDUNDEE_H
3
3
4 #include <QWidget>
4 #include <QWidget>
5 #include "spw_usb_api.h"
6 #include "spw_config_library.h"
7 #include <QPushButton>
5 #include <QPushButton>
8 #include <QGridLayout>
6 #include <QGridLayout>
9 #include <QSpinBox>
7 #include <QSpinBox>
10 #include <QLabel>
8 #include <QLabel>
11 #include <QSemaphore>
9 #include <QSemaphore>
10 #include <QTimer>
11 #include <QDialog>
12
12 #include "rmapoperations.h"
13 #include "rmapoperations.h"
14 #include "spw_usb_api.h"
15 #include "spw_config_library.h"
13
16
14 #define BWAIT_0 0
17 #define BWAIT_0 0
15 #define BWAIT_1 1
18 #define BWAIT_1 1
16
19
17 class StarDundee : public QWidget
20 class StarDundee : public QWidget
18 {
21 {
19 Q_OBJECT
22 Q_OBJECT
20 public:
23 public:
21 explicit StarDundee(QWidget *parent = 0);
24 explicit StarDundee(QWidget *parent = 0);
22 ~StarDundee();
25 ~StarDundee();
23 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
26 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
24 unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0);
27 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);
28 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
26
29
27 signals:
30 signals:
28 void sendMessage(QString message);
31 void sendMessage(QString message);
29 void isOpen(bool);
32 void isOpen(bool);
30 void RMAP_write_reply_setText(QString);
33 void RMAP_write_reply_setText(QString);
31 void appendToLog(QString);
34 void appendToLog(QString);
32 void ccsdsPacketAvailable(unsigned char*, unsigned int);
35 void ccsdsPacketAvailable(unsigned char*, unsigned int);
33
36
34 public slots:
37 public slots:
35 void Open();
38 void Open();
36 void Close();
39 void Close();
37 int receiveSPWPacket(unsigned char requestID);
40 int receiveSPWPacket(unsigned char requestID);
38 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
41 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
39 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
42 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
43 void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();}
44 void reTestSPWLink() {getLinkStatus(linkNumber_SPINBOX->value());}
45 //
40 void sourceHasChanged(int target) {rmapSourceLogicalAddress = (unsigned char) target;}
46 void sourceHasChanged(int target) {rmapSourceLogicalAddress = (unsigned char) target;}
47 void receivePollingLoop();
41
48
42 private:
49 private:
43 unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0);
50 unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0);
44 unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0);
51 unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0);
45 void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->acquire();}
52 void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->tryAcquire();}
46 void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->acquire();}
53 void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->tryAcquire();}
54 unsigned char setRoutingTableEntry(int tableEntry, U32 dwOutputPorts);
47
55
48 unsigned int getLinkStatus(unsigned char link);
56 unsigned int getLinkStatus(unsigned char link);
49 unsigned int GetRoutingTableEntry();
57 unsigned int GetRoutingTableEntry();
50
58
51 unsigned char rmapTargetLogicalAddress ;
59 unsigned char rmapTargetLogicalAddress ;
52 unsigned char rmapSourceLogicalAddress ;
60 unsigned char rmapSourceLogicalAddress ;
53
61
54 RMAP_command_codes commandCode;
62 RMAP_command_codes commandCode;
55
63
56 QLabel *usbDeviceNumber_LABEL;
64 QLabel *usbDeviceNumber_LABEL;
57 QLabel *linkNumber_LABEL;
65 QLabel *linkNumber_LABEL;
58 QLabel *sourceLogicalAddress_LABEL;
66 QLabel *sourceLogicalAddress_LABEL;
67 QLabel *starDundeeStatusQueryDialogLabel;
59
68
60 QSpinBox *usbDeviceNumber_SPINBOX;
69 QSpinBox *usbDeviceNumber_SPINBOX;
61 QSpinBox *linkNumber_SPINBOX;
70 QSpinBox *linkNumber_SPINBOX;
62 QSpinBox *sourceLogicalAddress_SPINBOX;
71 QSpinBox *sourceLogicalAddress_SPINBOX;
63
72
64 QGridLayout *connection_LAYOUT;
73 QGridLayout *connection_LAYOUT;
74 QGridLayout *starDundeeStatusQueryDialogLayout;
75
76 QDialog *starDundeeStatusQueryDialog;
77
78 QPushButton *starDundeeStatusQueryRetryButton;
79 QPushButton *starDundeeStatusQueryAbortButton;
80
81 QTimer *timer;
65
82
66 unsigned char pBuffer[10]; // Pointer to the start of the user buffer from which to transmit data
83 unsigned char pBuffer[10]; // Pointer to the start of the user buffer from which to transmit data
67 USB_SPACEWIRE_ID pIdentifier; // A pointer to a variable which will be set to contain a unique identifier for the send
84 USB_SPACEWIRE_ID pIdentifier; // A pointer to a variable which will be set to contain a unique identifier for the send
68
85
69 star_device_handle hDevice; // Handle to the SpaceWire device
86 star_device_handle hDevice; // Handle to the SpaceWire device
70 USB_SPACEWIRE_STATUS result; // The result of the send operation
87 USB_SPACEWIRE_STATUS result; // The result of the send operation
71
88
72 // Packet receiver
89 // Packet receiver
73 QSemaphore *rmapPacketSEMAPHORE;
90 QSemaphore *rmapPacketSEMAPHORE;
74 QSemaphore *ccsdsPacketSEMAPHORE;
91 QSemaphore *ccsdsPacketSEMAPHORE;
75 char* rmapPacket; // The buffer to receive RMAP READ packets
92 char* rmapPacket; // The buffer to receive RMAP READ packets
76 unsigned char *ccsdsPacket;
93 unsigned char *ccsdsPacket;
77 char *spwPacket;
94 char *spwPacket;
78 unsigned int rmapPacketSize;
95 unsigned int rmapPacketSize;
79 unsigned int ccsdsPacketSize;
96 unsigned int ccsdsPacketSize;
80 };
97 };
81
98
82 #endif // STARDUNDEE_H
99 #endif // STARDUNDEE_H
General Comments 0
You need to be logged in to leave comments. Login now