# engine.LingYi.entitys.ferrymission

View Source

      1# -*- coding:utf-8 -*-
      2
      3from .global_util import *
      4from .mission_common import MissionCommon
      5
      6
      7class FerryMission(MissionCommon):
      8    """
      9    转场任务类
     10    1、设置转场规则
     11    2、设置任务编队规模
     12    3、是否飞机数低于编队规模不允许起飞
     13    4、设置任务所需最少飞机数
     14    5、飞机转场油门
     15    6、飞机转场高度
     16    7、潜艇转场深度
     17    8、设置转场地形跟随
     18    9、舰艇转场油门
     19    10、潜艇转场油门
     20
     21    示例：
     22    mission = self.get_mission_by_name('ferry1')   # 通过转场任务的名字，获取任务对象
     23    mission.set_flight_size(FlightSize.One)  # 设置任务编队规模
     24    mission.set_start('05/24/2014 16:05:00')  # 设置任务开始时间 mission.py中接口
     25    """
     26    def __init__(self, guid, name, side_name):
     27        MissionCommon.__init__(self, guid, name, side_name, ElementType.FerryMission)
     28        self.Type = 0  # 转场任务无任务子类型
     29        self.NDH = ""  # 转场任务目的地（机场或航母）ID mDestinationHostID
     30        self.FerryThrottleAircraft = 0  # 转场油门_飞机
     31        self.FerryAltitudeAircraft = 0.0  # 转场高度_飞机
     32        self.FerryTerrainFollowingAircraft = False  # 转场地形跟随_飞机
     33        self.FerryThrottleShip = 0  # 转场油门_舰艇
     34        self.FerryThrottleSubmarine = 0  # 转场油门_潜艇
     35        self.FerryAltitudeSubmarine = 0.0  # 转场高度_潜艇
     36        self.FormationCruise = 0  # 队形_巡航
     37        self.MinAircraftReq = 0.0  # 最小飞机数量
     38        self.Behavior = 0  # 转场任务行为
     39
     40    def set_behavior(self, ferry_behavior):
     41        """
     42        1、设置转场规则，传入参数时需要用枚举值。
     43        :param ferry_behavior: FerryBehavior，转场模式，global_util.py中定义
     44        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     45        """
     46        str_set = "ferryBehavior='%s'" % str(ferry_behavior.value)
     47        return self._set(str_set)
     48
     49    def set_flight_size(self, enum_flight_size):
     50        """
     51        2、设置任务编队规模，传入参数时需要用枚举值。
     52        :param enum_flight_size:FlightSize, 编队规模，global_util.py中定义
     53        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     54        """
     55        str_set = "flightSize=%s" % str(enum_flight_size.value)
     56        return self._set(str_set)
     57
     58    def use_flight_size(self, use_flight_size):
     59        """
     60        3、是否飞机数低于编队规模不允许起飞
     61        :param use_flight_size: bool, True:是
     62        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     63        """
     64        str_set = "useFlightSize=%s" % str(use_flight_size).lower()
     65        return self._set(str_set)
     66
     67    def set_minaircraft(self, min_aircraft):
     68        """
     69        4、设置任务所需最少飞机数，传入参数时需要用枚举值。
     70        :param min_aircraft: 枚举MinAircraftReq的值, global_util.py中定义
     71        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     72        """
     73        str_set = "minaircraftreq=%d" % min_aircraft.value
     74        return self._set(str_set)
     75
     76    def set_aircraft_throttle(self, enum_throttle):
     77        """
     78        5、飞机转场油门，传入参数时需要用枚举值。
     79        :param enum_throttle: 枚举Throttle的值, 油门, global_util.py中定义
     80        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     81        """
     82        if enum_throttle.value == 0:
     83            str_set = "FerryThrottleAircraft='Unspecified'"
     84        else:
     85            str_set = "FerryThrottleAircraft=%d" % (enum_throttle.value-1)
     86        return self._set(str_set)
     87
     88    def set_aircraft_alt(self, alt):
     89        """
     90        6、飞机转场高度
     91        :param alt: float 米
     92        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     93        """
     94        str_set = "ferryAltitudeAircraft=%.1lf" % alt
     95        return self._set(str_set)
     96
     97    def set_submarine_alt(self, alt):
     98        """
     99        7、潜艇转场深度
    100        :param alt: float, 米
    101        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    102        """
    103        str_set = "FerryAltitudeSubmarine=%.11f" % alt
    104        return self._set(str_set)
    105
    106    def set_ferry_terrain_following(self, terrain_follow):
    107        """
    108        8、设置转场地形跟随
    109        :param terrain_follow: bool
    110        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    111        """
    112        str_set = "ferryTerrainFollowingAircraft=%s" % str(terrain_follow).lower()
    113        return self._set(str_set)
    114
    115    def set_ship_throttle(self, enum_throttle):
    116        """
    117        9、舰艇转场油门
    118        :param enum_throttle: Throttle, 油门, global_util.py中定义
    119        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    120        """
    121        if enum_throttle.value == 0:
    122            str_set = "FerryThrottleShip='Unspecified'"
    123        else:
    124            str_set = "FerryThrottleShip=%d" % (enum_throttle.value - 1)
    125        return self._set(str_set)
    126
    127    def set_submarine_throttle(self, enum_throttle):
    128        """
    129        10、潜艇转场油门
    130        :param enum_throttle: Throttle, 油门, global_util.py中定义
    131        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    132        """
    133        if enum_throttle.value == 0:
    134            str_set = "FerryThrottleSubmarine='Unspecified'"
    135        else:
    136            str_set = "FerryThrottleSubmarine=%d" % (enum_throttle.value - 1)
    137        return self._set(str_set)

class FerryMission(engine.LingYi.entitys.mission_common.MissionCommon): View Source

      8class FerryMission(MissionCommon):
      9    """
     10    转场任务类
     11    1、设置转场规则
     12    2、设置任务编队规模
     13    3、是否飞机数低于编队规模不允许起飞
     14    4、设置任务所需最少飞机数
     15    5、飞机转场油门
     16    6、飞机转场高度
     17    7、潜艇转场深度
     18    8、设置转场地形跟随
     19    9、舰艇转场油门
     20    10、潜艇转场油门
     21
     22    示例：
     23    mission = self.get_mission_by_name('ferry1')   # 通过转场任务的名字，获取任务对象
     24    mission.set_flight_size(FlightSize.One)  # 设置任务编队规模
     25    mission.set_start('05/24/2014 16:05:00')  # 设置任务开始时间 mission.py中接口
     26    """
     27    def __init__(self, guid, name, side_name):
     28        MissionCommon.__init__(self, guid, name, side_name, ElementType.FerryMission)
     29        self.Type = 0  # 转场任务无任务子类型
     30        self.NDH = ""  # 转场任务目的地（机场或航母）ID mDestinationHostID
     31        self.FerryThrottleAircraft = 0  # 转场油门_飞机
     32        self.FerryAltitudeAircraft = 0.0  # 转场高度_飞机
     33        self.FerryTerrainFollowingAircraft = False  # 转场地形跟随_飞机
     34        self.FerryThrottleShip = 0  # 转场油门_舰艇
     35        self.FerryThrottleSubmarine = 0  # 转场油门_潜艇
     36        self.FerryAltitudeSubmarine = 0.0  # 转场高度_潜艇
     37        self.FormationCruise = 0  # 队形_巡航
     38        self.MinAircraftReq = 0.0  # 最小飞机数量
     39        self.Behavior = 0  # 转场任务行为
     40
     41    def set_behavior(self, ferry_behavior):
     42        """
     43        1、设置转场规则，传入参数时需要用枚举值。
     44        :param ferry_behavior: FerryBehavior，转场模式，global_util.py中定义
     45        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     46        """
     47        str_set = "ferryBehavior='%s'" % str(ferry_behavior.value)
     48        return self._set(str_set)
     49
     50    def set_flight_size(self, enum_flight_size):
     51        """
     52        2、设置任务编队规模，传入参数时需要用枚举值。
     53        :param enum_flight_size:FlightSize, 编队规模，global_util.py中定义
     54        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     55        """
     56        str_set = "flightSize=%s" % str(enum_flight_size.value)
     57        return self._set(str_set)
     58
     59    def use_flight_size(self, use_flight_size):
     60        """
     61        3、是否飞机数低于编队规模不允许起飞
     62        :param use_flight_size: bool, True:是
     63        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     64        """
     65        str_set = "useFlightSize=%s" % str(use_flight_size).lower()
     66        return self._set(str_set)
     67
     68    def set_minaircraft(self, min_aircraft):
     69        """
     70        4、设置任务所需最少飞机数，传入参数时需要用枚举值。
     71        :param min_aircraft: 枚举MinAircraftReq的值, global_util.py中定义
     72        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     73        """
     74        str_set = "minaircraftreq=%d" % min_aircraft.value
     75        return self._set(str_set)
     76
     77    def set_aircraft_throttle(self, enum_throttle):
     78        """
     79        5、飞机转场油门，传入参数时需要用枚举值。
     80        :param enum_throttle: 枚举Throttle的值, 油门, global_util.py中定义
     81        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     82        """
     83        if enum_throttle.value == 0:
     84            str_set = "FerryThrottleAircraft='Unspecified'"
     85        else:
     86            str_set = "FerryThrottleAircraft=%d" % (enum_throttle.value-1)
     87        return self._set(str_set)
     88
     89    def set_aircraft_alt(self, alt):
     90        """
     91        6、飞机转场高度
     92        :param alt: float 米
     93        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     94        """
     95        str_set = "ferryAltitudeAircraft=%.1lf" % alt
     96        return self._set(str_set)
     97
     98    def set_submarine_alt(self, alt):
     99        """
    100        7、潜艇转场深度
    101        :param alt: float, 米
    102        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    103        """
    104        str_set = "FerryAltitudeSubmarine=%.11f" % alt
    105        return self._set(str_set)
    106
    107    def set_ferry_terrain_following(self, terrain_follow):
    108        """
    109        8、设置转场地形跟随
    110        :param terrain_follow: bool
    111        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    112        """
    113        str_set = "ferryTerrainFollowingAircraft=%s" % str(terrain_follow).lower()
    114        return self._set(str_set)
    115
    116    def set_ship_throttle(self, enum_throttle):
    117        """
    118        9、舰艇转场油门
    119        :param enum_throttle: Throttle, 油门, global_util.py中定义
    120        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    121        """
    122        if enum_throttle.value == 0:
    123            str_set = "FerryThrottleShip='Unspecified'"
    124        else:
    125            str_set = "FerryThrottleShip=%d" % (enum_throttle.value - 1)
    126        return self._set(str_set)
    127
    128    def set_submarine_throttle(self, enum_throttle):
    129        """
    130        10、潜艇转场油门
    131        :param enum_throttle: Throttle, 油门, global_util.py中定义
    132        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    133        """
    134        if enum_throttle.value == 0:
    135            str_set = "FerryThrottleSubmarine='Unspecified'"
    136        else:
    137            str_set = "FerryThrottleSubmarine=%d" % (enum_throttle.value - 1)
    138        return self._set(str_set)

