Ejemplo n.º 1
0
        public override void AddLink(ILink link)
        {
            ILinkableComponent LC = link.SourceComponent;

            for (int i = 0; i < GetAcceptedEventTypeCount(); i++)
            {
                EventType ev = GetAcceptedEventType(i);
                LC.Subscribe(this, ev);
            }
            base.AddLink(link);
        }
Ejemplo n.º 2
0
        //private DbOperations _db;

        #region ILinkableComponent Members

        /// <summary>
        /// This method is called when links are created by the component
        /// </summary>
        /// <param name="link">OpenMI link object</param>
        public void AddLink(ILink link)
        {
            //subscribe to events
            ILinkableComponent LC = link.SourceComponent;

            for (int i = 0; i < GetAcceptedEventTypeCount(); i++)
            {
                EventType ev = GetAcceptedEventType(i);
                LC.Subscribe(this, ev);
            }

            //build HD data model object to store time-series
            CreateSeries(link);

            //store the link for future reference
            _links.Add(link.ID, link);

            // create timestep list
            //_timestep.Add(link.ID, new List<DateTime>());
        }