VehicleOccupant

VehicleOccupant

new VehicleOccupant(position, productopt, nullable, physiologyopt, nullable)

Source:
Example
let driver = new VehicleOccupant(
                WorkflowOccupant.DRIVER,
                WorkflowOccupant.LEFT,
                WorkflowOccupant.FRONT,
                json.driver.product,
                json.driver.physiology
            )
Parameters:
Name Type Attributes Default Description
position string
product string <optional>
<nullable>
null taken from JSON
physiology string <optional>
<nullable>
null taken from JSON

Members

(static) LHD :string

Description:
  • Left-hand drive (LHD) constant
Source:
Left-hand drive (LHD) constant
Type:
  • string

(static) RHD :string

Description:
  • Right-hand drive (RHD) constant
Source:
Right-hand drive (RHD) constant
Type:
  • string

physiology :string|undefined

Description:
  • Occupant physiology
Source:
Occupant physiology
Type:
  • string | undefined

product :string|undefined

Description:
  • Occupant product
Source:
Occupant product
Type:
  • string | undefined

Methods

(static) FromJSON(json)

Description:
  • returns a VehicleOccupant from the json
Source:
Parameters:
Name Type Description
json VehicleOccupantJSON
Returns:

(static) GetValidHandDrive(drive_side) → {string}

Description:
  • if the hand drive is valid returns the value passed, otherwise prints warning and return VehicleOccupant.LHD
Source:
Parameters:
Name Type Description
drive_side string
Returns:
Type
string

Empty() → {boolean}

Description:
  • occupant may be empty if either product or physiology are null
Source:
Returns:
empty
Type
boolean

GetOccupantNames() → {Array.<string>}

Description:
  • returns an array of valid (supported) occupant names corresponding to the occupant product and physiology properties
Source:
Returns:
occupant names array
Type
Array.<string>

GetSide(drive_sideopt) → {string}

Description:
  • Get the side of an occupant for a given drive side (LHD or RHD) based on position
Source:
Parameters:
Name Type Attributes Default Description
drive_side string <optional>
VehicleOccupant.LHD VehicleOccupant.LHD (default) or VehicleOccupant.RHD
Returns:
Type
string

SetEmpty()

Description:
  • make the occupant empty by setting product and physiology to null
Source:

ToJSON() → {Object}

Description:
  • returns an object representation of VehicleOccupant
Source:
Returns:
Type
Object