# engine.LingYi.entitys.minemission

View Source

      1# -*- coding:utf-8 -*-
      2
      3from .global_util import *
      4from .mission_common import MissionCommon
      5
      6
      7class MineMission(MissionCommon):
      8    """
      9    布雷任务类
     10    1、三分之一规则
     11    2、水雷接触保险延迟
     12    3、设置任务编队规模
     13    4、是否飞机数低于编队规模不允许起飞
     14    5、设置任务舰船/潜艇编队规模
     15    6、是否舰船/潜艇数低于编队规模不允许出发
     16    7、设置任务所需最少飞机数
     17    8、设置任务的出航油门
     18    9、设置任务的阵位油门
     19    10、设置任务的出航高度
     20    11、设置任务的阵位高度
     21    12、设置出航地形跟随
     22    13、设置阵位地形跟随
     23    14、设置部雷任务的区域
     24    15、设置出航地形跟随
     25    16、阵地地形跟随
     26
     27    示例：
     28    mission = self.get_mission_by_name('mine_mission')   # 通过排雷任务的名字  获取排雷任务对象
     29    mission.set_one_third_rule(True)  # 三分之一规则 开启
     30    mission.set_start('05/24/2014 16:05:00')  # 设置任务开始时间 mission.py中接口
     31    """
     32    def __init__(self, guid, name, side_name):
     33        MissionCommon.__init__(self, guid, name, side_name, ElementType.MineMission)
     34        self.Type = 0  # 任务子类型（无含义）
     35        self.Area = []  # 部雷区域--参考点guid列表
     36        self.OTR = False  # OneThirdRule 三分之一规则
     37        self.TransitThrottleAircraft = 0  # 运输油门_飞机
     38        self.StationThrottleAircraft = 0  # 阵位油门_飞机
     39        self.TransitAltitudeAircraft = 0.0  # 运输高度_飞机
     40        self.StationAltitudeAircraft = 0.0  # 阵位高度_飞机
     41        self.TransitTerrainFollowingAircraft = False  # 运输地形跟随_飞机
     42        self.StationTerrainFollowingAircraft = False  # 阵位地形跟随_飞机
     43        self.TransitThrottleSubmarine = 0  # 运输油门_潜艇
     44        self.StationThrottleSubmarine = 0  # 阵位油门_潜艇
     45        self.TransitDepthSubmarine = 0.0  # 9999表示无设置  // 运输深度_潜艇
     46        self.StationDepthSubmarine = 0.0  # 阵位深度_潜艇
     47        self.TransitThrottleShip = 0  # 运输油门_舰船
     48        self.StationThrottleShip = 0  # 阵位油门_舰船
     49        self.TransitThrottleFacility = 0  # 运输油门_设施
     50        self.StationThrottleFacility = 0  # 阵位油门_设施
     51        self.FormationCruise = 0  # 巡航队形
     52        self.AD = 0  # ArmingDelay 待命延迟
     53        self.MinAircraftReq = 0  # 最小飞机数量
     54
     55    def set_one_third_rule(self, one_third):
     56        """
     57        1、三分之一规则
     58        :param one_third: bool, True,设置三分之一规则  False:不遵守三分之一规则
     59        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     60        """
     61        str_set = "oneThirdRule=%s" % (str(one_third).lower())
     62        return self._set(str_set)
     63
     64    def set_armingdelay(self, time_delay):
     65        """
     66        2、水雷接触保险延迟
     67        :param time_delay: str, exp: 以'天数:时数:分数:秒数'表示，如1天4 小时30分钟表示为'1:4:30:0'
     68        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     69        """
     70        str_set = "armingdelay='%s'" % time_delay
     71        return self._set(str_set)
     72
     73    def set_flight_size(self, enum_flight_size):
     74        """
     75        3、设置任务编队规模
     76        :param enum_flight_size:FlightSize, 编队规模, global_util.py中定义
     77        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     78        """
     79        str_set = "flightSize=%d" % enum_flight_size.value
     80        return self._set(str_set)
     81
     82    def use_flight_size(self, use_flight_size):
     83        """
     84        4、是否飞机数低于编队规模不允许起飞
     85        :param use_flight_size: bool, True:是
     86        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     87        """
     88        str_set = "useFlightSize=%s" % str(use_flight_size).lower()
     89        return self._set(str_set)
     90
     91    def set_group_size(self, enum_group_size):
     92        """
     93        5、设置任务舰船/潜艇编队规模
     94        :param enum_group_size:GroupSize, 编队规模
     95        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     96        """
     97        str_set = "groupSize=%d" % enum_group_size.value
     98        return self._set(str_set)
     99
    100    def use_group_size(self, use_group_size):
    101        """
    102        6、是否舰船/潜艇数低于编队规模不允许出发
    103        :param use_group_size: bool, True:是
    104        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    105        """
    106        str_set = "useGroupSize=%s" % str(use_group_size).lower()
    107        return self._set(str_set)
    108
    109    def set_minaircraft(self, min_aircraft):
    110        """
    111        7、设置任务所需最少飞机数
    112        :param min_aircraft:枚举MinAircraftReq的值, global_util.py中定义
    113        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    114        """
    115        str_set = "minaircraftreq=%d" % min_aircraft.value
    116        return self._set(str_set)
    117
    118    def set_transit_throttle(self, enum_throttle, unit_category=ElementType.Aircraft):
    119        """
    120        8、设置任务的出航油门
    121        :param enum_throttle:枚举Throttle的值, 油门, global_util.py中定义
    122        :param unit_category:ElementType.Aircraft, or ElementType.Ship, or ElementType.Submarine
    123        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    124        """
    125        if unit_category == ElementType.Aircraft:
    126            if enum_throttle.value == 0:
    127                str_set = "transitThrottleAircraft='Unspecified'"
    128            else:
    129                str_set = "transitThrottleAircraft=%d" % (enum_throttle.value-1)
    130        elif unit_category == ElementType.Ship:
    131            if enum_throttle.value == 0:
    132                str_set = "transitThrottleShip='Unspecified'"
    133            else:
    134                str_set = "transitThrottleShip=%d" % (enum_throttle.value-1)
    135        elif unit_category == ElementType.Submarine:
    136            if enum_throttle.value == 0:
    137                str_set = "transitThrottleSubmarine='Unspecified'"
    138            else:
    139                str_set = "transitThrottleSubmarine=%d" % (enum_throttle.value-1)
    140        else:
    141            raise ValueError("parameter unit_category value error")
    142        return self._set(str_set)
    143
    144    def set_station_throttle(self, enum_throttle, unit_category=ElementType.Aircraft):
    145        """
    146        9、设置任务的阵位油门
    147        :param enum_throttle: 枚举Throttle的值, 油门, global_util.py中定义
    148        :param unit_category:ElementType.Aircraft, or ElementType.Ship, or ElementType.Submarine
    149        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    150        """
    151        if unit_category == ElementType.Aircraft:
    152            if enum_throttle.value == 0:
    153                str_set = "stationThrottleAircraft='Unspecified'"
    154            else:
    155                str_set = "stationThrottleAircraft=%d" % (enum_throttle.value-1)
    156        elif unit_category == ElementType.Ship:
    157            if enum_throttle.value == 0:
    158                str_set = "stationThrottleShip='Unspecified'"
    159            else:
    160                str_set = "stationThrottleShip=%d" % (enum_throttle.value-1)
    161        elif unit_category == ElementType.Submarine:
    162            if enum_throttle.value == 0:
    163                str_set = "stationThrottleSubmarine='Unspecified'"
    164            else:
    165                str_set = "stationThrottleSubmarine=%d" % (enum_throttle.value-1)
    166        else:
    167            raise ValueError("parameter unit_category value error")
    168        return self._set(str_set)
    169
    170    def set_transit_alt(self, altitude_value, is_submarine=False):
    171        """
    172        10、设置任务的出航高度
    173        :param altitude_value: float, 出航高度， 单位：米，最多6位字符，例：99999.9， 888888
    174        :param is_submarine: bool, 是否出潜深度
    175        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    176        """
    177        if is_submarine:
    178            str_set = "transitDepthSubmarine=%.2lf" % altitude_value
    179        else:
    180            str_set = "transitAltitudeAircraft=%.2lf" % altitude_value
    181        return self._set(str_set)
    182
    183    def set_station_altitude(self, altitude_value, is_submarine=False):
    184        """
    185        11、设置任务的阵位高度
    186        :param altitude_value: float, 阵位高度， 单位：米，最多6位字符
    187        :param is_submarine: bool, 是否出潜深度
    188        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    189        """
    190        if is_submarine:
    191            str_set = "stationDepthSubmarine=%.2lf" % altitude_value
    192        else:
    193            str_set = "stationAltitudeAircraft=%.2lf" % altitude_value
    194        return self._set(str_set)
    195
    196    def set_transit_terrain_following(self, transit_terrain):
    197        """
    198        12、设置出航地形跟随
    199        :param transit_terrain: bool
    200        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    201        """
    202        str_set = "transitTerrainFollowing=%s" % str(transit_terrain).lower()
    203        return self._set(str_set)
    204
    205    def set_station_terrain_following(self, station_terrain):
    206        """
    207        13、设置阵位地形跟随
    208        :param station_terrain: bool
    209        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    210        """
    211        str_set = "stationTerrainFollowingAircraft=%s" % str(station_terrain).lower()
    212        return self._set(str_set)
    213
    214    def mine_set_zone(self, Zone):
    215        """
    216        14、设置部雷任务的区域，按顺序排列的参考点名
    217        :param Zone: 参考点列表, list,
    218        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    219        """
    220        str_set = "Zone=%s" % (str(Zone).replace("[", "{").replace("]", "}"))
    221        return self._set(str_set)
    222
    223    def mine_set_transit_terrain_following(self, transit_terrain):
    224        """
    225        15、设置出航地形跟随
    226        :param transit_terrain: bool
    227        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    228        """
    229        str_set = "TransitTerrainFollowingAircraft=%s" % str(transit_terrain).lower()
    230        return self._set(str_set)
    231
    232    def mine_set_station_terrain_following(self, station_terrain):
    233        """
    234        16、阵地地形跟随
    235        :param station_terrain: bool
    236        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    237        """
    238        str_set = "stationTerrainFollowingAircraft=%s" % str(station_terrain).lower()
    239        return self._set(str_set)

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

      8class MineMission(MissionCommon):
      9    """
     10    布雷任务类
     11    1、三分之一规则
     12    2、水雷接触保险延迟
     13    3、设置任务编队规模
     14    4、是否飞机数低于编队规模不允许起飞
     15    5、设置任务舰船/潜艇编队规模
     16    6、是否舰船/潜艇数低于编队规模不允许出发
     17    7、设置任务所需最少飞机数
     18    8、设置任务的出航油门
     19    9、设置任务的阵位油门
     20    10、设置任务的出航高度
     21    11、设置任务的阵位高度
     22    12、设置出航地形跟随
     23    13、设置阵位地形跟随
     24    14、设置部雷任务的区域
     25    15、设置出航地形跟随
     26    16、阵地地形跟随
     27
     28    示例：
     29    mission = self.get_mission_by_name('mine_mission')   # 通过排雷任务的名字  获取排雷任务对象
     30    mission.set_one_third_rule(True)  # 三分之一规则 开启
     31    mission.set_start('05/24/2014 16:05:00')  # 设置任务开始时间 mission.py中接口
     32    """
     33    def __init__(self, guid, name, side_name):
     34        MissionCommon.__init__(self, guid, name, side_name, ElementType.MineMission)
     35        self.Type = 0  # 任务子类型（无含义）
     36        self.Area = []  # 部雷区域--参考点guid列表
     37        self.OTR = False  # OneThirdRule 三分之一规则
     38        self.TransitThrottleAircraft = 0  # 运输油门_飞机
     39        self.StationThrottleAircraft = 0  # 阵位油门_飞机
     40        self.TransitAltitudeAircraft = 0.0  # 运输高度_飞机
     41        self.StationAltitudeAircraft = 0.0  # 阵位高度_飞机
     42        self.TransitTerrainFollowingAircraft = False  # 运输地形跟随_飞机
     43        self.StationTerrainFollowingAircraft = False  # 阵位地形跟随_飞机
     44        self.TransitThrottleSubmarine = 0  # 运输油门_潜艇
     45        self.StationThrottleSubmarine = 0  # 阵位油门_潜艇
     46        self.TransitDepthSubmarine = 0.0  # 9999表示无设置  // 运输深度_潜艇
     47        self.StationDepthSubmarine = 0.0  # 阵位深度_潜艇
     48        self.TransitThrottleShip = 0  # 运输油门_舰船
     49        self.StationThrottleShip = 0  # 阵位油门_舰船
     50        self.TransitThrottleFacility = 0  # 运输油门_设施
     51        self.StationThrottleFacility = 0  # 阵位油门_设施
     52        self.FormationCruise = 0  # 巡航队形
     53        self.AD = 0  # ArmingDelay 待命延迟
     54        self.MinAircraftReq = 0  # 最小飞机数量
     55
     56    def set_one_third_rule(self, one_third):
     57        """
     58        1、三分之一规则
     59        :param one_third: bool, True,设置三分之一规则  False:不遵守三分之一规则
     60        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     61        """
     62        str_set = "oneThirdRule=%s" % (str(one_third).lower())
     63        return self._set(str_set)
     64
     65    def set_armingdelay(self, time_delay):
     66        """
     67        2、水雷接触保险延迟
     68        :param time_delay: str, exp: 以'天数:时数:分数:秒数'表示，如1天4 小时30分钟表示为'1:4:30:0'
     69        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     70        """
     71        str_set = "armingdelay='%s'" % time_delay
     72        return self._set(str_set)
     73
     74    def set_flight_size(self, enum_flight_size):
     75        """
     76        3、设置任务编队规模
     77        :param enum_flight_size:FlightSize, 编队规模, global_util.py中定义
     78        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     79        """
     80        str_set = "flightSize=%d" % enum_flight_size.value
     81        return self._set(str_set)
     82
     83    def use_flight_size(self, use_flight_size):
     84        """
     85        4、是否飞机数低于编队规模不允许起飞
     86        :param use_flight_size: bool, True:是
     87        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     88        """
     89        str_set = "useFlightSize=%s" % str(use_flight_size).lower()
     90        return self._set(str_set)
     91
     92    def set_group_size(self, enum_group_size):
     93        """
     94        5、设置任务舰船/潜艇编队规模
     95        :param enum_group_size:GroupSize, 编队规模
     96        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     97        """
     98        str_set = "groupSize=%d" % enum_group_size.value
     99        return self._set(str_set)
    100
    101    def use_group_size(self, use_group_size):
    102        """
    103        6、是否舰船/潜艇数低于编队规模不允许出发
    104        :param use_group_size: bool, True:是
    105        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    106        """
    107        str_set = "useGroupSize=%s" % str(use_group_size).lower()
    108        return self._set(str_set)
    109
    110    def set_minaircraft(self, min_aircraft):
    111        """
    112        7、设置任务所需最少飞机数
    113        :param min_aircraft:枚举MinAircraftReq的值, global_util.py中定义
    114        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    115        """
    116        str_set = "minaircraftreq=%d" % min_aircraft.value
    117        return self._set(str_set)
    118
    119    def set_transit_throttle(self, enum_throttle, unit_category=ElementType.Aircraft):
    120        """
    121        8、设置任务的出航油门
    122        :param enum_throttle:枚举Throttle的值, 油门, global_util.py中定义
    123        :param unit_category:ElementType.Aircraft, or ElementType.Ship, or ElementType.Submarine
    124        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    125        """
    126        if unit_category == ElementType.Aircraft:
    127            if enum_throttle.value == 0:
    128                str_set = "transitThrottleAircraft='Unspecified'"
    129            else:
    130                str_set = "transitThrottleAircraft=%d" % (enum_throttle.value-1)
    131        elif unit_category == ElementType.Ship:
    132            if enum_throttle.value == 0:
    133                str_set = "transitThrottleShip='Unspecified'"
    134            else:
    135                str_set = "transitThrottleShip=%d" % (enum_throttle.value-1)
    136        elif unit_category == ElementType.Submarine:
    137            if enum_throttle.value == 0:
    138                str_set = "transitThrottleSubmarine='Unspecified'"
    139            else:
    140                str_set = "transitThrottleSubmarine=%d" % (enum_throttle.value-1)
    141        else:
    142            raise ValueError("parameter unit_category value error")
    143        return self._set(str_set)
    144
    145    def set_station_throttle(self, enum_throttle, unit_category=ElementType.Aircraft):
    146        """
    147        9、设置任务的阵位油门
    148        :param enum_throttle: 枚举Throttle的值, 油门, global_util.py中定义
    149        :param unit_category:ElementType.Aircraft, or ElementType.Ship, or ElementType.Submarine
    150        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    151        """
    152        if unit_category == ElementType.Aircraft:
    153            if enum_throttle.value == 0:
    154                str_set = "stationThrottleAircraft='Unspecified'"
    155            else:
    156                str_set = "stationThrottleAircraft=%d" % (enum_throttle.value-1)
    157        elif unit_category == ElementType.Ship:
    158            if enum_throttle.value == 0:
    159                str_set = "stationThrottleShip='Unspecified'"
    160            else:
    161                str_set = "stationThrottleShip=%d" % (enum_throttle.value-1)
    162        elif unit_category == ElementType.Submarine:
    163            if enum_throttle.value == 0:
    164                str_set = "stationThrottleSubmarine='Unspecified'"
    165            else:
    166                str_set = "stationThrottleSubmarine=%d" % (enum_throttle.value-1)
    167        else:
    168            raise ValueError("parameter unit_category value error")
    169        return self._set(str_set)
    170
    171    def set_transit_alt(self, altitude_value, is_submarine=False):
    172        """
    173        10、设置任务的出航高度
    174        :param altitude_value: float, 出航高度， 单位：米，最多6位字符，例：99999.9， 888888
    175        :param is_submarine: bool, 是否出潜深度
    176        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    177        """
    178        if is_submarine:
    179            str_set = "transitDepthSubmarine=%.2lf" % altitude_value
    180        else:
    181            str_set = "transitAltitudeAircraft=%.2lf" % altitude_value
    182        return self._set(str_set)
    183
    184    def set_station_altitude(self, altitude_value, is_submarine=False):
    185        """
    186        11、设置任务的阵位高度
    187        :param altitude_value: float, 阵位高度， 单位：米，最多6位字符
    188        :param is_submarine: bool, 是否出潜深度
    189        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    190        """
    191        if is_submarine:
    192            str_set = "stationDepthSubmarine=%.2lf" % altitude_value
    193        else:
    194            str_set = "stationAltitudeAircraft=%.2lf" % altitude_value
    195        return self._set(str_set)
    196
    197    def set_transit_terrain_following(self, transit_terrain):
    198        """
    199        12、设置出航地形跟随
    200        :param transit_terrain: bool
    201        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    202        """
    203        str_set = "transitTerrainFollowing=%s" % str(transit_terrain).lower()
    204        return self._set(str_set)
    205
    206    def set_station_terrain_following(self, station_terrain):
    207        """
    208        13、设置阵位地形跟随
    209        :param station_terrain: bool
    210        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    211        """
    212        str_set = "stationTerrainFollowingAircraft=%s" % str(station_terrain).lower()
    213        return self._set(str_set)
    214
    215    def mine_set_zone(self, Zone):
    216        """
    217        14、设置部雷任务的区域，按顺序排列的参考点名
    218        :param Zone: 参考点列表, list,
    219        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    220        """
    221        str_set = "Zone=%s" % (str(Zone).replace("[", "{").replace("]", "}"))
    222        return self._set(str_set)
    223
    224    def mine_set_transit_terrain_following(self, transit_terrain):
    225        """
    226        15、设置出航地形跟随
    227        :param transit_terrain: bool
    228        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    229        """
    230        str_set = "TransitTerrainFollowingAircraft=%s" % str(transit_terrain).lower()
    231        return self._set(str_set)
    232
    233    def mine_set_station_terrain_following(self, station_terrain):
    234        """
    235        16、阵地地形跟随
    236        :param station_terrain: bool
    237        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    238        """
    239        str_set = "stationTerrainFollowingAircraft=%s" % str(station_terrain).lower()
    240        return self._set(str_set)

布雷任务类
1、三分之一规则
2、水雷接触保险延迟
3、设置任务编队规模
4、是否飞机数低于编队规模不允许起飞
5、设置任务舰船/潜艇编队规模
6、是否舰船/潜艇数低于编队规模不允许出发
7、设置任务所需最少飞机数
8、设置任务的出航油门
9、设置任务的阵位油门
10、设置任务的出航高度
11、设置任务的阵位高度
12、设置出航地形跟随
13、设置阵位地形跟随
14、设置部雷任务的区域
15、设置出航地形跟随
16、阵地地形跟随

示例：
mission = self.get_mission_by_name('mine_mission') # 通过排雷任务的名字 获取排雷任务对象
mission.set_one_third_rule(True) # 三分之一规则 开启
mission.set_start('05/24/2014 16:05:00') # 设置任务开始时间 mission.py中接口

MineMission(guid, name, side_name) View Source

    33    def __init__(self, guid, name, side_name):
    34        MissionCommon.__init__(self, guid, name, side_name, ElementType.MineMission)
    35        self.Type = 0  # 任务子类型（无含义）
    36        self.Area = []  # 部雷区域--参考点guid列表
    37        self.OTR = False  # OneThirdRule 三分之一规则
    38        self.TransitThrottleAircraft = 0  # 运输油门_飞机
    39        self.StationThrottleAircraft = 0  # 阵位油门_飞机
    40        self.TransitAltitudeAircraft = 0.0  # 运输高度_飞机
    41        self.StationAltitudeAircraft = 0.0  # 阵位高度_飞机
    42        self.TransitTerrainFollowingAircraft = False  # 运输地形跟随_飞机
    43        self.StationTerrainFollowingAircraft = False  # 阵位地形跟随_飞机
    44        self.TransitThrottleSubmarine = 0  # 运输油门_潜艇
    45        self.StationThrottleSubmarine = 0  # 阵位油门_潜艇
    46        self.TransitDepthSubmarine = 0.0  # 9999表示无设置  // 运输深度_潜艇
    47        self.StationDepthSubmarine = 0.0  # 阵位深度_潜艇
    48        self.TransitThrottleShip = 0  # 运输油门_舰船
    49        self.StationThrottleShip = 0  # 阵位油门_舰船
    50        self.TransitThrottleFacility = 0  # 运输油门_设施
    51        self.StationThrottleFacility = 0  # 阵位油门_设施
    52        self.FormationCruise = 0  # 巡航队形
    53        self.AD = 0  # ArmingDelay 待命延迟
    54        self.MinAircraftReq = 0  # 最小飞机数量

Type
Area
OTR
TransitThrottleAircraft
StationThrottleAircraft
TransitAltitudeAircraft
StationAltitudeAircraft
TransitTerrainFollowingAircraft
StationTerrainFollowingAircraft
TransitThrottleSubmarine
StationThrottleSubmarine
TransitDepthSubmarine
StationDepthSubmarine
TransitThrottleShip
StationThrottleShip
TransitThrottleFacility
StationThrottleFacility
FormationCruise
AD
MinAircraftReq
def set_one_third_rule(self, one_third): View Source

    56    def set_one_third_rule(self, one_third):
    57        """
    58        1、三分之一规则
    59        :param one_third: bool, True,设置三分之一规则  False:不遵守三分之一规则
    60        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    61        """
    62        str_set = "oneThirdRule=%s" % (str(one_third).lower())
    63        return self._set(str_set)

1、三分之一规则 :param one_third: bool, True,设置三分之一规则 False:不遵守三分之一规则 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_armingdelay(self, time_delay): View Source

    65    def set_armingdelay(self, time_delay):
    66        """
    67        2、水雷接触保险延迟
    68        :param time_delay: str, exp: 以'天数:时数:分数:秒数'表示，如1天4 小时30分钟表示为'1:4:30:0'
    69        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    70        """
    71        str_set = "armingdelay='%s'" % time_delay
    72        return self._set(str_set)

