Skip to content
Snippets Groups Projects
Commit c1083278 authored by killenb's avatar killenb
Browse files

- Made a server which uses the referenceTestCore of the control system adapter

  -- kind of seems to work with jddd_tool (strange update behaviour)
  -- automatic tests missing
- Fixed the use of process variables with location name


git-svn-id: https://svnsrv.desy.de/desy/mtca4u_applications/DOOCS_Adapter/trunk@143 688d77b5-b833-4f6b-b27f-eb88d88625d6
parent fba675c8
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,8 @@
#include <ControlSystemAdapter/ProcessVariableListener.h>
#include <ControlSystemAdapter/ControlSystemSynchronizationUtility.h>
#include "splitStringAtFirstSlash.h"
// Just declare the EqFct class. We only need the pointer in this header.
class EqFct;
......@@ -69,8 +71,9 @@ public:
DoocsProcessArray( EqFct * const eqFct,
boost::shared_ptr< typename mtca4u::ProcessArray<T> > const & processArray,
ControlSystemSynchronizationUtility & syncUtility)
: D_spectrum(processArray->getName().c_str(), processArray->get().size(), eqFct),
_processArray(processArray) {
: D_spectrum( splitStringAtFirstSlash(processArray->getName()).second.c_str(),
processArray->get().size(), eqFct),
_processArray(processArray) {
syncUtility.addReceiveNotificationListener( processArray->getName(),
ProcessVariableListener::SharedPtr( new DoocsArrayListener(this) ) );
}
......
......@@ -7,6 +7,7 @@
#include <ControlSystemAdapter/ControlSystemSynchronizationUtility.h>
#include <boost/shared_ptr.hpp>
//#include <boost/function.hpp>
#include "splitStringAtFirstSlash.h"
// Just declare the EqFct class. We only need the pointer in this header.
class EqFct;
......@@ -54,7 +55,8 @@ public:
DoocsProcessScalar( EqFct * const eqFct,
boost::shared_ptr< typename mtca4u::ProcessScalar<T> > const & processScalar,
ControlSystemSynchronizationUtility & syncUtility)
: DOOCS_T(processScalar->getName().c_str(), eqFct), _processScalar(processScalar) {
: DOOCS_T( splitStringAtFirstSlash(processScalar->getName()).second.c_str(), eqFct),
_processScalar(processScalar) {
syncUtility.addReceiveNotificationListener( processScalar->getName(),
ProcessVariableListener::SharedPtr( new DoocsScalarListener(this) ) );
}
......
......@@ -3,7 +3,7 @@
namespace mtca4u{
std::pair< std::string, std::string > splitStringAtFirstSlash(std::string input){
inline std::pair< std::string, std::string > splitStringAtFirstSlash(std::string input){
auto slashPosition = input.find_first_of("/");
if (slashPosition == std::string::npos){
return std::make_pair( std::string(), input);
......
......@@ -36,9 +36,11 @@ LDFLAGS += -lboost_system -lEqServer -lDOOCSapi
#link the adapter with runpath, so it is found at execution time
LDFLAGS += -L$(OBJDIR) -lDoocsAdapter -Wl,-rpath=$(OBJDIR),--enable-new-dtags $(ControlSystemAdapter_LDFLAGS)
.PHONY: $(OBJDIR)/.depend_tests referenceTestDoocsServer
include ../CPP_DEBUG_FLAGS.CONFIG
all: $(TEST_TARGETS)
all: $(TEST_TARGETS) referenceTestDoocsServer
$(OBJDIR)/.depend_tests depend:
@if [ ! -f $(OBJDIR) ] ; then \
......@@ -50,6 +52,9 @@ $(OBJDIR)/.depend_tests depend:
include $(OBJDIR)/.depend_tests
referenceTestDoocsServer:
(cd referenceTestDoocsServer; make)
#.cpp.o:
# @if [ ! -f $(OBJDIR)/tests ] ; then \
# echo ---------- creating directory $(OBJDIR)/tests --------------; \
......@@ -72,6 +77,7 @@ $(OBJDIR)/tests/%: src/%.cpp
clean:
rm -f $(SOURCEOBJ) $(OBJDIR)/tests/* *.gcda *.gcno $(OBJDIR)/.depend*
(cd referenceTestDoocsServer; make clean)
test: $(OBJDIR)/CTestTestfile.cmake
(cd $(OBJDIR); ctest)
......
#define the dependeny locations here
DOOCSROOT = $(HOME)/doocs.git/doocs
# to define DOOCSROOT as an absolute path
include $(DOOCSROOT)/$(DOOCSARCH)/DEFINEDOOCSROOT
# to define the arch dependend things
include $(DOOCSROOT)/$(DOOCSARCH)/CONFIG
#Check that the ControlSystemAdapter-config script is in your path
CPPFLAGS += $(shell ControlSystemAdapter-config --cppflags)
LDFLAGS += $(shell ControlSystemAdapter-config --ldflags)
#DOOCS_Adapter_SRC_DIR = ../..
OBJDIR = $(DOOCSROOT)/$(DOOCSARCH)/obj/server/test/referenceTestDoocsServer
SRCDIR = $(PWD)
ADAPTER_OBJDIR = $(DOOCSROOT)/$(DOOCSARCH)/obj/library/common/DoocsAdapter
SOURCEOBJ = $(OBJDIR)/referenceTestDoocsServer.o
SOURCEHFILES =
ALLPROGS = $(OBJDIR)/referenceTestDoocsServer
include ../../CPP_DEBUG_FLAGS.CONFIG
CPPFLAGS += -Wall -Wextra -Wshadow -pedantic -Wuninitialized $(CPP_DEBUG_FLAGS)
CPPFLAGS += -I../../include -Iinclude -isystem/local/lib/include
LDFLAGS += -lboost_thread -lboost_system
#link the adapter with runpath, so it is found at execution time
LDFLAGS += -L$(ADAPTER_OBJDIR) -lDoocsAdapter -Wl,-rpath=$(ADAPTER_OBJDIR),--enable-new-dtags
all: $(ALLPROGS)
$(OBJDIR)/.depend depend:
@if [ ! -f $(OBJDIR) ] ; then \
echo ---------- create dir $(OBJDIR) --------------; \
mkdir -p $(OBJDIR) ; \
fi
for i in $(SRCDIR)/*.cc ;do $(CCDEP) $$i ;done > $(OBJDIR)/.depend_temp
cat $(OBJDIR)/.depend_temp | sed -e "/:/s/^/\$$\(OBJDIR\)\//g" > $(OBJDIR)/.depend
chmod g+w $(OBJDIR)/.depend*
include $(OBJDIR)/.depend
$(OBJDIR)/referenceTestDoocsServer: $(SOURCEOBJ)
$(LINK.cc) \
-o $@ $(SOURCEOBJ) \
-lEqServer -lDOOCSapi \
$(LDFLAGS) $(LDLIBS)
@chmod g+w $@
@echo "---------------- $@ done---------------"
clean:
rm -f $(SOURCEOBJ) $(OBJDIR)/*.o $(OBJDIR)/referenceTestDoocsServer $(OBJDIR)/.depend* *.gcda *.gcno
test: $(OBJDIR)/CTestTestfile.cmake
(cd $(OBJDIR); ctest)
$(OBJDIR)/CTestTestfile.cmake: CTestTestfile.cmake.in
cat $< | sed "{s|@__OBJDIR__@|$(OBJDIR)|}" > $@
#include <DoocsAdapter.h>
// Include all the control applications you want in this server
#include <ControlSystemAdapter/testing/IndependentTestCore.h>
BEGIN_DOOCS_SERVER("ReferenceTest DOOCS server", 10)
// Create static instances for all applications cores. They must not have overlapping
// process variable names ("location/protery" must be unique).
static IndependentTestCore independentTestCore(doocsAdapter.getDevicePVManager(), true);
END_DOOCS_SERVER()
eq_conf:
oper_uid: -1
oper_gid: 405
xpert_uid: 1000
xpert_gid: 1000
ring_buffer: 10000
memory_buffer: 500
eq_fct_name: "REFERENCE_TEST._SVR"
eq_fct_type: 1
{
SVR.RPC_NUMBER: 610498009
SVR.NAME: "REFERENCE_TEST._SVR"
SVR.RATE: 1 0 0 0
SVR.BPN: 6000
}
eq_fct_name: "INT"
eq_fct_type: 10
{
NAME: "INT"
}
eq_fct_name: "SHORT"
eq_fct_type: 10
{
NAME: "SHORT"
}
eq_fct_name: "FLOAT"
eq_fct_type: 10
{
NAME: "FLOAT"
}
eq_fct_name: "DOUBLE"
eq_fct_type: 10
{
NAME: "DOUBLE"
}
eq_fct_name: "UINT"
eq_fct_type: 10
{
NAME: "UINT"
}
eq_fct_name: "USHORT"
eq_fct_type: 10
{
NAME: "USHORT"
}
eq_fct_name: "CHAR"
eq_fct_type: 10
{
NAME: "CHAR"
}
eq_fct_name: "UCHAR"
eq_fct_type: 10
{
NAME: "UCHAR"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment