Options
All
  • Public
  • Public/Protected
  • All
Menu

A fuel patch file.

author

"Travis Redpath"

Hierarchy

  • FuelPatch

Index

Constructors

constructor

Properties

Private _filename

_filename: string = ""

The filename associated with this fuel patch. Only valid if type is FILE.

Private _id

_id: string

The name of the fuel patch. The name must be unique amongst the fuel patch collection.

comments

comments: string = ""

Any comments about the fuel patch (optional).

feature

feature: LatLon[] = new Array<LatLon>()

An array of LatLon describing the fuel patch. Only valid if type is POLYGON.

fromFuel

fromFuel: string | null = null

The fuel that the patch changes from (one of this, {@link #fromFuelIndex}, or {@link #fromFuelRule} is required).

fromFuelIndex

fromFuelIndex: number | null = null

Instead of using the name of a fuel, reference it by index.

fromFuelRule

fromFuelRule: FromFuel | null = null

The rule about which fuels to apply the patch to (one of this, {@link #fromFuelIndex}, or {@link #fromFuel} is required). If fromFuel is not specified this must be set.

toFuel

toFuel: string = ""

The fuel the patch changes to.

toFuelIndex

toFuelIndex: number | null = null

Instead of using the name of a fuel, reference it by index.

type

type: FuelPatchType = -1

The type of fuel patch (required).

Static Private Readonly PARAM_FUELPATCH

PARAM_FUELPATCH: "fuelpatch" = "fuelpatch"

Static Protected counter

counter: number = 0

Accessors

filename

  • get filename(): string
  • set filename(value: string): void

id

  • get id(): string
  • set id(value: string): void
  • Get the name of the fuel patch.

    throws

    If SocketMsg.inlineThrowOnError is set a RangeError will be thrown if value is not valid.

    Returns string

  • Set the name of the fuel patch. Must be unique amongst the fuel patch collection. Cannot be null or empty.

    throws

    If SocketMsg.inlineThrowOnError is set a RangeError will be thrown if value is not valid.

    Parameters

    • value: string

    Returns void

Methods

checkValid

  • Find all errors that may be in the fuel patch.

    Returns Array<ValidationError>

getId

  • getId(): string
  • Returns string

isValid

  • isValid(): boolean
  • Are all required values set.

    Returns boolean

setName

  • setName(name: string): void
  • Set the name of the fuel patch. This name must be unique within the simulation. The name will get a default value when the fuel patch is constructed but can be overriden with this method.

    Parameters

    • name: string

    Returns void

stream

  • stream(builder: Socket): void
  • Streams the fuel patch file to a socket.

    Parameters

    • builder: Socket

    Returns void