Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

tacticalRules usage





This article presents some basic usages for the tacticalRules module.

Invoking a service if one service data has a specified value

The followings rules specification will invoke the "receivedWP20" service if the "nextWaypoint" service is received with the value "WP20" for the waypointID:
      <rules>
         <rule>
            <trigger name="nextWaypoint">
               <data name="waypointID" value="WP20" />
            </trigger>
            <service name="receivedWP20"/>
         </rule>
      </rules>

Invoking a service if several service datas has specified values

The following rules specification will invoke the "receivedWP20" service if the "nextWaypoint" service is received with the value "WP20" for the waypointID and "AC2" for the aircraftID:
      <rules>
         <rule>
            <trigger name="nextWaypoint">
               <data name="aircraftID" value="AC2" />
               <data name="waypointID" value="WP20" />
            </trigger>
            <service name="receivedWP20"/>
         </rule>
      </rules>

Invoking a service if a service is received but another service has not been received before

The followings rules specification will invoke the "endMission" service if the "endOPTRO" service is received but the "activateSensors" was never received prior to its reception:
      <rules>
         <rule>
            <trigger name="activateSensors"/>
            <event name="sensorsActivated" value="true" type="boolean" />
         </rule>
         <rule>
            <trigger name="endOPTRO"/>
            <conditions>
               <notExist name="sensorsActivated" />
            </conditions>
            <service name="endMission"/>
         </rule>
      </rules>

Invoking a service if one service is received, and another service has been received within a specified delay

The followings rules specification will invoke the "eventTo" service if the "eventFrom" service is received but the "eventFrom2" was receive less than 10s before:
      <rules>
         <rule>
            <trigger name="eventFrom2"/>
            <setValue name="timer1" value="true" />
            <startTimer elapsedTime="10s" name="timer1" value="false" type="boolean"/>
         </rule>   
         <rule>
            <trigger name="eventFrom"/>
            <conditions>
               <equals name="timer1" value="true"/>
            </conditions>
            <service name="eventTo">
               <data name="result" value="true" />
            </service>        
         </rule>     
      </rules>

See also


Categories: builtin-applis

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence