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