From cebfc174ae43e8b0e0a0709860f83f408277bfad Mon Sep 17 00:00:00 2001 From: "Penn, John M 047828115" Date: Wed, 24 Apr 2019 18:29:50 -0500 Subject: [PATCH] Don't compile and link HTTP server by default Ref #756 --- trick_sims/Cannon/SIM_cannon_numeric/S_define | 22 ++++--------------- .../Cannon/SIM_cannon_numeric/S_overrides.mk | 7 +++--- .../mongoose_httpd/include/http_server.h | 2 ++ .../models/mongoose_httpd/mongoose_httpd.sm | 21 ++++++++++++++++++ 4 files changed, 30 insertions(+), 22 deletions(-) create mode 100644 trick_sims/Cannon/models/mongoose_httpd/mongoose_httpd.sm diff --git a/trick_sims/Cannon/SIM_cannon_numeric/S_define b/trick_sims/Cannon/SIM_cannon_numeric/S_define index 54566b93..d7852fa7 100644 --- a/trick_sims/Cannon/SIM_cannon_numeric/S_define +++ b/trick_sims/Cannon/SIM_cannon_numeric/S_define @@ -5,26 +5,15 @@ LIBRARY DEPENDENCIES: ( (cannon/gravity/src/cannon_init.c) (cannon/gravity/src/cannon_numeric.c) - (mongoose_httpd/src/http_server.cpp) ) *************************************************************/ #include "sim_objects/default_trick_sys.sm" + +// Uncomment to get a webserver. Also uncomment lines in S_overrise.mk to link in mongoose lib. +// #include "mongoose_httpd/mongoose_httpd.sm" + ##include "cannon/gravity/include/cannon_numeric.h" -##include "mongoose_httpd/include/http_server.h" - -class HttpSimObject : public Trick::SimObject { - - public: - HTTP_Server http_server ; - - HttpSimObject() { - ("default_data") http_default_data( &http_server ) ; - ("initialization") http_init( &http_server ) ; - ("shutdown") http_shutdown( &http_server ) ; - } -} ; - class CannonSimObject : public Trick::SimObject { public: @@ -38,10 +27,7 @@ class CannonSimObject : public Trick::SimObject { ("dynamic_event") cannon_impact( &cannon) ; } } ; - -// Instantiations CannonSimObject dyn ; -HttpSimObject http ; IntegLoop dyn_integloop (0.01) dyn; diff --git a/trick_sims/Cannon/SIM_cannon_numeric/S_overrides.mk b/trick_sims/Cannon/SIM_cannon_numeric/S_overrides.mk index 3a3073fb..0eae513e 100644 --- a/trick_sims/Cannon/SIM_cannon_numeric/S_overrides.mk +++ b/trick_sims/Cannon/SIM_cannon_numeric/S_overrides.mk @@ -1,7 +1,6 @@ - -TRICK_CFLAGS += -I/usr/include -I../models -TRICK_CXXFLAGS += -I/usr/include -I../models +TRICK_CFLAGS += -I../models +TRICK_CXXFLAGS += -I../models +TRICK_SFLAGS += -I../models TRICK_LDFLAGS += -L/usr/local/lib TRICK_USER_LINK_LIBS += -lmongoose - diff --git a/trick_sims/Cannon/models/mongoose_httpd/include/http_server.h b/trick_sims/Cannon/models/mongoose_httpd/include/http_server.h index 90efbeca..06fd3aae 100644 --- a/trick_sims/Cannon/models/mongoose_httpd/include/http_server.h +++ b/trick_sims/Cannon/models/mongoose_httpd/include/http_server.h @@ -1,5 +1,7 @@ /************************************************************************* PURPOSE: (Represent the state and initial conditions of an http server) +LIBRARY DEPENDENCIES: + ( (../src/http_server.cpp)) **************************************************************************/ #ifndef HTTP_SERVER_H #define HTTP_SERVER_H diff --git a/trick_sims/Cannon/models/mongoose_httpd/mongoose_httpd.sm b/trick_sims/Cannon/models/mongoose_httpd/mongoose_httpd.sm new file mode 100644 index 00000000..20ac74c0 --- /dev/null +++ b/trick_sims/Cannon/models/mongoose_httpd/mongoose_httpd.sm @@ -0,0 +1,21 @@ +/************************TRICK HEADER************************* +PURPOSE: + (HTTP Server) +LIBRARY DEPENDENCIES: + ((src/http_server.cpp)) +*************************************************************/ +##include "mongoose_httpd/include/http_server.h" + +class HttpSimObject : public Trick::SimObject { + + public: + HTTP_Server http_server ; + + HttpSimObject() { + ("default_data") http_default_data( &http_server ) ; + ("initialization") http_init( &http_server ) ; + ("shutdown") http_shutdown( &http_server ) ; + } +}; + +HttpSimObject http ;