#pragma once

#include "StateEstimator_Interface.hpp"

#include <string>
#include <string_view>

enum class ControlMode : uint8_t
{
	NONE = 0,
	PRESSURE,
	VELOCITY,
	PRESSURE_VELOCITY
};

class Platform_Controller
{
  public:
	Platform_Controller(std::string id);

	virtual void start(const stateEstimate_t initial) = 0;
	virtual void stop() = 0;
	virtual void sleep() = 0;

	virtual const std::string_view getEngFileHeader() = 0;

	virtual float update(const stateEstimate_t current, const float pressureDesired_dBar,
						 const bool parkAtDesiredPressure, const float velocityDesired_dBar_s,
						 const ControlMode ctrlMode, const SBE_CTD_MODE ctdMode) = 0;

	// Contstrain inVal to +/- absLimitVal
	float constrainValueSymetric(const float inVal, const float absLimitVal);

	const std::string_view moduleID;

	static constexpr float DEFAULT_MAX_TARGET_PRESSURE_DBAR = 500.0;
	static constexpr float DEFAULT_MAX_PRESSURE_SPEED_DBAR_PER_SEC = 1.0;

  protected:
	virtual ~Platform_Controller() = default;
};