// A display for X, Y data
#pragma once
#include "libOLED/displayclass.H"
class displayXY_t
{
/// \param display the parent display
/// \param xmin minimum X axis value
/// \param xmax maximum X axis value
public:
/// \param siz = size
displayXY_t(display_t &disp,
int xmin, int xmax, int ymin, int ymax);
void drawAxes();
void plotPoint(int x, int y, char *message = nullptr,char * message_lower = nullptr, char * message_upper=nullptr);
private:
display_t &display;
const int x_min;
const int x_max;
const int y_min;
const int y_max;
const int left_margin;
const int right_margin;
const int plot_width;
const int top_margin;
const int bottom_margin;
const int plot_height;
/// @brief persistent storage - a trail of pixels follow the plotted point. .
static unsigned const PERSIST= 40;
uint8_t persist_x[PERSIST];
uint8_t persist_y[PERSIST];
uint8_t next_persist;
};