#pragma once

namespace inertia
{

/** @brief Logging Columns.
 *
 *  A struct to specify the enabled columns in a logfile.
 */
struct INERTIA_API LogColumns
{
	bool sampleNumberEnabled;        ///< Sample number is included.
	bool seqNrSlotIndexEnabled;      ///< Detailed sample information (sequence number, index, slot) is included.
	bool nodeIDEnabled;              ///< NodeID is included.
	bool lostSamplesEnabled;         ///< Lost Samples is included.
	bool accelerometerEnabled;       ///< Accelerometer data is included.
	bool compassEnabled;             ///< Compass data is included.
	bool gyroscopeEnabled;           ///< Gyroscope data is included.
	bool rssiEnabled;                ///< Radio Signal Strength Indicator (RSSI) is included.
	bool rtcEnabled;                 ///< Real Time Clock (RTC) is included.
	int quaternionEulerCount;        ///< Orientation is included: Quaternion (w, x, y, z) (1), Euler angles (roll, pitch, yaw) (2), both (3) or none (negative).
	int adcCount;                    ///< ADC values are included (negative to disable).
	bool statusEnabled;              ///< Status data (battery, CPU Temperature, External Input) is included.
	bool accelerometerHighGEnabled;  ///< High-G Accelerometer data is included.
	bool pressureEnabled;            ///< Pressure data is included.
	bool temperatureEnabled;         ///< Temperature data is included.
	int imaCount;                    ///< IMA values are included (negative to disable).
	int ioCount;                     ///< I/O values are included (negative to disable).
	int customCount;                 ///< Custom values are included (negative to disable).
	bool gpsEnabled;                 ///< GPS data is included (separate file or struct).
	bool statusRawEnabled;           ///< Raw status data is included (separate file or struct).
	bool sensorsEnabled;             ///< Sensor data per sensorID

	/** Default constructor. */
	LogColumns();

	/** Constructor setting the availability of each member.
	 *  @param _sampleNumber set sampleNumberEnabled
	 *  @param _seqNrSlotIndex set seqNrSlotIndexEnabled
	 *  @param _nodeID set nodeIDEnabled
	 *  @param _lostSamples set lostSamplesEnabled
	 *  @param _accelerometer set accelerometerEnabled
	 *  @param _compass set compassEnabled
	 *  @param _gyroscope set gyroscopeEnabled
	 *  @param _rssi set rssiEnabled
	 *  @param _rtc set rtcEnabled
	 *  @param _quaternionEuler set quaternionEulerCount
	 *  @param _adc set adcCount
	 *  @param _status set statusEnabled
	 *  @param _accelHighG set accelerometerHighGEnabled
	 *  @param _pressure set pressureEnabled
	 *  @param _temperature set temperatureEnabled
	 *  @param _ima set imaCount
	 *  @param _io set ioCount
	 *  @param _custom set customCount
	 *  @param _gps set gpsEnabled
	 */
	LogColumns(const bool _sampleNumber, const bool _seqNrSlotIndex, const bool _nodeID, const bool _lostSamples, const bool _accelerometer,
		const bool _compass, const bool _gyroscope, const bool _rssi, const bool _rtc, const int _quaternionEuler,
		const int _adc, const bool _status, const bool _accelHighG, const bool _pressure,
		const bool _temperature, const int _ima, const int _io, const int _custom, const bool _gps);

	/** Constructor with string argument.
	 *  @param argString string with arguments
	 */
	LogColumns(std::wstring const& argString);

	/** Adjust the ADC, IMA, IO and Custom count to the configuration settings of the nodes at the provided source.
	 *  The count is not updated if a sensor configuration is not present.
	 *  @param source The connection or logfile to get the info from
	 */
	void UpdateCount(std::wstring const& source);

	/** Enable the default columns for IMU sensors (ProMove).
	 */
	void SetIMUDefaults();

	/** Enable the default columns for analog DAQ systems (Nexo, V-Mon).
	 */
	void SetAnalogDefaults();

	/** Enable all columns.
	 */
	void SetAllDefaults();

#ifdef WITH_BOOST_PROGRAM_OPTIONS
	/** Get the possible command-line arguments for LogColumns.
	 *  Only available when \a WITH_BOOST_PROGRAM_OPTIONS is defined.
	 *  @return the option description
	 */
	static const po::options_description GetOptionDescription();
#endif

	/** Get a string representation of this LogColumns.
	 *  The string is compatible with GetOptionDescription() and LogColumns(std::wstring const&).
	 *  @return the string
	 */
	std::wstring const ToString() const;
};

}
