Documentation
¶
Overview ¶
TODO: 1. Fix mouse to put top box not the bottom box
Index ¶
- Constants
- Variables
- func FullDatablockFieldSpecs() map[DatablockFieldID]DatablockFieldSpec
- type CRRColor
- type CRRGroup
- type CRRLocation
- type CommandInput
- type CommandMode
- type CommandStatus
- type CommonPreferences
- type DatablockFieldID
- type DatablockFieldSpec
- type DatablockLayout
- type DatablockOutlines
- type DatablockType
- type ERAMError
- type ERAMPane
- func (ep *ERAMPane) Activate(r renderer.Renderer, pl platform.Platform, es *sim.EventStream, ...)
- func (ep *ERAMPane) CanTakeKeyboardFocus() bool
- func (ep *ERAMPane) ClearTemporaryCursor()
- func (ep *ERAMPane) DisplayName() string
- func (ep *ERAMPane) Draw(ctx *panes.Context, cb *renderer.CommandBuffer)
- func (ep *ERAMPane) DrawInfo(c *client.ControlClient, p platform.Platform, lg *log.Logger)
- func (ep *ERAMPane) DrawUI(p platform.Platform, config *platform.Config)
- func (ep *ERAMPane) ERAMFont(size int) *renderer.Font
- func (ep *ERAMPane) ERAMInputFont() *renderer.Font
- func (ep *ERAMPane) ERAMToolbarFont() *renderer.Font
- func (ep *ERAMPane) FullDatablockOutlines(ctx *panes.Context, trk sim.Track, transforms radar.ScopeTransformations) (DatablockOutlines, bool)
- func (ep *ERAMPane) Hide() bool
- func (ep *ERAMPane) LoadedSim(client *client.ControlClient, pl platform.Platform, lg *log.Logger)
- func (ep *ERAMPane) ResetSim(client *client.ControlClient, pl platform.Platform, lg *log.Logger)
- func (ep *ERAMPane) ScaledRGBFromColorPickerRGB(input [3]float32) renderer.RGB
- func (ep *ERAMPane) SetTemporaryCursor(cursorType string, seconds float64, rollbackCursor string)
- type InterimAltitude
- type Preferences
- type PrefrenceSet
- type TrackState
- func (ts *TrackState) Climbing() bool
- func (ts *TrackState) Descending() bool
- func (ts *TrackState) HaveHeading() bool
- func (ts *TrackState) HeadingVector(nmPerLongitude, magneticVariation float32) math.Point2LL
- func (ts *TrackState) IsLevel() bool
- func (ts *TrackState) TrackDeltaAltitude() int
- func (ts *TrackState) TrackHeading(nmPerLongitude float32) float32
Constants ¶
const ( Line4None = iota Line4Destination Line4Type )
Variables ¶
var ( ERAMPopupPaneBackgroundColor = renderer.RGB{R: 0, G: 0, B: 0} ERAMYellow = renderer.RGB{R: .894, G: .894} )
var ( ErrCommandFormat = NewERAMError("FORMAT") ErrERAMAmbiguousACID = NewERAMError("AMB ACID") ErrERAMIllegalACID = NewERAMError("ILL CID") ErrERAMIllegalPosition = NewERAMError("ILLEGAL POSITION") ErrERAMIllegalValue = NewERAMError("ILLEGAL VALUE") ErrERAMIllegalAirport = NewERAMError("ILLEGAL AIRPORT") ErrIllegalUserAction = NewERAMError("ILLEGAL USER ACTION") ErrERAMMessageTooLong = NewERAMError("MESSAGE TOO LONG") ErrERAMSectorNotActive = NewERAMError("SECTOR NOT ACTIVE") )
Functions ¶
func FullDatablockFieldSpecs ¶ added in v0.14.0
func FullDatablockFieldSpecs() map[DatablockFieldID]DatablockFieldSpec
FullDatablockFieldSpecs returns a copy of the built-in field specs map.
Types ¶
type CRRColor ¶ added in v0.13.3
type CRRColor int
CRRColor represents one of the selectable CRR colors. The palette approximates the figures provided by the user.
type CRRGroup ¶ added in v0.13.3
type CRRGroup struct {
Label string
Location math.Point2LL
Color CRRColor
// Aircraft present in the group; value unused.
Aircraft map[av.ADSBCallsign]struct{}
}
CRRGroup holds one CRR group definition and its aircraft membership.
type CRRLocation ¶ added in v0.14.0
type CRRLocation struct {
Location math.Point2LL
Token string // Original token without // prefix (for deriving labels)
}
CRRLocation represents a parsed CRR location from //FIX, //FRD, etc.
type CommandInput ¶ added in v0.14.0
type CommandInput struct {
// contains filtered or unexported fields
}
CommandInput holds the current state during command matching.
type CommandMode ¶
type CommandMode int
const ( CommandModeNone CommandMode = iota CommandModeDrawRoute )
type CommandStatus ¶
type CommandStatus struct {
// contains filtered or unexported fields
}
type CommonPreferences ¶
type CommonPreferences struct {
CharSize struct {
Line4 int // Find out what this is
RDB int
LDB int
FDB int
Toolbar int
Outage int // Again, what is this?
Portal int // Same here...
}
Brightness struct {
Background radar.Brightness
Cursor radar.Brightness
Text radar.Brightness
PRTGT radar.Brightness
UNPTGT radar.Brightness
PRHST radar.Brightness
UNPHST radar.Brightness
LDB radar.Brightness
SLDB radar.Brightness
WX radar.Brightness
NEXRAD radar.Brightness
Backlight radar.Brightness
Button radar.Brightness
Border radar.Brightness
Toolbar radar.Brightness
TBBRDR radar.Brightness
ABBRDR radar.Brightness
FDB radar.Brightness
Portal radar.Brightness
Satcomm radar.Brightness
ONFREQ radar.Brightness
Line4 radar.Brightness
Dwell radar.Brightness
Fence radar.Brightness
DBFEL radar.Brightness
Outage radar.Brightness
}
Line4Type int
TornOffButtons map[string][2]float32 // button name -> screen position
MasterToolbarPosition [2]float32 // top-left position of the master toolbar button
// contains filtered or unexported fields
}
type DatablockFieldID ¶ added in v0.14.0
type DatablockFieldID string
DatablockFieldID identifies a datablock field for outline lookup.
const ( DBFieldMain DatablockFieldID = "main" DBFieldCallsign DatablockFieldID = "callsign" DBFieldVCI DatablockFieldID = "vci" DBFieldAltitude DatablockFieldID = "altitude" DBFieldCID DatablockFieldID = "cid" DBFieldHandoffSpeed DatablockFieldID = "handoff_speed" DBFieldSpeed DatablockFieldID = "speed" DBFieldLine4 DatablockFieldID = "line4" )
type DatablockFieldSpec ¶ added in v0.14.0
DatablockFieldSpec describes a field location in line/column space (0-based).
func FullDatablockFieldSpec ¶ added in v0.14.0
func FullDatablockFieldSpec(id DatablockFieldID) (DatablockFieldSpec, bool)
FullDatablockFieldSpec returns the built-in field spec, if defined.
type DatablockLayout ¶ added in v0.14.0
type DatablockLayout struct {
Anchor [2]float32
CharWidth float32
LineHeight float32
LineSpacing float32
}
DatablockLayout captures the layout metrics for a rendered datablock.
func (DatablockLayout) FieldExtent ¶ added in v0.14.0
func (l DatablockLayout) FieldExtent(spec DatablockFieldSpec) math.Extent2D
FieldExtent returns the outline for the specified field.
func (DatablockLayout) LineExtent ¶ added in v0.14.0
func (l DatablockLayout) LineExtent(line, cols int) math.Extent2D
LineExtent returns the outline for a full line of the specified width.
type DatablockOutlines ¶ added in v0.14.0
type DatablockOutlines struct {
Layout DatablockLayout
Fields map[DatablockFieldID]math.Extent2D
Lines map[int]math.Extent2D
}
DatablockOutlines provides field and line outlines for a datablock.
type DatablockType ¶
type DatablockType int
DatablockType enumerates the supported ERAM datablock formats. Only the general types are provided here; the specific contents are defined elsewhere.
const ( // LimitedDatablock represents the two-line limited data block used for // untracked or unpaired targets. LimitedDatablock DatablockType = iota // FullDatablock represents the five line full data block. FullDatablock // EnhancedLimitedDatablock represents the optional enhanced limited data // block. It behaves like LimitedDatablock with additional information. EnhancedLimitedDatablock )
type ERAMError ¶
type ERAMError struct {
// contains filtered or unexported fields
}
func NewERAMError ¶
type ERAMPane ¶
type ERAMPane struct {
ERAMPreferenceSets map[string]*PrefrenceSet `json:"PreferenceSets,omitempty"`
TrackState map[av.ADSBCallsign]*TrackState `json:"TrackState,omitempty"`
DisableERAMtoRadio bool `json:"-"`
InboundPointOuts map[string]string `json:"-"`
OutboundPointOuts map[string]string `json:"-"`
Input inputText `json:"-"`
VelocityTime int // 0, 1, 4, or 8 minutes
IFPHelpers struct {
ArrivalsColor *[3]float32
ApproachesColor *[3]float32
DeparturesColor *[3]float32
OverflightsColor *[3]float32
AirspaceColor *[3]float32
}
// CRR state (session)
CRRGroups map[string]*CRRGroup `json:"CRRGroups,omitempty"`
// contains filtered or unexported fields
}
func NewERAMPane ¶
func NewERAMPane() *ERAMPane
func (*ERAMPane) CanTakeKeyboardFocus ¶
func (*ERAMPane) ClearTemporaryCursor ¶ added in v0.14.0
func (ep *ERAMPane) ClearTemporaryCursor()
ClearTemporaryCursor removes any temporary cursor override and rollback cursor.
func (*ERAMPane) DisplayName ¶
func (*ERAMPane) ERAMInputFont ¶
func (*ERAMPane) ERAMToolbarFont ¶
func (*ERAMPane) FullDatablockOutlines ¶ added in v0.14.0
func (ep *ERAMPane) FullDatablockOutlines(ctx *panes.Context, trk sim.Track, transforms radar.ScopeTransformations) (DatablockOutlines, bool)
FullDatablockOutlines returns outlines for the ERAM full datablock fields.
func (*ERAMPane) ScaledRGBFromColorPickerRGB ¶
type InterimAltitude ¶ added in v0.14.0
type InterimAltitude struct {
Altitude int // Altitude in feet
Type string // "" for none, "P" for pilot, "L" for local
}
InterimAltitude holds an interim altitude value with optional type (P for pilot, L for local)
type Preferences ¶
type Preferences struct {
CommonPreferences
Name string
// ARTCC facility identifier for which this preference set applies (e.g., ZNY)
ARTCC string
Center math.Point2LL
Range float32
CurrentCenter math.Point2LL
VideoMapGroup string // ZNYMAP, AREAA, AREAB, etc
AltitudeFilters []float32 // find out the different targets
VideoMapVisible map[string]interface{}
DisplayToolbar bool
Line4Size int
FDBSize int
PoralSize int
ToolbarSize int
RDBSize int // CRR datablocks
LDBSize int
OutageSize int
CursorSize int
VideoMapBrightness map[string]int
UseRightClick bool
// CRR view preferences and configuration
CRR struct {
Visible bool
ListMode bool // true: list, false: panel
Opaque bool
ShowBorder bool
Lines int
Font int
Bright int
SelectedColor CRRColor
ColorBright map[CRRColor]int
Position [2]float32
DisplayFixes bool // ATC TOOLS overlay of CRR fixes
}
// contains filtered or unexported fields
}
type PrefrenceSet ¶
type PrefrenceSet struct {
Current Preferences
Selected *int
// Saved preference slots (10). Some slots may be nil. Each stored
// Preferences includes ARTCC and VideoMapGroup so we can filter rows.
Saved [numSavedPreferenceSets]*Preferences
}
type TrackState ¶
type TrackState struct {
Track av.RadarTrack
PreviousTrack av.RadarTrack
PreviousAltitude float32 // for seeing if the track is climbing or descending. This may need to be moved someplace else later
PreviousTrackTime time.Time
TrackTime time.Time
CID int
HistoryTracks [6]historyTrack // I think it's six?
HistoryTrackIndex int
DatablockType DatablockType
LeaderLineDirection *math.CardinalOrdinalDirection
ELDB bool
EFDB bool
DisplayJRing bool
DisplayReducedJRing bool
DisplayVCI bool
OSectorEndTime time.Time
ReachedAltitude bool
HoverVCI bool // if the user is hovering over the VCI field
HSFHide bool
}
func (*TrackState) Climbing ¶
func (ts *TrackState) Climbing() bool
func (*TrackState) Descending ¶
func (ts *TrackState) Descending() bool
func (*TrackState) HaveHeading ¶
func (ts *TrackState) HaveHeading() bool
func (*TrackState) HeadingVector ¶
func (ts *TrackState) HeadingVector(nmPerLongitude, magneticVariation float32) math.Point2LL
func (*TrackState) IsLevel ¶
func (ts *TrackState) IsLevel() bool
func (*TrackState) TrackDeltaAltitude ¶
func (ts *TrackState) TrackDeltaAltitude() int
func (*TrackState) TrackHeading ¶
func (ts *TrackState) TrackHeading(nmPerLongitude float32) float32