Files
lab1/processors/ripr_agents/aiai/behavior_draw_target.txt
2025-09-12 15:20:28 +08:00

48 lines
1.2 KiB
Plaintext

# ****************************************************************************
# CUI
#
# The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
#
# The use, dissemination or disclosure of data in this file is subject to
# limitation or restriction. See accompanying README and LICENSE for details.
# ****************************************************************************
behavior draw_target
script_variables
WsfDraw draw = WsfDraw();
end_script_variables
on_init
draw.SetLineSize(2);
draw.SetColor(1.0, 0.0, 1.0); //purple
end_on_init
precondition
writeln("precondition draw_target");
WsfTrack targetTrack = PROCESSOR.GetTarget();
if (targetTrack.IsNull() || !targetTrack.IsValid())
{
writeln_d("target not valid for executing draw_target");
return false;
}
draw.SetDuration(PROCESSOR.UpdateInterval());
return true;
end_precondition
execute
writeln("executing draw_target");
WsfTrack targetTrack = PROCESSOR.GetTarget();
draw.BeginLines();
draw.Vertex(PLATFORM.Location());
draw.Vertex(targetTrack.CurrentLocation());
draw.End();
end_execute
end_behavior