##// END OF EJS Templates
Plugin modified to allow the launch of interactiv tests from the python interpreter...
leroy -
r11:0c9852fa341b 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.3) on: Mon Dec 10 09:02:30 2012
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Tue Mar 5 08:11:23 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) /opt/LPPMON_PLUGINS_PAUL/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) /opt/LPPMON_PLUGINS_PAUL/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,264 +1,264
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE QtCreatorProject>
2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by Qt Creator 2.4.1, 2012-12-11T14:32:09. -->
3 <!-- Written by Qt Creator 2.4.1, 2013-03-21T08:38:26. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
7 <value type="int">0</value>
7 <value type="int">0</value>
8 </data>
8 </data>
9 <data>
9 <data>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
11 <valuemap type="QVariantMap">
11 <valuemap type="QVariantMap">
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
14 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
14 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
15 <value type="QString" key="language">Cpp</value>
15 <value type="QString" key="language">Cpp</value>
16 <valuemap type="QVariantMap" key="value">
16 <valuemap type="QVariantMap" key="value">
17 <value type="QString" key="CurrentPreferences">CppGlobal</value>
17 <value type="QString" key="CurrentPreferences">CppGlobal</value>
18 </valuemap>
18 </valuemap>
19 </valuemap>
19 </valuemap>
20 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
20 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
21 <value type="QString" key="language">QmlJS</value>
21 <value type="QString" key="language">QmlJS</value>
22 <valuemap type="QVariantMap" key="value">
22 <valuemap type="QVariantMap" key="value">
23 <value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
23 <value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
24 </valuemap>
24 </valuemap>
25 </valuemap>
25 </valuemap>
26 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
26 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
27 <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
27 <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
28 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
28 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
29 <value type="int" key="EditorConfiguration.IndentSize">4</value>
29 <value type="int" key="EditorConfiguration.IndentSize">4</value>
30 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
30 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
31 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
31 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
32 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
32 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
33 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
33 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
34 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
34 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
35 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
35 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
36 <value type="int" key="EditorConfiguration.TabSize">8</value>
36 <value type="int" key="EditorConfiguration.TabSize">8</value>
37 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
37 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
38 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
38 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
39 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
39 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
40 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
40 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
41 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
41 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
42 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
42 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
43 </valuemap>
43 </valuemap>
44 </data>
44 </data>
45 <data>
45 <data>
46 <variable>ProjectExplorer.Project.PluginSettings</variable>
46 <variable>ProjectExplorer.Project.PluginSettings</variable>
47 <valuemap type="QVariantMap"/>
47 <valuemap type="QVariantMap"/>
48 </data>
48 </data>
49 <data>
49 <data>
50 <variable>ProjectExplorer.Project.Target.0</variable>
50 <variable>ProjectExplorer.Project.Target.0</variable>
51 <valuemap type="QVariantMap">
51 <valuemap type="QVariantMap">
52 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
52 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
53 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
53 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value>
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value>
55 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
55 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
56 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
56 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
58 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
58 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
59 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
59 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
60 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
60 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
61 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
61 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
62 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
62 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
63 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
63 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
64 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
64 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
65 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
65 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
66 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
66 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
67 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
67 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
68 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
68 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
69 </valuemap>
69 </valuemap>
70 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
70 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
71 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
71 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
72 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
72 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
73 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
73 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
74 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
74 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
75 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
75 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
76 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
76 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
77 </valuemap>
77 </valuemap>
78 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
78 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
79 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
79 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
80 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
80 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
81 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
81 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
82 </valuemap>
82 </valuemap>
83 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
83 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
84 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
84 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
85 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
85 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
86 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
86 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
88 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
88 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
89 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
89 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
90 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
90 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
91 </valuemap>
91 </valuemap>
92 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
92 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
93 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
93 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
96 </valuemap>
96 </valuemap>
97 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
97 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
98 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
98 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
99 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
99 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
100 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value>
100 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value>
101 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
101 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
102 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
102 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
103 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
103 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
104 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL</value>
104 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL</value>
105 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
105 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
106 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
106 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
107 </valuemap>
107 </valuemap>
108 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
108 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
109 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
109 <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value>
110 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
110 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
111 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
111 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
112 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
112 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
115 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
115 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
116 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
116 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
117 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
117 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
118 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
118 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
119 </valuemap>
119 </valuemap>
120 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
120 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
121 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
121 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
122 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
122 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
124 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
124 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
125 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
125 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
126 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
126 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
127 </valuemap>
127 </valuemap>
128 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
128 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
129 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
129 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
130 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
130 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
131 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
131 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
132 </valuemap>
132 </valuemap>
133 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
133 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
134 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
134 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
135 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
135 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
136 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
136 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
137 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
137 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
138 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
138 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
139 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
139 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
140 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
140 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
141 </valuemap>
141 </valuemap>
142 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
142 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
143 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
143 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
144 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
144 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
145 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
145 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
146 </valuemap>
146 </valuemap>
147 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
147 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
148 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
148 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
149 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
149 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
150 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value>
150 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value>
151 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
151 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
152 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
152 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
153 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
153 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
154 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL</value>
154 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/LPPMON_PLUGINS_PAUL</value>
155 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
155 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
156 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
156 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
157 </valuemap>
157 </valuemap>
158 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
158 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
159 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
159 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
160 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
160 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
161 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
161 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
162 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
162 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
163 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
163 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
164 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
164 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
165 </valuemap>
165 </valuemap>
166 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
166 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
167 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
167 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
168 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
168 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
169 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
169 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
170 </valuemap>
170 </valuemap>
171 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
171 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
172 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
172 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
173 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
173 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
174 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
174 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
175 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
175 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
176 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
176 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
177 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
177 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
178 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
178 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
179 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
179 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
180 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
180 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
181 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
181 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
182 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
182 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
183 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
183 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
184 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
184 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
185 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
185 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
186 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
186 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
187 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
187 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
188 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
188 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
189 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
189 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
190 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
190 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
191 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
191 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
192 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
192 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
193 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
193 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
194 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
194 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
195 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
195 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
196 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
196 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
197 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
197 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
198 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
198 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
199 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
199 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
200 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
200 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
201 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
201 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
202 <value type="int">0</value>
202 <value type="int">0</value>
203 <value type="int">1</value>
203 <value type="int">1</value>
204 <value type="int">2</value>
204 <value type="int">2</value>
205 <value type="int">3</value>
205 <value type="int">3</value>
206 <value type="int">4</value>
206 <value type="int">4</value>
207 <value type="int">5</value>
207 <value type="int">5</value>
208 <value type="int">6</value>
208 <value type="int">6</value>
209 <value type="int">7</value>
209 <value type="int">7</value>
210 <value type="int">8</value>
210 <value type="int">8</value>
211 <value type="int">9</value>
211 <value type="int">9</value>
212 <value type="int">10</value>
212 <value type="int">10</value>
213 <value type="int">11</value>
213 <value type="int">11</value>
214 <value type="int">12</value>
214 <value type="int">12</value>
215 <value type="int">13</value>
215 <value type="int">13</value>
216 <value type="int">14</value>
216 <value type="int">14</value>
217 </valuelist>
217 </valuelist>
218 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
218 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
219 <value type="int">0</value>
219 <value type="int">0</value>
220 <value type="int">1</value>
220 <value type="int">1</value>
221 <value type="int">2</value>
221 <value type="int">2</value>
222 <value type="int">3</value>
222 <value type="int">3</value>
223 <value type="int">4</value>
223 <value type="int">4</value>
224 <value type="int">5</value>
224 <value type="int">5</value>
225 <value type="int">6</value>
225 <value type="int">6</value>
226 <value type="int">7</value>
226 <value type="int">7</value>
227 <value type="int">8</value>
227 <value type="int">8</value>
228 <value type="int">9</value>
228 <value type="int">9</value>
229 <value type="int">10</value>
229 <value type="int">10</value>
230 <value type="int">11</value>
230 <value type="int">11</value>
231 <value type="int">12</value>
231 <value type="int">12</value>
232 <value type="int">13</value>
232 <value type="int">13</value>
233 <value type="int">14</value>
233 <value type="int">14</value>
234 </valuelist>
234 </valuelist>
235 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
235 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
236 <value type="int" key="ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase">2</value>
236 <value type="int" key="ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase">2</value>
237 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">lppmon</value>
237 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">lppmon</value>
238 <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">false</value>
238 <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">false</value>
239 <valuelist type="QVariantList" key="ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges"/>
239 <valuelist type="QVariantList" key="ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges"/>
240 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value>
240 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value>
241 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Run lppmon</value>
241 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Run lppmon</value>
242 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
242 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
243 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
243 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
244 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
244 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
245 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
245 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
246 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
246 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
247 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
247 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
248 </valuemap>
248 </valuemap>
249 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
249 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
250 </valuemap>
250 </valuemap>
251 </data>
251 </data>
252 <data>
252 <data>
253 <variable>ProjectExplorer.Project.TargetCount</variable>
253 <variable>ProjectExplorer.Project.TargetCount</variable>
254 <value type="int">1</value>
254 <value type="int">1</value>
255 </data>
255 </data>
256 <data>
256 <data>
257 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
257 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
258 <value type="QString">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
258 <value type="QString">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
259 </data>
259 </data>
260 <data>
260 <data>
261 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
261 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
262 <value type="int">10</value>
262 <value type="int">10</value>
263 </data>
263 </data>
264 </qtcreator>
264 </qtcreator>
@@ -1,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,434 +1,444
1 #############################################################################
1 #############################################################################
2 # Makefile for building: librmapplugin.so.1.0.0
2 # Makefile for building: librmapplugin.so.1.0.0
3 # Generated by qmake (2.01a) (Qt 4.8.3) on: Mon Dec 10 16:03:39 2012
3 # Generated by qmake (2.01a) (Qt 4.8.4) on: Tue Mar 19 07:43:19 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_TRANSLATION_PATH="\"/etc/lppmon/translations\"" -DLPPMONPLUGIN_LIBRARY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
13 DEFINES = -DPLUGIN=rmapplugin -DPLUGINHEADER="\"rmapplugin.h\"" -Ddriver_Name="\"RMAPPlugin\"" -Ddriver_Author="\"Paul Leroy paul.leroy@lpp.polytechnique.fr\"" -Ddriver_Version="\"1.1.2\"" -Ddriver_Description="\"AHB bus controler, works with Gaisler's AHB plugn' play bus.\"" -Ddriver_can_be_root=1 -Ddriver_can_be_child=0 -Ddriver_VID=0 -Ddriver_PID=0 -DUNIXTRANSLATIONPATH -DLPPMON_PLUGINS_INSTALL_PATH="QDir::homePath()+\"/.lppmon/plugins\"" -DLPPMON_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 -I. -I../common_PLE -I../spw_usb_driver_v2.61/inc -I/usr/include/lppmon/pluginsInterface -I/usr/include/PythonQt -Imoc
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/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 -lQtGui -lQtNetwork -lQtCore -lpthread
19 LIBS = $(SUBLIBS) -L/usr/lib64 ../spw_usb_driver_v2.61/lib/x86_64/libSpaceWireUSBAPI.so ../spw_usb_driver_v2.61/lib/x86_64/libConfigLibraryUSB.so -ldl -lutil -lm -lpython2.7 -lPythonQt_QtAll -lPythonQt -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 /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp moc/moc_rmappluginui.cpp \
57 /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp moc/moc_rmappluginui.cpp \
58 moc/moc_rmapplugin.cpp \
58 moc/moc_rmapplugin.cpp \
59 moc/moc_qipdialogbox.cpp \
59 moc/moc_qipdialogbox.cpp \
60 moc/moc_gresbstatusenquiry.cpp \
60 moc/moc_gresbstatusenquiry.cpp \
61 moc/moc_spectralmatricesdmasimulator.cpp \
61 moc/moc_spectralmatricesdmasimulator.cpp \
62 moc/moc_rmappluginpythonwrapper.cpp \
62 moc/moc_rmappluginpythonwrapper.cpp \
63 moc/moc_stardundee.cpp \
63 moc/moc_stardundee.cpp \
64 moc/moc_gresb.cpp \
64 moc/moc_gresb.cpp \
65 moc/moc_bridge.cpp \
65 moc/moc_tcpackettosend.cpp \
66 moc/moc_genericPySysdriver.cpp \
66 moc/moc_genericPySysdriver.cpp \
67 moc/moc_lppmonplugin.cpp
67 moc/moc_lppmonplugin.cpp
68 OBJECTS = obj/rmapplugin.o \
68 OBJECTS = obj/rmapplugin.o \
69 obj/rmappluginui.o \
69 obj/rmappluginui.o \
70 obj/rmapoperations.o \
70 obj/rmapoperations.o \
71 obj/ccsds.o \
71 obj/ccsds.o \
72 obj/qipdialogbox.o \
72 obj/qipdialogbox.o \
73 obj/gresbstatusenquiry.o \
73 obj/gresbstatusenquiry.o \
74 obj/spectralmatricesdmasimulator.o \
74 obj/spectralmatricesdmasimulator.o \
75 obj/rmappluginpythonwrapper.o \
75 obj/rmappluginpythonwrapper.o \
76 obj/stardundee.o \
76 obj/stardundee.o \
77 obj/gresb.o \
77 obj/gresb.o \
78 obj/bridge.o \
78 obj/tcpackettosend.o \
79 obj/lppmonplugininterface.o \
79 obj/lppmonplugininterface.o \
80 obj/moc_rmappluginui.o \
80 obj/moc_rmappluginui.o \
81 obj/moc_rmapplugin.o \
81 obj/moc_rmapplugin.o \
82 obj/moc_qipdialogbox.o \
82 obj/moc_qipdialogbox.o \
83 obj/moc_gresbstatusenquiry.o \
83 obj/moc_gresbstatusenquiry.o \
84 obj/moc_spectralmatricesdmasimulator.o \
84 obj/moc_spectralmatricesdmasimulator.o \
85 obj/moc_rmappluginpythonwrapper.o \
85 obj/moc_rmappluginpythonwrapper.o \
86 obj/moc_stardundee.o \
86 obj/moc_stardundee.o \
87 obj/moc_gresb.o \
87 obj/moc_gresb.o \
88 obj/moc_bridge.o \
88 obj/moc_tcpackettosend.o \
89 obj/moc_genericPySysdriver.o \
89 obj/moc_genericPySysdriver.o \
90 obj/moc_lppmonplugin.o
90 obj/moc_lppmonplugin.o
91 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
91 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
92 /usr/lib64/qt4/mkspecs/common/linux.conf \
92 /usr/lib64/qt4/mkspecs/common/linux.conf \
93 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
93 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
94 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
94 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
95 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
95 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
96 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
96 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
97 /usr/lib64/qt4/mkspecs/qconfig.pri \
97 /usr/lib64/qt4/mkspecs/qconfig.pri \
98 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \
98 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \
99 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
99 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
100 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
100 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
101 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
101 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
102 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
102 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
103 /usr/lib64/qt4/mkspecs/features/release.prf \
103 /usr/lib64/qt4/mkspecs/features/release.prf \
104 /usr/lib64/qt4/mkspecs/features/default_post.prf \
104 /usr/lib64/qt4/mkspecs/features/default_post.prf \
105 /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf \
105 /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf \
106 /usr/lib64/qt4/mkspecs/features/pythonqt.prf \
106 /usr/lib64/qt4/mkspecs/features/pythonqt.prf \
107 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
107 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
108 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
108 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
109 /usr/lib64/qt4/mkspecs/features/qt.prf \
109 /usr/lib64/qt4/mkspecs/features/qt.prf \
110 /usr/lib64/qt4/mkspecs/features/unix/thread.prf \
110 /usr/lib64/qt4/mkspecs/features/unix/thread.prf \
111 /usr/lib64/qt4/mkspecs/features/moc.prf \
111 /usr/lib64/qt4/mkspecs/features/moc.prf \
112 /usr/lib64/qt4/mkspecs/features/resources.prf \
112 /usr/lib64/qt4/mkspecs/features/resources.prf \
113 /usr/lib64/qt4/mkspecs/features/uic.prf \
113 /usr/lib64/qt4/mkspecs/features/uic.prf \
114 /usr/lib64/qt4/mkspecs/features/yacc.prf \
114 /usr/lib64/qt4/mkspecs/features/yacc.prf \
115 /usr/lib64/qt4/mkspecs/features/lex.prf \
115 /usr/lib64/qt4/mkspecs/features/lex.prf \
116 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
116 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
117 rmapplugin.pro
117 rmapplugin.pro
118 QMAKE_TARGET = rmapplugin
118 QMAKE_TARGET = rmapplugin
119 DESTDIR = bin/
119 DESTDIR = bin/
120 TARGET = librmapplugin.so.1.0.0
120 TARGET = librmapplugin.so.1.0.0
121 TARGETA = bin/librmapplugin.a
121 TARGETA = bin/librmapplugin.a
122 TARGETD = librmapplugin.so.1.0.0
122 TARGETD = librmapplugin.so.1.0.0
123 TARGET0 = librmapplugin.so
123 TARGET0 = librmapplugin.so
124 TARGET1 = librmapplugin.so.1
124 TARGET1 = librmapplugin.so.1
125 TARGET2 = librmapplugin.so.1.0
125 TARGET2 = librmapplugin.so.1.0
126
126
127 first: all
127 first: all
128 ####### Implicit rules
128 ####### Implicit rules
129
129
130 .SUFFIXES: .o .c .cpp .cc .cxx .C
130 .SUFFIXES: .o .c .cpp .cc .cxx .C
131
131
132 .cpp.o:
132 .cpp.o:
133 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
133 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
134
134
135 .cc.o:
135 .cc.o:
136 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
136 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
137
137
138 .cxx.o:
138 .cxx.o:
139 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
139 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
140
140
141 .C.o:
141 .C.o:
142 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
142 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
143
143
144 .c.o:
144 .c.o:
145 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
145 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
146
146
147 ####### Build rules
147 ####### Build rules
148
148
149 all: Makefile bin/$(TARGET)
149 all: Makefile bin/$(TARGET)
150
150
151 bin/$(TARGET): $(OBJECTS) $(SUBLIBS) $(OBJCOMP)
151 bin/$(TARGET): $(OBJECTS) $(SUBLIBS) $(OBJCOMP)
152 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
152 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
153 -$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)
153 -$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)
154 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP)
154 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP)
155 -ln -s $(TARGET) $(TARGET0)
155 -ln -s $(TARGET) $(TARGET0)
156 -ln -s $(TARGET) $(TARGET1)
156 -ln -s $(TARGET) $(TARGET1)
157 -ln -s $(TARGET) $(TARGET2)
157 -ln -s $(TARGET) $(TARGET2)
158 -$(DEL_FILE) bin/$(TARGET)
158 -$(DEL_FILE) bin/$(TARGET)
159 -$(DEL_FILE) bin/$(TARGET0)
159 -$(DEL_FILE) bin/$(TARGET0)
160 -$(DEL_FILE) bin/$(TARGET1)
160 -$(DEL_FILE) bin/$(TARGET1)
161 -$(DEL_FILE) bin/$(TARGET2)
161 -$(DEL_FILE) bin/$(TARGET2)
162 -$(MOVE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) bin/
162 -$(MOVE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) bin/
163
163
164
164
165
165
166 staticlib: $(TARGETA)
166 staticlib: $(TARGETA)
167
167
168 $(TARGETA): $(OBJECTS) $(OBJCOMP)
168 $(TARGETA): $(OBJECTS) $(OBJCOMP)
169 -$(DEL_FILE) $(TARGETA)
169 -$(DEL_FILE) $(TARGETA)
170 $(AR) $(TARGETA) $(OBJECTS)
170 $(AR) $(TARGETA) $(OBJECTS)
171
171
172 Makefile: rmapplugin.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
172 Makefile: rmapplugin.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
173 /usr/lib64/qt4/mkspecs/common/linux.conf \
173 /usr/lib64/qt4/mkspecs/common/linux.conf \
174 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
174 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
175 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
175 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
176 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
176 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
177 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
177 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
178 /usr/lib64/qt4/mkspecs/qconfig.pri \
178 /usr/lib64/qt4/mkspecs/qconfig.pri \
179 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \
179 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri \
180 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
180 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
181 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
181 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
182 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
182 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
183 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
183 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
184 /usr/lib64/qt4/mkspecs/features/release.prf \
184 /usr/lib64/qt4/mkspecs/features/release.prf \
185 /usr/lib64/qt4/mkspecs/features/default_post.prf \
185 /usr/lib64/qt4/mkspecs/features/default_post.prf \
186 /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf \
186 /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf \
187 /usr/lib64/qt4/mkspecs/features/pythonqt.prf \
187 /usr/lib64/qt4/mkspecs/features/pythonqt.prf \
188 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
188 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
189 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
189 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
190 /usr/lib64/qt4/mkspecs/features/qt.prf \
190 /usr/lib64/qt4/mkspecs/features/qt.prf \
191 /usr/lib64/qt4/mkspecs/features/unix/thread.prf \
191 /usr/lib64/qt4/mkspecs/features/unix/thread.prf \
192 /usr/lib64/qt4/mkspecs/features/moc.prf \
192 /usr/lib64/qt4/mkspecs/features/moc.prf \
193 /usr/lib64/qt4/mkspecs/features/resources.prf \
193 /usr/lib64/qt4/mkspecs/features/resources.prf \
194 /usr/lib64/qt4/mkspecs/features/uic.prf \
194 /usr/lib64/qt4/mkspecs/features/uic.prf \
195 /usr/lib64/qt4/mkspecs/features/yacc.prf \
195 /usr/lib64/qt4/mkspecs/features/yacc.prf \
196 /usr/lib64/qt4/mkspecs/features/lex.prf \
196 /usr/lib64/qt4/mkspecs/features/lex.prf \
197 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
197 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
198 /usr/lib64/libQtXml.prl \
199 /usr/lib64/libQtCore.prl \
198 /usr/lib64/libQtGui.prl \
200 /usr/lib64/libQtGui.prl \
199 /usr/lib64/libQtCore.prl \
200 /usr/lib64/libQtNetwork.prl
201 /usr/lib64/libQtNetwork.prl
201 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro
202 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro
202 /usr/lib64/qt4/mkspecs/common/unix.conf:
203 /usr/lib64/qt4/mkspecs/common/unix.conf:
203 /usr/lib64/qt4/mkspecs/common/linux.conf:
204 /usr/lib64/qt4/mkspecs/common/linux.conf:
204 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
205 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
205 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
206 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
206 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
207 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
207 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
208 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
208 /usr/lib64/qt4/mkspecs/qconfig.pri:
209 /usr/lib64/qt4/mkspecs/qconfig.pri:
209 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri:
210 /usr/lib64/qt4/mkspecs/modules/qt_webkit_version.pri:
210 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
211 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
211 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
212 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
212 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
213 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
213 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
214 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
214 /usr/lib64/qt4/mkspecs/features/release.prf:
215 /usr/lib64/qt4/mkspecs/features/release.prf:
215 /usr/lib64/qt4/mkspecs/features/default_post.prf:
216 /usr/lib64/qt4/mkspecs/features/default_post.prf:
216 /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf:
217 /usr/lib64/qt4/mkspecs/features/lppmonplugin.prf:
217 /usr/lib64/qt4/mkspecs/features/pythonqt.prf:
218 /usr/lib64/qt4/mkspecs/features/pythonqt.prf:
218 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
219 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
219 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
220 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
220 /usr/lib64/qt4/mkspecs/features/qt.prf:
221 /usr/lib64/qt4/mkspecs/features/qt.prf:
221 /usr/lib64/qt4/mkspecs/features/unix/thread.prf:
222 /usr/lib64/qt4/mkspecs/features/unix/thread.prf:
222 /usr/lib64/qt4/mkspecs/features/moc.prf:
223 /usr/lib64/qt4/mkspecs/features/moc.prf:
223 /usr/lib64/qt4/mkspecs/features/resources.prf:
224 /usr/lib64/qt4/mkspecs/features/resources.prf:
224 /usr/lib64/qt4/mkspecs/features/uic.prf:
225 /usr/lib64/qt4/mkspecs/features/uic.prf:
225 /usr/lib64/qt4/mkspecs/features/yacc.prf:
226 /usr/lib64/qt4/mkspecs/features/yacc.prf:
226 /usr/lib64/qt4/mkspecs/features/lex.prf:
227 /usr/lib64/qt4/mkspecs/features/lex.prf:
227 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
228 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
229 /usr/lib64/libQtXml.prl:
230 /usr/lib64/libQtCore.prl:
228 /usr/lib64/libQtGui.prl:
231 /usr/lib64/libQtGui.prl:
229 /usr/lib64/libQtCore.prl:
230 /usr/lib64/libQtNetwork.prl:
232 /usr/lib64/libQtNetwork.prl:
231 qmake: FORCE
233 qmake: FORCE
232 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro
234 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile rmapplugin.pro
233
235
234 dist:
236 dist:
235 @$(CHK_DIR_EXISTS) obj/rmapplugin1.0.0 || $(MKDIR) obj/rmapplugin1.0.0
237 @$(CHK_DIR_EXISTS) obj/rmapplugin1.0.0 || $(MKDIR) obj/rmapplugin1.0.0
236 $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmappluginui.h rmapplugin.h rmapoperations.h ccsds.h ../common_PLE/qipdialogbox.h ../common_PLE/gresbstatusenquiry.h spectralmatricesdmasimulator.h rmappluginpythonwrapper.h stardundee.h ../spw_usb_driver_v2.61/inc/spw_usb_api.h ../spw_usb_driver_v2.61/inc/spw_config_library.h gresb.h bridge.h /usr/include/genericPySysdriver.h /usr/include/lppmonplugin.h obj/rmapplugin1.0.0/ && $(COPY_FILE) --parents rmapplugin.cpp rmappluginui.cpp rmapoperations.cpp ccsds.cpp ../common_PLE/qipdialogbox.cpp ../common_PLE/gresbstatusenquiry.cpp spectralmatricesdmasimulator.cpp rmappluginpythonwrapper.cpp stardundee.cpp gresb.cpp bridge.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp obj/rmapplugin1.0.0/ && (cd `dirname obj/rmapplugin1.0.0` && $(TAR) rmapplugin1.0.0.tar rmapplugin1.0.0 && $(COMPRESS) rmapplugin1.0.0.tar) && $(MOVE) `dirname obj/rmapplugin1.0.0`/rmapplugin1.0.0.tar.gz . && $(DEL_FILE) -r obj/rmapplugin1.0.0
238 $(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 /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 tcpackettosend.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
237
239
238
240
239 clean:compiler_clean
241 clean:compiler_clean
240 -$(DEL_FILE) $(OBJECTS)
242 -$(DEL_FILE) $(OBJECTS)
241 -$(DEL_FILE) *~ core *.core
243 -$(DEL_FILE) *~ core *.core
242
244
243
245
244 ####### Sub-libraries
246 ####### Sub-libraries
245
247
246 distclean: clean
248 distclean: clean
247 -$(DEL_FILE) bin/$(TARGET)
249 -$(DEL_FILE) bin/$(TARGET)
248 -$(DEL_FILE) bin/$(TARGET0) bin/$(TARGET1) bin/$(TARGET2) $(TARGETA)
250 -$(DEL_FILE) bin/$(TARGET0) bin/$(TARGET1) bin/$(TARGET2) $(TARGETA)
249 -$(DEL_FILE) Makefile
251 -$(DEL_FILE) Makefile
250
252
251
253
252 check: first
254 check: first
253
255
254 mocclean: compiler_moc_header_clean compiler_moc_source_clean
256 mocclean: compiler_moc_header_clean compiler_moc_source_clean
255
257
256 mocables: compiler_moc_header_make_all compiler_moc_source_make_all
258 mocables: compiler_moc_header_make_all compiler_moc_source_make_all
257
259
258 compiler_moc_header_make_all: moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_qipdialogbox.cpp moc/moc_gresbstatusenquiry.cpp moc/moc_spectralmatricesdmasimulator.cpp moc/moc_rmappluginpythonwrapper.cpp moc/moc_stardundee.cpp moc/moc_gresb.cpp moc/moc_bridge.cpp moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp
260 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_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp
259 compiler_moc_header_clean:
261 compiler_moc_header_clean:
260 -$(DEL_FILE) moc/moc_rmappluginui.cpp moc/moc_rmapplugin.cpp moc/moc_qipdialogbox.cpp moc/moc_gresbstatusenquiry.cpp moc/moc_spectralmatricesdmasimulator.cpp moc/moc_rmappluginpythonwrapper.cpp moc/moc_stardundee.cpp moc/moc_gresb.cpp moc/moc_bridge.cpp moc/moc_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp
262 -$(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_genericPySysdriver.cpp moc/moc_lppmonplugin.cpp
261 moc/moc_rmappluginui.cpp: rmapoperations.h \
263 moc/moc_rmappluginui.cpp: rmapoperations.h \
262 spectralmatricesdmasimulator.h \
264 spectralmatricesdmasimulator.h \
263 stardundee.h \
265 stardundee.h \
266 ccsds.h \
264 gresb.h \
267 gresb.h \
265 rmappluginui.h
268 rmappluginui.h
266 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginui.h -o moc/moc_rmappluginui.cpp
269 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginui.h -o moc/moc_rmappluginui.cpp
267
270
268 moc/moc_rmapplugin.cpp: rmappluginui.h \
271 moc/moc_rmapplugin.cpp: rmappluginui.h \
269 rmapoperations.h \
272 rmapoperations.h \
270 spectralmatricesdmasimulator.h \
273 spectralmatricesdmasimulator.h \
271 stardundee.h \
274 stardundee.h \
275 ccsds.h \
272 gresb.h \
276 gresb.h \
273 ccsds.h \
274 rmapplugin.h
277 rmapplugin.h
275 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmapplugin.h -o moc/moc_rmapplugin.cpp
278 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmapplugin.h -o moc/moc_rmapplugin.cpp
276
279
277 moc/moc_qipdialogbox.cpp: ../common_PLE/qipdialogbox.h
280 moc/moc_qipdialogbox.cpp: ../common_PLE/qipdialogbox.h
278 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../common_PLE/qipdialogbox.h -o moc/moc_qipdialogbox.cpp
281 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../common_PLE/qipdialogbox.h -o moc/moc_qipdialogbox.cpp
279
282
280 moc/moc_gresbstatusenquiry.cpp: ../common_PLE/gresbstatusenquiry.h
283 moc/moc_gresbstatusenquiry.cpp: ../common_PLE/gresbstatusenquiry.h
281 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../common_PLE/gresbstatusenquiry.h -o moc/moc_gresbstatusenquiry.cpp
284 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) ../common_PLE/gresbstatusenquiry.h -o moc/moc_gresbstatusenquiry.cpp
282
285
283 moc/moc_spectralmatricesdmasimulator.cpp: spectralmatricesdmasimulator.h
286 moc/moc_spectralmatricesdmasimulator.cpp: spectralmatricesdmasimulator.h
284 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) spectralmatricesdmasimulator.h -o moc/moc_spectralmatricesdmasimulator.cpp
287 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) spectralmatricesdmasimulator.h -o moc/moc_spectralmatricesdmasimulator.cpp
285
288
286 moc/moc_rmappluginpythonwrapper.cpp: rmappluginpythonwrapper.h
289 moc/moc_rmappluginpythonwrapper.cpp: rmapoperations.h \
290 ccsds.h \
291 rmappluginpythonwrapper.h
287 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginpythonwrapper.h -o moc/moc_rmappluginpythonwrapper.cpp
292 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) rmappluginpythonwrapper.h -o moc/moc_rmappluginpythonwrapper.cpp
288
293
289 moc/moc_stardundee.cpp: rmapoperations.h \
294 moc/moc_stardundee.cpp: rmapoperations.h \
295 ccsds.h \
290 stardundee.h
296 stardundee.h
291 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) stardundee.h -o moc/moc_stardundee.cpp
297 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) stardundee.h -o moc/moc_stardundee.cpp
292
298
293 moc/moc_gresb.cpp: rmapoperations.h \
299 moc/moc_gresb.cpp: rmapoperations.h \
300 ccsds.h \
294 gresb.h
301 gresb.h
295 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) gresb.h -o moc/moc_gresb.cpp
302 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) gresb.h -o moc/moc_gresb.cpp
296
303
297 moc/moc_bridge.cpp: rmapoperations.h \
304 moc/moc_tcpackettosend.cpp: tcpackettosend.h
298 bridge.h
305 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) tcpackettosend.h -o moc/moc_tcpackettosend.cpp
299 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) bridge.h -o moc/moc_bridge.cpp
300
306
301 moc/moc_genericPySysdriver.cpp: /usr/include/genericPySysdriver.h
307 moc/moc_genericPySysdriver.cpp: /usr/include/genericPySysdriver.h
302 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/genericPySysdriver.h -o moc/moc_genericPySysdriver.cpp
308 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/genericPySysdriver.h -o moc/moc_genericPySysdriver.cpp
303
309
304 moc/moc_lppmonplugin.cpp: /usr/include/lppmonplugin.h
310 moc/moc_lppmonplugin.cpp: /usr/include/lppmonplugin.h
305 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/lppmonplugin.h -o moc/moc_lppmonplugin.cpp
311 /usr/lib64/qt4/bin/moc $(DEFINES) $(INCPATH) /usr/include/lppmonplugin.h -o moc/moc_lppmonplugin.cpp
306
312
307 compiler_rcc_make_all:
313 compiler_rcc_make_all:
308 compiler_rcc_clean:
314 compiler_rcc_clean:
309 compiler_image_collection_make_all: qmake_image_collection.cpp
315 compiler_image_collection_make_all: qmake_image_collection.cpp
310 compiler_image_collection_clean:
316 compiler_image_collection_clean:
311 -$(DEL_FILE) qmake_image_collection.cpp
317 -$(DEL_FILE) qmake_image_collection.cpp
312 compiler_moc_source_make_all:
318 compiler_moc_source_make_all:
313 compiler_moc_source_clean:
319 compiler_moc_source_clean:
314 compiler_uic_make_all:
320 compiler_uic_make_all:
315 compiler_uic_clean:
321 compiler_uic_clean:
316 compiler_yacc_decl_make_all:
322 compiler_yacc_decl_make_all:
317 compiler_yacc_decl_clean:
323 compiler_yacc_decl_clean:
318 compiler_yacc_impl_make_all:
324 compiler_yacc_impl_make_all:
319 compiler_yacc_impl_clean:
325 compiler_yacc_impl_clean:
320 compiler_lex_make_all:
326 compiler_lex_make_all:
321 compiler_lex_clean:
327 compiler_lex_clean:
322 compiler_clean: compiler_moc_header_clean
328 compiler_clean: compiler_moc_header_clean
323
329
324 ####### Compile
330 ####### Compile
325
331
326 obj/rmapplugin.o: rmapplugin.cpp rmapplugin.h \
332 obj/rmapplugin.o: rmapplugin.cpp rmapplugin.h \
327 rmappluginui.h \
333 rmappluginui.h \
328 rmapoperations.h \
334 rmapoperations.h \
329 spectralmatricesdmasimulator.h \
335 spectralmatricesdmasimulator.h \
330 stardundee.h \
336 stardundee.h \
337 ccsds.h \
331 gresb.h \
338 gresb.h \
332 ccsds.h \
333 rmappluginpythonwrapper.h
339 rmappluginpythonwrapper.h
334 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapplugin.o rmapplugin.cpp
340 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapplugin.o rmapplugin.cpp
335
341
336 obj/rmappluginui.o: rmappluginui.cpp rmapplugin.h \
342 obj/rmappluginui.o: rmappluginui.cpp rmapplugin.h \
337 rmappluginui.h \
343 rmappluginui.h \
338 rmapoperations.h \
344 rmapoperations.h \
339 spectralmatricesdmasimulator.h \
345 spectralmatricesdmasimulator.h \
340 stardundee.h \
346 stardundee.h \
341 gresb.h \
347 ccsds.h \
342 ccsds.h
348 gresb.h
343 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginui.o rmappluginui.cpp
349 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginui.o rmappluginui.cpp
344
350
345 obj/rmapoperations.o: rmapoperations.cpp rmapoperations.h
351 obj/rmapoperations.o: rmapoperations.cpp rmapoperations.h
346 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapoperations.o rmapoperations.cpp
352 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmapoperations.o rmapoperations.cpp
347
353
348 obj/ccsds.o: ccsds.cpp ccsds.h
354 obj/ccsds.o: ccsds.cpp ccsds.h
349 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/ccsds.o ccsds.cpp
355 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/ccsds.o ccsds.cpp
350
356
351 obj/qipdialogbox.o: ../common_PLE/qipdialogbox.cpp ../common_PLE/qipdialogbox.h
357 obj/qipdialogbox.o: ../common_PLE/qipdialogbox.cpp ../common_PLE/qipdialogbox.h
352 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/qipdialogbox.o ../common_PLE/qipdialogbox.cpp
358 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/qipdialogbox.o ../common_PLE/qipdialogbox.cpp
353
359
354 obj/gresbstatusenquiry.o: ../common_PLE/gresbstatusenquiry.cpp ../common_PLE/gresbstatusenquiry.h
360 obj/gresbstatusenquiry.o: ../common_PLE/gresbstatusenquiry.cpp ../common_PLE/gresbstatusenquiry.h
355 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/gresbstatusenquiry.o ../common_PLE/gresbstatusenquiry.cpp
361 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/gresbstatusenquiry.o ../common_PLE/gresbstatusenquiry.cpp
356
362
357 obj/spectralmatricesdmasimulator.o: spectralmatricesdmasimulator.cpp spectralmatricesdmasimulator.h
363 obj/spectralmatricesdmasimulator.o: spectralmatricesdmasimulator.cpp spectralmatricesdmasimulator.h
358 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/spectralmatricesdmasimulator.o spectralmatricesdmasimulator.cpp
364 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/spectralmatricesdmasimulator.o spectralmatricesdmasimulator.cpp
359
365
360 obj/rmappluginpythonwrapper.o: rmappluginpythonwrapper.cpp rmappluginpythonwrapper.h
366 obj/rmappluginpythonwrapper.o: rmappluginpythonwrapper.cpp rmappluginpythonwrapper.h \
367 rmapoperations.h \
368 ccsds.h \
369 tcpackettosend.h
361 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginpythonwrapper.o rmappluginpythonwrapper.cpp
370 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/rmappluginpythonwrapper.o rmappluginpythonwrapper.cpp
362
371
363 obj/stardundee.o: stardundee.cpp stardundee.h \
372 obj/stardundee.o: stardundee.cpp stardundee.h \
364 rmapoperations.h
373 rmapoperations.h \
374 ccsds.h
365 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/stardundee.o stardundee.cpp
375 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/stardundee.o stardundee.cpp
366
376
367 obj/gresb.o: gresb.cpp gresb.h \
377 obj/gresb.o: gresb.cpp gresb.h \
368 rmapoperations.h
378 rmapoperations.h \
379 ccsds.h
369 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/gresb.o gresb.cpp
380 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/gresb.o gresb.cpp
370
381
371 obj/bridge.o: bridge.cpp bridge.h \
382 obj/tcpackettosend.o: tcpackettosend.cpp tcpackettosend.h
372 rmapoperations.h
383 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/tcpackettosend.o tcpackettosend.cpp
373 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/bridge.o bridge.cpp
374
384
375 obj/lppmonplugininterface.o: /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.h \
385 obj/lppmonplugininterface.o: /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp /usr/include/lppmon/pluginsInterface/lppmonplugininterface.h \
376 /usr/include/lppmon/pluginsInterface/lppmonplugininterface_global.h
386 /usr/include/lppmon/pluginsInterface/lppmonplugininterface_global.h
377 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/lppmonplugininterface.o /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp
387 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/lppmonplugininterface.o /usr/include/lppmon/pluginsInterface/lppmonplugininterface.cpp
378
388
379 obj/moc_rmappluginui.o: moc/moc_rmappluginui.cpp
389 obj/moc_rmappluginui.o: moc/moc_rmappluginui.cpp
380 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmappluginui.o moc/moc_rmappluginui.cpp
390 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmappluginui.o moc/moc_rmappluginui.cpp
381
391
382 obj/moc_rmapplugin.o: moc/moc_rmapplugin.cpp
392 obj/moc_rmapplugin.o: moc/moc_rmapplugin.cpp
383 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmapplugin.o moc/moc_rmapplugin.cpp
393 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmapplugin.o moc/moc_rmapplugin.cpp
384
394
385 obj/moc_qipdialogbox.o: moc/moc_qipdialogbox.cpp
395 obj/moc_qipdialogbox.o: moc/moc_qipdialogbox.cpp
386 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_qipdialogbox.o moc/moc_qipdialogbox.cpp
396 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_qipdialogbox.o moc/moc_qipdialogbox.cpp
387
397
388 obj/moc_gresbstatusenquiry.o: moc/moc_gresbstatusenquiry.cpp
398 obj/moc_gresbstatusenquiry.o: moc/moc_gresbstatusenquiry.cpp
389 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_gresbstatusenquiry.o moc/moc_gresbstatusenquiry.cpp
399 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_gresbstatusenquiry.o moc/moc_gresbstatusenquiry.cpp
390
400
391 obj/moc_spectralmatricesdmasimulator.o: moc/moc_spectralmatricesdmasimulator.cpp
401 obj/moc_spectralmatricesdmasimulator.o: moc/moc_spectralmatricesdmasimulator.cpp
392 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_spectralmatricesdmasimulator.o moc/moc_spectralmatricesdmasimulator.cpp
402 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_spectralmatricesdmasimulator.o moc/moc_spectralmatricesdmasimulator.cpp
393
403
394 obj/moc_rmappluginpythonwrapper.o: moc/moc_rmappluginpythonwrapper.cpp
404 obj/moc_rmappluginpythonwrapper.o: moc/moc_rmappluginpythonwrapper.cpp
395 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmappluginpythonwrapper.o moc/moc_rmappluginpythonwrapper.cpp
405 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_rmappluginpythonwrapper.o moc/moc_rmappluginpythonwrapper.cpp
396
406
397 obj/moc_stardundee.o: moc/moc_stardundee.cpp
407 obj/moc_stardundee.o: moc/moc_stardundee.cpp
398 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_stardundee.o moc/moc_stardundee.cpp
408 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_stardundee.o moc/moc_stardundee.cpp
399
409
400 obj/moc_gresb.o: moc/moc_gresb.cpp
410 obj/moc_gresb.o: moc/moc_gresb.cpp
401 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_gresb.o moc/moc_gresb.cpp
411 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_gresb.o moc/moc_gresb.cpp
402
412
403 obj/moc_bridge.o: moc/moc_bridge.cpp
413 obj/moc_tcpackettosend.o: moc/moc_tcpackettosend.cpp
404 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_bridge.o moc/moc_bridge.cpp
414 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_tcpackettosend.o moc/moc_tcpackettosend.cpp
405
415
406 obj/moc_genericPySysdriver.o: moc/moc_genericPySysdriver.cpp
416 obj/moc_genericPySysdriver.o: moc/moc_genericPySysdriver.cpp
407 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_genericPySysdriver.o moc/moc_genericPySysdriver.cpp
417 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_genericPySysdriver.o moc/moc_genericPySysdriver.cpp
408
418
409 obj/moc_lppmonplugin.o: moc/moc_lppmonplugin.cpp
419 obj/moc_lppmonplugin.o: moc/moc_lppmonplugin.cpp
410 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_lppmonplugin.o moc/moc_lppmonplugin.cpp
420 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_lppmonplugin.o moc/moc_lppmonplugin.cpp
411
421
412 ####### Install
422 ####### Install
413
423
414 install_target: first FORCE
424 install_target: first FORCE
415 @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/ || $(MKDIR) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/
425 @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/ || $(MKDIR) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/
416 -$(INSTALL_PROGRAM) "bin/$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET)"
426 -$(INSTALL_PROGRAM) "bin/$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET)"
417 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET0)"
427 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET0)"
418 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET1)"
428 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET1)"
419 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET2)"
429 -$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET2)"
420
430
421 uninstall_target: FORCE
431 uninstall_target: FORCE
422 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET)"
432 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET)"
423 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET0)"
433 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET0)"
424 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET1)"
434 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET1)"
425 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET2)"
435 -$(DEL_FILE) "$(INSTALL_ROOT)/home/paul/.lppmon/plugins/$(TARGET2)"
426 -$(DEL_DIR) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/
436 -$(DEL_DIR) $(INSTALL_ROOT)/home/paul/.lppmon/plugins/
427
437
428
438
429 install: install_target FORCE
439 install: install_target FORCE
430
440
431 uninstall: uninstall_target FORCE
441 uninstall: uninstall_target FORCE
432
442
433 FORCE:
443 FORCE:
434
444
@@ -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,798
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 //ccsdsPacketSEMAPHORE->release();
515 emit(ccsdsPacketAvailable(ccsdsPacket, packetLength));
529 //emit(ccsdsPacketAvailable(ccsdsPacket, packetLength));
516 //emit sendMessage("CCSDS packet of size " + QString::number(packetLength) + " received");
530 //emit sendMessage("CCSDS packet of size " + QString::number(packetLength) + " received");
531 storeCCSDSPacket(ccsdsPacket, packetLength);
517 return packetLength;
532 return packetLength;
518 }
533 }
519 return 0;
534 return 0;
520 }
535 }
521
536
537 unsigned int gresb::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
538 {
539 unsigned int i;
540 ccsdsPacketToProcess_t ccsdsPacketToStore;
541
542 ccsdsPacketToStore.size = size;
543 for(i=0; i<size; i++)
544 {
545 ccsdsPacketToStore.data[i] = ccsdsPacket[i];
546 }
547 ccsdsPacketStore << ccsdsPacketToStore;
548 //emit(ccsdsPacketAvailable(ccsdsPacket, packetLength));
549 //emit ccsdsPacketIsAvailable(size);
550 return 1;
551 }
552
522 void gresb::Open() // SLOT
553 void gresb::Open() // SLOT
523 {
554 {
524 bool spwRunning = true;
555 bool spwRunning = true;
525 RMAPSend_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getGRESBIP()),
556 RMAPSend_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()),
526 3000 + gresbVirtualLinkSpinBox->value()*2,
557 3000 + gresbVirtualLinkSpinBox->value()*2,
527 QIODevice::WriteOnly);
558 QIODevice::WriteOnly);
528 RMAPReceive_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getGRESBIP()),
559 RMAPReceive_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()),
529 3000 + gresbVirtualLinkSpinBox->value()*2+1,
560 3000 + gresbVirtualLinkSpinBox->value()*2+1,
530 QIODevice::ReadOnly);
561 QIODevice::ReadOnly);
531 GRESBStatusQuery_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getGRESBIP()),
562 GRESBStatusQuery_SOCKET->connectToHost( QHostAddress(gresbBridgeIPDialogBox->getIP()),
532 3010,
563 3010,
533 QIODevice::ReadWrite);
564 QIODevice::ReadWrite);
534 GRESBStatusQuery_SOCKET->waitForConnected(10000);
565 GRESBStatusQuery_SOCKET->waitForConnected(10000);
535 RMAPReceive_SOCKET->readAll(); // read all remaining data from the reception socket
536 // initialize SPW packet semaphores
566 // initialize SPW packet semaphores
537 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
567 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
538 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
568 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
539 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) != 0)
569 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) != 0)
540 {
570 {
541 spwRunning = gresbStatusQueryDialog->exec();
571 spwRunning = gresbStatusQueryDialog->exec();
542 }
572 }
543 if (spwRunning == false) this->Close();
573 if (spwRunning == false) this->Close();
544 else
574 else
545 {
575 {
546 emit appendToLog(QString("SpaceWire running on virtual link ")+ QString::number(spwLinkSpinBox->value()));
576 emit appendToLog(QString("SpaceWire running on link ")+ QString::number(spwLinkSpinBox->value()));
577 RMAPReceive_SOCKET->readAll(); // read all remaining data from the reception socket
547 emit isOpen(true);
578 emit isOpen(true);
548 }
579 }
549 }
580 }
550
581
551 void gresb::Close() // SLOT
582 void gresb::Close() // SLOT
552 {
583 {
553 RMAPSend_SOCKET->disconnectFromHost();
584 RMAPSend_SOCKET->disconnectFromHost();
554 RMAPReceive_SOCKET->disconnectFromHost();
585 RMAPReceive_SOCKET->disconnectFromHost();
555 GRESBStatusQuery_SOCKET->disconnectFromHost();
586 GRESBStatusQuery_SOCKET->disconnectFromHost();
556 emit isOpen(false);
587 emit isOpen(false);
557 }
588 }
558
589
559 int gresb::GRESBStatusQuery() // SLOT
590 int gresb::GRESBStatusQuery() // SLOT
560 {
591 {
561 GRESBStatusQueryRequest(LinkStatus, 0);
592 GRESBStatusQueryRequest(LinkStatus, 0);
562 GRESBStatusQueryRequest(LinkStatus, 1);
593 GRESBStatusQueryRequest(LinkStatus, 1);
563 GRESBStatusQueryRequest(LinkStatus, 2);
594 GRESBStatusQueryRequest(LinkStatus, 2);
564 GRESBStatusQueryRequest(LinkStatistics, 0);
595 GRESBStatusQueryRequest(LinkStatistics, 0);
565 GRESBStatusQueryRequest(LinkStatistics, 1);
596 GRESBStatusQueryRequest(LinkStatistics, 1);
566 GRESBStatusQueryRequest(LinkStatistics, 2);
597 GRESBStatusQueryRequest(LinkStatistics, 2);
567 return 0;
598 return 0;
568 }
599 }
569
600
570 int gresb::GRESBStatusQueryRequest(GresbStatusQueryOption option, char link)
601 int gresb::GRESBStatusQueryRequest(GresbStatusQueryOption option, char link)
571 {
602 {
572 gresb_status_query_t statusQueryCommand;
603 gresb_status_query_t statusQueryCommand;
573 gresb_link_status_reply_t linkStatusReply;
604 gresb_link_status_reply_t linkStatusReply;
574 gresb_link_statistics_reply_t linkStatisticsReply;
605 gresb_link_statistics_reply_t linkStatisticsReply;
575 QTime statusQueryTimeout;
606 QTime statusQueryTimeout;
576 QString console_message;
607 QString console_message;
577
608
578 statusQueryCommand.protocolIdentifier = (char) 0x02;
609 statusQueryCommand.protocolIdentifier = (char) 0x02;
579 statusQueryCommand.reserved1 = (char) 0x00;
610 statusQueryCommand.reserved1 = (char) 0x00;
580 statusQueryCommand.reserved0 = (char) 0x00;
611 statusQueryCommand.reserved0 = (char) 0x00;
581 statusQueryCommand.option = (char) option;
612 statusQueryCommand.option = (char) option;
582 statusQueryCommand.value3 = (char) 0x00;
613 statusQueryCommand.value3 = (char) 0x00;
583 statusQueryCommand.value2 = (char) 0x00;
614 statusQueryCommand.value2 = (char) 0x00;
584 statusQueryCommand.value1 = (char) 0x00;
615 statusQueryCommand.value1 = (char) 0x00;
585 statusQueryCommand.value0 = (char) link;
616 statusQueryCommand.value0 = (char) link;
586
617
587 GRESBStatusQuery_SOCKET->write((char*) ((void*) &statusQueryCommand), sizeof(statusQueryCommand));
618 GRESBStatusQuery_SOCKET->write((char*) ((void*) &statusQueryCommand), sizeof(statusQueryCommand));
588 GRESBStatusQuery_SOCKET->flush();
619 GRESBStatusQuery_SOCKET->flush();
589 GRESBStatusQuery_SOCKET->waitForBytesWritten(1000);
620 GRESBStatusQuery_SOCKET->waitForBytesWritten(1000);
590
621
591 statusQueryTimeout.start();
622 statusQueryTimeout.start();
592 while(GRESBStatusQuery_SOCKET->bytesToWrite() > 0)
623 while(GRESBStatusQuery_SOCKET->bytesToWrite() > 0)
593 {
624 {
594 GRESBStatusQuery_SOCKET->waitForBytesWritten(100);
625 GRESBStatusQuery_SOCKET->waitForBytesWritten(100);
595 if(statusQueryTimeout.elapsed()>1000)
626 if(statusQueryTimeout.elapsed()>1000)
596 {
627 {
597 emit appendToLog("WARNING === in function GRESBStatusQueryRequest of rmapplugin *** sending StatusQueryCommand timeout");
628 emit appendToLog("WARNING === in function GRESBStatusQueryRequest of rmapplugin *** sending StatusQueryCommand timeout");
598 return 1;
629 return 1;
599 }
630 }
600 }
631 }
601
632
602 switch (option)
633 switch (option)
603 {
634 {
604 case LinkStatus:
635 case LinkStatus:
605 {
636 {
606 statusQueryTimeout.start();
637 statusQueryTimeout.start();
607 while(GRESBStatusQuery_SOCKET->bytesAvailable() < (int) sizeof(linkStatusReply))
638 while(GRESBStatusQuery_SOCKET->bytesAvailable() < (int) sizeof(linkStatusReply))
608 {
639 {
609 GRESBStatusQuery_SOCKET->waitForReadyRead(100);
640 GRESBStatusQuery_SOCKET->waitForReadyRead(100);
610 if(statusQueryTimeout.elapsed()>1000)
641 if(statusQueryTimeout.elapsed()>1000)
611 {
642 {
612 console_message.sprintf("GRESBStatusQueryRequest / LinkStatus => error timeout bytesAvailable()\n");
643 console_message.sprintf("GRESBStatusQueryRequest / LinkStatus => error timeout bytesAvailable()\n");
613 emit appendToLog(console_message);
644 emit appendToLog(console_message);
614 return 1;
645 return 1;
615 }
646 }
616 }
647 }
617 GRESBStatusQuery_SOCKET->read((char*) ((void*) &linkStatusReply), (int) sizeof(linkStatusReply));
648 GRESBStatusQuery_SOCKET->read((char*) ((void*) &linkStatusReply), (int) sizeof(linkStatusReply));
618 console_message.sprintf("%x", linkStatusReply.byte0);
649 console_message.sprintf("%x", linkStatusReply.byte0);
619 spwLinkStatusEnquiry->statusQueryTable->item(0, link)->setText(console_message);
650 spwLinkStatusEnquiry->statusQueryTable->item(0, link)->setText(console_message);
620 console_message.sprintf("%d", linkStatusReply.byte1);
651 console_message.sprintf("%d", linkStatusReply.byte1);
621 spwLinkStatusEnquiry->statusQueryTable->item(1, link)->setText(console_message);
652 spwLinkStatusEnquiry->statusQueryTable->item(1, link)->setText(console_message);
622 if (linkStatusReply.byte0 == 0) return 1;
653 if (linkStatusReply.byte0 == 0) return 1;
623 break;
654 break;
624 }
655 }
625 case LinkStatistics:
656 case LinkStatistics:
626 {
657 {
627 statusQueryTimeout.start();
658 statusQueryTimeout.start();
628 while(GRESBStatusQuery_SOCKET->bytesAvailable() < (int) sizeof(linkStatisticsReply))
659 while(GRESBStatusQuery_SOCKET->bytesAvailable() < (int) sizeof(linkStatisticsReply))
629 {
660 {
630 GRESBStatusQuery_SOCKET->waitForReadyRead(100);
661 GRESBStatusQuery_SOCKET->waitForReadyRead(100);
631 if(statusQueryTimeout.elapsed()>1000)
662 if(statusQueryTimeout.elapsed()>1000)
632 {
663 {
633 console_message.sprintf("GRESBStatusQueryRequest / LinkStatistics => error timeout bytesAvailable()\n");
664 console_message.sprintf("GRESBStatusQueryRequest / LinkStatistics => error timeout bytesAvailable()\n");
634 emit appendToLog(console_message);
665 emit appendToLog(console_message);
635 return 1;
666 return 1;
636 }
667 }
637 }
668 }
638 GRESBStatusQuery_SOCKET->read((char*) ((void*) &linkStatisticsReply), sizeof(linkStatisticsReply));
669 GRESBStatusQuery_SOCKET->read((char*) ((void*) &linkStatisticsReply), sizeof(linkStatisticsReply));
639 /*console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.sizeOfDataTransmitted));
670 /*console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.sizeOfDataTransmitted));
640 UI->spwLinkStatusEnquiry->statusQueryTable->item(9, link)->setText(console_message);
671 UI->spwLinkStatusEnquiry->statusQueryTable->item(9, link)->setText(console_message);
641 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsTransmitted));
672 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsTransmitted));
642 UI->spwLinkStatusEnquiry->statusQueryTable->item(8, link)->setText(console_message);
673 UI->spwLinkStatusEnquiry->statusQueryTable->item(8, link)->setText(console_message);
643 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfTruncatedPacketsReceived));
674 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfTruncatedPacketsReceived));
644 UI->spwLinkStatusEnquiry->statusQueryTable->item(6, link)->setText(console_message);
675 UI->spwLinkStatusEnquiry->statusQueryTable->item(6, link)->setText(console_message);
645 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsWithEEPReceived));
676 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsWithEEPReceived));
646 UI->spwLinkStatusEnquiry->statusQueryTable->item(5, link)->setText(console_message);
677 UI->spwLinkStatusEnquiry->statusQueryTable->item(5, link)->setText(console_message);
647 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.sizeOfDataReceived));
678 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.sizeOfDataReceived));
648 UI->spwLinkStatusEnquiry->statusQueryTable->item(4, link)->setText(console_message);
679 UI->spwLinkStatusEnquiry->statusQueryTable->item(4, link)->setText(console_message);
649 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsReceived));
680 console_message.sprintf("%d", charTab_TO_int(linkStatisticsReply.numberOfPacketsReceived));
650 UI->spwLinkStatusEnquiry->statusQueryTable->item(3, link)->setText(console_message);*/
681 UI->spwLinkStatusEnquiry->statusQueryTable->item(3, link)->setText(console_message);*/
651 break;
682 break;
652 }
683 }
653 case NodeAddressStatistics:
684 case NodeAddressStatistics:
654 {
685 {
655 break;
686 break;
656 }
687 }
657 case GetRoute:
688 case GetRoute:
658 {
689 {
659 break;
690 break;
660 }
691 }
661 }
692 }
662 return 0;
693 return 0;
663 }
694 }
664
695
665 void gresb::reTestSPWLink() // SLOT
696 void gresb::reTestSPWLink() // SLOT
666 {
697 {
667 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 0)
698 if (GRESBStatusQueryRequest(LinkStatus, spwLinkSpinBox->value()) == 0)
668 {
699 {
669 gresbStatusQueryDialog->accept();
700 gresbStatusQueryDialog->accept();
670 }
701 }
671 }
702 }
672
703
673 void gresb::RMAPSendConnectionState(QAbstractSocket::SocketState socketState) // SLOT
704 void gresb::RMAPSendConnectionState(QAbstractSocket::SocketState socketState) // SLOT
674 {
705 {
675 rmapSendStateLabel->setText("");
706 rmapSendStateLabel->setText("");
676 QString socketMessage = "RMAP Send Socket State: ";
707 QString socketMessage = "RMAP Send Socket State: ";
677 switch(socketState)
708 switch(socketState)
678 {
709 {
679 case QAbstractSocket::UnconnectedState :
710 case QAbstractSocket::UnconnectedState :
680 socketMessage.append("0 => Unconnected");
711 socketMessage.append("0 => Unconnected");
681 break;
712 break;
682 case 1:
713 case 1:
683 socketMessage.append("1 => HostLookup");
714 socketMessage.append("1 => HostLookup");
684 break;
715 break;
685 case 2:
716 case 2:
686 socketMessage.append("2 => Connecting");
717 socketMessage.append("2 => Connecting");
687 break;
718 break;
688 case 3:
719 case 3:
689 socketMessage.append("3 => Connected");
720 socketMessage.append("3 => Connected");
690 break;
721 break;
691 case 4:
722 case 4:
692 socketMessage.append("4 => Bound");
723 socketMessage.append("4 => Bound");
693 break;
724 break;
694 case 5:
725 case 5:
695 socketMessage.append("5 => Closing");
726 socketMessage.append("5 => Closing");
696 break;
727 break;
697 case 6:
728 case 6:
698 socketMessage.append("6 => Listening");
729 socketMessage.append("6 => Listening");
699 break;
730 break;
700 }
731 }
701 rmapSendStateLabel->setText(socketMessage);
732 rmapSendStateLabel->setText(socketMessage);
702 emit appendToLog(socketMessage);
733 emit appendToLog(socketMessage);
703 }
734 }
704
735
705 void gresb::RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState) // SLOT
736 void gresb::RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState) // SLOT
706 {
737 {
707 rmapReceiveStateLabel->setText("");
738 rmapReceiveStateLabel->setText("");
708 QString socketMessage = "RMAP Receive Socket State: ";
739 QString socketMessage = "RMAP Receive Socket State: ";
709 switch(socketState)
740 switch(socketState)
710 {
741 {
711 case QAbstractSocket::UnconnectedState :
742 case QAbstractSocket::UnconnectedState :
712 socketMessage.append("0 => Unconnected");
743 socketMessage.append("0 => Unconnected");
713 break;
744 break;
714 case 1:
745 case 1:
715 socketMessage.append("1 => HostLookup");
746 socketMessage.append("1 => HostLookup");
716 break;
747 break;
717 case 2:
748 case 2:
718 socketMessage.append("2 => Connecting");
749 socketMessage.append("2 => Connecting");
719 break;
750 break;
720 case 3:
751 case 3:
721 socketMessage.append("3 => Connected");
752 socketMessage.append("3 => Connected");
722 break;
753 break;
723 case 4:
754 case 4:
724 socketMessage.append("4 => Bound");
755 socketMessage.append("4 => Bound");
725 break;
756 break;
726 case 5:
757 case 5:
727 socketMessage.append("5 => Closing");
758 socketMessage.append("5 => Closing");
728 break;
759 break;
729 case 6:
760 case 6:
730 socketMessage.append("6 => Listening");
761 socketMessage.append("6 => Listening");
731 break;
762 break;
732 }
763 }
733 rmapReceiveStateLabel->setText(socketMessage);
764 rmapReceiveStateLabel->setText(socketMessage);
734 emit appendToLog(socketMessage);
765 emit appendToLog(socketMessage);
735 }
766 }
736
767
737 void gresb::GRESBConnectionState(QAbstractSocket::SocketState socketState) // SLOT
768 void gresb::GRESBConnectionState(QAbstractSocket::SocketState socketState) // SLOT
738 {
769 {
739 gresbStatusQueryLabel->setText("");
770 gresbStatusQueryLabel->setText("");
740 QString socketMessage = "GRESB status query socket (port 3010): ";
771 QString socketMessage = "GRESB status query socket (port 3010): ";
741 switch(socketState)
772 switch(socketState)
742 {
773 {
743 case QAbstractSocket::UnconnectedState :
774 case QAbstractSocket::UnconnectedState :
744 socketMessage.append("0 => Unconnected");
775 socketMessage.append("0 => Unconnected");
745 break;
776 break;
746 case 1:
777 case 1:
747 socketMessage.append("1 => HostLookup");
778 socketMessage.append("1 => HostLookup");
748 break;
779 break;
749 case 2:
780 case 2:
750 socketMessage.append("2 => Connecting");
781 socketMessage.append("2 => Connecting");
751 break;
782 break;
752 case 3:
783 case 3:
753 socketMessage.append("3 => Connected");
784 socketMessage.append("3 => Connected");
754 break;
785 break;
755 case 4:
786 case 4:
756 socketMessage.append("4 => Bound");
787 socketMessage.append("4 => Bound");
757 break;
788 break;
758 case 5:
789 case 5:
759 socketMessage.append("5 => Closing");
790 socketMessage.append("5 => Closing");
760 break;
791 break;
761 case 6:
792 case 6:
762 socketMessage.append("6 => Listening");
793 socketMessage.append("6 => Listening");
763 break;
794 break;
764 }
795 }
765 gresbStatusQueryLabel->setText(socketMessage);
796 gresbStatusQueryLabel->setText(socketMessage);
766 }
797 }
798
@@ -1,101 +1,109
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"
16
17
17 class gresb : public QWidget
18 class gresb : public QWidget
18 {
19 {
19 Q_OBJECT
20 Q_OBJECT
20 public:
21 public:
21 explicit gresb(QWidget *parent = 0);
22 explicit gresb(QWidget *parent = 0);
22 ~gresb();
23 ~gresb();
23 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
24 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);
25 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);
26 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
27
28 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
29 QList<ccsdsPacketToProcess_t> ccsdsPacketStore;
26
30
27 signals:
31 signals:
28 void sendMessage(QString message);
32 void sendMessage(QString message);
29 void isOpen(bool);
33 void isOpen(bool);
30 void RMAP_write_reply_setText(QString);
34 void RMAP_write_reply_setText(QString);
31 void appendToLog(QString);
35 void appendToLog(QString);
32 void ccsdsPacketAvailable(unsigned char*, unsigned int);
36 void ccsdsPacketAvailable(unsigned char*, unsigned int);
37 void packetStoreNotEmpty();
33
38
34 public slots:
39 public slots:
35 void Open();
40 void Open();
36 void Close();
41 void Close();
42 int receiveSPWPacketLoop(unsigned char requestID=0);
37 int receiveSPWPacket(unsigned char requestID=0);
43 int receiveSPWPacket(unsigned char requestID=0);
38 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
44 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
39 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
45 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
46 void sourceHasChanged(int source) {rmapSourceLogicalAddress = (unsigned char) source;}
40 void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();}
47 void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();}
41 void reTestSPWLink();
48 void reTestSPWLink();
42 //
49 //
43 void RMAPSendConnectionState(QAbstractSocket::SocketState socketState);
50 void RMAPSendConnectionState(QAbstractSocket::SocketState socketState);
44 void RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState);
51 void RMAPReceiveConnectionState(QAbstractSocket::SocketState socketState);
45 void GRESBConnectionState(QAbstractSocket::SocketState socketState);
52 void GRESBConnectionState(QAbstractSocket::SocketState socketState);
53 //
54 void setIP(unsigned char address1, unsigned char address2, unsigned char address3, unsigned char address4)
55 {this->gresbBridgeIPDialogBox->setIP(address1, address2, address3, address4);}
46
56
47 private slots:
57 private slots:
48 int GRESBStatusQuery();
58 int GRESBStatusQuery();
49
59
50 private:
60 private:
51 unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0);
61 unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0);
52 unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0);
62 unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0);
53 void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->tryAcquire();}
63 void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->tryAcquire();}
54 void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->tryAcquire();}
64 void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->tryAcquire();}
55 int GRESBStatusQueryRequest(GresbStatusQueryOption option, char link);
65 int GRESBStatusQueryRequest(GresbStatusQueryOption option, char link);
56
66
57 unsigned char rmapTargetLogicalAddress ;
67 unsigned char rmapTargetLogicalAddress ;
58 unsigned char rmapSourceLogicalAddress ;
68 unsigned char rmapSourceLogicalAddress ;
59
69
60 RMAP_command_codes commandCode;
70 RMAP_command_codes commandCode;
61
71
62 QPushButton *gresbStatusQueryRetryButton;
72 QPushButton *gresbStatusQueryRetryButton;
63 QPushButton *gresbStatusQueryAbortButton;
73 QPushButton *gresbStatusQueryAbortButton;
64
74
65 QLabel *gresbBridgeIPLabel;
75 QLabel *gresbBridgeIPLabel;
66 QLabel *gresbVirtualLinkLabel;
76 QLabel *gresbVirtualLinkLabel;
67 QLabel *spwLinkLabel;
77 QLabel *spwLinkLabel;
68 QLabel *rmapSourceLogicalAddressLabel;
69 QLabel *rmapSendStateLabel;
78 QLabel *rmapSendStateLabel;
70 QLabel *rmapReceiveStateLabel;
79 QLabel *rmapReceiveStateLabel;
71 QLabel *gresbStatusQueryLabel;
80 QLabel *gresbStatusQueryLabel;
72 QLabel *gresbStatusQueryDialogLabel;
81 QLabel *gresbStatusQueryDialogLabel;
73
82
74 QDialog *gresbStatusQueryDialog;
83 QDialog *gresbStatusQueryDialog;
75
84
76 QIPDialogBox* gresbBridgeIPDialogBox;
85 QIPDialogBox* gresbBridgeIPDialogBox;
77
86
78 QSpinBox *gresbVirtualLinkSpinBox;
87 QSpinBox *gresbVirtualLinkSpinBox;
79 QSpinBox *spwLinkSpinBox;
88 QSpinBox *spwLinkSpinBox;
80 QSpinBox *rmapSourceLogicalAddressSpinBox;
81
89
82 QGridLayout *connectionLayout;
90 QGridLayout *connectionLayout;
83 QGridLayout *gresbStatusQueryDialogLayout;
91 QGridLayout *gresbStatusQueryDialogLayout;
84
92
85 QTcpSocket *RMAPSend_SOCKET;
93 QTcpSocket *RMAPSend_SOCKET;
86 QTcpSocket *RMAPReceive_SOCKET;
94 QTcpSocket *RMAPReceive_SOCKET;
87 QTcpSocket *GRESBStatusQuery_SOCKET;
95 QTcpSocket *GRESBStatusQuery_SOCKET;
88
96
89 gresbStatusEnquiry* spwLinkStatusEnquiry;
97 gresbStatusEnquiry* spwLinkStatusEnquiry;
90
98
91 // Packet receiver
99 // Packet receiver
92 QSemaphore *rmapPacketSEMAPHORE;
100 QSemaphore *rmapPacketSEMAPHORE;
93 QSemaphore *ccsdsPacketSEMAPHORE;
101 QSemaphore *ccsdsPacketSEMAPHORE;
94 char* rmapPacket; // The buffer to receive RMAP READ packets
102 char* rmapPacket; // The buffer to receive RMAP READ packets
95 unsigned char *ccsdsPacket;
103 unsigned char *ccsdsPacket;
96 char *spwPacket;
104 char *spwPacket;
97 unsigned int rmapPacketSize;
105 unsigned int rmapPacketSize;
98 unsigned int ccsdsPacketSize;
106 unsigned int ccsdsPacketSize;
99 };
107 };
100
108
101 #endif // GRESB_H
109 #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,390
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
61 //**************
62 // get a smart pointer to the __main__ module of the Python interpreter
63 PythonQtObjectPtr context = PythonQt::self()->getMainModule();
64 // add a QObject as variable of name "BUTTON_rmapOpenCommunication" to the namespace of the __main__ module
65 context.addObject("BUTTON_rmapOpenCommunication", UI->rmapOpenCommunicationButton);
66 context.addObject("BUTTON_rmapCloseCommunication", UI->rmapCloseCommunicationButton);
67 context.addObject("BUTTON_selectStarDundee", UI->selectStarDundee_BUTTON);
68 context.addObject("BUTTON_selectGRESB", UI->selectGRESB_BUTTON);
69 context.addObject("GRESB_Bridge", UI->gresbBridge);
70 //**************
45
71
46 connect(UI->rmapOpenCommunicationButton, SIGNAL(clicked()), this, SLOT(openBridge()));
72 connect(UI->rmapOpenCommunicationButton, SIGNAL(clicked()), this, SLOT(openBridge()));
47 connect(UI->rmapCloseCommunicationButton, SIGNAL(clicked()), this, SLOT(closeBridge()));
73 connect(UI->rmapCloseCommunicationButton, SIGNAL(clicked()), this, SLOT(closeBridge()));
48
74
49 // CCSDS
75 // CCSDS
50 connect(this->UI->sendCCSDSCommandButton, SIGNAL(clicked()), this, SLOT(sendCCSDS()));
76 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()));
77 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()));
78 connect(this->UI->reset_TC_LFR_UPDATE_TIME_Button, SIGNAL(clicked()), this, SLOT(reset_TC_LFR_UPDATE_TIME()));
53
79
54 // spectralMAtricesDMASimulator
80 // spectralMAtricesDMASimulator
55 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(rmapplugginRead(uint*,uint,uint)), this, SLOT(Read(uint*,uint,uint)));
81 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)));
82 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)));
83 connect(this->UI->spectralMatricesDMASimulator, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
58
84
59 // GRESB
85 // GRESB
60 connect(this->UI->gresbBridge, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
86 connect(this->UI->gresbBridge, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
61 connect(this->UI->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool)));
87 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)));
88 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)));
89 connect(this->UI->gresbBridge, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString)));
64 connect(this->UI->gresbBridge, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)),
90 connect(this->UI->gresbBridge, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)),
65 this, SLOT(processCCSDSPacket(unsigned char*,uint)));
91 this, SLOT(processCCSDSPacket(unsigned char*,uint)));
66 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->gresbBridge, SLOT(ccsdsPacketIsProcessed()));
92 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->gresbBridge, SLOT(ccsdsPacketIsProcessed()));
93 connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
94 this->UI->gresbBridge, SLOT(targetHasChanged(int)));
95 connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
96 this->UI->gresbBridge, SLOT(sourceHasChanged(int)));
97 connect(this->UI->gresbBridge, SIGNAL(packetStoreNotEmpty()),
98 this, SLOT(processPacketStore()));
67
99
68 // Star Dundee
100 // Star Dundee
69 connect(this->UI->starDundee, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
101 connect(this->UI->starDundee, SIGNAL(sendMessage(QString)), this, SLOT(displayOnConsole(QString)));
70 connect(this->UI->starDundee, SIGNAL(isOpen(bool)), this, SLOT(activatePlugin(bool)));
102 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)));
103 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)));
104 connect(this->UI->starDundee, SIGNAL(appendToLog(QString)), this, SLOT(appendToLog(QString)));
73 connect(this->UI->starDundee, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)),
105 connect(this->UI->starDundee, SIGNAL(ccsdsPacketAvailable(unsigned char*,uint)),
74 this, SLOT(processCCSDSPacket(unsigned char*,uint)));
106 this, SLOT(processCCSDSPacket(unsigned char*,uint)));
75 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->starDundee, SLOT(ccsdsPacketIsProcessed()));
107 connect(this, SIGNAL(ccsdsPacketIsProcessed()), this->UI->starDundee, SLOT(ccsdsPacketIsProcessed()));
108 connect(this->UI->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
109 this->UI->starDundee, SLOT(targetHasChanged(int)));
110 connect(this->UI->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)),
111 this->UI->starDundee, SLOT(sourceHasChanged(int)));
112 connect(this->UI->starDundee, SIGNAL(packetStoreNotEmpty()),
113 this, SLOT(processPacketStore()));
76
114
77 connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(bridgeHasChanged(selectedBridge)));
115 connect(this->UI, SIGNAL(bridgeHasChanged(selectedBridge)), this, SLOT(bridgeHasChanged(selectedBridge)));
116
78 }
117 }
79
118
80 rmapplugin::~rmapplugin()
119 rmapplugin::~rmapplugin()
81 {
120 {
82 if (!RMAPSend_SOCKET->isOpen()) RMAPSend_SOCKET->disconnectFromHost();
121 switch(currentBridge)
83 if (!RMAPReceive_SOCKET->isOpen()) RMAPReceive_SOCKET->disconnectFromHost();
122 {
84 if (!GRESBStatusQuery_SOCKET->isOpen()) GRESBStatusQuery_SOCKET->disconnectFromHost();
123 case selectedBridgeIsGRESB :
124 if (RMAPSend_SOCKET->isOpen()) RMAPSend_SOCKET->disconnectFromHost();
125 if (RMAPReceive_SOCKET->isOpen()) RMAPReceive_SOCKET->disconnectFromHost();
126 if (GRESBStatusQuery_SOCKET->isOpen()) GRESBStatusQuery_SOCKET->disconnectFromHost();
127 break;
128 case selectedBridgeIsStarDundee :
129 break;
130 default:
131 break;
132 }
85 }
133 }
86
134
87 unsigned int rmapplugin::Write(unsigned int *Value, unsigned int count, unsigned int address)
135 unsigned int rmapplugin::Write(unsigned int *Value, unsigned int count, unsigned int address)
88 {
136 {
89 unsigned int result;
137 unsigned int result;
90 switch(currentBridge)
138 switch(currentBridge)
91 {
139 {
92 case selectedBridgeIsGRESB :
140 case selectedBridgeIsGRESB :
93 result = UI->gresbBridge->Write(Value, count, address);
141 result = UI->gresbBridge->Write(Value, count, address);
94 break;
142 break;
95 case selectedBridgeIsStarDundee :
143 case selectedBridgeIsStarDundee :
96 result = UI->starDundee->Write(Value, count, address);
144 result = UI->starDundee->Write(Value, count, address);
97 break;
145 break;
98 default:
146 default:
99 result = 1;
147 result = 1;
100 break;
148 break;
101 }
149 }
102 return result;
150 return result;
103 }
151 }
104
152
105 unsigned int rmapplugin::Read(unsigned int *Value, unsigned int count, unsigned int address)
153 unsigned int rmapplugin::Read(unsigned int *Value, unsigned int count, unsigned int address)
106 {
154 {
107 unsigned int result;
155 unsigned int result;
108 switch(currentBridge)
156 switch(currentBridge)
109 {
157 {
110 case selectedBridgeIsGRESB :
158 case selectedBridgeIsGRESB :
111 result = UI->gresbBridge->Read(Value, count, address);
159 result = UI->gresbBridge->Read(Value, count, address);
112 break;
160 break;
113 case selectedBridgeIsStarDundee :
161 case selectedBridgeIsStarDundee :
114 result = UI->starDundee->Read(Value, count, address);
162 result = UI->starDundee->Read(Value, count, address);
115 break;
163 break;
116 default:
164 default:
117 result = 1;
165 result = 1;
118 break;
166 break;
119 }
167 }
120 return result;
168 return result;
121 }
169 }
122
170
123 ////////
171 ////////
124 // SLOTS
172 // SLOTS
125
173
126 unsigned int rmapplugin::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication) // SLOT
174 unsigned int rmapplugin::WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication) // SLOT
127 {
175 {
128 unsigned int result;
176 unsigned int result;
129 switch(currentBridge)
177 switch(currentBridge)
130 {
178 {
131 case selectedBridgeIsGRESB :
179 case selectedBridgeIsGRESB :
132 result = UI->gresbBridge->WriteSPW(Value, count, targetLogicalAddress, userApplication);
180 result = UI->gresbBridge->WriteSPW(Value, count, targetLogicalAddress, userApplication);
133 break;
181 break;
134 case selectedBridgeIsStarDundee :
182 case selectedBridgeIsStarDundee :
135 result = UI->starDundee->WriteSPW(Value, count, targetLogicalAddress, userApplication);
183 result = UI->starDundee->WriteSPW(Value, count, targetLogicalAddress, userApplication);
136 break;
184 break;
137 default:
185 default:
138 result = 1;
186 result = 1;
139 break;
187 break;
140 }
188 }
141 return result;
189 return result;
142 }
190 }
143
191
144 void rmapplugin::sendCCSDS() // SLOT
192 void rmapplugin::sendCCSDS() // SLOT
145 {
193 {
146 unsigned int nbBYTES_application_data = 8;
194 unsigned int nbBYTES_application_data = 8;
147 unsigned int count;
195 unsigned int count;
148 char *tab;
196 char *tab;
149 unsigned char packetErrorControl1 = 0xaa;
197 unsigned char packetErrorControl1 = 0xaa;
150 unsigned char packetErrorControl0 = 0xbb;
198 unsigned char packetErrorControl0 = 0xbb;
151
199
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
200 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,
201 /* unsigned char data_field_header,
154 unsigned char processID,
202 unsigned char processID,
155 unsigned int sequence_count,
203 unsigned int sequence_count,
156 unsigned int packet_length,
204 unsigned int packet_length,
157 unsigned char acceptance,
205 unsigned char acceptance,
158 unsigned int completion,
206 unsigned int completion,
159 unsigned char service_type,
207 unsigned char service_type,
160 unsigned char service_subtype,
208 unsigned char service_subtype,
161 unsigned char sourceID*/
209 unsigned char sourceID*/
162
210
163 count = nbBYTES_application_data+12; // 12 is the size in bytes of the header
211 count = nbBYTES_application_data+12; // 12 is the size in bytes of the header
164 tab = (char*) malloc(count);
212 tab = (char*) malloc(count);
165 tab[0] = ccsds_command->ccsds_header->packetId1;
213 tab[0] = ccsds_command->ccsds_header->packetId1;
166 tab[1] = ccsds_command->ccsds_header->packetId0;
214 tab[1] = ccsds_command->ccsds_header->packetId0;
167 tab[2] = ccsds_command->ccsds_header->packetSequenceControl1;
215 tab[2] = ccsds_command->ccsds_header->packetSequenceControl1;
168 tab[3] = ccsds_command->ccsds_header->packetSequenceControl0;
216 tab[3] = ccsds_command->ccsds_header->packetSequenceControl0;
169 tab[4] = ccsds_command->ccsds_header->packetLength1;
217 tab[4] = ccsds_command->ccsds_header->packetLength1;
170 tab[5] = ccsds_command->ccsds_header->packetLength0;
218 tab[5] = ccsds_command->ccsds_header->packetLength0;
171 tab[6] = ccsds_command->ccsds_header->dataFieldHeader3;
219 tab[6] = ccsds_command->ccsds_header->dataFieldHeader3;
172 tab[7] = ccsds_command->ccsds_header->dataFieldHeader2;
220 tab[7] = ccsds_command->ccsds_header->dataFieldHeader2;
173 tab[8] = ccsds_command->ccsds_header->dataFieldHeader1;
221 tab[8] = ccsds_command->ccsds_header->dataFieldHeader1;
174 tab[9] = ccsds_command->ccsds_header->dataFieldHeader0;
222 tab[9] = ccsds_command->ccsds_header->dataFieldHeader0;
175 tab[10]=0x00;
223 tab[10]=0x00;
176 tab[11]=0x00;
224 tab[11]=0x00;
177 tab[12]=0x00;
225 tab[12]=0x00;
178 tab[13]=0x00;
226 tab[13]=0x00;
179 tab[14]=0x00;
227 tab[14]=0x00;
180 tab[15]=0x00;
228 tab[15]=0x00;
181 tab[nbBYTES_application_data+10] = packetErrorControl1;
229 tab[nbBYTES_application_data+10] = packetErrorControl1;
182 tab[nbBYTES_application_data+11] = packetErrorControl0;
230 tab[nbBYTES_application_data+11] = packetErrorControl0;
183
231
184 WriteSPW(tab, count, UI->CCSDSTargetLogicalAddressSpinBox->value(), 0x00);
232 WriteSPW(tab, count, UI->CCSDSTargetLogicalAddressSpinBox->value(), 0x00);
185
233
186 free(tab);
234 free(tab);
187 }
235 }
188
236
189 void rmapplugin::openBridge()
237 void rmapplugin::openBridge()
190 {
238 {
191 switch(currentBridge)
239 switch(currentBridge)
192 {
240 {
193 case selectedBridgeIsGRESB :
241 case selectedBridgeIsGRESB :
194 this->UI->gresbBridge->Open();
242 this->UI->gresbBridge->Open();
195 break;
243 break;
196 case selectedBridgeIsStarDundee :
244 case selectedBridgeIsStarDundee :
197 this->UI->starDundee->Open();
245 this->UI->starDundee->Open();
198 break;
246 break;
199 default:
247 default:
200 break;
248 break;
201 }
249 }
202 }
250 }
203
251
204 void rmapplugin::closeBridge()
252 void rmapplugin::closeBridge()
205 {
253 {
206 switch(currentBridge)
254 switch(currentBridge)
207 {
255 {
208 case selectedBridgeIsGRESB :
256 case selectedBridgeIsGRESB :
209 this->UI->gresbBridge->Close();
257 this->UI->gresbBridge->Close();
210 break;
258 break;
211 case selectedBridgeIsStarDundee :
259 case selectedBridgeIsStarDundee :
212 this->UI->starDundee->Close();
260 this->UI->starDundee->Close();
213 break;
261 break;
214 default:
262 default:
215 break;
263 break;
216 }
264 }
217 }
265 }
218
266
219 void rmapplugin::send_TC_LFR_UPDATE_TIME()
267 void rmapplugin::send_TC_LFR_UPDATE_TIME()
220 {
268 {
221 unsigned int nbBYTES_application_data = 6; // Time at CUC format is on 48 bits / 6 bytes
269 unsigned int nbBYTES_application_data = 6; // Time at CUC format is on 48 bits / 6 bytes
222 unsigned int count;
270 unsigned int count;
223 char *tab;
271 char *tab;
224 unsigned char packetErrorControl1 = 0xaa;
272 unsigned char packetErrorControl1 = 0xaa;
225 unsigned char packetErrorControl0 = 0xbb;
273 unsigned char packetErrorControl0 = 0xbb;
226
274
227 ccsds_command = new ccsds(1, 11, 0, nbBYTES_application_data, 1, 1, 9, 129, 0);
275 ccsds_command = new ccsds(1, 11, 0, nbBYTES_application_data, 1, 1, 9, 129, 0);
228 /* unsigned char data_field_header,
276 /* unsigned char data_field_header,
229 unsigned char processID,
277 unsigned char processID,
230 unsigned int sequence_count,
278 unsigned int sequence_count,
231 unsigned int packet_length,
279 unsigned int packet_length,
232 unsigned char acceptance,
280 unsigned char acceptance,
233 unsigned int completion,
281 unsigned int completion,
234 unsigned char service_type,
282 unsigned char service_type,
235 unsigned char service_subtype,
283 unsigned char service_subtype,
236 unsigned char sourceID*/
284 unsigned char sourceID*/
237
285
238 count = nbBYTES_application_data+12; // +12 => packet header 6 bytes + data field header 4 bytes + packet error control 2 bytes
286 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);
287 tab = (char*) malloc(count);
240 tab[0] = ccsds_command->ccsds_header->packetId1;
288 tab[0] = ccsds_command->ccsds_header->packetId1;
241 tab[1] = ccsds_command->ccsds_header->packetId0;
289 tab[1] = ccsds_command->ccsds_header->packetId0;
242 tab[2] = ccsds_command->ccsds_header->packetSequenceControl1;
290 tab[2] = ccsds_command->ccsds_header->packetSequenceControl1;
243 tab[3] = ccsds_command->ccsds_header->packetSequenceControl0;
291 tab[3] = ccsds_command->ccsds_header->packetSequenceControl0;
244 tab[4] = ccsds_command->ccsds_header->packetLength1;
292 tab[4] = ccsds_command->ccsds_header->packetLength1;
245 tab[5] = ccsds_command->ccsds_header->packetLength0;
293 tab[5] = ccsds_command->ccsds_header->packetLength0;
246 tab[6] = ccsds_command->ccsds_header->dataFieldHeader3;
294 tab[6] = ccsds_command->ccsds_header->dataFieldHeader3;
247 tab[7] = ccsds_command->ccsds_header->dataFieldHeader2;
295 tab[7] = ccsds_command->ccsds_header->dataFieldHeader2;
248 tab[8] = ccsds_command->ccsds_header->dataFieldHeader1;
296 tab[8] = ccsds_command->ccsds_header->dataFieldHeader1;
249 tab[9] = ccsds_command->ccsds_header->dataFieldHeader0;
297 tab[9] = ccsds_command->ccsds_header->dataFieldHeader0;
250 tab[10] = (unsigned char) (time_COARSE>>24);
298 tab[10] = (unsigned char) (time_COARSE>>24);
251 tab[11] = (unsigned char) (time_COARSE>>18);
299 tab[11] = (unsigned char) (time_COARSE>>18);
252 tab[12] = (unsigned char) (time_COARSE>>8);
300 tab[12] = (unsigned char) (time_COARSE>>8);
253 tab[13] = (unsigned char) (time_COARSE);
301 tab[13] = (unsigned char) (time_COARSE);
254 tab[14] = (unsigned char) (time_FINE>>8);
302 tab[14] = (unsigned char) (time_FINE>>8);
255 tab[15] = (unsigned char) (time_FINE);
303 tab[15] = (unsigned char) (time_FINE);
256 tab[nbBYTES_application_data+10] = packetErrorControl1;
304 tab[nbBYTES_application_data+10] = packetErrorControl1;
257 tab[nbBYTES_application_data+11] = packetErrorControl0;
305 tab[nbBYTES_application_data+11] = packetErrorControl0;
258
306
259 WriteSPW(tab, count, UI->CCSDSTargetLogicalAddressSpinBox->value(), 0x00);
307 WriteSPW(tab, count, UI->CCSDSTargetLogicalAddressSpinBox->value(), 0x00);
260
308
261 time_COARSE = time_COARSE+1;
309 time_COARSE = time_COARSE+1;
262
310
263 free(tab);
311 free(tab);
264 }
312 }
265
313
266 void rmapplugin::reset_TC_LFR_UPDATE_TIME()
314 void rmapplugin::reset_TC_LFR_UPDATE_TIME()
267 {
315 {
268 time_COARSE = 0;
316 time_COARSE = 0;
269 time_FINE = 0;
317 time_FINE = 0;
270 }
318 }
271
319
272 void rmapplugin::RMAP_write_reply_setText(QString text)
320 void rmapplugin::RMAP_write_reply_setText(QString text)
273 {
321 {
274 this->UI->RMAP_write_reply->setText(text);
322 this->UI->RMAP_write_reply->setText(text);
275 }
323 }
276
324
277 void rmapplugin::appendToLog(QString text)
325 void rmapplugin::appendToLog(QString text)
278 {
326 {
279 APPENDTOLOG(text);
327 APPENDTOLOG(text);
280 }
328 }
281
329
330 void rmapplugin::setValueTargetAddress(unsigned char newAddress)
331 {
332 this->UI->rmapTargetLogicalAddressSpinBox->setValue(newAddress);
333 }
334
335 void rmapplugin::setValueSourceAddress(unsigned char newAddress)
336 {
337 this->UI->rmapSourceLogicalAddressSpinBox->setValue(newAddress);
338 }
339
282 /////////////////////
340 /////////////////////
283 // INTERNAL FUNCTIONS
341 // INTERNAL FUNCTIONS
284
342
285 void rmapplugin::processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size) // SLOT
343 void rmapplugin::processCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size) // SLOT
286 {
344 {
287 QString message;
345 QString message;
288 unsigned int fine_time_value = 0;
346 unsigned int fine_time_value = 0;
289 fine_time_value = ((unsigned int) ccsdsPacket[7]<<24)
347 fine_time_value = ((unsigned int) ccsdsPacket[7]<<24)
290 + ((unsigned int) ccsdsPacket[6]<<16)
348 + ((unsigned int) ccsdsPacket[6]<<16)
291 + ((unsigned int) ccsdsPacket[5]<<8)
349 + ((unsigned int) ccsdsPacket[5]<<8)
292 + ((unsigned int) ccsdsPacket[4]);
350 + ((unsigned int) ccsdsPacket[4]);
293 message.append(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": ");
351 message.append(QTime::currentTime().toString() +":" + QString::number(QTime::currentTime().msec()) + ": ");
294 message.append("size "
352 message.append("size "
295 + QString::number(size)
353 + QString::number(size)
296 +" *** header "
354 +" *** header "
297 + QString::number(ccsdsPacket[0], 16)
355 + QString::number(ccsdsPacket[0], 16)
298 + " "
356 + " "
299 + QString::number(ccsdsPacket[1], 16)
357 + QString::number(ccsdsPacket[1], 16)
300 + " "
358 + " "
301 + QString::number(ccsdsPacket[2], 16)
359 + QString::number(ccsdsPacket[2], 16)
302 + " "
360 + " "
303 + QString::number(ccsdsPacket[3], 16)
361 + QString::number(ccsdsPacket[3], 16)
304 + " *** coarse time "
362 + " *** coarse time "
305 + QString::number(fine_time_value));
363 + QString::number(fine_time_value));
306 //+ QString::number(ccsdsPacket[4], 16)
364 //+ QString::number(ccsdsPacket[4], 16)
307 //+" "
365 //+" "
308 //+ QString::number(ccsdsPacket[5], 16)
366 //+ QString::number(ccsdsPacket[5], 16)
309 //+" "
367 //+" "
310 //+ QString::number(ccsdsPacket[6], 16)
368 //+ QString::number(ccsdsPacket[6], 16)
311 //+" "
369 //+" "
312 //+ QString::number(ccsdsPacket[7], 16));
370 //+ QString::number(ccsdsPacket[7], 16));
313 displayOnConsole(message);
371 displayOnConsole(message);
372 ((rmappluginPythonWrapper*)this->pyObject)->storeCCSDSPacket(ccsdsPacket, size);
314 emit ccsdsPacketIsProcessed();
373 emit ccsdsPacketIsProcessed();
315 }
374 }
316
375
376 void rmapplugin::processPacketStore()
377 {
378 switch(currentBridge)
379 {
380 case selectedBridgeIsGRESB :
381 ((rmappluginPythonWrapper*)this->pyObject)->ccsdsPacketStore = &(this->UI->gresbBridge->ccsdsPacketStore);
382 break;
383 case selectedBridgeIsStarDundee :
384 ((rmappluginPythonWrapper*)this->pyObject)->ccsdsPacketStore = &(this->UI->starDundee->ccsdsPacketStore);
385 break;
386 default:
387 break;
388 }
389 ((rmappluginPythonWrapper*)this->pyObject)->processPacketStore();
390 }
@@ -1,88 +1,91
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();
60 //
63 //
61 void sendCCSDS();
64 void sendCCSDS();
62 void send_TC_LFR_UPDATE_TIME();
65 void send_TC_LFR_UPDATE_TIME();
63 void reset_TC_LFR_UPDATE_TIME();
66 void reset_TC_LFR_UPDATE_TIME();
64 void displayOnConsole(QString message) {this->UI->console->append(message);}
67 void displayOnConsole(QString message) {this->UI->console->append(message);}
65 //
68 //
66 void RMAP_write_reply_setText(QString text);
69 void RMAP_write_reply_setText(QString text);
67 void appendToLog(QString text);
70 void appendToLog(QString text);
68 //
71 //
69 void activatePlugin(bool flag) {emit activateSig(flag);}
72 void activatePlugin(bool flag) {emit activateSig(flag);}
70 void bridgeHasChanged(selectedBridge bridge) {currentBridge = bridge;}
73 void bridgeHasChanged(selectedBridge bridge) {currentBridge = bridge;}
71
74
72 signals:
75 signals:
73 void ccsdsPacketIsProcessed();
76 void ccsdsPacketIsProcessed();
74
77
75 private:
78 private:
76 selectedBridge currentBridge;
79 selectedBridge currentBridge;
77 rmapPluginUI* UI;
80 rmapPluginUI* UI;
78 QTcpSocket* GRESBStatusQuery_SOCKET;
81 QTcpSocket* GRESBStatusQuery_SOCKET;
79 QTcpSocket* RMAPSend_SOCKET;
82 QTcpSocket* RMAPSend_SOCKET;
80 QTcpSocket* RMAPReceive_SOCKET;
83 QTcpSocket* RMAPReceive_SOCKET;
81 ccsds* ccsds_command;
84 ccsds* ccsds_command;
82 unsigned int rmapPacketSize;
85 unsigned int rmapPacketSize;
83 unsigned int time_COARSE;
86 unsigned int time_COARSE;
84 unsigned int time_FINE;
87 unsigned int time_FINE;
85 char timeCode;
88 char timeCode;
86 };
89 };
87
90
88 #endif // DRIVER1_H
91 #endif // DRIVER1_H
@@ -1,70 +1,70
1 #
1 #
2 # Project created by QtCreator 2011-09-20T08:15:30
2 # Project created by QtCreator 2011-09-20T08:15:30
3 #
3 #
4 #-------------------------------------------------
4 #-------------------------------------------------
5
5
6 #include(/etc/lppmon/lppmonplugin.prf)
6 #include(/etc/lppmon/lppmonplugin.prf)
7 CONFIG += lppmonplugin
7 CONFIG += lppmonplugin
8 TARGET = rmapplugin
8 TARGET = rmapplugin
9
9
10 DEFINES += PLUGIN=rmapplugin
10 DEFINES += PLUGIN=rmapplugin
11 DEFINES += PLUGINHEADER="\"\\\"rmapplugin.h"\\\"\"
11 DEFINES += PLUGINHEADER="\"\\\"rmapplugin.h"\\\"\"
12 DEFINES += driver_Name="\"\\\"RMAPPlugin"\\\"\"
12 DEFINES += driver_Name="\"\\\"RMAPPlugin"\\\"\"
13 DEFINES += driver_Author="\"\\\"Paul Leroy paul.leroy@lpp.polytechnique.fr"\\\"\"
13 DEFINES += driver_Author="\"\\\"Paul Leroy paul.leroy@lpp.polytechnique.fr"\\\"\"
14 DEFINES += driver_Version="\"\\\"1.1.2"\\\"\"
14 DEFINES += driver_Version="\"\\\"1.1.2"\\\"\"
15 DEFINES += driver_Description="\"\\\"AHB bus controler, works with Gaisler's AHB plugn' play bus."\\\"\"
15 DEFINES += driver_Description="\"\\\"AHB bus controler, works with Gaisler's AHB plugn' play bus."\\\"\"
16 DEFINES += driver_can_be_root=1
16 DEFINES += driver_can_be_root=1
17 DEFINES += driver_can_be_child=0
17 DEFINES += driver_can_be_child=0
18 DEFINES += driver_VID=0
18 DEFINES += driver_VID=0
19 DEFINES += driver_PID=0
19 DEFINES += driver_PID=0
20
20
21 QT += network
21 QT += network
22
22
23 LIBS += ../spw_usb_driver_v2.61/lib/x86_64/libSpaceWireUSBAPI.so \
23 LIBS += ../spw_usb_driver_v2.61/lib/x86_64/libSpaceWireUSBAPI.so \
24 ../spw_usb_driver_v2.61/lib/x86_64/libConfigLibraryUSB.so
24 ../spw_usb_driver_v2.61/lib/x86_64/libConfigLibraryUSB.so
25
25
26
26
27 INCLUDEPATH += \
27 INCLUDEPATH += \
28 $${PWD} \
28 $${PWD} \
29 ../common_PLE \
29 ../common_PLE \
30 ../spw_usb_driver_v2.61/inc
30 ../spw_usb_driver_v2.61/inc
31
31
32
32
33 HEADERS += \
33 HEADERS += \
34 rmappluginui.h \
34 rmappluginui.h \
35 rmapplugin.h \
35 rmapplugin.h \
36 rmapoperations.h \
36 rmapoperations.h \
37 ccsds.h \
37 ccsds.h \
38 ../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
47
48
48
49 SOURCES += \
49 SOURCES += \
50 rmapplugin.cpp \
50 rmapplugin.cpp \
51 rmappluginui.cpp \
51 rmappluginui.cpp \
52 rmapoperations.cpp \
52 rmapoperations.cpp \
53 ccsds.cpp \
53 ccsds.cpp \
54 ../common_PLE/qipdialogbox.cpp \
54 ../common_PLE/qipdialogbox.cpp \
55 ../common_PLE/gresbstatusenquiry.cpp \
55 ../common_PLE/gresbstatusenquiry.cpp \
56 spectralmatricesdmasimulator.cpp \
56 spectralmatricesdmasimulator.cpp \
57 rmappluginpythonwrapper.cpp \
57 rmappluginpythonwrapper.cpp \
58 stardundee.cpp \
58 stardundee.cpp \
59 gresb.cpp \
59 gresb.cpp \
60 bridge.cpp
60 tcpackettosend.cpp
61
61
62
62
63
63
64
64
65
65
66
66
67
67
68
68
69
69
70
70
@@ -1,19 +1,174
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()));
7 }
12 }
8
13
9
10 QList<QVariant> rmappluginPythonWrapper::getData()
14 QList<QVariant> rmappluginPythonWrapper::getData()
11 {
15 {
12 QList<QVariant> data;
16 QList<QVariant> data;
13 for (int i = 0; i<1024; i++)
17 for (int i = 0; i<1024; i++)
14 {
18 {
15 QVariant t(1000*cos(0.1*i));
19 QVariant t(1000*cos(0.1*i));
16 data.append(t);
20 data.append(t);
17 }
21 }
18 return data;
22 return data;
19 }
23 }
24
25 QList<QVariant> rmappluginPythonWrapper::ReadSPW(unsigned int size)
26 {
27 QList<QVariant> result;
28 ccsdsPacketToProcess_t ccsdsPacket;
29
30 if (!ccsdsPacketStore->isEmpty())
31 {
32 ccsdsPacket = ccsdsPacketStore->takeFirst();
33 for(unsigned int i = 0;i<size;i++)
34 {
35 result.append((QVariant)ccsdsPacket.data[i]);
36 }
37 }
38 return result;
39 }
40
41 void rmappluginPythonWrapper::WriteSPW(QList<int> dataList)
42 {
43 char targetLogicalAddress;
44 char userApplication;
45 unsigned int count;
46 char *Value;
47
48 unsigned char data[dataList.count()];
49
50 for(int i = 0; i<dataList.count(); i++) // get the data as unsigned char
51 {
52 data[i] = (unsigned char)dataList.at(i);
53 }
54 // read the first bytes of the data to get the targetLogicalAddress and the userApplication parameters
55 targetLogicalAddress = data[0];
56 userApplication = data[3];
57
58 count = dataList.count() - 4; // the CCSDS header (4 bytes) is added by LPPMON
59 Value = (char*) &data[4];
60
61 emit WriteSPWSig(Value, count, targetLogicalAddress, userApplication);
62 }
63
64 void rmappluginPythonWrapper::WriteSPWDelay(QList<int> dataList, unsigned int delay)
65 {
66 char targetLogicalAddress;
67 char userApplication;
68 unsigned int count;
69 char *Value;
70 TCPacketToSend *packet;
71
72 unsigned char data[dataList.count()];
73
74 for(int i = 0; i<dataList.count(); i++) // get the data as unsigned char
75 {
76 data[i] = (unsigned char)dataList.at(i);
77 }
78 // read the first bytes of the data to get the targetLogicalAddress and the userApplication parameters
79 targetLogicalAddress = data[0];
80 userApplication = data[3];
81
82 count = dataList.count() - 4; // the CCSDS header (4 bytes) is added by LPPMON
83 Value = (char*) &data[4];
84
85 packet = new TCPacketToSend(Value, count, targetLogicalAddress, userApplication, delay);
86 TCPacketStore.append(packet);
87
88 emit(activateTCLoopSig());
89
90 }
91
92 void rmappluginPythonWrapper::processPacketStoreLater(unsigned int delay)
93 {
94 emit sendMessage(
95 "*** process packet store in " + QString::number(delay) + " ms"
96 );
97 QTimer::singleShot(delay, this, SLOT(sendProcessPacketStoreNowSig()));
98 }
99
100 void rmappluginPythonWrapper::sendTCLoop()
101 {
102 unsigned int delay;
103
104 if (!timer->isActive())
105 {
106 if (!TCPacketStore.isEmpty())
107 {
108 delay = TCPacketStore.at(0)->delay;
109 timer->setInterval(delay);
110 timer->start();
111 }
112 }
113 }
114
115 void rmappluginPythonWrapper::sendTC()
116 {
117 TCPacketToSend *packet;
118 unsigned int delay;
119
120 packet = TCPacketStore.takeFirst();
121 // the signal is connected with the option Qt::DirectConnection, thus it is processed immediately
122 emit(WriteSPWSig(packet->Value, packet->count,packet->targetLogicalAddress, packet->userApplication));
123 delete(packet);
124 if (!TCPacketStore.isEmpty())
125 {
126 delay = TCPacketStore.at(0)->delay;
127 timer->setInterval(delay);
128 timer->start();
129 }
130 }
131
132 unsigned int rmappluginPythonWrapper::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
133 {
134 unsigned int i;
135 ccsdsPacketToProcess_t ccsdsPacketToStore;
136
137 ccsdsPacketToStore.size = size;
138 for(i=0; i<size; i++)
139 {
140 //ccsdsPacket0[i] = ccsdsPacket[i];
141 ccsdsPacketToStore.data[i] = ccsdsPacket[i];
142 }
143 ccsdsPacketStore->append(ccsdsPacketToStore);
144 emit ccsdsPacketIsAvailable(size);
145 return 1;
146 }
147
148 void rmappluginPythonWrapper::processPacketStore()
149 {
150 while (!ccsdsPacketStore->isEmpty())
151 {
152 emit ccsdsPacketIsAvailable(ccsdsPacketStore->at(0).size);
153 ProcessPendingEvents();
154 }
155 }
156
157 void rmappluginPythonWrapper::setTargetAddressValue(unsigned int address)
158 {
159 unsigned char newAddress;
160 newAddress = (unsigned char) address;
161 emit updateTargetAddress(newAddress);
162 }
163
164 void rmappluginPythonWrapper::setSourceAddressValue(unsigned int address)
165 {
166 unsigned char newAddress;
167 newAddress = (unsigned char) address;
168 emit updateSourceAddress(newAddress);
169 }
170
171 void rmappluginPythonWrapper::ProcessPendingEvents()
172 {
173 QCoreApplication::processEvents();
174 }
@@ -1,22 +1,55
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 <QTimer>
8
12
9 class rmappluginPythonWrapper : public genericPySysdriver
13 class rmappluginPythonWrapper : public genericPySysdriver
10 {
14 {
11 Q_OBJECT
15 Q_OBJECT
12 public:
16 public:
13 explicit rmappluginPythonWrapper(QObject *parent = 0);
17 explicit rmappluginPythonWrapper(QObject *parent = 0);
18
19 QList<ccsdsPacketToProcess_t> *ccsdsPacketStore;
20 void processPacketStore();
21 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
22
23 QList<TCPacketToSend*> TCPacketStore;
24 QTimer *timer;
14
25
15 signals:
26 signals:
27 void ccsdsPacketIsAvailable(unsigned int size);
28 void wakeUpCallingThread();
29 unsigned int WriteSPWSig(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
30 void updateTargetAddress(unsigned char newAddress);
31 void updateSourceAddress(unsigned char newAddress);
32 void activateTCLoopSig();
33 void processPacketStoreNowSig();
34 void sendMessage(QString message);
16
35
17 public slots:
36 public slots:
18 QList<QVariant> getData();
37 QList<QVariant> getData();
38
39 QList<QVariant> ReadSPW(unsigned int size);
40 void WriteSPW(QList<int> dataList);
41 void WriteSPWDelay(QList<int> dataList, unsigned int delay=0);
42 void processPacketStoreLater(unsigned int delay);
43 void sendProcessPacketStoreNowSig(){emit processPacketStoreNowSig();}
44 void sendTCLoop();
45 void sendTC();
46 void reEmitWriteSPWSig(char *Value, unsigned int count, char targetLogicalAddress, char userApplication)
47 {emit WriteSPWSig(Value, count, targetLogicalAddress, userApplication);}
48
49 void setTargetAddressValue(unsigned int address);
50 void setSourceAddressValue(unsigned int address);
51 void ProcessPendingEvents();
19
52
20 };
53 };
21
54
22 #endif // RMAPPLUGINPYTHONWRAPPER_H
55 #endif // RMAPPLUGINPYTHONWRAPPER_H
@@ -1,293 +1,298
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the LPPMON Software
2 -- This file is a part of the LPPMON Software
3 -- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
3 -- Copyright (C) 2011, Laboratory of Plasmas Physic - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 3 of the License, or
7 -- the Free Software Foundation; either version 3 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "rmapplugin.h"
22 #include "rmapplugin.h"
23
23
24 rmapPluginUI::rmapPluginUI(QWidget *parent) :
24 rmapPluginUI::rmapPluginUI(QWidget *parent) :
25 QWidget(parent)
25 QWidget(parent)
26 {
26 {
27 spectralMatricesDMASimulator = new SpectralMatricesDMASimulator;
27 spectralMatricesDMASimulator = new SpectralMatricesDMASimulator;
28 spwTabWidget = new QTabWidget;
28 spwTabWidget = new QTabWidget;
29 QWidget* spwTabWidgetPage0 = new QWidget;
29 QWidget* spwTabWidgetPage0 = new QWidget;
30 QWidget* spwTabWidgetPage1 = new QWidget;
30 QWidget* spwTabWidgetPage1 = new QWidget;
31 QWidget* spwTabWidgetPage2 = new QWidget;
31 QWidget* spwTabWidgetPage2 = new QWidget;
32 QWidget* spwTabWidgetPage3 = new QWidget;
32 QWidget* spwTabWidgetPage3 = new QWidget;
33 QWidget* spwTabWidgetPage4 = new QWidget;
33 QWidget* spwTabWidgetPage4 = new QWidget;
34 bridgeWidget = new QWidget;
34 bridgeWidget = new QWidget;
35 mainLayout = new QVBoxLayout;
35 mainLayout = new QVBoxLayout;
36 connectionLayout = new QGridLayout;
36 connectionLayout = new QGridLayout;
37 ccsdsLayout = new QVBoxLayout;
37 ccsdsLayout = new QVBoxLayout;
38 consoleLayout = new QVBoxLayout;
38 consoleLayout = new QVBoxLayout;
39 selectionLayout = new QVBoxLayout;
39 selectionLayout = new QVBoxLayout;
40 bridgeSelection_LAYOUT = new QGridLayout;
40 bridgeSelection_LAYOUT = new QGridLayout;
41 generalParameters_LAYOUT = new QGridLayout;
41 generalParameters_LAYOUT = new QGridLayout;
42
42
43 gresb_GROUPBOX = new QGroupBox(tr("GRESB bridge parameters"));
43 gresb_GROUPBOX = new QGroupBox(tr("GRESB bridge parameters"));
44 stardundee_GROUPBOX = new QGroupBox(tr("Star Dundee brick parameters"));
44 stardundee_GROUPBOX = new QGroupBox(tr("Star Dundee brick parameters"));
45 selection_GROUPBOX = new QGroupBox(tr("Bridge selection"));
45 selection_GROUPBOX = new QGroupBox(tr("Bridge selection"));
46 generalParameters_GROUPBOX = new QGroupBox(tr("General parameters"));
46 generalParameters_GROUPBOX = new QGroupBox(tr("General parameters"));
47
47
48 //*** QLABEL ***//
48 //*** QLABEL ***//
49 gresbBridgeIPLabel = new QLabel(tr("Bridge IP: "));
49 gresbBridgeIPLabel = new QLabel(tr("Bridge IP: "));
50 gresbVirtualLinkLabel = new QLabel(tr("Virtual Link: "));
50 gresbVirtualLinkLabel = new QLabel(tr("Virtual Link: "));
51 spwLinkLabel = new QLabel(tr("SPW Link: "));
51 spwLinkLabel = new QLabel(tr("SPW Link: "));
52 rmapSourceLogicalAddressLabel = new QLabel(tr("RMAP Source Logical Address: "));
52 rmapSourceLogicalAddressLabel = new QLabel(tr("RMAP Source Logical Address: "));
53 rmapTargetLogicalAddressLabel = new QLabel(tr("RMAP Target Logical Address: "));
53 rmapTargetLogicalAddressLabel = new QLabel(tr("RMAP Target Logical Address: "));
54 logFileName = new QLabel;
54 logFileName = new QLabel;
55 gresbStatusQueryLabel = new QLabel(tr("Status query socket (port 3010): waiting for connection"));
55 gresbStatusQueryLabel = new QLabel(tr("Status query socket (port 3010): waiting for connection"));
56 gresbStatusQueryDialogLabel = new QLabel(tr("sockets opened but SpaceWire link not running"));
56 gresbStatusQueryDialogLabel = new QLabel(tr("sockets opened but SpaceWire link not running"));
57 sendCCSDSCommandLabel = new QLabel(tr("Address of the target"));
57 sendCCSDSCommandLabel = new QLabel(tr("Address of the target"));
58
58
59 //*** QPUSHBUTTON ***//
59 //*** QPUSHBUTTON ***//
60 rmapOpenCommunicationButton = new QPushButton(tr("Open selected bridge"));
60 rmapOpenCommunicationButton = new QPushButton(tr("Open selected bridge"));
61 rmapCloseCommunicationButton = new QPushButton(tr("Close selected bridge"));
61 rmapCloseCommunicationButton = new QPushButton(tr("Close selected bridge"));
62 rmapOpenCommunicationButton->setEnabled(false);
62 rmapOpenCommunicationButton->setEnabled(false);
63 rmapCloseCommunicationButton->setEnabled(false);
63 rmapCloseCommunicationButton->setEnabled(false);
64 logFileChooseButton = new QPushButton(tr("Choose file"));
64 logFileChooseButton = new QPushButton(tr("Choose file"));
65 gresbStatusQueryRetryButton = new QPushButton(tr("Retry"));
65 gresbStatusQueryRetryButton = new QPushButton(tr("Retry"));
66 gresbStatusQueryAbortButton = new QPushButton(tr("Abort"));
66 gresbStatusQueryAbortButton = new QPushButton(tr("Abort"));
67 sendCCSDSCommandButton = new QPushButton(tr("Send CCSDS Command"));
67 sendCCSDSCommandButton = new QPushButton(tr("Send CCSDS Command"));
68 send_TC_LFR_UPDATE_TIME_Button = new QPushButton(tr("Send TC_LFR_UPDATE_TIME Packet"));
68 send_TC_LFR_UPDATE_TIME_Button = new QPushButton(tr("Send TC_LFR_UPDATE_TIME Packet"));
69 reset_TC_LFR_UPDATE_TIME_Button = new QPushButton(tr("reset the TC_LFR_UPDATE_TIME Packet coarse and fine times"));
69 reset_TC_LFR_UPDATE_TIME_Button = new QPushButton(tr("reset the TC_LFR_UPDATE_TIME Packet coarse and fine times"));
70 clearConsoleButton = new QPushButton(tr("Clear"));
70 clearConsoleButton = new QPushButton(tr("Clear"));
71
71
72 selectGRESB_BUTTON = new QRadioButton(tr("GRESB"));
72 selectGRESB_BUTTON = new QRadioButton(tr("GRESB"));
73 selectStarDundee_BUTTON = new QRadioButton(tr("Star Dundee"));
73 selectStarDundee_BUTTON = new QRadioButton(tr("Star Dundee"));
74
74
75 //*** SPINBOX ***//
75 //*** SPINBOX ***//
76 gresbVirtualLinkSpinBox = new QSpinBox;
76 gresbVirtualLinkSpinBox = new QSpinBox;
77 rmapSourceLogicalAddressSpinBox = new QSpinBox;
77 rmapSourceLogicalAddressSpinBox = new QSpinBox;
78 rmapTargetLogicalAddressSpinBox = new QSpinBox;
78 rmapTargetLogicalAddressSpinBox = new QSpinBox;
79 spwLinkSpinBox = new QSpinBox;;
79 spwLinkSpinBox = new QSpinBox;;
80 CCSDSTargetLogicalAddressSpinBox = new QSpinBox;
80 CCSDSTargetLogicalAddressSpinBox = new QSpinBox;
81 gresbVirtualLinkSpinBox->setRange(0, 4);
81 gresbVirtualLinkSpinBox->setRange(0, 4);
82 gresbVirtualLinkSpinBox->setValue(1);
82 gresbVirtualLinkSpinBox->setValue(1);
83 rmapSourceLogicalAddressSpinBox->setRange(0, 255);
83 rmapSourceLogicalAddressSpinBox->setRange(0, 255);
84 rmapSourceLogicalAddressSpinBox->setValue(33);
84 rmapSourceLogicalAddressSpinBox->setValue(0);
85 rmapTargetLogicalAddressSpinBox->setRange(0, 255);
85 rmapTargetLogicalAddressSpinBox->setRange(0, 255);
86 spwLinkSpinBox->setRange(0, 2);
86 spwLinkSpinBox->setRange(0, 2);
87 spwLinkSpinBox->setValue(0);
87 spwLinkSpinBox->setValue(0);
88 CCSDSTargetLogicalAddressSpinBox->setRange(0,255);
88 CCSDSTargetLogicalAddressSpinBox->setRange(0,255);
89 CCSDSTargetLogicalAddressSpinBox->setValue(254);
89 CCSDSTargetLogicalAddressSpinBox->setValue(0);
90
90
91 //*** MISC **//
91 //*** MISC **//
92 starDundee = new StarDundee;
92 starDundee = new StarDundee;
93 gresbBridge = new gresb;
93 gresbBridge = new gresb;
94 console = new QTextEdit;
94 console = new QTextEdit;
95 gresbBridgeIPDialogBox = new QIPDialogBox;
95 //gresbBridgeIPDialogBox = new QIPDialogBox;
96 gresbStatusQueryDialog = new QDialog;
96 gresbStatusQueryDialog = new QDialog;
97 logEnableCheckBox = new QCheckBox(tr("Enable Logs"));
97 logEnableCheckBox = new QCheckBox(tr("Enable Logs"));
98 RMAP_write_verify = new QCheckBox(tr("data checked before write\nlimited to 4 bytes\nNOT IMPLEMENTED"));
98 RMAP_write_verify = new QCheckBox(tr("data checked before write\nlimited to 4 bytes\nNOT IMPLEMENTED"));
99 RMAP_write_reply = new QCheckBox(tr("reply to the write command required\nlast reply status: unavailable"));
99 RMAP_write_reply = new QCheckBox(tr("reply to the write command required\nlast reply status: unavailable"));
100 spwLinkStatusEnquiry = new gresbStatusEnquiry;
100 spwLinkStatusEnquiry = new gresbStatusEnquiry;
101 logFile = new QFile();
101 logFile = new QFile();
102
102
103 logFileEn = false;
103 logFileEn = false;
104
104
105 connectionLayout->setRowStretch(7, 1);
105 connectionLayout->setRowStretch(7, 1);
106 connectionLayout->setColumnStretch(2, 1);
106 connectionLayout->setColumnStretch(2, 1);
107
107
108 bridgeSelection_LAYOUT->addWidget(selectGRESB_BUTTON, 0, 0, 1, 1);
108 bridgeSelection_LAYOUT->addWidget(selectGRESB_BUTTON, 0, 0, 1, 1);
109 bridgeSelection_LAYOUT->addWidget(selectStarDundee_BUTTON, 0, 1, 1, 1);
109 bridgeSelection_LAYOUT->addWidget(selectStarDundee_BUTTON, 0, 1, 1, 1);
110 bridgeSelection_LAYOUT->setRowStretch(1, 1);
110 bridgeSelection_LAYOUT->setRowStretch(1, 1);
111 bridgeSelection_LAYOUT->setColumnStretch(2, 1);
111 bridgeSelection_LAYOUT->setColumnStretch(2, 1);
112
112
113 generalParameters_LAYOUT->addWidget(logEnableCheckBox, 0, 0, 1, 1);
113 generalParameters_LAYOUT->addWidget(logEnableCheckBox, 0, 0, 1, 1);
114 generalParameters_LAYOUT->addWidget(logFileChooseButton, 0, 1, 1, 1);
114 generalParameters_LAYOUT->addWidget(logFileChooseButton, 0, 1, 1, 1);
115 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressLabel, 1, 0, 0);
115 generalParameters_LAYOUT->addWidget(rmapSourceLogicalAddressLabel, 1, 0, 0);
116 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressSpinBox, 1, 1, 0);
116 generalParameters_LAYOUT->addWidget(rmapSourceLogicalAddressSpinBox, 1, 1, 0);
117 generalParameters_LAYOUT->addWidget(rmapOpenCommunicationButton, 2, 0, 1, 1);
117 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressLabel, 2, 0, 0);
118 generalParameters_LAYOUT->addWidget(rmapCloseCommunicationButton, 2, 1, 1, 1);
118 generalParameters_LAYOUT->addWidget(rmapTargetLogicalAddressSpinBox, 2, 1, 0);
119 generalParameters_LAYOUT->addWidget(RMAP_write_verify, 3, 0, 1, 2);
119 generalParameters_LAYOUT->addWidget(rmapOpenCommunicationButton, 3, 0, 1, 1);
120 generalParameters_LAYOUT->addWidget(RMAP_write_reply, 4, 0, 1, 2);
120 generalParameters_LAYOUT->addWidget(rmapCloseCommunicationButton, 3, 1, 1, 1);
121 generalParameters_LAYOUT->setRowStretch(5, 1);
121 generalParameters_LAYOUT->addWidget(RMAP_write_verify, 4, 0, 1, 2);
122 generalParameters_LAYOUT->addWidget(RMAP_write_reply, 5, 0, 1, 2);
123 generalParameters_LAYOUT->setRowStretch(6, 1);
122 generalParameters_LAYOUT->setColumnStretch(2, 1);
124 generalParameters_LAYOUT->setColumnStretch(2, 1);
123
125
124 gresb_GROUPBOX->setLayout(gresbBridge->layout());
126 gresb_GROUPBOX->setLayout(gresbBridge->layout());
125 gresb_GROUPBOX->setVisible(false);
127 gresb_GROUPBOX->setVisible(false);
126 stardundee_GROUPBOX->setLayout(starDundee->layout());
128 stardundee_GROUPBOX->setLayout(starDundee->layout());
127 stardundee_GROUPBOX->setVisible(false);
129 stardundee_GROUPBOX->setVisible(false);
128 selection_GROUPBOX->setLayout(bridgeSelection_LAYOUT);
130 selection_GROUPBOX->setLayout(bridgeSelection_LAYOUT);
129 generalParameters_GROUPBOX->setLayout(generalParameters_LAYOUT);
131 generalParameters_GROUPBOX->setLayout(generalParameters_LAYOUT);
130 selectionLayout->addWidget(selection_GROUPBOX);
132 selectionLayout->addWidget(selection_GROUPBOX);
131 selectionLayout->addWidget(generalParameters_GROUPBOX);
133 selectionLayout->addWidget(generalParameters_GROUPBOX);
132 selectionLayout->addWidget(gresb_GROUPBOX);
134 selectionLayout->addWidget(gresb_GROUPBOX);
133 selectionLayout->addWidget(stardundee_GROUPBOX);
135 selectionLayout->addWidget(stardundee_GROUPBOX);
134
136
135 ccsdsLayout->addWidget(sendCCSDSCommandButton);
137 ccsdsLayout->addWidget(sendCCSDSCommandButton);
136 ccsdsLayout->addWidget(send_TC_LFR_UPDATE_TIME_Button);
138 ccsdsLayout->addWidget(send_TC_LFR_UPDATE_TIME_Button);
137 ccsdsLayout->addWidget(reset_TC_LFR_UPDATE_TIME_Button);
139 ccsdsLayout->addWidget(reset_TC_LFR_UPDATE_TIME_Button);
138 ccsdsLayout->addWidget(sendCCSDSCommandLabel);
140 ccsdsLayout->addWidget(sendCCSDSCommandLabel);
139 ccsdsLayout->addWidget(CCSDSTargetLogicalAddressSpinBox);
141 ccsdsLayout->addWidget(CCSDSTargetLogicalAddressSpinBox);
140
142
141 consoleLayout->addWidget(console);
143 consoleLayout->addWidget(console);
142 consoleLayout->addWidget(clearConsoleButton);
144 consoleLayout->addWidget(clearConsoleButton);
143
145
144 connect(this->logFileChooseButton, SIGNAL(clicked()), this, SLOT(chooseLogFile()));
146 connect(this->logFileChooseButton, SIGNAL(clicked()), this, SLOT(chooseLogFile()));
145 connect(this, SIGNAL(setLogFileName(QString)), this->logFileName, SLOT(setText(QString)));
147 connect(this, SIGNAL(setLogFileName(QString)), this->logFileName, SLOT(setText(QString)));
146 connect(this->logEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(logFileEnDisable(int)));
148 connect(this->logEnableCheckBox, SIGNAL(stateChanged(int)), this, SLOT(logFileEnDisable(int)));
147
149
148 spwTabWidget->addTab(spwTabWidgetPage0, tr("connection"));
150 spwTabWidget->addTab(spwTabWidgetPage0, tr("connection"));
149 spwTabWidget->addTab(spwTabWidgetPage1, tr("ccsds"));
151 spwTabWidget->addTab(spwTabWidgetPage1, tr("ccsds"));
150 spwTabWidget->addTab(spwTabWidgetPage2, tr("status"));
152 spwTabWidget->addTab(spwTabWidgetPage2, tr("status"));
151 spwTabWidget->addTab(spwTabWidgetPage3, tr("console"));
153 spwTabWidget->addTab(spwTabWidgetPage3, tr("console"));
152 spwTabWidget->addTab(spwTabWidgetPage4, tr("DMA"));
154 spwTabWidget->addTab(spwTabWidgetPage4, tr("DMA"));
153
155
154 spwTabWidgetPage0->setLayout(selectionLayout);
156 spwTabWidgetPage0->setLayout(selectionLayout);
155 spwTabWidgetPage1->setLayout(ccsdsLayout);
157 spwTabWidgetPage1->setLayout(ccsdsLayout);
156 spwTabWidgetPage2->setLayout(this->spwLinkStatusEnquiry->mainLayout);
158 spwTabWidgetPage2->setLayout(this->spwLinkStatusEnquiry->mainLayout);
157 spwTabWidgetPage3->setLayout(consoleLayout);
159 spwTabWidgetPage3->setLayout(consoleLayout);
158 spwTabWidgetPage4->setLayout(spectralMatricesDMASimulator->mainLayout);
160 spwTabWidgetPage4->setLayout(spectralMatricesDMASimulator->mainLayout);
159
161
160 mainLayout->addWidget(spwTabWidget);
162 mainLayout->addWidget(spwTabWidget);
161 setLayout(mainLayout);
163 setLayout(mainLayout);
162
164
163 connect(this->clearConsoleButton, SIGNAL(clicked()), this->console, SLOT(clear()));
165 connect(this->clearConsoleButton, SIGNAL(clicked()), this->console, SLOT(clear()));
164
166
165 // briges
167 // briges
166 connect(this->selectGRESB_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee()));
168 connect(this->selectGRESB_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee()));
167 connect(this->selectStarDundee_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee()));
169 connect(this->selectStarDundee_BUTTON, SIGNAL(clicked()), this, SLOT(selectionBetweenGresbAndStarDundee()));
168 connect(this->starDundee, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
170 connect(this->starDundee, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
169 connect(this->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
171 connect(this->gresbBridge, SIGNAL(isOpen(bool)), this, SLOT(isOpen(bool)));
170
172
173 connect(this->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(sourceHasChanged(int)));
174 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(targetHasChanged(int)));
175 connect(this->rmapSourceLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(sourceHasChanged(int)));
171 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(targetHasChanged(int)));
176 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->starDundee, SLOT(targetHasChanged(int)));
172 connect(this->rmapTargetLogicalAddressSpinBox, SIGNAL(valueChanged(int)), this->gresbBridge, SLOT(targetHasChanged(int)));
173
177
174 // command code
178 // command code
175 connect(this->RMAP_write_reply, SIGNAL(clicked()), this, SLOT(getCommandCode()));
179 connect(this->RMAP_write_reply, SIGNAL(clicked()), this, SLOT(getCommandCode()));
176 connect(this->RMAP_write_verify, SIGNAL(clicked()), this, SLOT(getCommandCode()));
180 connect(this->RMAP_write_verify, SIGNAL(clicked()), this, SLOT(getCommandCode()));
177 connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)),
181 connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)),
178 this->starDundee, SLOT(commandCodeHasChanged(RMAP_command_codes)));
182 this->starDundee, SLOT(commandCodeHasChanged(RMAP_command_codes)));
179 connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)),
183 connect(this, SIGNAL(commandCodeHasChanged(RMAP_command_codes)),
180 this->gresbBridge, SLOT(commandCodeHasChanged(RMAP_command_codes)));
184 this->gresbBridge, SLOT(commandCodeHasChanged(RMAP_command_codes)));
181
185
182 getCommandCode(); // init the command code value
186 getCommandCode(); // init the command code value
183 rmapTargetLogicalAddressSpinBox->setValue(254);
187 rmapSourceLogicalAddressSpinBox->setValue(DEFAULT_SOURCE);
188 rmapTargetLogicalAddressSpinBox->setValue(DEFAULT_TARGET);
184 }
189 }
185
190
186 rmapPluginUI::~rmapPluginUI()
191 rmapPluginUI::~rmapPluginUI()
187 {
192 {
188 //delete ui;
193 //delete ui;
189 }
194 }
190
195
191 void rmapPluginUI::chooseLogFile()
196 void rmapPluginUI::chooseLogFile()
192 {
197 {
193 if(this->logFile->isOpen())
198 if(this->logFile->isOpen())
194 this->logFile->close();
199 this->logFile->close();
195 this->logFile->setFileName(QFileDialog::getSaveFileName(this,tr("Open Log file"),
200 this->logFile->setFileName(QFileDialog::getSaveFileName(this,tr("Open Log file"),
196 QDir::homePath()
201 QDir::homePath()
197 + "/"
202 + "/"
198 + QDate::currentDate().toString()
203 + QDate::currentDate().toString()
199 + "_"
204 + "_"
200 + QTime::currentTime().toString()
205 + QTime::currentTime().toString()
201 + "_rmapPluginUI.log",
206 + "_rmapPluginUI.log",
202 tr("Log Files (*.txt *.log)")));
207 tr("Log Files (*.txt *.log)")));
203 if(this->logFile->open(QIODevice::WriteOnly))
208 if(this->logFile->open(QIODevice::WriteOnly))
204 {
209 {
205 this->logFileStrm = new QTextStream(this->logFile);
210 this->logFileStrm = new QTextStream(this->logFile);
206 emit this->setLogFileName(this->logFile->fileName());
211 emit this->setLogFileName(this->logFile->fileName());
207 }
212 }
208 }
213 }
209
214
210 void rmapPluginUI::logFileEnDisable(int state)
215 void rmapPluginUI::logFileEnDisable(int state)
211 {
216 {
212 if(state==Qt::Checked)
217 if(state==Qt::Checked)
213 {
218 {
214 this->logFileEn = true;
219 this->logFileEn = true;
215 }
220 }
216 else if(state==Qt::Unchecked)
221 else if(state==Qt::Unchecked)
217 {
222 {
218 this->logFileEn = false;
223 this->logFileEn = false;
219 }
224 }
220 }
225 }
221
226
222 bool rmapPluginUI::islogfileenable()
227 bool rmapPluginUI::islogfileenable()
223 {
228 {
224 return this->logFileEn;
229 return this->logFileEn;
225 }
230 }
226
231
227 void rmapPluginUI::appendToLogFile(const QString & text)
232 void rmapPluginUI::appendToLogFile(const QString & text)
228 {
233 {
229 if(this->logFileEn && this->logFile->isOpen())
234 if(this->logFileEn && this->logFile->isOpen())
230 {
235 {
231 *(this->logFileStrm) << text << endl;
236 *(this->logFileStrm) << text << endl;
232 }
237 }
233 }
238 }
234
239
235 void rmapPluginUI::closeEvent(QCloseEvent *event)
240 void rmapPluginUI::closeEvent(QCloseEvent *event)
236 {
241 {
237 if(this->logFile->isOpen())
242 if(this->logFile->isOpen())
238 {
243 {
239 this->logFileStrm->flush();
244 this->logFileStrm->flush();
240 this->logFile->waitForBytesWritten(3000);
245 this->logFile->waitForBytesWritten(3000);
241 this->logFile->close();
246 this->logFile->close();
242 }
247 }
243 event->accept();
248 event->accept();
244 }
249 }
245
250
246 RMAP_command_codes rmapPluginUI::getCommandCode()
251 RMAP_command_codes rmapPluginUI::getCommandCode()
247 {
252 {
248 RMAP_command_codes commandCode = invalid0;
253 RMAP_command_codes commandCode = invalid0;
249 if (RMAP_write_verify->isChecked() and RMAP_write_reply->isChecked()) commandCode = writeSingle_ver_rep;
254 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;
255 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;
256 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;
257 if (!RMAP_write_verify->isChecked() and !RMAP_write_reply->isChecked()) commandCode = writeSingle_noVer_noRep;
253 emit commandCodeHasChanged(commandCode);
258 emit commandCodeHasChanged(commandCode);
254 return commandCode;
259 return commandCode;
255 }
260 }
256
261
257 // SLOT
262 // SLOT
258
263
259 void rmapPluginUI::selectionBetweenGresbAndStarDundee() //SLOT
264 void rmapPluginUI::selectionBetweenGresbAndStarDundee() //SLOT
260 {
265 {
261 if (selectGRESB_BUTTON->isChecked())
266 if (selectGRESB_BUTTON->isChecked())
262 {
267 {
263 gresb_GROUPBOX->setVisible(true);
268 gresb_GROUPBOX->setVisible(true);
264 stardundee_GROUPBOX->setVisible(false);
269 stardundee_GROUPBOX->setVisible(false);
265 rmapOpenCommunicationButton->setEnabled(true);
270 rmapOpenCommunicationButton->setEnabled(true);
266 emit bridgeHasChanged(selectedBridgeIsGRESB);
271 emit bridgeHasChanged(selectedBridgeIsGRESB);
267 }
272 }
268 if (selectStarDundee_BUTTON->isChecked())
273 if (selectStarDundee_BUTTON->isChecked())
269 {
274 {
270 stardundee_GROUPBOX->setVisible(true);
275 stardundee_GROUPBOX->setVisible(true);
271 gresb_GROUPBOX->setVisible(false);
276 gresb_GROUPBOX->setVisible(false);
272 rmapOpenCommunicationButton->setEnabled(true);
277 rmapOpenCommunicationButton->setEnabled(true);
273 emit bridgeHasChanged(selectedBridgeIsStarDundee);
278 emit bridgeHasChanged(selectedBridgeIsStarDundee);
274 }
279 }
275 }
280 }
276
281
277 void rmapPluginUI::isOpen(bool flag)
282 void rmapPluginUI::isOpen(bool flag)
278 {
283 {
279 if (flag == true)
284 if (flag == true)
280 {
285 {
281 selection_GROUPBOX->setEnabled(false);
286 selection_GROUPBOX->setEnabled(false);
282 this->rmapOpenCommunicationButton->setEnabled(false);
287 this->rmapOpenCommunicationButton->setEnabled(false);
283 this->rmapCloseCommunicationButton->setEnabled(true);
288 this->rmapCloseCommunicationButton->setEnabled(true);
284 }
289 }
285 if (flag == false)
290 if (flag == false)
286 {
291 {
287 selection_GROUPBOX->setEnabled(true);
292 selection_GROUPBOX->setEnabled(true);
288 this->rmapOpenCommunicationButton->setEnabled(true);
293 this->rmapOpenCommunicationButton->setEnabled(true);
289 this->rmapCloseCommunicationButton->setEnabled(false);
294 this->rmapCloseCommunicationButton->setEnabled(false);
290 }
295 }
291 }
296 }
292
297
293
298
@@ -1,159 +1,160
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
95
96 QDialog* gresbStatusQueryDialog;
96 QDialog* gresbStatusQueryDialog;
97
97
98 gresbStatusEnquiry* spwLinkStatusEnquiry;
98 gresbStatusEnquiry* spwLinkStatusEnquiry;
99
99
100 SpectralMatricesDMASimulator *spectralMatricesDMASimulator;
100 SpectralMatricesDMASimulator *spectralMatricesDMASimulator;
101
101
102 QTextEdit* console;
102 QTextEdit* console;
103
103
104 // SPACEWIRE BRIDGES
104 StarDundee *starDundee;
105 StarDundee *starDundee;
105
106 gresb *gresbBridge;
106 gresb *gresbBridge;
107
107
108 bool islogfileenable();
108 bool islogfileenable();
109 void appendToLogFile(const QString & text);
109 void appendToLogFile(const QString & text);
110 void closeEvent(QCloseEvent *event);
110 void closeEvent(QCloseEvent *event);
111
111
112 public slots:
112 public slots:
113 void chooseLogFile();
113 void chooseLogFile();
114 void logFileEnDisable(int state);
114 void logFileEnDisable(int state);
115 RMAP_command_codes getCommandCode();
115 RMAP_command_codes getCommandCode();
116
116
117 private slots:
117 private slots:
118 void selectionBetweenGresbAndStarDundee();
118 void selectionBetweenGresbAndStarDundee();
119 void isOpen(bool flag);
119 void isOpen(bool flag);
120
120
121 signals:
121 signals:
122 void connectPortsig(QString PortName,int baudrate);
122 void connectPortsig(QString PortName,int baudrate);
123 void setLogFileName(QString FileName);
123 void setLogFileName(QString FileName);
124 void commandCodeHasChanged(RMAP_command_codes commandCode);
124 void commandCodeHasChanged(RMAP_command_codes commandCode);
125 void bridgeHasChanged(selectedBridge bridge);
125 void bridgeHasChanged(selectedBridge bridge);
126 void targetHasChanged(unsigned char target);
126 void targetHasChanged(unsigned char target);
127 void sourceHasChanged(unsigned char source);
127
128
128 private:
129 private:
129 QLabel *gresbBridgeIPLabel;
130 QLabel *gresbBridgeIPLabel;
130 QLabel *gresbVirtualLinkLabel;
131 QLabel *gresbVirtualLinkLabel;
131 QLabel *spwLinkLabel;
132 QLabel *spwLinkLabel;
132 QLabel *rmapSourceLogicalAddressLabel;
133 QLabel *rmapSourceLogicalAddressLabel;
133 QLabel *rmapTargetLogicalAddressLabel;
134 QLabel *rmapTargetLogicalAddressLabel;
134 QLabel *logFileName;
135 QLabel *logFileName;
135
136
136 QGridLayout *bridgeSelection_LAYOUT;
137 QGridLayout *bridgeSelection_LAYOUT;
137 QVBoxLayout *selectionLayout;
138 QVBoxLayout *selectionLayout;
138 QVBoxLayout *mainLayout;
139 QVBoxLayout *mainLayout;
139 QGridLayout *connectionLayout;
140 QGridLayout *connectionLayout;
140 QVBoxLayout *ccsdsLayout;
141 QVBoxLayout *ccsdsLayout;
141 QVBoxLayout *consoleLayout;
142 QVBoxLayout *consoleLayout;
142 QGridLayout *gresbStatusQueryDialogLayout;
143 QGridLayout *gresbStatusQueryDialogLayout;
143 QGridLayout *generalParameters_LAYOUT;
144 QGridLayout *generalParameters_LAYOUT;
144
145
145 QTabWidget *spwTabWidget;
146 QTabWidget *spwTabWidget;
146
147
147 QWidget* bridgeWidget;
148 QWidget* bridgeWidget;
148
149
149 QGroupBox *gresb_GROUPBOX;
150 QGroupBox *gresb_GROUPBOX;
150 QGroupBox *stardundee_GROUPBOX;
151 QGroupBox *stardundee_GROUPBOX;
151 QGroupBox *generalParameters_GROUPBOX;
152 QGroupBox *generalParameters_GROUPBOX;
152
153
153 QFile *logFile;
154 QFile *logFile;
154 QTextStream *logFileStrm;
155 QTextStream *logFileStrm;
155 bool logFileEn;
156 bool logFileEn;
156
157
157 };
158 };
158
159
159 #endif // RMAPPLUGINUI_H
160 #endif // RMAPPLUGINUI_H
@@ -1,734 +1,855
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
61 timer->start(100); // starts the periodical timer, period = 100ms
68 }
62 }
69
63
70 StarDundee::~StarDundee()
64 StarDundee::~StarDundee()
71 {
65 {
72 free(rmapPacket);
66 free(rmapPacket);
73 free(ccsdsPacket);
67 free(ccsdsPacket);
74 free(spwPacket);
68 free(spwPacket);
75 USBSpaceWire_Close(hDevice); // Close the device
69 USBSpaceWire_Close(hDevice); // Close the device
76 }
70 }
77
71
78 void StarDundee::Open()
72 void StarDundee::Open()
79 {
73 {
80 int status;
74 int status;
81 U32 statusControl;
75 U32 statusControl;
82
76
83 if (!USBSpaceWire_Open(&hDevice, usbDeviceNumber_SPINBOX->value())) // Open the USB device
77 if (!USBSpaceWire_Open(&hDevice, usbDeviceNumber_SPINBOX->value())) // Open the USB device
84 {
78 {
85 emit sendMessage("stardundee *** Open *** ERROR: USBSpaceWire_Open(&hDevice, 0))");
79 emit sendMessage("stardundee *** Open *** ERROR: USBSpaceWire_Open(&hDevice, 0))");
86 return;
80 return;
87 }
81 }
88 emit sendMessage("stardundee *** Open *** USBSpaceWire_Open successful, device number: "
82 emit sendMessage("stardundee *** Open *** USBSpaceWire_Open successful, device number: "
89 + QString::number(usbDeviceNumber_SPINBOX->value()));
83 + QString::number(usbDeviceNumber_SPINBOX->value()));
90
84
91 USBSpaceWire_EnableNetworkMode(hDevice, 0); // deactivate the network mode
85 USBSpaceWire_EnableNetworkMode(hDevice, 0); // deactivate the network mode
92 CFGSpaceWire_EnableRMAP(1); // Enable the use of RMAP
86 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
87 CFGSpaceWire_SetRMAPDestinationKey(0x20); // Set the destination key expected by STAR-Dundee devices
94
88
95 // Set the path and return path to the device
89 // Set the path and return path to the device
96 CFGSpaceWire_StackClear();
90 CFGSpaceWire_StackClear();
97 CFGSpaceWire_AddrStackPush(0);
91 CFGSpaceWire_AddrStackPush(0);
98 CFGSpaceWire_AddrStackPush(254);
92 CFGSpaceWire_AddrStackPush(254);
99 CFGSpaceWire_RetAddrStackPush(254);
93 CFGSpaceWire_RetAddrStackPush(254);
100
94
101 // set the base transmit rate to 100 MHz
95 // set the base transmit rate to 100 MHz
102 status = CFGSpaceWire_SetBrickBaseTransmitRate( hDevice, CFG_BRK_CLK_100_MHZ, CFG_BRK_DVDR_1, 0xff);
96 status = CFGSpaceWire_SetBrickBaseTransmitRate( hDevice, CFG_BRK_CLK_100_MHZ, CFG_BRK_DVDR_1, 0xff);
103 if (status != CFG_TRANSFER_SUCCESS)
97 if (status != CFG_TRANSFER_SUCCESS)
104 {
98 {
105 emit sendMessage("ERROR CFGSpaceWire_SetBrickBaseTransmitRate");
99 emit sendMessage("ERROR CFGSpaceWire_SetBrickBaseTransmitRate");
106 }
100 }
107 else emit sendMessage("OK CFGSpaceWire_SetBrickBaseTransmitRate, base rate = 100 MHz");
101 else emit sendMessage("OK CFGSpaceWire_SetBrickBaseTransmitRate, base rate = 100 MHz");
108 // read the link status
102 // read the link status
109 if (CFGSpaceWire_GetLinkStatusControl(hDevice, linkNumber_SPINBOX->value(), &statusControl) != CFG_TRANSFER_SUCCESS)
103 if (CFGSpaceWire_GetLinkStatusControl(hDevice, linkNumber_SPINBOX->value(), &statusControl) != CFG_TRANSFER_SUCCESS)
110 {
104 {
111 emit sendMessage("Could not read link status control for link " + QString::number(linkNumber_SPINBOX->value()));
105 emit sendMessage("Could not read link status control for link " + QString::number(linkNumber_SPINBOX->value()));
112 }
106 }
113 else
107 else
114 {
108 {
115 emit sendMessage("OK CFGSpaceWire_GetLinkStatusControl of link " + QString::number(linkNumber_SPINBOX->value()));
109 emit sendMessage("OK CFGSpaceWire_GetLinkStatusControl of link " + QString::number(linkNumber_SPINBOX->value()));
116
110
117 // Set the link status control register properties
111 // Set the link status control register properties
118 CFGSpaceWire_LSEnableAutoStart(&statusControl, 1);
112 CFGSpaceWire_LSEnableAutoStart(&statusControl, 1);
119 CFGSpaceWire_LSEnableStart(&statusControl, 1);
113 CFGSpaceWire_LSEnableStart(&statusControl, 1);
120 CFGSpaceWire_LSEnableDisabled(&statusControl, 0);
114 CFGSpaceWire_LSEnableDisabled(&statusControl, 0);
121 CFGSpaceWire_LSEnableTristate(&statusControl, 0);
115 CFGSpaceWire_LSEnableTristate(&statusControl, 0);
122 CFGSpaceWire_LSSetOperatingSpeed(&statusControl, 9); // sets the link speed to ( 100 MHz / (9+1) ) = 10 MHz
116 CFGSpaceWire_LSSetOperatingSpeed(&statusControl, 9); // sets the link speed to ( 100 MHz / (9+1) ) = 10 MHz
123
117
124 // Set the link status control register
118 // Set the link status control register
125 if (CFGSpaceWire_SetLinkStatusControl(hDevice, linkNumber_SPINBOX->value(), statusControl) != CFG_TRANSFER_SUCCESS)
119 if (CFGSpaceWire_SetLinkStatusControl(hDevice, linkNumber_SPINBOX->value(), statusControl) != CFG_TRANSFER_SUCCESS)
126 {
120 {
127 emit sendMessage("Could not set the link status control for link " + QString::number(linkNumber_SPINBOX->value()));
121 emit sendMessage("Could not set the link status control for link " + QString::number(linkNumber_SPINBOX->value()));
128 }
122 }
129 else emit sendMessage("Set the link status control for link " + QString::number(linkNumber_SPINBOX->value()));
123 else emit sendMessage("Set the link status control for link " + QString::number(linkNumber_SPINBOX->value()));
130 }
124 }
131
125
132 setRoutingTableEntry(rmapTargetLogicalAddress, (1<<linkNumber_SPINBOX->value()));
126 if (CFGSpaceWire_SetAsInterface(hDevice, 1, 0) != CFG_TRANSFER_SUCCESS)
133 setRoutingTableEntry(sourceLogicalAddress_SPINBOX->value(), (1<<3));
127 {
134 //setRoutingTableEntry(33, (1<<3));
128 emit sendMessage("Could not set the device to be an interface");
129 }
130 else
131 {
132 emit sendMessage("Device set to be an interface");
133 }
135
134
136 emit sendMessage("The driver's current send buffer size is " + QString::number(USBSpaceWire_GetDriverSendBufferSize(hDevice)) + " bytes");
135 //setRoutingTableEntry(rmapTargetLogicalAddress, (1<<linkNumber_SPINBOX->value()));
136 //setRoutingTableEntry(rmapSourceLogicalAddress, (1<<3));
137 //GetRoutingTableEntry(rmapTargetLogicalAddress);
138 //GetRoutingTableEntry(rmapSourceLogicalAddress);
137
139
138 USBSpaceWire_RegisterReceiveOnAllPorts(hDevice); // Register to receive on all ports
140 USBSpaceWire_RegisterReceiveOnAllPorts(hDevice); // Register to receive on all ports
139 USBSpaceWire_ClearEndpoints(hDevice); // clear the USB endpoints
141 USBSpaceWire_ClearEndpoints(hDevice); // clear the USB endpoints
140
142
143 emit sendMessage("The driver's current send buffer size is " + QString::number(USBSpaceWire_GetDriverSendBufferSize(hDevice)) + " bytes");
144 emit sendMessage("The driver's current read buffer size is " + QString::number(USBSpaceWire_GetDriverReadBufferSize(hDevice)) + " bytes");
145 emit sendMessage("USBSpaceWire_IsReadThrottling is " + QString::number(USBSpaceWire_IsReadThrottling(hDevice)));
146
141 // initialize SPW packet semaphores
147 // initialize SPW packet semaphores
142 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
148 while (rmapPacketSEMAPHORE->available()!=0) rmapPacketSEMAPHORE->acquire();
143 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
149 while (ccsdsPacketSEMAPHORE->available()!=0) ccsdsPacketSEMAPHORE->acquire();
144
150
145 if (getLinkStatus(linkNumber_SPINBOX->value()))
151 if (getLinkStatus(linkNumber_SPINBOX->value()))
146 {
152 {
147 emit isOpen(true);
153 emit isOpen(true);
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 //sendMessage("trying to get a packet");
736 result = receiveSPWPacket(requestID);
737 }
738 if (!ccsdsPacketStore.isEmpty())
739 {
740 emit packetStoreNotEmpty();
741 }
742 return result;
743 }
744
654 int StarDundee::receiveSPWPacket(unsigned char requestID) // SLOT
745 int StarDundee::receiveSPWPacket(unsigned char requestID) // SLOT
655 {
746 {
656 unsigned int packetLength;
747 unsigned int packetLength;
657 unsigned int nbBytes;
748 unsigned int nbBytes;
658 unsigned nPacketNum;
749 unsigned nPacketNum;
659 USB_SPACEWIRE_PACKET_PROPERTIES properties; // The properties of the read
750 USB_SPACEWIRE_PACKET_PROPERTIES properties; // The properties of the read
660
751
661 if (requestID==1)
752 if (requestID==1)
662 {
753 {
663 if (rmapPacketSEMAPHORE->available())
754 if (rmapPacketSEMAPHORE->available())
664 {
755 {
665 return rmapPacketSize;
756 return rmapPacketSize;
666 }
757 }
667 }
758 }
668
759
669 //********************
760 //********************
670 // TRY TO RECEIVE DATA
761 // TRY TO RECEIVE DATA
671 nbBytes = qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH); // maximum size of the packet to receive
762 nbBytes = qMax(RMAP_MAX_PACKET_LENGTH, CCSDS_MAX_PACKET_LENGTH); // maximum size of the packet to receive
672 nPacketNum = 1;
763 nPacketNum = 1;
673 result = USBSpaceWire_ReadPackets(hDevice, spwPacket, nbBytes, nPacketNum, BWAIT_1, &properties, &pIdentifier);
764 result = USBSpaceWire_ReadPackets(hDevice, spwPacket, nbBytes, nPacketNum, BWAIT_1, &properties, &pIdentifierRead);
674 if (result != TRANSFER_SUCCESS)
765 if (result != TRANSFER_SUCCESS)
675 {
766 {
676 emit sendMessage("Error: Could not receive the packet");
767 emit sendMessage("Error: Could not receive the packet");
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));
703 }
828 }
704 return 0;
829 return 0;
705 }
830 }
706
831
707 void StarDundee::receivePollingLoop()
832 unsigned int StarDundee::storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size)
708 {
833 {
709 timer->blockSignals(true);
834 unsigned int i;
710 if (USBSpaceWire_WaitOnReadPacketAvailable(hDevice, 0)) receiveSPWPacket(0);
835 ccsdsPacketToProcess_t ccsdsPacketToStore;
711 timer->blockSignals(false);
836
837 ccsdsPacketToStore.size = size;
838 for(i=0; i<size; i++)
839 {
840 ccsdsPacketToStore.data[i] = ccsdsPacket[i];
841 }
842 ccsdsPacketStore << ccsdsPacketToStore;
843 //emit(ccsdsPacketAvailable(ccsdsPacket, packetLength));
844 //emit ccsdsPacketIsAvailable(size);
845 return 1;
712 }
846 }
713
847
714 unsigned char StarDundee::setRoutingTableEntry(int tableEntry, U32 dwOutputPorts)
848 void StarDundee::reTestSPWLink() // SLOT
715 {
849 {
716 U32 routingTableEntry;
850 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 {
851 {
720 emit sendMessage("Could not clear routing table entry " + QString::number(tableEntry));
852 emit isOpen(true);
853 starDundeeStatusQueryDialog->accept();
721 }
854 }
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 }
855 }
@@ -1,99 +1,105
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"
16
17
17 #define BWAIT_0 0
18 #define BWAIT_0 0
18 #define BWAIT_1 1
19 #define BWAIT_1 1
20 #define PATH_ADDRESSING_OFFSET 1
19
21
20 class StarDundee : public QWidget
22 class StarDundee : public QWidget
21 {
23 {
22 Q_OBJECT
24 Q_OBJECT
23 public:
25 public:
24 explicit StarDundee(QWidget *parent = 0);
26 explicit StarDundee(QWidget *parent = 0);
25 ~StarDundee();
27 ~StarDundee();
26 unsigned int Write(unsigned int *Value,unsigned int count,unsigned int address=0);
28 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);
29 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);
30 unsigned int WriteSPW(char *Value, unsigned int count, char targetLogicalAddress, char userApplication);
29
31
32 unsigned int storeCCSDSPacket(unsigned char *ccsdsPacket, unsigned int size);
33 QList<ccsdsPacketToProcess_t> ccsdsPacketStore;
34
30 signals:
35 signals:
31 void sendMessage(QString message);
36 void sendMessage(QString message);
32 void isOpen(bool);
37 void isOpen(bool);
33 void RMAP_write_reply_setText(QString);
38 void RMAP_write_reply_setText(QString);
34 void appendToLog(QString);
39 void appendToLog(QString);
35 void ccsdsPacketAvailable(unsigned char*, unsigned int);
40 void ccsdsPacketAvailable(unsigned char*, unsigned int);
41 void packetStoreNotEmpty();
36
42
37 public slots:
43 public slots:
38 void Open();
44 void Open();
39 void Close();
45 void Close();
40 int receiveSPWPacket(unsigned char requestID);
46 void reTestSPWLink();
47 int receiveSPWPacketLoop(unsigned char requestID=0);
48 int receiveSPWPacket(unsigned char requestID=0);
41 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
49 void commandCodeHasChanged(RMAP_command_codes code) {this->commandCode = code;}
42 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
50 void targetHasChanged(int target) {rmapTargetLogicalAddress = (unsigned char) target;}
51 void sourceHasChanged(int source) {rmapSourceLogicalAddress = (unsigned char) source;}
43 void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();}
52 void ccsdsPacketIsProcessed() {ccsdsPacketSEMAPHORE->tryAcquire();}
44 void reTestSPWLink() {getLinkStatus(linkNumber_SPINBOX->value());}
45 //
53 //
46 void sourceHasChanged(int target) {rmapSourceLogicalAddress = (unsigned char) target;}
47 void receivePollingLoop();
54 void receivePollingLoop();
48
55
49 private:
56 private:
50 unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0);
57 unsigned int WriteBLOCK(char *data,unsigned int nbBytes,unsigned int address=0);
51 unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0);
58 unsigned int ReadBLOCK(unsigned int nbBytes,unsigned int address=0);
52 void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->tryAcquire();}
59 void acquireRMAPSemaphore() {rmapPacketSEMAPHORE->tryAcquire();}
53 void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->tryAcquire();}
60 void acquireCCSDSSemaphore() {ccsdsPacketSEMAPHORE->tryAcquire();}
54 unsigned char setRoutingTableEntry(int tableEntry, U32 dwOutputPorts);
61 unsigned char setRoutingTableEntry(int tableEntry, U32 dwOutputPorts);
55
62
56 unsigned int getLinkStatus(unsigned char link);
63 unsigned int getLinkStatus(unsigned char link);
57 unsigned int GetRoutingTableEntry();
64 unsigned int GetRoutingTableEntry(int tableEntry);
58
65
59 unsigned char rmapTargetLogicalAddress ;
66 unsigned char rmapTargetLogicalAddress ;
60 unsigned char rmapSourceLogicalAddress ;
67 unsigned char rmapSourceLogicalAddress ;
61
68
62 RMAP_command_codes commandCode;
69 RMAP_command_codes commandCode;
63
70
64 QLabel *usbDeviceNumber_LABEL;
71 QLabel *usbDeviceNumber_LABEL;
65 QLabel *linkNumber_LABEL;
72 QLabel *linkNumber_LABEL;
66 QLabel *sourceLogicalAddress_LABEL;
67 QLabel *starDundeeStatusQueryDialogLabel;
73 QLabel *starDundeeStatusQueryDialogLabel;
68
74
69 QSpinBox *usbDeviceNumber_SPINBOX;
75 QSpinBox *usbDeviceNumber_SPINBOX;
70 QSpinBox *linkNumber_SPINBOX;
76 QSpinBox *linkNumber_SPINBOX;
71 QSpinBox *sourceLogicalAddress_SPINBOX;
72
77
73 QGridLayout *connection_LAYOUT;
78 QGridLayout *connection_LAYOUT;
74 QGridLayout *starDundeeStatusQueryDialogLayout;
79 QGridLayout *starDundeeStatusQueryDialogLayout;
75
80
76 QDialog *starDundeeStatusQueryDialog;
81 QDialog *starDundeeStatusQueryDialog;
77
82
78 QPushButton *starDundeeStatusQueryRetryButton;
83 QPushButton *starDundeeStatusQueryRetryButton;
79 QPushButton *starDundeeStatusQueryAbortButton;
84 QPushButton *starDundeeStatusQueryAbortButton;
80
85
81 QTimer *timer;
86 QTimer *timer;
82
87
83 unsigned char pBuffer[10]; // Pointer to the start of the user buffer from which to transmit data
88 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
89 USB_SPACEWIRE_ID pIdentifierRead; // A pointer to a variable which will be set to contain a unique identifier for the read
90 USB_SPACEWIRE_ID pIdentifier;
85
91
86 star_device_handle hDevice; // Handle to the SpaceWire device
92 star_device_handle hDevice; // Handle to the SpaceWire device
87 USB_SPACEWIRE_STATUS result; // The result of the send operation
93 USB_SPACEWIRE_STATUS result; // The result of the send operation
88
94
89 // Packet receiver
95 // Packet receiver
90 QSemaphore *rmapPacketSEMAPHORE;
96 QSemaphore *rmapPacketSEMAPHORE;
91 QSemaphore *ccsdsPacketSEMAPHORE;
97 QSemaphore *ccsdsPacketSEMAPHORE;
92 char* rmapPacket; // The buffer to receive RMAP READ packets
98 char* rmapPacket; // The buffer to receive RMAP READ packets
93 unsigned char *ccsdsPacket;
99 unsigned char *ccsdsPacket;
94 char *spwPacket;
100 char *spwPacket;
95 unsigned int rmapPacketSize;
101 unsigned int rmapPacketSize;
96 unsigned int ccsdsPacketSize;
102 unsigned int ccsdsPacketSize;
97 };
103 };
98
104
99 #endif // STARDUNDEE_H
105 #endif // STARDUNDEE_H
General Comments 0
You need to be logged in to leave comments. Login now