Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WeatherGrid

Information about a weather grid input.

author

"Travis Redpath"

Hierarchy

  • WeatherGrid

Index

Constructors

constructor

Properties

Private _endTime

_endTime: DateTime

The grid end time (required).

Private _endTimeOfDay

_endTimeOfDay: Duration

The patches end time of day (required).

Private _id

_id: string

The name of the weather grid. The name must be unique amongst the weather grid collection.

Private _startTime

_startTime: DateTime

The grid start time (required).

Private _startTimeOfDay

_startTimeOfDay: Duration

The patches start time of day (required).

comments

comments: string = ""

Any comments about the weather grid (optional).

defaultValuesFile

defaultValuesFile: string

The default sector data. If specified defaultValuesProjection must also be specified.

defaultValuesProjection

defaultValuesProjection: string

The projection file for the default sector data. Must be specified if defaultValuesFile is specified.

gridData

gridData: WeatherGrid_GridFile[] = new Array<WeatherGrid_GridFile>()

An array of WeatherGrid_GridFile. There can be one for each wind sector (North, Northeast, East, etc.).

type

Whether this wind grid is for wind speed, or wind direction (required). Must be one of TYPE_DIRECTION and TYPE_SPEED.

Static Private Readonly PARAM_WEATHER_GRID

PARAM_WEATHER_GRID: "weathergrid_2" = "weathergrid_2"

Static Protected counter

counter: number = 0

Accessors

dEndTimeOfDay

dStartTimeOfDay

endTime

  • get endTime(): string
  • set endTime(value: string): void
  • Get the weather grid end time as an ISO8601 string.

    deprecated

    Returns string

  • Set the weather grid end time using a string. Cannot be null or empty. Must be formatted in ISO8601.

    throws

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

    deprecated

    Parameters

    • value: string

    Returns void

endTimeOfDay

  • get endTimeOfDay(): string
  • set endTimeOfDay(value: string): void
  • Get the weather grid end time of day as an ISO8601 string.

    deprecated

    Returns string

  • Set the weather grid end time of day using a string. Cannot be null or empty. Must be formatted in ISO8601.

    throws

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

    deprecated

    Parameters

    • value: string

    Returns void

id

  • get id(): string
  • set id(value: string): void
  • Get the name of the weather grid.

    throws

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

    Returns string

  • Set the name of the weather grid. Must be unique amongst the weather grid 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

lEndTime

  • get lEndTime(): DateTime
  • set lEndTime(value: DateTime): void

lStartTime

  • get lStartTime(): DateTime
  • set lStartTime(value: DateTime): void

startTime

  • get startTime(): string
  • set startTime(value: string): void
  • Get the weather grid start time as an ISO8601 string.

    deprecated

    Returns string

  • Set the weather grid start time using a string. Cannot be null or empty. Must be formatted in ISO8601.

    throws

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

    deprecated

    Parameters

    • value: string

    Returns void

startTimeOfDay

  • get startTimeOfDay(): string
  • set startTimeOfDay(value: string): void
  • Get the weather grid start time of day as an ISO8601 string.

    deprecated

    Returns string

  • Set the weather grid start time of day using a string. Cannot be null or empty. Must be formatted in ISO8601.

    throws

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

    deprecated

    Parameters

    • value: string

    Returns void

Methods

addDirectionFile

  • Add a direction file to the weather grid.

    throws

    Exception Throws an exception if a file for the same sector has already been added.

    throws

    If SocketMsg.inlineThrowOnError is set and SocketMsg.skipFileTests is not set a RangeError will be thrown if the file doesn't exist.

    Parameters

    • filename: string

      The location of the grid file. Can either be the actual file path or the attachment URL returned from {@link WISE#addAttachment}

    • projection: string

      The projection file.

    • sector: WeatherGridSector

      The sector (wind direction) to apply this grid file to. Only one of each sector is allowed per station.

    • speed: number

      The wind speed.

    Returns WeatherGrid_GridFile

checkValid

  • Find all errors in the weather grid.

    Returns Array<ValidationError>

    A list of errors found.

getId

  • getId(): string
  • Returns string

isValid

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

    Returns boolean

removeDirectionFile

  • Remove a WeatherGrid_GridFile object from the weather grid.

    Parameters

    Returns boolean

    A boolean indicating if the object was found and removed

setDefaultValuesGrid

  • setDefaultValuesGrid(defaultValuesFile: string, defaultValuesProjection: string): void
  • A convenience method for specifying the default values grid file and its projection.

    Parameters

    • defaultValuesFile: string

      The file or attachment that contains a grid of default values for the grid.

    • defaultValuesProjection: string

      The projection file for the specified default values file.

    Returns void

setName

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

    Parameters

    • name: string

    Returns void

stream

  • stream(builder: Socket): void
  • Streams the weather grid file to a socket.

    Parameters

    • builder: Socket

    Returns void