2、水雷接触保险延迟 :param time_delay: str, exp: 以'天数:时数:分数:秒数'表示，如1天4 小时30分钟表示为'1:4:30:0' :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_flight_size(self, enum_flight_size): View Source

    74    def set_flight_size(self, enum_flight_size):
    75        """
    76        3、设置任务编队规模
    77        :param enum_flight_size:FlightSize, 编队规模, global_util.py中定义
    78        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    79        """
    80        str_set = "flightSize=%d" % enum_flight_size.value
    81        return self._set(str_set)

3、设置任务编队规模 :param enum_flight_size:FlightSize, 编队规模, global_util.py中定义 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def use_flight_size(self, use_flight_size): View Source

    83    def use_flight_size(self, use_flight_size):
    84        """
    85        4、是否飞机数低于编队规模不允许起飞
    86        :param use_flight_size: bool, True:是
    87        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    88        """
    89        str_set = "useFlightSize=%s" % str(use_flight_size).lower()
    90        return self._set(str_set)

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

def set_group_size(self, enum_group_size): View Source

    92    def set_group_size(self, enum_group_size):
    93        """
    94        5、设置任务舰船/潜艇编队规模
    95        :param enum_group_size:GroupSize, 编队规模
    96        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    97        """
    98        str_set = "groupSize=%d" % enum_group_size.value
    99        return self._set(str_set)

5、设置任务舰船/潜艇编队规模 :param enum_group_size:GroupSize, 编队规模 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def use_group_size(self, use_group_size): View Source

    101    def use_group_size(self, use_group_size):
    102        """
    103        6、是否舰船/潜艇数低于编队规模不允许出发
    104        :param use_group_size: bool, True:是
    105        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    106        """
    107        str_set = "useGroupSize=%s" % str(use_group_size).lower()
    108        return self._set(str_set)

6、是否舰船/潜艇数低于编队规模不允许出发 :param use_group_size: bool, True:是 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_minaircraft(self, min_aircraft): View Source

    110    def set_minaircraft(self, min_aircraft):
    111        """
    112        7、设置任务所需最少飞机数
    113        :param min_aircraft:枚举MinAircraftReq的值, global_util.py中定义
    114        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    115        """
    116        str_set = "minaircraftreq=%d" % min_aircraft.value
    117        return self._set(str_set)

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

def set_transit_throttle(self, enum_throttle, unit_category=<ElementType.Aircraft: 31>): View Source

    119    def set_transit_throttle(self, enum_throttle, unit_category=ElementType.Aircraft):
    120        """
    121        8、设置任务的出航油门
    122        :param enum_throttle:枚举Throttle的值, 油门, global_util.py中定义
    123        :param unit_category:ElementType.Aircraft, or ElementType.Ship, or ElementType.Submarine
    124        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    125        """
    126        if unit_category == ElementType.Aircraft:
    127            if enum_throttle.value == 0:
    128                str_set = "transitThrottleAircraft='Unspecified'"
    129            else:
    130                str_set = "transitThrottleAircraft=%d" % (enum_throttle.value-1)
    131        elif unit_category == ElementType.Ship:
    132            if enum_throttle.value == 0:
    133                str_set = "transitThrottleShip='Unspecified'"
    134            else:
    135                str_set = "transitThrottleShip=%d" % (enum_throttle.value-1)
    136        elif unit_category == ElementType.Submarine:
    137            if enum_throttle.value == 0:
    138                str_set = "transitThrottleSubmarine='Unspecified'"
    139            else:
    140                str_set = "transitThrottleSubmarine=%d" % (enum_throttle.value-1)
    141        else:
    142            raise ValueError("parameter unit_category value error")
    143        return self._set(str_set)

8、设置任务的出航油门 :param enum_throttle:枚举Throttle的值, 油门, global_util.py中定义 :param unit_category:ElementType.Aircraft, or ElementType.Ship, or ElementType.Submarine :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_station_throttle(self, enum_throttle, unit_category=<ElementType.Aircraft: 31>): View Source

    145    def set_station_throttle(self, enum_throttle, unit_category=ElementType.Aircraft):
    146        """
    147        9、设置任务的阵位油门
    148        :param enum_throttle: 枚举Throttle的值, 油门, global_util.py中定义
    149        :param unit_category:ElementType.Aircraft, or ElementType.Ship, or ElementType.Submarine
    150        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    151        """
    152        if unit_category == ElementType.Aircraft:
    153            if enum_throttle.value == 0:
    154                str_set = "stationThrottleAircraft='Unspecified'"
    155            else:
    156                str_set = "stationThrottleAircraft=%d" % (enum_throttle.value-1)
    157        elif unit_category == ElementType.Ship:
    158            if enum_throttle.value == 0:
    159                str_set = "stationThrottleShip='Unspecified'"
    160            else:
    161                str_set = "stationThrottleShip=%d" % (enum_throttle.value-1)
    162        elif unit_category == ElementType.Submarine:
    163            if enum_throttle.value == 0:
    164                str_set = "stationThrottleSubmarine='Unspecified'"
    165            else:
    166                str_set = "stationThrottleSubmarine=%d" % (enum_throttle.value-1)
    167        else:
    168            raise ValueError("parameter unit_category value error")
    169        return self._set(str_set)

