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