using System;
using System.Xml.Serialization;

namespace QDART_MFG_CfgEditor;

[Serializable]
public class QTADataInfo
{
	private string frequency;

	private string loss;

	private string delta;

	[XmlElement(ElementName = "Frequency")]
	public string Frequency
	{
		get
		{
			return frequency;
		}
		set
		{
			if (double.TryParse(value, out var _))
			{
				frequency = value;
				return;
			}
			Exception ex = new Exception("Invalid data for frequency");
			throw ex;
		}
	}

	[XmlElement(ElementName = "Value")]
	public string Loss
	{
		get
		{
			return loss;
		}
		set
		{
			if (double.TryParse(value, out var _))
			{
				loss = value;
				return;
			}
			Exception ex = new Exception("Invalid data for loss at frequency " + frequency);
			throw ex;
		}
	}

	[XmlElement("Delta")]
	public string Delta
	{
		get
		{
			return delta;
		}
		set
		{
			delta = value;
		}
	}
}
