Options
All
  • Public
  • Public/Protected
  • All
Menu

The DisplayRow Class It represents a single row of the display output for the digits

import { DisplayRow, Separator, StringConverter } from '@maximva/examenopdracht-maximva'

interface DisplaySettings {
  frame: boolean,
  size: DisplaySize
}
let settings: DisplaySettings = {
     frame: true,
     size: large
}
const separator: Separator = new Separator(this.settings.size)
const stringConverter: StringConverter = new StringConverter()
const digits: Digit[] =  stringToDigits.getDigits("42.42 °C")
const rowSegments: number[][] = this.getSegments(this.settings.size)
const displayRows: string[] = this.getRows(rowSegments, digits)
console.log(displayRows)

Hierarchy

  • DisplayRow

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

_separator

_separator: Separator

settings

settings: DisplaySize

The settings for Display size (regular or large)

Accessors

segments

  • get segments(): number[][]
  • Returns the segments for a row given a display size (large or regular)

    Returns number[][]

Private separator

Methods

getRow

  • getRow(rowSegments: number[], isBottomRow: boolean, digits: Digit[]): string
  • Returns a string for a single row in the output for all digits

    Parameters

    • rowSegments: number[]

      ALl segments for for one row

    • isBottomRow: boolean

      Boolean to represent if it is the bottom row or not

    • digits: Digit[]

      ALl digits in that row

    Returns string

getRows

  • getRows(digits: Digit[]): string[]
  • Returns a string for every row in the output for all digits

    Parameters

    • digits: Digit[]

      ALl the digits for the entire row

    Returns string[]

Generated using TypeDoc