转场任务类
1、设置转场规则
2、设置任务编队规模
3、是否飞机数低于编队规模不允许起飞
4、设置任务所需最少飞机数
5、飞机转场油门
6、飞机转场高度
7、潜艇转场深度
8、设置转场地形跟随
9、舰艇转场油门
10、潜艇转场油门

示例：
mission = self.get_mission_by_name('ferry1') # 通过转场任务的名字，获取任务对象
mission.set_flight_size(FlightSize.One) # 设置任务编队规模
mission.set_start('05/24/2014 16:05:00') # 设置任务开始时间 mission.py中接口

FerryMission(guid, name, side_name) View Source

    27    def __init__(self, guid, name, side_name):
    28        MissionCommon.__init__(self, guid, name, side_name, ElementType.FerryMission)
    29        self.Type = 0  # 转场任务无任务子类型
    30        self.NDH = ""  # 转场任务目的地（机场或航母）ID mDestinationHostID
    31        self.FerryThrottleAircraft = 0  # 转场油门_飞机
    32        self.FerryAltitudeAircraft = 0.0  # 转场高度_飞机
    33        self.FerryTerrainFollowingAircraft = False  # 转场地形跟随_飞机
    34        self.FerryThrottleShip = 0  # 转场油门_舰艇
    35        self.FerryThrottleSubmarine = 0  # 转场油门_潜艇
    36        self.FerryAltitudeSubmarine = 0.0  # 转场高度_潜艇
    37        self.FormationCruise = 0  # 队形_巡航
    38        self.MinAircraftReq = 0.0  # 最小飞机数量
    39        self.Behavior = 0  # 转场任务行为

Type
NDH
FerryThrottleAircraft
FerryAltitudeAircraft
FerryTerrainFollowingAircraft
FerryThrottleShip
FerryThrottleSubmarine
FerryAltitudeSubmarine
FormationCruise
MinAircraftReq
Behavior
def set_behavior(self, ferry_behavior): View Source

    41    def set_behavior(self, ferry_behavior):
    42        """
    43        1、设置转场规则，传入参数时需要用枚举值。
    44        :param ferry_behavior: FerryBehavior，转场模式，global_util.py中定义
    45        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    46        """
    47        str_set = "ferryBehavior='%s'" % str(ferry_behavior.value)
    48        return self._set(str_set)

1、设置转场规则，传入参数时需要用枚举值。 :param ferry_behavior: FerryBehavior，转场模式，global_util.py中定义 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_flight_size(self, enum_flight_size): View Source

    50    def set_flight_size(self, enum_flight_size):
    51        """
    52        2、设置任务编队规模，传入参数时需要用枚举值。
    53        :param enum_flight_size:FlightSize, 编队规模，global_util.py中定义
    54        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    55        """
    56        str_set = "flightSize=%s" % str(enum_flight_size.value)
    57        return self._set(str_set)

2、设置任务编队规模，传入参数时需要用枚举值。 :param enum_flight_size:FlightSize, 编队规模，global_util.py中定义 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def use_flight_size(self, use_flight_size): View Source

    59    def use_flight_size(self, use_flight_size):
    60        """
    61        3、是否飞机数低于编队规模不允许起飞
    62        :param use_flight_size: bool, True:是
    63        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    64        """
    65        str_set = "useFlightSize=%s" % str(use_flight_size).lower()
    66        return self._set(str_set)

3、是否飞机数低于编队规模不允许起飞 :param use_flight_size: bool, True:是 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_minaircraft(self, min_aircraft): View Source

    68    def set_minaircraft(self, min_aircraft):
    69        """
    70        4、设置任务所需最少飞机数，传入参数时需要用枚举值。
    71        :param min_aircraft: 枚举MinAircraftReq的值, global_util.py中定义
    72        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    73        """
    74        str_set = "minaircraftreq=%d" % min_aircraft.value
    75        return self._set(str_set)

4、设置任务所需最少飞机数，传入参数时需要用枚举值。 :param min_aircraft: 枚举MinAircraftReq的值, global_util.py中定义 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_aircraft_throttle(self, enum_throttle): View Source

    77    def set_aircraft_throttle(self, enum_throttle):
    78        """
    79        5、飞机转场油门，传入参数时需要用枚举值。
    80        :param enum_throttle: 枚举Throttle的值, 油门, global_util.py中定义
    81        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    82        """
    83        if enum_throttle.value == 0:
    84            str_set = "FerryThrottleAircraft='Unspecified'"
    85        else:
    86            str_set = "FerryThrottleAircraft=%d" % (enum_throttle.value-1)
    87        return self._set(str_set)

5、飞机转场油门，传入参数时需要用枚举值。 :param enum_throttle: 枚举Throttle的值, 油门, global_util.py中定义 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_aircraft_alt(self, alt): View Source

    89    def set_aircraft_alt(self, alt):
    90        """
    91        6、飞机转场高度
    92        :param alt: float 米
    93        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    94        """
    95        str_set = "ferryAltitudeAircraft=%.1lf" % alt
    96        return self._set(str_set)

6、飞机转场高度 :param alt: float 米 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_submarine_alt(self, alt): View Source

     98    def set_submarine_alt(self, alt):
     99        """
    100        7、潜艇转场深度
    101        :param alt: float, 米
    102        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    103        """
    104        str_set = "FerryAltitudeSubmarine=%.11f" % alt
    105        return self._set(str_set)

7、潜艇转场深度 :param alt: float, 米 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_ferry_terrain_following(self, terrain_follow): View Source

    107    def set_ferry_terrain_following(self, terrain_follow):
    108        """
    109        8、设置转场地形跟随
    110        :param terrain_follow: bool
    111        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    112        """
    113        str_set = "ferryTerrainFollowingAircraft=%s" % str(terrain_follow).lower()
    114        return self._set(str_set)

8、设置转场地形跟随 :param terrain_follow: bool :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_ship_throttle(self, enum_throttle): View Source

    116    def set_ship_throttle(self, enum_throttle):
    117        """
    118        9、舰艇转场油门
    119        :param enum_throttle: Throttle, 油门, global_util.py中定义
    120        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    121        """
    122        if enum_throttle.value == 0:
    123            str_set = "FerryThrottleShip='Unspecified'"
    124        else:
    125            str_set = "FerryThrottleShip=%d" % (enum_throttle.value - 1)
    126        return self._set(str_set)

