#ifndef __screen_move_sensorerror
#define __screen_move_sensorerror

#include "include/screenids.h"
#include "../screen.h"
#include "../Control.h"


/*
 * Move sensor error screen
 *   Shows a warning that the height sensor is not providing valid values.
 *   Can only be dismissed after the sensor is stable again.
 */
class MoveSensorErrorScreen : public BaseScreen
{
  public:
    MoveSensorErrorScreen(ScreenManager* screenManager, Adafruit_GFX* display) : BaseScreen(screenManager, display) { }

    void onShow();
    void onButton(Button button);
    void onTick();

    ScreenId screenId() { return ScreenId::MoveSensorError; };

  private:
    uint32_t lastRefresh;
    uint8_t currentHeightY;
    uint16_t lastTextWidth = 0;

    void drawLastMeasurement();
};

#endif
