Esempio n. 1
0
        void ParseComData(string data)
        {
            if (data.StartsWith("MD"))
            {
                var intdata = data.Split(' ').Skip(1).Select(n => int.Parse(n, NumberStyles.HexNumber)).ToArray();

                foreach (var panel in Panels)
                {
                    panel.TakeData(intdata);
                }
            }

            if (data.StartsWith("JD"))
            {
                var intdata = data.Split(' ').Skip(1).Select(n => byte.Parse(n, NumberStyles.HexNumber)).ToArray();
                var jdata   = __JoyInfo.Parse(intdata);

                foreach (var panel in Panels)
                {
                    panel.TakeJoyData(jdata);
                }
            }
        }