Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
stm32f4-energy-monitor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Mark Kettner
stm32f4-energy-monitor
Commits
9ad9be77
Commit
9ad9be77
authored
Aug 14, 2013
by
James Pallister
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4 from AWhetter/python-prep
Extensions to host receiver
parents
89b51b0c
670a2ae0
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1338 additions
and
232 deletions
+1338
-232
host/Makefile.am
host/Makefile.am
+6
-0
host/Makefile.in
host/Makefile.in
+161
-24
host/config.h.in
host/config.h.in
+3
-0
host/configure
host/configure
+680
-0
host/configure.ac
host/configure.ac
+82
-1
host/dataprocessor.cpp
host/dataprocessor.cpp
+56
-8
host/dataprocessor.h
host/dataprocessor.h
+5
-0
host/host_receiver.cpp
host/host_receiver.cpp
+324
-192
host/pymodule.cpp
host/pymodule.cpp
+21
-7
No files found.
host/Makefile.am
View file @
9ad9be77
bin_PROGRAMS
=
host_receiver
lib_LTLIBRARIES
=
pyenergy.la
host_receiver_SOURCES
=
helper.cpp dataprocessor.cpp libusbinterface.cpp host_receiver.cpp
pyenergy_la_SOURCES
=
$(host_receiver_SOURCES)
pymodule.cpp
host_receiver_CPPFLAGS
=
$(BOOST_CPPFLAGS)
host_receiver_LDADD
=
$(BOOST_REGEX_LIBS)
$(BOOST_THREAD_LIBS)
$(BOOST_SYSTEM_LIBS)
host_receiver_LDFLAGS
=
$(BOOST_REGEX_LDFLAGS)
$(BOOST_THREAD_LDFLAGS)
$(BOOST_SYSTEM_LDFLAGS)
pyenergy_la_CPPFLAGS
=
$(PYTHON_CPPFLAGS)
pyenergy_la_LIBADD
=
$(BOOST_PYTHON_LIBS)
$(BOOST_PYTHON3_LIBS)
$(PYTHON_LIBS)
$(host_receiver_LDADD)
pyenergy_la_LDFLAGS
=
$(BOOST_PYTHON_LDFLAGS)
$(BOOST_PYTHON3_LDFLAGS)
-module
-shared
-avoid-version
$(host_receiver_LDFLAGS)
ACLOCAL_AMFLAGS
=
-Im4
host/Makefile.in
View file @
9ad9be77
...
...
@@ -14,6 +14,7 @@
@SET_MAKE@
VPATH
=
@srcdir@
am__is_gnu_make
=
test
-n
'
$(MAKEFILE_LIST)
'
&&
test
-n
'
$(MAKELEVEL)
'
am__make_running_with_option
=
\
...
...
@@ -106,20 +107,59 @@ mkinstalldirs = $(install_sh) -d
CONFIG_HEADER
=
config.h
CONFIG_CLEAN_FILES
=
CONFIG_CLEAN_VPATH_FILES
=
am__installdirs
=
"
$(DESTDIR)$(bindir)
"
am__vpath_adj_setup
=
srcdirstrip
=
`
echo
"
$(srcdir)
"
|
sed
's|.|.|g'
`
;
am__vpath_adj
=
case
$$
p
in
\
$(srcdir)
/
*
)
f
=
`
echo
"
$$
p"
|
sed
"s|^
$$
srcdirstrip/||"
`
;;
\
*
)
f
=
$$
p
;;
\
esac
;
am__strip_dir
=
f
=
`
echo
$$
p |
sed
-e
's|^.*/||'
`
;
am__install_max
=
40
am__nobase_strip_setup
=
\
srcdirstrip
=
`
echo
"
$(srcdir)
"
|
sed
's/[].[^$$\\*|]/\\\\&/g'
`
am__nobase_strip
=
\
for
p
in
$$
list
;
do
echo
"
$$
p"
;
done
|
sed
-e
"s|
$$
srcdirstrip/||"
am__nobase_list
=
$(am__nobase_strip_setup)
;
\
for
p
in
$$
list
;
do
echo
"
$$
p
$$
p"
;
done
|
\
sed
"s|
$$
srcdirstrip/| |;"
' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,'
|
\
$(AWK)
'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] ==
$(am__install_max)
) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list
=
\
sed
'$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
\
sed
'$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir
=
{
\
test
-z
"
$$
files"
\
||
{
test
!
-d
"
$$
dir"
&&
test
!
-f
"
$$
dir"
&&
test
!
-r
"
$$
dir"
;
}
\
||
{
echo
" ( cd '
$$
dir' && rm -f"
$$
files
")"
;
\
$(am__cd)
"
$$
dir"
&&
rm
-f
$$
files
;
}
;
\
}
am__installdirs
=
"
$(DESTDIR)$(libdir)
"
"
$(DESTDIR)$(bindir)
"
LTLIBRARIES
=
$(lib_LTLIBRARIES)
am__DEPENDENCIES_1
=
am__DEPENDENCIES_2
=
$(am__DEPENDENCIES_1)
$(am__DEPENDENCIES_1)
\
$(am__DEPENDENCIES_1)
pyenergy_la_DEPENDENCIES
=
$(am__DEPENDENCIES_1)
$(am__DEPENDENCIES_1)
\
$(am__DEPENDENCIES_1)
$(am__DEPENDENCIES_2)
am__objects_1
=
pyenergy_la-helper.lo pyenergy_la-dataprocessor.lo
\
pyenergy_la-libusbinterface.lo pyenergy_la-host_receiver.lo
am_pyenergy_la_OBJECTS
=
$(am__objects_1)
pyenergy_la-pymodule.lo
pyenergy_la_OBJECTS
=
$(am_pyenergy_la_OBJECTS)
AM_V_lt
=
$
(
am__v_lt_@AM_V@
)
am__v_lt_
=
$
(
am__v_lt_@AM_DEFAULT_V@
)
am__v_lt_0
=
--silent
am__v_lt_1
=
pyenergy_la_LINK
=
$(LIBTOOL)
$(AM_V_lt)
--tag
=
CXX
$(AM_LIBTOOLFLAGS)
\
$(LIBTOOLFLAGS)
--mode
=
link
$(CXXLD)
$(AM_CXXFLAGS)
\
$(CXXFLAGS)
$(pyenergy_la_LDFLAGS)
$(LDFLAGS)
-o
$@
PROGRAMS
=
$(bin_PROGRAMS)
am_host_receiver_OBJECTS
=
host_receiver-helper.
$(OBJEXT)
\
host_receiver-dataprocessor.
$(OBJEXT)
\
host_receiver-libusbinterface.
$(OBJEXT)
\
host_receiver-host_receiver.
$(OBJEXT)
host_receiver_OBJECTS
=
$(am_host_receiver_OBJECTS)
am__DEPENDENCIES_1
=
host_receiver_DEPENDENCIES
=
$(am__DEPENDENCIES_1)
\
$(am__DEPENDENCIES_1)
$(am__DEPENDENCIES_1)
AM_V_lt
=
$
(
am__v_lt_@AM_V@
)
am__v_lt_
=
$
(
am__v_lt_@AM_DEFAULT_V@
)
am__v_lt_0
=
--silent
am__v_lt_1
=
host_receiver_LINK
=
$(LIBTOOL)
$(AM_V_lt)
--tag
=
CXX
\
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode
=
link
$(CXXLD)
\
$(AM_CXXFLAGS)
$(CXXFLAGS)
$(host_receiver_LDFLAGS)
$(LDFLAGS)
\
...
...
@@ -158,8 +198,8 @@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
am__v_CXXLD_
=
$
(
am__v_CXXLD_@AM_DEFAULT_V@
)
am__v_CXXLD_0
=
@echo
" CXXLD "
$@
;
am__v_CXXLD_1
=
SOURCES
=
$(host_receiver_SOURCES)
DIST_SOURCES
=
$(host_receiver_SOURCES)
SOURCES
=
$(
pyenergy_la_SOURCES)
$(
host_receiver_SOURCES)
DIST_SOURCES
=
$(
pyenergy_la_SOURCES)
$(
host_receiver_SOURCES)
am__can_run_installinfo
=
\
case
$$
AM_UPDATE_INFO_DIR
in
\
n|no|NO
)
false
;;
\
...
...
@@ -214,6 +254,13 @@ AUTOMAKE = @AUTOMAKE@
AWK
=
@AWK@
BOOST_CPPFLAGS
=
@BOOST_CPPFLAGS@
BOOST_LDPATH
=
@BOOST_LDPATH@
BOOST_PYTHON3_LDFLAGS
=
@BOOST_PYTHON3_LDFLAGS@
BOOST_PYTHON3_LDPATH
=
@BOOST_PYTHON3_LDPATH@
BOOST_PYTHON3_LIBS
=
@BOOST_PYTHON3_LIBS@
BOOST_PYTHON_CPPFLAGS
=
@BOOST_PYTHON_CPPFLAGS@
BOOST_PYTHON_LDFLAGS
=
@BOOST_PYTHON_LDFLAGS@
BOOST_PYTHON_LDPATH
=
@BOOST_PYTHON_LDPATH@
BOOST_PYTHON_LIBS
=
@BOOST_PYTHON_LIBS@
BOOST_REGEX_LDFLAGS
=
@BOOST_REGEX_LDFLAGS@
BOOST_REGEX_LDPATH
=
@BOOST_REGEX_LDPATH@
BOOST_REGEX_LIBS
=
@BOOST_REGEX_LIBS@
...
...
@@ -281,6 +328,8 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL
=
@PACKAGE_URL@
PACKAGE_VERSION
=
@PACKAGE_VERSION@
PATH_SEPARATOR
=
@PATH_SEPARATOR@
PYTHON_CPPFLAGS
=
@PYTHON_CPPFLAGS@
PYTHON_LIBS
=
@PYTHON_LIBS@
RANLIB
=
@RANLIB@
SED
=
@SED@
SET_MAKE
=
@SET_MAKE@
...
...
@@ -340,10 +389,15 @@ target_alias = @target_alias@
top_build_prefix
=
@top_build_prefix@
top_builddir
=
@top_builddir@
top_srcdir
=
@top_srcdir@
lib_LTLIBRARIES
=
pyenergy.la
host_receiver_SOURCES
=
helper.cpp dataprocessor.cpp libusbinterface.cpp host_receiver.cpp
pyenergy_la_SOURCES
=
$(host_receiver_SOURCES)
pymodule.cpp
host_receiver_CPPFLAGS
=
$(BOOST_CPPFLAGS)
host_receiver_LDADD
=
$(BOOST_REGEX_LIBS)
$(BOOST_THREAD_LIBS)
$(BOOST_SYSTEM_LIBS)
host_receiver_LDFLAGS
=
$(BOOST_REGEX_LDFLAGS)
$(BOOST_THREAD_LDFLAGS)
$(BOOST_SYSTEM_LDFLAGS)
pyenergy_la_CPPFLAGS
=
$(PYTHON_CPPFLAGS)
pyenergy_la_LIBADD
=
$(BOOST_PYTHON_LIBS)
$(BOOST_PYTHON3_LIBS)
$(PYTHON_LIBS)
$(host_receiver_LDADD)
pyenergy_la_LDFLAGS
=
$(BOOST_PYTHON_LDFLAGS)
$(BOOST_PYTHON3_LDFLAGS)
-module
-shared
-avoid-version
$(host_receiver_LDFLAGS)
ACLOCAL_AMFLAGS
=
-Im4
all
:
config.h
$(MAKE)
$(AM_MAKEFLAGS)
all-am
...
...
@@ -399,6 +453,44 @@ $(srcdir)/config.h.in: $(am__configure_deps)
distclean-hdr
:
-
rm
-f
config.h stamp-h1
install-libLTLIBRARIES
:
$(lib_LTLIBRARIES)
@
$(NORMAL_INSTALL)
@
list
=
'
$(lib_LTLIBRARIES)
'
;
test
-n
"
$(libdir)
"
||
list
=
;
\
list2
=
;
for
p
in
$$
list
;
do
\
if
test
-f
$$
p
;
then
\
list2
=
"
$$
list2
$$
p"
;
\
else
:
;
fi
;
\
done
;
\
test
-z
"
$$
list2"
||
{
\
echo
"
$(MKDIR_P)
'
$(DESTDIR)$(libdir)
'"
;
\
$(MKDIR_P)
"
$(DESTDIR)$(libdir)
"
||
exit
1
;
\
echo
"
$(LIBTOOL)
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode=install
$(INSTALL)
$(INSTALL_STRIP_FLAG)
$$
list2 '
$(DESTDIR)$(libdir)
'"
;
\
$(LIBTOOL)
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode
=
install
$(INSTALL)
$(INSTALL_STRIP_FLAG)
$$
list2
"
$(DESTDIR)$(libdir)
"
;
\
}
uninstall-libLTLIBRARIES
:
@
$(NORMAL_UNINSTALL)
@
list
=
'
$(lib_LTLIBRARIES)
'
;
test
-n
"
$(libdir)
"
||
list
=
;
\
for
p
in
$$
list
;
do
\
$(am__strip_dir)
\
echo
"
$(LIBTOOL)
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode=uninstall rm -f '
$(DESTDIR)$(libdir)
/
$$
f'"
;
\
$(LIBTOOL)
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode
=
uninstall
rm
-f
"
$(DESTDIR)$(libdir)
/
$$
f"
;
\
done
clean-libLTLIBRARIES
:
-
test
-z
"
$(lib_LTLIBRARIES)
"
||
rm
-f
$(lib_LTLIBRARIES)
@
list
=
'
$(lib_LTLIBRARIES)
'
;
\
locs
=
`
for
p
in
$$
list
;
do
echo
$$
p
;
done
|
\
sed
's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|'
|
\
sort
-u
`
;
\
test
-z
"
$$
locs"
||
{
\
echo rm
-f
$
${locs}
;
\
rm
-f
$
${locs}
;
\
}
pyenergy.la
:
$(pyenergy_la_OBJECTS) $(pyenergy_la_DEPENDENCIES) $(EXTRA_pyenergy_la_DEPENDENCIES)
$(AM_V_CXXLD)$(pyenergy_la_LINK)
-rpath
$(libdir)
$(pyenergy_la_OBJECTS)
$(pyenergy_la_LIBADD)
$(LIBS)
install-binPROGRAMS
:
$(bin_PROGRAMS)
@
$(NORMAL_INSTALL)
@
list
=
'
$(bin_PROGRAMS)
'
;
test
-n
"
$(bindir)
"
||
list
=
;
\
...
...
@@ -463,6 +555,11 @@ distclean-compile:
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/host_receiver-helper.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/host_receiver-host_receiver.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/host_receiver-libusbinterface.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/pyenergy_la-dataprocessor.Plo@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/pyenergy_la-helper.Plo@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/pyenergy_la-host_receiver.Plo@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/pyenergy_la-libusbinterface.Plo@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/pyenergy_la-pymodule.Plo@am__quote@
.cpp.o
:
@am__fastdepCXX_TRUE@
$(AM_V_CXX)$(CXXCOMPILE)
-MT
$@
-MD
-MP
-MF
$(DEPDIR)/$*.Tpo
-c
-o
$@
$<
...
...
@@ -485,6 +582,41 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCXX_FALSE@
DEPDIR
=
$(DEPDIR)
$(CXXDEPMODE)
$(depcomp)
@AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@
$(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE)
-c
-o
$@
$<
pyenergy_la-helper.lo
:
helper.cpp
@am__fastdepCXX_TRUE@
$(AM_V_CXX)$(LIBTOOL)
$(AM_V_lt)
--tag
=
CXX
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode
=
compile
$(CXX)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(pyenergy_la_CPPFLAGS)
$(CPPFLAGS)
$(AM_CXXFLAGS)
$(CXXFLAGS)
-MT
pyenergy_la-helper.lo
-MD
-MP
-MF
$(DEPDIR)
/pyenergy_la-helper.Tpo
-c
-o
pyenergy_la-helper.lo
`
test
-f
'helper.cpp'
||
echo
'
$(srcdir)
/'
`
helper.cpp
@am__fastdepCXX_TRUE@
$(AM_V_at)$(am__mv)
$(DEPDIR)/pyenergy_la-helper.Tpo
$(DEPDIR)/pyenergy_la-helper.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@
$(AM_V_CXX)source
=
'helper.cpp'
object
=
'pyenergy_la-helper.lo'
libtool
=
yes
@AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@
DEPDIR
=
$(DEPDIR)
$(CXXDEPMODE)
$(depcomp)
@AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@
$(AM_V_CXX@am__nodep@)$(LIBTOOL)
$(AM_V_lt)
--tag
=
CXX
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode
=
compile
$(CXX)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(pyenergy_la_CPPFLAGS)
$(CPPFLAGS)
$(AM_CXXFLAGS)
$(CXXFLAGS)
-c
-o
pyenergy_la-helper.lo
`
test
-f
'helper.cpp'
||
echo
'
$(srcdir)
/'
`
helper.cpp
pyenergy_la-dataprocessor.lo
:
dataprocessor.cpp
@am__fastdepCXX_TRUE@
$(AM_V_CXX)$(LIBTOOL)
$(AM_V_lt)
--tag
=
CXX
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode
=
compile
$(CXX)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(pyenergy_la_CPPFLAGS)
$(CPPFLAGS)
$(AM_CXXFLAGS)
$(CXXFLAGS)
-MT
pyenergy_la-dataprocessor.lo
-MD
-MP
-MF
$(DEPDIR)
/pyenergy_la-dataprocessor.Tpo
-c
-o
pyenergy_la-dataprocessor.lo
`
test
-f
'dataprocessor.cpp'
||
echo
'
$(srcdir)
/'
`
dataprocessor.cpp
@am__fastdepCXX_TRUE@
$(AM_V_at)$(am__mv)
$(DEPDIR)/pyenergy_la-dataprocessor.Tpo
$(DEPDIR)/pyenergy_la-dataprocessor.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@
$(AM_V_CXX)source
=
'dataprocessor.cpp'
object
=
'pyenergy_la-dataprocessor.lo'
libtool
=
yes
@AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@
DEPDIR
=
$(DEPDIR)
$(CXXDEPMODE)
$(depcomp)
@AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@
$(AM_V_CXX@am__nodep@)$(LIBTOOL)
$(AM_V_lt)
--tag
=
CXX
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode
=
compile
$(CXX)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(pyenergy_la_CPPFLAGS)
$(CPPFLAGS)
$(AM_CXXFLAGS)
$(CXXFLAGS)
-c
-o
pyenergy_la-dataprocessor.lo
`
test
-f
'dataprocessor.cpp'
||
echo
'
$(srcdir)
/'
`
dataprocessor.cpp
pyenergy_la-libusbinterface.lo
:
libusbinterface.cpp
@am__fastdepCXX_TRUE@
$(AM_V_CXX)$(LIBTOOL)
$(AM_V_lt)
--tag
=
CXX
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode
=
compile
$(CXX)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(pyenergy_la_CPPFLAGS)
$(CPPFLAGS)
$(AM_CXXFLAGS)
$(CXXFLAGS)
-MT
pyenergy_la-libusbinterface.lo
-MD
-MP
-MF
$(DEPDIR)
/pyenergy_la-libusbinterface.Tpo
-c
-o
pyenergy_la-libusbinterface.lo
`
test
-f
'libusbinterface.cpp'
||
echo
'
$(srcdir)
/'
`
libusbinterface.cpp
@am__fastdepCXX_TRUE@
$(AM_V_at)$(am__mv)
$(DEPDIR)/pyenergy_la-libusbinterface.Tpo
$(DEPDIR)/pyenergy_la-libusbinterface.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@
$(AM_V_CXX)source
=
'libusbinterface.cpp'
object
=
'pyenergy_la-libusbinterface.lo'
libtool
=
yes
@AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@
DEPDIR
=
$(DEPDIR)
$(CXXDEPMODE)
$(depcomp)
@AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@
$(AM_V_CXX@am__nodep@)$(LIBTOOL)
$(AM_V_lt)
--tag
=
CXX
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode
=
compile
$(CXX)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(pyenergy_la_CPPFLAGS)
$(CPPFLAGS)
$(AM_CXXFLAGS)
$(CXXFLAGS)
-c
-o
pyenergy_la-libusbinterface.lo
`
test
-f
'libusbinterface.cpp'
||
echo
'
$(srcdir)
/'
`
libusbinterface.cpp
pyenergy_la-host_receiver.lo
:
host_receiver.cpp
@am__fastdepCXX_TRUE@
$(AM_V_CXX)$(LIBTOOL)
$(AM_V_lt)
--tag
=
CXX
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode
=
compile
$(CXX)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(pyenergy_la_CPPFLAGS)
$(CPPFLAGS)
$(AM_CXXFLAGS)
$(CXXFLAGS)
-MT
pyenergy_la-host_receiver.lo
-MD
-MP
-MF
$(DEPDIR)
/pyenergy_la-host_receiver.Tpo
-c
-o
pyenergy_la-host_receiver.lo
`
test
-f
'host_receiver.cpp'
||
echo
'
$(srcdir)
/'
`
host_receiver.cpp
@am__fastdepCXX_TRUE@
$(AM_V_at)$(am__mv)
$(DEPDIR)/pyenergy_la-host_receiver.Tpo
$(DEPDIR)/pyenergy_la-host_receiver.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@
$(AM_V_CXX)source
=
'host_receiver.cpp'
object
=
'pyenergy_la-host_receiver.lo'
libtool
=
yes
@AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@
DEPDIR
=
$(DEPDIR)
$(CXXDEPMODE)
$(depcomp)
@AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@
$(AM_V_CXX@am__nodep@)$(LIBTOOL)
$(AM_V_lt)
--tag
=
CXX
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode
=
compile
$(CXX)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(pyenergy_la_CPPFLAGS)
$(CPPFLAGS)
$(AM_CXXFLAGS)
$(CXXFLAGS)
-c
-o
pyenergy_la-host_receiver.lo
`
test
-f
'host_receiver.cpp'
||
echo
'
$(srcdir)
/'
`
host_receiver.cpp
pyenergy_la-pymodule.lo
:
pymodule.cpp
@am__fastdepCXX_TRUE@
$(AM_V_CXX)$(LIBTOOL)
$(AM_V_lt)
--tag
=
CXX
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode
=
compile
$(CXX)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(pyenergy_la_CPPFLAGS)
$(CPPFLAGS)
$(AM_CXXFLAGS)
$(CXXFLAGS)
-MT
pyenergy_la-pymodule.lo
-MD
-MP
-MF
$(DEPDIR)
/pyenergy_la-pymodule.Tpo
-c
-o
pyenergy_la-pymodule.lo
`
test
-f
'pymodule.cpp'
||
echo
'
$(srcdir)
/'
`
pymodule.cpp
@am__fastdepCXX_TRUE@
$(AM_V_at)$(am__mv)
$(DEPDIR)/pyenergy_la-pymodule.Tpo
$(DEPDIR)/pyenergy_la-pymodule.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@
$(AM_V_CXX)source
=
'pymodule.cpp'
object
=
'pyenergy_la-pymodule.lo'
libtool
=
yes
@AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@
DEPDIR
=
$(DEPDIR)
$(CXXDEPMODE)
$(depcomp)
@AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@
$(AM_V_CXX@am__nodep@)$(LIBTOOL)
$(AM_V_lt)
--tag
=
CXX
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode
=
compile
$(CXX)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(pyenergy_la_CPPFLAGS)
$(CPPFLAGS)
$(AM_CXXFLAGS)
$(CXXFLAGS)
-c
-o
pyenergy_la-pymodule.lo
`
test
-f
'pymodule.cpp'
||
echo
'
$(srcdir)
/'
`
pymodule.cpp
host_receiver-helper.o
:
helper.cpp
@am__fastdepCXX_TRUE@
$(AM_V_CXX)$(CXX)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(host_receiver_CPPFLAGS)
$(CPPFLAGS)
$(AM_CXXFLAGS)
$(CXXFLAGS)
-MT
host_receiver-helper.o
-MD
-MP
-MF
$(DEPDIR)/host_receiver-helper.Tpo
-c
-o
host_receiver-helper.o
`test
-f
'helper.cpp'
||
echo
'$(srcdir)/'
`helper.cpp
@am__fastdepCXX_TRUE@
$(AM_V_at)$(am__mv)
$(DEPDIR)/host_receiver-helper.Tpo
$(DEPDIR)/host_receiver-helper.Po
...
...
@@ -773,9 +905,11 @@ distcleancheck: distclean
exit
1
;
}
>
&2
check-am
:
all-am
check
:
check-am
all-am
:
Makefile $(PROGRAMS) config.h
all-am
:
Makefile $(LTLIBRARIES) $(PROGRAMS) config.h
install-binPROGRAMS
:
install-libLTLIBRARIES
installdirs
:
for
dir
in
"
$(DESTDIR)$(bindir)
"
;
do
\
for
dir
in
"
$(DESTDIR)$(
libdir)
"
"
$(DESTDIR)$(
bindir)
"
;
do
\
test
-z
"
$$
dir"
||
$(MKDIR_P)
"
$$
dir"
;
\
done
install
:
install-am
...
...
@@ -810,7 +944,8 @@ maintainer-clean-generic:
@
echo
"it deletes files that may require special tools to rebuild."
clean
:
clean-am
clean-am
:
clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
clean-am
:
clean-binPROGRAMS clean-generic clean-libLTLIBRARIES
\
clean-libtool mostlyclean-am
distclean
:
distclean-am
-
rm
-f
$(am__CONFIG_DISTCLEAN_FILES)
...
...
@@ -837,7 +972,7 @@ install-dvi: install-dvi-am
install-dvi-am
:
install-exec-am
:
install-binPROGRAMS
install-exec-am
:
install-binPROGRAMS
install-libLTLIBRARIES
install-html
:
install-html-am
...
...
@@ -879,26 +1014,28 @@ ps: ps-am
ps-am
:
uninstall-am
:
uninstall-binPROGRAMS
uninstall-am
:
uninstall-binPROGRAMS
uninstall-libLTLIBRARIES
.MAKE
:
all install-am install-strip
.PHONY
:
CTAGS GTAGS TAGS all all-am am--refresh check check-am clean
\
clean-binPROGRAMS clean-cscope clean-generic clean-libtool
\
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2
\
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip
\
distcheck distclean distclean-compile distclean-generic
\
distclean-hdr distclean-libtool distclean-tags distcleancheck
\
distdir distuninstallcheck dvi dvi-am html html-am info
\
info-am install install-am install-binPROGRAMS install-data
\
clean-binPROGRAMS clean-cscope clean-generic
\
clean-libLTLIBRARIES clean-libtool cscope cscopelist-am ctags
\
ctags-am dist dist-all dist-bzip2 dist-gzip dist-lzip
\
dist-shar dist-tarZ dist-xz dist-zip distcheck distclean
\
distclean-compile distclean-generic distclean-hdr
\
distclean-libtool distclean-tags distcleancheck distdir
\
distuninstallcheck dvi dvi-am html html-am info info-am
\
install install-am install-binPROGRAMS install-data
\
install-data-am install-dvi install-dvi-am install-exec
\
install-exec-am install-html install-html-am install-info
\
install-info-am install-
man install-pdf install-pdf-am
\
install-p
s install-ps-am install-strip installcheck
\
installcheck-am installdirs maintainer-clean
\
install-info-am install-
libLTLIBRARIES install-man install-pdf
\
install-p
df-am install-ps install-ps-am install-strip
\
installcheck
installcheck
-am installdirs maintainer-clean
\
maintainer-clean-generic mostlyclean mostlyclean-compile
\
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am
\
tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
\
uninstall-libLTLIBRARIES
# Tell versions [3.59,3.63) of GNU make to not export all variables.
...
...
host/config.h.in
View file @
9ad9be77
...
...
@@ -3,6 +3,9 @@
/* Defined if the requested minimum BOOST version is satisfied */
#undef HAVE_BOOST
/* Define to 1 if you have <boost/python.hpp> */
#undef HAVE_BOOST_PYTHON_HPP
/* Define to 1 if you have <boost/regex.hpp> */
#undef HAVE_BOOST_REGEX_HPP
...
...
host/configure
View file @
9ad9be77
This diff is collapsed.
Click to expand it.
host/configure.ac
View file @
9ad9be77
...
...
@@ -6,7 +6,7 @@ AC_INIT([stm32-host-receiver], [0.0.1], [BUG-REPORT-ADDRESS])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE
AC_PROG_LIBTOOL
LT_INIT
AC_CONFIG_SRCDIR([host_receiver.cpp])
AC_CONFIG_HEADERS([config.h])
...
...
@@ -28,6 +28,87 @@ BOOST_SYSTEM([n])
AC_CHECK_LIB([readline], [main],, [AC_MSG_ERROR([Cannot find readline library. Please install it.])])
AC_CHECK_LIB([usb-1.0], [main],, [AC_MSG_ERROR([Cannot find usb-1.0 library. Please install it.])])
# Python checking adapted from gdb's configure.ac
# It's license, and original code can be obtained from
# http://ftp.gnu.org/gnu/gdb/gdb-7.6.tar.bz2
AC_DEFUN([AC_TRY_LIBPYTHON],
[
version=$1
define([have_libpython_var],$2)
new_CPPFLAGS=$3
new_LIBS=$4
save_CPPFLAGS=$CPPFLAGS
save_LIBS=$LIBS
CPPFLAGS="$CPPFLAGS $new_CPPFLAGS"
LIBS="$LIBS $new_LIBS"
case $version in
python3*)
BOOST_FIND_LIB([python3], [n], [boost/python.hpp],
[], [BOOST_PYTHON_MODULE(empty) {}])
;;
*)
BOOST_PYTHON([n])
;;
esac
found_usable_python=no
AC_MSG_CHECKING([for ${version}])
AC_LINK_IFELSE(AC_LANG_PROGRAM([[#include "Python.h"]],
[[Py_Initialize ();]]),
[have_libpython_var=${version}
found_usable_python=yes
PYTHON_CPPFLAGS=$new_CPPFLAGS
PYTHON_LIBS=$new_LIBS])
CPPFLAGS=$save_CPPFLAGS
LIBS=$save_LIBS
AC_MSG_RESULT([${found_usable_python}])
])
AC_ARG_WITH(python,
AS_HELP_STRING([--with-python=PYTHON], [also build host receiver as a python module (/path/to/python)]),
[],
[with_python=no])
AC_MSG_CHECKING([whether to use python])
AC_MSG_RESULT([$with_python])
if test "${with_python}" = no; then
AC_MSG_WARN([python module will not be compiled])
else
python_bin="${with_python}"
if test ! -f "${python_bin}"; then
AC_MSG_ERROR(unable to find python program ${python_bin})
else
python_includes=`${python_bin}-config --includes`
if test $? != 0; then
AC_MSG_ERROR(failure running python-config --includes)
fi
python_libs=`${python_bin}-config --ldflags`
if test $? != 0; then
AC_MSG_ERROR(failure running python-config --ldflags)
fi
have_libpython=no
python_version=`echo " ${python_libs} " \
| sed -e 's,^.* -l\(python[[0-9]]*[[\.]]*[[0-9]]*\).*$,\1,'`
case "${python_version}" in
python*)
AC_TRY_LIBPYTHON(${python_version}, have_libpython,
${python_includes}, ${python_libs})
;;
*)
AC_MSG_ERROR([unable to determine python version from ${python_libs}])
;;
esac
if test "${have_libpython}" = no; then
AC_MSG_ERROR([no usable python found at ${with_python}])
fi
fi
fi
AC_SUBST(PYTHON_CPPFLAGS)
AC_SUBST(PYTHON_LIBS)
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
...
...
host/dataprocessor.cpp
View file @
9ad9be77
...
...
@@ -6,6 +6,8 @@
#include "helper.h"
#include <math.h>
#define DEFAULT_OUTPUT "output_results"
using
namespace
std
;
using
namespace
boost
;
using
namespace
boost
::
accumulators
;
...
...
@@ -15,7 +17,6 @@ DataProcessor::DataProcessor(boost::mutex *m, std::queue<boost::shared_array<uns
mQueue
=
m
;
dQueue
=
d
;
status
=
0
;
output
=
fopen
(
"output_results"
,
"w"
);
cur_time
=
0
;
doAccumulation
=
false
;
last_tick
=
0
;
...
...
@@ -24,15 +25,13 @@ DataProcessor::DataProcessor(boost::mutex *m, std::queue<boost::shared_array<uns
resistor
=
1.0
;
gain
=
50.0
;
referenceVoltage
=
3.0
;
/* Don't set output. This should be done with openOutput. */
output
=
NULL
;
}
DataProcessor
::~
DataProcessor
()
{
if
(
output
)
{
fclose
(
output
);
output
=
NULL
;
}
DataProcessor
::
closeOutput
();
}
void
DataProcessor
::
operator
()()
...
...
@@ -138,12 +137,18 @@ void DataProcessor::processData()
b2
|=
(
data
[
i
]
&
0xF0
)
<<
4
;
power
=
convertToPower
(
b1
);
fprintf
(
output
,
"%f %lu
\n
"
,
power
,
cur_time
);
if
(
DataProcessor
::
openedFile
())
{
fprintf
(
output
,
"%f %lu
\n
"
,
power
,
cur_time
);
}
addDataItem
(
power
,
cur_time
);
cur_time
+=
rate
;
power
=
convertToPower
(
b2
);
fprintf
(
output
,
"%f %lu
\n
"
,
power
,
cur_time
);
if
(
DataProcessor
::
openedFile
())
{
fprintf
(
output
,
"%f %lu
\n
"
,
power
,
cur_time
);
}
addDataItem
(
power
,
cur_time
);
cur_time
+=
rate
;
}
...
...
@@ -181,3 +186,46 @@ float DataProcessor::convertToPower(float v)
return
double
(
v
)
*
4096.
/
4095.
/
4095.
*
double
(
referenceVoltage
)
*
double
(
referenceVoltage
)
*
2.
/
double
(
gain
)
/
double
(
resistor
);
}
int
DataProcessor
::
closeOutput
()
{
if
(
status
==
1
)
{
return
1
;
}
int
to_return
=
0
;
if
(
output
)
{
to_return
=
fclose
(
output
);
output
=
NULL
;
}
return
to_return
;
}
int
DataProcessor
::
openOutput
()
{
openOutput
(
DEFAULT_OUTPUT
);
}
int
DataProcessor
::
openOutput
(
std
::
string
output_loc
)
{
int
to_return
=
0
;
if
(
!
output
)
{
output
=
fopen
(
output_loc
.
c_str
(),
"w"
);
to_return
=
(
output
==
NULL
);
}
else
{
to_return
=
-
1
;
}
return
to_return
;
}
int
DataProcessor
::
openedFile
()
{
return
(
output
!=
NULL
);
}
host/dataprocessor.h
View file @
9ad9be77
...
...
@@ -27,6 +27,11 @@ public:
void
setResistor
(
float
);
void
setReferenceVoltage
(
float
);
void
setGain
(
float
);
int
closeOutput
();
int
openOutput
();
int
openOutput
(
std
::
string
output_loc
);
int
openedFile
();
private:
boost
::
mutex
*
mQueue
;
std
::
queue
<
boost
::
shared_array
<
unsigned
char
>
>
*
dQueue
;
...
...
host/host_receiver.cpp
View file @
9ad9be77
...
...
@@ -16,6 +16,7 @@
#include "config.h"
#include "dataprocessor.h"
#include "libusbinterface.h"
#include "host_receiver.h"
#define CHECK_CONNECTED() \
if (!connected) { \
...
...
@@ -45,271 +46,402 @@ bool connected = false;
void
ctrlc_handler
(
int
_
)
{
liObj
->
endSignal
();
dpObj
->
endSignal
();
if
(
dpObj
)
{
dpObj
->
endSignal
();
}
running
=
false
;
}
void
processCommand
(
string
input
)
void
cmd_connect
(
)
{
vector
<
string
>
args
;
cmd_connect_to
(
""
);
}
split
(
args
,
input
,
is_any_of
(
"
\t
"
));
void
cmd_connect_to
(
string
connect_to
)
{
auto
devlist
=
LibusbInterface
::
listDevices
(
0xF539
,
0xF539
);
int
i
=
0
;
if
(
args
[
0
]
==
"cmd"
)
if
(
devlist
.
empty
()
)
{
// CHECK_PARAMS()
;
// liObj->sendCommand(lexical_cast<int>(args[1]))
;
cout
<<
" No devices found!"
<<
endl
;
return
;
}
else
if
(
args
[
0
]
==
"connect"
)
{
auto
devlist
=
LibusbInterface
::
listDevices
(
0xF539
,
0xF539
);
int
i
=
0
;
if
(
devlist
.
empty
())
{
cout
<<
" No devices found!"
<<
endl
;
return
;
}
if
(
devlist
.
size
()
>
1
)
if
(
devlist
.
size
()
>
1
)
{
if
(
connect_to
.
compare
(
""
))
{
if
(
args
.
size
()
==
1
)
{
cout
<<
" Select a device"
<<
endl
;
for
(
auto
dev
:
devlist
)
{
i
++
;
cout
<<
" "
<<
i
<<
": "
<<
dev
.
first
<<
"
\t
"
<<
dev
.
second
<<
endl
;
}
return
;
}
else
cout
<<
" Select a device"
<<
endl
;
for
(
auto
dev
:
devlist
)
{
i
nt
devn
=
lexical_cast
<
int
>
(
args
[
1
])
;
c
hosen_serial
=
devlist
[
devn
].
first
;
i
++
;
c
out
<<
" "
<<
i
<<
": "
<<
dev
.
first
<<
"
\t
"
<<
dev
.
second
<<
endl
;
}
return
;
}
else
{
chosen_serial
=
devlist
[
0
].
first
;
int
devn
=
lexical_cast
<
int
>
(
connect_to
);
chosen_serial
=
devlist
[
devn
].
first
;
}
}
else
{
chosen_serial
=
devlist
[
0
].
first
;
}
if
(
connected
)
{
liObj
->
endSignal
();
dpObj
->
endSignal
();
connected
=
false
;
thread1
.
join
();
thread2
.
join
();
delete
liObj
;
delete
dpObj
;
}
if
(
connected
)
{
liObj
->
endSignal
();
dpObj
->
endSignal
();
connected
=
false
;
thread1
.
join
();
thread2
.
join
();
delete
liObj
;
delete
dpObj
;
dpObj
=
NULL
;
}
dQueue
.
reset
(
new
queue
<
shared_array
<
unsigned
char
>
>
());
liObj
=
new
LibusbInterface
(
&
bmutex
,
dQueue
.
get
(),
0xF539
,
0xF539
,
chosen_serial
);
dpObj
=
new
DataProcessor
(
&
bmutex
,
dQueue
.
get
());
thread1
=
boost
::
thread
(
bind
(
&
LibusbInterface
::
operator
(),
liObj
));
// Bind prevents copying obj (need to keep ptr)
connected
=
true
;
cout
<<
" Connected to device, serial: "
<<
chosen_serial
<<
endl
;