mirror of
https://github.com/nasa/trick.git
synced 2024-12-19 05:07:54 +00:00
0c84b8ad08
Moved SIM_events, test_dp, test_dr, and abstract. refs #191
110 lines
6.2 KiB
Python
110 lines
6.2 KiB
Python
|
|
''' Ensure variable is defined '''
|
|
try:
|
|
DR_GROUP_ID
|
|
except NameError:
|
|
def initialize_globals():
|
|
global DR_GROUP_ID # Create global variable when not defined
|
|
global drg # Create a data recording group variable
|
|
DR_GROUP_ID = 0
|
|
drg = [] # Initialize variable as an empty array
|
|
initialize_globals()
|
|
|
|
|
|
"""
|
|
Default Data Recording Template.
|
|
"""
|
|
def add_dr_group():
|
|
global DR_GROUP_ID
|
|
global drg
|
|
group_name = "group4"
|
|
drg.append( trick.DRBinary(group_name) )
|
|
drg[DR_GROUP_ID].set_freq(trick.sim_services.DR_Always)
|
|
drg[DR_GROUP_ID].enable()
|
|
drg[DR_GROUP_ID].set_cycle(0.4)
|
|
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[0][0].s1[0][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[0][0].s1[0][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[1][0].s1[0][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[1][0].s1[0][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[2][0].s1[0][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[2][0].s1[0][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[0][1].s1[0][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[0][1].s1[0][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[1][1].s1[0][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[1][1].s1[0][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[2][1].s1[0][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[2][1].s1[0][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[0][0].s1[1][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[0][0].s1[1][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[1][0].s1[1][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[1][0].s1[1][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[2][0].s1[1][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[2][0].s1[1][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[0][1].s1[1][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[0][1].s1[1][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[1][1].s1[1][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[1][1].s1[1][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[2][1].s1[1][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[2][1].s1[1][0].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[0][0].s1[0][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[0][0].s1[0][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[1][0].s1[0][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[1][0].s1[0][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[2][0].s1[0][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[2][0].s1[0][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[0][1].s1[0][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[0][1].s1[0][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[1][1].s1[0][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[1][1].s1[0][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[2][1].s1[0][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[2][1].s1[0][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[0][0].s1[1][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[0][0].s1[1][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[1][0].s1[1][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[1][0].s1[1][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[2][0].s1[1][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[2][0].s1[1][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[0][1].s1[1][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[0][1].s1[1][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[1][1].s1[1][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[2][1].s1[1][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[2][1].s1[1][1].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[0][0].s1[0][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[0][0].s1[0][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[1][0].s1[0][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[1][0].s1[0][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[2][0].s1[0][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[2][0].s1[0][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[0][1].s1[0][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[0][1].s1[0][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[1][1].s1[0][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[1][1].s1[0][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[2][1].s1[0][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[2][1].s1[0][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[0][0].s1[1][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[0][0].s1[1][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[1][0].s1[1][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[1][0].s1[1][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[2][0].s1[1][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[2][0].s1[1][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[0][1].s1[1][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[0][1].s1[1][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[1][1].s1[1][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[1][1].s1[1][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[0].s2[2][1].s1[1][2].d[2]" )
|
|
drg[DR_GROUP_ID].add_variable("dpx.test.s3[1].s2[2][1].s1[1][2].d[2]" )
|
|
|
|
trick_data_record.drd.add_group( drg[DR_GROUP_ID], trick.DR_Buffer )
|
|
add_dr_group()
|
|
|
|
|
|
"""
|
|
add 1 to DR_GROUP_ID, THIS SETS DR_GROUP_ID UP
|
|
FOR THE NEXT DATA RECORDING FILE
|
|
"""
|
|
def increment_group_id():
|
|
global DR_GROUP_ID
|
|
DR_GROUP_ID += 1
|
|
increment_group_id()
|