Documentation
¶
Index ¶
- func BroadcastMessage(hostname, msg, password string, lg *log.Logger)
- func TryConnectRemoteServer(hostname string, lg *log.Logger) chan *serverConnection
- type ConnectionManager
- func (cm *ConnectionManager) ClientIsLocal() bool
- func (cm *ConnectionManager) ConnectToSim(config server.JoinSimRequest, initials string, srv *Server, lg *log.Logger) error
- func (cm *ConnectionManager) Connected() bool
- func (cm *ConnectionManager) ConnectionStartTime() time.Time
- func (cm *ConnectionManager) CreateNewSim(config server.NewSimRequest, initials string, srv *Server, lg *log.Logger) error
- func (cm *ConnectionManager) Disconnect()
- func (cm *ConnectionManager) GetMETAR(srv *Server, airports []string, callback func(map[string][]wx.METAR, error))
- func (cm *ConnectionManager) LoadLocalSim(s *sim.Sim, initials string, lg *log.Logger) (*ControlClient, error)
- func (cm *ConnectionManager) Update(es *sim.EventStream, p platform.Platform, lg *log.Logger)
- func (cm *ConnectionManager) UpdateRunningSims() error
- type ControlClient
- func (c *ControlClient) AcceptHandoff(acid sim.ACID, callback func(error))
- func (c *ControlClient) AcceptRedirectedHandoff(acid sim.ACID, callback func(error))
- func (c *ControlClient) AcknowledgePointOut(acid sim.ACID, callback func(error))
- func (c *ControlClient) ActivateFlightPlan(callsign av.ADSBCallsign, fpACID sim.ACID, spec sim.FlightPlanSpecifier, ...)
- func (c *ControlClient) AirspaceForTCW(tcw sim.TCW) []av.ControllerAirspaceVolume
- func (c *ControlClient) AllowRadioTransmissions()
- func (c *ControlClient) AssociateFlightPlan(callsign av.ADSBCallsign, spec sim.FlightPlanSpecifier, callback func(error))
- func (c *ControlClient) CancelHandoff(acid sim.ACID, callback func(error))
- func (c *ControlClient) ConfigureATPA(op sim.ATPAConfigOp, volumeId string, callback func(output string, err error))
- func (c *ControlClient) Connected() bool
- func (c *ControlClient) ConsolidateTCP(receivingTCW sim.TCW, sendingTCP sim.TCP, consType sim.ConsolidationType, ...)
- func (c *ControlClient) CreateArrival(group, airport string, ac *sim.Aircraft, callback func(error))
- func (c *ControlClient) CreateDeparture(airport, runway, category string, rules av.FlightRules, ac *sim.Aircraft, ...)
- func (c *ControlClient) CreateFlightPlan(spec sim.FlightPlanSpecifier, callback func(error))
- func (c *ControlClient) CreateOverflight(group string, ac *sim.Aircraft, callback func(error))
- func (c *ControlClient) CreateRestrictionArea(ra av.RestrictionArea, callback func(int, error))
- func (c *ControlClient) CurrentTime() time.Time
- func (c *ControlClient) DeconsolidateTCP(tcp sim.TCP, callback func(error))
- func (c *ControlClient) DeleteAircraft(aircraft []sim.Aircraft, callback func(err error))
- func (c *ControlClient) DeleteAllAircraft(callback func(err error))
- func (c *ControlClient) DeleteFlightPlan(acid sim.ACID, callback func(error))
- func (c *ControlClient) DeleteRestrictionArea(idx int, callback func(error))
- func (c *ControlClient) Disconnect()
- func (c *ControlClient) FastForward()
- func (c *ControlClient) FlightPlanDirect(aircraft sim.ACID, fix string, callback func(err error))
- func (c *ControlClient) ForceQL(acid sim.ACID, to sim.ControlPosition, callback func(error))
- func (c *ControlClient) GetAircraftDisplayState(callsign av.ADSBCallsign) (sim.AircraftDisplayState, error)
- func (c *ControlClient) GetAtmosGrid(t time.Time, callback func(*wx.AtmosGrid, error))
- func (c *ControlClient) GetPrecipURL(t time.Time, callback func(url string, nextTime time.Time, err error))
- func (c *ControlClient) GetSerializeSim() (*sim.Sim, error)
- func (c *ControlClient) GetSimRate() float32
- func (c *ControlClient) GetUpdates(eventStream *sim.EventStream, p platform.Platform, onErr func(error))
- func (c *ControlClient) GetVideoMapLibrary(filename string) (*sim.VideoMapLibrary, error)
- func (c *ControlClient) HandoffTrack(acid sim.ACID, to sim.ControlPosition, callback func(error))
- func (c *ControlClient) HaveTTS() bool
- func (c *ControlClient) HoldRadioTransmissions()
- func (c *ControlClient) LastTTSCallsign() av.ADSBCallsign
- func (c *ControlClient) LaunchArrivalOverflight(ac sim.Aircraft)
- func (c *ControlClient) LaunchDeparture(ac sim.Aircraft, rwy string)
- func (c *ControlClient) ModifyFlightPlan(acid sim.ACID, spec sim.FlightPlanSpecifier, callback func(error))
- func (c *ControlClient) PointOut(acid sim.ACID, to sim.ControlPosition, callback func(error))
- func (c *ControlClient) RPCClient() *RPCClient
- func (c *ControlClient) RadioIsActive() bool
- func (c *ControlClient) RecallPointOut(acid sim.ACID, callback func(error))
- func (c *ControlClient) RedirectHandoff(acid sim.ACID, to sim.ControlPosition, callback func(error))
- func (c *ControlClient) RejectPointOut(acid sim.ACID, callback func(error))
- func (c *ControlClient) ReleaseDeparture(callsign av.ADSBCallsign, callback func(error))
- func (c *ControlClient) RepositionTrack(acid sim.ACID, callsign av.ADSBCallsign, p math.Point2LL, callback func(error))
- func (c *ControlClient) RequestFlightFollowing()
- func (c *ControlClient) RunAircraftCommands(callsign av.ADSBCallsign, cmds string, multiple, clickedTrack bool, ...)
- func (c *ControlClient) SendGlobalMessage(message string)
- func (c *ControlClient) SendRouteCoordinates(aircraft sim.ACID, callback func(err error))
- func (c *ControlClient) SetLaunchConfig(lc sim.LaunchConfig)
- func (c *ControlClient) SetSimRate(r float32)
- func (c *ControlClient) SetWaypointCommands(commands string)
- func (c *ControlClient) Status() string
- func (c *ControlClient) StringIsSPC(s string) bool
- func (c *ControlClient) TakeOrReturnLaunchControl(eventStream *sim.EventStream)
- func (c *ControlClient) ToggleSimPause()
- func (c *ControlClient) TowerListAirports() []string
- func (c *ControlClient) TriggerEmergency(emergencyName string)
- func (c *ControlClient) UpdateRestrictionArea(idx int, ra av.RestrictionArea, callback func(error))
- type RPCClient
- type Server
- type SessionStats
- type SimState
- func (ss *SimState) BeaconCodeInUse(sq av.Squawk) bool
- func (ss *SimState) GetAllReleaseDepartures() []sim.ReleaseDeparture
- func (ss *SimState) GetFlightPlanForACID(acid sim.ACID) *sim.NASFlightPlan
- func (ss *SimState) GetInitialCenter() math.Point2LL
- func (ss *SimState) GetInitialRange() float32
- func (ss *SimState) GetOurTrackByACID(acid sim.ACID) (*sim.Track, bool)
- func (ss *SimState) GetOurTrackByCallsign(callsign av.ADSBCallsign) (*sim.Track, bool)
- func (ss *SimState) GetRegularReleaseDepartures() []sim.ReleaseDeparture
- func (ss *SimState) GetSTARSReleaseDepartures() []sim.ReleaseDeparture
- func (ss *SimState) GetTrackByACID(acid sim.ACID) (*sim.Track, bool)
- func (ss *SimState) GetTrackByCallsign(callsign av.ADSBCallsign) (*sim.Track, bool)
- func (ss *SimState) GetTrackByFLID(flid string) (*sim.Track, bool)
- func (ss *SimState) GetUserConsolidation() *sim.TCPConsolidation
- func (ss *SimState) UserControlsPosition(pos sim.ControlPosition) bool
- func (ss *SimState) UserControlsTrack(track *sim.Track) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BroadcastMessage ¶
func TryConnectRemoteServer ¶
Types ¶
type ConnectionManager ¶
type ConnectionManager struct {
LocalServer *Server
RemoteServer *Server
// contains filtered or unexported fields
}
func MakeServerManager ¶
func MakeServerManager(serverAddress, additionalScenario, additionalVideoMap string, lg *log.Logger, onNewClient func(*ControlClient), onError func(error)) (*ConnectionManager, util.ErrorLogger, string)
func (*ConnectionManager) ClientIsLocal ¶
func (cm *ConnectionManager) ClientIsLocal() bool
func (*ConnectionManager) ConnectToSim ¶
func (cm *ConnectionManager) ConnectToSim(config server.JoinSimRequest, initials string, srv *Server, lg *log.Logger) error
func (*ConnectionManager) Connected ¶
func (cm *ConnectionManager) Connected() bool
func (*ConnectionManager) ConnectionStartTime ¶
func (cm *ConnectionManager) ConnectionStartTime() time.Time
func (*ConnectionManager) CreateNewSim ¶
func (cm *ConnectionManager) CreateNewSim(config server.NewSimRequest, initials string, srv *Server, lg *log.Logger) error
func (*ConnectionManager) Disconnect ¶
func (cm *ConnectionManager) Disconnect()
func (*ConnectionManager) LoadLocalSim ¶
func (cm *ConnectionManager) LoadLocalSim(s *sim.Sim, initials string, lg *log.Logger) (*ControlClient, error)
func (*ConnectionManager) Update ¶
func (cm *ConnectionManager) Update(es *sim.EventStream, p platform.Platform, lg *log.Logger)
func (*ConnectionManager) UpdateRunningSims ¶ added in v0.13.3
func (cm *ConnectionManager) UpdateRunningSims() error
type ControlClient ¶
type ControlClient struct {
SessionStats SessionStats
// This is all read-only data that we expect other parts of the system
// to access directly.
State SimState
// contains filtered or unexported fields
}
func NewControlClient ¶
func (*ControlClient) AcceptHandoff ¶
func (c *ControlClient) AcceptHandoff(acid sim.ACID, callback func(error))
func (*ControlClient) AcceptRedirectedHandoff ¶
func (c *ControlClient) AcceptRedirectedHandoff(acid sim.ACID, callback func(error))
func (*ControlClient) AcknowledgePointOut ¶
func (c *ControlClient) AcknowledgePointOut(acid sim.ACID, callback func(error))
func (*ControlClient) ActivateFlightPlan ¶
func (c *ControlClient) ActivateFlightPlan(callsign av.ADSBCallsign, fpACID sim.ACID, spec sim.FlightPlanSpecifier, callback func(error))
func (*ControlClient) AirspaceForTCW ¶ added in v0.13.3
func (c *ControlClient) AirspaceForTCW(tcw sim.TCW) []av.ControllerAirspaceVolume
func (*ControlClient) AllowRadioTransmissions ¶
func (c *ControlClient) AllowRadioTransmissions()
func (*ControlClient) AssociateFlightPlan ¶
func (c *ControlClient) AssociateFlightPlan(callsign av.ADSBCallsign, spec sim.FlightPlanSpecifier, callback func(error))
func (*ControlClient) CancelHandoff ¶
func (c *ControlClient) CancelHandoff(acid sim.ACID, callback func(error))
func (*ControlClient) ConfigureATPA ¶ added in v0.13.3
func (c *ControlClient) ConfigureATPA(op sim.ATPAConfigOp, volumeId string, callback func(output string, err error))
func (*ControlClient) Connected ¶
func (c *ControlClient) Connected() bool
func (*ControlClient) ConsolidateTCP ¶ added in v0.13.3
func (c *ControlClient) ConsolidateTCP(receivingTCW sim.TCW, sendingTCP sim.TCP, consType sim.ConsolidationType, callback func(error))
ConsolidateTCP consolidates the sendingTCP to the receivingTCW's keyboard. sim.ConsolidationFull transfers active tracks; sim.ConsolidationBasic only inactive/future flights.
func (*ControlClient) CreateArrival ¶
func (c *ControlClient) CreateArrival(group, airport string, ac *sim.Aircraft, callback func(error))
func (*ControlClient) CreateDeparture ¶
func (c *ControlClient) CreateDeparture(airport, runway, category string, rules av.FlightRules, ac *sim.Aircraft, callback func(error))
func (*ControlClient) CreateFlightPlan ¶
func (c *ControlClient) CreateFlightPlan(spec sim.FlightPlanSpecifier, callback func(error))
func (*ControlClient) CreateOverflight ¶
func (c *ControlClient) CreateOverflight(group string, ac *sim.Aircraft, callback func(error))
func (*ControlClient) CreateRestrictionArea ¶
func (c *ControlClient) CreateRestrictionArea(ra av.RestrictionArea, callback func(int, error))
func (*ControlClient) CurrentTime ¶
func (c *ControlClient) CurrentTime() time.Time
CurrentTime returns an extrapolated value that models the current Sim's time. (Because the Sim may be running remotely, we have to make some approximations, though they shouldn't cause much trouble since we get an update from the Sim at least once a second...)
func (*ControlClient) DeconsolidateTCP ¶ added in v0.13.3
func (c *ControlClient) DeconsolidateTCP(tcp sim.TCP, callback func(error))
DeconsolidateTCP returns a secondary TCP to its default keyboard. If tcp is empty, deconsolidates the default TCP for the TCW (i.e., the TCP one with the same name) back to the user's TCW.
func (*ControlClient) DeleteAircraft ¶
func (c *ControlClient) DeleteAircraft(aircraft []sim.Aircraft, callback func(err error))
func (*ControlClient) DeleteAllAircraft ¶
func (c *ControlClient) DeleteAllAircraft(callback func(err error))
func (*ControlClient) DeleteFlightPlan ¶
func (c *ControlClient) DeleteFlightPlan(acid sim.ACID, callback func(error))
func (*ControlClient) DeleteRestrictionArea ¶
func (c *ControlClient) DeleteRestrictionArea(idx int, callback func(error))
func (*ControlClient) Disconnect ¶
func (c *ControlClient) Disconnect()
func (*ControlClient) FastForward ¶
func (c *ControlClient) FastForward()
func (*ControlClient) FlightPlanDirect ¶ added in v0.13.0
func (c *ControlClient) FlightPlanDirect(aircraft sim.ACID, fix string, callback func(err error))
func (*ControlClient) ForceQL ¶
func (c *ControlClient) ForceQL(acid sim.ACID, to sim.ControlPosition, callback func(error))
func (*ControlClient) GetAircraftDisplayState ¶
func (c *ControlClient) GetAircraftDisplayState(callsign av.ADSBCallsign) (sim.AircraftDisplayState, error)
func (*ControlClient) GetAtmosGrid ¶ added in v0.13.0
func (*ControlClient) GetPrecipURL ¶ added in v0.13.0
func (*ControlClient) GetSerializeSim ¶
func (c *ControlClient) GetSerializeSim() (*sim.Sim, error)
func (*ControlClient) GetSimRate ¶
func (c *ControlClient) GetSimRate() float32
func (*ControlClient) GetUpdates ¶
func (c *ControlClient) GetUpdates(eventStream *sim.EventStream, p platform.Platform, onErr func(error))
func (*ControlClient) GetVideoMapLibrary ¶
func (c *ControlClient) GetVideoMapLibrary(filename string) (*sim.VideoMapLibrary, error)
func (*ControlClient) HandoffTrack ¶
func (c *ControlClient) HandoffTrack(acid sim.ACID, to sim.ControlPosition, callback func(error))
func (*ControlClient) HaveTTS ¶
func (c *ControlClient) HaveTTS() bool
func (*ControlClient) HoldRadioTransmissions ¶
func (c *ControlClient) HoldRadioTransmissions()
func (*ControlClient) LastTTSCallsign ¶
func (c *ControlClient) LastTTSCallsign() av.ADSBCallsign
func (*ControlClient) LaunchArrivalOverflight ¶
func (c *ControlClient) LaunchArrivalOverflight(ac sim.Aircraft)
func (*ControlClient) LaunchDeparture ¶
func (c *ControlClient) LaunchDeparture(ac sim.Aircraft, rwy string)
func (*ControlClient) ModifyFlightPlan ¶
func (c *ControlClient) ModifyFlightPlan(acid sim.ACID, spec sim.FlightPlanSpecifier, callback func(error))
func (*ControlClient) PointOut ¶
func (c *ControlClient) PointOut(acid sim.ACID, to sim.ControlPosition, callback func(error))
func (*ControlClient) RPCClient ¶
func (c *ControlClient) RPCClient() *RPCClient
func (*ControlClient) RadioIsActive ¶
func (c *ControlClient) RadioIsActive() bool
func (*ControlClient) RecallPointOut ¶
func (c *ControlClient) RecallPointOut(acid sim.ACID, callback func(error))
func (*ControlClient) RedirectHandoff ¶
func (c *ControlClient) RedirectHandoff(acid sim.ACID, to sim.ControlPosition, callback func(error))
func (*ControlClient) RejectPointOut ¶
func (c *ControlClient) RejectPointOut(acid sim.ACID, callback func(error))
func (*ControlClient) ReleaseDeparture ¶
func (c *ControlClient) ReleaseDeparture(callsign av.ADSBCallsign, callback func(error))
func (*ControlClient) RepositionTrack ¶
func (c *ControlClient) RepositionTrack(acid sim.ACID, callsign av.ADSBCallsign, p math.Point2LL, callback func(error))
func (*ControlClient) RequestFlightFollowing ¶
func (c *ControlClient) RequestFlightFollowing()
func (*ControlClient) RunAircraftCommands ¶
func (c *ControlClient) RunAircraftCommands(callsign av.ADSBCallsign, cmds string, multiple, clickedTrack bool, handleResult func(message string, remainingInput string))
func (*ControlClient) SendGlobalMessage ¶
func (c *ControlClient) SendGlobalMessage(message string)
func (*ControlClient) SendRouteCoordinates ¶ added in v0.13.0
func (c *ControlClient) SendRouteCoordinates(aircraft sim.ACID, callback func(err error))
func (*ControlClient) SetLaunchConfig ¶
func (c *ControlClient) SetLaunchConfig(lc sim.LaunchConfig)
func (*ControlClient) SetSimRate ¶
func (c *ControlClient) SetSimRate(r float32)
func (*ControlClient) SetWaypointCommands ¶ added in v0.13.0
func (c *ControlClient) SetWaypointCommands(commands string)
func (*ControlClient) Status ¶
func (c *ControlClient) Status() string
func (*ControlClient) StringIsSPC ¶
func (c *ControlClient) StringIsSPC(s string) bool
func (*ControlClient) TakeOrReturnLaunchControl ¶
func (c *ControlClient) TakeOrReturnLaunchControl(eventStream *sim.EventStream)
func (*ControlClient) ToggleSimPause ¶
func (c *ControlClient) ToggleSimPause()
func (*ControlClient) TowerListAirports ¶
func (c *ControlClient) TowerListAirports() []string
func (*ControlClient) TriggerEmergency ¶ added in v0.13.2
func (c *ControlClient) TriggerEmergency(emergencyName string)
func (*ControlClient) UpdateRestrictionArea ¶
func (c *ControlClient) UpdateRestrictionArea(idx int, ra av.RestrictionArea, callback func(error))
type Server ¶
type Server struct {
*RPCClient
HaveTTS bool
AvailableWXByTRACON map[string][]util.TimeInterval
// contains filtered or unexported fields
}
This is the client-side representation of a server (perhaps could be better-named...)
func (*Server) GetRunningSims ¶
func (s *Server) GetRunningSims() map[string]*server.RunningSim
func (*Server) GetScenarioCatalogs ¶ added in v0.13.3
func (s *Server) GetScenarioCatalogs() map[string]map[string]*server.ScenarioCatalog
type SessionStats ¶
type SessionStats struct {
Departures int
Arrivals int
IntraFacility int
Overflights int
SignOnTime time.Time
Initials string
// contains filtered or unexported fields
}
func (*SessionStats) Update ¶
func (s *SessionStats) Update(ss *SimState)
type SimState ¶ added in v0.13.3
SimState is the client's view of simulation state. It embeds server.SimState, providing access to all its fields and methods.
func (*SimState) BeaconCodeInUse ¶ added in v0.13.3
func (*SimState) GetAllReleaseDepartures ¶ added in v0.13.3
func (ss *SimState) GetAllReleaseDepartures() []sim.ReleaseDeparture
func (*SimState) GetFlightPlanForACID ¶ added in v0.13.3
func (ss *SimState) GetFlightPlanForACID(acid sim.ACID) *sim.NASFlightPlan
func (*SimState) GetInitialCenter ¶ added in v0.13.3
func (*SimState) GetInitialRange ¶ added in v0.13.3
func (*SimState) GetOurTrackByACID ¶ added in v0.13.3
func (*SimState) GetOurTrackByCallsign ¶ added in v0.13.3
func (*SimState) GetRegularReleaseDepartures ¶ added in v0.13.3
func (ss *SimState) GetRegularReleaseDepartures() []sim.ReleaseDeparture
func (*SimState) GetSTARSReleaseDepartures ¶ added in v0.13.3
func (ss *SimState) GetSTARSReleaseDepartures() []sim.ReleaseDeparture
func (*SimState) GetTrackByACID ¶ added in v0.13.3
func (*SimState) GetTrackByCallsign ¶ added in v0.13.3
func (*SimState) GetTrackByFLID ¶ added in v0.13.3
func (*SimState) GetUserConsolidation ¶ added in v0.13.3
func (ss *SimState) GetUserConsolidation() *sim.TCPConsolidation
GetUserConsolidation returns the consolidation state for the current user's TCW. Returns nil if no consolidation state exists.
func (*SimState) UserControlsPosition ¶ added in v0.13.3
func (ss *SimState) UserControlsPosition(pos sim.ControlPosition) bool
UserControlsPosition returns true if the current user controls the given position.