RegionSender¶
-
class
ledwall.components.
RegionSender
(x, y, width, height, delegate, mode=<WireMode.LTR: 0>)¶ Takes a rectangular region of a display and uses it as an input to a chained sender instance.
This allows it to define a bigger display than the actual physical device and map a region to the physical device.
The delegate parameter is used as the sender to hand over the color data for the defined region. The dimensions of the region and the size of the physical device, the sender is transmitting the data to, must be identical.
In combinatoin with the
ListSender
, it is possible to combine multiple physical devices to create a connected display.This sender is a middleware component. It extends the
Sender
class and therefore can be used as a sender attribute in theDisplay
class.For the delegate, this class mimics a display with the desired region.
- ..warning::
- This class exposes not every display method to the delegate. Just the properties and methods needed to send the data to the physical display.
Parameters: - x (int) – The x value of the top left corner of the region
- y (int) – The y value of the top left corner of the region
- width (int) – The width of the region
- height (int) – The height of the region
- delegate (Sender) – The sender instance to send the color data to
- mode (WireMode) – The mode that the LEDs are organized. Left-to-Right or Zig-Zag. Defaults to WireMode.LTR.
-
init
(panel)¶ Sets the associated display. This method will be called by the display, so don’t call this method directly. When update() is called, the implementation can access the display via the property ‘panel’. (I know, it’s confusing and will be changed in the future).
-
update
()¶ This method will be called every time, the sender should update the physical led display and should be implemented in every derived class.