public void AddConstant(object value, string name, XDFCategories category, string units, int size, int address, bool issixteenbit)
{
if (sw != null)
{
ConstantID++;
sw.WriteLine("%%CONSTANT%%");
sw.WriteLine("000002 UniqueID =0x" + ConstantID.ToString("X4"));
sw.WriteLine("000100 Cat0ID =0x" + ((int)category).ToString("X2"));
sw.WriteLine("020005 Title =\"" + name + "\"");
sw.WriteLine("020011 DescSize =0x1");
sw.WriteLine("020010 Desc =\"\"");
sw.WriteLine("020020 Units =\"" + units + "\"");
if (issixteenbit)
{
sw.WriteLine("020050 SizeInBits =0x10");
}
sw.WriteLine("020100 Address =0x" + address.ToString("X6"));
sw.WriteLine("020200 Equation =TH|0|0|0|0|");
sw.WriteLine("%%END%%");
}
}