MOOSE/docs/Documentation/Utils.html
2017-03-10 23:05:02 +01:00

854 lines
14 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="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
<li><a href="AI_Cas.html">AI_Cas</a></li>
<li><a href="AI_Patrol.html">AI_Patrol</a></li>
<li><a href="Account.html">Account</a></li>
<li><a href="Airbase.html">Airbase</a></li>
<li><a href="AirbasePolice.html">AirbasePolice</a></li>
<li><a href="Assign.html">Assign</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="CommandCenter.html">CommandCenter</a></li>
<li><a href="Controllable.html">Controllable</a></li>
<li><a href="Database.html">Database</a></li>
<li><a href="Detection.html">Detection</a></li>
<li><a href="DetectionManager.html">DetectionManager</a></li>
<li><a href="Escort.html">Escort</a></li>
<li><a href="Event.html">Event</a></li>
<li><a href="Fsm.html">Fsm</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="Identifiable.html">Identifiable</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="Movement.html">Movement</a></li>
<li><a href="Object.html">Object</a></li>
<li><a href="Point.html">Point</a></li>
<li><a href="Positionable.html">Positionable</a></li>
<li><a href="Process_JTAC.html">Process_JTAC</a></li>
<li><a href="Process_Pickup.html">Process_Pickup</a></li>
<li><a href="Route.html">Route</a></li>
<li><a href="Scenery.html">Scenery</a></li>
<li><a href="ScheduleDispatcher.html">ScheduleDispatcher</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="Smoke.html">Smoke</a></li>
<li><a href="Spawn.html">Spawn</a></li>
<li><a href="Static.html">Static</a></li>
<li><a href="Task.html">Task</a></li>
<li><a href="Task_A2G.html">Task_A2G</a></li>
<li><a href="Task_A2G_Dispatcher.html">Task_A2G_Dispatcher</a></li>
<li><a href="Task_PICKUP.html">Task_PICKUP</a></li>
<li><a href="Unit.html">Unit</a></li>
<li>Utils</li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="routines.html">routines</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>Utils</code></h1>
<p>This module contains derived utilities taken from the MIST framework,
which are excellent tools to be reused in an OO environment!.</p>
<h3>Authors:</h3>
<ul>
<li>Grimes : Design &amp; Programming of the MIST framework.</li>
</ul>
<h3>Contributions:</h3>
<ul>
<li>FlightControl : Rework to OO framework </li>
</ul>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="#FLARECOLOR">FLARECOLOR</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#SMOKECOLOR">SMOKECOLOR</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#UTILS">UTILS</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#lookup_table">lookup_table</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(FLARECOLOR)">Type <code>FLARECOLOR</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(FLARECOLOR).Green">FLARECOLOR.Green</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FLARECOLOR).Red">FLARECOLOR.Red</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FLARECOLOR).White">FLARECOLOR.White</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FLARECOLOR).Yellow">FLARECOLOR.Yellow</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(SMOKECOLOR)">Type <code>SMOKECOLOR</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(SMOKECOLOR).Blue">SMOKECOLOR.Blue</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SMOKECOLOR).Green">SMOKECOLOR.Green</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SMOKECOLOR).Orange">SMOKECOLOR.Orange</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SMOKECOLOR).Red">SMOKECOLOR.Red</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SMOKECOLOR).White">SMOKECOLOR.White</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(UTILS)">Type <code>UTILS</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).BasicSerialize">UTILS.BasicSerialize(s)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).DeepCopy">UTILS.DeepCopy(object)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).DoString">UTILS.DoString(s)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).FeetToMeters">UTILS.FeetToMeters(feet)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).KmphToMps">UTILS.KmphToMps(kmph)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).KnotsToMps">UTILS.KnotsToMps(knots)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).MetersToFeet">UTILS.MetersToFeet(meters)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).MetersToNM">UTILS.MetersToNM(meters)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).MpsToKmph">UTILS.MpsToKmph(mps)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).MpsToKnots">UTILS.MpsToKnots(mps)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).NMToMeters">UTILS.NMToMeters(NM)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).OneLineSerialize">UTILS.OneLineSerialize(tbl)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).Round">UTILS.Round(num, idp)</a></td>
<td class="summary">
<p>From http://lua-users.org/wiki/SimpleRound
use negative idp for rounding ahead of decimal place, positive for rounding after decimal place</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).ToDegree">UTILS.ToDegree(angle)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).ToRadian">UTILS.ToRadian(angle)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(UTILS).tostringLL">UTILS.tostringLL(lat, lon, acc, DMS)</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2>Global(s)</h2>
<dl class="function">
<dt>
<em><a href="##(FLARECOLOR)">#FLARECOLOR</a></em>
<a id="FLARECOLOR" >
<strong>FLARECOLOR</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="##(SMOKECOLOR)">#SMOKECOLOR</a></em>
<a id="SMOKECOLOR" >
<strong>SMOKECOLOR</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="##(UTILS)">#UTILS</a></em>
<a id="UTILS" >
<strong>UTILS</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="lookup_table" >
<strong>lookup_table</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h2><a id="#(Utils)" >Type <code>Utils</code></a></h2>
<h2><a id="#(FLARECOLOR)" >Type <code>FLARECOLOR</code></a></h2>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<a id="#(FLARECOLOR).Green" >
<strong>FLARECOLOR.Green</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FLARECOLOR).Red" >
<strong>FLARECOLOR.Red</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FLARECOLOR).White" >
<strong>FLARECOLOR.White</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FLARECOLOR).Yellow" >
<strong>FLARECOLOR.Yellow</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h2><a id="#(SMOKECOLOR)" >Type <code>SMOKECOLOR</code></a></h2>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<a id="#(SMOKECOLOR).Blue" >
<strong>SMOKECOLOR.Blue</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SMOKECOLOR).Green" >
<strong>SMOKECOLOR.Green</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SMOKECOLOR).Orange" >
<strong>SMOKECOLOR.Orange</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SMOKECOLOR).Red" >
<strong>SMOKECOLOR.Red</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SMOKECOLOR).White" >
<strong>SMOKECOLOR.White</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h2><a id="#(UTILS)" >Type <code>UTILS</code></a></h2>
<p>Utilities static class.</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<a id="#(UTILS).BasicSerialize" >
<strong>UTILS.BasicSerialize(s)</strong>
</a>
</dt>
<dd>
<p>porting in Slmod's "safestring" basic serialize</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> s </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).DeepCopy" >
<strong>UTILS.DeepCopy(object)</strong>
</a>
</dt>
<dd>
<p>from http://lua-users.org/wiki/CopyTable</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> object </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).DoString" >
<strong>UTILS.DoString(s)</strong>
</a>
</dt>
<dd>
<p> porting in Slmod's dostring</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> s </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).FeetToMeters" >
<strong>UTILS.FeetToMeters(feet)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> feet </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).KmphToMps" >
<strong>UTILS.KmphToMps(kmph)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> kmph </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).KnotsToMps" >
<strong>UTILS.KnotsToMps(knots)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> knots </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).MetersToFeet" >
<strong>UTILS.MetersToFeet(meters)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> meters </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).MetersToNM" >
<strong>UTILS.MetersToNM(meters)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> meters </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).MpsToKmph" >
<strong>UTILS.MpsToKmph(mps)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> mps </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).MpsToKnots" >
<strong>UTILS.MpsToKnots(mps)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> mps </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).NMToMeters" >
<strong>UTILS.NMToMeters(NM)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> NM </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).OneLineSerialize" >
<strong>UTILS.OneLineSerialize(tbl)</strong>
</a>
</dt>
<dd>
<p> porting in Slmod's serialize_slmod2</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> tbl </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).Round" >
<strong>UTILS.Round(num, idp)</strong>
</a>
</dt>
<dd>
<p>From http://lua-users.org/wiki/SimpleRound
use negative idp for rounding ahead of decimal place, positive for rounding after decimal place</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> num </em></code>: </p>
</li>
<li>
<p><code><em> idp </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).ToDegree" >
<strong>UTILS.ToDegree(angle)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> angle </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).ToRadian" >
<strong>UTILS.ToRadian(angle)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> angle </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(UTILS).tostringLL" >
<strong>UTILS.tostringLL(lat, lon, acc, DMS)</strong>
</a>
</dt>
<dd>
<p>acc:
in DM: decimal point of minutes.
In DMS: decimal point of seconds.
position after the decimal of the least significant digit:
So:
42.32 - acc of 2.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> lat </em></code>: </p>
</li>
<li>
<p><code><em> lon </em></code>: </p>
</li>
<li>
<p><code><em> acc </em></code>: </p>
</li>
<li>
<p><code><em> DMS </em></code>: </p>
</li>
</ul>
</dd>
</dl>
</div>
</div>
</body>
</html>