public static Configuration Load(string fileName, HomeSimCockpitSDK.IInput module) { if (!File.Exists(fileName)) { throw new FileNotFoundException(fileName); } Configuration c = new Configuration(); XmlDocument xml = new XmlDocument(); xml.Load(fileName); XmlNodeList nodes = xml.SelectNodes("/configuration/inputs/input"); if (nodes != null && nodes.Count > 0) { List <FSXInput> inputs = new List <FSXInput>(); foreach (XmlNode node in nodes) { #warning sprawdzenie czy zmienna o danym id już istnieje inputs.Add(FSXInput.Load(node, module)); } inputs.Sort(); c._inputs = inputs.ToArray(); } return(c); }
public Input(HomeSimCockpitSDK.IInput module, string id, string description, Device device, byte code) { Module = module; _id = id; Description = description; _device = device; Code = code; }
public static FSXInput Load(XmlNode xml, HomeSimCockpitSDK.IInput module) { FSXInput result = new FSXInput(); result._module = module; result._id = xml.Attributes["id"].Value; result._description = xml.Attributes["description"].Value; result._type = (HomeSimCockpitSDK.VariableType)Enum.Parse(typeof(HomeSimCockpitSDK.VariableType), xml.Attributes["type"].Value); if (result.Type == HomeSimCockpitSDK.VariableType.Unknown) { throw new Exception("Zmienna wejściowa '" + result.ID + "' nie ma określonego typu."); } result._fsxName = xml.Attributes["fsxName"].Value; result._fsxUnit = (FSXUnit)Enum.Parse(typeof(FSXUnit), xml.Attributes["fsxUnit"].Value); result._fsxType = (Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATATYPE)Enum.Parse(typeof(Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATATYPE), xml.Attributes["fsxType"].Value); result._fsxEpsilon = Convert.ToSingle(xml.Attributes["fsxEpsilon"].Value); result._fsxGroup = Convert.ToUInt16(xml.Attributes["fsxGroup"].Value); return(result); }
public OneStateInput(HomeSimCockpitSDK.IInput module, string id, string description, Device device, byte code) : base(module, id, description, device, code) { }
public Timer(HomeSimCockpitSDK.IInput module, int index) { Module = module; Index = index; }
public COMNAV(HomeSimCockpitSDK.IInput module, XmlNode node) : base(module, node) { Init(); }
public COMNAV(HomeSimCockpitSDK.IInput module) : base(module) { Init(); }
public FCU(HomeSimCockpitSDK.IInput module) : base(module) { Init(); }
void b_VariableChanged(HomeSimCockpitSDK.IInput inputModule, string variableID, object variableValue) { BeginInvoke(new MetodaDelegate(SetValue), variableID, variableValue); }
protected Device(HomeSimCockpitSDK.IInput module, XmlNode node) : this(module) { Name = node.Attributes["name"].Value; SerialNumber = node.Attributes["serialNumber"].Value; }
protected Device(HomeSimCockpitSDK.IInput module) { Module = module; }