Added in a testing sim

This commit is contained in:
Marcus Rockwell 2024-03-13 13:15:59 -05:00
parent 0878f428cc
commit 8d7d309267
8 changed files with 99 additions and 0 deletions

1
test/SIM_gui_testing/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
socket_info

View File

@ -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)

View File

@ -0,0 +1,10 @@
exec(open("./Modified_Data/realtime.py").read())
# Save the Connection Info <host,port> 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()

View File

@ -0,0 +1,6 @@
exec(open("./Modified_Data/realtime.py").read())
# Open the SimControlPanel
simControlPanel = trick.SimControlPanel()
trick.add_external_application(simControlPanel)

View File

@ -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);
}

View File

@ -0,0 +1,2 @@
TRICK_CFLAGS += -Imodels
TRICK_CXXFLAGS += -Imodels

View File

@ -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

View File

@ -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;
}