9、舰艇转场油门 :param enum_throttle: Throttle, 油门, global_util.py中定义 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_submarine_throttle(self, enum_throttle): View Source

    128    def set_submarine_throttle(self, enum_throttle):
    129        """
    130        10、潜艇转场油门
    131        :param enum_throttle: Throttle, 油门, global_util.py中定义
    132        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    133        """
    134        if enum_throttle.value == 0:
    135            str_set = "FerryThrottleSubmarine='Unspecified'"
    136        else:
    137            str_set = "FerryThrottleSubmarine=%d" % (enum_throttle.value - 1)
    138        return self._set(str_set)

10、潜艇转场油门 :param enum_throttle: Throttle, 油门, global_util.py中定义 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

##### Inherited Members

engine.LingYi.entitys.mission_common.MissionCommon
  use_refuel_unrep
  use_tanker
  set_mission_launchMissionWithoutTankersInPlace
  set_mission_tankerMissionList
  set_mission_tankerMinNumber_total
  set_mission_tankerMinNumber_airborne
  set_mission_tankerMinNumber_station
  set_mission_maxReceiversInQueuePerTanker_airborne
  set_mission_fuelQtyToStartLookingForTanker_airborne
  set_mission_TankerFollowsReceiverse
  set_mission_tankerMaxDistance_airborne
engine.LingYi.entitys.mission.Mission
  Category
  Status
  START
  END
  TakeOffTime
  TimeOnTarget
  SISIH
  UseFlightplan
  UseFlightplansOnly
  IncludeInATO
  TankerUsage
  TankerMissionList
  FlightSize
  GroupSize
  GroupName
  DeactivationUnassignUnits
  CheckBoxOrderRTB
  CheckBoxDeleteMission
  LaunchMissionWithoutTankersInPlace
  TankerMinNumberTotal
  TankerMinNumberAirborne
  TankerMinNumberStation
  MaxReceiversInQueuePerTankerAirborne
  FuelQtyToStartLookingForTankerAirborne
  TankerMaxDistanceAirborne
  TankerFollowsReceivers
  UseFlightSizeHardLimit
  UseGroupSizeHardLimit
  Flight
  EmptySlotsList
  ListNavigation1
  ListNavigation2
  ListNavigation3
  mission_active
  set_start
  set_end
  set_switch_radar
  assign_unit
  get_units_assigned
  unassign_unit
  set_mission_course
  set_mission_newname
  set_groupName
engine.LingYi.entitys.operatorbase.DoctrineOperator
  Doctrine
  category
  category_str
  doctrine_switch_radar
  doctrine_switch_oecm
  doctrine_switch_sonar
  doctrine_SetEMCON_Inherit
  use_nuclear_weapons
  doctrine_weapon_control_status_air
  doctrine_weapon_control_status_surface
  doctrine_weapon_control_status_subsurface
  doctrine_weapon_control_status_land
  doctrine_ignore_plotted_course
  doctrine_engaging_ambiguous_targets
  doctrine_engage_opportunity_targets
  doctrine_ignore_emcon_under_attack
  torpedoes_kinematic_range
  doctrine_automatic_evasion
  doctrine_refuel
  doctrine_refuel_select
  doctrine_refuel_allied
  doctrine_air_operations_tempo
  doctrine_quick_turnaround
  doctrine_fuel_state_planned
  doctrine_fuel_state_rtb
  doctrine_weapon_state_planned
  doctrine_weapon_state_rtb
  doctrine_gun_strafing
  doctrine_jettison_ordnance
  doctrine_bvr_logic
  use_sams_in_anti_surface_mode
  doctrine_maintain_standoff
  doctrine_navigation_surface_mode
  avoid_contact
  dive_on_threat
  recharge_on_patrol
  recharge_on_attack
  use_aip
  dipping_sonar
  navigation_sub
  navigation_land
  set_weapon_release_authority
  wra_qty_salvo
  wra_shooter_salvo
  wra_firing_range
  wra_self_defence_distance
  withdraw_on_damage
  withdraw_on_fuel
  withdraw_on_attack
  withdraw_on_defence
  deploy_on_damage
  deploy_on_fuel
  deploy_on_attack
  deploy_on_defence
  get_doctrineWRA
engine.LingYi.entitys.element.Element
  ID
  Name
  Side
  ElementType
  delete_sub_object