stars

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2026 License: GPL-3.0 Imports: 39 Imported by: 0

Documentation

Overview

Commands defined in chapter 3 of the TCW Operator Manual

Commands defined in chapter 4 of the TCW Operator Manual

Commands defined in chapter 8 of the TCW Operator Manual

Index

Constants

View Source
const (
	DefaultFuzzMutationRate     = 0.1
	DefaultFuzzTotalFrames      = 3600 // 1 hour of simulated time at 1 sim step / second
	DefaultFuzzCommandsPerFrame = 10
	DefaultFuzzSimRate          = 20   // Max sim speed
	DefaultFuzzLogInterval      = 6000 // Commands between periodic logs
)

Fuzz testing default values.

View Source
const (
	AudioConflictAlert = iota
	AudioSquawkSPC
	AudioMinimumSafeAltitudeWarning
	AudioModeCIntruder
	AudioTest
	AudioInboundHandoff
	AudioCommandError
	AudioHandoffAccepted
	AudioNumTypes
)

The types of events we may play audio for.

View Source
const (
	CRDAModeStagger = iota
	CRDAModeTie
)
View Source
const (
	VideoMapNoCategory = iota - 1
	VideoMapGeographicMaps
	VideoMapControlledAirspace
	VideoMapRunwayExtensions
	VideoMapDangerAreas
	VideoMapAerodromes
	VideoMapGeneralAviation
	VideoMapSIDsSTARs
	VideoMapMilitary
	VideoMapGeographicPoints
	VideoMapProcessingAreas
	VideoMapCurrent
	VideoMapNumCategories
)
View Source
const (
	// Make 0 be "on" so zero-initialization gives "on"
	DwellModeOn = iota
	DwellModeLock
	DwellModeOff
)
View Source
const (
	RadarModeSingle = iota
	RadarModeMulti
	RadarModeFused
)
View Source
const (
	ATPAStatusUnset = iota
	ATPAStatusMonitor
	ATPAStatusWarning
	ATPAStatusAlert
)
View Source
const (
	GhostStateRegular = iota
	GhostStateSuppressed
	GhostStateForced
)
View Source
const AlertAudioDuration = 5 * time.Second
View Source
const (
	FPMThreshold = 8400 / 100
)
View Source
const LateralMinimum = 3

IFR TRACON separation requirements

View Source
const STARSFilledUpTriangle = string(rune(0x1e))

Filled upward-pointing triangle

View Source
const STARSTriangleCharacter = string(rune(0x80))

STARS ∆ is character 0x80 in the font

View Source
const TabListEntries = 100
View Source
const TabListUnassignedIndex = -1
View Source
const VerticalMinimum = 1000

Variables

