Difference between revisions of "Component: GLCD Graph Creator (Graphical Library)"
From Flowcode Help
Jump to navigationJump to searchLine 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Lib_GLCD_Graph.fcfx FC_Comp_Source_Lib_GLCD_Graph.fcfx] |
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
Line 38: | Line 40: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Line 80: | Line 84: | ||
==Macro reference== | ==Macro reference== | ||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddPoint''' | ||
+ | |- | ||
+ | | colspan="2" | Adds a new data point to the graph. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Data Value to plot | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Index | ||
+ | |- | ||
+ | | colspan="2" | Plot Index: Range 0-7 | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | ||
+ | |- | ||
+ | | colspan="2" | Initialises the graph object on the GLCD to the specified dimensions. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Property reference== | ||
+ | |||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Display Properties | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | LinkTo | ||
+ | |- | ||
+ | | colspan="2" | Graphical LCD Object to draw the graph on | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | ColourDisplay | ||
+ | |- | ||
+ | | colspan="2" | Automatically detects if the graphical LCD object is colour or monochrome | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | X Coord | ||
+ | |- | ||
+ | | colspan="2" | X coordinate for the top left of the graph container rectangle | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Y Coord | ||
+ | |- | ||
+ | | colspan="2" | Y coordinate for the top left of the graph container rectangle | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Width | ||
+ | |- | ||
+ | | colspan="2" | Horizontal size of the graph in pixels | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Height | ||
+ | |- | ||
+ | | colspan="2" | Vertical size of the graph in pixels | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Graph Properties | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Number Of Plots | ||
+ | |- | ||
+ | | colspan="2" | Determines the number of plots that can be displayed simultaneously on the graph. Monochrome displays can only support a single plot. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Number Of Points | ||
+ | |- | ||
+ | | colspan="2" | Number of data points the graph can store, multiplied by the number of plots. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | Scrolling | ||
+ | |- | ||
+ | | colspan="2" | Controls how data is drawn onto the display. Scrolling is useful for slower data where you want a constant plot with the right hand side always being the latest data. None scrolling is useful for faster data such as audio snippets. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Graph Style | ||
+ | |- | ||
+ | | colspan="2" | Controls the graph draw style. Point - Draws a single point Line - Draws a line from the last point to the new point | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
+ | | width="90%" | Min Value | ||
+ | |- | ||
+ | | colspan="2" | Value to represent the bottom Y axis on the graph | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
+ | | width="90%" | Max Value | ||
+ | |- | ||
+ | | colspan="2" | Value to represent the top Y axis on the graph | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | Show Border | ||
+ | |- | ||
+ | | colspan="2" | Decides if a border for the graph is generated | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Show Grid | ||
+ | |- | ||
+ | | colspan="2" | Decides if a X or Y grid is shown for the graph | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Theme | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-1-icon.png]] | ||
+ | | width="90%" | Background Colour | ||
+ | |- | ||
+ | | colspan="2" | Determines the graph background colour. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-1-icon.png]] | ||
+ | | width="90%" | Plot 0 Colour | ||
+ | |- | ||
+ | | colspan="2" | Determines the graph plot colour. | ||
+ | |}==Macro reference== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
Revision as of 15:15, 20 January 2023
Author | Matrix TSL |
Version | 1.2 |
Category | Graphical Library |
Contents
GLCD Graph Creator component
A component to simplify the process of drawing graphs and charts using a graphical LCD.
Component Source Code
Please click here to view the component source code (Beta): FC_Comp_Source_Lib_GLCD_Graph.fcfx
Detailed description
No detailed description exists yet for this component
Examples
The graph creator component must be linked to the graphical LCD using the gLCD Object property.
The X Coord, Y Coord, Width and Height component properties set the size and position of the graph on the gLCD.
In the attached example the ADC component sets the input to the graph. Every 50ms a sample is taken and added to the graph.
Any size of graph can be created. For efficiency it is best to try and stick to the following rules.
- The width should be equal to or a multiple of the number of points
- The height should be equal to or a division of the input range - Min Value 0 to Max Value 255 = input range of 256
- If Show Border is enabled then Width and Height should be as above plus 2 to account for the border pixels
Macro reference
![]() |
AddPoint |
Adds a new data point to the graph. | |
![]() |
Data |
Data Value to plot | |
![]() |
Index |
Plot Index: Range 0-7 | |
![]() |
Return |
![]() |
Initialise |
Initialises the graph object on the GLCD to the specified dimensions. | |
![]() |
Return |
Property reference
==Macro reference==
![]() |
AddPoint |
Adds a new data point to the graph. | |
![]() |
Data |
Data Value to plot | |
![]() |
Index |
Plot Index: Range 0-7 | |
![]() |
Return |
![]() |
Initialise |
Initialises the graph object on the GLCD to the specified dimensions. | |
![]() |
Return |