mirror of
https://github.com/nasa/trick.git
synced 2025-01-31 00:24:03 +00:00
Added in a testing sim
This commit is contained in:
parent
0878f428cc
commit
8d7d309267
1
test/SIM_gui_testing/.gitignore
vendored
Normal file
1
test/SIM_gui_testing/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
socket_info
|
7
test/SIM_gui_testing/Modified_Data/realtime.py
Normal file
7
test/SIM_gui_testing/Modified_Data/realtime.py
Normal 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)
|
10
test/SIM_gui_testing/RUN_test/input.py
Normal file
10
test/SIM_gui_testing/RUN_test/input.py
Normal 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()
|
||||||
|
|
6
test/SIM_gui_testing/RUN_test/input_gui.py
Normal file
6
test/SIM_gui_testing/RUN_test/input_gui.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
exec(open("./Modified_Data/realtime.py").read())
|
||||||
|
|
||||||
|
# Open the SimControlPanel
|
||||||
|
simControlPanel = trick.SimControlPanel()
|
||||||
|
trick.add_external_application(simControlPanel)
|
||||||
|
|
27
test/SIM_gui_testing/S_define
Normal file
27
test/SIM_gui_testing/S_define
Normal 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);
|
||||||
|
}
|
2
test/SIM_gui_testing/S_overrides.mk
Normal file
2
test/SIM_gui_testing/S_overrides.mk
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
TRICK_CFLAGS += -Imodels
|
||||||
|
TRICK_CXXFLAGS += -Imodels
|
20
test/SIM_gui_testing/models/Basic/include/Basic.hh
Normal file
20
test/SIM_gui_testing/models/Basic/include/Basic.hh
Normal 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
|
26
test/SIM_gui_testing/models/Basic/src/Basic.cc
Normal file
26
test/SIM_gui_testing/models/Basic/src/Basic.cc
Normal 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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user