View Source
var (
	ErrSTARSAmbiguousACID              = NewSTARSError("AMB ACID")
	ErrSTARSBeaconMismatch             = NewSTARSError("BCN MISMATCH")
	ErrSTARSCapacity                   = NewSTARSError("CAPACITY")
	ErrSTARSCapacityBeacon             = NewSTARSError("CAPACITY - BCN")
	ErrSTARSCommandFormat              = NewSTARSError("FORMAT")
	ErrSTARSDuplicateACID              = NewSTARSError("DUP NEW ID")
	ErrSTARSDuplicateBeacon            = NewSTARSError("DUP BCN")
	ErrSTARSDuplicateCommand           = NewSTARSError("DUP CMD")
	ErrSTARSIllegalACID                = NewSTARSError("ILL ACID")
	ErrSTARSIllegalACType              = NewSTARSError("ACTYPE NOT ADAPTED")
	ErrSTARSIllegalATIS                = NewSTARSError("ILL ATIS")
	ErrSTARSIllegalAirport             = NewSTARSError("ILL AIRPORT")
	ErrSTARSIllegalCode                = NewSTARSError("ILL CODE")
	ErrSTARSIllegalColor               = NewSTARSError("ILL COLOR")
	ErrSTARSIllegalFix                 = NewSTARSError("ILL FIX")
	ErrSTARSIllegalFlight              = NewSTARSError("ILL FLIGHT")
	ErrSTARSIllegalFunction            = NewSTARSError("ILL FUNC")
	ErrSTARSIllegalFunctionAlertActive = NewSTARSError("ILL FUNC - ALERT ACTIVE")
	ErrSTARSIllegalGeoId               = NewSTARSError("ILL GEO ID")
	ErrSTARSIllegalGeoLoc              = NewSTARSError("ILL GEO LOC")
	ErrSTARSIllegalLine                = NewSTARSError("ILL LINE")
	ErrSTARSIllegalMap                 = NewSTARSError("ILL MAP")
	ErrSTARSIllegalParam               = NewSTARSError("ILL PARAM")
	ErrSTARSIllegalPosition            = NewSTARSError("ILL POS")
	ErrSTARSIllegalPrefset             = NewSTARSError("ILL PREFSET")
	ErrSTARSIllegalRPC                 = NewSTARSError("ILL RPC") // CRDA runway pair config
	ErrSTARSIllegalRange               = NewSTARSError("ILL RANGE")
	ErrSTARSIllegalRegion              = NewSTARSError("ILL REGION")
	ErrSTARSIllegalRunway              = NewSTARSError("ILL RWY")
	ErrSTARSIllegalScratchpad          = NewSTARSError("ILL SCR")
	ErrSTARSIllegalSector              = NewSTARSError("ILL SECTOR")
	ErrSTARSIllegalTCPDeconsolFirst    = NewSTARSError("ILL TCP - DECONSOL FIRST")
	ErrSTARSIllegalTCPNotConsolidated  = NewSTARSError("ILL TCP - NOT CONSOLIDATED")
	ErrSTARSIllegalTCW                 = NewSTARSError("ILL TCW")
	ErrSTARSIllegalText                = NewSTARSError("ILL TEXT")
	ErrSTARSIllegalTrack               = NewSTARSError("ILL TRK")
	ErrSTARSIllegalValue               = NewSTARSError("ILL VALUE")
	ErrSTARSMultipleFlights            = NewSTARSError("MULTIPLE FLIGHT")
	ErrSTARSNoFlight                   = NewSTARSError("NO FLIGHT")
	ErrSTARSNoTrack                    = NewSTARSError("NO TRK")
	ErrSTARSRangeLimit                 = NewSTARSError("RANGE LIMIT")
)
View Source
var (
	STARSBackgroundColor    = renderer.RGB{.2, .2, .2} // at 100 contrast
	STARSListColor          = renderer.RGB{.1, .9, .1}
	STARSTextAlertColor     = renderer.RGB{1, 0, 0}
	STARSTextWarningColor   = renderer.RGB{1, 1, 0}
	STARSCompassColor       = renderer.RGB{.55, .55, .55}
	STARSRangeRingColor     = renderer.RGB{.55, .55, .55}
	STARSTrackBlockColor    = renderer.RGB{0.12, 0.48, 1}
	STARSTrackHistoryColors = [5]renderer.RGB{
		renderer.RGB{.12, .31, .78},
		renderer.RGB{.28, .28, .67},
		renderer.RGB{.2, .2, .51},
		renderer.RGB{.16, .16, .43},
		renderer.RGB{.12, .12, .35},
	}
	STARSJRingConeColor         = renderer.RGB{.5, .5, 1}
	STARSTrackedAircraftColor   = renderer.RGB{1, 1, 1}
	STARSUntrackedAircraftColor = renderer.RGB{0, 1, 0}
	STARSTrackAlertColor        = renderer.RGB{1, 1, 0}
	STARSGhostColor             = renderer.RGB{1, 1, 0}
	STARSSelectedAircraftColor  = renderer.RGB{0, 1, 1}

	STARSATPAWarningColor = renderer.RGB{1, 1, 0}
	STARSATPAAlertColor   = renderer.RGB{1, .215, 0}
)

Functions

func SelectRandomScenario added in v0.13.3

func SelectRandomScenario(srv *client.Server) (server.NewSimRequest, error)

SelectRandomScenario picks a random scenario from the server's catalog and returns a NewSimRequest ready for use with ConnectionManager.CreateNewSim.

Types

type ATPAStatus

type ATPAStatus int

type AudioType

type AudioType int

func (AudioType) String

func (ae AudioType) String() string

type BasicSTARSList

type BasicSTARSList struct {
	Position [2]float32
	Visible  bool
	Lines    int
}

type CAAircraft

type CAAircraft struct {
	ADSBCallsigns [2]av.ADSBCallsign // sorted alphabetically
	Acknowledged  bool
	SoundEnd      time.Time
	Start         time.Time
}

Used both for CAs and MCIs.

type CRDAMode

type CRDAMode int

type CRDARunwayPairState

type CRDARunwayPairState struct {
	Enabled     bool
	Mode        CRDAMode
	RunwayState [2]CRDARunwayState
}

stores the per-preference set state for each STARSConvergingRunways

type CRDARunwayState

type CRDARunwayState struct {
	Enabled                 bool
	Airport                 string
	Runway                  string
	LeaderLineDirection     *math.CardinalOrdinalDirection // nil -> unset
	DrawCourseLines         bool
	DrawQualificationRegion bool
}

type CommandClear added in v0.13.3

type CommandClear int

CommandClear specifies how command state should be cleared after execution.

const (
	ClearAll   CommandClear = iota // Clear all command state (default zero value)
	ClearInput                     // Clear user text input but stay in same command mode
	ClearNone                      // Don't clear any command state
)

type CommandInput added in v0.13.3

type CommandInput struct {
	// contains filtered or unexported fields
}

CommandInput holds the current state during command matching.

type CommandMode

type CommandMode int
const (
	// Keyboard command entry modes; can be main or DCB menu for these; sp.dcbShowAux decides.
	CommandModeNone CommandMode = iota
	CommandModeInitiateControl
	CommandModeTrackReposition
	CommandModeTrackSuspend
	CommandModeTerminateControl
	CommandModeHandOff
	CommandModeVFRPlan
	CommandModeMultiFunc
	CommandModeFlightData
	CommandModeCollisionAlert
	CommandModeMin
	CommandModeTargetGen
	CommandModeTargetGenLock
	CommandModeReleaseDeparture
	CommandModeRestrictionArea
	CommandModeDrawRoute
	CommandModeDrawWind

	// These correspond to buttons on the main DCB menu.
	CommandModeRange
	CommandModePlaceCenter
	CommandModeRangeRings
	CommandModePlaceRangeRings
	CommandModeMaps
	CommandModeWX
	CommandModeBrite
	CommandModeBriteSpinner
	CommandModeLDR
	CommandModeLDRDir
	CommandModeCharSize
	CommandModeCharSizeSpinner
	CommandModeSite
	CommandModePref
	CommandModeSavePrefAs
	CommandModeSSAFilter
	CommandModeGITextFilter

	// These correspond to buttons on the secondary DCB menu.
	CommandModeVolume
	CommandModeHistory
	CommandModeHistoryRate
	CommandModePTLLength
	CommandModeDwell
	CommandModeTPA
)

func (CommandMode) PreviewString

func (c CommandMode) PreviewString(sp *STARSPane) string

type CommandSpec added in v0.13.3

type CommandSpec struct {
	Mode       CommandMode
	Generators []matchGenerator
	OrigSpec   string // For debugging
}

CommandSpec holds a parsed command specification ready for generation.

func BuildCommandSpecs added in v0.13.3

func BuildCommandSpecs() []CommandSpec

BuildCommandSpecs builds CommandSpecs from the registered userCommands.

func (*CommandSpec) Generate added in v0.13.3

func (cs *CommandSpec) Generate(r *rand.Rand, ctx *GeneratorContext) GeneratorResult

Generate generates a complete input string for this command spec.

type CommandStatus

type CommandStatus struct {
	Clear  CommandClear // how to clear command state after execution
	Output string       // text to display in preview area

	// CommandHandlers registers transient handlers that intercept subsequent
	// input (keyboard Enter or scope click). Uses the same userCommand type
	// as registerCommand, with cmd specifying the command spec (e.g., "",
	// "[NUM]", "[POS]") and handlerFunc the handler function. Handlers are tried in
	// order; first matching handler wins.
	CommandHandlers []userCommand
}

CommandStatus is returned by command handlers to indicate behavior. The zero value means: clear command state, no output.

type CommonPreferences

