#include "BuoyancyEngine_Interface.hpp"
#include "Logger.hpp"

void BuoyancyEngine::logEngLine(std::string comment)
{
	//TODO fix: 	Logger::logEngLine(ALWAYS, id_, comment);
}

void BuoyancyEngine::logEngFileHeader()
{
/*TODO fix: 	Logger::logEngLine(ALWAYS,
		id_,
		"dateTime_Z",
		"state",
		"comment");
	Logger::logEngLine(ALWAYS,
		id_,
		"text",
		"text",
		"text");
*/
}

motorVel_normalized BuoyancyEngine::pumpSpeedForDescend(const motorVel_normalized in)
{
	// This method should ensure the inner bellows INFLATES, for this causes the platform to DESCEND
	motorVel_normalized out = 0.0;
	
	if (pump_dir_ == BuoyancyEngine::PumpDirection::POS_MOTOR_COUNTS_INFLATE_INNER_BELLOWS)
	{
		out = std::abs(in);
	}
	else 
	{
		// the pump dir is POS_MOTOR_COUNTS_DEFLATE_INNER_BELLOWS,
		// so we want to negate the input command to ensure the pump
		// goes the right way.
		out = float(-1.0 * std::abs(in));
	}
	
	return out;
}
	
motorVel_normalized BuoyancyEngine::pumpSpeedForAscend(const motorVel_normalized in)
{
	// Do the opposite, thus logic resides only in one place
	return float(-1.0 * pumpSpeedForDescend(in));
}