XML data container serializer -- 2
Budget: £10 – £40 GBP
I DO NOT WANT TO HEAR ABOUT HOW GREAT YOU ARE AT EVERYTHING..
Just that you can do the this C# job.. and quickly..
The solution must use serialisation so that if I change the structs I do not have to update your saving and loading code. This is important!!
I want someone to write the load and save functions here to load/save the DataContainer to disk in XML
[Serializable]
public struct FanDetails
{
public Int16 outputBit;
public Int16 inputBit;
public Int16 triggerPeriod;
public Int16 failPolarity;
public Int16 inputOverride;
}
[Serializable]
public struct ILSDetails
{
public Int16 ILSBit;
public float weighting;
public Int16 openTime;
public Int16 closeTime;
public UInt16 stepGrouping;
public UInt16 stepLSMModuleNumber;
public Int16 stepLSMBit;
}
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System;
using System.Linq.Expressions;
using System.Xml.Serialization;
[Serializable]
public class DataContainer
{
public List<FanDetails> Fans { get; set; }
public List<ILSDetails>[] LoadSteps { get; set; } = new List<ILSDetails>[ILS.LoadStepRange];
public DataContainer()
{
Fans = new List<FanDetails>();
for (int i = 0; i < ILS.LoadStepRange; i++)
{
LoadSteps[i] = new List<ILSDetails>();
}
}
// Serialize a DataContainer to an XML file
public void Save(string fileName)
{
}
// Deserialize a DataContainer from an XML file
public static DataContainer Load(string fileName)
{
}
}
Just that you can do the this C# job.. and quickly..
The solution must use serialisation so that if I change the structs I do not have to update your saving and loading code. This is important!!
I want someone to write the load and save functions here to load/save the DataContainer to disk in XML
[Serializable]
public struct FanDetails
{
public Int16 outputBit;
public Int16 inputBit;
public Int16 triggerPeriod;
public Int16 failPolarity;
public Int16 inputOverride;
}
[Serializable]
public struct ILSDetails
{
public Int16 ILSBit;
public float weighting;
public Int16 openTime;
public Int16 closeTime;
public UInt16 stepGrouping;
public UInt16 stepLSMModuleNumber;
public Int16 stepLSMBit;
}
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System;
using System.Linq.Expressions;
using System.Xml.Serialization;
[Serializable]
public class DataContainer
{
public List<FanDetails> Fans { get; set; }
public List<ILSDetails>[] LoadSteps { get; set; } = new List<ILSDetails>[ILS.LoadStepRange];
public DataContainer()
{
Fans = new List<FanDetails>();
for (int i = 0; i < ILS.LoadStepRange; i++)
{
LoadSteps[i] = new List<ILSDetails>();
}
}
// Serialize a DataContainer to an XML file
public void Save(string fileName)
{
}
// Deserialize a DataContainer from an XML file
public static DataContainer Load(string fileName)
{
}
}