type CommonPreferences struct {
	DisplayDCB  bool
	DCBPosition int

	AudioVolume int // 1-10

	RadarTrackHistory int // Number of history markers
	// 4-94: 0.5s increments via trackball but 0.1s increments allowed if
	// keyboard input.
	RadarTrackHistoryRate float32

	AudioEffectEnabled []bool

	DisplayWeatherLevel     [radar.NumWxLevels]bool
	LastDisplayWeatherLevel [radar.NumWxLevels]bool

	// For aircraft tracked by the user.
	LeaderLineDirection math.CardinalOrdinalDirection
	LeaderLineLength    int // 0-7

	OverflightFullDatablocks bool
	AutomaticFDBOffset       bool

	AutoCursorHome bool
	CursorHome     [2]float32

	DisplayTPASize               bool
	DisplayATPAInTrailDist       bool `json:"DisplayATPAIntrailDist"`
	DisplayATPAWarningAlertCones bool
	DisplayATPAMonitorCones      bool

	PTLLength      float32
	PTLOwn, PTLAll bool

	DwellMode DwellMode

	DisplaySuspendedTrackAltitude bool

	Brightness struct {
		DCB                radar.Brightness
		BackgroundContrast radar.Brightness
		VideoGroupA        radar.Brightness
		VideoGroupB        radar.Brightness
		FullDatablocks     radar.Brightness
		Lists              radar.Brightness
		Positions          radar.Brightness
		LimitedDatablocks  radar.Brightness
		OtherTracks        radar.Brightness
		Lines              radar.Brightness
		RangeRings         radar.Brightness
		Compass            radar.Brightness
		BeaconSymbols      radar.Brightness
		PrimarySymbols     radar.Brightness
		History            radar.Brightness
		Weather            radar.Brightness
		WxContrast         radar.Brightness
	}

	CharSize struct {
		DCB             int
		Datablocks      int
		Lists           int
		Tools           int
		PositionSymbols int
	}

	PreviewAreaPosition [2]float32

	SSAList struct {
		Position [2]float32
		Filter   struct {
			All                 bool
			Wx                  bool
			Time                bool
			Altimeter           bool
			Status              bool
			ConfigPlan          bool
			Radar               bool
			Codes               bool
			SpecialPurposeCodes bool
			SysOff              bool
			Range               bool
			PredictedTrackLines bool
			AltitudeFilters     bool
			Intrail             bool
			Intrail25           bool
			AirportWeather      bool
			QuickLookPositions  bool
			DisabledTerminal    bool
			ActiveCRDAPairs     bool
			WxHistory           bool
			Consolidation       bool
			GIText              [10]bool
		}
	}
	VFRList       BasicSTARSList
	TABList       BasicSTARSList
	AlertList     BasicSTARSList
	CoastList     BasicSTARSList
	SignOnList    BasicSTARSList
	VideoMapsList struct {
		Position  [2]float32
		Visible   bool
		Selection VideoMapsGroup
	}
	CRDAStatusList      BasicSTARSList
	MCISuppressionList  BasicSTARSList
	TowerLists          [3]BasicSTARSList
	CoordinationLists   map[string]*CoordinationList
	RestrictionAreaList BasicSTARSList

	RestrictionAreaSettings map[int]*RestrictionAreaSettings
}

CommonPreferences stores the STARS preference settings that are generally TRACON-independent--font size, brightness, etc. This is admittedly somewhat subjective. Splitting them out in this way lets us maintain those settings when the user starts a scenario at a new TRACON so that they don't need to start from scratch for each one.

type CoordinationList

type CoordinationList struct {
	BasicSTARSList // Note that Visible is ignored for coordination lists.
	Group          string
	AutoRelease    bool
}

type DatablockType

type DatablockType int
const (
	PartialDatablock DatablockType = iota
	LimitedDatablock
	FullDatablock
	SuspendedDatablock
)

type DwellMode

type DwellMode int

func (DwellMode) String

func (d DwellMode) String() string

type FuzzConfig added in v0.13.3

type FuzzConfig struct {
	MutationRate     float32 // Probability of mutating valid input (default 0.1)
	Seed             uint64  // Random seed (0 = time-based)
	TotalFrames      int     // Total frames to run (0 = DefaultFuzzTotalFrames)
	CommandsPerFrame int     // Commands to execute per frame (0 = DefaultFuzzCommandsPerFrame)
}

FuzzConfig controls fuzz test behavior.

type FuzzController added in v0.13.3

type FuzzController struct {
	// contains filtered or unexported fields
}

FuzzController orchestrates fuzz testing of STARS commands.

func NewFuzzController added in v0.13.3

func NewFuzzController(sp *STARSPane, cfg FuzzConfig, lg *log.Logger) *FuzzController

NewFuzzController creates a new FuzzController for testing STARS commands.

func (*FuzzController) ExecuteFrame added in v0.13.3

func (fc *FuzzController) ExecuteFrame(ctx *panes.Context, c *client.ControlClient) bool

ExecuteFrame runs one frame of fuzz testing. It handles initialization on the first frame and executes the configured number of commands. Returns true if testing should continue.

func (*FuzzController) ExecuteRandomCommand added in v0.13.3

func (fc *FuzzController) ExecuteRandomCommand(ctx *panes.Context)

ExecuteRandomCommand generates and executes a random command.

func (*FuzzController) FrameCount added in v0.13.3

func (fc *FuzzController) FrameCount() int

FrameCount returns the number of frames executed so far.

func (*FuzzController) PrintStatistics added in v0.13.3

func (fc *FuzzController) PrintStatistics()

PrintStatistics outputs the fuzz testing statistics.

func (*FuzzController) Seed added in v0.13.3

func (fc *FuzzController) Seed() uint64

Seed returns the random seed used by this controller.

func (*FuzzController) ShouldContinue added in v0.13.3

func (fc *FuzzController) ShouldContinue() bool

ShouldContinue returns true if fuzz testing should continue.

func (*FuzzController) TotalFrames added in v0.13.3

func (fc *FuzzController) TotalFrames() int

TotalFrames returns the configured total number of frames.

type GeneratorContext added in v0.13.3

type GeneratorContext struct {
	SP          *STARSPane  // Access to visible tracks, prefs, etc.
	TargetTrack *sim.Track  // Currently selected track for aircraft commands
	CommandMode CommandMode // Current command mode (affects ALL_TEXT generation)
}

GeneratorContext provides access to simulation state for generators.

type GeneratorResult added in v0.13.3

type GeneratorResult struct {
	Text       string     // Text fragment to include
	NeedsClick bool       // Whether a track/position click is needed
	Track      *sim.Track // If NeedsClick, optionally the track to click on
}

GeneratorResult holds the result of generating input for a matcher.

type GhostState

type GhostState int

type ListFormatter

type ListFormatter struct {
	Title      string
	FrameTitle string
	Lines      int
	Entries    int
	FormatLine func(idx int, sb *strings.Builder)
}

Most system lists are drawn via drawSystemList / ListFormatter, which allows a mostly-declarative style for specifying list contents where drawSystemList handles the formatting details in a single place.

type ModeStats added in v0.13.3

type ModeStats struct {
	Tried   int
	Handled int
	Errors  int
}

ModeStats tracks statistics per command mode.

type ModeledAircraft

type ModeledAircraft struct {
	// contains filtered or unexported fields
}

func MakeModeledAircraft

func MakeModeledAircraft(ctx *panes.Context, trk sim.Track, state *TrackState, threshold math.Point2LL) ModeledAircraft

func (*ModeledAircraft) EstimatedAltitude

func (ma *ModeledAircraft) EstimatedAltitude(s float32) float32

estimated altitude s seconds in the future

func (*ModeledAircraft) NextPosition

func (ma *ModeledAircraft) NextPosition(p [2]float32) [2]float32

Return estimated position 1s in the future

type PointOutControllers

type PointOutControllers struct {
	From, To sim.TCP
}

type PreferenceSet

type PreferenceSet struct {
	Current  Preferences
	Selected *int // if non-nil, an index into Saved
	Saved    [numSavedPreferenceSets]*Preferences
}

PreferenceSet stores the currently active preferences and up to numSavedPreferenceSets saved preferences; STARSPane keeps a separate PreferenceSet for each TRACON that the user signs in to.

func (*PreferenceSet) Reset

func (p *PreferenceSet) Reset(ss client.SimState, sp *STARSPane)

Reset ends up being called when a new Sim is started. It is responsible for resetting all of the preference values in the PreferenceSet that we don't expect to persist on a restart (e.g. quick look positions.)

func (*PreferenceSet) ResetDefault

func (p *PreferenceSet) ResetDefault(ss client.SimState, pl platform.Platform, sp *STARSPane)

ResetDefault resets the current preferences to the system defaults.

func (*PreferenceSet) SetCurrent

func (p *PreferenceSet) SetCurrent(cur Preferences, pl platform.Platform, sp *STARSPane)

func (*PreferenceSet) Upgrade

func (p *PreferenceSet) Upgrade(from, to int)

type Preferences

type Preferences struct {
	CommonPreferences

	Name string // Name given if it's been saved

	// Radar scope
	DefaultCenter math.Point2LL `json:"Center"` /* backwards compat */
	UserCenter    math.Point2LL `json:"CurrentCenter"`
	UseUserCenter bool
	Range         float32

	RangeRingsUserCenter math.Point2LL `json:"RangeRingsCenter"`
	RangeRingRadius      int
	// Whether we center them at RangeRingsCenter or Center
	UseUserRangeRingsCenter bool `json:"RangeRingsUserCenter"`

	// User-supplied text for the SSA list
	ATIS   [10]string `json:"ATISes"` /* rename after making array */
	GIText [10]string

	// If empty, then then MULTI or FUSED mode, depending on
	// FusedRadarMode.  The custom JSON name is so we don't get errors
	// parsing old configs, which stored this as an array...
	RadarSiteSelected string `json:"RadarSiteSelectedName"`
	FusedRadarMode    bool

	// For tracked by other controllers
	ControllerLeaderLineDirections map[av.ControlPosition]math.CardinalOrdinalDirection
	// If not specified in ControllerLeaderLineDirections...
	OtherControllerLeaderLineDirection *math.CardinalOrdinalDirection
	// Only set if specified by the user (and not used currently...)
	UnassociatedLeaderLineDirection *math.CardinalOrdinalDirection

	AltitudeFilters struct {
		Unassociated [2]int // low, high
		Associated   [2]int
	}

	AutomaticHandoffs struct {
		Interfacility bool
		Intrafacility bool
	}

	QuickLookAll       bool
	QuickLookAllIsPlus bool
	QuickLookTCPs      map[string]bool // in map: is quicklooked; bool indicates QL+
	DisabledQLRegions  map[string]any

	DisplayEmptyCoordinationLists bool

	CRDA struct {
		Disabled bool
		// RunwayPairState has the same size and indexing as corresponding
		// the STARSPane STARSConvergingRunways member.
		RunwayPairState []CRDARunwayPairState
		ForceAllGhosts  bool
	}

	DisplayLDBBeaconCodes bool // TODO: default?
	SelectedBeacons       []av.Squawk

	DisableCAWarnings  bool
	DisableMCIWarnings bool
	DisableMSAW        bool

	VideoMapVisible map[int]any

	InhibitPositionSymOnUnassociatedPrimary bool // 4-29
}

Preferences encapsulates the user-settable STARS preferences

func (*Preferences) Activate

func (p *Preferences) Activate(pl platform.Platform, sp *STARSPane)

func (*Preferences) Duplicate

func (p *Preferences) Duplicate() *Preferences

func (*Preferences) Reset

func (p *Preferences) Reset(ss client.SimState, sp *STARSPane)

func (*Preferences) Upgrade

func (p *Preferences) Upgrade(from, to int)

type RAText added in v0.13.3

type RAText struct {
	// contains filtered or unexported fields
}

type RestrictionAreaSettings

type RestrictionAreaSettings struct {
	Visible           bool
	HideText          bool
	StopBlinkingText  bool
	ForceBlinkingText bool
}

RestrictionAreaSettings holds local settings related to restriction areas that aren't sent back to the server to be changed for all users.

type STARSConvergingRunways

type STARSConvergingRunways struct {
	av.ConvergingRunways
	ApproachRegions [2]*av.ApproachRegion
	Airport         string
	Index           int
}

this is read-only, stored in STARSPane for convenience

type STARSError

type STARSError struct {
	// contains filtered or unexported fields
}

func GetSTARSError

func GetSTARSError(e error, lg *log.Logger) *STARSError

func NewSTARSError

func NewSTARSError(msg string) *STARSError

type STARSPane

