#ifndef PRINTER_H_INCLUDED
#define PRINTER_H_INCLUDED

#include <map>
#include <string>
#include "serial.h"
#include "json.hpp"
#include "point.h"

class Printer{
    Point position;
    long int length;
    long int width;
    int pencount;
    std::map<int, std::string> pens;
    bool power;
    int port;
    long int baudrate;
    Serial com;
public:
    Printer();
    Printer(long int _length, long int _width, int _pencount, std::map<int, std::string> _pens, int _port, long int _baudrate);

    Point getPosition();
    long int getLength();
    long int getWidth();
    int getPenCount();
    std::map<int, std::string> getPens();
    bool getPowerState();
    std::string getPort();
    int getPortInt();
    long int getBaudRate();

    bool setSettings(long int _length, long int _width, int _pencount, std::map<int, std::string> _pens, int _port, long int _baudrate);
    bool setComParameters(int _port, long int _baudrate);

    bool connect();
    void disconnect();
    bool isConnected();
    bool send(std::string s);
    std::string recv();
    bool autoDetect();
};

#endif // PRINTER_H_INCLUDED
