Treehopper C# API
BarGraph Class Reference

Represents a collection of LEDs visually arranged in a line or circle that represent a real-valued number from 0.0 to 1.0. More...

Inheritance diagram for BarGraph:
LedDisplay IFlushable

Public Member Functions

 BarGraph (IList< Led > Leds)
 Construct a bar graph from a list of LEDs. More...
 
void WriteLeds ()
 Write the LEDs without flushing the drivers More...
 
Task FlushAsync (bool force=false)
 Flush data to the drivers More...
 

Public Attributes

IFlushable Parent => null
 The parent object. More...
 

Properties

double Value [get, set]
 THe value – from 0.0 to 1.0 – of the bar graph More...
 
bool Fill [get, set]
 Gets or sets whether the display should fill. More...
 
LedCollection Leds [get]
 The collection of LEDs belonging to this bar graph More...
 
bool AutoFlush = true [get, set]
 Whether to automatically flush this LED widget whenever a value is written to it More...
 

Detailed Description

Represents a collection of LEDs visually arranged in a line or circle that represent a real-valued number from 0.0 to 1.0.

This class can be used to construct a wide variety of dynamic displays, including LED rings around encoders, linear displays, and animation effects.

Constructor & Destructor Documentation

◆ BarGraph()

BarGraph ( IList< Led Leds)

Construct a bar graph from a list of LEDs.

Parameters
LedsThe list of LEDs to use in the bar graph

Member Function Documentation

◆ WriteLeds()

void WriteLeds ( )

Write the LEDs without flushing the drivers

◆ FlushAsync()

Task FlushAsync ( bool  force = false)

Flush data to the drivers

Parameters
forceWhether to force all data to flush, even if it appears to be unchanged
Returns
An awaitable task

Implements IFlushable.

Member Data Documentation

◆ Parent

IFlushable Parent => null

The parent object.

Unused, returns null.

Property Documentation

◆ Value

double Value
getset

THe value – from 0.0 to 1.0 – of the bar graph

◆ Fill

bool Fill
getset

Gets or sets whether the display should fill.

When false, the display's current value is only indicated by a single LED.

◆ Leds

LedCollection Leds
get

The collection of LEDs belonging to this bar graph

◆ AutoFlush

bool AutoFlush = true
getset

Whether to automatically flush this LED widget whenever a value is written to it


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