📄 pilothelpergui.java.svn-base
字号:
package gui;import java.util.List;import world.Airport;import world.Runway;import world.Taxiway;import world.Gate;import world.Strip;import world.TRACON;import world.Weather;import world.Waypoint;import base.WorldObject;//import interfaces.PilotInterface;//import agents.GroundControllerAgent;//import agents.LocalControllerAgent;public class PilotHelperGUI extends WorldObject// implements PilotInterface{ //private Airport airport; private PilotGUI pilotGUI; private CoPilotHelperGUI coPilot; private ClearanceDeliveryHelper clearanceDelivery; //arrival private String callNumber; private Runway runway; private Gate gate; private String approach; private String destination; private List<Runway> path; private LocalControlHelperGUI localController; private Runway lastPath; private List<Taxiway> taxiInstruction; private Strip arrival; //departure private Weather report; private GroundControlHelperGUI groundController; private List<Waypoint> procedure; private Runway takeoffRunway; private TRACON departureControl; private Taxiway currentPosition; public PilotHelperGUI( Airport airportTemp, PilotGUI pilotGUITemp, CoPilotHelperGUI coPilotTemp ) { //airport = airportTemp; pilotGUI = pilotGUITemp; coPilot = coPilotTemp; clearanceDelivery = null; callNumber = ""; runway = null; gate = null; approach = ""; destination = ""; path = null; localController = null; lastPath = null; taxiInstruction = null; arrival = null; report = null; groundController = null; procedure = null; takeoffRunway = null; departureControl = null; currentPosition = null; updateInfo(); } private void updateInfo() { pilotGUI.update( runway, gate, approach, destination, path, localController, lastPath, taxiInstruction, arrival, report, groundController, procedure, takeoffRunway, departureControl ); } public void setClearanceDelivery( ClearanceDeliveryHelper clearanceDelivery ) { this.clearanceDelivery = clearanceDelivery; } //arrival public void msgNewArrivingFlight( String callNumber, Runway runway, Gate gate, LocalControlHelperGUI localController ) { this.callNumber = callNumber; this.runway = runway; this.gate = gate; this.localController = localController; pilotGUI.getMessageWindow().addMessage( "New Arriving Flight" ); String[] options = { "Prepare For Landing" }; pilotGUI.getRadioWindow().changeOptions( options ); updateInfo(); } public void msgArrivalChecklistSuccessful() { pilotGUI.getMessageWindow().addMessage( "Arrival Checklist Successful" ); String[] options = { "Request To Land" }; pilotGUI.getRadioWindow().changeOptions( options ); } public void msgNotClearedToLand() { pilotGUI.getMessageWindow().addMessage( "Not Cleared To Land" ); } public void msgClearedToLand( Runway runway ) { this.runway = runway; pilotGUI.getMessageWindow().addMessage( "Cleared To Land" ); String[] options = { "Confirm Clearance To Land" }; pilotGUI.getRadioWindow().changeOptions( options ); updateInfo(); } public void msgLandingPath( List<Runway> path, GroundControlHelperGUI groundController ) { this.path = path; this.groundController = groundController; pilotGUI.getMessageWindow().addMessage( "Landing Path" ); String[] options = { "Confirm Landing Path" }; pilotGUI.getRadioWindow().changeOptions( options ); updateInfo(); } public void msgTaxiLandingPath( List<Taxiway> taxiInstruction ) { this.taxiInstruction = taxiInstruction; pilotGUI.getMessageWindow().addMessage( "Taxi Landing Path" ); String[] options = { "Confirm Taxi Landing Path" }; pilotGUI.getRadioWindow().changeOptions( options ); updateInfo(); } //departure public void msgNewDepartingFlight( String callNumber, Runway runway, Gate gate, String destination ) { this.callNumber = callNumber; this.runway = runway; this.gate = gate; this.destination = destination; pilotGUI.getMessageWindow().addMessage( "New Departing Flight" ); String[] options = { "Requesting Clearance" }; pilotGUI.getRadioWindow().changeOptions( options ); updateInfo(); } public void msgClearanceGranted( List<Waypoint> procedure, GroundControlHelperGUI groundController ) { this.procedure = procedure; this.groundController = groundController; pilotGUI.getMessageWindow().addMessage( "Clearance Granted" ); String[] options = { "Confirm Clearance Granted" }; pilotGUI.getRadioWindow().changeOptions( options ); updateInfo(); } public void msgSendWeather( Weather report ) { this.report = report; pilotGUI.getMessageWindow().addMessage( "Send Weather" ); String[] options = { "Confirm Weather" }; pilotGUI.getRadioWindow().changeOptions( options ); updateInfo(); } public void msgDepartureChecklistSuccessful() { pilotGUI.getMessageWindow().addMessage( "Departure Checklist Successful" ); String[] options = { "Request Push Back" }; pilotGUI.getRadioWindow().changeOptions( options ); } public void msgGivePushBack( Runway takeoffRunway, Gate gate ) { this.takeoffRunway = takeoffRunway; this.gate = gate; pilotGUI.getMessageWindow().addMessage( "Give Push Back" ); String[] options = { "Confirm Push Back" }; pilotGUI.getRadioWindow().changeOptions( options ); updateInfo(); } public void msgTaxiTakeoffPath( List<Taxiway> taxiInstruction, LocalControlHelperGUI localController ) { this.taxiInstruction = taxiInstruction; this.localController = localController; pilotGUI.getMessageWindow().addMessage( "Taxi Takeoff Path" ); String[] options = { "Confirm Taxi Takeoff Path" }; pilotGUI.getRadioWindow().changeOptions( options ); updateInfo(); } public void msgPositionAndHold() { pilotGUI.getMessageWindow().addMessage( "Position And Hold" ); String[] options = { "Confirm Position And Hold" }; pilotGUI.getRadioWindow().changeOptions( options ); } public void msgClearedForTakeoff( Runway takeoffRunway ) { this.takeoffRunway = takeoffRunway; pilotGUI.getMessageWindow().addMessage( "Cleared For Takeoff" ); String[] options = { "Confirm Cleared For Takeoff" }; pilotGUI.getRadioWindow().changeOptions( options ); updateInfo(); } public void msgContactDepartureControl( TRACON departureControl ) { this.departureControl = departureControl; pilotGUI.getMessageWindow().addMessage( "Contact Departure Control" ); String[] options = { "Confirm Departure Control" }; pilotGUI.getRadioWindow().changeOptions( options ); updateInfo(); } //nonnormative public void coPilotTakingOverAsPilot() { pilotGUI.getMessageWindow().addMessage( "coPilot Taking Over As Pilot" ); String[] options = { "Pilot Is Back" }; pilotGUI.getRadioWindow().changeOptions( options ); } public void arrivalChecklistUnsuccessful() { pilotGUI.getMessageWindow().addMessage( "Arrival Checklist Unsuccessful" ); String[] options = { "Not Ready To Request Landing" }; pilotGUI.getRadioWindow().changeOptions( options ); } public void arrivalChecklistSuccessful() { pilotGUI.getMessageWindow().addMessage( "Arrival Checklist Successful" ); String[] options = { "Ready To Request Landing" }; pilotGUI.getRadioWindow().changeOptions( options ); } public void departureChecklistSuccessful() { pilotGUI.getMessageWindow().addMessage( "Departure Checklist Successful" ); String[] options = { "Request Push Back" }; pilotGUI.getRadioWindow().changeOptions( options ); } public void departureChecklistUnsuccessful() { pilotGUI.getMessageWindow().addMessage( "Departure Checklist Unsuccessful" ); String[] options = { "Not Ready To Push Back" }; pilotGUI.getRadioWindow().changeOptions( options ); } public void seriousEmergency_LandNow() { pilotGUI.getMessageWindow().addMessage( "Serious Emergency Land Now" ); String[] options = { "Emergency Landing" }; pilotGUI.getRadioWindow().changeOptions( options ); } /* out messages */ //arrivals public void msgPrepareForLanding() { coPilot.msgPrepareForLanding(); } public void msgRequestToLand() { localController.msgRequestToLand( callNumber, approach, runway ); } public void msgConfirmClearanceToLand() { localController.msgConfirmClearanceToLand( callNumber, runway ); } public void msgConfirmLandingPath() { localController.msgConfirmLandingPath( callNumber, taxiInstruction, groundController ); } public void msgLeavingRunway() { groundController.msgLeavingRunway( callNumber, lastPath, gate ); } public void msgConfirmTaxiLandingPath() { groundController.msgConfirmTaxiLandingPath( callNumber, taxiInstruction ); } //departures public void msgRequestingClearance() { clearanceDelivery.msgRequestingClearance( callNumber, gate ); } public void msgConfirmClearanceGranted() { //clearanceDelivery.msgConfirmClearanceGranted() // this is missing } public void msgConfirmWeather() { clearanceDelivery.msgConfirmWeather( callNumber ); } public void msgPrepareForDeparture() { coPilot.msgPrepareForDeparture(); } public void msgRequestPushBack() { groundController.msgRequestPushBack( callNumber, gate ); } public void msgConfirmPushBack() { groundController.msgConfirmPushBack( callNumber, takeoffRunway, gate ); } public void msgReadyForTaxi() { groundController.msgReadyForTaxi( callNumber, currentPosition ); } public void msgConfirmTaxiTakeoffPath() { groundController.msgConfirmTaxiTakeoffPath( callNumber, taxiInstruction, localController ); } public void msgReadyForTakeoff() { localController.msgReadyForTakeoff( callNumber, runway ); } public void msgConfirmPositionAndHold() { localController.msgConfirmPositionAndHold( callNumber ); } public void msgConfirmClearedForTakeoff() { localController.msgConfirmClearedForTakeoff( callNumber, takeoffRunway ); } public void msgConfirmDepartureControl() { localController.msgConfirmDepartureControl( callNumber ); } //non normative public void pilotUnavailable() { coPilot.pilotUnavailable(); } public void pilotIsBack() { coPilot.pilotIsBack(); } public void notReadyToRequestLanding() { localController.msgNotReadyToRequestLanding( callNumber ); } public void requestToLand() { localController.msgRequestToLand( callNumber, approach, runway ); } public void prepareForArrival() { coPilot.prepareForArrival(); } public void notReadyToPushBack() { //groundController.msgNotReadyToPushBack(); //missing } public void requestPushBack() { groundController.msgRequestPushBack( callNumber, gate ); } public void prepareForDeparture() { coPilot.prepareForDeparture(); } public void emergencyLanding() { localController.msgEmergencyLanding( callNumber, approach, runway ); } public void clearanceForEmergencyLanding() { //localController.msgClearanceForEmergencyLanding()//missing }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -