diff --git a/share/trick/sim_objects/default_trick_sys.sm b/share/trick/sim_objects/default_trick_sys.sm index 39ec7a383..ac1f04716 100644 --- a/share/trick/sim_objects/default_trick_sys.sm +++ b/share/trick/sim_objects/default_trick_sys.sm @@ -466,7 +466,9 @@ class VariableServerSimObject : public Trick::SimObject { // Call variable server initialization for normal sims, // monte carlo slave sim children, and the monte carlo master. // monte carlo slave parents do not reach initialization. - {TRK} P0 ("initialization") trick_ret = vs.init() ; + // Note: schedule this after MonteCarlo::execute_monte (which is P1) + // so Monte Carlo slave parents do not reach initialization. + {TRK} P2 ("initialization") trick_ret = vs.init() ; #ifndef TRICK_NO_MONTE_CARLO {TRK} ("monte_master_init") trick_ret = vs.init() ; @@ -514,7 +516,10 @@ class JSONVariableServerSimObject : public Trick::SimObject { JSONVariableServerSimObject() { {TRK} ("default_data") vs.init_listen_device() ; - {TRK} P0 ("initialization") trick_ret = vs.init() ; + // Schedule JSON VS initialization after MonteCarlo::execute_monte (P1) + // to be consistent with VariableServerSimObject so that Monte Carlo + // slave parents do not reach initialization if Monte Carlo is enabled. + {TRK} P2 ("initialization") trick_ret = vs.init() ; {TRK} ("restart") vs.restart(); {TRK} ("shutdown") vs.cancel_thread() ; diff --git a/trick_source/trick_utils/comm/test_programs/dr_client.c b/trick_source/trick_utils/comm/test_programs/dr_client.c index 8ed307d29..2845adffb 100644 --- a/trick_source/trick_utils/comm/test_programs/dr_client.c +++ b/trick_source/trick_utils/comm/test_programs/dr_client.c @@ -17,7 +17,7 @@ * */ -#include "../include/tc_proto.h" +#include "trick/tc_proto.h" #define MAX_FILES 128 typedef struct { diff --git a/trick_source/trick_utils/comm/test_programs/makefile b/trick_source/trick_utils/comm/test_programs/makefile index f1739a412..745e753fa 100644 --- a/trick_source/trick_utils/comm/test_programs/makefile +++ b/trick_source/trick_utils/comm/test_programs/makefile @@ -9,7 +9,8 @@ # Date: 6/19/00 ##################################################################### --include ${TRICK_HOME}/makefiles/Makefile.common +include ${TRICK_HOME}/share/trick/makefiles/Makefile.common +include ${TRICK_HOME}/share/trick/makefiles/Makefile.tricklib ifndef TRICK_HOST_CPU TRICK_HOST_CPU := $(shell trick-gte TRICK_HOST_CPU) @@ -21,7 +22,8 @@ endif CC = cc -FLAGS = +# Default include paths for test builds (can be overridden by environment) +FLAGS ?= -I${TRICK_HOME}/trick_source -I${TRICK_HOME}/include ifeq ($(TRICK_HOST_TYPE), Darwin) LIBS = else @@ -36,10 +38,8 @@ endif ## UTILITY DEFINITIONS ## ##################################################################### -LIB_DIR = ../object_$(shell uname -s) -COMM_LIB = ${LIB_DIR}/libtrick_comm.a -STUBS_LIB = ${LIB_DIR}/libtrick_stubs.a -LIBTC_LIB = $(COMM_LIB) $(STUBS_LIB) -lpthread ${LIBS} +COMM_LIB = ${TRICK_LIB_DIR}/libtrick_comm.a +LIBTC_LIB = $(COMM_LIB) -lpthread ${LIBS} ##################################################################### @@ -62,9 +62,9 @@ TEST_PRGMS = \ default: @ if [ "${TRICK_HOME}" != "" ] ; then \ if [ "`uname -s`" = "SunOS" ] ; then \ - make -e test "FLAGS=-I${TRICK_HOME}/trick_source -I../include" "LIBS=-lsocket -lnsl" ; \ + make -e test "FLAGS=$(FLAGS)" "LIBS=-lsocket -lnsl" ; \ else \ - make -e test "FLAGS=-I${TRICK_HOME}/trick_source -I../include" "LIBS=${LIBS}" ; \ + make -e test "FLAGS=$(FLAGS)" "LIBS=${LIBS}" ; \ fi \ else \ if [ "`uname -s`" = "SunOS" ] ; then \ @@ -105,19 +105,11 @@ $(OBJ_DIR)/dr_client: dr_client.c $(CC) $(FLAGS) -o $@ ${@F}.c $(LIBTC_LIB) $(COMM_LIB): - @ cd .. ; make STAND_ALONE=1 trick_comm - -$(STUBS_LIB): - @ cd .. ; make STAND_ALONE=1 trick_stubs_lib - + @echo "Building parent comm library: invoking parent 'trick' target..." + @cd .. && $(MAKE) trick $(OBJ_DIR)/dr_client: $(COMM_LIB) -$(OBJ_DIR)/dr_client: $(STUBS_LIB) $(OBJ_DIR)/tc_server: $(COMM_LIB) -$(OBJ_DIR)/tc_server: $(STUBS_LIB) $(OBJ_DIR)/tc_client: $(COMM_LIB) -$(OBJ_DIR)/tc_client: $(STUBS_LIB) $(OBJ_DIR)/tc_multi_serv_example: $(COMM_LIB) $(OBJ_DIR)/tc_multi_client_example: $(COMM_LIB) -$(OBJ_DIR)/tc_multi_serv_example: $(STUBS_LIB) -$(OBJ_DIR)/tc_multi_client_example: $(STUBS_LIB) diff --git a/trick_source/trick_utils/comm/test_programs/tc_client.c b/trick_source/trick_utils/comm/test_programs/tc_client.c index 54104c661..648426528 100644 --- a/trick_source/trick_utils/comm/test_programs/tc_client.c +++ b/trick_source/trick_utils/comm/test_programs/tc_client.c @@ -1,5 +1,4 @@ - -#include "../include/tc_proto.h" +#include "trick/tc_proto.h" int main( int narg, char** args ) { diff --git a/trick_source/trick_utils/comm/test_programs/tc_multi_client_example.c b/trick_source/trick_utils/comm/test_programs/tc_multi_client_example.c index a6a1b0af2..c6a7a8030 100644 --- a/trick_source/trick_utils/comm/test_programs/tc_multi_client_example.c +++ b/trick_source/trick_utils/comm/test_programs/tc_multi_client_example.c @@ -4,9 +4,10 @@ * This program uses trickcomm "tc" routines to create a client that * connects to a server and writes and reads 10 messages. */ +#include "trick/tc_proto.h" -#include "../include/tc_proto.h" -#include +#include +#include void sigint_hndlr( int sig ); void stupid( int sig ); diff --git a/trick_source/trick_utils/comm/test_programs/tc_multi_serv_example.c b/trick_source/trick_utils/comm/test_programs/tc_multi_serv_example.c index 10b81545a..26c9d5f01 100644 --- a/trick_source/trick_utils/comm/test_programs/tc_multi_serv_example.c +++ b/trick_source/trick_utils/comm/test_programs/tc_multi_serv_example.c @@ -5,10 +5,12 @@ * connects to a server and writes and reads 10 messages. */ +#include "trick/bitfield_proto.h" +#include "trick/tc_proto.h" -#include "../include/attributes.h" -#include "../include/tc_proto.h" -#include +#include +#include +#include void sigint_hndlr( int sig ); @@ -45,63 +47,78 @@ typedef struct { ATTRIBUTES attrBUFFER[] = { { "i1", "int", "--", "", "Not Specified", + "", 3,5,sizeof(int),0,0,Language_C,0, 0,(char*)0, 0 } , { "s1", "short", "--", "", "Not Specified", + "", 3,3,sizeof(short),0,0,Language_C,0, 0,(char*)0, 0 } , { "s2", "short", "--", "", "Not Specified", + "", 3,3,sizeof(short),0,0,Language_C,0, 0,(char*)0, 0 } , { "c1", "char", "--", "", "Not Specified", + "", 3,0,sizeof(char),0,0,Language_C,0, 0,(char*)0, 0 } , { "c2", "char", "--", "", "Not Specified", + "", 3,0,sizeof(char),0,0,Language_C,0, 0,(char*)0, 0 } , { "c3", "char", "--", "", "Not Specified", + "", 3,0,sizeof(char),0,0,Language_C,0, 0,(char*)0, 0 } , { "c4", "char", "--", "", "Not Specified", + "", 3,0,sizeof(char),0,0,Language_C,0, 0,(char*)0, 0 } , { "f1", "float", "--", "", "Not Specified", + "", 3,9,sizeof(float),0,0,Language_C,0, 0,(char*)0, 0 } , { "b1", "int", "--", "", "Not Specified", - 3,11,0,0,0,Language_C,0, + "", + 3,11,0,0,0,Language_C,0, 0,(char*)0, 0,{{5,27}} } , { "b2", "int", "--", "", "Not Specified", - 3,11,0,0,0,Language_C,0, + "", + 3,11,0,0,0,Language_C,0, 0,(char*)0, 0,{{4,23}} } , { "b3", "int", "--", "", "Not Specified", - 3,11,0,0,0,Language_C,0, + "", + 3,11,0,0,0,Language_C,0, 0,(char*)0, 0,{{7,16}} } , { "b4", "int", "--", "", "Not Specified", - 3,11,0,0,0,Language_C,0, + "", + 3,11,0,0,0,Language_C,0, 0,(char*)0, 0,{{13,3}} } , { "b5", "int", "--", "", "Not Specified", - 3,11,0,0,0,Language_C,0, + "", + 3,11,0,0,0,Language_C,0, 0,(char*)0, 0,{{3,0}} } , { "i2", "int", "--", "", "Not Specified", - 3,5,sizeof(int),0,0,Language_C,0, + "", + 3,5,sizeof(int),0,0,Language_C,0, 0,(char*)0, 0 } , { "d1", "double", "--", "", "Not Specified", - 3,10,sizeof(double),0,0,Language_C,0, + "", + 3,10,sizeof(double),0,0,Language_C,0, 0,(char*)0, 0 } , { "" } } ; @@ -140,7 +157,7 @@ void *continuous_connect(void *in) { TCDevice* temp_device ; int status ; -fprintf(stderr,"Starting continuous_connect %d\n", pthread_self()); +fprintf(stderr,"Starting continuous_connect %lu\n", (unsigned long)pthread_self()); /* continuously look for and connect to new clients */ while (1) { temp_device = malloc(sizeof(TCDevice)); diff --git a/trick_source/trick_utils/comm/test_programs/tc_server.c b/trick_source/trick_utils/comm/test_programs/tc_server.c index ba96cbaa3..a18e7a3a6 100644 --- a/trick_source/trick_utils/comm/test_programs/tc_server.c +++ b/trick_source/trick_utils/comm/test_programs/tc_server.c @@ -1,5 +1,5 @@ +#include "trick/tc_proto.h" -#include "../include/tc_proto.h" #ifndef __WIN32__ #include #endif