# engine.LingYi.entitys.cargomission

View Source

      1# -*- coding:utf-8 -*-
      2
      3from .global_util import *
      4from .mission import Mission
      5
      6
      7class CargoMission(Mission):
      8    """
      9    货运任务类
     10    1、设置任务的出航油门
     11    2、设置任务的阵位油门
     12    3、设置任务的出航高度
     13    4、设置任务的阵位高度
     14    5、设置运送货物DBIB和数量
     15    6、货运任务区域按顺序排列的参考点名
     16
     17    示例:
     18    mission = self.get_mission_by_name('cargeo')   # 通过货运任务的名字  获取货运任务对象
     19    mission.set_transit_throttle(Throttle.Cruise)  # 设置出航油门为巡航
     20    mission.set_unload_mount(65, 5)  # 设置货运任务运输DBID为65的货物（萨姆10B车），数量为5
     21    """
     22    def __init__(self, guid, name, side_name):
     23        Mission.__init__(self, guid, name, side_name, ElementType.CargoMission)
     24        # 结构THMissionCargo中属性： 货运任务
     25        self.Type = 0  # 货运任务类型 参考ECargoMissionType定义
     26        self.TransitThrottleAircraft = 0  # 运输油门_飞机
     27        self.StationThrottleAircraft = 0  # 阵位油门_飞机
     28        self.TransitAltitudeAircraft = 0.0  # 运输高度_飞机
     29        self.StationAltitudeAircraft = 0.0  # 阵位高度_飞机
     30        self.TransitThrottleShip = 0  # 运输油门_舰艇
     31        self.StationThrottleShip = 0  # 阵位油门_舰艇
     32        self.Area = []  # 投送区域--参考点guid列表
     33        self.MountsToUnload = {}  # 卸载的货物---结构：dict<int32, int32>，key:货物类型，value：数量
     34
     35    def set_transit_throttle(self, enum_throttle, unit_category=ElementType.Aircraft):
     36        """
     37        1、设置任务的出航油门
     38        :param enum_throttle:枚举Throttle的值, 油门, global_util.py中定义
     39        :param unit_category:ElementType.Aircraft, or ElementType.Ship, or ElementType.Submarine
     40        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     41        """
     42        if unit_category == ElementType.Aircraft:
     43            str_set = "transitThrottleAircraft=%d" % (enum_throttle.value-1)
     44        elif unit_category == ElementType.Ship:
     45            str_set = "transitThrottleShip=%d" % (enum_throttle.value-1)
     46        elif unit_category == ElementType.Submarine:
     47            str_set = "transitThrottleSubmarine=%d" % (enum_throttle.value-1)
     48        else:
     49            raise ValueError("parameter unit_category value error")
     50        return self._set(str_set)
     51
     52    def set_station_throttle(self, enum_throttle, unit_category=ElementType.Aircraft):
     53        """
     54        2、设置任务的阵位油门
     55        :param enum_throttle: 枚举Throttle的值, 油门, global_util.py中定义
     56        :param unit_category:ElementType.Aircraft, or ElementType.Ship, or ElementType.Submarine
     57        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     58        """
     59        if unit_category == ElementType.Aircraft:
     60            str_set = "stationThrottleAircraft=%d" % (enum_throttle.value-1)
     61        elif unit_category == ElementType.Ship:
     62            str_set = "stationThrottleShip=%d" % (enum_throttle.value-1)
     63        elif unit_category == ElementType.Submarine:
     64            str_set = "stationThrottleSubmarine=%d" % (enum_throttle.value-1)
     65        else:
     66            raise ValueError("parameter unit_category value error")
     67        return self._set(str_set)
     68
     69    def set_transit_alt(self, altitude_value):
     70        """
     71        3、设置任务的出航高度
     72        单位是米/m，传入数据格式为浮点数
     73        :param altitude_value: float, 出航高度， 单位：米，最多6位字符，例：99999.9， 888888
     74        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     75        """
     76        str_set = "transitAltitudeAircraft=%.2lf" % altitude_value
     77        return self._set(str_set)
     78
     79    def set_station_altitude(self, altitude_value):
     80        """
     81        4、设置任务的阵位高度
     82        单位是米/m，传入数据格式为浮点数
     83        :param altitude_value: float, 阵位高度， 单位：米，最多6位字符
     84        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     85        """
     86        str_set = "stationAltitudeAircraft=%.2lf" % altitude_value
     87        return self._set(str_set)
     88
     89    def set_unload_mount(self, unload_mount_dbid, unload_mount_count):
     90        """
     91        5、设置货运任务中基地中转移货物DBIB与数量
     92        :param unload_mount_dbid: int, 货运任务中转移货物DBIB
     93        :param unload_mount_count: int, 货运任务中转移货物的数量
     94        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     95        """
     96        str_set = "unloadMountDBID=%d,unloadMountCount=%d" % (unload_mount_dbid, unload_mount_count)
     97        return self._set(str_set)
     98
     99    def cargo_set_zone(self, Zone):
    100        """
    101        6、货运任务区域按顺序排列的参考点名
    102        :param Zone: list， 参考点名列表
    103        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    104        """
    105        str_set = "Zone=%s" % (str(Zone).replace("[", "{").replace("]", "}"))
    106        return self._set(str_set)

class CargoMission(engine.LingYi.entitys.mission.Mission): View Source

      8class CargoMission(Mission):
      9    """
     10    货运任务类
     11    1、设置任务的出航油门
     12    2、设置任务的阵位油门
     13    3、设置任务的出航高度
     14    4、设置任务的阵位高度
     15    5、设置运送货物DBIB和数量
     16    6、货运任务区域按顺序排列的参考点名
     17
     18    示例:
     19    mission = self.get_mission_by_name('cargeo')   # 通过货运任务的名字  获取货运任务对象
     20    mission.set_transit_throttle(Throttle.Cruise)  # 设置出航油门为巡航
     21    mission.set_unload_mount(65, 5)  # 设置货运任务运输DBID为65的货物（萨姆10B车），数量为5
     22    """
     23    def __init__(self, guid, name, side_name):
     24        Mission.__init__(self, guid, name, side_name, ElementType.CargoMission)
     25        # 结构THMissionCargo中属性： 货运任务
     26        self.Type = 0  # 货运任务类型 参考ECargoMissionType定义
     27        self.TransitThrottleAircraft = 0  # 运输油门_飞机
     28        self.StationThrottleAircraft = 0  # 阵位油门_飞机
     29        self.TransitAltitudeAircraft = 0.0  # 运输高度_飞机
     30        self.StationAltitudeAircraft = 0.0  # 阵位高度_飞机
     31        self.TransitThrottleShip = 0  # 运输油门_舰艇
     32        self.StationThrottleShip = 0  # 阵位油门_舰艇
     33        self.Area = []  # 投送区域--参考点guid列表
     34        self.MountsToUnload = {}  # 卸载的货物---结构：dict<int32, int32>，key:货物类型，value：数量
     35
     36    def set_transit_throttle(self, enum_throttle, unit_category=ElementType.Aircraft):
     37        """
     38        1、设置任务的出航油门
     39        :param enum_throttle:枚举Throttle的值, 油门, global_util.py中定义
     40        :param unit_category:ElementType.Aircraft, or ElementType.Ship, or ElementType.Submarine
     41        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     42        """
     43        if unit_category == ElementType.Aircraft:
     44            str_set = "transitThrottleAircraft=%d" % (enum_throttle.value-1)
     45        elif unit_category == ElementType.Ship:
     46            str_set = "transitThrottleShip=%d" % (enum_throttle.value-1)
     47        elif unit_category == ElementType.Submarine:
     48            str_set = "transitThrottleSubmarine=%d" % (enum_throttle.value-1)
     49        else:
     50            raise ValueError("parameter unit_category value error")
     51        return self._set(str_set)
     52
     53    def set_station_throttle(self, enum_throttle, unit_category=ElementType.Aircraft):
     54        """
     55        2、设置任务的阵位油门
     56        :param enum_throttle: 枚举Throttle的值, 油门, global_util.py中定义
     57        :param unit_category:ElementType.Aircraft, or ElementType.Ship, or ElementType.Submarine
     58        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     59        """
     60        if unit_category == ElementType.Aircraft:
     61            str_set = "stationThrottleAircraft=%d" % (enum_throttle.value-1)
     62        elif unit_category == ElementType.Ship:
     63            str_set = "stationThrottleShip=%d" % (enum_throttle.value-1)
     64        elif unit_category == ElementType.Submarine:
     65            str_set = "stationThrottleSubmarine=%d" % (enum_throttle.value-1)
     66        else:
     67            raise ValueError("parameter unit_category value error")
     68        return self._set(str_set)
     69
     70    def set_transit_alt(self, altitude_value):
     71        """
     72        3、设置任务的出航高度
     73        单位是米/m，传入数据格式为浮点数
     74        :param altitude_value: float, 出航高度， 单位：米，最多6位字符，例：99999.9， 888888
     75        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     76        """
     77        str_set = "transitAltitudeAircraft=%.2lf" % altitude_value
     78        return self._set(str_set)
     79
     80    def set_station_altitude(self, altitude_value):
     81        """
     82        4、设置任务的阵位高度
     83        单位是米/m，传入数据格式为浮点数
     84        :param altitude_value: float, 阵位高度， 单位：米，最多6位字符
     85        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     86        """
     87        str_set = "stationAltitudeAircraft=%.2lf" % altitude_value
     88        return self._set(str_set)
     89
     90    def set_unload_mount(self, unload_mount_dbid, unload_mount_count):
     91        """
     92        5、设置货运任务中基地中转移货物DBIB与数量
     93        :param unload_mount_dbid: int, 货运任务中转移货物DBIB
     94        :param unload_mount_count: int, 货运任务中转移货物的数量
     95        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
     96        """
     97        str_set = "unloadMountDBID=%d,unloadMountCount=%d" % (unload_mount_dbid, unload_mount_count)
     98        return self._set(str_set)
     99
    100    def cargo_set_zone(self, Zone):
    101        """
    102        6、货运任务区域按顺序排列的参考点名
    103        :param Zone: list， 参考点名列表
    104        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    105        """
    106        str_set = "Zone=%s" % (str(Zone).replace("[", "{").replace("]", "}"))
    107        return self._set(str_set)

货运任务类
1、设置任务的出航油门
2、设置任务的阵位油门
3、设置任务的出航高度
4、设置任务的阵位高度
5、设置运送货物DBIB和数量
6、货运任务区域按顺序排列的参考点名

示例:
mission = self.get_mission_by_name('cargeo') # 通过货运任务的名字 获取货运任务对象
mission.set_transit_throttle(Throttle.Cruise) # 设置出航油门为巡航
mission.set_unload_mount(65, 5) # 设置货运任务运输DBID为65的货物（萨姆10B车），数量为5

CargoMission(guid, name, side_name) View Source

    23    def __init__(self, guid, name, side_name):
    24        Mission.__init__(self, guid, name, side_name, ElementType.CargoMission)
    25        # 结构THMissionCargo中属性： 货运任务
    26        self.Type = 0  # 货运任务类型 参考ECargoMissionType定义
    27        self.TransitThrottleAircraft = 0  # 运输油门_飞机
    28        self.StationThrottleAircraft = 0  # 阵位油门_飞机
    29        self.TransitAltitudeAircraft = 0.0  # 运输高度_飞机
    30        self.StationAltitudeAircraft = 0.0  # 阵位高度_飞机
    31        self.TransitThrottleShip = 0  # 运输油门_舰艇
    32        self.StationThrottleShip = 0  # 阵位油门_舰艇
    33        self.Area = []  # 投送区域--参考点guid列表
    34        self.MountsToUnload = {}  # 卸载的货物---结构：dict<int32, int32>，key:货物类型，value：数量

