sync to work on test machine

This commit is contained in:
Ren RenJuan 2014-01-07 17:59:27 +00:00
parent a86d612f94
commit 83c6117308
11 changed files with 89 additions and 51 deletions

View File

@ -57,36 +57,28 @@
<buildTargets> <buildTargets>
<target name="clean" path="ACTK1_3_2" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="clean" path="ACTK1_3_2" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget> <buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand> <useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders> <runAllBuilders>true</runAllBuilders>
</target> </target>
<target name="AusRegEPPTK.so" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="all" path="ACTK1_3_2" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildTarget>all</buildTarget> <buildTarget>all</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand> <useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders> <runAllBuilders>true</runAllBuilders>
</target> </target>
<target name="tests" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="tests" path="ACTK1_3_2" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>tests</buildTarget> <buildTarget>tests</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand> <useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders> <runAllBuilders>true</runAllBuilders>
</target> </target>
<target name="clean" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="cliever" path="AusRegCliever" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="cliever" path="AusRegCliever" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>cliever</buildTarget> <buildTarget>cliever</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand> <useDefaultCommand>true</useDefaultCommand>
@ -94,6 +86,7 @@
</target> </target>
<target name="clean" path="AusRegCliever" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="clean" path="AusRegCliever" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget> <buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand> <useDefaultCommand>true</useDefaultCommand>
@ -101,11 +94,36 @@
</target> </target>
<target name="distclean" path="AusRegCliever" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> <target name="distclean" path="AusRegCliever" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand> <buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>distclean</buildTarget> <buildTarget>distclean</buildTarget>
<stopOnError>true</stopOnError> <stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand> <useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders> <runAllBuilders>true</runAllBuilders>
</target> </target>
<target name="AusRegEPPTK.so" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="tests" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>tests</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="clean" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets> </buildTargets>
</storageModule> </storageModule>
</cproject> </cproject>

View File

@ -48,7 +48,7 @@ test_execs = $(subst .o,,$(test_objs))
calc_deps = \ calc_deps = \
$(CC) -MT '$(build_obj_dir)/$(basename $(notdir $@)).o $@' -MF $@ -MM $(CPPFLAGS) $(INCLUDE_DIR) $< $(CC) -MT '$(build_obj_dir)/$(basename $(notdir $@)).o $@' -MF $@ -MM $(CPPFLAGS) $(INCLUDE_DIR) $<
all: dirs $(objs) $(BUILD_LIB_DIR)/libAusRegEPPTK.so all: dirs $(objs) $(BUILD_LIB_DIR)/libACTK1_3_2.so
%.d: %.c %.d: %.c
$(calc_deps) $(calc_deps)
@ -78,7 +78,7 @@ $(BUILD_OBJ_DIR)/%.o: %.c
$(CC) $(CPPFLAGS) -c -o $@ $(INCLUDE_DIR) $< $(CC) $(CPPFLAGS) -c -o $@ $(INCLUDE_DIR) $<
LDFLAGS_TESTS = -L$(BUILD_LIB_DIR) -lAusRegEPPTK \ LDFLAGS_TESTS = -L$(BUILD_LIB_DIR) -lACTK1_3_2 \
-L$(XALAN_LIB_DIR) -lxalan-c -lxalanMsg\ -L$(XALAN_LIB_DIR) -lxalan-c -lxalanMsg\
-L$(XERCES_LIB_DIR) -lxerces-c \ -L$(XERCES_LIB_DIR) -lxerces-c \
-lssl \ -lssl \
@ -90,7 +90,7 @@ $(BUILD_OBJ_DIR)/%: $(BUILD_OBJ_DIR)/%.o
.PHONY: doc clean dclean .PHONY: doc clean dclean
####### Build rules ####### Build rules
#libAusreg_EPP_toolkit.a: $(OBJECTS) #libACTK1_3_2.a: $(OBJECTS)
# $(LIB_ARCHIVER) $(LIB_FLAGS) $(BUILD_LIB_DIR)/$@ $^ # $(LIB_ARCHIVER) $(LIB_FLAGS) $(BUILD_LIB_DIR)/$@ $^
@ -103,15 +103,15 @@ dirs:
-mkdir -p $(BUILD_LIB_DIR) -mkdir -p $(BUILD_LIB_DIR)
-mkdir -p $(BUILD_OBJ_DIR) -mkdir -p $(BUILD_OBJ_DIR)
libAusRegEPPTK.so: libACTK1_3_2.so:
$(BUILD_LIB_DIR)/libAusRegEPPTK.so: $(objs) $(BUILD_LIB_DIR)/libACTK1_3_2.so: $(objs)
$(CXX) $(LDFLAGS) $(SHARED_CXXFLAGS) -shared $^ -o $@ $(CXX) $(LDFLAGS) $(SHARED_CXXFLAGS) -shared $^ -o $@
doc: doc:
doxygen etc/Doxyfile doxygen etc/Doxyfile
clean: clean:
$(RM) $(objs) $(BUILD_LIB_DIR)/libAusRegEPPTK.so *~ $(RM) $(objs) $(BUILD_LIB_DIR)/libACTK1_3_2.so *~
$(RM) -r $(BUILD_OBJ_DIR) $(RM) -r $(BUILD_OBJ_DIR)
$(RM) -r $(BUILD_LIB_DIR) $(RM) -r $(BUILD_LIB_DIR)

View File

@ -6,11 +6,11 @@ CC=g++
Cc=gcc Cc=gcc
BOSTLIB=-L/usr/lib/boost BOSTLIB=-L/usr/lib/boost
BOSINCL=-L/usr/include/boost BOSINCL=-I/usr/include/boost
LOG4LIB=-L/usr/lib LOG4LIB=-L/usr/lib
ifeq ($(LOCATION),authoring) ifeq ($(LOCATION),authoring)
ARTKLIB=-L/home/jdaugherty/clients/reg.de/git/ACTK1_3_2/build ARTKLIB=-L/home/jdaugherty/clients/reg.de/git/ACTK1_3_2/lib
ARTKINCL=-I/home/jdaugherty/clients/reg.de/git/ACTK1_3_2/common ARTKINCL=-I/home/jdaugherty/clients/reg.de/git/ACTK1_3_2/common
endif endif
@ -19,7 +19,7 @@ ifeq ($(LOCATION),testing)
ARTKINCL=I/home/drde/git/ACTK1_3_2/common ARTKINCL=I/home/drde/git/ACTK1_3_2/common
endif endif
SLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) -l boost_system -l boost_thread -l log4cpp SLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) $(ARTKLIB) -l boost_system -l boost_thread -l log4cpp
ifeq ($(LOCATION),authoring) ifeq ($(LOCATION),authoring)
SINCL= -I include -I /usr/include/log4cpp $(BOSINCL) SINCL= -I include -I /usr/include/log4cpp $(BOSINCL)
@ -40,7 +40,14 @@ CLFLAGS= -Wall -Wundef -Wpointer-arith -Wshadow \
-Wstrict-prototypes -Waggregate-return -Wno-implicit -Wstrict-prototypes -Waggregate-return -Wno-implicit
ACOBJS= build/cliever.o build/mdLogger.o build/masterDaemonConfig.o build/masterDaemon.o \ ACOBJS= build/cliever.o build/mdLogger.o build/masterDaemonConfig.o build/masterDaemon.o \
build/mdHost.o build/mdState.o build/mdAusReg.o build/mdHost.o build/mdState.o
ARTKDEPS = -L$(BUILD_LIB_DIR) -lACTK1_3_2 \
-L$(XALAN_LIB_DIR) -lxalan-c -lxalanMsg\
-L$(XERCES_LIB_DIR) -lxerces-c \
-lssl \
-lrt
# --- targets # --- targets
# #
@ -76,7 +83,7 @@ build/mdAusReg.o: server/mdAusReg.cpp include/*.h
$(CC) $(CFLAGS) server/mdAusReg.cpp -c -o build/mdAusReg.o $(SINCL) $(ARTKINCL) $(CC) $(CFLAGS) server/mdAusReg.cpp -c -o build/mdAusReg.o $(SINCL) $(ARTKINCL)
build/drde-cliever: $(ACOBJS) build/drde-cliever: $(ACOBJS)
$(CC) $(CFLAGS) -o build/drde-cliever $(SINCL) $(LIBS) $(ACOBJS) $(SLIBS) $(CC) $(CFLAGS) -o build/drde-cliever $(SINCL) $(LIBS) $(ACOBJS) $(SLIBS) $(ARTKDEPS)
doxygen/index.html: etc/doxygen.config doxygen/index.html: etc/doxygen.config
doxygen etc/doxygen.config doxygen etc/doxygen.config

View File

@ -5,8 +5,7 @@
class ausRegPeer { class ausRegPeer {
bool gotIt(std::string propertiesFilePath);
Init acTkInit;
}; };

View File

@ -3,7 +3,7 @@
#include <cstdlib> #include <cstdlib>
#include <iostream> #include <iostream>
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/statechart/event.hpp> #include <boost/statechart/event.hpp>
#include <boost/statechart/state_machine.hpp> #include <boost/statechart/state_machine.hpp>
#include <boost/statechart/simple_state.hpp> #include <boost/statechart/simple_state.hpp>

View File

@ -28,7 +28,8 @@ public:
ClientsByHandle allClients; ClientsByHandle allClients;
PeersByHandle allEPPPeers; PeersByHandle allEPPPeers;
// date epoch(MD_EPOCH); //date epoch(MD_EPOCH);
int debugThreshold,nClients,nClievers, int debugThreshold,nClients,nClievers,
servicePort,thisMachineContext, servicePort,thisMachineContext,
clientPort; clientPort;
@ -40,7 +41,6 @@ public:
int loadMachineConfiguration(int machineClass); int loadMachineConfiguration(int machineClass);
}; };
#endif #endif

View File

@ -5,8 +5,7 @@
* General abstraction of all MD clients * General abstraction of all MD clients
* *
* For historical reasons all clients are considered to be * For historical reasons all clients are considered to be
* devices, though mdclient and US clients have a non-device * devices. The central device of the system has zero
* client type. The central device of the system has zero
* device type. * device type.
* *
*/ */
@ -19,15 +18,15 @@ class mdHost {
public: public:
bool isSingleton; bool isSingleton;
int clieverGroup, // masterDaemonConfig.thisMachineContext int clieverGroup, // masterDaemonConfig.thisMachineContext
handle,mdStdDevIdx; handle,mdStdDevIdx;
md_device type; md_device type;
mdState state; mdState state;
udp::endpoint ip; udp::endpoint ip;
// Only Machine and Instrument use below // Superset of the RFC speced
InstructionSet cmds; InstructionSet cmds;
// Some parameters initially here are now all uniformly ODEs // Some parameters initially here are now all uniformly ODEs
// defined in the COOL scripts. // defined in the COOL scripts.
@ -66,7 +65,6 @@ public:
mdPeer() : mdHost<mdPeer>( MDDEV_PEER ) mdPeer() : mdHost<mdPeer>( MDDEV_PEER )
{ {
//rrj cmds["RST"] = new mdCommand(MD_SCPI,std::string("RST"));
cmds["RST"] = new mdCommand((md_mand)0,std::string("RST")); cmds["RST"] = new mdCommand((md_mand)0,std::string("RST"));
} }
mdPeer *validateClient(int handle, const mdClientBirth &c, mdResponse &r); mdPeer *validateClient(int handle, const mdClientBirth &c, mdResponse &r);

View File

@ -74,7 +74,7 @@ using boost::asio::ip::udp;
#define MD_NAME CLIEVER_APP " " MD_COMPONENT #define MD_NAME CLIEVER_APP " " MD_COMPONENT
#define MD_VERSION " 1.0 " // Version #define MD_VERSION " 1.0 " // Version
#define MD_REFRESH 10 // default milliseconds between API frame updates #define MD_REFRESH 10 // default milliseconds between API frame updates
#define MD_TYPE "EPPCLIENT" #define MD_TYPE "EPPPEER"
#define NORMAL_DEBUG 10 #define NORMAL_DEBUG 10
#ifndef CURRENT_DEBUG #ifndef CURRENT_DEBUG
#define CURRENT_DEBUG NORMAL_DEBUG #define CURRENT_DEBUG NORMAL_DEBUG
@ -260,17 +260,14 @@ struct MD_CONTROL_BLOCK
typedef std::map<int,mdCB*> mdStdDevicePODMap; // MD Standard Device Map - typedef std::map<int,mdCB*> mdStdDevicePODMap; // MD Standard Device Map -
/* /*
*\brief stdDev: collection with MD at: 0, CD in: 1 - MAX_CLIEVER, *\brief stdDev: collection with MD at: 0, CD in: 1 to MAX_CLIEVER,
* MACHINEs in: MAX_CLIEVER+1 - MAX_CLIEVER*2, * PEERS in: MAX_CLIEVER + 1 to - MAX_CLIEVER+1+MAX_PEER,
* Servers in: (MAX_CLIEVER*2)+1 - (((MAX_CLIEVER*2)+1)+(MAX_CLIEVER*MAX_INSTRUMENTS)),
* Clients in: (MAX_CLIEVER*MAX_INSTRUMENTS)+1 - MAX_CLIENT
* localhost at: MAX_CLIENT+1
* *
* The mdStdDevIdx of a device is its index above. * The mdStdDevIdx of a device is its index above.
* Within intervals clients are assigned compactly in the same order as thier handles are created and assigned. * Within intervals clients are assigned compactly in the same order as thier handles are created and assigned.
*/ */
#if (defined(MD_MAIN) || defined(CD_MAIN) || defined(DV_DLL_MAIN)) #if (defined(MD_MAIN) || defined(CD_MAIN) )
mdStdDevicePODMap cb; mdStdDevicePODMap cb;
int myStdDevIdx=MAX_CLIENTS+1; // global default to localhost int myStdDevIdx=MAX_CLIENTS+1; // global default to localhost
#else #else
@ -369,7 +366,7 @@ class mdDGChannel
bool connect_to (boost::asio::ip::udp::endpoint &ep,boost::system::error_code &ec,int &step,int stdDevIdx=-1) bool connect_to (boost::asio::ip::udp::endpoint &ep,boost::system::error_code &ec,int &step,int stdDevIdx=-1)
{ {
bool value = false; bool value = false;
stdDevIdx = stdDevIdx == -1 ? mdStdDevIdx : stdDevIdx; stdDevIdx = stdDevIdx == -1 ? mdStdDevIdx : stdDevIdx;
map<int,mdCB *>::iterator iter = cb.find(stdDevIdx); map<int,mdCB *>::iterator iter = cb.find(stdDevIdx);

View File

@ -1,3 +1,22 @@
#include "cliever-md.h" #include "cliever-md.h"
#include "ausRegPeer.h" #include "ausRegPeer.h"
bool ausRegPeer::gotIt(std::string propPath) {
bool did=false;
try {
init(propPath);
did = true;
}
catch(std::exception &e) {
}
return did;
}

View File

@ -20,15 +20,15 @@ using namespace log4cpp;
void mdLogger::init() { void mdLogger::init() {
const char *mainLogFileName = "auc-md.log", const char *mainLogFileName = "drde-cliever.log",
*xmlrpcLogFileName = "auc-xmlrpc.log"; *actkLogFileName = "actk1_3_2.log";
logPath = new char [strlen(thisConfig->logPath) + logPath = new char [strlen(thisConfig->logPath) +
strlen(xmlrpcLogFileName) + 2]; strlen(actkLogFileName) + 2];
strcpy(logPath,thisConfig->logPath); strcpy(logPath,thisConfig->logPath);
strcat(logPath,"/"); strcat(logPath,"/");
strcat(logPath,xmlrpcLogFileName); strcat(logPath,actkLogFileName);
thisConfig->xmlrpcLogpath = logPath; thisConfig->xmlrpcLogpath = logPath;

View File

@ -8,15 +8,15 @@ CXX = g++
CC = gcc CC = gcc
#SHARED_CXXFLAGS += -O2 #SHARED_CXXFLAGS += -O2
SHARED_CXXFLAGS += -g SHARED_CXXFLAGS += -g
CXXFLAGS = $(SHARED_CXXFLAGS) -Wall -Wpointer-arith -Wcast-qual -D_REENTRANT -fPIC CXXFLAGS = $(SHARED_CXXFLAGS) -Wall -Wpointer-arith -Wcast-qual -D_REENTRANT -fPIC
CPPFLAGS = -fPIC -D_GNU_SOURCE CPPFLAGS = -fPIC -D_GNU_SOURCE
CXXFLAGS += -D_GNU_SOURCE -O0 CXXFLAGS += -D_GNU_SOURCE -O0
#XERCES_HOME = /usr/local/xerces-c-src_2_7_0 #XERCES_HOME = /usr/local/xerces-c-src_2_7_0
#XERCES_LIB_DIR = ${XERCES_HOME}/lib #XERCES_LIB_DIR = ${XERCES_HOME}/lib
#XERCES_LIB = xerces-c2_7_0 #XERCES_LIB = xerces-c2_7_0
#XALAN_HOME = /usr/local/xalan-c_1_10_0 #XALAN_HOME = /usr/local/xalan-c_1_10_0
#XALAN_LIB_DIR = $(XALAN_HOME)/lib #XALAN_LIB_DIR = $(XALAN_HOME)/lib
@ -79,7 +79,7 @@ $(BUILD_OBJ_DIR)/%.o: %.c
LDFLAGS_TESTS = -L$(BUILD_LIB_DIR) -lAusRegEPPTK \ LDFLAGS_TESTS = -L$(BUILD_LIB_DIR) -lAusRegEPPTK \
-L$(XALAN_LIB_DIR) -lxalan-c -lxalanMsg\ -L$(XALAN_LIB_DIR) -lxalan-c -lxalanMsg -licuuc -licudata \
-L$(XERCES_LIB_DIR) -lxerces-c \ -L$(XERCES_LIB_DIR) -lxerces-c \
-lssl \ -lssl \
-lrt -lrt