type STARSPane struct {
	TRACONPreferenceSets map[string]*PreferenceSet

	// These are the current prefs from the prior representation; we read
	// them back in if they're there to use to bootstrap the new
	// representation.
	// TODO: remove this at some point in the future.
	OldPrefsCurrentPreferenceSet  *Preferences  `json:"CurrentPreferenceSet,omitempty"`
	OldPrefsSelectedPreferenceSet *int          `json:"SelectedPreferenceSet,omitempty"`
	OldPrefsPreferenceSets        []Preferences `json:"PreferenceSets,omitempty"`

	// Preferences that were active when we entered the PREF menu.
	RestorePreferences       *Preferences
	RestorePreferencesNumber *int

	// It seems like this should be based on ACID but then we also need
	// state for unassociated tracks, so... ?
	TrackState map[av.ADSBCallsign]*TrackState

	LockDisplay bool

	// a/c callsign -> controllers
	PointOuts         map[sim.ACID]PointOutControllers
	RejectedPointOuts map[sim.ACID]any
	ForceQLACIDs      map[sim.ACID]any

	CoastSuspendIndex int // Next index to assign

	// Hold for release callsigns we have seen but not released. (We need
	// to track this since auto release only applies to new ones seen after
	// it is enabled.)
	ReleaseRequests map[av.ADSBCallsign]any

	// Periodically updated in processEvents
	DuplicateBeacons map[av.Squawk]any

	RangeBearingLines []STARSRangeBearingLine
	MinSepAircraft    [2]av.ADSBCallsign

	CAAircraft  []CAAircraft
	MCIAircraft []CAAircraft

	// For CRDA
	ConvergingRunways []STARSConvergingRunways

	// Various UI state
	FlipNumericKeypad bool
	TgtGenKey         byte

	FontSelection int32

	DisplayBeaconCode        av.Squawk
	DisplayBeaconCodeEndTime time.Time

	DisplayRequestedAltitude bool

	// When VFR flight plans were first seen (used for sorting in VFR list)
	VFRFPFirstSeen map[sim.ACID]time.Time

	// Instrument Flight Procedure (SIDs, STARs, IAPs etc) Helpers
	IFPHelpers struct {
		ArrivalsColor    *[3]float32
		ApproachesColor  *[3]float32
		DeparturesColor  *[3]float32
		OverflightsColor *[3]float32
		AirspaceColor    *[3]float32
		HoldsColor       *[3]float32
	}
	// contains filtered or unexported fields
}

func NewSTARSPane

func NewSTARSPane() *STARSPane

func (*STARSPane) Activate

func (sp *STARSPane) Activate(r renderer.Renderer, p platform.Platform, eventStream *sim.EventStream, lg *log.Logger)

func (*STARSPane) CanTakeKeyboardFocus

func (sp *STARSPane) CanTakeKeyboardFocus() bool

func (*STARSPane) DisplayName

func (sp *STARSPane) DisplayName() string

func (*STARSPane) Draw

func (sp *STARSPane) Draw(ctx *panes.Context, cb *renderer.CommandBuffer)

func (*STARSPane) DrawInfo

func (sp *STARSPane) DrawInfo(c *client.ControlClient, p platform.Platform, lg *log.Logger)

func (*STARSPane) DrawUI

func (sp *STARSPane) DrawUI(p platform.Platform, config *platform.Config)

func (*STARSPane) Hide

func (sp *STARSPane) Hide() bool

func (*STARSPane) LoadedSim

func (sp *STARSPane) LoadedSim(client *client.ControlClient, pl platform.Platform, lg *log.Logger)

func (*STARSPane) ResetSim

func (sp *STARSPane) ResetSim(client *client.ControlClient, pl platform.Platform, lg *log.Logger)

func (*STARSPane) ScaledRGBFromColorPickerRGB

func (sp *STARSPane) ScaledRGBFromColorPickerRGB(input [3]float32) renderer.RGB

func (*STARSPane) Upgrade

func (sp *STARSPane) Upgrade(from, to int)

func (*STARSPane) WarnOutsideAirspace

func (sp *STARSPane) WarnOutsideAirspace(ctx *panes.Context, trk sim.Track) ([][2]int, bool)

type STARSRangeBearingLine

type STARSRangeBearingLine struct {
	P [2]struct {
		// If callsign is given, use that aircraft's position;
		// otherwise we have a fixed position.
		Loc          math.Point2LL
		ADSBCallsign av.ADSBCallsign
	}
}

func (STARSRangeBearingLine) GetPoints

func (rbl STARSRangeBearingLine) GetPoints(ctx *panes.Context, sp *STARSPane) (math.Point2LL, math.Point2LL)

