Represents a rain gauge station in the RAAIN system. This class manages gauge data collection and configuration.

Remarks

Used in the API endpoint: api/gauges/:id

Example

const gaugeNode = new GaugeNode({
id: 'gauge1',
latitude: 48.8566,
longitude: 2.3522,
name: 'Paris Gauge',
team: teamNode,
description: 'Main rain gauge station'
});

Hierarchy (view full)

Constructors

  • Creates a new GaugeNode instance.

    Parameters

    • json: {
          id: string;
          latitude: number;
          longitude: number;
          name: string;
          team: string | TeamNode;
          description?: string;
          links?: Link[] | RaainNode[];
          version?: string;
          configurationAsJSON?: string;
      }

      Configuration object

      • id: string

        Unique identifier

      • latitude: number

        Latitude of the gauge station

      • longitude: number

        Longitude of the gauge station

      • name: string

        Name of the gauge station

      • team: string | TeamNode

        Associated team

      • Optional description?: string

        Optional description

      • Optional links?: Link[] | RaainNode[]

        Optional array of links

      • Optional version?: string

        Optional version string

      • Optional configurationAsJSON?: string

        Optional configuration object

    Returns GaugeNode

Properties

TYPE: string = 'gauge'

Type identifier for gauge nodes

name: string

Name of the gauge station

description: string

Description of the gauge station

latitude: number

Latitude of the gauge station

longitude: number

Longitude of the gauge station

team: TeamNode

Associated team

id: string

Unique identifier for the node

version: string

Version string of the node

Accessors

Methods

  • Sets the configuration for the gauge node.

    Parameters

    • configuration: any

      Configuration object or JSON string

    Returns void

  • Gets the configuration of the gauge node.

    Returns any

    The configuration object or null if not set

  • Converts the gauge node to a JSON object.

    Returns {
        name: string;
        description: string;
        latitude: number;
        longitude: number;
        team: string | TeamNode;
        configurationAsJSON: string;
        id: string;
        links: Link[];
        version?: string;
    }

    A JSON object containing the gauge node's data

    • name: string
    • description: string
    • latitude: number
    • longitude: number
    • team: string | TeamNode
    • configurationAsJSON: string
    • id: string
    • links: Link[]
    • Optional version?: string
  • Gets the count of links, optionally filtered by type.

    Parameters

    • Optional linkType: string

      Optional type of links to count

    Returns number

    The number of links