Ejemplo n.º 1
0
        private static void LoadEmbeddedData(XmlNode requiredNode, EventSequence es)
        {
            var fullChannels = new List <Channel>();
            var xmlNodeList  = requiredNode.SelectNodes("Channels/Channel");

            if (xmlNodeList != null)
            {
                fullChannels.AddRange(from XmlNode node in xmlNodeList select new Channel(node));
            }
            es.SetFullChannels(fullChannels);

            es.PlugInData = new SetupData();
            es.PlugInData.LoadFromXml(requiredNode);
            es.Groups = Group.LoadFromXml(requiredNode) ?? new Dictionary <string, GroupData>();
            Group.LoadFromFile(requiredNode, es.Groups);
        }
Ejemplo n.º 2
0
        public EventSequence OpenSequence(string fileName)
        {
            var seqDoc           = Xml.LoadDocument(fileName);
            var trackNode        = seqDoc.SelectSingleNode("sequence/tracks");
            var channelsInfoNode = seqDoc.SelectSingleNode("sequence/channels");

            SetTotalCentiseconds(trackNode);

            var seqChannels = GetChannels(trackNode, channelsInfoNode);

            _eventValues = new byte[seqChannels.Count, TotalCentiseconds];
            SetChannelEvents(seqChannels, channelsInfoNode);

            var es = new EventSequence();

            es.SetFullChannels(seqChannels);
            es.Time          = TotalCentiseconds * 10;
            es.EventPeriod   = 10;
            es.FileIOHandler = this;
            es.EventValues   = _eventValues;
            es.Name          = Path.GetFileNameWithoutExtension(fileName);

            return(es);
        }