侦察,干扰,指挥,开火构建完毕
This commit is contained in:
@@ -35,7 +35,7 @@ platform_type EW_RADAR WSF_PLATFORM
|
||||
|
||||
comm sub_net RED_DATALINK
|
||||
network_name <local:slave>
|
||||
internal_link task_mgr
|
||||
#internal_link task_mgr
|
||||
end_comm
|
||||
|
||||
# processor task_mgr RED_RADAR_TACTICS
|
||||
|
||||
@@ -74,6 +74,8 @@ processor IADS_CMDR_TASK_MGR WSF_TASK_PROCESSOR
|
||||
script void MakeAssignments()
|
||||
#writeln("MakeAssignments ");
|
||||
Array<WsfPlatform> filter = Array<WsfPlatform>();
|
||||
Array<WsfPlatform> mover = Array<WsfPlatform>();
|
||||
Array<WsfPlatform> waiter = Array<WsfPlatform>();
|
||||
foreach (WsfPlatform sub in PLATFORM.Subordinates())
|
||||
{
|
||||
#writeln("is Subordinates");
|
||||
@@ -89,6 +91,16 @@ processor IADS_CMDR_TASK_MGR WSF_TASK_PROCESSOR
|
||||
writeln("*** Adding ", sub.Name(), " to filter");
|
||||
filter.PushBack(sub);
|
||||
}
|
||||
if(WeaponsAvailable(sub) &&
|
||||
!(TRACK.WithinZoneOf(sub, "battalion_sector")))
|
||||
{
|
||||
writeln("*** Adding ", sub.Name(), " to mover");
|
||||
mover.PushBack(sub);
|
||||
}
|
||||
if(!WeaponsAvailable(sub))
|
||||
{
|
||||
waiter.PushBack(sub);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,6 +111,20 @@ processor IADS_CMDR_TASK_MGR WSF_TASK_PROCESSOR
|
||||
writeln("assign fire");
|
||||
AssignTask(TRACK, "ENGAGE", filter[i]);
|
||||
}
|
||||
|
||||
int numMover=(int)(mover.Size());
|
||||
for (int i=0; i < numMover; i = i + 1)
|
||||
{
|
||||
writeln("assign move");
|
||||
AssignTask(TRACK, "MOVE", mover[i]);
|
||||
}
|
||||
|
||||
int numWaiter=(int)(waiter.Size());
|
||||
for (int i=0; i < numWaiter; i = i + 1)
|
||||
{
|
||||
writeln("assign wait");
|
||||
AssignTask(TRACK, "WAIT", waiter[i]);
|
||||
}
|
||||
end_script
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
@@ -108,7 +134,6 @@ processor IADS_CMDR_TASK_MGR WSF_TASK_PROCESSOR
|
||||
state DETECTED
|
||||
next_state ASSIGNED
|
||||
if (! IsAssignable()) return false;
|
||||
|
||||
MakeAssignments();
|
||||
return true;
|
||||
end_next_state
|
||||
|
||||
@@ -22,6 +22,8 @@ platform_type LARGE_SAM_LAUNCHER WSF_PLATFORM
|
||||
internal_link data_mgr
|
||||
internal_link task_mgr
|
||||
end_comm
|
||||
mover WSF_GROUND_MOVER
|
||||
end_mover
|
||||
|
||||
processor data_mgr WSF_TRACK_PROCESSOR
|
||||
purge_interval 60 sec
|
||||
@@ -32,37 +34,34 @@ platform_type LARGE_SAM_LAUNCHER WSF_PLATFORM
|
||||
|
||||
if (aTask.TaskType() == "ENGAGE")
|
||||
{
|
||||
if (!aTrack.Exists())
|
||||
{
|
||||
writeln("[SAM] ");
|
||||
return;
|
||||
}
|
||||
WsfWeapon missile = PLATFORM.Weapon("sam");
|
||||
missile.Fire(aTrack);
|
||||
writeln("fire,remain weapon:", missile.QuantityRemaining());
|
||||
}
|
||||
|
||||
if (!aTrack.WithinZoneOf(PLATFORM, "battalion_sector"))
|
||||
writeln("[SAM] 20nm ");
|
||||
return;
|
||||
end
|
||||
|
||||
--
|
||||
if (PLATFORM.Weapon("sam").QuantityRemaining() <= 0) then
|
||||
writeln("[SAM] ");
|
||||
return;
|
||||
end
|
||||
|
||||
--
|
||||
PLATFORM.Weapon("sam").FireAt(aTrack);
|
||||
writeln("[SAM] : ", aTrack.TargetName());
|
||||
else
|
||||
writeln("[SAM] ", aTask.Type());
|
||||
end
|
||||
end_script
|
||||
if (aTask.TaskType() == "MOVE")
|
||||
{
|
||||
if(!aTrack.WithinZoneOf(PLATFORM,"battalion_sector"))
|
||||
{
|
||||
double relativeAzimuthOf=
|
||||
PLATFORM.RelativeAzimuthOf(aTrack.CurrentLocation());
|
||||
PLATFORM.TurnToRelativeHeading(relativeAzimuthOf);
|
||||
PLATFORM.GoToSpeed(16);#m/s
|
||||
|
||||
}
|
||||
}
|
||||
if (aTask.TaskType() == "WAIT")
|
||||
{
|
||||
PLATFORM.GoToSpeed(0);#m/s
|
||||
}
|
||||
|
||||
|
||||
end_script
|
||||
|
||||
|
||||
end_processor
|
||||
|
||||
weapon sam LARGE_SAM
|
||||
quantity 4
|
||||
quantity 10
|
||||
end_weapon
|
||||
|
||||
zone battalion_sector
|
||||
|
||||
@@ -29,6 +29,8 @@ platform_type RADAR_APACHE WSF_PLATFORM
|
||||
network_name <local:slave>
|
||||
#internal_link task_mgr
|
||||
end_comm
|
||||
|
||||
|
||||
|
||||
# processor task_mgr RED_RADAR_TACTICS
|
||||
# end_processor
|
||||
|
||||
Reference in New Issue
Block a user