Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Display

Display Class It outputs the string in 7-segment style to print out from a given temperature in string format

import { Display } from '@maximva/examenopdracht-maximva'
import { Temperature } from '@maximva/examenopdracht-maximva'
import { DisplaySize } from '@maximva/examenopdracht-maximva'

const displaySettings = {
    frame : true,
    size : DisplaySize.large
}

const temperature: Temperature = new Temperature(12.81)
const display: Display = new Display(displaySettings)
const displayOutput = display.write(temperature.toString())

console.log(displayOutput)

Hierarchy

  • Display

Index

Constructors

constructor

  • Create new instance of Display

    Parameters

    • settings: DisplaySettings

      The settings for the display size and whether or not there should be a frame around the output

    Returns Display

Properties

Private displayRow

displayRow: DisplayRow

Private separator

separator: Separator

settings

settings: DisplaySettings

The settings for the display size and whether or not there should be a frame around the output

Private stringToDigits

stringToDigits: StringConverter = new StringConverter()

Methods

getDisplayOutput

  • getDisplayOutput(displayRows: string[], frameGenerator: Frame): string
  • Get the display output in string format from a given array of displayRows

    Parameters

    • displayRows: string[]

      An array of the separate rows from the temperature output segments (without the frame)

    • frameGenerator: Frame

      An instance of the Frame class to add a frame if so described in the settings

    Returns string

write

  • write(temperature: string): string
  • Returns the actual string in 7-segment style from a given temperature in string format

    Parameters

    • temperature: string

      The temperature to print out in 7-segment style

    Returns string

Generated using TypeDoc