Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WeatherStream

Information about a weather stream.

author

"Travis Redpath"

Hierarchy

  • WeatherStream

Index

Constructors

constructor

  • Construct a new weather stream.

    Parameters

    • parentId: string

      The ID of the weather station that the stream came from.

    Returns WeatherStream

Properties

Private _end_time

_end_time: DateTime

The ending time of the weather stream (required). Must be formatted as 'YYYY-MM-DD'.

Private _filename

_filename: string = ""

The location of the file containing the stream data (required).

Private _hffmc_hour

_hffmc_hour: number

The hour that the HFFMC value is for (required). Must be between -1 and 23 inclusive.

Private _id

_id: string

The name of the weather stream. The name must be unique amongst a weather stream collection.

Private _start_time

_start_time: DateTime

The starting time of the weather stream (required).

Private _starting_dc

_starting_dc: number = -1

Yesterday's daily starting drought code (required).

Private _starting_dmc

_starting_dmc: number = -1

Yesterday's daily starting duff moisture code (required).

Private _starting_ffmc

_starting_ffmc: number = -1

Yesterday's daily starting fine fuel moisture code (required).

Private _starting_precip

_starting_precip: number = -1

Yesterday's daily starting precipitation (13:01-23:00 if daylight savings time, 12:01-23:00 otherwise) (required).

comments

comments: string = ""

User comments about the weather stream (optional).

diurnal_temperature_alpha

diurnal_temperature_alpha: number = 9999

Diurnal parameters - temperature alpha (optional).

diurnal_temperature_beta

diurnal_temperature_beta: number = 9999

Diurnal parameters - temperature beta (optional).

diurnal_temperature_gamma

diurnal_temperature_gamma: number = 9999

Diurnal parameters - temperature gamma (optional).

diurnal_windspeed_alpha

diurnal_windspeed_alpha: number = 9999

Diurnal parameters - wind speed alpha (optional).

diurnal_windspeed_beta

diurnal_windspeed_beta: number = 9999

Diurnal parameters - wind speed beta (optional).

diurnal_windspeed_gamma

diurnal_windspeed_gamma: number = 9999

Diurnal parameters - wind speed gamma (optional).

hffmc_method

hffmc_method: HFFMCMethod = -1

The HFFMC calculation method (required).

hffmc_value

hffmc_value: number

The HFFMC value (required).

Protected parentId

parentId: string

The ID of the weather station that this stream came from.

Static Private Readonly PARAM_WEATHERSTREAM

PARAM_WEATHERSTREAM: "weatherstream" = "weatherstream"

Static Protected counter

counter: number = 0

Accessors

end_time

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

    deprecated

    Returns string

  • Set the weather stream end date 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

hffmc_hour

  • get hffmc_hour(): number
  • set hffmc_hour(value: number): void

id

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

    throws

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

    Returns string

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

lend_time

  • get lend_time(): DateTime
  • set lend_time(value: DateTime): void
  • Get the weather stream end time as a Luxon DateTime.

    throws

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

    Returns DateTime

  • Set the weather stream end date using a Luxon DateTime. Cannot be null. Only the date component will be used.

    throws

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

    Parameters

    • value: DateTime

    Returns void

lstart_time

  • get lstart_time(): DateTime
  • set lstart_time(value: DateTime): void
  • Get the weather stream starting date as a Luxon DateTime.

    throws

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

    Returns DateTime

  • Set the weather grid end time using a Luxon DateTime. Cannot be null. Only the date component will be used.

    throws

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

    Parameters

    • value: DateTime

    Returns void

start_time

  • get start_time(): string
  • set start_time(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

starting_dc

  • get starting_dc(): number
  • set starting_dc(value: number): void

starting_dmc

  • get starting_dmc(): number
  • set starting_dmc(value: number): void

starting_ffmc

  • get starting_ffmc(): number
  • set starting_ffmc(value: number): void
  • Get yesterday's daily starting fine fuel moisture code.

    throws

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

    Returns number

  • Set yesterday's daily starting fine fuel moisture code. Must be in [0, 101].

    throws

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

    Parameters

    • value: number

    Returns void

starting_precip

  • get starting_precip(): number
  • set starting_precip(value: number): void

Methods

checkValid

  • Find any errors that may be in the weather stream.

    Returns Array<ValidationError>

    A list of errors that were found.

getId

  • getId(): string
  • Get the unique ID of this weather stream.

    Returns string

getParentId

  • getParentId(): string
  • Get the unique ID of the weather station that this stream came from.

    Returns string

isValid

  • isValid(): boolean
  • Checks to see if all required values have been set.

    Returns boolean

setName

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

    Parameters

    • name: string

    Returns void

stream

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

    Parameters

    • builder: Socket

    Returns void