//-------------------------------------------------------------------------------------------------
// <copyright file="SBGPCTDProgramSettings.cpp" company="LiquidRobotics">
//
// Copyright (c) 2014 Liquid Robotics, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// This software is associated with a release.  Liquid Robotics makes no
// representation that the design, interfaces or component distribution will
// remain unchanged in future releases.
//
// </copyright>
//
// <summary>
// 	Implementation of SBGPCTDProgramSettings, an serializable entity class that contains the config
//  settings for an instance of SBGPCTDProgram
// </summary>
//
// <owner>Mike Cookson</owner>
//-------------------------------------------------------------------------------------------------

#include "SBGPCTDProgramSettings.h"
#include "LqrSMACLoadSaveBoostXml.h"

using namespace std;
using namespace LiquidRobotics::SMACFramework;
using namespace LiquidRobotics::EventLib;

namespace LiquidRobotics {
namespace SeabirdGPCTD {

SBGPCTDProgramSettings::SBGPCTDProgramSettings()
: sampleEventSettings("SBGPCTDSample", "SBGPCTDSampleEvent", "LiquidR-SMC")
, sampleFormatCode(8)
, o2SampleEventSettings("SBGPCTDSampleWithDO", "SBGPCTDSampleEvent", "LiquidR-SMC")
, o2SampleFormatCode(9)
, telemetryChangedEventSettings("TelemetryChangedEvent", "TelemetryChangedEvent", "LiquidR-SMC")
{
}

SBGPCTDProgramSettings::~SBGPCTDProgramSettings()
{
}

const SBGPCTDControllerSettings& SBGPCTDProgramSettings::GetControllerSettings() const
{
	return controllerSettings;
}

void SBGPCTDProgramSettings::SetControllerSettings(const SBGPCTDControllerSettings& newValue)
{
	controllerSettings = newValue;
}

const SensorProgramSettings& SBGPCTDProgramSettings::GetSensorProgramSettings() const
{
	return sensorProgramSettings;
}

void SBGPCTDProgramSettings::SetSensorProgramSettings(const SensorProgramSettings& newValue)
{
	sensorProgramSettings = newValue;
}

void SBGPCTDProgramSettings::Load(const string& fileName)
{
	LoadBoostXml(fileName, *this);
}

void SBGPCTDProgramSettings::Save(const string& fileName) const
{
	SaveBoostXml(fileName, *this);
}

const EventSettings& SBGPCTDProgramSettings::GetSampleEventSettings() const
{
	return sampleEventSettings;
}

void SBGPCTDProgramSettings::SetSampleEventSettings(const EventSettings& newValue)
{
	sampleEventSettings = newValue;
}

unsigned SBGPCTDProgramSettings::GetSampleFormatCode() const
{
	return sampleFormatCode;
}

void SBGPCTDProgramSettings::SetSampleFormatCode(unsigned newValue)
{
	sampleFormatCode = newValue;
}

const EventSettings& SBGPCTDProgramSettings::GetO2SampleEventSettings() const
{
	return o2SampleEventSettings;
}

void SBGPCTDProgramSettings::SetO2SampleEventSettings(const EventSettings& newValue)
{
	o2SampleEventSettings = newValue;
}

unsigned SBGPCTDProgramSettings::GetO2SampleFormatCode() const
{
	return o2SampleFormatCode;
}

void SBGPCTDProgramSettings::SetO2SampleFormatCode(unsigned newValue)
{
	o2SampleFormatCode = newValue;
}

const EventSettings& SBGPCTDProgramSettings::GetTelemetryChangedEventSettings() const
{
	return telemetryChangedEventSettings;
}

void SBGPCTDProgramSettings::SetTelemetryChangedEventSettings(const EventSettings& newValue)
{
	telemetryChangedEventSettings = newValue;
}

}
}