9、设置任务的阵位油门 :param enum_throttle: 枚举Throttle的值, 油门, global_util.py中定义 :param unit_category:ElementType.Aircraft, or ElementType.Ship, or ElementType.Submarine :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_transit_alt(self, altitude_value, is_submarine=False): View Source

    171    def set_transit_alt(self, altitude_value, is_submarine=False):
    172        """
    173        10、设置任务的出航高度
    174        :param altitude_value: float, 出航高度， 单位：米，最多6位字符，例：99999.9， 888888
    175        :param is_submarine: bool, 是否出潜深度
    176        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    177        """
    178        if is_submarine:
    179            str_set = "transitDepthSubmarine=%.2lf" % altitude_value
    180        else:
    181            str_set = "transitAltitudeAircraft=%.2lf" % altitude_value
    182        return self._set(str_set)

10、设置任务的出航高度 :param altitude_value: float, 出航高度， 单位：米，最多6位字符，例：99999.9， 888888 :param is_submarine: bool, 是否出潜深度 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_station_altitude(self, altitude_value, is_submarine=False): View Source

    184    def set_station_altitude(self, altitude_value, is_submarine=False):
    185        """
    186        11、设置任务的阵位高度
    187        :param altitude_value: float, 阵位高度， 单位：米，最多6位字符
    188        :param is_submarine: bool, 是否出潜深度
    189        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    190        """
    191        if is_submarine:
    192            str_set = "stationDepthSubmarine=%.2lf" % altitude_value
    193        else:
    194            str_set = "stationAltitudeAircraft=%.2lf" % altitude_value
    195        return self._set(str_set)

