Select one of the symbols to view example projects that use it.
 
Outline
#include <gui/graph_screen/Graph.hpp>
#include <touchgfx/Color.hpp>
#include <touchgfx/EasingEquations.hpp>
#include <math.h>
Graph::Graph()
Graph::~Graph()
Graph::setup(int, int, uint16_t, uint16_t)
Graph::setRange(int, int, int, int)
Graph::setLineVisible(bool)
Graph::setDotsVisible(bool)
Graph::setDotsBackgroundVisible(bool)
Graph::setAreaVisible(bool)
Graph::setDotShape(int, int, int)
Graph::setDotBackgroundShape(int, int, int)
Graph::setAlpha(uint8_t)
Graph::getAlpha()
Files
loading...
CodeScopeSTM32 Libraries and SamplesTouchGFXGui/gui/src/graph_screen/Graph.cpp
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * This file is part of the TouchGFX 4.10.0 distribution. * * @attention * * Copyright (c) 2018 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... */ #include <gui/graph_screen/Graph.hpp> #include <touchgfx/Color.hpp> #include <touchgfx/EasingEquations.hpp> #include <math.h> Graph::Graph() : myAlpha(255) { }{ ... } Graph::~Graph() { }{ ... } void Graph::setup(int newWidth, int newHeight, uint16_t lineColor, uint16_t backgroundColor) { setWidth(newWidth); setHeight(newHeight); graphLinePainter.setColor(lineColor); graphAreaPainter.setColor(lineColor, getHeight()); graphDotsPainter.setColor(lineColor); graphDotsBackgroundPainter.setColor(backgroundColor); graphLine.setLinkedGraph(graphArea); graphLine.setLinkedGraph(graphDots); graphLine.setLinkedGraph(graphDotsBackground); graphLine.setPosition(0, 0, getWidth(), getHeight()); graphLine.setPainter(graphLinePainter); graphLine.setBuffer(graphBuffer, NUMBER_OF_POINTS); graphLine.setLineWidth(1); graphLine.setRange(-1, 77, 400, 0); graphArea.setPainter(graphAreaPainter); graphArea.setLineWidth(0); graphDots.setPainter(graphDotsPainter); graphDots.setLineWidth(7); graphDots.setDotShape(0, 90); graphDotsBackground.setPainter(graphDotsBackgroundPainter); graphDotsBackground.setLineWidth(9); graphDotsBackground.setDotShape(0, 30); add(graphArea); add(graphLine); add(graphDotsBackground); add(graphDots); }{ ... } void Graph::setRange(int left, int right, int top, int bottom) { graphLine.setRange(left, right, top, bottom); }{ ... } void Graph::setLineVisible(bool lineVisible) { graphLine.setVisible(lineVisible); }{ ... } void Graph::setDotsVisible(bool dotsVisible) { graphDots.setVisible(dotsVisible); }{ ... } void Graph::setDotsBackgroundVisible(bool dotsBackgroundVisible) { graphDotsBackground.setVisible(dotsBackgroundVisible); }{ ... } void Graph::setAreaVisible(bool areaVisible) { graphArea.setVisible(areaVisible); }{ ... } void Graph::setDotShape(int startAngle, int angleStep, int lineWidth) { graphDots.setDotShape(startAngle, angleStep); graphDots.setLineWidth(lineWidth); graphDots.invalidate(); }{ ... } void Graph::setDotBackgroundShape(int startAngle, int angleStep, int lineWidth) { graphDotsBackground.setDotShape(startAngle, angleStep); graphDotsBackground.setLineWidth(lineWidth); graphDots.invalidate(); }{ ... } void Graph::setAlpha(uint8_t alpha) { myAlpha = alpha; graphLine.setAlpha(myAlpha); graphArea.setAlpha(myAlpha); graphDots.setAlpha(myAlpha); graphDotsBackground.setAlpha(myAlpha); invalidate(); }{ ... } uint8_t Graph::getAlpha() { return myAlpha; }{ ... }