#include "BellowsPosition_Interface.hpp"
#include <Logger.hpp>
#include <system_time.hpp>

BellowsPosition::BellowsPosition(std::string id, bellowsPosSensorCfg_t cfg)
: id_(id), sensorCfg_(cfg)
{
}

void BellowsPosition::logEngLine(std::string comment)
{
	//TODO fix: Logger::logEngLine(ALWAYS, this->id_, comment);
}

void BellowsPosition::logEngLine(BellowsPosition::Measurement meas, std::string comment)
{
	char counts[16] = "0.0";
	char volts[16] = "0.0";
	char position_mm[16] = "0";
	char position_pctFull[8] = "0.0";

	snprintf(counts, sizeof(counts), "%ld", meas.counts);
	snprintf(volts, sizeof(volts), "%.6f", meas.volts);
	snprintf(position_mm, sizeof(position_mm), "%.6f", meas.position_mm);
	snprintf(position_pctFull, sizeof(position_pctFull), "%.4f", meas.position_pctFull);

	//TODO fix: Logger::logEngLine(ALWAYS, this->id_, meas.tickstamp, comment, counts, volts, position_mm, position_pctFull);
}

void BellowsPosition::logEngFileHeader()
{
	//TODO fix: 	Logger::logEngLine(ALWAYS, this->id_, "dateTime_Z", "state", "comment", "counts", "volts", "position_mm", "position_pctFull" );
	//TODO fix: Logger::logEngLine(ALWAYS, this->id_, "text", "text", "text", "text", "0.0", "0.0", "0.0", "0.0");
}
