Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WeatherPatch

Information about a weather patch input file.

author

"Travis Redpath"

Hierarchy

  • WeatherPatch

Index

Constructors

constructor

Properties

Private _endTime

_endTime: DateTime

The patch end time (required).

Private _endTimeOfDay

_endTimeOfDay: Duration

The patches end time of day (required). Must be formatted as "hh:mm:ss".

Private _filename

_filename: string = ""

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

Private _id

_id: string

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

Private _startTime

_startTime: DateTime

The patch start time (required).

Private _startTimeOfDay

_startTimeOfDay: Duration

The patches start time of day (required).

comments

comments: string = ""

Any user comments about the weather patch (optional).

feature

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

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

precip

precip: WeatherPatch_Precipitation | null = null

The precipitation to apply with this patch.

rh

The relative humidty to apply with this patch.

temperature

temperature: WeatherPatch_Temperature | null = null

The temperature to apply with this patch.

type

The type of weather patch (required).

windDirection

windDirection: WeatherPatch_WindDirection | null = null

The wind direction to apply with this patch.

windSpeed

windSpeed: WeatherPatch_WindSpeed | null = null

The wind speed to apply with this patch.

Static Private Readonly PARAM_WEATHER_PATCH

PARAM_WEATHER_PATCH: "weatherpatch" = "weatherpatch"

Static Protected counter

counter: number = 0

Accessors

dEndTimeOfDay

dStartTimeOfDay

endTime

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

    deprecated

    Returns string

  • Set the weather patch 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 patch end time of day as an ISO8601 string.

    deprecated

    Returns string

  • Set the weather patch 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

filename

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

id

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

    throws

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

    Returns string

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

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 patch start time as an ISO8601 string.

    deprecated

    Returns string

  • Set the weather patch 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 patch start time of day as an ISO8601 string.

    deprecated

    Returns string

  • Set the weather patch 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

checkValid

  • Find all errors in the weather patch.

    Returns Array<ValidationError>

    A list of errors in the weather patch.

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 weather patch. This name must be unique within the simulation. The name will get a default value when the weather patch is constructed but can be overriden with this method.

    Parameters

    • name: string

    Returns void

setPrecipitationOperation

  • Set the precipitation operation for the weather patch.

    Parameters

    Returns void

setRhOperation

  • Set the relative humidity operation for the weather patch.

    Parameters

    • operation: WeatherPatchOperation

      The operation to apply.

    • value: number

      The value to apply (as a percent [0-100]).

    Returns void

setTemperatureOperation

  • Set the temperature operation for the weather patch.

    Parameters

    Returns void

setWindDirOperation

  • Set the wind direction operation for the weather patch.

    Parameters

    Returns void

setWindSpeedOperation

  • Set the wind speed operation for the weather patch.

    Parameters

    Returns void

stream

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

    Parameters

    • builder: Socket

    Returns void

unsetPrecipitationOperation

  • unsetPrecipitationOperation(): void
  • Unset the precipitation operation for the weather patch.

    Returns void

unsetRhOperation

  • unsetRhOperation(): void
  • Unset the relative humidty operation for the weather patch.

    Returns void

unsetTemperatureOperation

  • unsetTemperatureOperation(): void
  • Unset the temperature operation for the weather patch.

    Returns void

unsetWindDirOperation

  • unsetWindDirOperation(): void
  • Unset the wind direction operation for the weather patch.

    Returns void

unsetWindSpeedOperation

  • unsetWindSpeedOperation(): void
  • Unset the wind speed operation for the weather patch.

    Returns void