/*#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif*/
#ifndef LcdMQTTViewerdef
#define LcdMQTTViewerdef 1

#include "MqttDefines.h"
class LiquidCrystal;
class PubSubClient;
class MqttVarManager;
struct LcdMQTTInfo
{
	byte ivar;//indice a variable
	char formatLCD[32];//formato
	byte pan;//pantalla en la que sale
  byte line;//linea en la que sale

};

#define MAXINFOLCD	 8
class LcdMQTTViewer
{
public:
	LiquidCrystal *lcd;
	int nchar;
	int maxtInfo;
	int maxpan;
	int panActual = 0;
  unsigned long  tiempo;
	unsigned long incre_t;


  MqttVarManager* vars;
  
	LcdMQTTInfo LcdConf[MAXINFOLCD];

	LcdMQTTViewer();

  void inicia(MqttVarManager *vars, LiquidCrystal* lcdEx, int digi, int lines);
  void loop();//publica datos variables

//auxiliares----------------------------------------------------------
	void add(byte ivar, char* formatLCD, int line, int pan);
	void setTimer(int seg);
	void envia(char* txt, int pos, int line);
	void envia(int pan);
	void revisa();
};
#endif