Type
TransitThrottleAircraft
StationThrottleAircraft
TransitAltitudeAircraft
StationAltitudeAircraft
TransitThrottleShip
StationThrottleShip
Area
MountsToUnload
def set_transit_throttle(self, enum_throttle, unit_category=<ElementType.Aircraft: 31>): View Source

    36    def set_transit_throttle(self, enum_throttle, unit_category=ElementType.Aircraft):
    37        """
    38        1、设置任务的出航油门
    39        :param enum_throttle:枚举Throttle的值, 油门, global_util.py中定义
    40        :param unit_category:ElementType.Aircraft, or ElementType.Ship, or ElementType.Submarine
    41        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    42        """
    43        if unit_category == ElementType.Aircraft:
    44            str_set = "transitThrottleAircraft=%d" % (enum_throttle.value-1)
    45        elif unit_category == ElementType.Ship:
    46            str_set = "transitThrottleShip=%d" % (enum_throttle.value-1)
    47        elif unit_category == ElementType.Submarine:
    48            str_set = "transitThrottleSubmarine=%d" % (enum_throttle.value-1)
    49        else:
    50            raise ValueError("parameter unit_category value error")
    51        return self._set(str_set)

1、设置任务的出航油门 :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

    53    def set_station_throttle(self, enum_throttle, unit_category=ElementType.Aircraft):
    54        """
    55        2、设置任务的阵位油门
    56        :param enum_throttle: 枚举Throttle的值, 油门, global_util.py中定义
    57        :param unit_category:ElementType.Aircraft, or ElementType.Ship, or ElementType.Submarine
    58        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    59        """
    60        if unit_category == ElementType.Aircraft:
    61            str_set = "stationThrottleAircraft=%d" % (enum_throttle.value-1)
    62        elif unit_category == ElementType.Ship:
    63            str_set = "stationThrottleShip=%d" % (enum_throttle.value-1)
    64        elif unit_category == ElementType.Submarine:
    65            str_set = "stationThrottleSubmarine=%d" % (enum_throttle.value-1)
    66        else:
    67            raise ValueError("parameter unit_category value error")
    68        return self._set(str_set)

2、设置任务的阵位油门 :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): View Source

    70    def set_transit_alt(self, altitude_value):
    71        """
    72        3、设置任务的出航高度
    73        单位是米/m，传入数据格式为浮点数
    74        :param altitude_value: float, 出航高度， 单位：米，最多6位字符，例：99999.9， 888888
    75        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    76        """
    77        str_set = "transitAltitudeAircraft=%.2lf" % altitude_value
    78        return self._set(str_set)

3、设置任务的出航高度 单位是米/m，传入数据格式为浮点数 :param altitude_value: float, 出航高度， 单位：米，最多6位字符，例：99999.9， 888888 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_station_altitude(self, altitude_value): View Source

    80    def set_station_altitude(self, altitude_value):
    81        """
    82        4、设置任务的阵位高度
    83        单位是米/m，传入数据格式为浮点数
    84        :param altitude_value: float, 阵位高度， 单位：米，最多6位字符
    85        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    86        """
    87        str_set = "stationAltitudeAircraft=%.2lf" % altitude_value
    88        return self._set(str_set)

4、设置任务的阵位高度 单位是米/m，传入数据格式为浮点数 :param altitude_value: float, 阵位高度， 单位：米，最多6位字符 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def set_unload_mount(self, unload_mount_dbid, unload_mount_count): View Source

    90    def set_unload_mount(self, unload_mount_dbid, unload_mount_count):
    91        """
    92        5、设置货运任务中基地中转移货物DBIB与数量
    93        :param unload_mount_dbid: int, 货运任务中转移货物DBIB
    94        :param unload_mount_count: int, 货运任务中转移货物的数量
    95        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    96        """
    97        str_set = "unloadMountDBID=%d,unloadMountCount=%d" % (unload_mount_dbid, unload_mount_count)
    98        return self._set(str_set)

5、设置货运任务中基地中转移货物DBIB与数量 :param unload_mount_dbid: int, 货运任务中转移货物DBIB :param unload_mount_count: int, 货运任务中转移货物的数量 :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似

def cargo_set_zone(self, Zone): View Source

    100    def cargo_set_zone(self, Zone):
    101        """
    102        6、货运任务区域按顺序排列的参考点名
    103        :param Zone: list， 参考点名列表
    104        :return: 指令执行结果, Reply对象, 和global_util.py中Reply类定义类似
    105        """
    106        str_set = "Zone=%s" % (str(Zone).replace("[", "{").replace("]", "}"))
    107        return self._set(str_set)

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

##### Inherited Members

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