diff --git a/test/SIM_gui_testing/.gitignore b/test/SIM_gui_testing/.gitignore new file mode 100644 index 00000000..9c30115d --- /dev/null +++ b/test/SIM_gui_testing/.gitignore @@ -0,0 +1 @@ +socket_info \ No newline at end of file diff --git a/test/SIM_gui_testing/Modified_Data/realtime.py b/test/SIM_gui_testing/Modified_Data/realtime.py new file mode 100644 index 00000000..feaab455 --- /dev/null +++ b/test/SIM_gui_testing/Modified_Data/realtime.py @@ -0,0 +1,7 @@ + +trick.real_time_enable() +trick.exec_set_software_frame(0.1) +trick.itimer_enable() + +trick.exec_set_enable_freeze(True) +trick.exec_set_freeze_command(True) \ No newline at end of file diff --git a/test/SIM_gui_testing/RUN_test/input.py b/test/SIM_gui_testing/RUN_test/input.py new file mode 100644 index 00000000..fe605265 --- /dev/null +++ b/test/SIM_gui_testing/RUN_test/input.py @@ -0,0 +1,10 @@ +exec(open("./Modified_Data/realtime.py").read()) + +# Save the Connection Info to a file +host = trick.var_server_get_hostname() +port = trick.var_server_get_port() + +f = open("socket_info", "w") +f.write(str(host) + ":" + str(port)) +f.close() + diff --git a/test/SIM_gui_testing/RUN_test/input_gui.py b/test/SIM_gui_testing/RUN_test/input_gui.py new file mode 100644 index 00000000..dad2d584 --- /dev/null +++ b/test/SIM_gui_testing/RUN_test/input_gui.py @@ -0,0 +1,6 @@ +exec(open("./Modified_Data/realtime.py").read()) + +# Open the SimControlPanel +simControlPanel = trick.SimControlPanel() +trick.add_external_application(simControlPanel) + diff --git a/test/SIM_gui_testing/S_define b/test/SIM_gui_testing/S_define new file mode 100644 index 00000000..8e374f13 --- /dev/null +++ b/test/SIM_gui_testing/S_define @@ -0,0 +1,27 @@ +/************************************************************ +PURPOSE: + ( Provide a basic simulation for testing GUI ) +LIBRARY DEPENDENCIES: + ((Basic/src/Basic.cc)) +*************************************************************/ +#include "sim_objects/default_trick_sys.sm" +##include "Basic/include/Basic.hh" + +class BasicSimObject : public Trick::SimObject { + public: + Basic basic; + + BasicSimObject() { + ("default_data") basic.default_data() ; + ("initialization") basic.state_init() ; + (0.1, "scheduled") basic.state_increment() ; + ("integration") trick_ret = basic.state_integ() ; + } +}; + +BasicSimObject dyn; +IntegLoop dyn_integloop(0.1) dyn; + +void create_connections() { + dyn_integloop.getIntegrator(Runge_Kutta_4, 4); +} \ No newline at end of file diff --git a/test/SIM_gui_testing/S_overrides.mk b/test/SIM_gui_testing/S_overrides.mk new file mode 100644 index 00000000..1b84a37b --- /dev/null +++ b/test/SIM_gui_testing/S_overrides.mk @@ -0,0 +1,2 @@ +TRICK_CFLAGS += -Imodels +TRICK_CXXFLAGS += -Imodels \ No newline at end of file diff --git a/test/SIM_gui_testing/models/Basic/include/Basic.hh b/test/SIM_gui_testing/models/Basic/include/Basic.hh new file mode 100644 index 00000000..cc870a44 --- /dev/null +++ b/test/SIM_gui_testing/models/Basic/include/Basic.hh @@ -0,0 +1,20 @@ +/************************************************************************ +PURPOSE: (Provide a basic simulation for testing GUI) +LIBRARY DEPENDENCIES: + ((Basic/src/Basic.o)) +**************************************************************************/ + +#ifndef BASIC_HH +#define BASIC_HH + +class Basic { + public: + int counter; /* -- Just a counter variable */ + + int default_data(); + int state_init(); + int state_increment(); + int state_integ(); +}; + +#endif \ No newline at end of file diff --git a/test/SIM_gui_testing/models/Basic/src/Basic.cc b/test/SIM_gui_testing/models/Basic/src/Basic.cc new file mode 100644 index 00000000..0985c714 --- /dev/null +++ b/test/SIM_gui_testing/models/Basic/src/Basic.cc @@ -0,0 +1,26 @@ +/************************************************************************ +PURPOSE: (Provide a basic simulation for testing GUI) +LIBRARY DEPENDENCIES: + ((Basic.o)) +**************************************************************************/ + +#include "Basic/include/Basic.hh" + +int Basic::default_data() { + counter = 0; + return 0; +} + +int Basic::state_init() { + counter = 0; + return 0; +} + +int Basic::state_increment() { + counter += 1; + return 0; +} + +int Basic::state_integ() { + return 0; +} \ No newline at end of file