687 lines
18 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" href="stylesheet.css" type="text/css"/>
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div>
<div id="main">
<div id="navigation">
<h2>Modules</h2>
<ul><li>
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AIBalancer.html">AIBalancer</a></li>
<li><a href="Airbase.html">Airbase</a></li>
<li><a href="AirbasePolice.html">AirbasePolice</a></li>
<li><a href="Base.html">Base</a></li>
<li><a href="CARGO.html">CARGO</a></li>
<li><a href="CleanUp.html">CleanUp</a></li>
<li><a href="Client.html">Client</a></li>
<li><a href="Controllable.html">Controllable</a></li>
<li><a href="DCSAirbase.html">DCSAirbase</a></li>
<li><a href="DCSCoalitionObject.html">DCSCoalitionObject</a></li>
<li><a href="DCSCommand.html">DCSCommand</a></li>
<li><a href="DCSController.html">DCSController</a></li>
<li><a href="DCSGroup.html">DCSGroup</a></li>
<li><a href="DCSObject.html">DCSObject</a></li>
<li><a href="DCSTask.html">DCSTask</a></li>
<li><a href="DCSTypes.html">DCSTypes</a></li>
<li><a href="DCSUnit.html">DCSUnit</a></li>
<li><a href="DCSWorld.html">DCSWorld</a></li>
<li><a href="DCScountry.html">DCScountry</a></li>
<li><a href="DCStimer.html">DCStimer</a></li>
<li><a href="DEPLOYTASK.html">DEPLOYTASK</a></li>
<li><a href="DESTROYBASETASK.html">DESTROYBASETASK</a></li>
<li><a href="DESTROYGROUPSTASK.html">DESTROYGROUPSTASK</a></li>
<li><a href="DESTROYRADARSTASK.html">DESTROYRADARSTASK</a></li>
<li><a href="DESTROYUNITTYPESTASK.html">DESTROYUNITTYPESTASK</a></li>
<li><a href="Database.html">Database</a></li>
<li><a href="Detection.html">Detection</a></li>
<li><a href="Escort.html">Escort</a></li>
<li><a href="Event.html">Event</a></li>
<li><a href="Fac.html">Fac</a></li>
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="Identifiable.html">Identifiable</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="NOTASK.html">NOTASK</a></li>
<li><a href="Object.html">Object</a></li>
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
<li>PatrolZone</li>
<li><a href="Point.html">Point</a></li>
<li><a href="Positionable.html">Positionable</a></li>
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
<li><a href="STAGE.html">STAGE</a></li>
<li><a href="Scheduler.html">Scheduler</a></li>
<li><a href="Scoring.html">Scoring</a></li>
<li><a href="Sead.html">Sead</a></li>
<li><a href="Set.html">Set</a></li>
<li><a href="Spawn.html">Spawn</a></li>
<li><a href="Static.html">Static</a></li>
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="TASK.html">TASK</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
<li><a href="routines.html">routines</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>PatrolZone</code></h1>
<p>This module contains the PATROLZONE class.</p>
<hr/>
<h1>1) <a href="Patrol.html##(PATROLZONE)">Patrol#PATROLZONE</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>The <a href="Patrol.html##(PATROLZONE)">Patrol#PATROLZONE</a> class implements the core functions to patrol a <a href="Zone.html">Zone</a>.</p>
<h2>1.1) PATROLZONE constructor:</h2>
<p><a href="PatrolZone.html##(PATROLZONE).New">PatrolZone#PATROLZONE.New</a>(): Creates a new PATROLZONE object.</p>
<h2>1.2) Modify the PATROLZONE parameters:</h2>
<p>The following methods are available to modify the parameters of a PATROLZONE object:</p>
<pre><code>* &lt;a href="PatrolZone.html##(PATROLZONE).SetGroup"&gt;PatrolZone#PATROLZONE.SetGroup&lt;/a&gt;(): Set the AI Patrol Group.
* &lt;a href="PatrolZone.html##(PATROLZONE).SetSpeed"&gt;PatrolZone#PATROLZONE.SetSpeed&lt;/a&gt;(): Set the patrol speed of the AI, for the next patrol.
* &lt;a href="PatrolZone.html##(PATROLZONE).SetAltitude"&gt;PatrolZone#PATROLZONE.SetAltitude&lt;/a&gt;(): Set altitude of the AI, for the next patrol.
</code></pre>
<h2>1.3) Manage the out of fuel in the PATROLZONE:</h2>
<p>When the PatrolGroup is out of fuel, it is required that a new PatrolGroup is started, before the old PatrolGroup can return to the home base.
Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated.
When the fuel treshold is reached, the PatrolGroup will continue for a given time its patrol task in orbit, while a new PatrolGroup is targetted to the PATROLZONE.
Once the time is finished, the old PatrolGroup will return to the base.
Use the method <a href="PatrolZone.html##(PATROLZONE).ManageFuel">PatrolZone#PATROLZONE.ManageFuel</a>() to have this proces in place.</p>
<hr/>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="#PATROLZONE">PATROLZONE</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#_NewPatrolRoute">_NewPatrolRoute(PatrolGroup)</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(PATROLZONE)">Type <code>PATROLZONE</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).ClassName">PATROLZONE.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).ManageFuel">PATROLZONE:ManageFuel(PatrolFuelTresholdPercentage, PatrolOutOfFuelOrbitTime)</a></td>
<td class="summary">
<p>When the PatrolGroup is out of fuel, it is required that a new PatrolGroup is started, before the old PatrolGroup can return to the home base.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).New">PATROLZONE:New(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed)</a></td>
<td class="summary">
<p>Creates a new PATROLZONE object, taking a <a href="Group.html">Group</a> object as a parameter.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).NewPatrolRoute">PATROLZONE:NewPatrolRoute()</a></td>
<td class="summary">
<p>Defines a new patrol route using the <a href="PatrolZone.html">PatrolZone</a> parameters and settings.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolCeilingAltitude">PATROLZONE.PatrolCeilingAltitude</a></td>
<td class="summary">
<p>The highest altitude in meters where to execute the patrol.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolFloorAltitude">PATROLZONE.PatrolFloorAltitude</a></td>
<td class="summary">
<p>The lowest altitude in meters where to execute the patrol.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolFuelTresholdPercentage">PATROLZONE.PatrolFuelTresholdPercentage</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolGroup">PATROLZONE.PatrolGroup</a></td>
<td class="summary">
<p>The <a href="Group.html">Group</a> patrolling.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolGroupTemplateName">PATROLZONE.PatrolGroupTemplateName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolManageFuel">PATROLZONE.PatrolManageFuel</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolMaxSpeed">PATROLZONE.PatrolMaxSpeed</a></td>
<td class="summary">
<p>The maximum speed of the <a href="Group.html">Group</a> in km/h.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolMinSpeed">PATROLZONE.PatrolMinSpeed</a></td>
<td class="summary">
<p>The minimum speed of the <a href="Group.html">Group</a> in km/h.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolOutOfFuelMonitor">PATROLZONE.PatrolOutOfFuelMonitor</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolOutOfFuelOrbitTime">PATROLZONE.PatrolOutOfFuelOrbitTime</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolZone">PATROLZONE.PatrolZone</a></td>
<td class="summary">
<p>The <a href="Zone.html">Zone</a> where the patrol needs to be executed.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).SetAltitude">PATROLZONE:SetAltitude(PatrolFloorAltitude, PatrolCeilingAltitude)</a></td>
<td class="summary">
<p>Sets the floor and ceiling altitude of the patrol.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).SetGroup">PATROLZONE:SetGroup(PatrolGroup)</a></td>
<td class="summary">
<p>Set the <a href="Group.html">Group</a> to act as the Patroller.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).SetSpeed">PATROLZONE:SetSpeed(PatrolMinSpeed, PatrolMaxSpeed)</a></td>
<td class="summary">
<p>Sets (modifies) the minimum and maximum speed of the patrol.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).SpawnPatrolGroup">PATROLZONE.SpawnPatrolGroup</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2>Global(s)</h2>
<dl class="function">
<dt>
<em><a href="##(PATROLZONE)">#PATROLZONE</a></em>
<a id="PATROLZONE" >
<strong>PATROLZONE</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="_NewPatrolRoute" >
<strong>_NewPatrolRoute(PatrolGroup)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Group.html##(GROUP)">Group#GROUP</a> PatrolGroup </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<h2><a id="#(PatrolZone)" >Type <code>PatrolZone</code></a></h2>
<h2><a id="#(PATROLZONE)" >Type <code>PATROLZONE</code></a></h2>
<p>PATROLZONE class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(PATROLZONE).ClassName" >
<strong>PATROLZONE.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(PATROLZONE).ManageFuel" >
<strong>PATROLZONE:ManageFuel(PatrolFuelTresholdPercentage, PatrolOutOfFuelOrbitTime)</strong>
</a>
</dt>
<dd>
<p>When the PatrolGroup is out of fuel, it is required that a new PatrolGroup is started, before the old PatrolGroup can return to the home base.</p>
<p>Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated.
When the fuel treshold is reached, the PatrolGroup will continue for a given time its patrol task in orbit, while a new PatrolGroup is targetted to the PATROLZONE.
Once the time is finished, the old PatrolGroup will return to the base.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#number PatrolFuelTresholdPercentage </em></code>:
The treshold in percentage (between 0 and 1) when the PatrolGroup is considered to get out of fuel.</p>
</li>
<li>
<p><code><em>#number PatrolOutOfFuelOrbitTime </em></code>:
The amount of seconds the out of fuel PatrolGroup will orbit before returning to the base.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(PATROLZONE)">#PATROLZONE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(PATROLZONE).New" >
<strong>PATROLZONE:New(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed)</strong>
</a>
</dt>
<dd>
<p>Creates a new PATROLZONE object, taking a <a href="Group.html">Group</a> object as a parameter.</p>
<p>The GROUP needs to be alive.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a> PatrolZone </em></code>:
The <a href="Zone.html">Zone</a> where the patrol needs to be executed.</p>
</li>
<li>
<p><code><em><a href="DCSTypes.html##(Altitude)">DCSTypes#Altitude</a> PatrolFloorAltitude </em></code>:
The lowest altitude in meters where to execute the patrol.</p>
</li>
<li>
<p><code><em><a href="DCSTypes.html##(Altitude)">DCSTypes#Altitude</a> PatrolCeilingAltitude </em></code>:
The highest altitude in meters where to execute the patrol.</p>
</li>
<li>
<p><code><em><a href="DCSTypes.html##(Speed)">DCSTypes#Speed</a> PatrolMinSpeed </em></code>:
The minimum speed of the <a href="Group.html">Group</a> in km/h.</p>
</li>
<li>
<p><code><em><a href="DCSTypes.html##(Speed)">DCSTypes#Speed</a> PatrolMaxSpeed </em></code>:
The maximum speed of the <a href="Group.html">Group</a> in km/h.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(PATROLZONE)">#PATROLZONE</a>:</em>
self</p>
<h3>Usage:</h3>
<pre class="example"><code>-- Define a new PATROLZONE Object. This PatrolArea will patrol a group within PatrolZone between 3000 and 6000 meters, with a variying speed between 600 and 900 km/h.
PatrolZone = ZONE:New( 'PatrolZone' )
PatrolGroup = GROUP:FindByName( "Patrol Group" )
PatrolArea = PATROLZONE:New( PatrolGroup, PatrolZone, 3000, 6000, 600, 900 )</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(PATROLZONE).NewPatrolRoute" >
<strong>PATROLZONE:NewPatrolRoute()</strong>
</a>
</dt>
<dd>
<p>Defines a new patrol route using the <a href="PatrolZone.html">PatrolZone</a> parameters and settings.</p>
<h3>Return value</h3>
<p><em><a href="##(PATROLZONE)">#PATROLZONE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="DCSTypes.html##(Altitude)">DCSTypes#Altitude</a></em>
<a id="#(PATROLZONE).PatrolCeilingAltitude" >
<strong>PATROLZONE.PatrolCeilingAltitude</strong>
</a>
</dt>
<dd>
<p>The highest altitude in meters where to execute the patrol.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="DCSTypes.html##(Altitude)">DCSTypes#Altitude</a></em>
<a id="#(PATROLZONE).PatrolFloorAltitude" >
<strong>PATROLZONE.PatrolFloorAltitude</strong>
</a>
</dt>
<dd>
<p>The lowest altitude in meters where to execute the patrol.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(PATROLZONE).PatrolFuelTresholdPercentage" >
<strong>PATROLZONE.PatrolFuelTresholdPercentage</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="Group.html##(GROUP)">Group#GROUP</a></em>
<a id="#(PATROLZONE).PatrolGroup" >
<strong>PATROLZONE.PatrolGroup</strong>
</a>
</dt>
<dd>
<p>The <a href="Group.html">Group</a> patrolling.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(PATROLZONE).PatrolGroupTemplateName" >
<strong>PATROLZONE.PatrolGroupTemplateName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(PATROLZONE).PatrolManageFuel" >
<strong>PATROLZONE.PatrolManageFuel</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="DCSTypes.html##(Speed)">DCSTypes#Speed</a></em>
<a id="#(PATROLZONE).PatrolMaxSpeed" >
<strong>PATROLZONE.PatrolMaxSpeed</strong>
</a>
</dt>
<dd>
<p>The maximum speed of the <a href="Group.html">Group</a> in km/h.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="DCSTypes.html##(Speed)">DCSTypes#Speed</a></em>
<a id="#(PATROLZONE).PatrolMinSpeed" >
<strong>PATROLZONE.PatrolMinSpeed</strong>
</a>
</dt>
<dd>
<p>The minimum speed of the <a href="Group.html">Group</a> in km/h.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(PATROLZONE).PatrolOutOfFuelMonitor" >
<strong>PATROLZONE.PatrolOutOfFuelMonitor</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(PATROLZONE).PatrolOutOfFuelOrbitTime" >
<strong>PATROLZONE.PatrolOutOfFuelOrbitTime</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a></em>
<a id="#(PATROLZONE).PatrolZone" >
<strong>PATROLZONE.PatrolZone</strong>
</a>
</dt>
<dd>
<p>The <a href="Zone.html">Zone</a> where the patrol needs to be executed.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(PATROLZONE).SetAltitude" >
<strong>PATROLZONE:SetAltitude(PatrolFloorAltitude, PatrolCeilingAltitude)</strong>
</a>
</dt>
<dd>
<p>Sets the floor and ceiling altitude of the patrol.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="DCSTypes.html##(Altitude)">DCSTypes#Altitude</a> PatrolFloorAltitude </em></code>:
The lowest altitude in meters where to execute the patrol.</p>
</li>
<li>
<p><code><em><a href="DCSTypes.html##(Altitude)">DCSTypes#Altitude</a> PatrolCeilingAltitude </em></code>:
The highest altitude in meters where to execute the patrol.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(PATROLZONE)">#PATROLZONE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(PATROLZONE).SetGroup" >
<strong>PATROLZONE:SetGroup(PatrolGroup)</strong>
</a>
</dt>
<dd>
<p>Set the <a href="Group.html">Group</a> to act as the Patroller.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Group.html##(GROUP)">Group#GROUP</a> PatrolGroup </em></code>:
The <a href="Group.html">Group</a> patrolling.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(PATROLZONE)">#PATROLZONE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(PATROLZONE).SetSpeed" >
<strong>PATROLZONE:SetSpeed(PatrolMinSpeed, PatrolMaxSpeed)</strong>
</a>
</dt>
<dd>
<p>Sets (modifies) the minimum and maximum speed of the patrol.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="DCSTypes.html##(Speed)">DCSTypes#Speed</a> PatrolMinSpeed </em></code>:
The minimum speed of the <a href="Group.html">Group</a> in km/h.</p>
</li>
<li>
<p><code><em><a href="DCSTypes.html##(Speed)">DCSTypes#Speed</a> PatrolMaxSpeed </em></code>:
The maximum speed of the <a href="Group.html">Group</a> in km/h.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(PATROLZONE)">#PATROLZONE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(PATROLZONE).SpawnPatrolGroup" >
<strong>PATROLZONE.SpawnPatrolGroup</strong>
</a>
</dt>
<dd>
</dd>
</dl>
</div>
</div>
</body>
</html>