ProcedureCollection#
- class ansys.stk.core.stkobjects.aviator.ProcedureCollection#
Class defining the collection of procedures in the phase of an Aviator mission.
Overview#
Given an index, returns an element in the collection. |
|
Add a procedure with the specified site at the end of the current phase. |
|
Add a procedure with the specified site at the given index. |
|
Remove given procedure. |
|
Remove procedure at the given index. |
|
Enable automatically propagating the mission. Aviator will automatically propagate before adding a procedure, ensuring a valid initial state for the new procedure. |
|
Disable automatically propagating the mission. Use with caution. Aviator will not automatically propagate before adding new procedures. |
Examples#
Add a takeoff procedure from a runway
# IProcedureCollection procedures: Procedure Collection object
# Add a takeoff procedure with a runway as a site
takeoff = procedures.add(SiteType.SITE_RUNWAY, ProcedureType.PROCEDURE_TAKEOFF)
# Get the runway heading options
headingOptions = takeoff.runway_heading_options
# Opt to use the headwind runway
headingOptions.runway_mode = RunwayHighLowEnd.HEADWIND
# Set the takeoff mode and get that interface
takeoff.takeoff_mode = TakeoffMode.TAKEOFF_NORMAL
takeoffNormal = takeoff.mode_as_normal
# Set the takeoff climb angle
takeoffNormal.takeoff_climb_angle = 5
# Set the departure altitude above the runway
takeoffNormal.departure_altitude = 600
# Set the altitude offset for the runway
takeoffNormal.runway_altitude_offset = 10
# Use terrain for the runway's altitude
takeoffNormal.use_runway_terrain = True
Add and configure a landing procedure
# IProcedureCollection procedures: Procedure Collection object
# Add a landing procedure
landing = procedures.add(SiteType.SITE_RUNWAY, ProcedureType.PROCEDURE_LANDING)
# Get the runway heading options
headingOptions = landing.runway_heading_options
# Land from the low end
headingOptions.runway_mode = RunwayHighLowEnd.LOW_END
# Use a standard instrument approach
landing.approach_mode = ApproachMode.STANDARD_INSTRUMENT_APPROACH
# Get the options for a standard instrument approach
sia = landing.mode_as_standard_instrument_approach
# Change the approach altitude
sia.approach_altitude = 1000
# Change the glideslope
sia.glideslope = 4
# Offset the runway altitude
sia.runway_altitude_offset = 10
# Use the terrain as an altitude reference for the runway
sia.use_runway_terrain = True
Add and configure an en-route procedure
# IProcedureCollection procedures: Procedure Collection object
# Add an enroute procedure with a site type of End of Previous Procedure
enroute = procedures.add_at_index(1, SiteType.SITE_END_OF_PREV_PROCEDURE, ProcedureType.PROCEDURE_ENROUTE)
# Get the altitude options
altitudeOptions = enroute.altitude_msl_options
# To specify an altitude, turn off the option to use the default cruise altitude
altitudeOptions.use_default_cruise_altitude = False
# Set the altitude
altitudeOptions.msl_altitude = 10000
# Get the navigation options
navigationOptions = enroute.navigation_options
# Set the route to arrive on a specified course
navigationOptions.navigation_mode = PointToPointMode.ARRIVE_ON_COURSE
# Set the course
navigationOptions.arrive_on_course = 30
# Use a magnetic heading
navigationOptions.use_magnetic_heading = True
# Get the navigation options
airspeedOptions = enroute.enroute_cruise_airspeed_options
# Fly at max speed
airspeedOptions.cruise_speed_type = CruiseSpeed.MAX_AIRSPEED
# To specify an airspeed to fly at, set the speed type to other airspeed
airspeedOptions.cruise_speed_type = CruiseSpeed.OTHER_AIRSPEED
# Then set the airspeed and airspeed type
airspeedOptions.set_other_airspeed(AirspeedType.TAS, 200)
Add and configure a basic maneuver procedure
# IProcedureCollection procedures: Procedure Collection object
# Add a basic maneuver procedure
basicManeuver = procedures.add(SiteType.SITE_END_OF_PREV_PROCEDURE, ProcedureType.PROCEDURE_BASIC_MANEUVER)
# Set the navigation to use a Straight Ahead strategy
basicManeuver.navigation_strategy_type = "Straight Ahead"
# Get the options for the straight ahead strategy
straightAhead = basicManeuver.navigation
# Opt to maintain course (as opposed to maintain heading)
straightAhead.reference_frame = StraightAheadReferenceFrame.MAINTAIN_COURSE
# Set the profile to use a Autopilot - Vertical Plane strategy
basicManeuver.profile_strategy_type = "Autopilot - Vertical Plane"
# Get the options for the profile strategy
autopilot = basicManeuver.profile
# Opt to maintain the initial altitude
autopilot.altitude_mode = AutopilotAltitudeMode.AUTOPILOT_HOLD_INIT_ALTITUDE
airspeedOptions = autopilot.airspeed_options
# Opt to maintain a specified airspeed
airspeedOptions.airspeed_mode = BasicManeuverAirspeedMode.MAINTAIN_SPECIFIED_AIRSPEED
# Specify the airspeed
airspeedOptions.specified_airspeed = 250
# Configure the options on the Attitude / Performance / Fuel page
basicManeuver.flight_mode = PhaseOfFlight.FLIGHT_PHASE_CRUISE
# Override the fuel flow
basicManeuver.fuel_flow_type = BasicManeuverFuelFlowType.BASIC_MANEUVER_FUEL_FLOW_OVERRIDE
basicManeuver.override_fuel_flow_value = 1000
# Set the basic stopping conditions
basicManeuver.use_max_downrange = True
basicManeuver.max_downrange = 10
basicManeuver.use_stop_fuel_state = False
basicManeuver.use_max_time_of_flight = False
Add and remove procedures
# IProcedureCollection procedures: Procedure Collection object
# AviatorPropagator propagator: Aviator Propagator object
# Add a takeoff procedure with a runway as a site. This will add the procedure
takeoff = procedures.add(SiteType.SITE_RUNWAY, ProcedureType.PROCEDURE_TAKEOFF)
# Add a procedure at a given index (starting from 0)
enroute = procedures.add_at_index(1, SiteType.SITE_END_OF_PREV_PROCEDURE, ProcedureType.PROCEDURE_ENROUTE)
# Make sure to propagate the mission to calculate the route
propagator.propagate()
# Get the mission
mission = propagator.aviator_mission
# Check to see if the mission is valid (must first be propagated)
isValid = mission.is_valid
# Get the number of procedures
procedureCount = procedures.count
# Remove the procedure at the given index
procedures.remove_at_index(1)
# Remove the given procedure
procedures.remove(takeoff)
# Propagate the mission
propagator.propagate()
Import detail#
from ansys.stk.core.stkobjects.aviator import ProcedureCollection
Property detail#
- property ProcedureCollection._new_enum: EnumeratorProxy#
Return an enumerator that can iterate through the collection.
Method detail#
- ProcedureCollection.item(self, index: int) IProcedure #
Given an index, returns an element in the collection.
- Parameters:
index :
int
- Returns:
IProcedure
- ProcedureCollection.add(self, site_type: SiteType, procedure_type: ProcedureType) IProcedure #
Add a procedure with the specified site at the end of the current phase.
- Parameters:
site_type :
SiteType
procedure_type :
ProcedureType
- Returns:
IProcedure
- ProcedureCollection.add_at_index(self, index: int, site_type: SiteType, procedure_type: ProcedureType) IProcedure #
Add a procedure with the specified site at the given index.
- Parameters:
index :
int
site_type :
SiteType
procedure_type :
ProcedureType
- Returns:
IProcedure
- ProcedureCollection.remove(self, procedure: IProcedure) None #
Remove given procedure.
- Parameters:
procedure :
IProcedure
- Returns: