#pragma once

#include "data/config/SamplingConfig.h"

namespace inertia
{

/** DetectionTypes */
enum DetectionTypes {
	DETECT_ALL = 0,
	DETECT_ACCEL,
	DETECT_GYRO,
	DETECT_PIR,
	DETECT_PRESSURE
};

struct INERTIA_API DetectionConfig
	: SamplingConfig
{
	bool adoptSettings, enableAlgorithm, resetAlgorithm, adoptGlobal;
	DetectionTypes type;

	uint8_t inputSelection; // axis or channel to use
	uint16_t actionThreshold, offsetThreshold, restThreshold, smashThreshold, minimumVolume;
	uint32_t globalSettings;

	DetectionConfig();
	DetectionConfig(uint8_t const* in);
	DetectionConfig(std::wstring const& argString);

#ifdef WITH_BOOST_PROGRAM_OPTIONS
	static const po::options_description GetOptionDescription();
#endif

	static unsigned GetLength();
	void GetBytes(std::vector<uint8_t>& out) const override;
	ConfigType GetConfigType() const override;
	const std::wstring ToString() const override;
};

}
