Difference between revisions of "Component: GLCD Graph Creator (Graphical Library)"
(Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 1.2 |- | width="20%" style="color:gray...") |
|||
(14 intermediate revisions by the same user not shown) | |||
Line 14: | Line 14: | ||
==GLCD Graph Creator component== | ==GLCD Graph Creator component== | ||
A component to simplify the process of drawing graphs and charts using a graphical LCD. | A component to simplify the process of drawing graphs and charts using a graphical LCD. | ||
+ | |||
+ | ==Component Source Code== | ||
+ | |||
+ | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Lib_GLCD_Graph.fcfx FC_Comp_Source_Lib_GLCD_Graph.fcfx] | ||
+ | |||
+ | 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== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
''No detailed description exists yet for this component'' | ''No detailed description exists yet for this component'' | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 47: | Line 97: | ||
* If Show Border is enabled then Width and Height should be as above plus 2 to account for the border pixels | * If Show Border is enabled then Width and Height should be as above plus 2 to account for the border pixels | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Macro reference== | ||
+ | |||
+ | ===AddPoint=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 80: | Line 118: | ||
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:]] - | + | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT |
| width="90%" | Data | | width="90%" | Data | ||
|- | |- | ||
Line 95: | Line 133: | ||
+ | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 106: | Line 145: | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 357: | Line 155: | ||
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] |
− | | width="90%" | | + | | 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 | | colspan="2" | Graphical LCD Object to draw the graph on | ||
Line 386: | Line 188: | ||
|- | |- | ||
| colspan="2" | Vertical size of the graph in pixels | | 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="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
Line 426: | Line 232: | ||
|- | |- | ||
| colspan="2" | Decides if a X or Y grid is shown for the graph | | 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="10%" align="center" | [[File:Fc9-type-1-icon.png]] | ||
Line 436: | Line 246: | ||
|- | |- | ||
| colspan="2" | Determines the graph plot colour. | | colspan="2" | Determines the graph plot colour. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} |
Latest revision as of 13:11, 7 February 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 download the component source project: FC_Comp_Source_Lib_GLCD_Graph.fcfx
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
AddPoint | |
Adds a new data point to the graph. | |
- INT | Data |
Data Value to plot | |
- BYTE | Index |
Plot Index: Range 0-7 | |
- VOID | Return |
Initialise
Initialise | |
Initialises the graph object on the GLCD to the specified dimensions. | |
- VOID | Return |