public static ProsimOffset Load(XmlNode node) { try { ProsimOffset result = null; node = node.SelectSingleNode("fsuipc"); if (node != null) { string serial = node.Attributes["serial"].Value; int port = int.Parse(node.Attributes["port"].Value); byte type = (byte)(port >> 16 & 3); if (type == 2) { int off = port & 0xffff; int val = port >> 18; FS.SimpleVariable offset = new simPROJECT.FS.SimpleVariable(off); FS.SimpleVariable offsetReset = new simPROJECT.FS.SimpleVariable(off); offset.ForWriting = true; offsetReset.ForWriting = true; switch (serial) { case "8 bit U": offset.ValueSize = 1; offsetReset.ValueSize = 1; offset.Value1 = (byte)val; break; case "16 bit U": case "16 bit S": offset.ValueSize = 2; offsetReset.ValueSize = 2; offset.Value2 = (short)val; break; case "32 bit U": case "32 bit S": offset.ValueSize = 4; offsetReset.ValueSize = 4; offset.Value4 = val; break; default: return(null); } result = new ProsimOffset(); result._offset = offset; result._offsetReset = offsetReset; } } return(result); } catch { return(null); } }
public PMDG737MCP() { _fsVariables = new simPROJECT.FS.SimpleVariable[] { _fsPMDGMCPstatus , _fsPMDGSPDINTV , _fsPMDGCOstatus , _fsPMDGIAS , _fsPMDGHDG , _fsPMDGALT , _fsPMDGVS , _fsIAS , _fsMACH , _fsCRS , _fsPMDGAT }; }