type TrackState

type TrackState struct {
	FullLDBEndTime           time.Time // If the LDB displays the groundspeed. When to stop
	DisplayRequestedAltitude *bool     // nil if unspecified

	IsSelected bool // middle click

	// We handed it off, the other controller accepted it, we haven't yet
	// slewed to make it a PDB.
	DisplayFDB bool

	// Hold for release aircraft released and deleted from the coordination
	// list by the controller.
	ReleaseDeleted bool

	// Only drawn if non-zero
	JRingRadius    float32
	ConeLength     float32
	DisplayTPASize *bool // unspecified->system default if nil

	DisplayATPAMonitor        *bool // unspecified->system default if nil
	DisplayATPAWarnAlert      *bool // unspecified->system default if nil
	IntrailDistance           float32
	InhibitDisplayInTrailDist bool
	ATPAStatus                ATPAStatus
	MinimumMIT                float32
	ATPALeadAircraftCallsign  av.ADSBCallsign
	DrawATPAGraphics          bool

	POFlashingEndTime time.Time
	UNFlashingEndTime time.Time
	IFFlashing        bool // Will continue to flash unless slewed or a successful handoff

	SuspendedShowAltitudeEndTime time.Time

	AcceptedHandoffSector     string
	AcceptedHandoffDisplayEnd time.Time

	// These are only set if a leader line direction was specified for this
	// aircraft individually:
	LeaderLineDirection *math.CardinalOrdinalDirection
	UseGlobalLeaderLine bool

	Ghost struct {
		PartialDatablock bool
		State            GhostState
	}

	DisplayLDBBeaconCode bool
	DisplayPTL           bool

	MSAW             bool // minimum safe altitude warning
	MSAWStart        time.Time
	InhibitMSAW      bool // only applies if in an alert. clear when alert is over?
	MSAWAcknowledged bool
	MSAWSoundEnd     time.Time

	SPCAlert        bool
	SPCAcknowledged bool
	SPCSoundEnd     time.Time

	MissingFlightPlanAcknowledged bool

	// record the code when it was ack'ed so that if it happens again with
	// a different code, we get a flashing DB in the datablock.
	DBAcknowledged av.Squawk

	FirstRadarTrackTime time.Time
	EnteredOurAirspace  bool

	OutboundHandoffAccepted bool
	OutboundHandoffFlashEnd time.Time

	RDIndicatorEnd time.Time

	// Set when the user enters a command to clear the primary scratchpad,
	// but it is already empty. (In turn, this causes the exit
	// fix/destination airport and the like to no longer be displayed, when
	// it is adapted to be shown in the FDB.)
	ClearedScratchpadAlternate bool

	// This is a little messy: we maintain maps from callsign->sector id
	// for pointouts that track the global state of them. Here we track
	// just inbound pointouts to the current controller so that the first
	// click acks a point out but leaves it yellow and a second clears it
	// entirely.
	PointOutAcknowledged bool
	ForceQL              bool

	// Unreasonable Mode-C
	UnreasonableModeC       bool
	ConsecutiveNormalTracks int

	// This is for [FLT DATA][SLEW] of an unowned FDB in which case it only
	// applies locally; for owned tracks, the flight plan is modified so it
	// applies globally.
	InhibitACTypeDisplay      *bool
	ForceACTypeDisplayEndTime time.Time

	// Draw the datablock in yellow (until cleared); currently only used for
	// [MF]Y[SLEW] quick flight plans
	DatablockAlert bool
	// contains filtered or unexported fields
}

func (*TrackState) HaveHeading

func (ts *TrackState) HaveHeading() bool

func (*TrackState) HeadingVector

func (ts *TrackState) HeadingVector(nmPerLongitude, magneticVariation float32) math.Point2LL

Note that the vector returned by HeadingVector() is along the aircraft's extrapolated path. Thus, it includes the effect of wind. The returned vector is scaled so that it represents where it is expected to be one minute in the future.

func (*TrackState) TrackDeltaAltitude

func (ts *TrackState) TrackDeltaAltitude() int

func (*TrackState) TrackHeading

func (ts *TrackState) TrackHeading(nmPerLongitude float32) float32

type VideoMapsGroup

type VideoMapsGroup int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL