DisplayModel
Class that contains current data (state of all dots) of the display. Any changes made here will be updated on display view in next update loop. This data tells what should be visible on actual display on screen. Actual display however may have broken or delayed pixels, or visible display is not yet updated to match this data.
This class doesn't have public constructor. Instance of this class is automatically created when DotMatrix initializes. After that reference to this class can be get from DotMatrix using GetDisplayModel() method.
In most cases there is no need to access this class directly but use Controller instead.
Properties
public int Height | Gets the height of display. | public int Width | Gets the width of display. |
Methods
public void Clear () | Clears the display by setting all dots 'off' (all dots to state 0). | public void ClearColumn (int x) | Clears the single column of display. | public void ClearRow (int y) | Clears the single row of display. | public void CycleDown () | Cycle everything on display to one dot down. | public void CycleLeft () | Cycle everything on display to one dot left. | public void CycleRight () | Cycle everything on display to one dot right. | public void CycleUp () | Cycle everything on display to one dot up. | public void Fill () | Fills the display by setting all dots 'on' (all dots to state 1). | public void FillColumn (int x) | Fills the single column of display. | public void FillRow (int y) | Fills the single row of display. | public int GetDotState (int x, int y) | Get state (color/rotation) of single dot. | public int[,] GetFullContent (int[,] target) | Gets the full content of the display (state of every dot) at this very moment. | public bool IsAllDotsInState (int state) | Check whatever all the dots in display are in certain state. | public bool IsClear () | Check if display is clear (all dots are off). | public bool IsDotOn (int x, int y) | Check if single dot is on or off. | public bool IsFull () | Check if display is full (all dots are on). | public void PushDown () | Move everything on display to one dot down. | public void PushLeft () | Move everything on display to one dot left. | public void PushRight () | Move everything on display to one dot right. | public void PushUp () | Move everything on display to one dot up. | public void SetAll (int state) | Set all the dots in display to certain state. | public void SetColumn (int x, int state) | Set all the dots in single column to certain state. | public void SetContent (bool[,] newContent) | Set new content to whole display. | public void SetDot (int x, int y, bool on) | Set state of single dot to on or off. | public void SetDot (int x, int y, int state) | Set state of single dot to any state. | public void SetFullContent (int[,] newContent) | Set new content to whole display. | public void SetPartialContent (int[,] partialNewContent, int posX, int posY) | Set new content to part of the display. | public void SetRow (int y, int state) | Set all the dots in single row to certain state. |
Properties
public int Height Gets the height of display. Value | Height of display in dots. |
public int Width Gets the width of display. Value | Width of display in dots. |
Methods
public void Clear () Clears the display by setting all dots 'off' (all dots to state 0).
public void ClearColumn (int x) Clears the single column of display. Parameters | x | X coordinate of column to clear, 0 is left. |
public void ClearRow (int y) Clears the single row of display. Parameters | y | Y coordinate of row to clear, 0 is top. |
public void CycleDown () Cycle everything on display to one dot down. Dots in bottom row are copied to top row.
public void CycleLeft () Cycle everything on display to one dot left. Dots in far left are copied to column far right.
public void CycleRight () Cycle everything on display to one dot right. Dots in far right are copied to column far left.
public void CycleUp () Cycle everything on display to one dot up. Dots in top row are copied to bottom row.
public void Fill () Fills the display by setting all dots 'on' (all dots to state 1).
public void FillColumn (int x) Fills the single column of display. Parameters | x | X coordinate of column to fill, 0 is left. |
public void FillRow (int y) Fills the single row of display. Parameters | y | Y coordinate of row to fill, 0 is top. |
public int GetDotState (int x, int y) Get state (color/rotation) of single dot. Parameters | x | X coordinate of dot to check, 0 is left. | | y | Y coordinate of dot to check, 0 is top. |
Returns | State of the dot. 0 is off state, 1 is default on state, 2 and forward are additional states dot can have. |
public int[,] GetFullContent (int[,] target) Gets the full content of the display (state of every dot) at this very moment. Returned array is copy of the internal content of display so making changes to returned array doesn't change anything in this display. Parameters | target | Optional target array. If null, new array is created. If not null, content is copied to this array and reference to this same array is also returned. |
Returns | State of all the dots as table of integers. Upper left dot is at index [0,0]. In actual values 0 is off state, 1 is default on state, 2 and forward are additional states dots can have. |
public bool IsAllDotsInState (int state) Check whatever all the dots in display are in certain state. Parameters | state | State where all the dots have to be for this method to return true. |
Returns | True if all the dots are in parameter state, false otherwise. |
public bool IsClear () Check if display is clear (all dots are off). Returns | True if display is clear, false otherwise. |
public bool IsDotOn (int x, int y) Check if single dot is on or off. Parameters | x | X coordinate of dot to check, 0 is left. | | y | Y coordinate of dot to check, 0 is top. |
Returns | False if dot state (color/rotation) is 0, true in all other cases. |
public bool IsFull () Check if display is full (all dots are on). In display that have more than 1 on-states, it doesn't matter on what on-state dots are as long as they are not off. Returns | False if there is any dot that is off, true otherwise. |
public void PushDown () Move everything on display to one dot down. Dots in bottom row will disappear and empty row appears to top.
public void PushLeft () Move everything on display to one dot left. Dots in far left will disappear and empty column appears to right.
public void PushRight () Move everything on display to one dot right. Dots in far right will disappear and empty column appears to left.
public void PushUp () Move everything on display to one dot up. Dots in top row will disappear and empty row appears to bottom.
public void SetAll (int state) Set all the dots in display to certain state. Parameters | state | New state (color/rotation) for all the dots. |
public void SetColumn (int x, int state) Set all the dots in single column to certain state. Parameters | x | X coordinate of column to set, 0 is left. | | state | New state (color/rotation) for all the dots in this column. |
public void SetContent (bool[,] newContent) Set new content to whole display. This method is here mostly for backward compatibility. Rather use method SetFullContent(int[,]) Parameters | newContent | New content, height and width must match display size. |
public void SetDot (int x, int y, bool on) Set state of single dot to on or off. Parameters | x | X coordinate of dot to set, 0 is left. | | y | Y coordinate of dot to set, 0 is top. | | on | True to set on, false to set off. |
public void SetDot (int x, int y, int state) Set state of single dot to any state. In two color display there is only two states, 0 (off) and 1 (on). Additional states are usually additional colors. Parameters | x | X coordinate of dot to set, 0 is left. | | y | Y coordinate of dot to set, 0 is top. | | state | New state for dot. |
public void SetFullContent (int[,] newContent) Set new content to whole display. Parameters | newContent | New content, height and width must match display size. |
public void SetPartialContent (int[,] partialNewContent, int posX, int posY) Set new content to part of the display. Any dots that would go outside of the display will be ignored. So for example parameter positions (x,y) can be also negative and parameter content can be bigger than display. Any dots in display which this new content doesn't cover, will remain unchanged. Parameters | partialNewContent | New content to add to certain point of display. | | posX | X position of display where leftmost dot of new content is added. | | posY | Y position of display where uppermost dot of new content is added. |
public void SetRow (int y, int state) Set all the dots in single row to certain state. Parameters | y | Y coordinate of row to set, 0 is top. | | state | New state (color/rotation) for all the dots in this row. |
|