@@ -1,142 +1,142 | |||
|
1 | 1 | ############################################################################# |
|
2 | 2 | # Makefile for building: PAULs_LPPMON_PLUGINS |
|
3 |
# Generated by qmake (2.01a) (Qt 4.8.4) on: |
|
|
3 | # Generated by qmake (2.01a) (Qt 4.8.4) on: Mon Apr 22 17:27:12 2013 | |
|
4 | 4 | # Project: PAULs_LPPMON_PLUGINS.pro |
|
5 | 5 | # Template: subdirs |
|
6 | 6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile PAULs_LPPMON_PLUGINS.pro |
|
7 | 7 | ############################################################################# |
|
8 | 8 | |
|
9 | 9 | first: make_default |
|
10 | 10 | MAKEFILE = Makefile |
|
11 | 11 | QMAKE = /usr/bin/qmake-qt4 |
|
12 | 12 | DEL_FILE = rm -f |
|
13 | 13 | CHK_DIR_EXISTS= test -d |
|
14 | 14 | MKDIR = mkdir -p |
|
15 | 15 | COPY = cp -f |
|
16 | 16 | COPY_FILE = $(COPY) |
|
17 | 17 | COPY_DIR = $(COPY) -r |
|
18 | 18 | INSTALL_FILE = install -m 644 -p |
|
19 | 19 | INSTALL_PROGRAM = install -m 755 -p |
|
20 | 20 | INSTALL_DIR = $(COPY_DIR) |
|
21 | 21 | DEL_FILE = rm -f |
|
22 | 22 | SYMLINK = ln -f -s |
|
23 | 23 | DEL_DIR = rmdir |
|
24 | 24 | MOVE = mv -f |
|
25 | 25 | CHK_DIR_EXISTS= test -d |
|
26 | 26 | MKDIR = mkdir -p |
|
27 | 27 | SUBTARGETS = \ |
|
28 | 28 | sub-rmapplugin |
|
29 | 29 | |
|
30 | 30 | rmapplugin/$(MAKEFILE): |
|
31 | 31 | @$(CHK_DIR_EXISTS) rmapplugin/ || $(MKDIR) rmapplugin/ |
|
32 | 32 | cd rmapplugin/ && $(QMAKE) /opt/LPPMON_PLUGINS_PAUL/rmapplugin/rmapplugin.pro -spec /usr/lib64/qt4/mkspecs/linux-g++ -o $(MAKEFILE) |
|
33 | 33 | sub-rmapplugin-qmake_all: FORCE |
|
34 | 34 | @$(CHK_DIR_EXISTS) rmapplugin/ || $(MKDIR) rmapplugin/ |
|
35 | 35 | cd rmapplugin/ && $(QMAKE) /opt/LPPMON_PLUGINS_PAUL/rmapplugin/rmapplugin.pro -spec /usr/lib64/qt4/mkspecs/linux-g++ -o $(MAKEFILE) |
|
36 | 36 | sub-rmapplugin: rmapplugin/$(MAKEFILE) FORCE |
|
37 | 37 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) |
|
38 | 38 | sub-rmapplugin-make_default-ordered: rmapplugin/$(MAKEFILE) FORCE |
|
39 | 39 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) |
|
40 | 40 | sub-rmapplugin-make_default: rmapplugin/$(MAKEFILE) FORCE |
|
41 | 41 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) |
|
42 | 42 | sub-rmapplugin-make_first-ordered: rmapplugin/$(MAKEFILE) FORCE |
|
43 | 43 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) first |
|
44 | 44 | sub-rmapplugin-make_first: rmapplugin/$(MAKEFILE) FORCE |
|
45 | 45 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) first |
|
46 | 46 | sub-rmapplugin-all-ordered: rmapplugin/$(MAKEFILE) FORCE |
|
47 | 47 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) all |
|
48 | 48 | sub-rmapplugin-all: rmapplugin/$(MAKEFILE) FORCE |
|
49 | 49 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) all |
|
50 | 50 | sub-rmapplugin-clean-ordered: rmapplugin/$(MAKEFILE) FORCE |
|
51 | 51 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) clean |
|
52 | 52 | sub-rmapplugin-clean: rmapplugin/$(MAKEFILE) FORCE |
|
53 | 53 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) clean |
|
54 | 54 | sub-rmapplugin-distclean-ordered: rmapplugin/$(MAKEFILE) FORCE |
|
55 | 55 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) distclean |
|
56 | 56 | sub-rmapplugin-distclean: rmapplugin/$(MAKEFILE) FORCE |
|
57 | 57 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) distclean |
|
58 | 58 | sub-rmapplugin-install_subtargets-ordered: rmapplugin/$(MAKEFILE) FORCE |
|
59 | 59 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) install |
|
60 | 60 | sub-rmapplugin-install_subtargets: rmapplugin/$(MAKEFILE) FORCE |
|
61 | 61 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) install |
|
62 | 62 | sub-rmapplugin-uninstall_subtargets-ordered: rmapplugin/$(MAKEFILE) FORCE |
|
63 | 63 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) uninstall |
|
64 | 64 | sub-rmapplugin-uninstall_subtargets: rmapplugin/$(MAKEFILE) FORCE |
|
65 | 65 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) uninstall |
|
66 | 66 | |
|
67 | 67 | Makefile: PAULs_LPPMON_PLUGINS.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
68 | 68 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
69 | 69 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
70 | 70 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ |
|
71 | 71 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ |
|
72 | 72 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ |
|
73 | 73 | /usr/lib64/qt4/mkspecs/qconfig.pri \ |
|
74 | 74 | /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \ |
|
75 | 75 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ |
|
76 | 76 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ |
|
77 | 77 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ |
|
78 | 78 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
79 | 79 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
80 | 80 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
81 | 81 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
82 | 82 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
83 | 83 | /usr/lib64/qt4/mkspecs/features/qt.prf \ |
|
84 | 84 | /usr/lib64/qt4/mkspecs/features/unix/thread.prf \ |
|
85 | 85 | /usr/lib64/qt4/mkspecs/features/moc.prf \ |
|
86 | 86 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
87 | 87 | /usr/lib64/qt4/mkspecs/features/uic.prf \ |
|
88 | 88 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ |
|
89 | 89 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
90 | 90 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf |
|
91 | 91 | $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile PAULs_LPPMON_PLUGINS.pro |
|
92 | 92 | /usr/lib64/qt4/mkspecs/common/unix.conf: |
|
93 | 93 | /usr/lib64/qt4/mkspecs/common/linux.conf: |
|
94 | 94 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: |
|
95 | 95 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf: |
|
96 | 96 | /usr/lib64/qt4/mkspecs/common/g++-base.conf: |
|
97 | 97 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf: |
|
98 | 98 | /usr/lib64/qt4/mkspecs/qconfig.pri: |
|
99 | 99 | /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri: |
|
100 | 100 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf: |
|
101 | 101 | /usr/lib64/qt4/mkspecs/features/qt_config.prf: |
|
102 | 102 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf: |
|
103 | 103 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: |
|
104 | 104 | /usr/lib64/qt4/mkspecs/features/release.prf: |
|
105 | 105 | /usr/lib64/qt4/mkspecs/features/default_post.prf: |
|
106 | 106 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: |
|
107 | 107 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: |
|
108 | 108 | /usr/lib64/qt4/mkspecs/features/qt.prf: |
|
109 | 109 | /usr/lib64/qt4/mkspecs/features/unix/thread.prf: |
|
110 | 110 | /usr/lib64/qt4/mkspecs/features/moc.prf: |
|
111 | 111 | /usr/lib64/qt4/mkspecs/features/resources.prf: |
|
112 | 112 | /usr/lib64/qt4/mkspecs/features/uic.prf: |
|
113 | 113 | /usr/lib64/qt4/mkspecs/features/yacc.prf: |
|
114 | 114 | /usr/lib64/qt4/mkspecs/features/lex.prf: |
|
115 | 115 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf: |
|
116 | 116 | qmake: qmake_all FORCE |
|
117 | 117 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile PAULs_LPPMON_PLUGINS.pro |
|
118 | 118 | |
|
119 | 119 | qmake_all: sub-rmapplugin-qmake_all FORCE |
|
120 | 120 | |
|
121 | 121 | make_default: sub-rmapplugin-make_default-ordered FORCE |
|
122 | 122 | make_first: sub-rmapplugin-make_first-ordered FORCE |
|
123 | 123 | all: sub-rmapplugin-all-ordered FORCE |
|
124 | 124 | clean: sub-rmapplugin-clean-ordered FORCE |
|
125 | 125 | distclean: sub-rmapplugin-distclean-ordered FORCE |
|
126 | 126 | -$(DEL_FILE) Makefile |
|
127 | 127 | install_subtargets: sub-rmapplugin-install_subtargets-ordered FORCE |
|
128 | 128 | uninstall_subtargets: sub-rmapplugin-uninstall_subtargets-ordered FORCE |
|
129 | 129 | |
|
130 | 130 | sub-rmapplugin-check_ordered: rmapplugin/$(MAKEFILE) |
|
131 | 131 | cd rmapplugin/ && $(MAKE) -f $(MAKEFILE) check |
|
132 | 132 | check: sub-rmapplugin-check_ordered |
|
133 | 133 | |
|
134 | 134 | mocclean: compiler_moc_header_clean compiler_moc_source_clean |
|
135 | 135 | |
|
136 | 136 | mocables: compiler_moc_header_make_all compiler_moc_source_make_all |
|
137 | 137 | install: install_subtargets FORCE |
|
138 | 138 | |
|
139 | 139 | uninstall: uninstall_subtargets FORCE |
|
140 | 140 | |
|
141 | 141 | FORCE: |
|
142 | 142 |
@@ -1,342 +1,342 | |||
|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
|
2 | 2 | <!DOCTYPE QtCreatorProject> |
|
3 |
<!-- Written by Qt Creator 2.4.1, 2013-04- |
|
|
3 | <!-- Written by Qt Creator 2.4.1, 2013-04-23T10:22:08. --> | |
|
4 | 4 | <qtcreator> |
|
5 | 5 | <data> |
|
6 | 6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
7 | 7 | <value type="int">0</value> |
|
8 | 8 | </data> |
|
9 | 9 | <data> |
|
10 | 10 | <variable>ProjectExplorer.Project.EditorSettings</variable> |
|
11 | 11 | <valuemap type="QVariantMap"> |
|
12 | 12 | <value type="bool" key="EditorConfiguration.AutoIndent">true</value> |
|
13 | 13 | <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> |
|
14 | 14 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> |
|
15 | 15 | <value type="QString" key="language">Cpp</value> |
|
16 | 16 | <valuemap type="QVariantMap" key="value"> |
|
17 | 17 | <value type="QString" key="CurrentPreferences">CppGlobal</value> |
|
18 | 18 | </valuemap> |
|
19 | 19 | </valuemap> |
|
20 | 20 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> |
|
21 | 21 | <value type="QString" key="language">QmlJS</value> |
|
22 | 22 | <valuemap type="QVariantMap" key="value"> |
|
23 | 23 | <value type="QString" key="CurrentPreferences">QmlJSGlobal</value> |
|
24 | 24 | </valuemap> |
|
25 | 25 | </valuemap> |
|
26 | 26 | <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value> |
|
27 | 27 | <value type="QByteArray" key="EditorConfiguration.Codec">System</value> |
|
28 | 28 | <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> |
|
29 | 29 | <value type="int" key="EditorConfiguration.IndentSize">4</value> |
|
30 | 30 | <value type="bool" key="EditorConfiguration.MouseNavigation">true</value> |
|
31 | 31 | <value type="int" key="EditorConfiguration.PaddingMode">1</value> |
|
32 | 32 | <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> |
|
33 | 33 | <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> |
|
34 | 34 | <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> |
|
35 | 35 | <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> |
|
36 | 36 | <value type="int" key="EditorConfiguration.TabSize">8</value> |
|
37 | 37 | <value type="bool" key="EditorConfiguration.UseGlobal">true</value> |
|
38 | 38 | <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> |
|
39 | 39 | <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> |
|
40 | 40 | <value type="bool" key="EditorConfiguration.cleanIndentation">true</value> |
|
41 | 41 | <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> |
|
42 | 42 | <value type="bool" key="EditorConfiguration.inEntireDocument">false</value> |
|
43 | 43 | </valuemap> |
|
44 | 44 | </data> |
|
45 | 45 | <data> |
|
46 | 46 | <variable>ProjectExplorer.Project.PluginSettings</variable> |
|
47 | 47 | <valuemap type="QVariantMap"/> |
|
48 | 48 | </data> |
|
49 | 49 | <data> |
|
50 | 50 | <variable>ProjectExplorer.Project.Target.0</variable> |
|
51 | 51 | <valuemap type="QVariantMap"> |
|
52 | 52 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value> |
|
53 | 53 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value> |
|
54 | 54 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value> |
|
55 | 55 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> |
|
56 | 56 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> |
|
57 | 57 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> |
|
58 | 58 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> |
|
59 | 59 | <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value> |
|
60 | 60 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
61 | 61 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
62 | 62 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|
63 | 63 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
64 | 64 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|
65 | 65 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|
66 | 66 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value> |
|
67 | 67 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|
68 | 68 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|
69 | 69 | </valuemap> |
|
70 | 70 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|
71 | 71 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
72 | 72 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
73 | 73 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
74 | 74 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|
75 | 75 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|
76 | 76 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
77 | 77 | </valuemap> |
|
78 | 78 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|
79 | 79 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|
80 | 80 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
81 | 81 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|
82 | 82 | </valuemap> |
|
83 | 83 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|
84 | 84 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
85 | 85 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
86 | 86 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
87 | 87 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
88 | 88 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|
89 | 89 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|
90 | 90 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
91 | 91 | </valuemap> |
|
92 | 92 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|
93 | 93 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|
94 | 94 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
95 | 95 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|
96 | 96 | </valuemap> |
|
97 | 97 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|
98 | 98 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|
99 | 99 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|
100 | 100 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value> |
|
101 | 101 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
102 | 102 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|
103 | 103 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> |
|
104 | 104 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL</value> |
|
105 | 105 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value> |
|
106 | 106 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value> |
|
107 | 107 | </valuemap> |
|
108 | 108 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> |
|
109 | 109 | <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value> |
|
110 | 110 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
111 | 111 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
112 | 112 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|
113 | 113 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
114 | 114 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|
115 | 115 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|
116 | 116 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value> |
|
117 | 117 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|
118 | 118 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|
119 | 119 | </valuemap> |
|
120 | 120 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|
121 | 121 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
122 | 122 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
123 | 123 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
124 | 124 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|
125 | 125 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|
126 | 126 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
127 | 127 | </valuemap> |
|
128 | 128 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|
129 | 129 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|
130 | 130 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
131 | 131 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|
132 | 132 | </valuemap> |
|
133 | 133 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|
134 | 134 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
135 | 135 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
136 | 136 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
137 | 137 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
138 | 138 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|
139 | 139 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|
140 | 140 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
141 | 141 | </valuemap> |
|
142 | 142 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|
143 | 143 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|
144 | 144 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
145 | 145 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|
146 | 146 | </valuemap> |
|
147 | 147 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|
148 | 148 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|
149 | 149 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|
150 | 150 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value> |
|
151 | 151 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
152 | 152 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|
153 | 153 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> |
|
154 | 154 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL</value> |
|
155 | 155 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value> |
|
156 | 156 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value> |
|
157 | 157 | </valuemap> |
|
158 | 158 | <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value> |
|
159 | 159 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> |
|
160 | 160 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
161 | 161 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> |
|
162 | 162 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> |
|
163 | 163 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
164 | 164 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> |
|
165 | 165 | </valuemap> |
|
166 | 166 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> |
|
167 | 167 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value> |
|
168 | 168 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
169 | 169 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> |
|
170 | 170 | </valuemap> |
|
171 | 171 | <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> |
|
172 | 172 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> |
|
173 | 173 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> |
|
174 | 174 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> |
|
175 | 175 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|
176 | 176 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|
177 | 177 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|
178 | 178 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|
179 | 179 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|
180 | 180 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|
181 | 181 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|
182 | 182 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|
183 | 183 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|
184 | 184 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|
185 | 185 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|
186 | 186 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|
187 | 187 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|
188 | 188 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|
189 | 189 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|
190 | 190 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|
191 | 191 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|
192 | 192 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|
193 | 193 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|
194 | 194 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|
195 | 195 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|
196 | 196 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|
197 | 197 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|
198 | 198 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|
199 | 199 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|
200 | 200 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|
201 | 201 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|
202 | 202 | <value type="int">0</value> |
|
203 | 203 | <value type="int">1</value> |
|
204 | 204 | <value type="int">2</value> |
|
205 | 205 | <value type="int">3</value> |
|
206 | 206 | <value type="int">4</value> |
|
207 | 207 | <value type="int">5</value> |
|
208 | 208 | <value type="int">6</value> |
|
209 | 209 | <value type="int">7</value> |
|
210 | 210 | <value type="int">8</value> |
|
211 | 211 | <value type="int">9</value> |
|
212 | 212 | <value type="int">10</value> |
|
213 | 213 | <value type="int">11</value> |
|
214 | 214 | <value type="int">12</value> |
|
215 | 215 | <value type="int">13</value> |
|
216 | 216 | <value type="int">14</value> |
|
217 | 217 | </valuelist> |
|
218 | 218 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|
219 | 219 | <value type="int">0</value> |
|
220 | 220 | <value type="int">1</value> |
|
221 | 221 | <value type="int">2</value> |
|
222 | 222 | <value type="int">3</value> |
|
223 | 223 | <value type="int">4</value> |
|
224 | 224 | <value type="int">5</value> |
|
225 | 225 | <value type="int">6</value> |
|
226 | 226 | <value type="int">7</value> |
|
227 | 227 | <value type="int">8</value> |
|
228 | 228 | <value type="int">9</value> |
|
229 | 229 | <value type="int">10</value> |
|
230 | 230 | <value type="int">11</value> |
|
231 | 231 | <value type="int">12</value> |
|
232 | 232 | <value type="int">13</value> |
|
233 | 233 | <value type="int">14</value> |
|
234 | 234 | </valuelist> |
|
235 | 235 | <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value> |
|
236 | 236 | <value type="int" key="ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase">2</value> |
|
237 | 237 | <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">lppmon</value> |
|
238 | 238 | <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">false</value> |
|
239 | 239 | <valuelist type="QVariantList" key="ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges"/> |
|
240 | 240 | <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value> |
|
241 | 241 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Run lppmon</value> |
|
242 | 242 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
243 | 243 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value> |
|
244 | 244 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> |
|
245 | 245 | <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> |
|
246 | 246 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> |
|
247 | 247 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value> |
|
248 | 248 | </valuemap> |
|
249 | 249 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1"> |
|
250 | 250 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> |
|
251 | 251 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> |
|
252 | 252 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|
253 | 253 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|
254 | 254 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|
255 | 255 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|
256 | 256 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|
257 | 257 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|
258 | 258 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|
259 | 259 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|
260 | 260 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|
261 | 261 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|
262 | 262 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|
263 | 263 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|
264 | 264 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|
265 | 265 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|
266 | 266 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|
267 | 267 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|
268 | 268 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|
269 | 269 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|
270 | 270 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|
271 | 271 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|
272 | 272 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|
273 | 273 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|
274 | 274 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|
275 | 275 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|
276 | 276 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|
277 | 277 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|
278 | 278 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|
279 | 279 | <value type="int">0</value> |
|
280 | 280 | <value type="int">1</value> |
|
281 | 281 | <value type="int">2</value> |
|
282 | 282 | <value type="int">3</value> |
|
283 | 283 | <value type="int">4</value> |
|
284 | 284 | <value type="int">5</value> |
|
285 | 285 | <value type="int">6</value> |
|
286 | 286 | <value type="int">7</value> |
|
287 | 287 | <value type="int">8</value> |
|
288 | 288 | <value type="int">9</value> |
|
289 | 289 | <value type="int">10</value> |
|
290 | 290 | <value type="int">11</value> |
|
291 | 291 | <value type="int">12</value> |
|
292 | 292 | <value type="int">13</value> |
|
293 | 293 | <value type="int">14</value> |
|
294 | 294 | </valuelist> |
|
295 | 295 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|
296 | 296 | <value type="int">0</value> |
|
297 | 297 | <value type="int">1</value> |
|
298 | 298 | <value type="int">2</value> |
|
299 | 299 | <value type="int">3</value> |
|
300 | 300 | <value type="int">4</value> |
|
301 | 301 | <value type="int">5</value> |
|
302 | 302 | <value type="int">6</value> |
|
303 | 303 | <value type="int">7</value> |
|
304 | 304 | <value type="int">8</value> |
|
305 | 305 | <value type="int">9</value> |
|
306 | 306 | <value type="int">10</value> |
|
307 | 307 | <value type="int">11</value> |
|
308 | 308 | <value type="int">12</value> |
|
309 | 309 | <value type="int">13</value> |
|
310 | 310 | <value type="int">14</value> |
|
311 | 311 | </valuelist> |
|
312 | 312 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">spwtimegenerator</value> |
|
313 | 313 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
314 | 314 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration</value> |
|
315 | 315 | <value type="int" key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase">2</value> |
|
316 | 316 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> |
|
317 | 317 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">spwtimegenerator/spwtimegenerator/spwtimegenerator.pro</value> |
|
318 | 318 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> |
|
319 | 319 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value> |
|
320 | 320 | <valuelist type="QVariantList" key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges"/> |
|
321 | 321 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> |
|
322 | 322 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> |
|
323 | 323 | <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> |
|
324 | 324 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> |
|
325 | 325 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> |
|
326 | 326 | </valuemap> |
|
327 | 327 | <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value> |
|
328 | 328 | </valuemap> |
|
329 | 329 | </data> |
|
330 | 330 | <data> |
|
331 | 331 | <variable>ProjectExplorer.Project.TargetCount</variable> |
|
332 | 332 | <value type="int">1</value> |
|
333 | 333 | </data> |
|
334 | 334 | <data> |
|
335 | 335 | <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> |
|
336 | 336 | <value type="QString">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value> |
|
337 | 337 | </data> |
|
338 | 338 | <data> |
|
339 | 339 | <variable>ProjectExplorer.Project.Updater.FileVersion</variable> |
|
340 | 340 | <value type="int">10</value> |
|
341 | 341 | </data> |
|
342 | 342 | </qtcreator> |
@@ -1,469 +1,486 | |||
|
1 | 1 | ############################################################################# |
|
2 | 2 | # Makefile for building: librmapplugin.so.1.0.0 |
|
3 |
# Generated by qmake (2.01a) (Qt 4.8.4) on: |
|
|
3 | # Generated by qmake (2.01a) (Qt 4.8.4) on: Mon Apr 22 17:27:12 2013 | |
|
4 | 4 | # Project: rmapplugin.pro |
|
5 | 5 | # Template: lib |
|
6 | 6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro |
|
7 | 7 | ############################################################################# |
|
8 | 8 | |
|
9 | 9 | ####### Compiler, tools and options |
|
10 | 10 | |
|
11 | 11 | CC = gcc |
|
12 | 12 | CXX = g++ |
|
13 | 13 | DEFINES = -DPLUGIN=rmapplugin -DPLUGINHEADER="\"rmapplugin.h\"" -Ddriver_Name="\"RMAPPlugin\"" -Ddriver_Author="\"Paul Leroy paul.leroy@lpp.polytechnique.fr\"" -Ddriver_Version="\"1.1.2\"" -Ddriver_Description="\"AHB bus controler, works with Gaisler's AHB plugn' play bus.\"" -Ddriver_can_be_root=1 -Ddriver_can_be_child=0 -Ddriver_VID=0 -Ddriver_PID=0 -DLPPMON_VERSION="\"0.0.1\"" -DUNIXTRANSLATIONPATH -DLPPMON_PLUGINS_INSTALL_PATH="QDir::homePath()+\"/.lppmon/plugins\"" -DLPPMON_CONFIG_PATH="QDir::homePath()+\"/.lppmon/config\"" -DLPPMON_TRANSLATION_PATH="\"/etc/lppmon/translations\"" -DLPPMONPLUGIN_LIBRARY -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED |
|
14 | 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 | 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 | 16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include -I. -I../common_PLE -I../spw_usb_driver_v2.63/inc -I/usr/include/lppmon/common -I/usr/include/lppmon -I/usr/include/lppmon/pluginsInterface -I/usr/include/PythonQt -Imoc |
|
17 | 17 | LINK = g++ |
|
18 | 18 | LFLAGS = -Wl,-O1 -Wl,-z,relro -shared -Wl,-soname,librmapplugin.so.1 |
|
19 | 19 | LIBS = $(SUBLIBS) -L/usr/lib64 ../spw_usb_driver_v2.63/lib/x86_64/libSpaceWireUSBAPI.so ../spw_usb_driver_v2.63/lib/x86_64/libConfigLibraryUSB.so -ldl -lutil -lm -lpython2.7 -lPythonQt_QtAll -lPythonQt -lQtXml -lQtGui -lQtNetwork -lQtCore -lpthread |
|
20 | 20 | AR = ar cqs |
|
21 | 21 | RANLIB = |
|
22 | 22 | QMAKE = /usr/bin/qmake-qt4 |
|
23 | 23 | TAR = tar -cf |
|
24 | 24 | COMPRESS = gzip -9f |
|
25 | 25 | COPY = cp -f |
|
26 | 26 | SED = sed |
|
27 | 27 | COPY_FILE = $(COPY) |
|
28 | 28 | COPY_DIR = $(COPY) -r |
|
29 | 29 | STRIP = |
|
30 | 30 | INSTALL_FILE = install -m 644 -p |
|
31 | 31 | INSTALL_DIR = $(COPY_DIR) |
|
32 | 32 | INSTALL_PROGRAM = install -m 755 -p |
|
33 | 33 | DEL_FILE = rm -f |
|
34 | 34 | SYMLINK = ln -f -s |
|
35 | 35 | DEL_DIR = rmdir |
|
36 | 36 | MOVE = mv -f |
|
37 | 37 | CHK_DIR_EXISTS= test -d |
|
38 | 38 | MKDIR = mkdir -p |
|
39 | 39 | |
|
40 | 40 | ####### Output directory |
|
41 | 41 | |
|
42 | 42 | OBJECTS_DIR = obj/ |
|
43 | 43 | |
|
44 | 44 | ####### Files |
|
45 | 45 | |
|
46 | 46 | SOURCES = rmapplugin.cpp \ |
|
47 | 47 | rmappluginui.cpp \ |
|
48 | 48 | rmapoperations.cpp \ |
|
49 | 49 | ccsds.cpp \ |
|
50 | 50 | ../common_PLE/qipdialogbox.cpp \ |
|
51 | 51 | ../common_PLE/gresbstatusenquiry.cpp \ |
|
52 | 52 | spectralmatricesdmasimulator.cpp \ |
|
53 | 53 | rmappluginpythonwrapper.cpp \ |
|
54 | 54 | stardundee.cpp \ |
|
55 | 55 | gresb.cpp \ |
|
56 | 56 | tcpackettosend.cpp \ |
|
57 | 57 | tmpackettoread.cpp \ |
|
58 | wfdisplay.cpp \ | |
|
58 | 59 | /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp moc/moc_rmappluginui.cpp \ |
|
59 | 60 | moc/moc_rmapplugin.cpp \ |
|
60 | 61 | moc/moc_qipdialogbox.cpp \ |
|
61 | 62 | moc/moc_gresbstatusenquiry.cpp \ |
|
62 | 63 | moc/moc_spectralmatricesdmasimulator.cpp \ |
|
63 | 64 | moc/moc_rmappluginpythonwrapper.cpp \ |
|
64 | 65 | moc/moc_stardundee.cpp \ |
|
65 | 66 | moc/moc_gresb.cpp \ |
|
66 | 67 | moc/moc_tcpackettosend.cpp \ |
|
67 | 68 | moc/moc_tmpackettoread.cpp \ |
|
69 | moc/moc_wfdisplay.cpp \ | |
|
68 | 70 | moc/moc_genericPySysdriver.cpp \ |
|
69 | 71 | moc/moc_lppmonplugin.cpp |
|
70 | 72 | OBJECTS = obj/rmapplugin.o \ |
|
71 | 73 | obj/rmappluginui.o \ |
|
72 | 74 | obj/rmapoperations.o \ |
|
73 | 75 | obj/ccsds.o \ |
|
74 | 76 | obj/qipdialogbox.o \ |
|
75 | 77 | obj/gresbstatusenquiry.o \ |
|
76 | 78 | obj/spectralmatricesdmasimulator.o \ |
|
77 | 79 | obj/rmappluginpythonwrapper.o \ |
|
78 | 80 | obj/stardundee.o \ |
|
79 | 81 | obj/gresb.o \ |
|
80 | 82 | obj/tcpackettosend.o \ |
|
81 | 83 | obj/tmpackettoread.o \ |
|
84 | obj/wfdisplay.o \ | |
|
82 | 85 | obj/lppmonplugininterface.o \ |
|
83 | 86 | obj/moc_rmappluginui.o \ |
|
84 | 87 | obj/moc_rmapplugin.o \ |
|
85 | 88 | obj/moc_qipdialogbox.o \ |
|
86 | 89 | obj/moc_gresbstatusenquiry.o \ |
|
87 | 90 | obj/moc_spectralmatricesdmasimulator.o \ |
|
88 | 91 | obj/moc_rmappluginpythonwrapper.o \ |
|
89 | 92 | obj/moc_stardundee.o \ |
|
90 | 93 | obj/moc_gresb.o \ |
|
91 | 94 | obj/moc_tcpackettosend.o \ |
|
92 | 95 | obj/moc_tmpackettoread.o \ |
|
96 | obj/moc_wfdisplay.o \ | |
|
93 | 97 | obj/moc_genericPySysdriver.o \ |
|
94 | 98 | obj/moc_lppmonplugin.o |
|
95 | 99 | DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
96 | 100 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
97 | 101 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
98 | 102 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ |
|
99 | 103 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ |
|
100 | 104 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ |
|
101 | 105 | /usr/lib64/qt4/mkspecs/qconfig.pri \ |
|
102 | 106 | /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \ |
|
103 | 107 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ |
|
104 | 108 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ |
|
105 | 109 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ |
|
106 | 110 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
107 | 111 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
108 | 112 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
109 | 113 | /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf \ |
|
110 | 114 | /usr/lib64/qt4/mkspecs/features/pythonqt.prf \ |
|
111 | 115 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
112 | 116 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
113 | 117 | /usr/lib64/qt4/mkspecs/features/qt.prf \ |
|
114 | 118 | /usr/lib64/qt4/mkspecs/features/unix/thread.prf \ |
|
115 | 119 | /usr/lib64/qt4/mkspecs/features/moc.prf \ |
|
116 | 120 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
117 | 121 | /usr/lib64/qt4/mkspecs/features/uic.prf \ |
|
118 | 122 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ |
|
119 | 123 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
120 | 124 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ |
|
121 | 125 | rmapplugin.pro |
|
122 | 126 | QMAKE_TARGET = rmapplugin |
|
123 | 127 | DESTDIR = bin/ |
|
124 | 128 | TARGET = librmapplugin.so.1.0.0 |
|
125 | 129 | TARGETA = bin/librmapplugin.a |
|
126 | 130 | TARGETD = librmapplugin.so.1.0.0 |
|
127 | 131 | TARGET0 = librmapplugin.so |
|
128 | 132 | TARGET1 = librmapplugin.so.1 |
|
129 | 133 | TARGET2 = librmapplugin.so.1.0 |
|
130 | 134 | |
|
131 | 135 | first: all |
|
132 | 136 | ####### Implicit rules |
|
133 | 137 | |
|
134 | 138 | .SUFFIXES: .o .c .cpp .cc .cxx .C |
|
135 | 139 | |
|
136 | 140 | .cpp.o: |
|
137 | 141 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
138 | 142 | |
|
139 | 143 | .cc.o: |
|
140 | 144 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
141 | 145 | |
|
142 | 146 | .cxx.o: |
|
143 | 147 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
144 | 148 | |
|
145 | 149 | .C.o: |
|
146 | 150 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
147 | 151 | |
|
148 | 152 | .c.o: |
|
149 | 153 | $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" |
|
150 | 154 | |
|
151 | 155 | ####### Build rules |
|
152 | 156 | |
|
153 | 157 | all: Makefile bin/$(TARGET) |
|
154 | 158 | |
|
155 | 159 | bin/$(TARGET): $(OBJECTS) $(SUBLIBS) $(OBJCOMP) |
|
156 | 160 | @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/ |
|
157 | 161 | -$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) |
|
158 | 162 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP) |
|
159 | 163 | -ln -s $(TARGET) $(TARGET0) |
|
160 | 164 | -ln -s $(TARGET) $(TARGET1) |
|
161 | 165 | -ln -s $(TARGET) $(TARGET2) |
|
162 | 166 | -$(DEL_FILE) bin/$(TARGET) |
|
163 | 167 | -$(DEL_FILE) bin/$(TARGET0) |
|
164 | 168 | -$(DEL_FILE) bin/$(TARGET1) |
|
165 | 169 | -$(DEL_FILE) bin/$(TARGET2) |
|
166 | 170 | -$(MOVE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) bin/ |
|
167 | 171 | |
|
168 | 172 | |
|
169 | 173 | |
|
170 | 174 | staticlib: $(TARGETA) |
|
171 | 175 | |
|
172 | 176 | $(TARGETA): $(OBJECTS) $(OBJCOMP) |
|
173 | 177 | -$(DEL_FILE) $(TARGETA) |
|
174 | 178 | $(AR) $(TARGETA) $(OBJECTS) |
|
175 | 179 | |
|
176 | 180 | Makefile: rmapplugin.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
177 | 181 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
178 | 182 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
179 | 183 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ |
|
180 | 184 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ |
|
181 | 185 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ |
|
182 | 186 | /usr/lib64/qt4/mkspecs/qconfig.pri \ |
|
183 | 187 | /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \ |
|
184 | 188 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ |
|
185 | 189 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ |
|
186 | 190 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ |
|
187 | 191 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
188 | 192 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
189 | 193 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
190 | 194 | /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf \ |
|
191 | 195 | /usr/lib64/qt4/mkspecs/features/pythonqt.prf \ |
|
192 | 196 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
193 | 197 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
194 | 198 | /usr/lib64/qt4/mkspecs/features/qt.prf \ |
|
195 | 199 | /usr/lib64/qt4/mkspecs/features/unix/thread.prf \ |
|
196 | 200 | /usr/lib64/qt4/mkspecs/features/moc.prf \ |
|
197 | 201 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
198 | 202 | /usr/lib64/qt4/mkspecs/features/uic.prf \ |
|
199 | 203 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ |
|
200 | 204 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
201 | 205 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ |
|
202 | 206 | /usr/lib64/libQtXml.prl \ |
|
203 | 207 | /usr/lib64/libQtCore.prl \ |
|
204 | 208 | /usr/lib64/libQtGui.prl \ |
|
205 | 209 | /usr/lib64/libQtNetwork.prl |
|
206 | 210 | $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro |
|
207 | 211 | /usr/lib64/qt4/mkspecs/common/unix.conf: |
|
208 | 212 | /usr/lib64/qt4/mkspecs/common/linux.conf: |
|
209 | 213 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: |
|
210 | 214 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf: |
|
211 | 215 | /usr/lib64/qt4/mkspecs/common/g++-base.conf: |
|
212 | 216 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf: |
|
213 | 217 | /usr/lib64/qt4/mkspecs/qconfig.pri: |
|
214 | 218 | /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri: |
|
215 | 219 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf: |
|
216 | 220 | /usr/lib64/qt4/mkspecs/features/qt_config.prf: |
|
217 | 221 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf: |
|
218 | 222 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: |
|
219 | 223 | /usr/lib64/qt4/mkspecs/features/release.prf: |
|
220 | 224 | /usr/lib64/qt4/mkspecs/features/default_post.prf: |
|
221 | 225 | /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf: |
|
222 | 226 | /usr/lib64/qt4/mkspecs/features/pythonqt.prf: |
|
223 | 227 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: |
|
224 | 228 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: |
|
225 | 229 | /usr/lib64/qt4/mkspecs/features/qt.prf: |
|
226 | 230 | /usr/lib64/qt4/mkspecs/features/unix/thread.prf: |
|
227 | 231 | /usr/lib64/qt4/mkspecs/features/moc.prf: |
|
228 | 232 | /usr/lib64/qt4/mkspecs/features/resources.prf: |
|
229 | 233 | /usr/lib64/qt4/mkspecs/features/uic.prf: |
|
230 | 234 | /usr/lib64/qt4/mkspecs/features/yacc.prf: |
|
231 | 235 | /usr/lib64/qt4/mkspecs/features/lex.prf: |
|
232 | 236 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf: |
|
233 | 237 | /usr/lib64/libQtXml.prl: |
|
234 | 238 | /usr/lib64/libQtCore.prl: |
|
235 | 239 | /usr/lib64/libQtGui.prl: |
|
236 | 240 | /usr/lib64/libQtNetwork.prl: |
|
237 | 241 | qmake: FORCE |
|
238 | 242 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro |
|
239 | 243 | |
|
240 | 244 | dist: |
|
241 | 245 | @$(CHK_DIR_EXISTS) obj/rmapplugin1.0.0 || $(MKDIR) obj/rmapplugin1.0.0 |
|
242 | $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmappluginui.h rmapplugin.h rmapoperations.h ccsds.h ../common_PLE/qipdialogbox.h ../common_PLE/gresbstatusenquiry.h spectralmatricesdmasimulator.h rmappluginpythonwrapper.h stardundee.h ../spw_usb_driver_v2.61/inc/spw_usb_api.h ../spw_usb_driver_v2.61/inc/spw_config_library.h gresb.h tcpackettosend.h tmpackettoread.h /usr/include/lppmon/genericPySysdriver.h /usr/include/lppmon/lppmonplugin.h obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmapplugin.cpp rmappluginui.cpp rmapoperations.cpp ccsds.cpp ../common_PLE/qipdialogbox.cpp ../common_PLE/gresbstatusenquiry.cpp spectralmatricesdmasimulator.cpp rmappluginpythonwrapper.cpp stardundee.cpp gresb.cpp tcpackettosend.cpp tmpackettoread.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp obj/rmapplugin1.0.0/ && (cd `dirname obj/rmapplugin1.0.0` && $(TAR) rmapplugin1.0.0.tar rmapplugin1.0.0 && $(COMPRESS) rmapplugin1.0.0.tar) && $(MOVE) `dirname obj/rmapplugin1.0.0`/rmapplugin1.0.0.tar.gz . && $(DEL_FILE) -r obj/rmapplugin1.0.0 | |
|
246 | $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmappluginui.h rmapplugin.h rmapoperations.h ccsds.h ../common_PLE/qipdialogbox.h ../common_PLE/gresbstatusenquiry.h spectralmatricesdmasimulator.h rmappluginpythonwrapper.h stardundee.h ../spw_usb_driver_v2.61/inc/spw_usb_api.h ../spw_usb_driver_v2.61/inc/spw_config_library.h gresb.h tcpackettosend.h tmpackettoread.h wfdisplay.h /usr/include/lppmon/genericPySysdriver.h /usr/include/lppmon/lppmonplugin.h obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmapplugin.cpp rmappluginui.cpp rmapoperations.cpp ccsds.cpp ../common_PLE/qipdialogbox.cpp ../common_PLE/gresbstatusenquiry.cpp spectralmatricesdmasimulator.cpp rmappluginpythonwrapper.cpp stardundee.cpp gresb.cpp tcpackettosend.cpp tmpackettoread.cpp wfdisplay.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 | |
|
243 | 247 | |
|
244 | 248 | |
|
245 | 249 | clean:compiler_clean |
|
246 | 250 | -$(DEL_FILE) $(OBJECTS) |
|
247 | 251 | -$(DEL_FILE) *~ core *.core |
|
248 | 252 | |
|
249 | 253 | |
|
250 | 254 | ####### Sub-libraries |
|
251 | 255 | |
|
252 | 256 | distclean: clean |
|
253 | 257 | -$(DEL_FILE) bin/$(TARGET) |
|
254 | 258 | -$(DEL_FILE) bin/$(TARGET0) bin/$(TARGET1) bin/$(TARGET2) $(TARGETA) |
|
255 | 259 | -$(DEL_FILE) Makefile |
|
256 | 260 | |
|
257 | 261 | |
|
258 | 262 | check: first |
|
259 | 263 | |
|
260 | 264 | mocclean: compiler_moc_header_clean compiler_moc_source_clean |
|
261 | 265 | |
|
262 | 266 | mocables: compiler_moc_header_make_all compiler_moc_source_make_all |
|
263 | 267 | |
|
264 | compiler_moc_header_make_all: moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_qipdialogbox.cpp moc/moc_gresbstatusenquiry.cpp moc/moc_spectralmatricesdmasimulator.cpp moc/moc_rmappluginpythonwrapper.cpp moc/moc_stardundee.cpp moc/moc_gresb.cpp moc/moc_tcpackettosend.cpp moc/moc_tmpackettoread.cpp moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp | |
|
268 | compiler_moc_header_make_all: moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_qipdialogbox.cpp moc/moc_gresbstatusenquiry.cpp moc/moc_spectralmatricesdmasimulator.cpp moc/moc_rmappluginpythonwrapper.cpp moc/moc_stardundee.cpp moc/moc_gresb.cpp moc/moc_tcpackettosend.cpp moc/moc_tmpackettoread.cpp moc/moc_wfdisplay.cpp moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp | |
|
265 | 269 | compiler_moc_header_clean: |
|
266 | -$(DEL_FILE) moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_qipdialogbox.cpp moc/moc_gresbstatusenquiry.cpp moc/moc_spectralmatricesdmasimulator.cpp moc/moc_rmappluginpythonwrapper.cpp moc/moc_stardundee.cpp moc/moc_gresb.cpp moc/moc_tcpackettosend.cpp moc/moc_tmpackettoread.cpp moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp | |
|
270 | -$(DEL_FILE) moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_qipdialogbox.cpp moc/moc_gresbstatusenquiry.cpp moc/moc_spectralmatricesdmasimulator.cpp moc/moc_rmappluginpythonwrapper.cpp moc/moc_stardundee.cpp moc/moc_gresb.cpp moc/moc_tcpackettosend.cpp moc/moc_tmpackettoread.cpp moc/moc_wfdisplay.cpp moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp | |
|
267 | 271 | moc/moc_rmappluginui.cpp: rmapoperations.h \ |
|
268 | 272 | spectralmatricesdmasimulator.h \ |
|
269 | 273 | stardundee.h \ |
|
270 | 274 | ccsds.h \ |
|
271 | 275 | tmpackettoread.h \ |
|
272 | 276 | gresb.h \ |
|
277 | wfdisplay.h \ | |
|
273 | 278 | rmappluginui.h |
|
274 | 279 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginui.h -o moc/moc_rmappluginui.cpp |
|
275 | 280 | |
|
276 | 281 | moc/moc_rmapplugin.cpp: rmappluginui.h \ |
|
277 | 282 | rmapoperations.h \ |
|
278 | 283 | spectralmatricesdmasimulator.h \ |
|
279 | 284 | stardundee.h \ |
|
280 | 285 | ccsds.h \ |
|
281 | 286 | tmpackettoread.h \ |
|
282 | 287 | gresb.h \ |
|
288 | wfdisplay.h \ | |
|
283 | 289 | rmapplugin.h |
|
284 | 290 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmapplugin.h -o moc/moc_rmapplugin.cpp |
|
285 | 291 | |
|
286 | 292 | moc/moc_qipdialogbox.cpp: ../common_PLE/qipdialogbox.h |
|
287 | 293 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../common_PLE/qipdialogbox.h -o moc/moc_qipdialogbox.cpp |
|
288 | 294 | |
|
289 | 295 | moc/moc_gresbstatusenquiry.cpp: ../common_PLE/gresbstatusenquiry.h |
|
290 | 296 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../common_PLE/gresbstatusenquiry.h -o moc/moc_gresbstatusenquiry.cpp |
|
291 | 297 | |
|
292 | 298 | moc/moc_spectralmatricesdmasimulator.cpp: spectralmatricesdmasimulator.h |
|
293 | 299 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) spectralmatricesdmasimulator.h -o moc/moc_spectralmatricesdmasimulator.cpp |
|
294 | 300 | |
|
295 | 301 | moc/moc_rmappluginpythonwrapper.cpp: rmapoperations.h \ |
|
296 | 302 | ccsds.h \ |
|
297 | 303 | tcpackettosend.h \ |
|
298 | 304 | tmpackettoread.h \ |
|
299 | 305 | rmappluginpythonwrapper.h |
|
300 | 306 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginpythonwrapper.h -o moc/moc_rmappluginpythonwrapper.cpp |
|
301 | 307 | |
|
302 | 308 | moc/moc_stardundee.cpp: rmapoperations.h \ |
|
303 | 309 | ccsds.h \ |
|
304 | 310 | tmpackettoread.h \ |
|
305 | 311 | stardundee.h |
|
306 | 312 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) stardundee.h -o moc/moc_stardundee.cpp |
|
307 | 313 | |
|
308 | 314 | moc/moc_gresb.cpp: rmapoperations.h \ |
|
309 | 315 | ccsds.h \ |
|
310 | 316 | tmpackettoread.h \ |
|
311 | 317 | gresb.h |
|
312 | 318 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) gresb.h -o moc/moc_gresb.cpp |
|
313 | 319 | |
|
314 | 320 | moc/moc_tcpackettosend.cpp: tcpackettosend.h |
|
315 | 321 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) tcpackettosend.h -o moc/moc_tcpackettosend.cpp |
|
316 | 322 | |
|
317 | 323 | moc/moc_tmpackettoread.cpp: tmpackettoread.h |
|
318 | 324 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) tmpackettoread.h -o moc/moc_tmpackettoread.cpp |
|
319 | 325 | |
|
326 | moc/moc_wfdisplay.cpp: wfdisplay.h | |
|
327 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) wfdisplay.h -o moc/moc_wfdisplay.cpp | |
|
328 | ||
|
320 | 329 | moc/moc_genericPySysdriver.cpp: /usr/include/lppmon/genericPySysdriver.h |
|
321 | 330 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/lppmon/genericPySysdriver.h -o moc/moc_genericPySysdriver.cpp |
|
322 | 331 | |
|
323 | 332 | moc/moc_lppmonplugin.cpp: /usr/include/lppmon/lppmonplugin.h |
|
324 | 333 | /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/lppmon/lppmonplugin.h -o moc/moc_lppmonplugin.cpp |
|
325 | 334 | |
|
326 | 335 | compiler_rcc_make_all: |
|
327 | 336 | compiler_rcc_clean: |
|
328 | 337 | compiler_image_collection_make_all: qmake_image_collection.cpp |
|
329 | 338 | compiler_image_collection_clean: |
|
330 | 339 | -$(DEL_FILE) qmake_image_collection.cpp |
|
331 | 340 | compiler_moc_source_make_all: |
|
332 | 341 | compiler_moc_source_clean: |
|
333 | 342 | compiler_uic_make_all: |
|
334 | 343 | compiler_uic_clean: |
|
335 | 344 | compiler_yacc_decl_make_all: |
|
336 | 345 | compiler_yacc_decl_clean: |
|
337 | 346 | compiler_yacc_impl_make_all: |
|
338 | 347 | compiler_yacc_impl_clean: |
|
339 | 348 | compiler_lex_make_all: |
|
340 | 349 | compiler_lex_clean: |
|
341 | 350 | compiler_clean: compiler_moc_header_clean |
|
342 | 351 | |
|
343 | 352 | ####### Compile |
|
344 | 353 | |
|
345 | 354 | obj/rmapplugin.o: rmapplugin.cpp rmapplugin.h \ |
|
346 | 355 | rmappluginui.h \ |
|
347 | 356 | rmapoperations.h \ |
|
348 | 357 | spectralmatricesdmasimulator.h \ |
|
349 | 358 | stardundee.h \ |
|
350 | 359 | ccsds.h \ |
|
351 | 360 | tmpackettoread.h \ |
|
352 | 361 | gresb.h \ |
|
362 | wfdisplay.h \ | |
|
353 | 363 | rmappluginpythonwrapper.h \ |
|
354 | 364 | tcpackettosend.h |
|
355 | 365 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapplugin.o rmapplugin.cpp |
|
356 | 366 | |
|
357 | 367 | obj/rmappluginui.o: rmappluginui.cpp rmapplugin.h \ |
|
358 | 368 | rmappluginui.h \ |
|
359 | 369 | rmapoperations.h \ |
|
360 | 370 | spectralmatricesdmasimulator.h \ |
|
361 | 371 | stardundee.h \ |
|
362 | 372 | ccsds.h \ |
|
363 | 373 | tmpackettoread.h \ |
|
364 | gresb.h | |
|
374 | gresb.h \ | |
|
375 | wfdisplay.h | |
|
365 | 376 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginui.o rmappluginui.cpp |
|
366 | 377 | |
|
367 | 378 | obj/rmapoperations.o: rmapoperations.cpp rmapoperations.h |
|
368 | 379 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapoperations.o rmapoperations.cpp |
|
369 | 380 | |
|
370 | 381 | obj/ccsds.o: ccsds.cpp ccsds.h |
|
371 | 382 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/ccsds.o ccsds.cpp |
|
372 | 383 | |
|
373 | 384 | obj/qipdialogbox.o: ../common_PLE/qipdialogbox.cpp ../common_PLE/qipdialogbox.h |
|
374 | 385 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/qipdialogbox.o ../common_PLE/qipdialogbox.cpp |
|
375 | 386 | |
|
376 | 387 | obj/gresbstatusenquiry.o: ../common_PLE/gresbstatusenquiry.cpp ../common_PLE/gresbstatusenquiry.h |
|
377 | 388 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/gresbstatusenquiry.o ../common_PLE/gresbstatusenquiry.cpp |
|
378 | 389 | |
|
379 | 390 | obj/spectralmatricesdmasimulator.o: spectralmatricesdmasimulator.cpp spectralmatricesdmasimulator.h |
|
380 | 391 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/spectralmatricesdmasimulator.o spectralmatricesdmasimulator.cpp |
|
381 | 392 | |
|
382 | 393 | obj/rmappluginpythonwrapper.o: rmappluginpythonwrapper.cpp rmappluginpythonwrapper.h \ |
|
383 | 394 | rmapoperations.h \ |
|
384 | 395 | ccsds.h \ |
|
385 | 396 | tcpackettosend.h \ |
|
386 | 397 | tmpackettoread.h |
|
387 | 398 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginpythonwrapper.o rmappluginpythonwrapper.cpp |
|
388 | 399 | |
|
389 | 400 | obj/stardundee.o: stardundee.cpp stardundee.h \ |
|
390 | 401 | rmapoperations.h \ |
|
391 | 402 | ccsds.h \ |
|
392 | 403 | tmpackettoread.h |
|
393 | 404 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/stardundee.o stardundee.cpp |
|
394 | 405 | |
|
395 | 406 | obj/gresb.o: gresb.cpp gresb.h \ |
|
396 | 407 | rmapoperations.h \ |
|
397 | 408 | ccsds.h \ |
|
398 | 409 | tmpackettoread.h |
|
399 | 410 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/gresb.o gresb.cpp |
|
400 | 411 | |
|
401 | 412 | obj/tcpackettosend.o: tcpackettosend.cpp tcpackettosend.h |
|
402 | 413 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tcpackettosend.o tcpackettosend.cpp |
|
403 | 414 | |
|
404 | 415 | obj/tmpackettoread.o: tmpackettoread.cpp tmpackettoread.h |
|
405 | 416 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tmpackettoread.o tmpackettoread.cpp |
|
406 | 417 | |
|
418 | obj/wfdisplay.o: wfdisplay.cpp wfdisplay.h | |
|
419 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/wfdisplay.o wfdisplay.cpp | |
|
420 | ||
|
407 | 421 | obj/lppmonplugininterface.o: /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.h \ |
|
408 | 422 | /usr/include/lppmon/pluginsInterface/lppmonplugininterface_global.h |
|
409 | 423 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/lppmonplugininterface.o /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp |
|
410 | 424 | |
|
411 | 425 | obj/moc_rmappluginui.o: moc/moc_rmappluginui.cpp |
|
412 | 426 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmappluginui.o moc/moc_rmappluginui.cpp |
|
413 | 427 | |
|
414 | 428 | obj/moc_rmapplugin.o: moc/moc_rmapplugin.cpp |
|
415 | 429 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmapplugin.o moc/moc_rmapplugin.cpp |
|
416 | 430 | |
|
417 | 431 | obj/moc_qipdialogbox.o: moc/moc_qipdialogbox.cpp |
|
418 | 432 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_qipdialogbox.o moc/moc_qipdialogbox.cpp |
|
419 | 433 | |
|
420 | 434 | obj/moc_gresbstatusenquiry.o: moc/moc_gresbstatusenquiry.cpp |
|
421 | 435 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_gresbstatusenquiry.o moc/moc_gresbstatusenquiry.cpp |
|
422 | 436 | |
|
423 | 437 | obj/moc_spectralmatricesdmasimulator.o: moc/moc_spectralmatricesdmasimulator.cpp |
|
424 | 438 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_spectralmatricesdmasimulator.o moc/moc_spectralmatricesdmasimulator.cpp |
|
425 | 439 | |
|
426 | 440 | obj/moc_rmappluginpythonwrapper.o: moc/moc_rmappluginpythonwrapper.cpp |
|
427 | 441 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmappluginpythonwrapper.o moc/moc_rmappluginpythonwrapper.cpp |
|
428 | 442 | |
|
429 | 443 | obj/moc_stardundee.o: moc/moc_stardundee.cpp |
|
430 | 444 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_stardundee.o moc/moc_stardundee.cpp |
|
431 | 445 | |
|
432 | 446 | obj/moc_gresb.o: moc/moc_gresb.cpp |
|
433 | 447 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_gresb.o moc/moc_gresb.cpp |
|
434 | 448 | |
|
435 | 449 | obj/moc_tcpackettosend.o: moc/moc_tcpackettosend.cpp |
|
436 | 450 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_tcpackettosend.o moc/moc_tcpackettosend.cpp |
|
437 | 451 | |
|
438 | 452 | obj/moc_tmpackettoread.o: moc/moc_tmpackettoread.cpp |
|
439 | 453 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_tmpackettoread.o moc/moc_tmpackettoread.cpp |
|
440 | 454 | |
|
455 | obj/moc_wfdisplay.o: moc/moc_wfdisplay.cpp | |
|
456 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_wfdisplay.o moc/moc_wfdisplay.cpp | |
|
457 | ||
|
441 | 458 | obj/moc_genericPySysdriver.o: moc/moc_genericPySysdriver.cpp |
|
442 | 459 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_genericPySysdriver.o moc/moc_genericPySysdriver.cpp |
|
443 | 460 | |
|
444 | 461 | obj/moc_lppmonplugin.o: moc/moc_lppmonplugin.cpp |
|
445 | 462 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_lppmonplugin.o moc/moc_lppmonplugin.cpp |
|
446 | 463 | |
|
447 | 464 | ####### Install |
|
448 | 465 | |
|
449 | 466 | install_target: first FORCE |
|
450 | 467 | @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/ || $(MKDIR) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/ |
|
451 | 468 | -$(INSTALL_PROGRAM) "bin/$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET)" |
|
452 | 469 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET0)" |
|
453 | 470 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET1)" |
|
454 | 471 | -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET2)" |
|
455 | 472 | |
|
456 | 473 | uninstall_target: FORCE |
|
457 | 474 | -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET)" |
|
458 | 475 | -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET0)" |
|
459 | 476 | -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET1)" |
|
460 | 477 | -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET2)" |
|
461 | 478 | -$(DEL_DIR) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/ |
|
462 | 479 | |
|
463 | 480 | |
|
464 | 481 | install: install_target FORCE |
|
465 | 482 | |
|
466 | 483 | uninstall: uninstall_target FORCE |
|
467 | 484 | |
|
468 | 485 | FORCE: |
|
469 | 486 |
@@ -1,789 +1,786 | |||
|
1 | 1 | #include "gresb.h" |
|
2 | 2 | #include <QTime> |
|
3 | 3 | #include <QHostAddress> |
|
4 | 4 | |
|
5 | 5 | gresb::gresb(QWidget *parent) : |
|
6 | 6 | QWidget(parent) |
|
7 | 7 | { |
|
8 | 8 | RMAPSend_SOCKET = new QTcpSocket; |
|
9 | 9 | RMAPReceive_SOCKET = new QTcpSocket; |
|
10 | 10 | GRESBStatusQuery_SOCKET = new QTcpSocket; |
|
11 | 11 | |
|
12 | 12 | rmapPacketSEMAPHORE = new QSemaphore; |
|
13 | 13 | ccsdsPacketSEMAPHORE = new QSemaphore; |
|
14 | 14 | rmapPacket = (char*) malloc(RMAP_MAX_PACKET_LENGTH); |
|
15 | 15 | ccsdsPacket = (unsigned char*) malloc(CCSDS_MAX_PACKET_LENGTH); |
|
16 | 16 | spwPacket = (char*) malloc( qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH) ); |
|
17 | 17 | |
|
18 | 18 | commandCode = invalid0; // initialization of the command code for the RMAP transfers |
|
19 | 19 | rmapTargetLogicalAddress = DEFAULT_TARGET; |
|
20 | 20 | rmapSourceLogicalAddress = DEFAULT_SOURCE; |
|
21 | 21 | |
|
22 | 22 | //*** QLABEL ***// |
|
23 | 23 | gresbBridgeIPLabel = new QLabel(tr("GRESB Bridge IP: ")); |
|
24 | 24 | gresbVirtualLinkLabel = new QLabel(tr("GRESB Virtual Link: ")); |
|
25 | 25 | spwLinkLabel = new QLabel(tr("GRESB SPW Link: ")); |
|
26 | 26 | rmapSendStateLabel = new QLabel(tr("RMAP Send Socket State: waiting for connection")); |
|
27 | 27 | rmapReceiveStateLabel = new QLabel(tr("RMAP Receive Socket State: waiting for connection")); |
|
28 | 28 | gresbStatusQueryLabel = new QLabel(tr("GRESB status query socket (port 3010): waiting for connection")); |
|
29 | 29 | gresbStatusQueryDialogLabel = new QLabel(tr("sockets opened but SpaceWire link not running")); |
|
30 | 30 | |
|
31 | 31 | //*** SPINBOX ***// |
|
32 | 32 | gresbVirtualLinkSpinBox = new QSpinBox; |
|
33 | 33 | spwLinkSpinBox = new QSpinBox;; |
|
34 | 34 | gresbVirtualLinkSpinBox->setRange(0, 4); |
|
35 | 35 | gresbVirtualLinkSpinBox->setValue(1); |
|
36 | 36 | spwLinkSpinBox->setRange(0, 2); |
|
37 | 37 | spwLinkSpinBox->setValue(0); |
|
38 | 38 | |
|
39 | 39 | //*** QPUSHBUTTON ***// |
|
40 | 40 | gresbStatusQueryRetryButton = new QPushButton(tr("Retry")); |
|
41 | 41 | gresbStatusQueryAbortButton = new QPushButton(tr("Abort")); |
|
42 | 42 | |
|
43 | 43 | //*** LAYOUT ***// |
|
44 | 44 | connectionLayout = new QGridLayout; |
|
45 | 45 | |
|
46 | 46 | //*** MISC ***// |
|
47 | 47 | gresbStatusQueryDialog = new QDialog; |
|
48 | 48 | gresbBridgeIPDialogBox = new QIPDialogBox; |
|
49 | 49 | spwLinkStatusEnquiry = new gresbStatusEnquiry; |
|
50 | 50 | |
|
51 | 51 | connectionLayout->addWidget(gresbBridgeIPLabel, 0, 0, 0); |
|
52 | 52 | connectionLayout->addWidget(gresbBridgeIPDialogBox, 0, 1, 0); |
|
53 | 53 | connectionLayout->addWidget(gresbVirtualLinkLabel, 1, 0, 0); |
|
54 | 54 | connectionLayout->addWidget(gresbVirtualLinkSpinBox, 1, 1, 0); |
|
55 | 55 | connectionLayout->addWidget(spwLinkLabel, 2, 0, 0); |
|
56 | 56 | connectionLayout->addWidget(spwLinkSpinBox, 2, 1, 0); |
|
57 | 57 | connectionLayout->addWidget(rmapSendStateLabel, 3, 0, 1, 2); |
|
58 | 58 | connectionLayout->addWidget(rmapReceiveStateLabel, 4, 0, 1, 2); |
|
59 | 59 | connectionLayout->addWidget(gresbStatusQueryLabel, 5, 0, 1, 2); |
|
60 | 60 | |
|
61 | 61 | connectionLayout->setRowStretch(6, 1); |
|
62 | 62 | connectionLayout->setColumnStretch(2, 1); |
|
63 | 63 | |
|
64 | 64 | // GRESB STATUS QUERY DIALOG |
|
65 | 65 | gresbStatusQueryDialogLayout = new QGridLayout; |
|
66 | 66 | gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryDialogLabel, 0, 0, 1, 2); |
|
67 | 67 | gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryRetryButton, 1, 0, 0); |
|
68 | 68 | gresbStatusQueryDialogLayout->addWidget(gresbStatusQueryAbortButton, 1, 1, 0); |
|
69 | 69 | gresbStatusQueryDialog->setLayout(gresbStatusQueryDialogLayout); |
|
70 | 70 | |
|
71 | 71 | this->setLayout(connectionLayout); |
|
72 | 72 | |
|
73 | 73 | connect(RMAPSend_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(RMAPSendConnectionState(QAbstractSocket::SocketState))); |
|
74 | 74 | connect(RMAPReceive_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(RMAPReceiveConnectionState(QAbstractSocket::SocketState))); |
|
75 | 75 | connect(GRESBStatusQuery_SOCKET, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(GRESBConnectionState(QAbstractSocket::SocketState))); |
|
76 | 76 | connect(gresbStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink())); |
|
77 | 77 | connect(gresbStatusQueryAbortButton, SIGNAL(clicked()), gresbStatusQueryDialog, SLOT(reject())); |
|
78 | 78 | connect(spwLinkStatusEnquiry->readSPWStatusButton, SIGNAL(clicked()), this, SLOT(GRESBStatusQuery())); |
|
79 | 79 | connect(this->RMAPReceive_SOCKET, SIGNAL(readyRead()), this, SLOT(receiveSPWPacketLoop())); |
|
80 | 80 | } |
|
81 | 81 | |
|
82 | 82 | gresb::~gresb() |
|
83 | 83 | { |
|
84 | 84 | free(rmapPacket); |
|
85 | 85 | free(ccsdsPacket); |
|
86 | 86 | free(spwPacket); |
|
87 | 87 | } |
|
88 | 88 | |
|
89 | 89 | unsigned int gresb::Write(unsigned int *Value, unsigned int count, unsigned int address) |
|
90 | 90 | { |
|
91 | 91 | unsigned int remainingCount = count; |
|
92 | 92 | unsigned int iOffset = 0; |
|
93 | 93 | QString console_message; |
|
94 | 94 | char* data; |
|
95 | 95 | |
|
96 | 96 | if(rmapPacketSEMAPHORE->available()!=0) |
|
97 | 97 | { |
|
98 | 98 | emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP request already running, WRITE access stopped"); |
|
99 | 99 | return 1; |
|
100 | 100 | } |
|
101 | 101 | |
|
102 | 102 | RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable"); |
|
103 | 103 | |
|
104 | 104 | data = (char*) malloc(READ_WRITE_MAX_COUNTS*4); |
|
105 | 105 | |
|
106 | 106 | emit appendToLog(QString("*** START *** WRITE ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16)); |
|
107 | 107 | |
|
108 | 108 | while (remainingCount > READ_WRITE_MAX_COUNTS) |
|
109 | 109 | { |
|
110 | 110 | for (int i = 0; i<READ_WRITE_MAX_COUNTS; i++) |
|
111 | 111 | { |
|
112 | 112 | data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]); |
|
113 | 113 | data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8); |
|
114 | 114 | data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16); |
|
115 | 115 | data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24); |
|
116 | 116 | } |
|
117 | 117 | |
|
118 | 118 | console_message.sprintf("remainingCount: %d => ", remainingCount); |
|
119 | 119 | emit appendToLog(console_message + QString("Write ")+ QString::number(READ_WRITE_MAX_COUNTS*4) + QString(" byte(s) @0x")+ QString::number(address,16)); |
|
120 | 120 | |
|
121 | 121 | if(WriteBLOCK(data, READ_WRITE_MAX_COUNTS*4, address)==0) |
|
122 | 122 | { |
|
123 | 123 | emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed"); |
|
124 | 124 | return 1; |
|
125 | 125 | } |
|
126 | 126 | |
|
127 | 127 | remainingCount = remainingCount - READ_WRITE_MAX_COUNTS; |
|
128 | 128 | address = address + READ_WRITE_MAX_COUNTS * 4; |
|
129 | 129 | iOffset = iOffset + READ_WRITE_MAX_COUNTS; |
|
130 | 130 | } |
|
131 | 131 | |
|
132 | 132 | if (remainingCount > 0) |
|
133 | 133 | { |
|
134 | 134 | for (unsigned int i = 0; i<remainingCount; i++) |
|
135 | 135 | { |
|
136 | 136 | data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]); |
|
137 | 137 | data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8); |
|
138 | 138 | data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16); |
|
139 | 139 | data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24); |
|
140 | 140 | } |
|
141 | 141 | |
|
142 | 142 | console_message.sprintf("remainingCount: %d => ", remainingCount); |
|
143 | 143 | emit appendToLog(console_message + QString("Write ")+ QString::number(remainingCount*4) + QString(" byte(s) @0x")+ QString::number(address,16)); |
|
144 | 144 | |
|
145 | 145 | if (WriteBLOCK(data, remainingCount*4, address)==0) |
|
146 | 146 | { |
|
147 | 147 | emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed"); |
|
148 | 148 | return 1; |
|
149 | 149 | } |
|
150 | 150 | } |
|
151 | 151 | |
|
152 | 152 | emit appendToLog(QString("*** STOP *** WRITE")); |
|
153 | 153 | free(data); |
|
154 | 154 | return count; |
|
155 | 155 | } |
|
156 | 156 | |
|
157 | 157 | unsigned int gresb::Read(unsigned int *Value, unsigned int count, unsigned int address) |
|
158 | 158 | { |
|
159 | 159 | unsigned int remainingCount = count; |
|
160 | 160 | unsigned int iOffset = 0; |
|
161 | 161 | QString console_message; |
|
162 | 162 | |
|
163 | 163 | if(rmapPacketSEMAPHORE->available()!=0) |
|
164 | 164 | { |
|
165 | 165 | emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP request already running, READ access stopped"); |
|
166 | 166 | return 1; |
|
167 | 167 | } |
|
168 | 168 | emit appendToLog(QString("*** START *** READ ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16)); |
|
169 | 169 | |
|
170 | 170 | while (remainingCount > READ_WRITE_MAX_COUNTS) |
|
171 | 171 | { |
|
172 | 172 | console_message.sprintf("remainingCount: %d => ", remainingCount); |
|
173 | 173 | emit appendToLog(console_message + QString("Read ")+ QString::number(4*READ_WRITE_MAX_COUNTS) + QString(" byte(s) @0x")+ QString::number(address,16)); |
|
174 | 174 | |
|
175 | 175 | if (ReadBLOCK(READ_WRITE_MAX_COUNTS*4, address)==0) |
|
176 | 176 | { |
|
177 | 177 | emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received"); |
|
178 | 178 | return 1; |
|
179 | 179 | } |
|
180 | 180 | |
|
181 | 181 | for(int i=0;i<READ_WRITE_MAX_COUNTS;i++) |
|
182 | 182 | { |
|
183 | 183 | Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH]; |
|
184 | 184 | for(int j=1;j<4;j++) |
|
185 | 185 | { |
|
186 | 186 | Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256; |
|
187 | 187 | } |
|
188 | 188 | } |
|
189 | 189 | |
|
190 | 190 | remainingCount = remainingCount - READ_WRITE_MAX_COUNTS; |
|
191 | 191 | address = address + READ_WRITE_MAX_COUNTS * 4; |
|
192 | 192 | iOffset = iOffset + READ_WRITE_MAX_COUNTS; |
|
193 | 193 | rmapPacketSEMAPHORE->acquire(); |
|
194 | 194 | } |
|
195 | 195 | |
|
196 | 196 | if (remainingCount > 0) |
|
197 | 197 | { |
|
198 | 198 | console_message.sprintf("remainingCount: %d => ", remainingCount); |
|
199 | 199 | emit appendToLog(console_message + QString("Read ")+ QString::number(4*remainingCount) + QString(" byte(s) @0x")+ QString::number(address,16)); |
|
200 | 200 | |
|
201 | 201 | if (ReadBLOCK(4*remainingCount, address)==0) |
|
202 | 202 | { |
|
203 | 203 | emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received"); |
|
204 | 204 | return 1; |
|
205 | 205 | } |
|
206 | 206 | |
|
207 | 207 | for(unsigned int i=0;i<remainingCount;i++) |
|
208 | 208 | { |
|
209 | 209 | Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH]; |
|
210 | 210 | for(int j=1;j<4;j++) |
|
211 | 211 | { |
|
212 | 212 | Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256; |
|
213 | 213 | } |
|
214 | 214 | } |
|
215 | 215 | rmapPacketSEMAPHORE->acquire(); |
|
216 | 216 | } |
|
217 | 217 | |
|
218 | 218 | emit appendToLog(QString("*** STOP *** READ ")); |
|
219 | 219 | return count; |
|
220 | 220 | } |
|
221 | 221 | |
|
222 | 222 | unsigned int gresb::WriteBLOCK(char *data, unsigned int nbBytes, unsigned int address) |
|
223 | 223 | { |
|
224 | 224 | QTime RMAPTimeout; |
|
225 | 225 | RMAP *RMAPCommand; |
|
226 | 226 | int errorCode; |
|
227 | 227 | QString console_message; |
|
228 | 228 | |
|
229 | 229 | if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1) |
|
230 | 230 | { |
|
231 | 231 | this->Close(); |
|
232 | 232 | return 1; |
|
233 | 233 | } |
|
234 | 234 | |
|
235 | 235 | RMAPCommand = new RMAP(commandCode, |
|
236 | 236 | rmapTargetLogicalAddress, |
|
237 | 237 | rmapSourceLogicalAddress, |
|
238 | 238 | address, |
|
239 | 239 | nbBytes, |
|
240 | 240 | data); |
|
241 | 241 | |
|
242 | 242 | // SEND GRESB HEADER |
|
243 | 243 | RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->GRESBHeader), 4); |
|
244 | 244 | // SEND SPACEWIRE PACKET HEADER |
|
245 | 245 | RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->RMAPHeader), sizeof(RMAPCommand->RMAPHeader)); |
|
246 | 246 | // SEND DATA |
|
247 | 247 | RMAPSend_SOCKET->write( data, nbBytes); |
|
248 | 248 | // SEND DATA CRC |
|
249 | 249 | RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->dataCRC), 1); |
|
250 | 250 | RMAPTimeout.start(); |
|
251 | 251 | while(RMAPSend_SOCKET->bytesToWrite() > 0) |
|
252 | 252 | { |
|
253 | 253 | RMAPSend_SOCKET->waitForBytesWritten(100); |
|
254 | 254 | if(RMAPTimeout.elapsed()>1000) |
|
255 | 255 | { |
|
256 | 256 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** sending Write RMAP Command timeout"); |
|
257 | 257 | return 0; |
|
258 | 258 | } |
|
259 | 259 | } |
|
260 | 260 | |
|
261 | 261 | if ( (commandCode == writeSingle_noVer_Rep) | (commandCode == writeInc_noVer_Rep) | |
|
262 | 262 | (commandCode == writeSingle_ver_rep) | (commandCode == writeInc_ver_rep) ) |
|
263 | 263 | { |
|
264 | 264 | // WAIT FOR THE RMAP REPLY PACKET |
|
265 | 265 | errorCode = receiveSPWPacket(1); |
|
266 | 266 | if (errorCode<=0) |
|
267 | 267 | { |
|
268 | 268 | emit appendToLog("WARNING === in function WriteBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode)); |
|
269 | 269 | return 0; |
|
270 | 270 | } |
|
271 | 271 | if(rmapPacketSize != 8) |
|
272 | 272 | { |
|
273 | 273 | console_message.sprintf("WARNING === in function WRITE (with reply) of rmapplugin *** write reply format not compliant\n"); |
|
274 | 274 | emit appendToLog(console_message); |
|
275 | 275 | return 0; |
|
276 | 276 | } |
|
277 | 277 | switch (rmapPacket[3]) // byte 4 is the status byte in the reply |
|
278 | 278 | { |
|
279 | 279 | case 0: |
|
280 | 280 | RMAP_write_reply_setText("reply to the write command required\nlast reply status: 0 Successfull"); |
|
281 | 281 | break; |
|
282 | 282 | case 1: |
|
283 | 283 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** General error code"); |
|
284 | 284 | RMAP_write_reply_setText("reply to the write command required\nlast reply status: 1 General error code"); |
|
285 | 285 | break; |
|
286 | 286 | case 2: |
|
287 | 287 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Unused RMAP packet type or command code"); |
|
288 | 288 | RMAP_write_reply_setText("reply to the write command required\nlast reply status: 2 Unused RMAP packet type or command code"); |
|
289 | 289 | break; |
|
290 | 290 | case 3: |
|
291 | 291 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid key"); |
|
292 | 292 | RMAP_write_reply_setText("reply to the write command required\nlast reply status: 3 Invalid key"); |
|
293 | 293 | break; |
|
294 | 294 | case 4: |
|
295 | 295 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid data CRC"); |
|
296 | 296 | RMAP_write_reply_setText("reply to the write command required\nlast reply status: 4 Invalid data CRC"); |
|
297 | 297 | break; |
|
298 | 298 | case 5: |
|
299 | 299 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Early EOP"); |
|
300 | 300 | RMAP_write_reply_setText("reply to the write command required\nlast reply status: 5 Early EOP"); |
|
301 | 301 | break; |
|
302 | 302 | case 6: |
|
303 | 303 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Too much data"); |
|
304 | 304 | RMAP_write_reply_setText("reply to the write command required\nlast reply status: 6 Too much data"); |
|
305 | 305 | break; |
|
306 | 306 | case 7: |
|
307 | 307 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** EEP"); |
|
308 | 308 | RMAP_write_reply_setText("reply to the write command required\nlast reply status: 7 EEP"); |
|
309 | 309 | break; |
|
310 | 310 | case 8: |
|
311 | 311 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Reserved"); |
|
312 | 312 | RMAP_write_reply_setText("reply to the write command required\nlast reply status: 8 Reserved"); |
|
313 | 313 | break; |
|
314 | 314 | case 9: |
|
315 | 315 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Verify buffer overrun"); |
|
316 | 316 | RMAP_write_reply_setText("reply to the write command required\nlast reply status: 9 Verify buffer overrun"); |
|
317 | 317 | break; |
|
318 | 318 | case 10: |
|
319 | 319 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMAP command not implemented or not authorised"); |
|
320 | 320 | RMAP_write_reply_setText("reply to the write command required\nlast reply status: 10 RMAP command not implemented or not authorised"); |
|
321 | 321 | break; |
|
322 | 322 | case 11: |
|
323 | 323 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMW data length error"); |
|
324 | 324 | RMAP_write_reply_setText("reply to the write command required\nlast reply status: 11 RMAP RMW data length error"); |
|
325 | 325 | break; |
|
326 | 326 | case 12: |
|
327 | 327 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid target logical address"); |
|
328 | 328 | RMAP_write_reply_setText("reply to the write command required\nlast reply status: 12 Invalid target logical address"); |
|
329 | 329 | break; |
|
330 | 330 | } |
|
331 | 331 | acquireRMAPSemaphore(); |
|
332 | 332 | } |
|
333 | 333 | return nbBytes; |
|
334 | 334 | } |
|
335 | 335 | |
|
336 | 336 | unsigned int gresb::ReadBLOCK(unsigned int nbBytes, unsigned int address) |
|
337 | 337 | { |
|
338 | 338 | int errorCode; |
|
339 | 339 | RMAP *RMAPCommand; |
|
340 | 340 | QTime RMAPTimeout; |
|
341 | 341 | unsigned int dataLength; |
|
342 | 342 | if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1) |
|
343 | 343 | { |
|
344 | 344 | this->Close(); |
|
345 | 345 | return 1; |
|
346 | 346 | } |
|
347 | 347 | |
|
348 | 348 | if (nbBytes > 4) |
|
349 | 349 | { |
|
350 | 350 | RMAPCommand = new RMAP(read_Inc, |
|
351 | 351 | rmapTargetLogicalAddress, |
|
352 | 352 | rmapSourceLogicalAddress, |
|
353 | 353 | address, |
|
354 | 354 | nbBytes, |
|
355 | 355 | NULL); |
|
356 | 356 | } |
|
357 | 357 | else |
|
358 | 358 | { |
|
359 | 359 | RMAPCommand = new RMAP(read_Single, |
|
360 | 360 | rmapTargetLogicalAddress, |
|
361 | 361 | rmapSourceLogicalAddress, |
|
362 | 362 | address, |
|
363 | 363 | nbBytes, |
|
364 | 364 | NULL); |
|
365 | 365 | } |
|
366 | 366 | |
|
367 | 367 | // SEND THE GRESB HEADER FOR THE RMAP READ COMMAND |
|
368 | 368 | RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->GRESBHeader), 4); |
|
369 | 369 | // SEND THE SPACEWIRE PACKET FOR THE RMAP READ COMMAND |
|
370 | 370 | RMAPSend_SOCKET->write((char*) ((void*) &RMAPCommand->RMAPHeader), sizeof(RMAPCommand->RMAPHeader)); |
|
371 | 371 | RMAPSend_SOCKET->waitForBytesWritten(100); |
|
372 | 372 | RMAPTimeout.start(); |
|
373 | 373 | // write timeout |
|
374 | 374 | while(RMAPSend_SOCKET->bytesToWrite() > 0) |
|
375 | 375 | { |
|
376 | 376 | RMAPSend_SOCKET->waitForBytesWritten(100); |
|
377 | 377 | if(RMAPTimeout.elapsed()>1000) |
|
378 | 378 | { |
|
379 | 379 | emit appendToLog("WARNING === in function READ of rmapplugin *** sending Read RMAP Command timeout\n"); |
|
380 | 380 | return 0; |
|
381 | 381 | } |
|
382 | 382 | } |
|
383 | 383 | |
|
384 | 384 | // RECEIVE THE INCOMING RMAP PACKET |
|
385 | 385 | errorCode = receiveSPWPacket(1); // request ID 1 is for RMAP packet |
|
386 | 386 | if (errorCode<=0) |
|
387 | 387 | { |
|
388 | 388 | emit appendToLog("WARNING === in function ReadBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode)); |
|
389 | 389 | return 0; |
|
390 | 390 | } |
|
391 | 391 | dataLength = rmapPacketSize - RMAP_READ_REPLY_HEADER_LENGTH - RMAP_DATA_CRC_LENGTH; |
|
392 | 392 | if(dataLength != nbBytes) |
|
393 | 393 | { |
|
394 | 394 | emit appendToLog("WARNING === in function READ of rmapplugin *** number of data received (" |
|
395 | 395 | +QString::number(dataLength) |
|
396 | 396 | +") not equal to number of data requested (" |
|
397 | 397 | +QString::number(nbBytes) |
|
398 | 398 | +")"); |
|
399 | 399 | return 0; |
|
400 | 400 | } |
|
401 | 401 | return dataLength; |
|
402 | 402 | } |
|
403 | 403 | |
|
404 | 404 | unsigned int gresb::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication) |
|
405 | 405 | { |
|
406 | 406 | char protocoleIdentifier = 0x02; |
|
407 | 407 | char reserved = 0x00; |
|
408 | 408 | char gresbProtocole = 0x00; |
|
409 | 409 | unsigned char size[3]; |
|
410 | 410 | unsigned int spwPacketSize = count + 4; |
|
411 | 411 | QTime SPWTimeout; |
|
412 | 412 | |
|
413 | 413 | if (count>248) |
|
414 | 414 | { |
|
415 | 415 | appendToLog("WARNING === in function WRITE of rmapplugin *** CCSDS packet size > 248 bytes\n"); |
|
416 | 416 | return 1; |
|
417 | 417 | } |
|
418 | 418 | |
|
419 | 419 | appendToLog(QString("*** START *** Send CCSDS packet of ")+ QString::number(count) + QString(" byte(s)")); |
|
420 | 420 | |
|
421 | 421 | if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 1) |
|
422 | 422 | { |
|
423 | 423 | this->Close(); |
|
424 | 424 | appendToLog("WARNING === in function WRITE of rmapplugin *** SPW link not running\n"); |
|
425 | 425 | return 1; |
|
426 | 426 | } |
|
427 | 427 | |
|
428 | 428 | // SEND GRESB HEADER |
|
429 | 429 | size[0] = (unsigned char) ((unsigned int) spwPacketSize>>16); |
|
430 | 430 | size[1] = (unsigned char) ((unsigned int) spwPacketSize>>8); |
|
431 | 431 | size[2] = (unsigned char) ((unsigned int) spwPacketSize); |
|
432 | 432 | RMAPSend_SOCKET->write(&gresbProtocole, 1); |
|
433 | 433 | RMAPSend_SOCKET->write((char*) size, 3); |
|
434 | 434 | // SEND SPW HEADER |
|
435 | 435 | RMAPSend_SOCKET->write(&targetLogicalAddress, 1); |
|
436 | 436 | RMAPSend_SOCKET->write(&protocoleIdentifier, 1); |
|
437 | 437 | RMAPSend_SOCKET->write(&reserved, 1); |
|
438 | 438 | RMAPSend_SOCKET->write(&userApplication, 1); |
|
439 | 439 | // SEND CCSDS PACKET |
|
440 | 440 | RMAPSend_SOCKET->write(Value, count); |
|
441 | 441 | SPWTimeout.start(); |
|
442 | 442 | while(RMAPSend_SOCKET->bytesToWrite() > 0) |
|
443 | 443 | { |
|
444 | 444 | RMAPSend_SOCKET->waitForBytesWritten(100); |
|
445 | 445 | if(SPWTimeout.elapsed()>1000) |
|
446 | 446 | { |
|
447 | 447 | appendToLog("WARNING === in function WRITE of rmapplugin *** sending CCSDS packet timeout\n"); |
|
448 | 448 | return 1; |
|
449 | 449 | } |
|
450 | 450 | } |
|
451 | 451 | |
|
452 | 452 | appendToLog(QString("*** CCSDS packet sent")); |
|
453 | 453 | |
|
454 | 454 | return count; |
|
455 | 455 | } |
|
456 | 456 | |
|
457 | 457 | int gresb::receiveSPWPacketLoop(unsigned char requestID) |
|
458 | 458 | { |
|
459 | 459 | int result = 0; |
|
460 | 460 | while (RMAPReceive_SOCKET->bytesAvailable()) |
|
461 | 461 | { |
|
462 | 462 | result = receiveSPWPacket(requestID); |
|
463 | 463 | } |
|
464 | if (!ccsdsPacketStore.isEmpty()) | |
|
465 | { | |
|
466 | emit packetStoreNotEmpty(); | |
|
467 | } | |
|
464 | ||
|
468 | 465 | return result; |
|
469 | 466 | } |
|
470 | 467 | |
|
471 | 468 | int gresb::receiveSPWPacket(unsigned char requestID) // SLOT |
|
472 | 469 | { |
|
473 | 470 | QTime spwPacketReceiverTimeout; |
|
474 | 471 | // GRESB HEADER |
|
475 | 472 | char RES_TR_EP; // 6 bits REserved + 1 bit TRuncated + 1 bit EP error end of packet |
|
476 | 473 | unsigned char packetLength2; |
|
477 | 474 | unsigned char packetLength1; |
|
478 | 475 | unsigned char packetLength0; |
|
479 | 476 | unsigned int packetLength; |
|
480 | 477 | |
|
481 | 478 | if (requestID==1) |
|
482 | 479 | { |
|
483 | 480 | if (rmapPacketSEMAPHORE->available()) return rmapPacketSize; |
|
484 | 481 | } |
|
485 | 482 | |
|
486 | 483 | RMAPReceive_SOCKET->blockSignals(1); // block the signals of the socket during packet reception |
|
487 | 484 | // READ THE GRESB HEADER OF THE INCOMING PACKET |
|
488 | 485 | spwPacketReceiverTimeout.start(); |
|
489 | 486 | while(RMAPReceive_SOCKET->bytesAvailable() < 4) |
|
490 | 487 | { |
|
491 | 488 | RMAPReceive_SOCKET->waitForReadyRead(100); |
|
492 | 489 | if(spwPacketReceiverTimeout.elapsed()>1000) return -1; // ERROR === read GRSEB header TIMEOUT |
|
493 | 490 | } |
|
494 | 491 | RMAPReceive_SOCKET->read(&RES_TR_EP, 1); |
|
495 | 492 | RMAPReceive_SOCKET->read( (char*) &packetLength2, 1); |
|
496 | 493 | RMAPReceive_SOCKET->read( (char*) &packetLength1, 1); |
|
497 | 494 | RMAPReceive_SOCKET->read( (char*) &packetLength0, 1); |
|
498 | 495 | packetLength = (packetLength2<<16) + (packetLength1<<8) + (packetLength0); |
|
499 | 496 | |
|
500 | 497 | // READ THE SPW PACKET |
|
501 | 498 | while(RMAPReceive_SOCKET->bytesAvailable() < packetLength) |
|
502 | 499 | { |
|
503 | 500 | RMAPReceive_SOCKET->waitForReadyRead(100); |
|
504 | 501 | if(spwPacketReceiverTimeout.elapsed()>1000) return -2; // ERROR === read SPW packet TIMEOUT |
|
505 | 502 | } |
|
506 | 503 | RMAPReceive_SOCKET->read( spwPacket, packetLength ); |
|
507 | 504 | RMAPReceive_SOCKET->blockSignals(0); |
|
508 | 505 | //emit sendMessage("Packet of size " + QString::number(packetLength) + " received"); |
|
509 | 506 | |
|
510 | 507 | switch(spwPacket[1]) // byte 1 is the protocole identifier in the SPW packet |
|
511 | 508 | { |
|
512 | 509 | case 1: // 0x01 is the protocole identifier for RMAP packets |
|
513 | 510 | if (rmapPacketSEMAPHORE->available()!=0) return -3; // ERROR === previous RMAP packet not processed yet |
|
514 | 511 | for(unsigned int i=0; i<packetLength; i++) rmapPacket[i] = spwPacket[i]; |
|
515 | 512 | rmapPacketSize = packetLength; |
|
516 | 513 | rmapPacketSEMAPHORE->release(); |
|
517 | 514 | emit sendMessage("RMAP packet of size " + QString::number(packetLength) + " received"); |
|
518 | 515 | return packetLength; |
|
519 | 516 | |
|
520 | 517 | case 2: // 0x02 is the protocole identifier for CCSDS packets |
|
521 | 518 | /*if (ccsdsPacketSEMAPHORE->available()!=0) |
|
522 | 519 | { |
|
523 | 520 | emit sendMessage("in function [receiveSPWPacket] === ERROR === previous CCSDS packet not processed yet"); |
|
524 | 521 | return -4; // ERROR === previous CCSDS packet not processed yet |
|
525 | 522 | }*/ |
|
526 | 523 | for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i]; |
|
527 | 524 | ccsdsPacketSize = packetLength; |
|
528 | 525 | storeCCSDSPacket(ccsdsPacket, packetLength); |
|
529 | 526 | return packetLength; |
|
530 | 527 | } |
|
531 | 528 | return 0; |
|
532 | 529 | } |
|
533 | 530 | |
|
534 | 531 | unsigned int gresb::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size) |
|
535 | 532 | { |
|
536 |
TMPacketToRead * |
|
|
533 | TMPacketToRead *generalPacket; | |
|
537 | 534 | |
|
538 |
|
|
|
539 | ccsdsPacketStore.append(packet); | |
|
535 | generalPacket = new TMPacketToRead(ccsdsPacket, size); | |
|
536 | emit sendPacket(generalPacket); | |
|
540 | 537 | |
|
541 | 538 | return 1; |
|
542 | 539 | } |
|
543 | 540 | |
|
544 | 541 | void gresb::Open() // SLOT |
|
545 | 542 | { |
|
546 | 543 | bool spwRunning = true; |
|
547 | 544 | RMAPSend_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()), |
|
548 | 545 | 3000 + gresbVirtualLinkSpinBox->value()*2, |
|
549 | 546 | QIODevice::WriteOnly); |
|
550 | 547 | RMAPReceive_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()), |
|
551 | 548 | 3000 + gresbVirtualLinkSpinBox->value()*2+1, |
|
552 | 549 | QIODevice::ReadOnly); |
|
553 | 550 | GRESBStatusQuery_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()), |
|
554 | 551 | 3010, |
|
555 | 552 | QIODevice::ReadWrite); |
|
556 | 553 | GRESBStatusQuery_SOCKET->waitForConnected(10000); |
|
557 | 554 | // initialize SPW packet semaphores |
|
558 | 555 | while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire(); |
|
559 | 556 | while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire(); |
|
560 | 557 | if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) != 0) |
|
561 | 558 | { |
|
562 | 559 | spwRunning = gresbStatusQueryDialog->exec(); |
|
563 | 560 | } |
|
564 | 561 | if (spwRunning == false) this->Close(); |
|
565 | 562 | else |
|
566 | 563 | { |
|
567 | 564 | emit appendToLog(QString("SpaceWire running on link ")+ QString::number(spwLinkSpinBox->value())); |
|
568 | 565 | RMAPReceive_SOCKET->readAll(); // read all remaining data from the reception socket |
|
569 | 566 | emit isOpen(true); |
|
570 | 567 | } |
|
571 | 568 | } |
|
572 | 569 | |
|
573 | 570 | void gresb::Close() // SLOT |
|
574 | 571 | { |
|
575 | 572 | RMAPSend_SOCKET->disconnectFromHost(); |
|
576 | 573 | RMAPReceive_SOCKET->disconnectFromHost(); |
|
577 | 574 | GRESBStatusQuery_SOCKET->disconnectFromHost(); |
|
578 | 575 | emit isOpen(false); |
|
579 | 576 | } |
|
580 | 577 | |
|
581 | 578 | int gresb::GRESBStatusQuery() // SLOT |
|
582 | 579 | { |
|
583 | 580 | GRESBStatusQueryRequest(LinkStatus, 0); |
|
584 | 581 | GRESBStatusQueryRequest(LinkStatus, 1); |
|
585 | 582 | GRESBStatusQueryRequest(LinkStatus, 2); |
|
586 | 583 | GRESBStatusQueryRequest(LinkStatistics, 0); |
|
587 | 584 | GRESBStatusQueryRequest(LinkStatistics, 1); |
|
588 | 585 | GRESBStatusQueryRequest(LinkStatistics, 2); |
|
589 | 586 | return 0; |
|
590 | 587 | } |
|
591 | 588 | |
|
592 | 589 | int gresb::GRESBStatusQueryRequest(GresbStatusQueryOption option, char link) |
|
593 | 590 | { |
|
594 | 591 | gresb_status_query_t statusQueryCommand; |
|
595 | 592 | gresb_link_status_reply_t linkStatusReply; |
|
596 | 593 | gresb_link_statistics_reply_t linkStatisticsReply; |
|
597 | 594 | QTime statusQueryTimeout; |
|
598 | 595 | QString console_message; |
|
599 | 596 | |
|
600 | 597 | statusQueryCommand.protocolIdentifier = (char) 0x02; |
|
601 | 598 | statusQueryCommand.reserved1 = (char) 0x00; |
|
602 | 599 | statusQueryCommand.reserved0 = (char) 0x00; |
|
603 | 600 | statusQueryCommand.option = (char) option; |
|
604 | 601 | statusQueryCommand.value3 = (char) 0x00; |
|
605 | 602 | statusQueryCommand.value2 = (char) 0x00; |
|
606 | 603 | statusQueryCommand.value1 = (char) 0x00; |
|
607 | 604 | statusQueryCommand.value0 = (char) link; |
|
608 | 605 | |
|
609 | 606 | GRESBStatusQuery_SOCKET->write((char*) ((void*) &statusQueryCommand), sizeof(statusQueryCommand)); |
|
610 | 607 | GRESBStatusQuery_SOCKET->flush(); |
|
611 | 608 | GRESBStatusQuery_SOCKET->waitForBytesWritten(1000); |
|
612 | 609 | |
|
613 | 610 | statusQueryTimeout.start(); |
|
614 | 611 | while(GRESBStatusQuery_SOCKET->bytesToWrite() > 0) |
|
615 | 612 | { |
|
616 | 613 | GRESBStatusQuery_SOCKET->waitForBytesWritten(100); |
|
617 | 614 | if(statusQueryTimeout.elapsed()>1000) |
|
618 | 615 | { |
|
619 | 616 | emit appendToLog("WARNING === in function GRESBStatusQueryRequest of rmapplugin *** sending StatusQueryCommand timeout"); |
|
620 | 617 | return 1; |
|
621 | 618 | } |
|
622 | 619 | } |
|
623 | 620 | |
|
624 | 621 | switch (option) |
|
625 | 622 | { |
|
626 | 623 | case LinkStatus: |
|
627 | 624 | { |
|
628 | 625 | statusQueryTimeout.start(); |
|
629 | 626 | while(GRESBStatusQuery_SOCKET->bytesAvailable() < (int) sizeof(linkStatusReply)) |
|
630 | 627 | { |
|
631 | 628 | GRESBStatusQuery_SOCKET->waitForReadyRead(100); |
|
632 | 629 | if(statusQueryTimeout.elapsed()>1000) |
|
633 | 630 | { |
|
634 | 631 | console_message.sprintf("GRESBStatusQueryRequest / LinkStatus => error timeout bytesAvailable()\n"); |
|
635 | 632 | emit appendToLog(console_message); |
|
636 | 633 | return 1; |
|
637 | 634 | } |
|
638 | 635 | } |
|
639 | 636 | GRESBStatusQuery_SOCKET->read((char*) ((void*) &linkStatusReply), (int) sizeof(linkStatusReply)); |
|
640 | 637 | console_message.sprintf("%x", linkStatusReply.byte0); |
|
641 | 638 | spwLinkStatusEnquiry->statusQueryTable->item(0, link)->setText(console_message); |
|
642 | 639 | console_message.sprintf("%d", linkStatusReply.byte1); |
|
643 | 640 | spwLinkStatusEnquiry->statusQueryTable->item(1, link)->setText(console_message); |
|
644 | 641 | if (linkStatusReply.byte0 == 0) return 1; |
|
645 | 642 | break; |
|
646 | 643 | } |
|
647 | 644 | case LinkStatistics: |
|
648 | 645 | { |
|
649 | 646 | statusQueryTimeout.start(); |
|
650 | 647 | while(GRESBStatusQuery_SOCKET->bytesAvailable() < (int) sizeof(linkStatisticsReply)) |
|
651 | 648 | { |
|
652 | 649 | GRESBStatusQuery_SOCKET->waitForReadyRead(100); |
|
653 | 650 | if(statusQueryTimeout.elapsed()>1000) |
|
654 | 651 | { |
|
655 | 652 | console_message.sprintf("GRESBStatusQueryRequest / LinkStatistics => error timeout bytesAvailable()\n"); |
|
656 | 653 | emit appendToLog(console_message); |
|
657 | 654 | return 1; |
|
658 | 655 | } |
|
659 | 656 | } |
|
660 | 657 | GRESBStatusQuery_SOCKET->read((char*) ((void*) &linkStatisticsReply), sizeof(linkStatisticsReply)); |
|
661 | 658 | /*console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.sizeOfDataTransmitted)); |
|
662 | 659 | UI->spwLinkStatusEnquiry->statusQueryTable->item(9, link)->setText(console_message); |
|
663 | 660 | console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsTransmitted)); |
|
664 | 661 | UI->spwLinkStatusEnquiry->statusQueryTable->item(8, link)->setText(console_message); |
|
665 | 662 | console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfTruncatedPacketsReceived)); |
|
666 | 663 | UI->spwLinkStatusEnquiry->statusQueryTable->item(6, link)->setText(console_message); |
|
667 | 664 | console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsWithEEPReceived)); |
|
668 | 665 | UI->spwLinkStatusEnquiry->statusQueryTable->item(5, link)->setText(console_message); |
|
669 | 666 | console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.sizeOfDataReceived)); |
|
670 | 667 | UI->spwLinkStatusEnquiry->statusQueryTable->item(4, link)->setText(console_message); |
|
671 | 668 | console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsReceived)); |
|
672 | 669 | UI->spwLinkStatusEnquiry->statusQueryTable->item(3, link)->setText(console_message);*/ |
|
673 | 670 | break; |
|
674 | 671 | } |
|
675 | 672 | case NodeAddressStatistics: |
|
676 | 673 | { |
|
677 | 674 | break; |
|
678 | 675 | } |
|
679 | 676 | case GetRoute: |
|
680 | 677 | { |
|
681 | 678 | break; |
|
682 | 679 | } |
|
683 | 680 | } |
|
684 | 681 | return 0; |
|
685 | 682 | } |
|
686 | 683 | |
|
687 | 684 | void gresb::reTestSPWLink() // SLOT |
|
688 | 685 | { |
|
689 | 686 | if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 0) |
|
690 | 687 | { |
|
691 | 688 | gresbStatusQueryDialog->accept(); |
|
692 | 689 | } |
|
693 | 690 | } |
|
694 | 691 | |
|
695 | 692 | void gresb::RMAPSendConnectionState(QAbstractSocket::SocketState socketState) // SLOT |
|
696 | 693 | { |
|
697 | 694 | rmapSendStateLabel->setText(""); |
|
698 | 695 | QString socketMessage = "RMAP Send Socket State: "; |
|
699 | 696 | switch(socketState) |
|
700 | 697 | { |
|
701 | 698 | case QAbstractSocket::UnconnectedState : |
|
702 | 699 | socketMessage.append("0 => Unconnected"); |
|
703 | 700 | break; |
|
704 | 701 | case 1: |
|
705 | 702 | socketMessage.append("1 => HostLookup"); |
|
706 | 703 | break; |
|
707 | 704 | case 2: |
|
708 | 705 | socketMessage.append("2 => Connecting"); |
|
709 | 706 | break; |
|
710 | 707 | case 3: |
|
711 | 708 | socketMessage.append("3 => Connected"); |
|
712 | 709 | break; |
|
713 | 710 | case 4: |
|
714 | 711 | socketMessage.append("4 => Bound"); |
|
715 | 712 | break; |
|
716 | 713 | case 5: |
|
717 | 714 | socketMessage.append("5 => Closing"); |
|
718 | 715 | break; |
|
719 | 716 | case 6: |
|
720 | 717 | socketMessage.append("6 => Listening"); |
|
721 | 718 | break; |
|
722 | 719 | } |
|
723 | 720 | rmapSendStateLabel->setText(socketMessage); |
|
724 | 721 | emit appendToLog(socketMessage); |
|
725 | 722 | } |
|
726 | 723 | |
|
727 | 724 | void gresb::RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState) // SLOT |
|
728 | 725 | { |
|
729 | 726 | rmapReceiveStateLabel->setText(""); |
|
730 | 727 | QString socketMessage = "RMAP Receive Socket State: "; |
|
731 | 728 | switch(socketState) |
|
732 | 729 | { |
|
733 | 730 | case QAbstractSocket::UnconnectedState : |
|
734 | 731 | socketMessage.append("0 => Unconnected"); |
|
735 | 732 | break; |
|
736 | 733 | case 1: |
|
737 | 734 | socketMessage.append("1 => HostLookup"); |
|
738 | 735 | break; |
|
739 | 736 | case 2: |
|
740 | 737 | socketMessage.append("2 => Connecting"); |
|
741 | 738 | break; |
|
742 | 739 | case 3: |
|
743 | 740 | socketMessage.append("3 => Connected"); |
|
744 | 741 | break; |
|
745 | 742 | case 4: |
|
746 | 743 | socketMessage.append("4 => Bound"); |
|
747 | 744 | break; |
|
748 | 745 | case 5: |
|
749 | 746 | socketMessage.append("5 => Closing"); |
|
750 | 747 | break; |
|
751 | 748 | case 6: |
|
752 | 749 | socketMessage.append("6 => Listening"); |
|
753 | 750 | break; |
|
754 | 751 | } |
|
755 | 752 | rmapReceiveStateLabel->setText(socketMessage); |
|
756 | 753 | emit appendToLog(socketMessage); |
|
757 | 754 | } |
|
758 | 755 | |
|
759 | 756 | void gresb::GRESBConnectionState(QAbstractSocket::SocketState socketState) // SLOT |
|
760 | 757 | { |
|
761 | 758 | gresbStatusQueryLabel->setText(""); |
|
762 | 759 | QString socketMessage = "GRESB status query socket (port 3010): "; |
|
763 | 760 | switch(socketState) |
|
764 | 761 | { |
|
765 | 762 | case QAbstractSocket::UnconnectedState : |
|
766 | 763 | socketMessage.append("0 => Unconnected"); |
|
767 | 764 | break; |
|
768 | 765 | case 1: |
|
769 | 766 | socketMessage.append("1 => HostLookup"); |
|
770 | 767 | break; |
|
771 | 768 | case 2: |
|
772 | 769 | socketMessage.append("2 => Connecting"); |
|
773 | 770 | break; |
|
774 | 771 | case 3: |
|
775 | 772 | socketMessage.append("3 => Connected"); |
|
776 | 773 | break; |
|
777 | 774 | case 4: |
|
778 | 775 | socketMessage.append("4 => Bound"); |
|
779 | 776 | break; |
|
780 | 777 | case 5: |
|
781 | 778 | socketMessage.append("5 => Closing"); |
|
782 | 779 | break; |
|
783 | 780 | case 6: |
|
784 | 781 | socketMessage.append("6 => Listening"); |
|
785 | 782 | break; |
|
786 | 783 | } |
|
787 | 784 | gresbStatusQueryLabel->setText(socketMessage); |
|
788 | 785 | } |
|
789 | 786 |
@@ -1,110 +1,108 | |||
|
1 | 1 | #ifndef GRESB_H |
|
2 | 2 | #define GRESB_H |
|
3 | 3 | |
|
4 | 4 | #include <QWidget> |
|
5 | 5 | #include <QLabel> |
|
6 | 6 | #include <QPushButton> |
|
7 | 7 | #include <QSpinBox> |
|
8 | 8 | #include <QGridLayout> |
|
9 | 9 | #include <QTcpSocket> |
|
10 | 10 | #include <QDialog> |
|
11 | 11 | #include <QSemaphore> |
|
12 | 12 | |
|
13 | 13 | #include "gresbstatusenquiry.h" |
|
14 | 14 | #include "rmapoperations.h" |
|
15 | 15 | #include "qipdialogbox.h" |
|
16 | 16 | #include "ccsds.h" |
|
17 | 17 | #include "tmpackettoread.h" |
|
18 | 18 | |
|
19 | 19 | class gresb : public QWidget |
|
20 | 20 | { |
|
21 | 21 | Q_OBJECT |
|
22 | 22 | public: |
|
23 | 23 | explicit gresb(QWidget *parent = 0); |
|
24 | 24 | ~gresb(); |
|
25 | 25 | unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0); |
|
26 | 26 | unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0); |
|
27 | 27 | unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication); |
|
28 | 28 | |
|
29 | 29 | unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size); |
|
30 | QList<TMPacketToRead*> ccsdsPacketStore; | |
|
31 | 30 | |
|
32 | 31 | signals: |
|
33 | 32 | void sendMessage(QString message); |
|
33 | void sendPacket(TMPacketToRead*); | |
|
34 | 34 | void isOpen(bool); |
|
35 | 35 | void RMAP_write_reply_setText(QString); |
|
36 | 36 | void appendToLog(QString); |
|
37 | void ccsdsPacketAvailable(unsigned char*, unsigned int); | |
|
38 | void packetStoreNotEmpty(); | |
|
39 | 37 | |
|
40 | 38 | public slots: |
|
41 | 39 | void Open(); |
|
42 | 40 | void Close(); |
|
43 | 41 | int receiveSPWPacketLoop(unsigned char requestID=0); |
|
44 | 42 | int receiveSPWPacket(unsigned char requestID=0); |
|
45 | 43 | void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;} |
|
46 | 44 | void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;} |
|
47 | 45 | void sourceHasChanged(int source) {rmapSourceLogicalAddress = (unsigned char) source;} |
|
48 | 46 | void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();} |
|
49 | 47 | void reTestSPWLink(); |
|
50 | 48 | // |
|
51 | 49 | void RMAPSendConnectionState(QAbstractSocket::SocketState socketState); |
|
52 | 50 | void RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState); |
|
53 | 51 | void GRESBConnectionState(QAbstractSocket::SocketState socketState); |
|
54 | 52 | // |
|
55 | 53 | void setIP(unsigned char address1, unsigned char address2, unsigned char address3, unsigned char address4) |
|
56 | 54 | {this->gresbBridgeIPDialogBox->setIP(address1, address2, address3, address4);} |
|
57 | 55 | |
|
58 | 56 | private slots: |
|
59 | 57 | int GRESBStatusQuery(); |
|
60 | 58 | |
|
61 | 59 | private: |
|
62 | 60 | unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0); |
|
63 | 61 | unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0); |
|
64 | 62 | void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->tryAcquire();} |
|
65 | 63 | void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->tryAcquire();} |
|
66 | 64 | int GRESBStatusQueryRequest(GresbStatusQueryOption option, char link); |
|
67 | 65 | |
|
68 | 66 | unsigned char rmapTargetLogicalAddress ; |
|
69 | 67 | unsigned char rmapSourceLogicalAddress ; |
|
70 | 68 | |
|
71 | 69 | RMAP_command_codes commandCode; |
|
72 | 70 | |
|
73 | 71 | QPushButton *gresbStatusQueryRetryButton; |
|
74 | 72 | QPushButton *gresbStatusQueryAbortButton; |
|
75 | 73 | |
|
76 | 74 | QLabel *gresbBridgeIPLabel; |
|
77 | 75 | QLabel *gresbVirtualLinkLabel; |
|
78 | 76 | QLabel *spwLinkLabel; |
|
79 | 77 | QLabel *rmapSendStateLabel; |
|
80 | 78 | QLabel *rmapReceiveStateLabel; |
|
81 | 79 | QLabel *gresbStatusQueryLabel; |
|
82 | 80 | QLabel *gresbStatusQueryDialogLabel; |
|
83 | 81 | |
|
84 | 82 | QDialog *gresbStatusQueryDialog; |
|
85 | 83 | |
|
86 | 84 | QIPDialogBox* gresbBridgeIPDialogBox; |
|
87 | 85 | |
|
88 | 86 | QSpinBox *gresbVirtualLinkSpinBox; |
|
89 | 87 | QSpinBox *spwLinkSpinBox; |
|
90 | 88 | |
|
91 | 89 | QGridLayout *connectionLayout; |
|
92 | 90 | QGridLayout *gresbStatusQueryDialogLayout; |
|
93 | 91 | |
|
94 | 92 | QTcpSocket *RMAPSend_SOCKET; |
|
95 | 93 | QTcpSocket *RMAPReceive_SOCKET; |
|
96 | 94 | QTcpSocket *GRESBStatusQuery_SOCKET; |
|
97 | 95 | |
|
98 | 96 | gresbStatusEnquiry* spwLinkStatusEnquiry; |
|
99 | 97 | |
|
100 | 98 | // Packet receiver |
|
101 | 99 | QSemaphore *rmapPacketSEMAPHORE; |
|
102 | 100 | QSemaphore *ccsdsPacketSEMAPHORE; |
|
103 | 101 | char* rmapPacket; // The buffer to receive RMAP READ packets |
|
104 | 102 | unsigned char *ccsdsPacket; |
|
105 | 103 | char *spwPacket; |
|
106 | 104 | unsigned int rmapPacketSize; |
|
107 | 105 | unsigned int ccsdsPacketSize; |
|
108 | 106 | }; |
|
109 | 107 | |
|
110 | 108 | #endif // GRESB_H |
@@ -1,96 +1,96 | |||
|
1 | 1 | #include "rmapoperations.h" |
|
2 | 2 | |
|
3 | 3 | RMAP::RMAP(RMAP_command_codes commandCode, unsigned char targetLogicalAddress, unsigned char initiatorLogicalAddress, |
|
4 | 4 | int startAddress, int nbBytes, char* data) |
|
5 | 5 | { |
|
6 | 6 | char packetType; // 2 most Significant Bits |
|
7 | 7 | char command; // 4 bits |
|
8 | 8 | char replyAddressLength; // 2 Least Significant Bits |
|
9 | 9 | int SPWPacketSize; |
|
10 | 10 | |
|
11 | 11 | // GRESB HEADER |
|
12 | 12 | if (data == NULL){ |
|
13 | 13 | SPWPacketSize = sizeof(RMAPHeader) ; |
|
14 | 14 | dataCRC = 0x00; |
|
15 | 15 | } |
|
16 | 16 | else{ |
|
17 | 17 | SPWPacketSize = sizeof(RMAPHeader) + nbBytes + 1 ; // SPW Packet = Header + Data + dataCRC |
|
18 | 18 | dataCRC = RMAPCalculateDataCRC(data, nbBytes); |
|
19 | 19 | } |
|
20 | 20 | GRESBHeader.GRESBProtocoleID = 0x00; // packets with protocole ID 0 have a SpaceWire packet as payload |
|
21 | 21 | GRESBHeader.SPWPacketSize2 = (SPWPacketSize>>16); |
|
22 | 22 | GRESBHeader.SPWPacketSize1 = (SPWPacketSize>>8); |
|
23 | 23 | GRESBHeader.SPWPacketSize0 = (SPWPacketSize); |
|
24 | 24 | |
|
25 | 25 | // SPACEWIRE HEADER |
|
26 | 26 | packetType = (char) 0b01; // 0b01 for a command, 0b00 for a reply |
|
27 | 27 | command = (char) commandCode; |
|
28 | 28 | replyAddressLength = (char) 0b00; // RMAP command: number of bytes in the reply address field |
|
29 | 29 | // RMAP reply: copy of the reply address field of the command |
|
30 | 30 | switch (commandCode){ |
|
31 | 31 | case writeSingle_noVer_noRep: |
|
32 | 32 | case writeSingle_noVer_Rep: |
|
33 | 33 | case writeSingle_ver_noRep: |
|
34 | 34 | case writeSingle_ver_rep: |
|
35 | 35 | if (nbBytes > 4) command = command + 1; // switch between Single and Incremental Read/Write operations |
|
36 | 36 | break; |
|
37 | 37 | default: |
|
38 | 38 | break; |
|
39 | 39 | } |
|
40 | 40 |
RMAPHeader.targetLogicalAddress = targetLogicalAddress |
|
41 | 41 | RMAPHeader.protocolIdentifier = 0x01; // 0x01 is the protocole identifier for RMAP |
|
42 | 42 | RMAPHeader.instruction = (packetType<<6) + (command<<2) + (replyAddressLength); |
|
43 |
RMAPHeader.key = |
|
|
43 | RMAPHeader.key = DEFAULT_DESTINATION_KEY; // used for command authorization | |
|
44 | 44 | RMAPHeader.initiatorLogicalAddress = initiatorLogicalAddress; // 0 is the default address for the GRESB module |
|
45 | 45 | RMAPHeader.transactionIdentifier1 = 0x00; |
|
46 | 46 | RMAPHeader.transactionIdentifier0 = 0x01; |
|
47 | 47 | RMAPHeader.extendedAddress = 0x00; |
|
48 | 48 | RMAPHeader.address3 = (char) (startAddress>>24); |
|
49 | 49 | RMAPHeader.address2 = (char) (startAddress>>16); |
|
50 | 50 | RMAPHeader.address1 = (char) (startAddress>>8); |
|
51 | 51 | RMAPHeader.address0 = (char) (startAddress); |
|
52 | 52 | RMAPHeader.dataLength2 = (char) (nbBytes>>16); |
|
53 | 53 | RMAPHeader.dataLength1 = (char) (nbBytes>>8); |
|
54 | 54 | RMAPHeader.dataLength0 = (char) (nbBytes); |
|
55 | 55 | RMAPHeader.headerCRC = RMAPCalculateHeaderCRC(); |
|
56 | 56 | } |
|
57 | 57 | |
|
58 | 58 | unsigned char RMAP::RMAPCalculateCRC(unsigned char INCR, unsigned char INBYTE) |
|
59 | 59 | { |
|
60 | 60 | return RMAP_CRCTable[INCR ^ INBYTE]; |
|
61 | 61 | } |
|
62 | 62 | |
|
63 | 63 | unsigned char RMAP::RMAPCalculateHeaderCRC() |
|
64 | 64 | { |
|
65 | 65 | unsigned char INCR = 0; |
|
66 | 66 | |
|
67 | 67 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.targetLogicalAddress); |
|
68 | 68 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.protocolIdentifier); |
|
69 | 69 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.instruction); |
|
70 | 70 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.key); |
|
71 | 71 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.initiatorLogicalAddress); |
|
72 | 72 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.transactionIdentifier1); |
|
73 | 73 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.transactionIdentifier0); |
|
74 | 74 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.extendedAddress); |
|
75 | 75 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.address3); |
|
76 | 76 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.address2); |
|
77 | 77 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.address1); |
|
78 | 78 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.address0); |
|
79 | 79 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.dataLength2); |
|
80 | 80 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.dataLength1); |
|
81 | 81 | INCR = RMAPCalculateCRC(INCR, RMAPHeader.dataLength0); |
|
82 | 82 | |
|
83 | 83 | return(INCR); |
|
84 | 84 | } |
|
85 | 85 | |
|
86 | 86 | unsigned char RMAP::RMAPCalculateDataCRC(char *data, int nbBytes) |
|
87 | 87 | { |
|
88 | 88 | unsigned char INCR = 0; |
|
89 | 89 | |
|
90 | 90 | for (int k=0; k<nbBytes; k++) |
|
91 | 91 | { |
|
92 | 92 | INCR = RMAPCalculateCRC(INCR, data[k]); |
|
93 | 93 | } |
|
94 | 94 | |
|
95 | 95 | return(INCR); |
|
96 | 96 | } |
@@ -1,150 +1,151 | |||
|
1 | 1 | #ifndef RMAPOPERATIONS_H |
|
2 | 2 | #define RMAPOPERATIONS_H |
|
3 | 3 | |
|
4 | 4 | #include "qhexspinbox.h" |
|
5 | 5 | |
|
6 | 6 | #define READ_WRITE_MAX_COUNTS 4096 // in words |
|
7 | 7 | #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 |
|
8 | 8 | #define RMAP_READ_REPLY_HEADER_LENGTH 12 // in bytes => ECSS |
|
9 | 9 | #define RMAP_READ_COMMAND_HEADER_LENGTH 16 // in bytes => ECSS |
|
10 | 10 | #define RMAP_DATA_CRC_LENGTH 1 // in bytes => ECSS |
|
11 | 11 | #define RMAP_MAX_PACKET_LENGTH RMAP_READ_REPLY_HEADER_LENGTH + RMAP_MAX_DATA_LENGTH + RMAP_DATA_CRC_LENGTH |
|
12 | 12 | |
|
13 | #define DEFAULT_DESTINATION_KEY 2 | |
|
13 | 14 | #define DEFAULT_SOURCE 0 |
|
14 | 15 | #define DEFAULT_TARGET 254 |
|
15 | 16 | |
|
16 | 17 | static const unsigned char RMAP_CRCTable[] = { |
|
17 | 18 | 0x00, 0x91, 0xe3, 0x72, 0x07, 0x96, 0xe4, 0x75, |
|
18 | 19 | 0x0e, 0x9f, 0xed, 0x7c, 0x09, 0x98, 0xea, 0x7b, |
|
19 | 20 | 0x1c, 0x8d, 0xff, 0x6e, 0x1b, 0x8a, 0xf8, 0x69, |
|
20 | 21 | 0x12, 0x83, 0xf1, 0x60, 0x15, 0x84, 0xf6, 0x67, |
|
21 | 22 | 0x38, 0xa9, 0xdb, 0x4a, 0x3f, 0xae, 0xdc, 0x4d, |
|
22 | 23 | 0x36, 0xa7, 0xd5, 0x44, 0x31, 0xa0, 0xd2, 0x43, |
|
23 | 24 | 0x24, 0xb5, 0xc7, 0x56, 0x23, 0xb2, 0xc0, 0x51, |
|
24 | 25 | 0x2a, 0xbb, 0xc9, 0x58, 0x2d, 0xbc, 0xce, 0x5f, |
|
25 | 26 | 0x70, 0xe1, 0x93, 0x02, 0x77, 0xe6, 0x94, 0x05, |
|
26 | 27 | 0x7e, 0xef, 0x9d, 0x0c, 0x79, 0xe8, 0x9a, 0x0b, |
|
27 | 28 | 0x6c, 0xfd, 0x8f, 0x1e, 0x6b, 0xfa, 0x88, 0x19, |
|
28 | 29 | 0x62, 0xf3, 0x81, 0x10, 0x65, 0xf4, 0x86, 0x17, |
|
29 | 30 | 0x48, 0xd9, 0xab, 0x3a, 0x4f, 0xde, 0xac, 0x3d, |
|
30 | 31 | 0x46, 0xd7, 0xa5, 0x34, 0x41, 0xd0, 0xa2, 0x33, |
|
31 | 32 | 0x54, 0xc5, 0xb7, 0x26, 0x53, 0xc2, 0xb0, 0x21, |
|
32 | 33 | 0x5a, 0xcb, 0xb9, 0x28, 0x5d, 0xcc, 0xbe, 0x2f, |
|
33 | 34 | 0xe0, 0x71, 0x03, 0x92, 0xe7, 0x76, 0x04, 0x95, |
|
34 | 35 | 0xee, 0x7f, 0x0d, 0x9c, 0xe9, 0x78, 0x0a, 0x9b, |
|
35 | 36 | 0xfc, 0x6d, 0x1f, 0x8e, 0xfb, 0x6a, 0x18, 0x89, |
|
36 | 37 | 0xf2, 0x63, 0x11, 0x80, 0xf5, 0x64, 0x16, 0x87, |
|
37 | 38 | 0xd8, 0x49, 0x3b, 0xaa, 0xdf, 0x4e, 0x3c, 0xad, |
|
38 | 39 | 0xd6, 0x47, 0x35, 0xa4, 0xd1, 0x40, 0x32, 0xa3, |
|
39 | 40 | 0xc4, 0x55, 0x27, 0xb6, 0xc3, 0x52, 0x20, 0xb1, |
|
40 | 41 | 0xca, 0x5b, 0x29, 0xb8, 0xcd, 0x5c, 0x2e, 0xbf, |
|
41 | 42 | 0x90, 0x01, 0x73, 0xe2, 0x97, 0x06, 0x74, 0xe5, |
|
42 | 43 | 0x9e, 0x0f, 0x7d, 0xec, 0x99, 0x08, 0x7a, 0xeb, |
|
43 | 44 | 0x8c, 0x1d, 0x6f, 0xfe, 0x8b, 0x1a, 0x68, 0xf9, |
|
44 | 45 | 0x82, 0x13, 0x61, 0xf0, 0x85, 0x14, 0x66, 0xf7, |
|
45 | 46 | 0xa8, 0x39, 0x4b, 0xda, 0xaf, 0x3e, 0x4c, 0xdd, |
|
46 | 47 | 0xa6, 0x37, 0x45, 0xd4, 0xa1, 0x30, 0x42, 0xd3, |
|
47 | 48 | 0xb4, 0x25, 0x57, 0xc6, 0xb3, 0x22, 0x50, 0xc1, |
|
48 | 49 | 0xba, 0x2b, 0x59, 0xc8, 0xbd, 0x2c, 0x5e, 0xcf |
|
49 | 50 | }; |
|
50 | 51 | |
|
51 | 52 | enum RMAP_command_codes{ |
|
52 | 53 | invalid0, //0000 |
|
53 | 54 | invalid1, //0001 |
|
54 | 55 | read_Single, //0010 |
|
55 | 56 | read_Inc, //0011 |
|
56 | 57 | invalid2, //0100 |
|
57 | 58 | invalid3, //0101 |
|
58 | 59 | invalid4, //0110 |
|
59 | 60 | readModWri_Inc, //0111 |
|
60 | 61 | writeSingle_noVer_noRep, //1000 |
|
61 | 62 | writeInc_noVer_noRep, //1001 |
|
62 | 63 | writeSingle_noVer_Rep, //1010 |
|
63 | 64 | writeInc_noVer_Rep, //1011 |
|
64 | 65 | writeSingle_ver_noRep, //1100 |
|
65 | 66 | writeInc_ver_noRep, //1101 |
|
66 | 67 | writeSingle_ver_rep, //1110 |
|
67 | 68 | writeInc_ver_rep //1111 |
|
68 | 69 | }; |
|
69 | 70 | |
|
70 | 71 | struct rmap_command_format_str |
|
71 | 72 | { |
|
72 | 73 | // char tagetSpaceWireAddress[]; // used for path addressing or regional addressing |
|
73 | 74 | char targetLogicalAddress; |
|
74 | 75 | char protocolIdentifier; |
|
75 | 76 | char instruction; |
|
76 | 77 | unsigned char key; // used for command authorization => check Gaisler GRSPW for compliance |
|
77 | 78 | //char replyAddress[]; // not needed if logical addressing is used (replyAddressLength = 0b00) |
|
78 | 79 | unsigned char initiatorLogicalAddress; |
|
79 | 80 | char transactionIdentifier1; |
|
80 | 81 | char transactionIdentifier0; |
|
81 | 82 | char extendedAddress; |
|
82 | 83 | char address3; |
|
83 | 84 | char address2; |
|
84 | 85 | char address1; |
|
85 | 86 | char address0; |
|
86 | 87 | unsigned char dataLength2; |
|
87 | 88 | unsigned char dataLength1; |
|
88 | 89 | unsigned char dataLength0; |
|
89 | 90 | char headerCRC; |
|
90 | 91 | }; |
|
91 | 92 | typedef struct rmap_command_format_str rmap_command_format_t; |
|
92 | 93 | |
|
93 | 94 | struct rmap_write_reply_str |
|
94 | 95 | { |
|
95 | 96 | unsigned char initiatorLogicalAddress; |
|
96 | 97 | unsigned char protocolIdentifier; |
|
97 | 98 | unsigned char instruction; |
|
98 | 99 | unsigned char status; |
|
99 | 100 | unsigned char targetLogicalAddress; |
|
100 | 101 | unsigned char transactionIdentifier1; |
|
101 | 102 | unsigned char transactionIdentifier2; |
|
102 | 103 | unsigned char headerCRC; |
|
103 | 104 | }; |
|
104 | 105 | typedef struct rmap_write_reply_str rmap_write_reply_t; |
|
105 | 106 | |
|
106 | 107 | struct rmap_read_reply_PcktHdr_str |
|
107 | 108 | { |
|
108 | 109 | //char replyAddress[]; // not needed if logical addressing is used |
|
109 | 110 | char initiatorLogicalAddress; |
|
110 | 111 | char protocolIdentifier; |
|
111 | 112 | char instruction; |
|
112 | 113 | char status; |
|
113 | 114 | char targetLogicalAddress; |
|
114 | 115 | char transactionIdentifier1; |
|
115 | 116 | char transactionIdentifier0; |
|
116 | 117 | char reserved; |
|
117 | 118 | unsigned char dataLength2; |
|
118 | 119 | unsigned char dataLength1; |
|
119 | 120 | unsigned char dataLength0; |
|
120 | 121 | char headerCRC; |
|
121 | 122 | }; |
|
122 | 123 | typedef struct rmap_read_reply_PcktHdr_str rmap_read_reply_PcktHdr_t; |
|
123 | 124 | |
|
124 | 125 | struct rmap_gresb_header_str |
|
125 | 126 | { |
|
126 | 127 | char GRESBProtocoleID; |
|
127 | 128 | unsigned char SPWPacketSize2; |
|
128 | 129 | unsigned char SPWPacketSize1; |
|
129 | 130 | unsigned char SPWPacketSize0; |
|
130 | 131 | }; |
|
131 | 132 | typedef struct rmap_gresb_header_str rmap_gresb_header_str; |
|
132 | 133 | |
|
133 | 134 | class RMAP |
|
134 | 135 | { |
|
135 | 136 | public: |
|
136 | 137 | RMAP(RMAP_command_codes commandCode, |
|
137 | 138 | unsigned char targetLogicalAddress, |
|
138 | 139 | unsigned char initiatorLogicalAddress, |
|
139 | 140 | int startAddress, |
|
140 | 141 | int nbBytes, |
|
141 | 142 | char *data); |
|
142 | 143 | unsigned char RMAPCalculateCRC(unsigned char INCR, unsigned char INBYTE); // ECSS-E-ST-50-52C |
|
143 | 144 | unsigned char RMAPCalculateHeaderCRC(); |
|
144 | 145 | unsigned char RMAPCalculateDataCRC(char *data, int nbBytes); |
|
145 | 146 | rmap_gresb_header_str GRESBHeader; |
|
146 | 147 | rmap_command_format_t RMAPHeader; |
|
147 | 148 | char dataCRC; |
|
148 | 149 | }; |
|
149 | 150 | |
|
150 | 151 | #endif // RMAPOPERATIONS_H |
@@ -1,416 +1,459 | |||
|
1 | 1 | /*------------------------------------------------------------------------------ |
|
2 | 2 | -- This file is a part of the LPPMON Software |
|
3 | 3 | -- Copyright (C) 2012, Laboratory of Plasma Physics - CNRS |
|
4 | 4 | -- |
|
5 | 5 | -- This program is free software; you can redistribute it and/or modify |
|
6 | 6 | -- it under the terms of the GNU General Public License as published by |
|
7 | 7 | -- the Free Software Foundation; either version 3 of the License, or |
|
8 | 8 | -- (at your option) any later version. |
|
9 | 9 | -- |
|
10 | 10 | -- This program is distributed in the hope that it will be useful, |
|
11 | 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 | 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 | 13 | -- GNU General Public License for more details. |
|
14 | 14 | -- |
|
15 | 15 | -- You should have received a copy of the GNU General Public License |
|
16 | 16 | -- along with this program; if not, write to the Free Software |
|
17 | 17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
18 | 18 | -------------------------------------------------------------------------------*/ |
|
19 | 19 | /*-- Author : Paul LEROY |
|
20 | 20 | -- Mail : paul.leroy@lpp.polytechnique.fr |
|
21 | 21 | ----------------------------------------------------------------------------*/ |
|
22 | 22 | #include "rmapplugin.h" |
|
23 | 23 | #include <QHostAddress> |
|
24 | 24 | #include <QIODevice> |
|
25 | 25 | #include <QApplication> |
|
26 | 26 | #include <rmappluginpythonwrapper.h> |
|
27 | 27 | #include <PythonQt.h> |
|
28 | 28 | #include <QTimer> |
|
29 | 29 | |
|
30 | 30 | rmapplugin::rmapplugin(QWidget *parent) |
|
31 | 31 | :lppmonplugin(parent,false) |
|
32 | 32 | { |
|
33 | 33 | this->UI = new rmapPluginUI(); |
|
34 | 34 | this->setWindowTitle(tr("RMAP and SPW Communication")); |
|
35 | 35 | this->setWidget((QWidget*)this->UI); |
|
36 | 36 | |
|
37 | 37 | timeCode = 0; |
|
38 | 38 | time_COARSE = 0; |
|
39 | 39 | time_FINE = 0; |
|
40 | 40 | currentBridge = selectedBridgeIsUnknown; |
|
41 | 41 | |
|
42 | 42 | //************** |
|
43 | 43 | //Python wrapper |
|
44 | 44 | this->pyObject = new rmappluginPythonWrapper(); |
|
45 | 45 | connect(this->pyObject,SIGNAL(ReadSig(uint*,uint,uint)),this,SLOT(Read(uint*,uint,uint))); |
|
46 | 46 | connect(this->pyObject,SIGNAL(WriteSig(uint*,uint,uint)),this,SLOT(Write(uint*,uint,uint))); |
|
47 | 47 | //** |
|
48 | 48 | connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL( WriteSPWSig(char*,uint,char,char) ), |
|
49 | 49 | this, SLOT( WriteSPW(char*,uint,char,char)), Qt::DirectConnection ); |
|
50 | 50 | //** |
|
51 | 51 | connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL( updateTargetAddress(unsigned char) ), |
|
52 | 52 | this, SLOT( setValueTargetAddress(unsigned char)) ); |
|
53 | 53 | //** |
|
54 | 54 | connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL( updateSourceAddress(unsigned char) ), |
|
55 | 55 | this, SLOT( setValueSourceAddress(unsigned char)) ); |
|
56 | 56 | //** |
|
57 | 57 | connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sendMessage(QString)), |
|
58 | 58 | this, SLOT(displayOnConsole(QString)) ); |
|
59 | 59 | //** |
|
60 | 60 | connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(fetchPacketSig()), |
|
61 | 61 | this, SLOT(fetchPacket()), Qt::DirectConnection ); |
|
62 | 62 | //************** |
|
63 | 63 | |
|
64 | 64 | //************** |
|
65 | 65 | // get a smart pointer to the __main__ module of the Python interpreter |
|
66 | 66 | PythonQtObjectPtr context = PythonQt::self()->getMainModule(); |
|
67 | 67 | // add a QObject as variable of name "BUTTON_rmapOpenCommunication" to the namespace of the __main__ module |
|
68 | 68 | context.addObject("BUTTON_rmapOpenCommunication", UI->rmapOpenCommunicationButton); |
|
69 | 69 | context.addObject("BUTTON_rmapCloseCommunication", UI->rmapCloseCommunicationButton); |
|
70 | 70 | context.addObject("BUTTON_selectStarDundee", UI->selectStarDundee_BUTTON); |
|
71 | 71 | context.addObject("BUTTON_selectGRESB", UI->selectGRESB_BUTTON); |
|
72 | 72 | context.addObject("GRESB_Bridge", UI->gresbBridge); |
|
73 | 73 | //************** |
|
74 | 74 | |
|
75 | 75 | connect(UI->rmapOpenCommunicationButton, SIGNAL(clicked()), this, SLOT(openBridge())); |
|
76 | 76 | connect(UI->rmapCloseCommunicationButton, SIGNAL(clicked()), this, SLOT(closeBridge())); |
|
77 | 77 | |
|
78 | 78 | // CCSDS |
|
79 | 79 | connect(this->UI->sendCCSDSCommandButton, SIGNAL(clicked()), this, SLOT(sendCCSDS())); |
|
80 | 80 | connect(this->UI->send_TC_LFR_UPDATE_TIME_Button, SIGNAL(clicked()), this, SLOT(send_TC_LFR_UPDATE_TIME())); |
|
81 | 81 | connect(this->UI->reset_TC_LFR_UPDATE_TIME_Button, SIGNAL(clicked()), this, SLOT(reset_TC_LFR_UPDATE_TIME())); |
|
82 | 82 | |
|
83 | 83 | // spectralMAtricesDMASimulator |
|
84 | 84 | connect(this->UI->spectralMatricesDMASimulator, SIGNAL(rmapplugginRead(uint*,uint,uint)), this, SLOT(Read(uint*,uint,uint))); |
|
85 | 85 | connect(this->UI->spectralMatricesDMASimulator, SIGNAL(rmapplugginWrite(uint*,uint,uint)), this, SLOT(Write(uint*,uint,uint))); |
|
86 | 86 | connect(this->UI->spectralMatricesDMASimulator, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString))); |
|
87 | 87 | |
|
88 | //****** | |
|
88 | 89 | // GRESB |
|
89 | 90 | connect(this->UI->gresbBridge, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString))); |
|
90 | 91 | connect(this->UI->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool))); |
|
91 | 92 | connect(this->UI->gresbBridge, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString))); |
|
92 | 93 | connect(this->UI->gresbBridge, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString))); |
|
93 | connect(this->UI->gresbBridge, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)), | |
|
94 | this, SLOT(processCCSDSPacket(unsigned char*,uint))); | |
|
95 | 94 | connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->gresbBridge, SLOT(ccsdsPacketIsProcessed())); |
|
96 | 95 | connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), |
|
97 | 96 | this->UI->gresbBridge, SLOT(targetHasChanged(int))); |
|
98 | 97 | connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), |
|
99 | 98 | this->UI->gresbBridge, SLOT(sourceHasChanged(int))); |
|
100 |
connect(this->UI->gresbBridge, SIGNAL( |
|
|
101 |
this, SLOT( |
|
|
99 | connect(this->UI->gresbBridge, SIGNAL(sendPacket(TMPacketToRead*)), | |
|
100 | this, SLOT(receivePacketFromBridge(TMPacketToRead*))); | |
|
102 | 101 | |
|
102 | //************ | |
|
103 | 103 | // Star Dundee |
|
104 | 104 | connect(this->UI->starDundee, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString))); |
|
105 | 105 | connect(this->UI->starDundee, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool))); |
|
106 | 106 | connect(this->UI->starDundee, SIGNAL(RMAP_write_reply_setText(QString)), this, SLOT(RMAP_write_reply_setText(QString))); |
|
107 | 107 | connect(this->UI->starDundee, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString))); |
|
108 | connect(this->UI->starDundee, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)), | |
|
109 | this, SLOT(processCCSDSPacket(unsigned char*,uint))); | |
|
110 | 108 | connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->starDundee, SLOT(ccsdsPacketIsProcessed())); |
|
111 | 109 | connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), |
|
112 | 110 | this->UI->starDundee, SLOT(targetHasChanged(int))); |
|
113 | 111 | connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), |
|
114 | 112 | this->UI->starDundee, SLOT(sourceHasChanged(int))); |
|
115 |
connect(this->UI->starDundee, SIGNAL( |
|
|
116 |
this, SLOT( |
|
|
113 | connect(this->UI->starDundee, SIGNAL(sendPacket(TMPacketToRead*)), | |
|
114 | this, SLOT(receivePacketFromBridge(TMPacketToRead*))); | |
|
117 | 115 | |
|
118 | 116 | connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(bridgeHasChanged(selectedBridge))); |
|
119 | connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(updatePacketStore(selectedBridge))); | |
|
120 | 117 | |
|
118 | ((rmappluginPythonWrapper*)this->pyObject)->ccsdsPacketStore = &(this->generalCCSDSPacketStore); | |
|
121 | 119 | } |
|
122 | 120 | |
|
123 | 121 | rmapplugin::~rmapplugin() |
|
124 | 122 | { |
|
125 | 123 | switch(currentBridge) |
|
126 | 124 | { |
|
127 | 125 | case selectedBridgeIsGRESB : |
|
128 | 126 | if (RMAPSend_SOCKET->isOpen()) RMAPSend_SOCKET->disconnectFromHost(); |
|
129 | 127 | if (RMAPReceive_SOCKET->isOpen()) RMAPReceive_SOCKET->disconnectFromHost(); |
|
130 | 128 | if (GRESBStatusQuery_SOCKET->isOpen()) GRESBStatusQuery_SOCKET->disconnectFromHost(); |
|
131 | 129 | break; |
|
132 | 130 | case selectedBridgeIsStarDundee : |
|
133 | 131 | break; |
|
134 | 132 | default: |
|
135 | 133 | break; |
|
136 | 134 | } |
|
137 | 135 | } |
|
138 | 136 | |
|
139 | 137 | unsigned int rmapplugin::Write(unsigned int *Value, unsigned int count, unsigned int address) |
|
140 | 138 | { |
|
141 | 139 | unsigned int result; |
|
142 | 140 | switch(currentBridge) |
|
143 | 141 | { |
|
144 | 142 | case selectedBridgeIsGRESB : |
|
145 | 143 | result = UI->gresbBridge->Write(Value, count, address); |
|
146 | 144 | break; |
|
147 | 145 | case selectedBridgeIsStarDundee : |
|
148 | 146 | result = UI->starDundee->Write(Value, count, address); |
|
149 | 147 | break; |
|
150 | 148 | default: |
|
151 | 149 | result = 1; |
|
152 | 150 | break; |
|
153 | 151 | } |
|
154 | 152 | return result; |
|
155 | 153 | } |
|
156 | 154 | |
|
157 | 155 | unsigned int rmapplugin::Read(unsigned int *Value, unsigned int count, unsigned int address) |
|
158 | 156 | { |
|
159 | 157 | unsigned int result; |
|
160 | 158 | switch(currentBridge) |
|
161 | 159 | { |
|
162 | 160 | case selectedBridgeIsGRESB : |
|
163 | 161 | result = UI->gresbBridge->Read(Value, count, address); |
|
164 | 162 | break; |
|
165 | 163 | case selectedBridgeIsStarDundee : |
|
166 | 164 | result = UI->starDundee->Read(Value, count, address); |
|
167 | 165 | break; |
|
168 | 166 | default: |
|
169 | 167 | result = 1; |
|
170 | 168 | break; |
|
171 | 169 | } |
|
172 | 170 | return result; |
|
173 | 171 | } |
|
174 | 172 | |
|
175 | 173 | //////// |
|
176 | 174 | // SLOTS |
|
177 | 175 | |
|
178 | 176 | unsigned int rmapplugin::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication) // SLOT |
|
179 | 177 | { |
|
180 | 178 | unsigned int result; |
|
181 | 179 | switch(currentBridge) |
|
182 | 180 | { |
|
183 | 181 | case selectedBridgeIsGRESB : |
|
184 | 182 | result = UI->gresbBridge->WriteSPW(Value, count, targetLogicalAddress, userApplication); |
|
185 | 183 | break; |
|
186 | 184 | case selectedBridgeIsStarDundee : |
|
187 | 185 | result = UI->starDundee->WriteSPW(Value, count, targetLogicalAddress, userApplication); |
|
188 | 186 | break; |
|
189 | 187 | default: |
|
190 | 188 | result = 1; |
|
191 | 189 | break; |
|
192 | 190 | } |
|
193 | 191 | return result; |
|
194 | 192 | } |
|
195 | 193 | |
|
196 | 194 | void rmapplugin::sendCCSDS() // SLOT |
|
197 | 195 | { |
|
198 | 196 | unsigned int nbBYTES_application_data = 8; |
|
199 | 197 | unsigned int count; |
|
200 | 198 | char *tab; |
|
201 | 199 | unsigned char packetErrorControl1 = 0xaa; |
|
202 | 200 | unsigned char packetErrorControl0 = 0xbb; |
|
203 | 201 | |
|
204 | 202 | 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 |
|
205 | 203 | /* unsigned char data_field_header, |
|
206 | 204 | unsigned char processID, |
|
207 | 205 | unsigned int sequence_count, |
|
208 | 206 | unsigned int packet_length, |
|
209 | 207 | unsigned char acceptance, |
|
210 | 208 | unsigned int completion, |
|
211 | 209 | unsigned char service_type, |
|
212 | 210 | unsigned char service_subtype, |
|
213 | 211 | unsigned char sourceID*/ |
|
214 | 212 | |
|
215 | 213 | count = nbBYTES_application_data+12; // 12 is the size in bytes of the header |
|
216 | 214 | tab = (char*) malloc(count); |
|
217 | 215 | tab[0] = ccsds_command->ccsds_header->packetId1; |
|
218 | 216 | tab[1] = ccsds_command->ccsds_header->packetId0; |
|
219 | 217 | tab[2] = ccsds_command->ccsds_header->packetSequenceControl1; |
|
220 | 218 | tab[3] = ccsds_command->ccsds_header->packetSequenceControl0; |
|
221 | 219 | tab[4] = ccsds_command->ccsds_header->packetLength1; |
|
222 | 220 | tab[5] = ccsds_command->ccsds_header->packetLength0; |
|
223 | 221 | tab[6] = ccsds_command->ccsds_header->dataFieldHeader3; |
|
224 | 222 | tab[7] = ccsds_command->ccsds_header->dataFieldHeader2; |
|
225 | 223 | tab[8] = ccsds_command->ccsds_header->dataFieldHeader1; |
|
226 | 224 | tab[9] = ccsds_command->ccsds_header->dataFieldHeader0; |
|
227 | 225 | tab[10]=0x00; |
|
228 | 226 | tab[11]=0x00; |
|
229 | 227 | tab[12]=0x00; |
|
230 | 228 | tab[13]=0x00; |
|
231 | 229 | tab[14]=0x00; |
|
232 | 230 | tab[15]=0x00; |
|
233 | 231 | tab[nbBYTES_application_data+10] = packetErrorControl1; |
|
234 | 232 | tab[nbBYTES_application_data+11] = packetErrorControl0; |
|
235 | 233 | |
|
236 | 234 | WriteSPW(tab, count, UI->CCSDSTargetLogicalAddressSpinBox->value(), 0x00); |
|
237 | 235 | |
|
238 | 236 | free(tab); |
|
239 | 237 | } |
|
240 | 238 | |
|
241 | 239 | void rmapplugin::openBridge() |
|
242 | 240 | { |
|
243 | 241 | switch(currentBridge) |
|
244 | 242 | { |
|
245 | 243 | case selectedBridgeIsGRESB : |
|
246 | 244 | this->UI->gresbBridge->Open(); |
|
247 | 245 | break; |
|
248 | 246 | case selectedBridgeIsStarDundee : |
|
249 | 247 | this->UI->starDundee->Open(); |
|
250 | 248 | break; |
|
251 | 249 | default: |
|
252 | 250 | break; |
|
253 | 251 | } |
|
254 | 252 | } |
|
255 | 253 | |
|
256 | 254 | void rmapplugin::closeBridge() |
|
257 | 255 | { |
|
258 | 256 | switch(currentBridge) |
|
259 | 257 | { |
|
260 | 258 | case selectedBridgeIsGRESB : |
|
261 | 259 | this->UI->gresbBridge->Close(); |
|
262 | 260 | break; |
|
263 | 261 | case selectedBridgeIsStarDundee : |
|
264 | 262 | this->UI->starDundee->Close(); |
|
265 | 263 | break; |
|
266 | 264 | default: |
|
267 | 265 | break; |
|
268 | 266 | } |
|
269 | 267 | } |
|
270 | 268 | |
|
271 | 269 | void rmapplugin::send_TC_LFR_UPDATE_TIME() |
|
272 | 270 | { |
|
273 | 271 | unsigned int nbBYTES_application_data = 6; // Time at CUC format is on 48 bits / 6 bytes |
|
274 | 272 | unsigned int count; |
|
275 | 273 | char *tab; |
|
276 | 274 | unsigned char packetErrorControl1 = 0xaa; |
|
277 | 275 | unsigned char packetErrorControl0 = 0xbb; |
|
278 | 276 | |
|
279 | 277 | ccsds_command = new ccsds(1, 11, 0, nbBYTES_application_data, 1, 1, 9, 129, 0); |
|
280 | 278 | /* unsigned char data_field_header, |
|
281 | 279 | unsigned char processID, |
|
282 | 280 | unsigned int sequence_count, |
|
283 | 281 | unsigned int packet_length, |
|
284 | 282 | unsigned char acceptance, |
|
285 | 283 | unsigned int completion, |
|
286 | 284 | unsigned char service_type, |
|
287 | 285 | unsigned char service_subtype, |
|
288 | 286 | unsigned char sourceID*/ |
|
289 | 287 | |
|
290 | 288 | count = nbBYTES_application_data+12; // +12 => packet header 6 bytes + data field header 4 bytes + packet error control 2 bytes |
|
291 | 289 | tab = (char*) malloc(count); |
|
292 | 290 | tab[0] = ccsds_command->ccsds_header->packetId1; |
|
293 | 291 | tab[1] = ccsds_command->ccsds_header->packetId0; |
|
294 | 292 | tab[2] = ccsds_command->ccsds_header->packetSequenceControl1; |
|
295 | 293 | tab[3] = ccsds_command->ccsds_header->packetSequenceControl0; |
|
296 | 294 | tab[4] = ccsds_command->ccsds_header->packetLength1; |
|
297 | 295 | tab[5] = ccsds_command->ccsds_header->packetLength0; |
|
298 | 296 | tab[6] = ccsds_command->ccsds_header->dataFieldHeader3; |
|
299 | 297 | tab[7] = ccsds_command->ccsds_header->dataFieldHeader2; |
|
300 | 298 | tab[8] = ccsds_command->ccsds_header->dataFieldHeader1; |
|
301 | 299 | tab[9] = ccsds_command->ccsds_header->dataFieldHeader0; |
|
302 | 300 | tab[10] = (unsigned char) (time_COARSE>>24); |
|
303 | 301 | tab[11] = (unsigned char) (time_COARSE>>18); |
|
304 | 302 | tab[12] = (unsigned char) (time_COARSE>>8); |
|
305 | 303 | tab[13] = (unsigned char) (time_COARSE); |
|
306 | 304 | tab[14] = (unsigned char) (time_FINE>>8); |
|
307 | 305 | tab[15] = (unsigned char) (time_FINE); |
|
308 | 306 | tab[nbBYTES_application_data+10] = packetErrorControl1; |
|
309 | 307 | tab[nbBYTES_application_data+11] = packetErrorControl0; |
|
310 | 308 | |
|
311 | 309 | WriteSPW(tab, count, UI->CCSDSTargetLogicalAddressSpinBox->value(), 0x00); |
|
312 | 310 | |
|
313 | 311 | time_COARSE = time_COARSE+1; |
|
314 | 312 | |
|
315 | 313 | free(tab); |
|
316 | 314 | } |
|
317 | 315 | |
|
318 | 316 | void rmapplugin::reset_TC_LFR_UPDATE_TIME() |
|
319 | 317 | { |
|
320 | 318 | time_COARSE = 0; |
|
321 | 319 | time_FINE = 0; |
|
322 | 320 | } |
|
323 | 321 | |
|
324 | 322 | void rmapplugin::RMAP_write_reply_setText(QString text) |
|
325 | 323 | { |
|
326 | 324 | this->UI->RMAP_write_reply->setText(text); |
|
327 | 325 | } |
|
328 | 326 | |
|
329 | 327 | void rmapplugin::appendToLog(QString text) |
|
330 | 328 | { |
|
331 | 329 | APPENDTOLOG(text); |
|
332 | 330 | } |
|
333 | 331 | |
|
334 | 332 | void rmapplugin::setValueTargetAddress(unsigned char newAddress) |
|
335 | 333 | { |
|
336 | 334 | this->UI->rmapTargetLogicalAddressSpinBox->setValue(newAddress); |
|
337 | 335 | } |
|
338 | 336 | |
|
339 | 337 | void rmapplugin::setValueSourceAddress(unsigned char newAddress) |
|
340 | 338 | { |
|
341 | 339 | this->UI->rmapSourceLogicalAddressSpinBox->setValue(newAddress); |
|
342 | 340 | } |
|
343 | 341 | |
|
342 | void rmapplugin::receivePacketFromBridge(TMPacketToRead *packet) | |
|
343 | { | |
|
344 | preProcessPacket(packet); | |
|
345 | this->generalCCSDSPacketStore.append(packet); | |
|
346 | processPacketStore(); | |
|
347 | } | |
|
348 | ||
|
349 | void rmapplugin::preProcessPacket(TMPacketToRead *packet) | |
|
350 | { | |
|
351 | unsigned char typ = 0; | |
|
352 | unsigned char sub = 0; | |
|
353 | unsigned char sid = 0; | |
|
354 | unsigned char pkt_nr = 0; | |
|
355 | unsigned int blk_nr = 0; | |
|
356 | unsigned int i = 0; | |
|
357 | unsigned int j = 0; | |
|
358 | unsigned char *data; | |
|
359 | ||
|
360 | typ = packet->Value[11]; // TYPE | |
|
361 | sub = packet->Value[12]; // SUBTYPE | |
|
362 | if ( (typ == 21) & (sub == 3) ) | |
|
363 | { | |
|
364 | sid = packet->Value[20]; // SID | |
|
365 | pkt_nr = packet->Value[23]; // PKT_NR | |
|
366 | blk_nr = packet->Value[24] * 256 + packet->Value[25]; | |
|
367 | switch (sid){ | |
|
368 | case SID_NORMAL_SWF_F0: | |
|
369 | emit displayOnConsole("wf packet received, sid: " + QString::number(sid) | |
|
370 | + ", pkt_nr: " + QString::number(pkt_nr) | |
|
371 | + ", blk_nr: " + QString::number(blk_nr) | |
|
372 | ); | |
|
373 | data = &packet->Value[26]; // start of the first data block; | |
|
374 | j = (pkt_nr-1) * 340; | |
|
375 | for ( i=0; i<blk_nr; i++ ){ | |
|
376 | normal_swf_f0_v[j + i] = (short) ( (data[i * BLK_SIZE ] << 8) + (data[i*BLK_SIZE + 1]) ); | |
|
377 | normal_swf_f0_e1[j + i] = (short) ( (data[i * BLK_SIZE + 2] << 8) + (data[i*BLK_SIZE + 3]) ); | |
|
378 | normal_swf_f0_e2[j + i] = (short) ( (data[i * BLK_SIZE + 4] << 8) + (data[i*BLK_SIZE + 5]) ); | |
|
379 | normal_swf_f0_b1[j + i] = (short) ( (data[i * BLK_SIZE + 6] << 8) + (data[i*BLK_SIZE + 7]) ); | |
|
380 | normal_swf_f0_b2[j + i] = (short) ( (data[i * BLK_SIZE + 8] << 8) + (data[i*BLK_SIZE + 9]) ); | |
|
381 | normal_swf_f0_b3[j + i] = (short) ( (data[i * BLK_SIZE + 10] << 8) + (data[i*BLK_SIZE + 11]) ); | |
|
382 | } | |
|
383 | if (pkt_nr == 7) | |
|
384 | { | |
|
385 | emit displayOnConsole("all packets received, display waveform"); | |
|
386 | this->UI->wfDisplay->displayOnPlot(normal_swf_f0_v, 0); | |
|
387 | this->UI->wfDisplay->displayOnPlot(normal_swf_f0_e1, 1); | |
|
388 | this->UI->wfDisplay->displayOnPlot(normal_swf_f0_e2, 2); | |
|
389 | this->UI->wfDisplay->displayOnPlot(normal_swf_f0_b1, 3); | |
|
390 | } | |
|
391 | break; | |
|
392 | case SID_NORMAL_SWF_F1: | |
|
393 | break; | |
|
394 | case SID_NORMAL_SWF_F2: | |
|
395 | break; | |
|
396 | case SID_NORMAL_CWF_F3: | |
|
397 | break; | |
|
398 | } | |
|
399 | } | |
|
400 | } | |
|
401 | ||
|
344 | 402 | ///////////////////// |
|
345 | 403 | // INTERNAL FUNCTIONS |
|
346 | 404 | |
|
347 | 405 | void rmapplugin::processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size) // SLOT |
|
348 | 406 | { |
|
349 | 407 | QString message; |
|
350 | 408 | unsigned int fine_time_value = 0; |
|
351 | 409 | fine_time_value = ((unsigned int) ccsdsPacket[7]<<24) |
|
352 | 410 | + ((unsigned int) ccsdsPacket[6]<<16) |
|
353 | 411 | + ((unsigned int) ccsdsPacket[5]<<8) |
|
354 | 412 | + ((unsigned int) ccsdsPacket[4]); |
|
355 | 413 | message.append(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": "); |
|
356 | 414 | message.append("size " |
|
357 | 415 | + QString::number(size) |
|
358 | 416 | +" *** header " |
|
359 | 417 | + QString::number(ccsdsPacket[0], 16) |
|
360 | 418 | + " " |
|
361 | 419 | + QString::number(ccsdsPacket[1], 16) |
|
362 | 420 | + " " |
|
363 | 421 | + QString::number(ccsdsPacket[2], 16) |
|
364 | 422 | + " " |
|
365 | 423 | + QString::number(ccsdsPacket[3], 16) |
|
366 | 424 | + " *** coarse time " |
|
367 | 425 | + QString::number(fine_time_value)); |
|
368 | 426 | //+ QString::number(ccsdsPacket[4], 16) |
|
369 | 427 | //+" " |
|
370 | 428 | //+ QString::number(ccsdsPacket[5], 16) |
|
371 | 429 | //+" " |
|
372 | 430 | //+ QString::number(ccsdsPacket[6], 16) |
|
373 | 431 | //+" " |
|
374 | 432 | //+ QString::number(ccsdsPacket[7], 16)); |
|
375 | 433 | displayOnConsole(message); |
|
376 | 434 | //((rmappluginPythonWrapper*)this->pyObject)->storeCCSDSPacket(ccsdsPacket, size); |
|
377 | 435 | emit ccsdsPacketIsProcessed(); |
|
378 | 436 | } |
|
379 | 437 | |
|
380 | 438 | void rmapplugin::processPacketStore() |
|
381 | 439 | { |
|
382 | 440 | ((rmappluginPythonWrapper*)this->pyObject)->processPacketStore(); |
|
383 | 441 | } |
|
384 | 442 | |
|
385 | void rmapplugin::updatePacketStore(selectedBridge bridge) | |
|
386 | { | |
|
387 | switch(bridge) | |
|
388 | { | |
|
389 | case selectedBridgeIsGRESB : | |
|
390 | ((rmappluginPythonWrapper*)this->pyObject)->ccsdsPacketStore = &(this->UI->gresbBridge->ccsdsPacketStore); | |
|
391 | break; | |
|
392 | case selectedBridgeIsStarDundee : | |
|
393 | ((rmappluginPythonWrapper*)this->pyObject)->ccsdsPacketStore = &(this->UI->starDundee->ccsdsPacketStore); | |
|
394 | break; | |
|
395 | default: | |
|
396 | break; | |
|
397 | } | |
|
398 | } | |
|
399 | ||
|
400 | 443 | int rmapplugin::fetchPacket() |
|
401 | 444 | { |
|
402 | 445 | int ret = 0; |
|
403 | 446 | |
|
404 | 447 | switch(currentBridge) |
|
405 | 448 | { |
|
406 | 449 | case selectedBridgeIsGRESB : |
|
407 | 450 | break; |
|
408 | 451 | case selectedBridgeIsStarDundee : |
|
409 | 452 | ret = this->UI->starDundee->receiveSPWPacketLoop(); |
|
410 | 453 | break; |
|
411 | 454 | default: |
|
412 | 455 | break; |
|
413 | 456 | } |
|
414 | 457 | |
|
415 | 458 | return ret; |
|
416 | 459 | } |
@@ -1,93 +1,104 | |||
|
1 | 1 | /*------------------------------------------------------------------------------ |
|
2 | 2 | -- This file is a part of the LPPMON Software |
|
3 | 3 | -- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS |
|
4 | 4 | -- |
|
5 | 5 | -- This program is free software; you can redistribute it and/or modify |
|
6 | 6 | -- it under the terms of the GNU General Public License as published by |
|
7 | 7 | -- the Free Software Foundation; either version 3 of the License, or |
|
8 | 8 | -- (at your option) any later version. |
|
9 | 9 | -- |
|
10 | 10 | -- This program is distributed in the hope that it will be useful, |
|
11 | 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 | 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 | 13 | -- GNU General Public License for more details. |
|
14 | 14 | -- |
|
15 | 15 | -- You should have received a copy of the GNU General Public License |
|
16 | 16 | -- along with this program; if not, write to the Free Software |
|
17 | 17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
18 | 18 | -------------------------------------------------------------------------------*/ |
|
19 | 19 | /*-- Author : Alexis Jeandet |
|
20 | 20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr |
|
21 | 21 | ----------------------------------------------------------------------------*/ |
|
22 | 22 | #ifndef DRIVER1_H |
|
23 | 23 | #define DRIVER1_H |
|
24 | 24 | #include <rmappluginui.h> |
|
25 | 25 | #include <rmapoperations.h> |
|
26 | 26 | #include <QMenuBar> |
|
27 | 27 | #include <QMenu> |
|
28 | 28 | #include <QAction> |
|
29 | 29 | #include <QMainWindow> |
|
30 | 30 | #include <QTcpSocket> |
|
31 | 31 | #include <QTime> |
|
32 | 32 | #include <ccsds.h> |
|
33 | 33 | #include <QSemaphore> |
|
34 | 34 | |
|
35 | 35 | #include <lppmonplugin.h> |
|
36 | 36 | |
|
37 | #include "tmpackettoread.h" | |
|
38 | ||
|
37 | 39 | #define APPENDTOLOG(message) this->UI->appendToLogFile(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": " + message) |
|
38 | 40 | |
|
39 | 41 | #define READ_WRITE_MAX_COUNTS 4096 // in words |
|
40 | 42 | #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 |
|
41 | 43 | #define RMAP_READ_REPLY_HEADER_LENGTH 12 // in bytes => ECSS |
|
42 | 44 | #define RMAP_READ_COMMAND_HEADER_LENGTH 16 // in bytes => ECSS |
|
43 | 45 | #define RMAP_DATA_CRC_LENGTH 1 // in bytes => ECSS |
|
44 | 46 | #define CCSDS_MAX_PACKET_LENGTH 4412 // in bytes, specified in the LFR Software Requirements Specification |
|
45 | 47 | |
|
46 | 48 | class rmapplugin : public lppmonplugin |
|
47 | 49 | { |
|
48 | 50 | Q_OBJECT |
|
49 | 51 | public: |
|
50 | 52 | explicit rmapplugin(QWidget *parent = 0); |
|
51 | 53 | ~rmapplugin(); |
|
54 | QList<TMPacketToRead*> generalCCSDSPacketStore; | |
|
55 | void preProcessPacket(TMPacketToRead *packet); | |
|
56 | short normal_swf_f0_v[2048]; | |
|
57 | short normal_swf_f0_e1[2048]; | |
|
58 | short normal_swf_f0_e2[2048]; | |
|
59 | short normal_swf_f0_b1[2048]; | |
|
60 | short normal_swf_f0_b2[2048]; | |
|
61 | short normal_swf_f0_b3[2048]; | |
|
52 | 62 | |
|
53 | 63 | public slots: |
|
54 | 64 | unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0); |
|
55 | 65 | unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0); |
|
56 | 66 | unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication); |
|
57 | 67 | void setValueTargetAddress(unsigned char newAddress); |
|
58 | 68 | void setValueSourceAddress(unsigned char newAddress); |
|
59 | 69 | void openBridge(); |
|
60 | 70 | void closeBridge(); |
|
61 | 71 | void processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size); |
|
62 | 72 | void processPacketStore(); |
|
63 | 73 | void updatePacketStore(selectedBridge bridge); |
|
64 | 74 | int fetchPacket(); |
|
75 | void receivePacketFromBridge(TMPacketToRead* packet); | |
|
65 | 76 | // |
|
66 | 77 | void sendCCSDS(); |
|
67 | 78 | void send_TC_LFR_UPDATE_TIME(); |
|
68 | 79 | void reset_TC_LFR_UPDATE_TIME(); |
|
69 | 80 | void displayOnConsole(QString message) {this->UI->console->append(message);} |
|
70 | 81 | // |
|
71 | 82 | void RMAP_write_reply_setText(QString text); |
|
72 | 83 | void appendToLog(QString text); |
|
73 | 84 | // |
|
74 | 85 | void activatePlugin(bool flag) {emit activateSig(flag);} |
|
75 | 86 | void bridgeHasChanged(selectedBridge bridge) {currentBridge = bridge;} |
|
76 | 87 | |
|
77 | 88 | signals: |
|
78 | 89 | void ccsdsPacketIsProcessed(); |
|
79 | 90 | |
|
80 | 91 | private: |
|
81 | 92 | selectedBridge currentBridge; |
|
82 | 93 | rmapPluginUI* UI; |
|
83 | 94 | QTcpSocket* GRESBStatusQuery_SOCKET; |
|
84 | 95 | QTcpSocket* RMAPSend_SOCKET; |
|
85 | 96 | QTcpSocket* RMAPReceive_SOCKET; |
|
86 | 97 | ccsds* ccsds_command; |
|
87 | 98 | unsigned int rmapPacketSize; |
|
88 | 99 | unsigned int time_COARSE; |
|
89 | 100 | unsigned int time_FINE; |
|
90 | 101 | char timeCode; |
|
91 | 102 | }; |
|
92 | 103 | |
|
93 | 104 | #endif // DRIVER1_H |
@@ -1,72 +1,74 | |||
|
1 | 1 | # |
|
2 | 2 | # Project created by QtCreator 2011-09-20T08:15:30 |
|
3 | 3 | # |
|
4 | 4 | #------------------------------------------------- |
|
5 | 5 | |
|
6 | 6 | #include(/etc/lppmon/lppmonplugin.prf) |
|
7 | 7 | CONFIG += lppmonplugin |
|
8 | 8 | TARGET = rmapplugin |
|
9 | 9 | |
|
10 | 10 | DEFINES += PLUGIN=rmapplugin |
|
11 | 11 | DEFINES += PLUGINHEADER="\"\\\"rmapplugin.h"\\\"\" |
|
12 | 12 | DEFINES += driver_Name="\"\\\"RMAPPlugin"\\\"\" |
|
13 | 13 | DEFINES += driver_Author="\"\\\"Paul Leroy paul.leroy@lpp.polytechnique.fr"\\\"\" |
|
14 | 14 | DEFINES += driver_Version="\"\\\"1.1.2"\\\"\" |
|
15 | 15 | DEFINES += driver_Description="\"\\\"AHB bus controler, works with Gaisler's AHB plugn' play bus."\\\"\" |
|
16 | 16 | DEFINES += driver_can_be_root=1 |
|
17 | 17 | DEFINES += driver_can_be_child=0 |
|
18 | 18 | DEFINES += driver_VID=0 |
|
19 | 19 | DEFINES += driver_PID=0 |
|
20 | 20 | |
|
21 | 21 | QT += network |
|
22 | 22 | |
|
23 | 23 | LIBS += ../spw_usb_driver_v2.63/lib/x86_64/libSpaceWireUSBAPI.so \ |
|
24 | 24 | ../spw_usb_driver_v2.63/lib/x86_64/libConfigLibraryUSB.so |
|
25 | 25 | |
|
26 | 26 | |
|
27 | 27 | INCLUDEPATH += \ |
|
28 | 28 | $${PWD} \ |
|
29 | 29 | ../common_PLE \ |
|
30 | 30 | ../spw_usb_driver_v2.63/inc |
|
31 | 31 | |
|
32 | 32 | |
|
33 | 33 | HEADERS += \ |
|
34 | 34 | rmappluginui.h \ |
|
35 | 35 | rmapplugin.h \ |
|
36 | 36 | rmapoperations.h \ |
|
37 | 37 | ccsds.h \ |
|
38 | 38 | ../common_PLE/qipdialogbox.h \ |
|
39 | 39 | ../common_PLE/gresbstatusenquiry.h \ |
|
40 | 40 | spectralmatricesdmasimulator.h \ |
|
41 | 41 | rmappluginpythonwrapper.h \ |
|
42 | 42 | stardundee.h \ |
|
43 | 43 | ../spw_usb_driver_v2.61/inc/spw_usb_api.h \ |
|
44 | 44 | ../spw_usb_driver_v2.61/inc/spw_config_library.h \ |
|
45 | 45 | gresb.h \ |
|
46 | 46 | tcpackettosend.h \ |
|
47 | tmpackettoread.h | |
|
47 | tmpackettoread.h \ | |
|
48 | wfdisplay.h | |
|
48 | 49 | |
|
49 | 50 | |
|
50 | 51 | SOURCES += \ |
|
51 | 52 | rmapplugin.cpp \ |
|
52 | 53 | rmappluginui.cpp \ |
|
53 | 54 | rmapoperations.cpp \ |
|
54 | 55 | ccsds.cpp \ |
|
55 | 56 | ../common_PLE/qipdialogbox.cpp \ |
|
56 | 57 | ../common_PLE/gresbstatusenquiry.cpp \ |
|
57 | 58 | spectralmatricesdmasimulator.cpp \ |
|
58 | 59 | rmappluginpythonwrapper.cpp \ |
|
59 | 60 | stardundee.cpp \ |
|
60 | 61 | gresb.cpp \ |
|
61 | 62 | tcpackettosend.cpp \ |
|
62 | tmpackettoread.cpp | |
|
63 | tmpackettoread.cpp \ | |
|
64 | wfdisplay.cpp | |
|
63 | 65 | |
|
64 | 66 | |
|
65 | 67 | |
|
66 | 68 | |
|
67 | 69 | |
|
68 | 70 | |
|
69 | 71 | |
|
70 | 72 | |
|
71 | 73 | |
|
72 | 74 |
@@ -1,301 +1,309 | |||
|
1 | 1 | /*------------------------------------------------------------------------------ |
|
2 | 2 | -- This file is a part of the LPPMON Software |
|
3 | 3 | -- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS |
|
4 | 4 | -- |
|
5 | 5 | -- This program is free software; you can redistribute it and/or modify |
|
6 | 6 | -- it under the terms of the GNU General Public License as published by |
|
7 | 7 | -- the Free Software Foundation; either version 3 of the License, or |
|
8 | 8 | -- (at your option) any later version. |
|
9 | 9 | -- |
|
10 | 10 | -- This program is distributed in the hope that it will be useful, |
|
11 | 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 | 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 | 13 | -- GNU General Public License for more details. |
|
14 | 14 | -- |
|
15 | 15 | -- You should have received a copy of the GNU General Public License |
|
16 | 16 | -- along with this program; if not, write to the Free Software |
|
17 | 17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
18 | 18 | -------------------------------------------------------------------------------*/ |
|
19 | 19 | /*-- Author : Alexis Jeandet |
|
20 | 20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr |
|
21 | 21 | ----------------------------------------------------------------------------*/ |
|
22 | 22 | #include "rmapplugin.h" |
|
23 | 23 | |
|
24 | 24 | rmapPluginUI::rmapPluginUI(QWidget *parent) : |
|
25 | 25 | QWidget(parent) |
|
26 | 26 | { |
|
27 | 27 | spectralMatricesDMASimulator = new SpectralMatricesDMASimulator; |
|
28 | 28 | spwTabWidget = new QTabWidget; |
|
29 | 29 | QWidget* spwTabWidgetPage0 = new QWidget; |
|
30 | 30 | QWidget* spwTabWidgetPage1 = new QWidget; |
|
31 | 31 | QWidget* spwTabWidgetPage2 = new QWidget; |
|
32 | 32 | QWidget* spwTabWidgetPage3 = new QWidget; |
|
33 | 33 | QWidget* spwTabWidgetPage4 = new QWidget; |
|
34 | QWidget* spwTabWidgetPage5 = new QWidget; | |
|
34 | 35 | bridgeWidget = new QWidget; |
|
35 | 36 | mainLayout = new QVBoxLayout; |
|
36 | connectionLayout = new QGridLayout; | |
|
37 | 37 | ccsdsLayout = new QVBoxLayout; |
|
38 | 38 | consoleLayout = new QVBoxLayout; |
|
39 | 39 | selectionLayout = new QVBoxLayout; |
|
40 | connectionLayout = new QGridLayout; | |
|
40 | 41 | bridgeSelection_LAYOUT = new QGridLayout; |
|
41 | 42 | generalParameters_LAYOUT = new QGridLayout; |
|
42 | 43 | |
|
43 | 44 | gresb_GROUPBOX = new QGroupBox(tr("GRESB bridge parameters")); |
|
44 | 45 | stardundee_GROUPBOX = new QGroupBox(tr("Star Dundee brick parameters")); |
|
45 | 46 | selection_GROUPBOX = new QGroupBox(tr("Bridge selection")); |
|
46 | 47 | generalParameters_GROUPBOX = new QGroupBox(tr("General parameters")); |
|
47 | 48 | |
|
48 | 49 | //*** QLABEL ***// |
|
49 | 50 | gresbBridgeIPLabel = new QLabel(tr("Bridge IP: ")); |
|
50 | 51 | gresbVirtualLinkLabel = new QLabel(tr("Virtual Link: ")); |
|
51 | 52 | spwLinkLabel = new QLabel(tr("SPW Link: ")); |
|
52 | 53 | rmapSourceLogicalAddressLabel = new QLabel(tr("RMAP Source Logical Address: ")); |
|
53 | 54 | rmapTargetLogicalAddressLabel = new QLabel(tr("RMAP Target Logical Address: ")); |
|
54 | 55 | logFileName = new QLabel; |
|
55 | 56 | gresbStatusQueryLabel = new QLabel(tr("Status query socket (port 3010): waiting for connection")); |
|
56 | 57 | gresbStatusQueryDialogLabel = new QLabel(tr("sockets opened but SpaceWire link not running")); |
|
57 | 58 | sendCCSDSCommandLabel = new QLabel(tr("Address of the target")); |
|
58 | 59 | nbPacketInStore = new QLabel(tr("nb packets in store: -")); |
|
59 | 60 | |
|
60 | 61 | //*** QPUSHBUTTON ***// |
|
61 | 62 | rmapOpenCommunicationButton = new QPushButton(tr("Open selected bridge")); |
|
62 | 63 | rmapCloseCommunicationButton = new QPushButton(tr("Close selected bridge")); |
|
63 | 64 | rmapOpenCommunicationButton->setEnabled(false); |
|
64 | 65 | rmapCloseCommunicationButton->setEnabled(false); |
|
65 | 66 | logFileChooseButton = new QPushButton(tr("Choose file")); |
|
66 | 67 | gresbStatusQueryRetryButton = new QPushButton(tr("Retry")); |
|
67 | 68 | gresbStatusQueryAbortButton = new QPushButton(tr("Abort")); |
|
68 | 69 | sendCCSDSCommandButton = new QPushButton(tr("Send CCSDS Command")); |
|
69 | 70 | send_TC_LFR_UPDATE_TIME_Button = new QPushButton(tr("Send TC_LFR_UPDATE_TIME Packet")); |
|
70 | 71 | reset_TC_LFR_UPDATE_TIME_Button = new QPushButton(tr("reset the TC_LFR_UPDATE_TIME Packet coarse and fine times")); |
|
71 | 72 | clearConsoleButton = new QPushButton(tr("Clear")); |
|
72 | 73 | |
|
73 | 74 | selectGRESB_BUTTON = new QRadioButton(tr("GRESB")); |
|
74 | 75 | selectStarDundee_BUTTON = new QRadioButton(tr("Star Dundee")); |
|
75 | 76 | |
|
76 | 77 | //*** SPINBOX ***// |
|
77 | 78 | gresbVirtualLinkSpinBox = new QSpinBox; |
|
78 | 79 | rmapSourceLogicalAddressSpinBox = new QSpinBox; |
|
79 | 80 | rmapTargetLogicalAddressSpinBox = new QSpinBox; |
|
80 | 81 | spwLinkSpinBox = new QSpinBox;; |
|
81 | 82 | CCSDSTargetLogicalAddressSpinBox = new QSpinBox; |
|
82 | 83 | gresbVirtualLinkSpinBox->setRange(0, 4); |
|
83 | 84 | gresbVirtualLinkSpinBox->setValue(1); |
|
84 | 85 | rmapSourceLogicalAddressSpinBox->setRange(0, 255); |
|
85 | 86 | rmapSourceLogicalAddressSpinBox->setValue(0); |
|
86 | 87 | rmapTargetLogicalAddressSpinBox->setRange(0, 255); |
|
87 | 88 | spwLinkSpinBox->setRange(0, 2); |
|
88 | 89 | spwLinkSpinBox->setValue(0); |
|
89 | 90 | CCSDSTargetLogicalAddressSpinBox->setRange(0,255); |
|
90 | 91 | CCSDSTargetLogicalAddressSpinBox->setValue(0); |
|
91 | 92 | |
|
92 | 93 | //*** MISC **// |
|
93 | 94 | starDundee = new StarDundee; |
|
94 | 95 | gresbBridge = new gresb; |
|
95 | 96 | console = new QTextEdit; |
|
96 | 97 | //gresbBridgeIPDialogBox = new QIPDialogBox; |
|
97 | 98 | gresbStatusQueryDialog = new QDialog; |
|
98 | 99 | logEnableCheckBox = new QCheckBox(tr("Enable Logs")); |
|
99 | 100 | RMAP_write_verify = new QCheckBox(tr("data checked before write\nlimited to 4 bytes\nNOT IMPLEMENTED")); |
|
100 | 101 | RMAP_write_reply = new QCheckBox(tr("reply to the write command required\nlast reply status: unavailable")); |
|
101 | 102 | spwLinkStatusEnquiry = new gresbStatusEnquiry; |
|
102 | 103 | logFile = new QFile(); |
|
104 | wfDisplay = new WFDisplay(); | |
|
103 | 105 | |
|
104 | 106 | logFileEn = false; |
|
105 | 107 | |
|
106 | 108 | connectionLayout->setRowStretch(7, 1); |
|
107 | 109 | connectionLayout->setColumnStretch(2, 1); |
|
108 | 110 | |
|
109 | 111 | bridgeSelection_LAYOUT->addWidget(selectGRESB_BUTTON, 0, 0, 1, 1); |
|
110 | 112 | bridgeSelection_LAYOUT->addWidget(selectStarDundee_BUTTON, 0, 1, 1, 1); |
|
111 | 113 | bridgeSelection_LAYOUT->setRowStretch(1, 1); |
|
112 | 114 | bridgeSelection_LAYOUT->setColumnStretch(2, 1); |
|
113 | 115 | |
|
114 | 116 | generalParameters_LAYOUT->addWidget(logEnableCheckBox, 0, 0, 1, 1); |
|
115 | 117 | generalParameters_LAYOUT->addWidget(logFileChooseButton, 0, 1, 1, 1); |
|
116 | 118 | generalParameters_LAYOUT->addWidget(rmapSourceLogicalAddressLabel, 1, 0, 0); |
|
117 | 119 | generalParameters_LAYOUT->addWidget(rmapSourceLogicalAddressSpinBox, 1, 1, 0); |
|
118 | 120 | generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressLabel, 2, 0, 0); |
|
119 | 121 | generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressSpinBox, 2, 1, 0); |
|
120 | 122 | generalParameters_LAYOUT->addWidget(rmapOpenCommunicationButton, 3, 0, 1, 1); |
|
121 | 123 | generalParameters_LAYOUT->addWidget(rmapCloseCommunicationButton, 3, 1, 1, 1); |
|
122 | 124 | generalParameters_LAYOUT->addWidget(RMAP_write_verify, 4, 0, 1, 2); |
|
123 | 125 | generalParameters_LAYOUT->addWidget(RMAP_write_reply, 5, 0, 1, 2); |
|
124 | 126 | |
|
125 | 127 | generalParameters_LAYOUT->setRowStretch(6, 1); |
|
126 | 128 | generalParameters_LAYOUT->setColumnStretch(2, 1); |
|
127 | 129 | |
|
128 | 130 | gresb_GROUPBOX->setLayout(gresbBridge->layout()); |
|
129 | 131 | gresb_GROUPBOX->setVisible(false); |
|
130 | 132 | stardundee_GROUPBOX->setLayout(starDundee->layout()); |
|
131 | 133 | stardundee_GROUPBOX->setVisible(false); |
|
132 | 134 | selection_GROUPBOX->setLayout(bridgeSelection_LAYOUT); |
|
133 | 135 | generalParameters_GROUPBOX->setLayout(generalParameters_LAYOUT); |
|
134 | 136 | selectionLayout->addWidget(selection_GROUPBOX); |
|
135 | 137 | selectionLayout->addWidget(generalParameters_GROUPBOX); |
|
136 | 138 | selectionLayout->addWidget(gresb_GROUPBOX); |
|
137 | 139 | selectionLayout->addWidget(stardundee_GROUPBOX); |
|
138 | 140 | |
|
141 | //****** | |
|
142 | // CCSDS | |
|
139 | 143 | ccsdsLayout->addWidget(sendCCSDSCommandButton); |
|
140 | 144 | ccsdsLayout->addWidget(send_TC_LFR_UPDATE_TIME_Button); |
|
141 | 145 | ccsdsLayout->addWidget(reset_TC_LFR_UPDATE_TIME_Button); |
|
142 | 146 | ccsdsLayout->addWidget(sendCCSDSCommandLabel); |
|
143 | 147 | ccsdsLayout->addWidget(CCSDSTargetLogicalAddressSpinBox); |
|
144 | 148 | |
|
149 | //******** | |
|
150 | // CONSOLE | |
|
145 | 151 | consoleLayout->addWidget(console); |
|
146 | 152 | consoleLayout->addWidget(clearConsoleButton); |
|
147 | 153 | consoleLayout->addWidget(nbPacketInStore); |
|
148 | 154 | |
|
149 | 155 | connect(this->logFileChooseButton, SIGNAL(clicked()), this, SLOT(chooseLogFile())); |
|
150 | 156 | connect(this, SIGNAL(setLogFileName(QString)), this->logFileName, SLOT(setText(QString))); |
|
151 | 157 | connect(this->logEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(logFileEnDisable(int))); |
|
152 | 158 | |
|
153 | 159 | spwTabWidget->addTab(spwTabWidgetPage0, tr("connection")); |
|
154 | 160 | spwTabWidget->addTab(spwTabWidgetPage1, tr("ccsds")); |
|
155 | 161 | spwTabWidget->addTab(spwTabWidgetPage2, tr("status")); |
|
156 | 162 | spwTabWidget->addTab(spwTabWidgetPage3, tr("console")); |
|
157 | 163 | spwTabWidget->addTab(spwTabWidgetPage4, tr("DMA")); |
|
164 | spwTabWidget->addTab(spwTabWidgetPage5, tr("waveforms")); | |
|
158 | 165 | |
|
159 | 166 | spwTabWidgetPage0->setLayout(selectionLayout); |
|
160 | 167 | spwTabWidgetPage1->setLayout(ccsdsLayout); |
|
161 | 168 | spwTabWidgetPage2->setLayout(this->spwLinkStatusEnquiry->mainLayout); |
|
162 | 169 | spwTabWidgetPage3->setLayout(consoleLayout); |
|
163 | 170 | spwTabWidgetPage4->setLayout(spectralMatricesDMASimulator->mainLayout); |
|
171 | spwTabWidgetPage5->setLayout(wfDisplay->layout()); | |
|
164 | 172 | |
|
165 | 173 | mainLayout->addWidget(spwTabWidget); |
|
166 | 174 | setLayout(mainLayout); |
|
167 | 175 | |
|
168 | 176 | connect(this->clearConsoleButton, SIGNAL(clicked()), this->console, SLOT(clear())); |
|
169 | 177 | |
|
170 | 178 | // briges |
|
171 | 179 | connect(this->selectGRESB_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee())); |
|
172 | 180 | connect(this->selectStarDundee_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee())); |
|
173 | 181 | connect(this->starDundee, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool))); |
|
174 | 182 | connect(this->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool))); |
|
175 | 183 | |
|
176 | 184 | connect(this->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(sourceHasChanged(int))); |
|
177 | 185 | connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(targetHasChanged(int))); |
|
178 | 186 | connect(this->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(sourceHasChanged(int))); |
|
179 | 187 | connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(targetHasChanged(int))); |
|
180 | 188 | |
|
181 | 189 | // command code |
|
182 | 190 | connect(this->RMAP_write_reply, SIGNAL(clicked()), this, SLOT(getCommandCode())); |
|
183 | 191 | connect(this->RMAP_write_verify, SIGNAL(clicked()), this, SLOT(getCommandCode())); |
|
184 | 192 | connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)), |
|
185 | 193 | this->starDundee, SLOT(commandCodeHasChanged(RMAP_command_codes))); |
|
186 | 194 | connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)), |
|
187 | 195 | this->gresbBridge, SLOT(commandCodeHasChanged(RMAP_command_codes))); |
|
188 | 196 | |
|
189 | 197 | getCommandCode(); // init the command code value |
|
190 | 198 | rmapSourceLogicalAddressSpinBox->setValue(DEFAULT_SOURCE); |
|
191 | 199 | rmapTargetLogicalAddressSpinBox->setValue(DEFAULT_TARGET); |
|
192 | 200 | } |
|
193 | 201 | |
|
194 | 202 | rmapPluginUI::~rmapPluginUI() |
|
195 | 203 | { |
|
196 | 204 | //delete ui; |
|
197 | 205 | } |
|
198 | 206 | |
|
199 | 207 | void rmapPluginUI::chooseLogFile() |
|
200 | 208 | { |
|
201 | 209 | if(this->logFile->isOpen()) |
|
202 | 210 | this->logFile->close(); |
|
203 | 211 | this->logFile->setFileName(QFileDialog::getSaveFileName(this,tr("Open Log file"), |
|
204 | 212 | QDir::homePath() |
|
205 | 213 | + "/" |
|
206 | 214 | + QDate::currentDate().toString() |
|
207 | 215 | + "_" |
|
208 | 216 | + QTime::currentTime().toString() |
|
209 | 217 | + "_rmapPluginUI.log", |
|
210 | 218 | tr("Log Files (*.txt *.log)"))); |
|
211 | 219 | if(this->logFile->open(QIODevice::WriteOnly)) |
|
212 | 220 | { |
|
213 | 221 | this->logFileStrm = new QTextStream(this->logFile); |
|
214 | 222 | emit this->setLogFileName(this->logFile->fileName()); |
|
215 | 223 | } |
|
216 | 224 | } |
|
217 | 225 | |
|
218 | 226 | void rmapPluginUI::logFileEnDisable(int state) |
|
219 | 227 | { |
|
220 | 228 | if(state==Qt::Checked) |
|
221 | 229 | { |
|
222 | 230 | this->logFileEn = true; |
|
223 | 231 | } |
|
224 | 232 | else if(state==Qt::Unchecked) |
|
225 | 233 | { |
|
226 | 234 | this->logFileEn = false; |
|
227 | 235 | } |
|
228 | 236 | } |
|
229 | 237 | |
|
230 | 238 | bool rmapPluginUI::islogfileenable() |
|
231 | 239 | { |
|
232 | 240 | return this->logFileEn; |
|
233 | 241 | } |
|
234 | 242 | |
|
235 | 243 | void rmapPluginUI::appendToLogFile(const QString & text) |
|
236 | 244 | { |
|
237 | 245 | if(this->logFileEn && this->logFile->isOpen()) |
|
238 | 246 | { |
|
239 | 247 | *(this->logFileStrm) << text << endl; |
|
240 | 248 | } |
|
241 | 249 | } |
|
242 | 250 | |
|
243 | 251 | void rmapPluginUI::closeEvent(QCloseEvent *event) |
|
244 | 252 | { |
|
245 | 253 | if(this->logFile->isOpen()) |
|
246 | 254 | { |
|
247 | 255 | this->logFileStrm->flush(); |
|
248 | 256 | this->logFile->waitForBytesWritten(3000); |
|
249 | 257 | this->logFile->close(); |
|
250 | 258 | } |
|
251 | 259 | event->accept(); |
|
252 | 260 | } |
|
253 | 261 | |
|
254 | 262 | RMAP_command_codes rmapPluginUI::getCommandCode() |
|
255 | 263 | { |
|
256 | 264 | RMAP_command_codes commandCode = invalid0; |
|
257 | 265 | if (RMAP_write_verify->isChecked() and RMAP_write_reply->isChecked()) commandCode = writeSingle_ver_rep; |
|
258 | 266 | if (RMAP_write_verify->isChecked() and !RMAP_write_reply->isChecked()) commandCode = writeSingle_ver_noRep; |
|
259 | 267 | if (!RMAP_write_verify->isChecked() and RMAP_write_reply->isChecked()) commandCode = writeSingle_noVer_Rep; |
|
260 | 268 | if (!RMAP_write_verify->isChecked() and !RMAP_write_reply->isChecked()) commandCode = writeSingle_noVer_noRep; |
|
261 | 269 | emit commandCodeHasChanged(commandCode); |
|
262 | 270 | return commandCode; |
|
263 | 271 | } |
|
264 | 272 | |
|
265 | 273 | // SLOT |
|
266 | 274 | |
|
267 | 275 | void rmapPluginUI::selectionBetweenGresbAndStarDundee() //SLOT |
|
268 | 276 | { |
|
269 | 277 | if (selectGRESB_BUTTON->isChecked()) |
|
270 | 278 | { |
|
271 | 279 | gresb_GROUPBOX->setVisible(true); |
|
272 | 280 | stardundee_GROUPBOX->setVisible(false); |
|
273 | 281 | rmapOpenCommunicationButton->setEnabled(true); |
|
274 | 282 | emit bridgeHasChanged(selectedBridgeIsGRESB); |
|
275 | 283 | } |
|
276 | 284 | if (selectStarDundee_BUTTON->isChecked()) |
|
277 | 285 | { |
|
278 | 286 | stardundee_GROUPBOX->setVisible(true); |
|
279 | 287 | gresb_GROUPBOX->setVisible(false); |
|
280 | 288 | rmapOpenCommunicationButton->setEnabled(true); |
|
281 | 289 | emit bridgeHasChanged(selectedBridgeIsStarDundee); |
|
282 | 290 | } |
|
283 | 291 | } |
|
284 | 292 | |
|
285 | 293 | void rmapPluginUI::isOpen(bool flag) |
|
286 | 294 | { |
|
287 | 295 | if (flag == true) |
|
288 | 296 | { |
|
289 | 297 | selection_GROUPBOX->setEnabled(false); |
|
290 | 298 | this->rmapOpenCommunicationButton->setEnabled(false); |
|
291 | 299 | this->rmapCloseCommunicationButton->setEnabled(true); |
|
292 | 300 | } |
|
293 | 301 | if (flag == false) |
|
294 | 302 | { |
|
295 | 303 | selection_GROUPBOX->setEnabled(true); |
|
296 | 304 | this->rmapOpenCommunicationButton->setEnabled(true); |
|
297 | 305 | this->rmapCloseCommunicationButton->setEnabled(false); |
|
298 | 306 | } |
|
299 | 307 | } |
|
300 | 308 | |
|
301 | 309 |
@@ -1,161 +1,164 | |||
|
1 | 1 | /*------------------------------------------------------------------------------ |
|
2 | 2 | -- This file is a part of the LPPMON Software |
|
3 | 3 | -- Copyright (C) 20011, Laboratory of Plasma Physics - CNRS |
|
4 | 4 | -- |
|
5 | 5 | -- This program is free software; you can redistribute it and/or modify |
|
6 | 6 | -- it under the terms of the GNU General Public License as published by |
|
7 | 7 | -- the Free Software Foundation; either version 3 of the License, or |
|
8 | 8 | -- (at your option) any later version. |
|
9 | 9 | -- |
|
10 | 10 | -- This program is distributed in the hope that it will be useful, |
|
11 | 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 | 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 | 13 | -- GNU General Public License for more details. |
|
14 | 14 | -- |
|
15 | 15 | -- You should have received a copy of the GNU General Public License |
|
16 | 16 | -- along with this program; if not, write to the Free Software |
|
17 | 17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
18 | 18 | -------------------------------------------------------------------------------*/ |
|
19 | 19 | /*-- Author : Paul Leroy |
|
20 | 20 | -- Mail : paul.leroy@lpp.polytechnique.fr |
|
21 | 21 | ----------------------------------------------------------------------------*/ |
|
22 | 22 | #ifndef RMAPPLUGINUI_H |
|
23 | 23 | #define RMAPPLUGINUI_H |
|
24 | 24 | |
|
25 | 25 | #include <QWidget> |
|
26 | 26 | #include <QPushButton> |
|
27 | 27 | #include <QLabel> |
|
28 | 28 | #include <QSlider> |
|
29 | 29 | #include <QSpinBox> |
|
30 | 30 | #include <QGridLayout> |
|
31 | 31 | #include <QCheckBox> |
|
32 | 32 | #include <QFile> |
|
33 | 33 | #include <QTextStream> |
|
34 | 34 | #include <QFileDialog> |
|
35 | 35 | #include <QDir> |
|
36 | 36 | #include <QDialog> |
|
37 | 37 | #include <QCloseEvent> |
|
38 | 38 | #include <QTabWidget> |
|
39 | 39 | #include "qipdialogbox.h" |
|
40 | 40 | #include <rmapoperations.h> |
|
41 | 41 | #include <gresbstatusenquiry.h> |
|
42 | 42 | #include <QTextEdit> |
|
43 | 43 | #include "spectralmatricesdmasimulator.h" |
|
44 | 44 | #include <stardundee.h> |
|
45 | 45 | #include <gresb.h> |
|
46 | 46 | #include <QRadioButton> |
|
47 | 47 | #include <QGroupBox> |
|
48 | #include "wfdisplay.h" | |
|
48 | 49 | |
|
49 | 50 | enum selectedBridge{ |
|
50 | 51 | selectedBridgeIsUnknown, |
|
51 | 52 | selectedBridgeIsGRESB, |
|
52 | 53 | selectedBridgeIsStarDundee |
|
53 | 54 | }; |
|
54 | 55 | |
|
55 | 56 | class rmapPluginUI : public QWidget |
|
56 | 57 | { |
|
57 | 58 | Q_OBJECT |
|
58 | 59 | |
|
59 | 60 | public: |
|
60 | 61 | explicit rmapPluginUI(QWidget *parent = 0); |
|
61 | 62 | ~rmapPluginUI(); |
|
62 | 63 | |
|
63 | 64 | QPushButton* rmapOpenCommunicationButton; |
|
64 | 65 | QPushButton* rmapCloseCommunicationButton; |
|
65 | 66 | QPushButton* logFileChooseButton; |
|
66 | 67 | QPushButton* gresbStatusQueryRetryButton; |
|
67 | 68 | QPushButton* gresbStatusQueryAbortButton; |
|
68 | 69 | QPushButton* sendCCSDSCommandButton; |
|
69 | 70 | QPushButton* send_TC_LFR_UPDATE_TIME_Button; |
|
70 | 71 | QPushButton* reset_TC_LFR_UPDATE_TIME_Button; |
|
71 | 72 | QPushButton* clearConsoleButton; |
|
72 | 73 | |
|
73 | 74 | QRadioButton* selectGRESB_BUTTON; |
|
74 | 75 | QRadioButton* selectStarDundee_BUTTON; |
|
75 | 76 | |
|
76 | 77 | QGroupBox *selection_GROUPBOX; |
|
77 | 78 | |
|
78 | 79 | QSpinBox* gresbVirtualLinkSpinBox; |
|
79 | 80 | QSpinBox* spwLinkSpinBox; |
|
80 | 81 | QSpinBox* rmapSourceLogicalAddressSpinBox; |
|
81 | 82 | QSpinBox* rmapTargetLogicalAddressSpinBox; |
|
82 | 83 | QSpinBox* CCSDSTargetLogicalAddressSpinBox; |
|
83 | 84 | |
|
84 | 85 | //QIPDialogBox* gresbBridgeIPDialogBox; |
|
85 | 86 | |
|
86 | 87 | QCheckBox *logEnableCheckBox; |
|
87 | 88 | QCheckBox *RMAP_write_verify; |
|
88 | 89 | QCheckBox *RMAP_write_reply; |
|
89 | 90 | |
|
90 | 91 | QLabel* rmapSendStateLabel; |
|
91 | 92 | QLabel* rmapReceiveStateLabel; |
|
92 | 93 | QLabel* gresbStatusQueryLabel; |
|
93 | 94 | QLabel* gresbStatusQueryDialogLabel; |
|
94 | 95 | QLabel* sendCCSDSCommandLabel; |
|
95 | 96 | QLabel* nbPacketInStore; |
|
96 | 97 | |
|
97 | 98 | QDialog* gresbStatusQueryDialog; |
|
98 | 99 | |
|
99 | 100 | gresbStatusEnquiry* spwLinkStatusEnquiry; |
|
100 | 101 | |
|
101 | 102 | SpectralMatricesDMASimulator *spectralMatricesDMASimulator; |
|
102 | 103 | |
|
103 | 104 | QTextEdit* console; |
|
104 | 105 | |
|
106 | WFDisplay* wfDisplay; | |
|
107 | ||
|
105 | 108 | // SPACEWIRE BRIDGES |
|
106 | 109 | StarDundee *starDundee; |
|
107 | 110 | gresb *gresbBridge; |
|
108 | 111 | |
|
109 | 112 | bool islogfileenable(); |
|
110 | 113 | void appendToLogFile(const QString & text); |
|
111 | 114 | void closeEvent(QCloseEvent *event); |
|
112 | 115 | |
|
113 | 116 | public slots: |
|
114 | 117 | void chooseLogFile(); |
|
115 | 118 | void logFileEnDisable(int state); |
|
116 | 119 | RMAP_command_codes getCommandCode(); |
|
117 | 120 | |
|
118 | 121 | private slots: |
|
119 | 122 | void selectionBetweenGresbAndStarDundee(); |
|
120 | 123 | void isOpen(bool flag); |
|
121 | 124 | |
|
122 | 125 | signals: |
|
123 | 126 | void connectPortsig(QString PortName,int baudrate); |
|
124 | 127 | void setLogFileName(QString FileName); |
|
125 | 128 | void commandCodeHasChanged(RMAP_command_codes commandCode); |
|
126 | 129 | void bridgeHasChanged(selectedBridge bridge); |
|
127 | 130 | void targetHasChanged(unsigned char target); |
|
128 | 131 | void sourceHasChanged(unsigned char source); |
|
129 | 132 | |
|
130 | 133 | private: |
|
131 | 134 | QLabel *gresbBridgeIPLabel; |
|
132 | 135 | QLabel *gresbVirtualLinkLabel; |
|
133 | 136 | QLabel *spwLinkLabel; |
|
134 | 137 | QLabel *rmapSourceLogicalAddressLabel; |
|
135 | 138 | QLabel *rmapTargetLogicalAddressLabel; |
|
136 | 139 | QLabel *logFileName; |
|
137 | 140 | |
|
138 | 141 | QGridLayout *bridgeSelection_LAYOUT; |
|
142 | QGridLayout *connectionLayout; | |
|
143 | QGridLayout *gresbStatusQueryDialogLayout; | |
|
144 | QGridLayout *generalParameters_LAYOUT; | |
|
139 | 145 | QVBoxLayout *selectionLayout; |
|
140 | 146 | QVBoxLayout *mainLayout; |
|
141 | QGridLayout *connectionLayout; | |
|
142 | 147 | QVBoxLayout *ccsdsLayout; |
|
143 | 148 | QVBoxLayout *consoleLayout; |
|
144 | QGridLayout *gresbStatusQueryDialogLayout; | |
|
145 | QGridLayout *generalParameters_LAYOUT; | |
|
146 | 149 | |
|
147 | 150 | QTabWidget *spwTabWidget; |
|
148 | 151 | |
|
149 | 152 | QWidget* bridgeWidget; |
|
150 | 153 | |
|
151 | 154 | QGroupBox *gresb_GROUPBOX; |
|
152 | 155 | QGroupBox *stardundee_GROUPBOX; |
|
153 | 156 | QGroupBox *generalParameters_GROUPBOX; |
|
154 | 157 | |
|
155 | 158 | QFile *logFile; |
|
156 | 159 | QTextStream *logFileStrm; |
|
157 | 160 | bool logFileEn; |
|
158 | 161 | |
|
159 | 162 | }; |
|
160 | 163 | |
|
161 | 164 | #endif // RMAPPLUGINUI_H |
@@ -1,850 +1,845 | |||
|
1 | 1 | #include "stardundee.h" |
|
2 | 2 | #include <QTime> |
|
3 | 3 | #include <math.h> |
|
4 | 4 | #include "ccsds.h" |
|
5 | 5 | |
|
6 | 6 | StarDundee::StarDundee(QWidget *parent) : |
|
7 | 7 | QWidget(parent) |
|
8 | 8 | { |
|
9 | 9 | // Packet receiver |
|
10 | 10 | timer = new QTimer; |
|
11 | 11 | rmapPacketSEMAPHORE = new QSemaphore; |
|
12 | 12 | ccsdsPacketSEMAPHORE = new QSemaphore; |
|
13 | 13 | rmapPacket = (char*) malloc(RMAP_MAX_PACKET_LENGTH); |
|
14 | 14 | ccsdsPacket = (unsigned char*) malloc(CCSDS_MAX_PACKET_LENGTH); |
|
15 | 15 | spwPacket = (char*) malloc( qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH) ); |
|
16 | 16 | |
|
17 | 17 | starDundeeStatusQueryDialog = new QDialog; |
|
18 | 18 | |
|
19 | 19 | commandCode = invalid0; // initialization of the cmmand code for the RMAP transfers |
|
20 | 20 | rmapTargetLogicalAddress = DEFAULT_TARGET; |
|
21 | 21 | rmapSourceLogicalAddress = DEFAULT_SOURCE; |
|
22 | 22 | |
|
23 | 23 | connection_LAYOUT = new QGridLayout; |
|
24 | 24 | |
|
25 | 25 | usbDeviceNumber_LABEL = new QLabel(tr("USB device number: ")); |
|
26 | 26 | linkNumber_LABEL = new QLabel(tr("SpaceWire link number: ")); |
|
27 | 27 | starDundeeStatusQueryDialogLabel = new QLabel(tr("SpaceWire link not running")); |
|
28 | 28 | |
|
29 | 29 | //*** QPUSHBUTTON ***// |
|
30 | 30 | starDundeeStatusQueryRetryButton = new QPushButton(tr("Retry")); |
|
31 | 31 | starDundeeStatusQueryAbortButton = new QPushButton(tr("Abort")); |
|
32 | 32 | |
|
33 | 33 | usbDeviceNumber_SPINBOX = new QSpinBox; |
|
34 | 34 | usbDeviceNumber_SPINBOX->setRange(0,32); |
|
35 | 35 | usbDeviceNumber_SPINBOX->setValue(0); |
|
36 | 36 | linkNumber_SPINBOX = new QSpinBox; |
|
37 | 37 | linkNumber_SPINBOX->setRange(1,2); |
|
38 | 38 | linkNumber_SPINBOX->setValue(1); |
|
39 | 39 | |
|
40 | 40 | // STAR DUNDEE STATUS QUERY DIALOG |
|
41 | 41 | starDundeeStatusQueryDialogLayout = new QGridLayout; |
|
42 | 42 | starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryDialogLabel, 0, 0, 1, 2); |
|
43 | 43 | starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryRetryButton, 1, 0, 0); |
|
44 | 44 | starDundeeStatusQueryDialogLayout->addWidget(starDundeeStatusQueryAbortButton, 1, 1, 0); |
|
45 | 45 | starDundeeStatusQueryDialog->setLayout(starDundeeStatusQueryDialogLayout); |
|
46 | 46 | |
|
47 | 47 | connection_LAYOUT->addWidget(usbDeviceNumber_LABEL, 0, 0, 1, 1); |
|
48 | 48 | connection_LAYOUT->addWidget(usbDeviceNumber_SPINBOX, 0, 1, 1, 1); |
|
49 | 49 | connection_LAYOUT->addWidget(linkNumber_LABEL, 1, 0, 1, 1); |
|
50 | 50 | connection_LAYOUT->addWidget(linkNumber_SPINBOX, 1, 1, 1, 1); |
|
51 | 51 | |
|
52 | 52 | connection_LAYOUT->setRowStretch(2, 1); |
|
53 | 53 | connection_LAYOUT->setColumnStretch(2, 1); |
|
54 | 54 | |
|
55 | 55 | this->setLayout(connection_LAYOUT); |
|
56 | 56 | |
|
57 | 57 | connect(starDundeeStatusQueryRetryButton, SIGNAL(clicked()), this, SLOT(reTestSPWLink())); |
|
58 | 58 | connect(starDundeeStatusQueryAbortButton, SIGNAL(clicked()), starDundeeStatusQueryDialog, SLOT(reject())); |
|
59 | 59 | |
|
60 | 60 | connect(this->timer, SIGNAL(timeout()), this, SLOT(receivePollingLoop())); |
|
61 | 61 | } |
|
62 | 62 | |
|
63 | 63 | StarDundee::~StarDundee() |
|
64 | 64 | { |
|
65 | 65 | free(rmapPacket); |
|
66 | 66 | free(ccsdsPacket); |
|
67 | 67 | free(spwPacket); |
|
68 | 68 | USBSpaceWire_Close(hDevice); // Close the device |
|
69 | 69 | } |
|
70 | 70 | |
|
71 | 71 | void StarDundee::Open() |
|
72 | 72 | { |
|
73 | 73 | int status; |
|
74 | 74 | U32 statusControl; |
|
75 | 75 | |
|
76 | 76 | if (!USBSpaceWire_Open(&hDevice, usbDeviceNumber_SPINBOX->value())) // Open the USB device |
|
77 | 77 | { |
|
78 | 78 | emit sendMessage("stardundee *** Open *** ERROR: USBSpaceWire_Open(&hDevice, 0))"); |
|
79 | 79 | return; |
|
80 | 80 | } |
|
81 | 81 | emit sendMessage("stardundee *** Open *** USBSpaceWire_Open successful, device number: " |
|
82 | 82 | + QString::number(usbDeviceNumber_SPINBOX->value())); |
|
83 | 83 | |
|
84 | 84 | USBSpaceWire_EnableNetworkMode(hDevice, 0); // deactivate the network mode |
|
85 | 85 | CFGSpaceWire_EnableRMAP(1); // Enable the use of RMAP for the StarDundee brick configuration |
|
86 | 86 | CFGSpaceWire_SetRMAPDestinationKey(0x20); // Set the destination key expected by STAR-Dundee devices |
|
87 | 87 | |
|
88 | 88 | // Set the path and return path to the device |
|
89 | 89 | CFGSpaceWire_StackClear(); |
|
90 | 90 | CFGSpaceWire_AddrStackPush(0); |
|
91 | 91 | CFGSpaceWire_AddrStackPush(254); |
|
92 | 92 | CFGSpaceWire_RetAddrStackPush(254); |
|
93 | 93 | |
|
94 | 94 | // set the base transmit rate to 100 MHz |
|
95 | 95 | status = CFGSpaceWire_SetBrickBaseTransmitRate( hDevice, CFG_BRK_CLK_100_MHZ, CFG_BRK_DVDR_1, 0xff); |
|
96 | 96 | if (status != CFG_TRANSFER_SUCCESS) |
|
97 | 97 | { |
|
98 | 98 | emit sendMessage("ERROR CFGSpaceWire_SetBrickBaseTransmitRate"); |
|
99 | 99 | } |
|
100 | 100 | else emit sendMessage("OK CFGSpaceWire_SetBrickBaseTransmitRate, base rate = 100 MHz"); |
|
101 | 101 | // read the link status |
|
102 | 102 | if (CFGSpaceWire_GetLinkStatusControl(hDevice, linkNumber_SPINBOX->value(), &statusControl) != CFG_TRANSFER_SUCCESS) |
|
103 | 103 | { |
|
104 | 104 | emit sendMessage("Could not read link status control for link " + QString::number(linkNumber_SPINBOX->value())); |
|
105 | 105 | } |
|
106 | 106 | else |
|
107 | 107 | { |
|
108 | 108 | emit sendMessage("OK CFGSpaceWire_GetLinkStatusControl of link " + QString::number(linkNumber_SPINBOX->value())); |
|
109 | 109 | |
|
110 | 110 | // Set the link status control register properties |
|
111 | 111 | CFGSpaceWire_LSEnableAutoStart(&statusControl, 1); |
|
112 | 112 | CFGSpaceWire_LSEnableStart(&statusControl, 1); |
|
113 | 113 | CFGSpaceWire_LSEnableDisabled(&statusControl, 0); |
|
114 | 114 | CFGSpaceWire_LSEnableTristate(&statusControl, 0); |
|
115 | 115 | CFGSpaceWire_LSSetOperatingSpeed(&statusControl, 9); // sets the link speed to ( 100 MHz / (9+1) ) = 10 MHz |
|
116 | 116 | |
|
117 | 117 | // Set the link status control register |
|
118 | 118 | if (CFGSpaceWire_SetLinkStatusControl(hDevice, linkNumber_SPINBOX->value(), statusControl) != CFG_TRANSFER_SUCCESS) |
|
119 | 119 | { |
|
120 | 120 | emit sendMessage("Could not set the link status control for link " + QString::number(linkNumber_SPINBOX->value())); |
|
121 | 121 | } |
|
122 | 122 | else emit sendMessage("Set the link status control for link " + QString::number(linkNumber_SPINBOX->value())); |
|
123 | 123 | } |
|
124 | 124 | |
|
125 | 125 | if (CFGSpaceWire_SetAsInterface(hDevice, 1, 0) != CFG_TRANSFER_SUCCESS) |
|
126 | 126 | { |
|
127 | 127 | emit sendMessage("Could not set the device to be an interface"); |
|
128 | 128 | } |
|
129 | 129 | else |
|
130 | 130 | { |
|
131 | 131 | emit sendMessage("Device set to be an interface"); |
|
132 | 132 | } |
|
133 | 133 | |
|
134 | 134 | //setRoutingTableEntry(rmapTargetLogicalAddress, (1<<linkNumber_SPINBOX->value())); |
|
135 | 135 | //setRoutingTableEntry(rmapSourceLogicalAddress, (1<<3)); |
|
136 | 136 | //GetRoutingTableEntry(rmapTargetLogicalAddress); |
|
137 | 137 | //GetRoutingTableEntry(rmapSourceLogicalAddress); |
|
138 | 138 | |
|
139 | 139 | USBSpaceWire_RegisterReceiveOnAllPorts(hDevice); // Register to receive on all ports |
|
140 | 140 | USBSpaceWire_ClearEndpoints(hDevice); // clear the USB endpoints |
|
141 | 141 | |
|
142 | 142 | emit sendMessage("The driver's current send buffer size is " + QString::number(USBSpaceWire_GetDriverSendBufferSize(hDevice)) + " bytes"); |
|
143 | 143 | emit sendMessage("The driver's current read buffer size is " + QString::number(USBSpaceWire_GetDriverReadBufferSize(hDevice)) + " bytes"); |
|
144 | 144 | emit sendMessage("USBSpaceWire_IsReadThrottling is " + QString::number(USBSpaceWire_IsReadThrottling(hDevice))); |
|
145 | 145 | |
|
146 | 146 | // initialize SPW packet semaphores |
|
147 | 147 | while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire(); |
|
148 | 148 | while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire(); |
|
149 | 149 | |
|
150 | 150 | if (getLinkStatus(linkNumber_SPINBOX->value())) |
|
151 | 151 | { |
|
152 | 152 | emit isOpen(true); |
|
153 | 153 | timer->start(100); // starts the periodical timer, period = 100ms |
|
154 | 154 | } |
|
155 | 155 | else |
|
156 | 156 | { |
|
157 | 157 | starDundeeStatusQueryDialog->exec(); |
|
158 | 158 | } |
|
159 | 159 | } |
|
160 | 160 | |
|
161 | 161 | void StarDundee::Close() |
|
162 | 162 | { |
|
163 | 163 | USBSpaceWire_Close(hDevice); // Close the device |
|
164 | 164 | emit sendMessage("stardundee *** Close *** USBSpaceWire_Close, device: " + QString::number(usbDeviceNumber_SPINBOX->value())); |
|
165 | 165 | |
|
166 | 166 | USBSpaceWire_UnregisterReceiveOnAllPorts(hDevice); // Stop receiving on all ports |
|
167 | 167 | |
|
168 | 168 | emit isOpen(false); |
|
169 | 169 | } |
|
170 | 170 | |
|
171 | 171 | unsigned char StarDundee::setRoutingTableEntry(int tableEntry, U32 dwOutputPorts) |
|
172 | 172 | { |
|
173 | 173 | U32 routingTableEntry; |
|
174 | 174 | // SET THE ROUTING TABLE ENTRY FOR LOGICAL ADDRESSING, TARGET entryNumber |
|
175 | 175 | if (CFGSpaceWire_ClearRoutingTableEntry(hDevice, tableEntry) != CFG_TRANSFER_SUCCESS) |
|
176 | 176 | { |
|
177 | 177 | emit sendMessage("Could not clear routing table entry " + QString::number(tableEntry)); |
|
178 | 178 | } |
|
179 | 179 | // Build the routing table entry |
|
180 | 180 | CFGSpaceWire_RTBuildRoutingTableEntry(&routingTableEntry, |
|
181 | 181 | dwOutputPorts, // route out of port dwOutputPorts |
|
182 | 182 | 0, // header deletion disabled |
|
183 | 183 | 0); // priority normal |
|
184 | 184 | // Set the routing table entry for logical address tableEntry |
|
185 | 185 | if (CFGSpaceWire_SetRoutingTableEntry(hDevice, tableEntry, routingTableEntry) != CFG_TRANSFER_SUCCESS) |
|
186 | 186 | { |
|
187 | 187 | emit sendMessage("Could not set routing table entry [" + QString::number(tableEntry) + "]"); |
|
188 | 188 | } |
|
189 | 189 | else emit sendMessage("Routing table entry [" + QString::number(tableEntry) + "] set" ); |
|
190 | 190 | return 1; |
|
191 | 191 | } |
|
192 | 192 | |
|
193 | 193 | unsigned int StarDundee::GetRoutingTableEntry(int tableEntry) |
|
194 | 194 | { |
|
195 | 195 | U32 routingTableEntry, outputPorts; |
|
196 | 196 | char enabled, delHead, priority; |
|
197 | 197 | int portNum; |
|
198 | 198 | |
|
199 | 199 | emit sendMessage("GetRoutingTableEntry [" + QString::number(tableEntry) + "]"); |
|
200 | 200 | // Read the routing table entry |
|
201 | 201 | if (CFGSpaceWire_GetRoutingTableEntry(hDevice, tableEntry, &routingTableEntry) != CFG_TRANSFER_SUCCESS) |
|
202 | 202 | { |
|
203 | 203 | emit sendMessage("Could not read routing table entry [" + QString::number(tableEntry) + "]"); |
|
204 | 204 | } |
|
205 | 205 | else |
|
206 | 206 | { |
|
207 | 207 | // Display the routing table entry properties |
|
208 | 208 | CFGSpaceWire_RTIsEnabled(routingTableEntry, &enabled); |
|
209 | 209 | CFGSpaceWire_RTIsDelHead(routingTableEntry, &delHead); |
|
210 | 210 | CFGSpaceWire_RTIsPriority(routingTableEntry, &priority); |
|
211 | 211 | CFGSpaceWire_RTGetOutputPorts(routingTableEntry, &outputPorts); |
|
212 | 212 | emit sendMessage("CFGSpaceWire_RTIsEnabled : " + QString::number(enabled)); |
|
213 | 213 | emit sendMessage("CFGSpaceWire_RTIsDelHead : " + QString::number(delHead)); |
|
214 | 214 | emit sendMessage("CFGSpaceWire_RTIsPriority : " + QString::number(priority)); |
|
215 | 215 | emit sendMessage("CFGSpaceWire_RTGetOutputPorts : "); |
|
216 | 216 | for (portNum = 0; portNum < 32; portNum++) |
|
217 | 217 | { |
|
218 | 218 | if (outputPorts & (1 << portNum)) |
|
219 | 219 | { |
|
220 | 220 | emit sendMessage(QString::number(portNum)); |
|
221 | 221 | } |
|
222 | 222 | } |
|
223 | 223 | } |
|
224 | 224 | |
|
225 | 225 | return 1; |
|
226 | 226 | } |
|
227 | 227 | |
|
228 | 228 | unsigned int StarDundee::Write(unsigned int *Value, unsigned int count, unsigned int address) |
|
229 | 229 | { |
|
230 | 230 | unsigned int remainingCount = count; |
|
231 | 231 | unsigned int iOffset = 0; |
|
232 | 232 | QString console_message; |
|
233 | 233 | char* data; |
|
234 | 234 | |
|
235 | 235 | if(rmapPacketSEMAPHORE->available()!=0) |
|
236 | 236 | { |
|
237 | 237 | emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP request already running, WRITE access stopped"); |
|
238 | 238 | return 1; |
|
239 | 239 | } |
|
240 | 240 | |
|
241 | 241 | emit this->RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable"); |
|
242 | 242 | |
|
243 | 243 | data = (char*) malloc(READ_WRITE_MAX_COUNTS*4); |
|
244 | 244 | |
|
245 | 245 | emit appendToLog(QString("*** START *** WRITE ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16)); |
|
246 | 246 | |
|
247 | 247 | while (remainingCount > READ_WRITE_MAX_COUNTS) |
|
248 | 248 | { |
|
249 | 249 | for (int i = 0; i<READ_WRITE_MAX_COUNTS; i++) |
|
250 | 250 | { |
|
251 | 251 | data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]); |
|
252 | 252 | data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8); |
|
253 | 253 | data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16); |
|
254 | 254 | data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24); |
|
255 | 255 | } |
|
256 | 256 | |
|
257 | 257 | console_message.sprintf("remainingCount: %d => ", remainingCount); |
|
258 | 258 | emit appendToLog(console_message + QString("Write ")+ QString::number(READ_WRITE_MAX_COUNTS*4) + QString(" byte(s) @0x")+ QString::number(address,16)); |
|
259 | 259 | |
|
260 | 260 | if(WriteBLOCK(data, READ_WRITE_MAX_COUNTS*4, address)==0) |
|
261 | 261 | { |
|
262 | 262 | emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed"); |
|
263 | 263 | return 1; |
|
264 | 264 | } |
|
265 | 265 | |
|
266 | 266 | remainingCount = remainingCount - READ_WRITE_MAX_COUNTS; |
|
267 | 267 | address = address + READ_WRITE_MAX_COUNTS * 4; |
|
268 | 268 | iOffset = iOffset + READ_WRITE_MAX_COUNTS; |
|
269 | 269 | } |
|
270 | 270 | |
|
271 | 271 | if (remainingCount > 0) |
|
272 | 272 | { |
|
273 | 273 | for (unsigned int i = 0; i<remainingCount; i++) |
|
274 | 274 | { |
|
275 | 275 | data[i*4+3] = (char) ((unsigned int) Value[i+iOffset]); |
|
276 | 276 | data[i*4+2] = (char) ((unsigned int) Value[i+iOffset]>>8); |
|
277 | 277 | data[i*4+1] = (char) ((unsigned int) Value[i+iOffset]>>16); |
|
278 | 278 | data[i*4+0] = (char) ((unsigned int) Value[i+iOffset]>>24); |
|
279 | 279 | } |
|
280 | 280 | |
|
281 | 281 | console_message.sprintf("remainingCount: %d => ", remainingCount); |
|
282 | 282 | emit appendToLog(console_message + QString("Write ")+ QString::number(remainingCount*4) + QString(" byte(s) @0x")+ QString::number(address,16)); |
|
283 | 283 | |
|
284 | 284 | if (WriteBLOCK(data, remainingCount*4, address)==0) |
|
285 | 285 | { |
|
286 | 286 | emit appendToLog("WARNING === in function WRITE of rmapplugin *** RMAP write command failed"); |
|
287 | 287 | return 1; |
|
288 | 288 | } |
|
289 | 289 | } |
|
290 | 290 | |
|
291 | 291 | emit appendToLog(QString("*** STOP *** WRITE")); |
|
292 | 292 | free(data); |
|
293 | 293 | return count; |
|
294 | 294 | } |
|
295 | 295 | |
|
296 | 296 | unsigned int StarDundee::Read(unsigned int *Value, unsigned int count, unsigned int address) |
|
297 | 297 | { |
|
298 | 298 | unsigned int remainingCount = count; |
|
299 | 299 | unsigned int iOffset = 0; |
|
300 | 300 | QString console_message; |
|
301 | 301 | |
|
302 | 302 | if(rmapPacketSEMAPHORE->available()!=0) |
|
303 | 303 | { |
|
304 | 304 | emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP request already running, READ access stopped"); |
|
305 | 305 | return 1; |
|
306 | 306 | } |
|
307 | 307 | emit appendToLog(QString("*** START *** READ ")+ QString::number(count) + QString(" word(s) @0x")+ QString::number(address,16)); |
|
308 | 308 | |
|
309 | 309 | while (remainingCount > READ_WRITE_MAX_COUNTS) |
|
310 | 310 | { |
|
311 | 311 | console_message.sprintf("remainingCount: %d => ", remainingCount); |
|
312 | 312 | emit appendToLog(console_message + QString("Read ")+ QString::number(4*READ_WRITE_MAX_COUNTS) + QString(" byte(s) @0x")+ QString::number(address,16)); |
|
313 | 313 | |
|
314 | 314 | if (this->ReadBLOCK(READ_WRITE_MAX_COUNTS*4, address)==0) |
|
315 | 315 | { |
|
316 | 316 | emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received"); |
|
317 | 317 | return 1; |
|
318 | 318 | } |
|
319 | 319 | |
|
320 | 320 | for(int i=0;i<READ_WRITE_MAX_COUNTS;i++) |
|
321 | 321 | { |
|
322 | 322 | Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH]; |
|
323 | 323 | for(int j=1;j<4;j++) |
|
324 | 324 | { |
|
325 | 325 | Value[i+iOffset]= ((unsigned char) (rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) |
|
326 | 326 | + Value[i+iOffset]*256; |
|
327 | 327 | } |
|
328 | 328 | } |
|
329 | 329 | |
|
330 | 330 | remainingCount = remainingCount - READ_WRITE_MAX_COUNTS; |
|
331 | 331 | address = address + READ_WRITE_MAX_COUNTS * 4; |
|
332 | 332 | iOffset = iOffset + READ_WRITE_MAX_COUNTS; |
|
333 | 333 | this->acquireRMAPSemaphore(); |
|
334 | 334 | } |
|
335 | 335 | |
|
336 | 336 | if (remainingCount > 0) |
|
337 | 337 | { |
|
338 | 338 | console_message.sprintf("remainingCount: %d => ", remainingCount); |
|
339 | 339 | emit appendToLog(console_message + QString("Read ")+ QString::number(4*remainingCount) + QString(" byte(s) @0x")+ QString::number(address,16)); |
|
340 | 340 | |
|
341 | 341 | if (this->ReadBLOCK(4*remainingCount, address)==0) |
|
342 | 342 | { |
|
343 | 343 | emit appendToLog("WARNING === in function READ of rmapplugin *** RMAP packet not received"); |
|
344 | 344 | return 1; |
|
345 | 345 | } |
|
346 | 346 | |
|
347 | 347 | for(unsigned int i=0;i<remainingCount;i++) |
|
348 | 348 | { |
|
349 | 349 | Value[i+iOffset] = (unsigned char) rmapPacket[i*4+RMAP_READ_REPLY_HEADER_LENGTH]; |
|
350 | 350 | for(int j=1;j<4;j++) |
|
351 | 351 | { |
|
352 | 352 | Value[i+iOffset]= ((unsigned char)(rmapPacket[i*4+j+RMAP_READ_REPLY_HEADER_LENGTH])) + Value[i+iOffset]*256; |
|
353 | 353 | } |
|
354 | 354 | } |
|
355 | 355 | this->acquireRMAPSemaphore(); |
|
356 | 356 | } |
|
357 | 357 | |
|
358 | 358 | emit appendToLog(QString("*** STOP *** READ ")); |
|
359 | 359 | return count; |
|
360 | 360 | } |
|
361 | 361 | |
|
362 | 362 | unsigned int StarDundee::WriteBLOCK(char *data, unsigned int nbBytes, unsigned int address) |
|
363 | 363 | { |
|
364 | 364 | RMAP *RMAPCommand; |
|
365 | 365 | char * packet; |
|
366 | 366 | char* aux; |
|
367 | 367 | unsigned char offset, headerSize, CRCSize; |
|
368 | 368 | unsigned int totalSize; |
|
369 | 369 | int errorCode; |
|
370 | 370 | QString console_message; |
|
371 | 371 | |
|
372 | 372 | if (getLinkStatus(this->linkNumber_SPINBOX->value()) == 0) |
|
373 | 373 | { |
|
374 | 374 | this->Close(); |
|
375 | 375 | return 1; |
|
376 | 376 | } |
|
377 | 377 | |
|
378 | 378 | RMAPCommand = new RMAP(this->commandCode, |
|
379 | 379 | rmapTargetLogicalAddress, |
|
380 | 380 | rmapSourceLogicalAddress, |
|
381 | 381 | address, |
|
382 | 382 | nbBytes, |
|
383 | 383 | data); |
|
384 | 384 | headerSize = sizeof(RMAPCommand->RMAPHeader); |
|
385 | 385 | CRCSize = 1; |
|
386 | 386 | |
|
387 | 387 | //************************* |
|
388 | 388 | // BUILD THE PACKET TO SEND |
|
389 | 389 | totalSize = headerSize + nbBytes + CRCSize + PATH_ADDRESSING_OFFSET; |
|
390 | 390 | packet = (char*) malloc( totalSize ); |
|
391 | 391 | aux = (char*) ((void*) &RMAPCommand->RMAPHeader); |
|
392 | 392 | packet[0] = this->linkNumber_SPINBOX->value(); |
|
393 | 393 | for(unsigned int i = 0; i<headerSize; i++) packet[i+PATH_ADDRESSING_OFFSET] = aux[i]; |
|
394 | 394 | offset = headerSize; |
|
395 | 395 | for(unsigned int i = 0; i<nbBytes; i++) |
|
396 | 396 | { |
|
397 | 397 | packet[i+offset+PATH_ADDRESSING_OFFSET] = data[i]; |
|
398 | 398 | } |
|
399 | 399 | packet[nbBytes+offset+PATH_ADDRESSING_OFFSET] = RMAPCommand->dataCRC; |
|
400 | 400 | |
|
401 | 401 | //**************** |
|
402 | 402 | // SEND THE PACKET |
|
403 | 403 | result = USBSpaceWire_SendPacket(hDevice, |
|
404 | 404 | packet, |
|
405 | 405 | totalSize, |
|
406 | 406 | BWAIT_1, &pIdentifier); |
|
407 | 407 | if (result != TRANSFER_SUCCESS) |
|
408 | 408 | { |
|
409 | 409 | emit sendMessage("ERROR *** WriteStarDundee when sending packet of size " |
|
410 | 410 | + QString::number(totalSize) +", with code: " + QString::number(result)); |
|
411 | 411 | USBSpaceWire_FreeSend(hDevice, pIdentifier); |
|
412 | 412 | free(data); |
|
413 | 413 | return 1; |
|
414 | 414 | } |
|
415 | 415 | else emit sendMessage("OK *** WriteStarDundee when sending packet of size " + QString::number(totalSize)); |
|
416 | 416 | |
|
417 | 417 | //************** |
|
418 | 418 | // Free the send |
|
419 | 419 | USBSpaceWire_FreeSend(hDevice, pIdentifier); |
|
420 | 420 | free(packet); |
|
421 | 421 | |
|
422 | 422 | if ( (commandCode == writeSingle_noVer_Rep) | (commandCode == writeInc_noVer_Rep) | |
|
423 | 423 | (commandCode == writeSingle_ver_rep) | (commandCode == writeInc_ver_rep) ) |
|
424 | 424 | { |
|
425 | 425 | // WAIT FOR THE RMAP REPLY PACKET |
|
426 | 426 | errorCode = this->receiveSPWPacket(1); |
|
427 | 427 | if (errorCode<=0) |
|
428 | 428 | { |
|
429 | 429 | emit appendToLog("WARNING === in function WriteBLOCK of rmapplugin *** RMAP packet reception failed with code " + QString::number(errorCode)); |
|
430 | 430 | return 0; |
|
431 | 431 | } |
|
432 | 432 | if(rmapPacketSize != 8) |
|
433 | 433 | { |
|
434 | 434 | console_message.sprintf("WARNING === in function WRITE (with reply) of rmapplugin *** write reply format not compliant\n"); |
|
435 | 435 | emit appendToLog(console_message); |
|
436 | 436 | return 0; |
|
437 | 437 | } |
|
438 | 438 | switch (this->rmapPacket[3]) // byte 4 is the status byte in the reply |
|
439 | 439 | { |
|
440 | 440 | case 0: |
|
441 | 441 | emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 0 Successfull"); |
|
442 | 442 | break; |
|
443 | 443 | case 1: |
|
444 | 444 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** General error code"); |
|
445 | 445 | emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 1 General error code"); |
|
446 | 446 | break; |
|
447 | 447 | case 2: |
|
448 | 448 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Unused RMAP packet type or command code"); |
|
449 | 449 | emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 2 Unused RMAP packet type or command code"); |
|
450 | 450 | break; |
|
451 | 451 | case 3: |
|
452 | 452 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid key"); |
|
453 | 453 | emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 3 Invalid key"); |
|
454 | 454 | break; |
|
455 | 455 | case 4: |
|
456 | 456 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid data CRC"); |
|
457 | 457 | emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 4 Invalid data CRC"); |
|
458 | 458 | break; |
|
459 | 459 | case 5: |
|
460 | 460 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Early EOP"); |
|
461 | 461 | emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 5 Early EOP"); |
|
462 | 462 | break; |
|
463 | 463 | case 6: |
|
464 | 464 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Too much data"); |
|
465 | 465 | emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 6 Too much data"); |
|
466 | 466 | break; |
|
467 | 467 | case 7: |
|
468 | 468 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** EEP"); |
|
469 | 469 | emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 7 EEP"); |
|
470 | 470 | break; |
|
471 | 471 | case 8: |
|
472 | 472 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Reserved"); |
|
473 | 473 | emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 8 Reserved"); |
|
474 | 474 | break; |
|
475 | 475 | case 9: |
|
476 | 476 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Verify buffer overrun"); |
|
477 | 477 | emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 9 Verify buffer overrun"); |
|
478 | 478 | break; |
|
479 | 479 | case 10: |
|
480 | 480 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMAP command not implemented or not authorised"); |
|
481 | 481 | emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 10 RMAP command not implemented or not authorised"); |
|
482 | 482 | break; |
|
483 | 483 | case 11: |
|
484 | 484 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** RMW data length error"); |
|
485 | 485 | emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 11 RMAP RMW data length error"); |
|
486 | 486 | break; |
|
487 | 487 | case 12: |
|
488 | 488 | emit appendToLog("WARNING === in function WRITE (with reply) of rmapplugin *** Invalid target logical address"); |
|
489 | 489 | emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: 12 Invalid target logical address"); |
|
490 | 490 | break; |
|
491 | 491 | } |
|
492 | 492 | this->acquireRMAPSemaphore(); |
|
493 | 493 | } |
|
494 | 494 | else |
|
495 | 495 | emit RMAP_write_reply_setText("reply to the write command required\nlast reply status: unavailable"); |
|
496 | 496 | |
|
497 | 497 | return nbBytes; |
|
498 | 498 | } |
|
499 | 499 | |
|
500 | 500 | unsigned int StarDundee::ReadBLOCK(unsigned int nbBytes, unsigned int address) |
|
501 | 501 | { |
|
502 | 502 | int errorCode; |
|
503 | 503 | RMAP *RMAPCommand; |
|
504 | 504 | char *packet; |
|
505 | 505 | char *aux; |
|
506 | 506 | unsigned int dataLength = 0; |
|
507 | 507 | unsigned int totalSize = 0; |
|
508 | 508 | |
|
509 | 509 | //********************** |
|
510 | 510 | // Check the link status |
|
511 | 511 | if ( getLinkStatus( this->linkNumber_SPINBOX->value() ) == 0 ) |
|
512 | 512 | { |
|
513 | 513 | this->Close(); |
|
514 | 514 | emit appendToLog("WARNING === in function WriteSPW of StarDundee *** SPW link not running\n"); |
|
515 | 515 | return 0; |
|
516 | 516 | } |
|
517 | 517 | |
|
518 | 518 | //********************** |
|
519 | 519 | // SEND THE READ COMMAND |
|
520 | 520 | if (nbBytes > 4) |
|
521 | 521 | { |
|
522 | 522 | RMAPCommand = new RMAP(read_Inc, |
|
523 | 523 | rmapTargetLogicalAddress, |
|
524 | 524 | rmapSourceLogicalAddress, |
|
525 | 525 | address, |
|
526 | 526 | nbBytes, |
|
527 | 527 | NULL); |
|
528 | 528 | } |
|
529 | 529 | else |
|
530 | 530 | { |
|
531 | 531 | RMAPCommand = new RMAP(read_Single, |
|
532 | 532 | rmapTargetLogicalAddress, |
|
533 | 533 | rmapSourceLogicalAddress, |
|
534 | 534 | address, |
|
535 | 535 | nbBytes, |
|
536 | 536 | NULL); |
|
537 | 537 | } |
|
538 | 538 | |
|
539 | 539 | //************************* |
|
540 | 540 | // BUILD THE PACKET TO SEND |
|
541 | 541 | totalSize = sizeof(RMAPCommand->RMAPHeader) + PATH_ADDRESSING_OFFSET; |
|
542 | 542 | packet = (char*) malloc( totalSize ); |
|
543 | 543 | aux = (char*) ((void*) &RMAPCommand->RMAPHeader); |
|
544 | 544 | packet[0] = this->linkNumber_SPINBOX->value(); |
|
545 | 545 | for (unsigned int i = 0; i<sizeof(RMAPCommand->RMAPHeader); i++) |
|
546 | 546 | packet[i+PATH_ADDRESSING_OFFSET] = aux[i]; |
|
547 | 547 | |
|
548 | 548 | //**************** |
|
549 | 549 | // SEND THE PACKET |
|
550 | 550 | result = USBSpaceWire_SendPacket(hDevice, |
|
551 | 551 | packet, |
|
552 | 552 | totalSize, |
|
553 | 553 | BWAIT_1, &pIdentifier); |
|
554 | 554 | if (result != TRANSFER_SUCCESS) emit sendMessage("ERR *** ReadStarDundee *** ReadBLOCK *** sending the READ command "); |
|
555 | 555 | else |
|
556 | 556 | { |
|
557 | 557 | emit sendMessage("OK *** ReadStarDundee *** ReadBLOCK *** sending the READ command"); |
|
558 | 558 | emit appendToLog("packet sent, B0 = " + QString::number(packet[0], 16) |
|
559 | 559 | + " *** B1 = " + QString::number(packet[1], 16) |
|
560 | 560 | + " *** B2 = " + QString::number(packet[2], 16) |
|
561 | 561 | + " *** B3 = " + QString::number(packet[3], 16) |
|
562 | 562 | + " *** B4 = " + QString::number(packet[4], 16) |
|
563 | 563 | + " *** B5 = " + QString::number(packet[5], 16) |
|
564 | 564 | ); |
|
565 | 565 | } |
|
566 | 566 | |
|
567 | 567 | //************** |
|
568 | 568 | // Free the send |
|
569 | 569 | USBSpaceWire_FreeSend(hDevice, pIdentifier); |
|
570 | 570 | free(packet); |
|
571 | 571 | |
|
572 | 572 | //********************************* |
|
573 | 573 | // RECEIVE THE INCOMING RMAP PACKET |
|
574 | 574 | errorCode = this->receiveSPWPacket(1); // request ID 1 is for RMAP packet |
|
575 | 575 | if (errorCode<=0) |
|
576 | 576 | { |
|
577 | 577 | emit appendToLog("WARNING === in function ReadBLOCK of StarDundee *** RMAP packet reception failed with code " + QString::number(errorCode)); |
|
578 | 578 | return 0; |
|
579 | 579 | } |
|
580 | 580 | dataLength = rmapPacketSize - RMAP_READ_REPLY_HEADER_LENGTH - RMAP_DATA_CRC_LENGTH; |
|
581 | 581 | if(dataLength != nbBytes) |
|
582 | 582 | { |
|
583 | 583 | emit appendToLog("WARNING === in function READ of StarDundee *** number of data received (" |
|
584 | 584 | +QString::number(dataLength) |
|
585 | 585 | +") not equal to number of data requested (" |
|
586 | 586 | +QString::number(nbBytes) |
|
587 | 587 | +")"); |
|
588 | 588 | return 0; |
|
589 | 589 | } |
|
590 | 590 | return dataLength; |
|
591 | 591 | } |
|
592 | 592 | |
|
593 | 593 | unsigned int StarDundee::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication) |
|
594 | 594 | { |
|
595 | 595 | char protocoleIdentifier = 0x02; |
|
596 | 596 | char reserved = 0x00; |
|
597 | 597 | char *SPWData; |
|
598 | 598 | unsigned int totalSize; |
|
599 | 599 | |
|
600 | 600 | if (count>248) |
|
601 | 601 | { |
|
602 | 602 | emit appendToLog("WARNING === in function WRITE of rmapplugin *** CCSDS packet size > 248 bytes\n"); |
|
603 | 603 | return 1; |
|
604 | 604 | } |
|
605 | 605 | |
|
606 | 606 | emit appendToLog("*** START *** Send CCSDS packet of "+ QString::number(count) + " byte(s)"); |
|
607 | 607 | |
|
608 | 608 | if ( getLinkStatus( this->linkNumber_SPINBOX->value() ) == 0 ) |
|
609 | 609 | { |
|
610 | 610 | this->Close(); |
|
611 | 611 | emit appendToLog("WARNING === in function WriteSPW of StarDundee *** SPW link not running\n"); |
|
612 | 612 | return 1; |
|
613 | 613 | } |
|
614 | 614 | |
|
615 | 615 | totalSize = count + 4 + PATH_ADDRESSING_OFFSET; // The StarDundee brick is in PATH addressing |
|
616 | 616 | SPWData = (char*) malloc(totalSize); |
|
617 | 617 | // SPW HEADER |
|
618 | 618 | SPWData[0] = this->linkNumber_SPINBOX->value(); // 1 by default, value can be 1 or 2 |
|
619 | 619 | SPWData[0+PATH_ADDRESSING_OFFSET] = targetLogicalAddress; |
|
620 | 620 | SPWData[1+PATH_ADDRESSING_OFFSET] = protocoleIdentifier; |
|
621 | 621 | SPWData[2+PATH_ADDRESSING_OFFSET] = reserved; |
|
622 | 622 | SPWData[3+PATH_ADDRESSING_OFFSET] = userApplication; |
|
623 | 623 | // CCSDS PACKET |
|
624 | 624 | for (unsigned int i = 0; i<count; i++) |
|
625 | 625 | { |
|
626 | 626 | SPWData[i+4+PATH_ADDRESSING_OFFSET] = Value[i]; |
|
627 | 627 | } |
|
628 | 628 | |
|
629 | 629 | //**************** |
|
630 | 630 | // SEND THE PACKET |
|
631 | 631 | result = USBSpaceWire_SendPacket(hDevice, |
|
632 | 632 | SPWData, |
|
633 | 633 | totalSize, |
|
634 | 634 | BWAIT_1, &pIdentifier); |
|
635 | 635 | if (result != TRANSFER_SUCCESS) |
|
636 | 636 | { |
|
637 | 637 | emit sendMessage("ERROR *** WriteSPW when sending packet of size " |
|
638 | 638 | + QString::number(totalSize) +", with code: " + QString::number(result)); |
|
639 | 639 | USBSpaceWire_FreeSend(hDevice, pIdentifier); |
|
640 | 640 | free(SPWData); |
|
641 | 641 | return 0; |
|
642 | 642 | } |
|
643 | 643 | else emit sendMessage("OK *** WriteSPW when sending packet of size " + QString::number(totalSize-1)); |
|
644 | 644 | emit appendToLog("packet sent, B0 = " + QString::number(SPWData[0]) |
|
645 | 645 | + " *** B1 = " + QString::number(SPWData[1]) |
|
646 | 646 | + " *** B2 = " + QString::number(SPWData[2]) |
|
647 | 647 | + " *** B3 = " + QString::number(SPWData[3]) |
|
648 | 648 | + " *** B4 = " + QString::number(SPWData[4]) |
|
649 | 649 | + " *** B5 = " + QString::number(SPWData[5]) |
|
650 | 650 | + " *** B6 = " + QString::number(SPWData[6]) |
|
651 | 651 | + " *** B7 = " + QString::number(SPWData[7]) |
|
652 | 652 | + " *** B8 = " + QString::number(SPWData[8]) |
|
653 | 653 | + " *** B9 = " + QString::number(SPWData[9]) |
|
654 | 654 | + " *** B10 = " + QString::number(SPWData[10]) |
|
655 | 655 | + " *** B11 = " + QString::number(SPWData[11]) |
|
656 | 656 | + " *** B12 = " + QString::number(SPWData[12]) |
|
657 | 657 | ); |
|
658 | 658 | |
|
659 | 659 | //************** |
|
660 | 660 | // Free the send |
|
661 | 661 | USBSpaceWire_FreeSend(hDevice, pIdentifier); |
|
662 | 662 | free(SPWData); |
|
663 | 663 | |
|
664 | 664 | emit appendToLog(QString("*** CCSDS packet sent")); |
|
665 | 665 | |
|
666 | 666 | return 1; |
|
667 | 667 | } |
|
668 | 668 | |
|
669 | 669 | unsigned int StarDundee::getLinkStatus(unsigned char link) |
|
670 | 670 | { |
|
671 | 671 | U32 statusControl, errorStatus, portType; |
|
672 | 672 | U32 linkStatus, operatingSpeed, outputPortConnection; |
|
673 | 673 | char isLinkRunning, isAutoStart, isStart, isDisabled, isTristate; |
|
674 | 674 | |
|
675 | 675 | // Read the link status control register |
|
676 | 676 | if (CFGSpaceWire_GetLinkStatusControl(hDevice, 1, &statusControl) != CFG_TRANSFER_SUCCESS) |
|
677 | 677 | { |
|
678 | 678 | emit appendToLog("Could not read link status control for link" + QString::number(link)); |
|
679 | 679 | } |
|
680 | 680 | else |
|
681 | 681 | { |
|
682 | 682 | // Display the link status control register properties |
|
683 | 683 | CFGSpaceWire_LSPortType(statusControl, &portType); |
|
684 | 684 | if (portType == CFG_CONFIGURATION_PORT) |
|
685 | 685 | { |
|
686 | 686 | CFGSpaceWire_LSConfigErrorStatus(statusControl, &errorStatus); |
|
687 | 687 | //emit appendToLog("Configuration port error status = " + QString::number(errorStatus)); |
|
688 | 688 | } |
|
689 | 689 | else if (portType == CFG_SPACEWIRE_EXTERNAL_PORT) |
|
690 | 690 | { |
|
691 | 691 | CFGSpaceWire_LSExternalErrorStatus(statusControl, &errorStatus); |
|
692 | 692 | //emit appendToLog("External port error status = " + QString::number(errorStatus)); |
|
693 | 693 | } |
|
694 | 694 | else |
|
695 | 695 | { |
|
696 | 696 | CFGSpaceWire_LSErrorStatus(statusControl, &errorStatus); |
|
697 | 697 | //emit appendToLog("SpaceWire link error status = " + QString::number(errorStatus)); |
|
698 | 698 | } |
|
699 | 699 | CFGSpaceWire_LSLinkState(statusControl, &linkStatus); |
|
700 | 700 | CFGSpaceWire_LSIsLinkRunning(statusControl, &isLinkRunning); |
|
701 | 701 | CFGSpaceWire_LSIsAutoStart(statusControl, &isAutoStart); |
|
702 | 702 | CFGSpaceWire_LSIsStart(statusControl, &isStart); |
|
703 | 703 | CFGSpaceWire_LSIsDisabled(statusControl, &isDisabled); |
|
704 | 704 | CFGSpaceWire_LSIsTristate(statusControl, &isTristate); |
|
705 | 705 | CFGSpaceWire_LSOperatingSpeed(statusControl, &operatingSpeed); |
|
706 | 706 | CFGSpaceWire_LSOutputPortConnection(statusControl, &outputPortConnection); |
|
707 | 707 | //emit appendToLog("The link state is = " + QString::number(linkStatus)); |
|
708 | 708 | //emit appendToLog("The link is running = " + QString::number(isLinkRunning)); |
|
709 | 709 | //emit appendToLog("The autostart bit is enabled = " + QString::number(isAutoStart)); |
|
710 | 710 | //emit appendToLog("The start bit is enabled = " + QString::number(isStart)); |
|
711 | 711 | //emit appendToLog("The link is disabled = " + QString::number(isDisabled)); |
|
712 | 712 | //emit appendToLog("The tri-state bit is enabled = " + QString::number(isAutoStart)); |
|
713 | 713 | //emit appendToLog("The operating speed is = " + QString::number(operatingSpeed)); |
|
714 | 714 | //emit appendToLog("This port is currently connected to output port = " + QString::number(outputPortConnection)); |
|
715 | 715 | } |
|
716 | 716 | if (linkStatus == 5) return 1; |
|
717 | 717 | else return 0; |
|
718 | 718 | } |
|
719 | 719 | |
|
720 | 720 | void StarDundee::receivePollingLoop() |
|
721 | 721 | { |
|
722 | 722 | timer->blockSignals(true); |
|
723 | 723 | if (USBSpaceWire_WaitOnReadPacketAvailable(hDevice, 0)) receiveSPWPacketLoop(0); |
|
724 | 724 | timer->blockSignals(false); |
|
725 | 725 | } |
|
726 | 726 | |
|
727 | 727 | int StarDundee::receiveSPWPacketLoop(unsigned char requestID) |
|
728 | 728 | { |
|
729 | 729 | int result = 0; |
|
730 | 730 | emit appendToLog("Number of packets dropped by the driver: " + |
|
731 | 731 | QString::number(USBSpaceWire_GetDriverDroppedPackets(hDevice))); |
|
732 | 732 | |
|
733 | 733 | while (USBSpaceWire_WaitOnReadPacketAvailable(hDevice, 0)) |
|
734 | 734 | { |
|
735 | 735 | result = receiveSPWPacket(requestID); |
|
736 | 736 | } |
|
737 | if (!ccsdsPacketStore.isEmpty()) | |
|
738 | { | |
|
739 | emit packetStoreNotEmpty(); | |
|
740 | } | |
|
737 | ||
|
741 | 738 | return result; |
|
742 | 739 | } |
|
743 | 740 | |
|
744 | 741 | int StarDundee::receiveSPWPacket(unsigned char requestID) // SLOT |
|
745 | 742 | { |
|
746 | 743 | unsigned int packetLength; |
|
747 | 744 | unsigned int nbBytes; |
|
748 | 745 | unsigned nPacketNum; |
|
749 | 746 | USB_SPACEWIRE_PACKET_PROPERTIES properties; // The properties of the read |
|
750 | 747 | |
|
751 | 748 | if (requestID==1) |
|
752 | 749 | { |
|
753 | 750 | if (rmapPacketSEMAPHORE->available()) |
|
754 | 751 | { |
|
755 | 752 | return rmapPacketSize; |
|
756 | 753 | } |
|
757 | 754 | } |
|
758 | 755 | |
|
759 | 756 | //******************** |
|
760 | 757 | // TRY TO RECEIVE DATA |
|
761 | 758 | nbBytes = qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH); // maximum size of the packet to receive |
|
762 | 759 | nPacketNum = 1; |
|
763 | 760 | result = USBSpaceWire_ReadPackets(hDevice, spwPacket, nbBytes, nPacketNum, BWAIT_1, &properties, &pIdentifierRead); |
|
764 | 761 | if (result != TRANSFER_SUCCESS) |
|
765 | 762 | { |
|
766 | 763 | emit sendMessage("Error: Could not receive the packet"); |
|
767 | 764 | USBSpaceWire_FreeRead(hDevice, pIdentifierRead); // Free the read buffer |
|
768 | 765 | return 0; |
|
769 | 766 | } |
|
770 | 767 | else |
|
771 | 768 | { |
|
772 | 769 | packetLength = properties.len; |
|
773 | 770 | if (properties.eop == SPACEWIRE_USB_NO_EOP) |
|
774 | 771 | { |
|
775 | 772 | emit appendToLog("No end of packet marker received"); |
|
776 | 773 | } |
|
777 | 774 | else if (properties.eop == SPACEWIRE_USB_EOP) |
|
778 | 775 | { |
|
779 | 776 | emit appendToLog("Normal end of packet marker received"); |
|
780 | 777 | } |
|
781 | 778 | else if (properties.eop == SPACEWIRE_USB_EEP) |
|
782 | 779 | { |
|
783 | 780 | emit appendToLog("Error end of packet marker received"); |
|
784 | 781 | } |
|
785 | 782 | |
|
786 | 783 | USBSpaceWire_FreeRead(hDevice, pIdentifierRead); // Free the read buffer |
|
787 | 784 | } |
|
788 | 785 | |
|
789 | 786 | switch(spwPacket[1]) // byte 1 is the protocole identifier in the SPW packet |
|
790 | 787 | { |
|
791 | 788 | case 1: // 0x01 is the protocole identifier for RMAP packets |
|
792 | 789 | if (rmapPacketSEMAPHORE->available()!=0) return -3; // ERROR === previous RMAP packet not processed yet |
|
793 | 790 | for(unsigned int i=0; i<packetLength; i++) rmapPacket[i] = spwPacket[i]; |
|
794 | 791 | rmapPacketSize = packetLength; |
|
795 | 792 | rmapPacketSEMAPHORE->release(); |
|
796 | 793 | emit appendToLog("RMAP packet of size " + QString::number(packetLength) + " received"); |
|
797 | 794 | emit appendToLog("packet received, B0 = " + QString::number(spwPacket[0], 16) |
|
798 | 795 | + " *** B1 = " + QString::number(spwPacket[1], 16) |
|
799 | 796 | + " *** B2 = " + QString::number(spwPacket[2], 16) |
|
800 | 797 | + " *** B3 = " + QString::number(spwPacket[3], 16) |
|
801 | 798 | + " *** B4 = " + QString::number(spwPacket[4], 16) |
|
802 | 799 | + " *** B5 = " + QString::number(spwPacket[5], 16) |
|
803 | 800 | ); |
|
804 | 801 | return packetLength; |
|
805 | 802 | |
|
806 | 803 | case 2: // 0x02 is the protocole identifier for CCSDS packets |
|
807 | 804 | if (ccsdsPacketSEMAPHORE->available()!=0) |
|
808 | 805 | { |
|
809 | 806 | emit sendMessage("in function [receiveSPWPacket] === ERROR === previous CCSDS packet not processed yet"); |
|
810 | 807 | return -4; // ERROR === previous CCSDS packet not processed yet |
|
811 | 808 | } |
|
812 | 809 | for(unsigned int i=0; i<packetLength; i++) ccsdsPacket[i] = spwPacket[i]; |
|
813 | 810 | ccsdsPacketSize = packetLength; |
|
814 | //ccsdsPacketSEMAPHORE->release(); | |
|
815 | //emit(ccsdsPacketAvailable(ccsdsPacket, packetLength)); | |
|
816 | 811 | emit appendToLog("CCSDS packet of size " + QString::number(packetLength) + " received"); |
|
817 | 812 | emit appendToLog("packet received, byte0 " + QString::number(spwPacket[0], 16) |
|
818 | 813 | + " *** byte1 " + QString::number(spwPacket[1], 16) |
|
819 | 814 | + " *** byte2 " + QString::number(spwPacket[2], 16) |
|
820 | 815 | + " *** byte3 " + QString::number(spwPacket[3], 16)); |
|
821 | 816 | storeCCSDSPacket(ccsdsPacket, packetLength); |
|
822 | 817 | return packetLength; |
|
823 | 818 | default: |
|
824 | 819 | emit appendToLog("packet received, byte0 " + QString::number(spwPacket[0], 16) |
|
825 | 820 | + " *** byte1 " + QString::number(spwPacket[1], 16) |
|
826 | 821 | + " *** byte2 " + QString::number(spwPacket[2], 16) |
|
827 | 822 | + " *** byte3 " + QString::number(spwPacket[3], 16)); |
|
828 | 823 | return 0; |
|
829 | 824 | } |
|
830 | 825 | return 0; |
|
831 | 826 | } |
|
832 | 827 | |
|
833 | 828 | unsigned int StarDundee::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size) |
|
834 | 829 | { |
|
835 |
TMPacketToRead * |
|
|
830 | TMPacketToRead *generalPacket; | |
|
836 | 831 | |
|
837 |
|
|
|
838 | ccsdsPacketStore.append(packet); | |
|
832 | generalPacket = new TMPacketToRead(ccsdsPacket, size); | |
|
833 | emit sendPacket(generalPacket); | |
|
839 | 834 | |
|
840 | 835 | return 1; |
|
841 | 836 | } |
|
842 | 837 | |
|
843 | 838 | void StarDundee::reTestSPWLink() // SLOT |
|
844 | 839 | { |
|
845 | 840 | if (getLinkStatus(linkNumber_SPINBOX->value())) |
|
846 | 841 | { |
|
847 | 842 | emit isOpen(true); |
|
848 | 843 | starDundeeStatusQueryDialog->accept(); |
|
849 | 844 | } |
|
850 | 845 | } |
@@ -1,106 +1,104 | |||
|
1 | 1 | #ifndef STARDUNDEE_H |
|
2 | 2 | #define STARDUNDEE_H |
|
3 | 3 | |
|
4 | 4 | #include <QWidget> |
|
5 | 5 | #include <QPushButton> |
|
6 | 6 | #include <QGridLayout> |
|
7 | 7 | #include <QSpinBox> |
|
8 | 8 | #include <QLabel> |
|
9 | 9 | #include <QSemaphore> |
|
10 | 10 | #include <QTimer> |
|
11 | 11 | #include <QDialog> |
|
12 | 12 | |
|
13 | 13 | #include "rmapoperations.h" |
|
14 | 14 | #include "spw_usb_api.h" |
|
15 | 15 | #include "spw_config_library.h" |
|
16 | 16 | #include "ccsds.h" |
|
17 | 17 | #include "tmpackettoread.h" |
|
18 | 18 | |
|
19 | 19 | #define BWAIT_0 0 |
|
20 | 20 | #define BWAIT_1 1 |
|
21 | 21 | #define PATH_ADDRESSING_OFFSET 1 |
|
22 | 22 | |
|
23 | 23 | class StarDundee : public QWidget |
|
24 | 24 | { |
|
25 | 25 | Q_OBJECT |
|
26 | 26 | public: |
|
27 | 27 | explicit StarDundee(QWidget *parent = 0); |
|
28 | 28 | ~StarDundee(); |
|
29 | 29 | unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0); |
|
30 | 30 | unsigned int Read(unsigned int *Value,unsigned int count,unsigned int address=0); |
|
31 | 31 | unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication); |
|
32 | 32 | |
|
33 | 33 | unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size); |
|
34 | QList<TMPacketToRead*> ccsdsPacketStore; | |
|
35 | 34 | |
|
36 | 35 | signals: |
|
37 | 36 | void sendMessage(QString message); |
|
37 | void sendPacket(TMPacketToRead*); | |
|
38 | 38 | void isOpen(bool); |
|
39 | 39 | void RMAP_write_reply_setText(QString); |
|
40 | 40 | void appendToLog(QString); |
|
41 | void ccsdsPacketAvailable(unsigned char*, unsigned int); | |
|
42 | void packetStoreNotEmpty(); | |
|
43 | 41 | |
|
44 | 42 | public slots: |
|
45 | 43 | void Open(); |
|
46 | 44 | void Close(); |
|
47 | 45 | void reTestSPWLink(); |
|
48 | 46 | int receiveSPWPacketLoop(unsigned char requestID=0); |
|
49 | 47 | int receiveSPWPacket(unsigned char requestID=0); |
|
50 | 48 | void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;} |
|
51 | 49 | void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;} |
|
52 | 50 | void sourceHasChanged(int source) {rmapSourceLogicalAddress = (unsigned char) source;} |
|
53 | 51 | void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();} |
|
54 | 52 | // |
|
55 | 53 | void receivePollingLoop(); |
|
56 | 54 | |
|
57 | 55 | private: |
|
58 | 56 | unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0); |
|
59 | 57 | unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0); |
|
60 | 58 | void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->tryAcquire();} |
|
61 | 59 | void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->tryAcquire();} |
|
62 | 60 | unsigned char setRoutingTableEntry(int tableEntry, U32 dwOutputPorts); |
|
63 | 61 | |
|
64 | 62 | unsigned int getLinkStatus(unsigned char link); |
|
65 | 63 | unsigned int GetRoutingTableEntry(int tableEntry); |
|
66 | 64 | |
|
67 | 65 | unsigned char rmapTargetLogicalAddress ; |
|
68 | 66 | unsigned char rmapSourceLogicalAddress ; |
|
69 | 67 | |
|
70 | 68 | RMAP_command_codes commandCode; |
|
71 | 69 | |
|
72 | 70 | QLabel *usbDeviceNumber_LABEL; |
|
73 | 71 | QLabel *linkNumber_LABEL; |
|
74 | 72 | QLabel *starDundeeStatusQueryDialogLabel; |
|
75 | 73 | |
|
76 | 74 | QSpinBox *usbDeviceNumber_SPINBOX; |
|
77 | 75 | QSpinBox *linkNumber_SPINBOX; |
|
78 | 76 | |
|
79 | 77 | QGridLayout *connection_LAYOUT; |
|
80 | 78 | QGridLayout *starDundeeStatusQueryDialogLayout; |
|
81 | 79 | |
|
82 | 80 | QDialog *starDundeeStatusQueryDialog; |
|
83 | 81 | |
|
84 | 82 | QPushButton *starDundeeStatusQueryRetryButton; |
|
85 | 83 | QPushButton *starDundeeStatusQueryAbortButton; |
|
86 | 84 | |
|
87 | 85 | QTimer *timer; |
|
88 | 86 | |
|
89 | 87 | unsigned char pBuffer[10]; // Pointer to the start of the user buffer from which to transmit data |
|
90 | 88 | USB_SPACEWIRE_ID pIdentifierRead; // A pointer to a variable which will be set to contain a unique identifier for the read |
|
91 | 89 | USB_SPACEWIRE_ID pIdentifier; |
|
92 | 90 | |
|
93 | 91 | star_device_handle hDevice; // Handle to the SpaceWire device |
|
94 | 92 | USB_SPACEWIRE_STATUS result; // The result of the send operation |
|
95 | 93 | |
|
96 | 94 | // Packet receiver |
|
97 | 95 | QSemaphore *rmapPacketSEMAPHORE; |
|
98 | 96 | QSemaphore *ccsdsPacketSEMAPHORE; |
|
99 | 97 | char* rmapPacket; // The buffer to receive RMAP READ packets |
|
100 | 98 | unsigned char *ccsdsPacket; |
|
101 | 99 | char *spwPacket; |
|
102 | 100 | unsigned int rmapPacketSize; |
|
103 | 101 | unsigned int ccsdsPacketSize; |
|
104 | 102 | }; |
|
105 | 103 | |
|
106 | 104 | #endif // STARDUNDEE_H |
General Comments 0
You need to be logged in to leave comments.
Login now