Documentation
¶
Index ¶
- type APReport
- type Report
- type SetSimObjectDataExpose
- type SimconnectInstance
- func (instance *SimconnectInstance) Close() error
- func (instance *SimconnectInstance) CreateEnrouteATCAircraft(containerTitle, tailNumber string, flightNumber uint32, flightPlanPath string, ...) (*uint32, error)
- func (instance *SimconnectInstance) GetAPReport() (*APReport, error)
- func (instance *SimconnectInstance) GetReport() (*Report, error)
- func (instance *SimconnectInstance) GetReportOnObjectID(objectID uint32) (*Report, error)
- func (instance *SimconnectInstance) LoadFlightPlan(flightPlanPath string) error
- func (instance *SimconnectInstance) LoadNonATCAircraft(containerTitle, tailNumber string, ...) (*uint32, error)
- func (instance *SimconnectInstance) LoadParkedATCAircraft(containerTitle, tailNumber, airportICAO string, requestID int) (*uint32, error)
- func (instance *SimconnectInstance) MapClientEventToSimEvent(eventID uint32, eventName string) error
- func (instance *SimconnectInstance) RemoveAIObject(objectID, requestID uint32) error
- func (instance *SimconnectInstance) SendText(eventID uint32, duration float64, textString string) error
- func (instance *SimconnectInstance) SetAircraftFlightPlan(objectID, requestID uint32, flightPlanPath string) error
- func (instance *SimconnectInstance) SetDataOnSimObject(objectID uint32, data []SetSimObjectDataExpose) error
- func (instance *SimconnectInstance) SubscribeToSystemEvent(eventID uint32, eventName string) error
- func (instance *SimconnectInstance) TransmitClientID(eventID uint32, data uint32) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APReport ¶
type APReport struct { simconnect_data.RecvSimobjectDataByType Title [256]byte `name:"Title"` APSelectedAlt float64 `name:"AUTOPILOT ALTITUDE LOCK VAR:3" unit:"feet"` APAltSlot int32 `name:"AUTOPILOT ALTITUDE SLOT INDEX" unit:"number"` }
type Report ¶
type Report struct { simconnect_data.RecvSimobjectDataByType Title [256]byte `name:"Title"` ATCAirline [128]byte `name:"ATC Airline"` ATCFlightNumber [128]byte `name:"ATC Flight Number"` ATCID [128]byte `name:"ATC ID"` ATCModel [128]byte `name:"ATC Model"` ATCHeavy bool `name:"ATC Heavy"` ATCType [128]byte `name:"ATC Type"` Kohlsman float64 `name:"Kohlsman setting hg" unit:"inHg"` Altitude float64 `name:"Plane Altitude" unit:"feet"` AltitudeIndicated float64 `name:"INDICATED ALTITUDE" unit:"feet"` AltitudeAboveGround float64 `name:"Plane Alt Above Ground" unit:"feet"` Latitude float64 `name:"Plane Latitude" unit:"degrees"` Longitude float64 `name:"Plane Longitude" unit:"degrees"` Airspeed float64 `name:"Airspeed Indicated" unit:"knot"` AirspeedBarberPole float64 `name:"Airspeed Barber Pole" unit:"knot"` GroundSpeed float64 `name:"Ground Velocity" unit:"knots"` OnGround int32 `name:"Sim On Ground" unit:"bool"` Heading float32 `name:"Plane Heading Degrees True"` HeadingMag float32 `name:"Plane Heading Degrees Magnetic"` Pitch float32 `name:"Plane Pitch Degrees"` Bank float32 `name:"Plane Bank Degrees"` GForce float32 `name:"G Force"` VerticalSpeedRelativeToWorld float32 `name:"Velocity World Y" unit:"Feet per second"` VerticalSpeedAircraft float32 `name:"Vertical Speed" unit:"Feet per second"` VerticalSpeedPlaneTouchdownNormal float64 `name:"Plane Touchdown Normal Velocity" unit:"Feet per second"` Crosswind float32 `name:"Aircraft Wind X" unit:"Knots"` Headwind float32 `name:"Aircraft Wind Z" unit:"Knots"` FuelTotal float32 `name:"Fuel Total Quantity Weight" unit:"kg"` WindSpeed float32 `name:"Ambient Wind Velocity" unit:"knot"` WindDirection float32 `name:"Ambient Wind Direction" unit:"radians"` FuelCapacity float32 `name:"FUEL TOTAL CAPACITY" unit:"gallons"` FuelWeightPerGallon float32 `name:"FUEL WEIGHT PER GALLON" unit:"kg"` FuelFlow float32 `name:"ESTIMATED FUEL FLOW" unit:"kilograms per second"` AmbientTemperature float32 `name:"Ambient Temperature" unit:"Celsius"` AmbientPressure float32 `name:"Ambient Pressure" unit:"inHg"` Parked int32 `name:"Plane In Parking State"` Engine1Combustion int32 `name:"General Eng Combustion:1" unit:"bool"` Engine2Combustion int32 `name:"General Eng Combustion:2" unit:"bool"` Engine3Combustion int32 `name:"General Eng Combustion:3" unit:"bool"` Engine4Combustion int32 `name:"General Eng Combustion:4" unit:"bool"` EngineCount int32 `name:"Number Of Engines"` ADFStandbyFrequency1 float64 `name:"ADF STANDBY FREQUENCY:1" unit:"MHz"` ADFActiveFrequency1 float64 `name:"ADF ACTIVE FREQUENCY:1" unit:"MHz"` ADFStandbyFrequency2 float64 `name:"ADF STANDBY FREQUENCY:2" unit:"MHz"` ADFActiveFrequency2 float64 `name:"ADF ACTIVE FREQUENCY:2" unit:"MHz"` COMStandbyFrequency1 float64 `name:"COM STANDBY FREQUENCY:1" unit:"MHz"` COMActiveFrequency1 float64 `name:"COM ACTIVE FREQUENCY:1" unit:"MHz"` COMStandbyFrequency2 float64 `name:"COM STANDBY FREQUENCY:2" unit:"MHz"` COMActiveFrequency2 float64 `name:"COM ACTIVE FREQUENCY:2" unit:"MHz"` NAVStandbyFrequency1 float64 `name:"NAV STANDBY FREQUENCY:1" unit:"MHz"` NAVActiveFrequency1 float64 `name:"NAV ACTIVE FREQUENCY:1" unit:"MHz"` NAVStandbyFrequency2 float64 `name:"NAV STANDBY FREQUENCY:2" unit:"MHz"` NAVActiveFrequency2 float64 `name:"NAV ACTIVE FREQUENCY:2" unit:"MHz"` }
Report contains data for a given sim object
type SetSimObjectDataExpose ¶
type SimconnectInstance ¶
type SimconnectInstance struct {
// contains filtered or unexported fields
}
func NewSimConnect ¶
func NewSimConnect(simconnectName string) (*SimconnectInstance, error)
NewSimConnect returns a new instance of SimConnect which will be used to call the methods.
func (*SimconnectInstance) Close ¶
func (instance *SimconnectInstance) Close() error
Close will end the connection to the SimConnect API
func (*SimconnectInstance) CreateEnrouteATCAircraft ¶
func (instance *SimconnectInstance) CreateEnrouteATCAircraft(containerTitle, tailNumber string, flightNumber uint32, flightPlanPath string, flightPlanPosition float32, touchAndGo bool, requestID uint32) (*uint32, error)
CreateEnrouteATCAircraft allows you to create an ATC already part way through its flight plan. See SimConnect API reference.
func (*SimconnectInstance) GetAPReport ¶
func (instance *SimconnectInstance) GetAPReport() (*APReport, error)
GetAPReport returns APReport struct containing current user data
func (*SimconnectInstance) GetReport ¶
func (instance *SimconnectInstance) GetReport() (*Report, error)
GetReport returns Report struct containing current user data
func (*SimconnectInstance) GetReportOnObjectID ¶
func (instance *SimconnectInstance) GetReportOnObjectID(objectID uint32) (*Report, error)
GetReportOnObjectID returns a Report struct containing the data for the Object ID passed in
func (*SimconnectInstance) LoadFlightPlan ¶
func (instance *SimconnectInstance) LoadFlightPlan(flightPlanPath string) error
LoadFlightPlan will load the supplied flight plan path into the users aircraft. FlightPlanPath must be a pln but the .pln extension must not be supplied with the flight plan.
func (*SimconnectInstance) LoadNonATCAircraft ¶
func (instance *SimconnectInstance) LoadNonATCAircraft(containerTitle, tailNumber string, initPos simconnect_data.SimconnectDataInitPosition, requestID int) (*uint32, error)
LoadNonATCAircraft will load a non ATC (vfr) aircraft with the specified parameters. See SimConnect API reference.
func (*SimconnectInstance) LoadParkedATCAircraft ¶
func (instance *SimconnectInstance) LoadParkedATCAircraft(containerTitle, tailNumber, airportICAO string, requestID int) (*uint32, error)
LoadParkedATCAircraft will load a parked ATC aircraft with the specified parameters. See SimConnect API reference.
func (*SimconnectInstance) MapClientEventToSimEvent ¶
func (instance *SimconnectInstance) MapClientEventToSimEvent(eventID uint32, eventName string) error
func (*SimconnectInstance) RemoveAIObject ¶
func (instance *SimconnectInstance) RemoveAIObject(objectID, requestID uint32) error
RemoveAIObject will remove an AI object from the sim. See SimConnect API reference.
func (*SimconnectInstance) SendText ¶
func (instance *SimconnectInstance) SendText(eventID uint32, duration float64, textString string) error
SendText will display a text notification in the simulator. Note: This will only be shown if 'Software Tips' are set to 'on' in the Assistance Options in the case of MSFS
func (*SimconnectInstance) SetAircraftFlightPlan ¶
func (instance *SimconnectInstance) SetAircraftFlightPlan(objectID, requestID uint32, flightPlanPath string) error
SetAircraftFlightPlan allows you to set a flight plan for an existing aircraft. See SimConnect API reference.
func (*SimconnectInstance) SetDataOnSimObject ¶
func (instance *SimconnectInstance) SetDataOnSimObject(objectID uint32, data []SetSimObjectDataExpose) error
SetDataOnSimObject allows you to set data for a given sim object, 0 can be used to apply the data to the users aircraft. See SimConnect API reference.
func (*SimconnectInstance) SubscribeToSystemEvent ¶
func (instance *SimconnectInstance) SubscribeToSystemEvent(eventID uint32, eventName string) error
func (*SimconnectInstance) TransmitClientID ¶
func (instance *SimconnectInstance) TransmitClientID(eventID uint32, data uint32) error