Treehopper C# API
SevenSegmentDisplay Class Reference

A display comprised of one or more SevenSegment characters More...

Inheritance diagram for SevenSegmentDisplay:
CharacterDisplay ICharacterDisplay

Public Member Functions

 SevenSegmentDisplay (IList< Led > Leds, bool rightToLeftDigits=false)
 Construct a SevenSegment display from a list of LEDs. More...
 
 SevenSegmentDisplay (IList< SevenSegmentDigit > Digits)
 Construct a SevenSegmentDisplay from a collection of already-created digits More...
 
Task SetCursorPosition (int left, int top)
 Set left/right cursor position More...
 
Task WriteLine (dynamic value)
 Write a line of text, advancing the cursor to the next line More...
 
async Task Write (dynamic value)
 Write text More...
 
Task Clear ()
 Clear the display and reset the cursor to (0,0) More...
 

Protected Member Functions

override async Task clear ()
 clear the display More...
 
override async Task updateCursorPosition ()
 update the cursor position More...
 
override Task write (dynamic value)
 write a value to the current position of the display More...
 

Properties

dynamic Text [get, set]
 Gets or sets the currently-displayed text. More...
 
bool LeftAlignt [get, set]
 Controls whether the display should be left-aligned or not. More...
 
Collection< string > History = new Collection<string>() [get]
 History of previously-written lines from the display More...
 
Collection< string > Lines = new Collection<string>() [get]
 Current lines of the display More...
 
int Columns [get]
 Number of columns of the display More...
 
int Rows [get]
 Number of rows of the display More...
 
int CursorLeft [get, set]
 Cursor left position More...
 
int CursorTop [get, set]
 Cursor top position More...
 

Detailed Description

A display comprised of one or more SevenSegment characters

Constructor & Destructor Documentation

◆ SevenSegmentDisplay() [1/2]

SevenSegmentDisplay ( IList< Led Leds,
bool  rightToLeftDigits = false 
)

Construct a SevenSegment display from a list of LEDs.

Parameters
LedsThe list of LEDs to use
rightToLeftDigitsWhether the digits are right-to-left digits

◆ SevenSegmentDisplay() [2/2]

SevenSegmentDisplay ( IList< SevenSegmentDigit Digits)

Construct a SevenSegmentDisplay from a collection of already-created digits

Parameters
Digits

Member Function Documentation

◆ clear()

override async Task clear ( )
protectedvirtual

clear the display

Returns
An awaitable task that completes when finished

Implements CharacterDisplay.

◆ updateCursorPosition()

override async Task updateCursorPosition ( )
protectedvirtual

update the cursor position

Returns
An awaitable task that completes when finished

Implements CharacterDisplay.

◆ write()

override Task write ( dynamic  value)
protectedvirtual

write a value to the current position of the display

Parameters
valuethe value to write
Returns
An awaitable task that completes when finished

Implements CharacterDisplay.

◆ SetCursorPosition()

Task SetCursorPosition ( int  left,
int  top 
)
inherited

Set left/right cursor position

Parameters
leftThe left position
topThe top position
Returns
An awaitable task that completes once the cursor is updated

Implements ICharacterDisplay.

◆ WriteLine()

Task WriteLine ( dynamic  value)
inherited

Write a line of text, advancing the cursor to the next line

Parameters
valuethe text to write
Returns
An awaitable task that completes when finished

Implements ICharacterDisplay.

◆ Write()

async Task Write ( dynamic  value)
inherited

Write text

Parameters
valuethe text to write
Returns
An awaitable task that completes when finished

Implements ICharacterDisplay.

◆ Clear()

Task Clear ( )
inherited

Clear the display and reset the cursor to (0,0)

Returns
An awaitable task that completes when finished

Implements ICharacterDisplay.

Property Documentation

◆ Text

dynamic Text
getset

Gets or sets the currently-displayed text.

◆ LeftAlignt

bool LeftAlignt
getset

Controls whether the display should be left-aligned or not.

◆ History

Collection<string> History = new Collection<string>()
getinherited

History of previously-written lines from the display

◆ Lines

Collection<string> Lines = new Collection<string>()
getinherited

Current lines of the display

◆ Columns

int Columns
getinherited

Number of columns of the display

◆ Rows

int Rows
getinherited

Number of rows of the display

◆ CursorLeft

int CursorLeft
getsetinherited

Cursor left position

◆ CursorTop

int CursorTop
getsetinherited

Cursor top position


The documentation for this class was generated from the following file: