Example #1
0
        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);
        }
Example #2
0
 public Input(HomeSimCockpitSDK.IInput module, string id, string description, Device device, byte code)
 {
     Module      = module;
     _id         = id;
     Description = description;
     _device     = device;
     Code        = code;
 }
Example #3
0
        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);
        }
Example #4
0
 public OneStateInput(HomeSimCockpitSDK.IInput module, string id, string description, Device device, byte code)
     : base(module, id, description, device, code)
 {
 }
Example #5
0
 public Timer(HomeSimCockpitSDK.IInput module, int index)
 {
     Module = module;
     Index  = index;
 }
Example #6
0
 public COMNAV(HomeSimCockpitSDK.IInput module, XmlNode node) : base(module, node)
 {
     Init();
 }
Example #7
0
 public COMNAV(HomeSimCockpitSDK.IInput module) : base(module)
 {
     Init();
 }
Example #8
0
 public FCU(HomeSimCockpitSDK.IInput module) : base(module)
 {
     Init();
 }
Example #9
0
 void b_VariableChanged(HomeSimCockpitSDK.IInput inputModule, string variableID, object variableValue)
 {
     BeginInvoke(new MetodaDelegate(SetValue), variableID, variableValue);
 }
Example #10
0
 protected Device(HomeSimCockpitSDK.IInput module, XmlNode node) : this(module)
 {
     Name         = node.Attributes["name"].Value;
     SerialNumber = node.Attributes["serialNumber"].Value;
 }
Example #11
0
 protected Device(HomeSimCockpitSDK.IInput module)
 {
     Module = module;
 }