示例#1
0
        public override void Propagate(IInstanceState state)
        {
            Value in1 = state.Get(1);
            Value in2 = state.Get(2);

            state.Set(0, in1.Or(in2), 1);
        }
示例#2
0
        public override void Propagate(IInstanceState state)
        {
            SwitchInstance myState = state.Instance as SwitchInstance;
            Value          curVal  = myState == null ? Value.X : myState.currentValue;

            state.Set(0, curVal, 1);
        }
示例#3
0
        protected override void HandleEventHook(InstanceEvent evnt, IInstanceState state)
        {
            SimulationModel simModel = null;

            if (evnt is SimulationInstanceEvent)
            {
                simModel = ((SimulationInstanceEvent)evnt).SimulationModel;
            }
            if (evnt.Type == InstanceEvent.Types.InstanceAdded)
            {
                Transaction       xn        = new Transaction();
                ILayoutAccess     subLayout = xn.RequestReadAccess(subLayoutModel);
                ISimulationAccess sim       = xn.RequestWriteAccess(simModel);
                using (xn.Start()) {
                    subSimulation = new LayoutSimulation(simModel, subLayoutModel);
                    subSimulation.SetActivated(true);
                    RenewPortLinks(subLayout, sim);
                }
            }
            else if (evnt.Type == InstanceEvent.Types.InstancePortsChanged)
            {
                if (simModel == null)
                {
                    simModel = subSimulation.SimulationModel;
                }
                if (subLayoutModel == null || simModel == null)
                {
                    return;
                }
                Transaction       xn        = new Transaction();
                ILayoutAccess     subLayout = xn.RequestReadAccess(subLayoutModel);
                ISimulationAccess sim       = xn.RequestWriteAccess(simModel);
                using (xn.Start()) {
                    RenewPortLinks(subLayout, sim);
                }
            }
            else if (evnt.Type == InstanceEvent.Types.InstanceRemoved)
            {
                subSimulation.SetActivated(false);
            }
        }
        public override sealed void HandleEvent(InstanceEvent evnt, IInstanceState state)
        {
            InstanceEvent.Types type = evnt.Type;
            if (type == InstanceEvent.Types.InstanceDirty)
            {
                Component.Propagate(state);
            }
            else
            {
                switch (type)
                {
                case InstanceEvent.Types.InstanceAdded:
                    Component.SetInstanceLive(this, true);
                    break;

                case InstanceEvent.Types.InstanceRemoved:
                    Component.SetInstanceLive(this, false);
                    break;
                }
                HandleEventHook(evnt, state);
            }
        }
示例#5
0
 public void Propagate(IInstanceState state)
 {
 }
示例#6
0
 public override void Propagate(IInstanceState state)
 {
 }
示例#7
0
 public override void Propagate(IInstanceState state)
 {
     module.Implementation.Propagate(state);
 }
示例#8
0
 public abstract override void Propagate(IInstanceState state);
 public ComponentPainter(IPaintbrush master, IInstanceState state)
     : base(master)
 {
     this.InstanceState = state;
 }
示例#10
0
        public override void Propagate(IInstanceState state)
        {
            Value incoming = state.Get(1);

            state.Set(0, incoming.Not, 1);
        }
示例#11
0
 public abstract void Propagate(IInstanceState state);
示例#12
0
 public abstract void HandleEvent(InstanceEvent evnt, IInstanceState state);
 protected virtual void HandleEventHook(InstanceEvent evnt, IInstanceState state)
 {
 }