11、设置任务的阵位高度 :param altitude_value: float, 阵位高度， 单位：米，最多6位字符 :param is_submarine: bool, 是否出潜深度 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_transit_terrain_following(self, transit_terrain): View Source

    197    def set_transit_terrain_following(self, transit_terrain):
    198        """
    199        12、设置出航地形跟随
    200        :param transit_terrain: bool
    201        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    202        """
    203        str_set = "transitTerrainFollowing=%s" % str(transit_terrain).lower()
    204        return self._set(str_set)

12、设置出航地形跟随 :param transit_terrain: bool :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_station_terrain_following(self, station_terrain): View Source

    206    def set_station_terrain_following(self, station_terrain):
    207        """
    208        13、设置阵位地形跟随
    209        :param station_terrain: bool
    210        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    211        """
    212        str_set = "stationTerrainFollowingAircraft=%s" % str(station_terrain).lower()
    213        return self._set(str_set)

13、设置阵位地形跟随 :param station_terrain: bool :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def mine_set_zone(self, Zone): View Source

    215    def mine_set_zone(self, Zone):
    216        """
    217        14、设置部雷任务的区域，按顺序排列的参考点名
    218        :param Zone: 参考点列表, list,
    219        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    220        """
    221        str_set = "Zone=%s" % (str(Zone).replace("[", "{").replace("]", "}"))
    222        return self._set(str_set)

14、设置部雷任务的区域，按顺序排列的参考点名 :param Zone: 参考点列表, list, :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def mine_set_transit_terrain_following(self, transit_terrain): View Source

    224    def mine_set_transit_terrain_following(self, transit_terrain):
    225        """
    226        15、设置出航地形跟随
    227        :param transit_terrain: bool
    228        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    229        """
    230        str_set = "TransitTerrainFollowingAircraft=%s" % str(transit_terrain).lower()
    231        return self._set(str_set)

15、设置出航地形跟随 :param transit_terrain: bool :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def mine_set_station_terrain_following(self, station_terrain): View Source

    233    def mine_set_station_terrain_following(self, station_terrain):
    234        """
    235        16、阵地地形跟随
    236        :param station_terrain: bool
    237        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    238        """
    239        str_set = "stationTerrainFollowingAircraft=%s" % str(station_terrain).lower()
    240        return self._set(str_set)

16、阵地地形跟随 :param station_terrain: bool :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