#ifndef __PAGEDESIGN_H__
#define __PAGEDESIGN_H__

#include "lcd.h"

//ҳ屳ɫ
#define PAGE_COLOR	LCD_BLACK

//߽
#define	BdX1(Box)	(Box.X1)
#define	BdY1(Box)	(Box.Y1)
#define	BdX2(Box)	(Box.X1+Box.Width)
#define	BdY2(Box)	(Box.Y1+Box.Height)

//ؽṹ嶨
typedef struct {
	uint16_t X1;	//x1
	uint16_t Y1;	//y1
	uint16_t Width;	//Ŀ
	uint16_t Height;//ĸ߶

} Box_XY;

//ťؽṹ嶨
typedef struct {
	Box_XY Box;
	uint32_t TextColor;
	uint32_t BackColor;
	uint8_t TextSize;
	char Text[10][30];
} Button;

//ıؽṹ嶨
typedef struct {
	Box_XY Box;
	uint32_t TextColor;
	uint32_t BackColor;
	uint8_t TextSize;	//С
} Text;

//ؽṹ嶨
typedef struct {
	float X;	//ͼƬx
	float Y;	//ͼƬy

} Point_XY;

//νؽṹ嶨
typedef struct {
	Box_XY Window;		//ʾεĴ
	float Range;		//ʾηΧԭʼֵľֵ
	uint8_t ADC_Bits;	//ADCλ
	float Gain;		//Ŵ
	Box_XY Wave_Area;	//
	double Precision;	//
} Wave_Page;



extern Wave_Page ADC_Wave;

void Draw_Box(Box_XY Box, uint32_t Color,int16_t Offset);
void Fill_Box(Box_XY Box,uint32_t BackColor,int16_t Offset);
void Get_Waveform_Window_Parameters(Wave_Page *Wave);
void Draw_Waveform_Windows(Wave_Page Wave, uint32_t Sample_Rate);
void Draw_Waveform(Wave_Page Wave,uint16_t *Pre_Wave_Data,uint16_t *Wave_Data, int32_t OffsetY);
void Draw_Grid_Background(Wave_Page Wave);
void Display_Time_Scale(Wave_Page Wave,uint32_t Sample_Rate);
void Display_Voltage_Scale(Wave_Page Wave);
void Draw_Normal_Button(Button Button);
void Draw_Normal_Text(Text Text, char *str);
void Draw_Button_Effect(Button Button);
void Draw_Mark_Line(uint8_t Direction,uint16_t Point, uint16_t Start,uint16_t End,uint32_t Color);

#endif
