nxgraph.h

来自「Display simple data graph on 320x240 LCD」· C头文件 代码 · 共 89 行

H
89
字号
#ifndef _NX_GRAPH
#define _NX_GRAPH

#include "GUI.h"
#include "nxConfig.h"

#ifdef NXGRAPH_USE_V20090205

#define NXGRAPH_MAX_LINES	5
#define NXGRAPH_REDRAW_ALL	0

#define LEFT_SHIFT			5 * 6
#define BOTTOM_SHIFT		8

//labels font : 6*8 from ucGUI

class nxGraph
{
	public:
		nxGraph();
		float XMin;
		float XScale;
		float XStep;
		float YMin;
		float YScale;
		float YStep;
		unsigned int Top;
		unsigned int Left;
		unsigned int Height;
		unsigned int Width;
		unsigned int PrevX[NXGRAPH_MAX_LINES];
		unsigned int PrevY[NXGRAPH_MAX_LINES];
		int Period;
		void Redraw(unsigned char Mode = NXGRAPH_REDRAW_ALL);
		void AddXY(unsigned char Line, float x, float y, bool visible = true);
		void ClearLines(void);
		~nxGraph();
	private:
		//no
};

#endif

#ifdef NXGRAPH_USE_V20090301

#define NXGRAPH_MAX_LINES	10
#define NXGRAPH_REDRAW_ALL	0

#define LEFT_SHIFT		5 * 6
#define BOTTOM_SHIFT		8

#define GRAPH_LINES           1
#define GRAPH_POINTS          2

//labels font : 6*8 from ucGUI

class nxGraph
{
	public:
		nxGraph();
		float XMin;
		float XScale;
		float XStep;
		float YMin;
		float YScale;
		float YStep;
            float Marker1;
            float Marker2;
            float Marker3;
            char Mode;
		unsigned int Top;
		unsigned int Left;
		unsigned int Height;
		unsigned int Width;
		unsigned int PrevX[NXGRAPH_MAX_LINES];
		unsigned int PrevY[NXGRAPH_MAX_LINES];
		int Period;
		void Redraw(unsigned char Mode = NXGRAPH_REDRAW_ALL);
		void AddXY(unsigned char Line, float x, float y, bool visible = true);
		void ClearLines(void);
		~nxGraph();
	private:
		//no
};

#endif

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?