first commit
This commit is contained in:
39
ESP8266_DOMOTICZ_ECRAN/Graph.cpp
Normal file
39
ESP8266_DOMOTICZ_ECRAN/Graph.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#include "Graph.h"
|
||||
|
||||
Graph::Graph(Ecran * _ecran, int _x0, int _y0 ,int _x1, int _y1)
|
||||
{
|
||||
Serial.println("--------------------------------------");
|
||||
Serial.println("Init Graph");
|
||||
x0 = _x0;
|
||||
x1 = _x1;
|
||||
y0 = _y0;
|
||||
y1 = _y1;
|
||||
ecran = _ecran;
|
||||
}
|
||||
|
||||
void Graph::drawAxes()
|
||||
{
|
||||
ecran->LcdString(0, 0, axe_x);
|
||||
ecran->LcdString(x1-10, y1-10, axe_y);
|
||||
|
||||
ecran->u8g2->drawLine(x0 + 5, y1 - 1, x1, y1 -1);
|
||||
ecran->u8g2->drawLine(x0 + 5, y0 + 5, x0 + 5, y1);
|
||||
}
|
||||
void Graph::drawTitle()
|
||||
{
|
||||
if (title != "") {
|
||||
ecran->LcdString(x0 + 20, y0, title);
|
||||
}
|
||||
}
|
||||
void Graph::drawDatas()
|
||||
{
|
||||
|
||||
}
|
||||
void Graph::drawGraph()
|
||||
{
|
||||
drawAxes();
|
||||
drawTitle();
|
||||
// drawDatas();
|
||||
ecran->u8g2->sendBuffer();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user