예제 #1
0
            public override void Evaluate(int SpreadMax)
            {
                SpreadMax = FInput.SliceCount;

                if (!FInput.IsChanged)
                {
                    //				FLogger.Log(LogType.Debug, "skip set");
                    return;
                }


                if (FInput.SliceCount == 0 || FInput[0] == null)
                {
                    FOutput.SliceCount = 0;
                    return;
                }

                for (int i = 0; i < SpreadMax; i++)
                {
                    Message message = FInput[i];
                    foreach (string name in FPins.Keys)
                    {
                        var pin = (IEnumerable)ToISpread(FPins[name])[i];
                        message.AssignFrom(name, pin);
                    }
                }

                FOutput.AssignFrom(FInput);
                FOutput.Flush();
            }
예제 #2
0
        public override void Evaluate(int SpreadMax)
        {
            TypeUpdate();

            SpreadMax = 0;
            if (!FSet[0])
            {
                //				FLogger.Log(LogType.Debug, "skip join");
                FOutput.SliceCount = 0;
                FOutput.Flush();
                return;
            }

            foreach (string name in FPins.Keys)
            {
                var pin = ToISpread(FPins[name]);
                pin.Sync();
                SpreadMax = Math.Max(pin.SliceCount, SpreadMax);
            }


            FOutput.SliceCount = SpreadMax;
            for (int i = 0; i < SpreadMax; i++)
            {
                Message message = new Message();

                message.Address = FAddress[i];
                foreach (string name in FPins.Keys)
                {
                    message.AssignFrom(name, (IEnumerable)ToISpread(FPins[name])[i]);
                }
                FOutput[i] = message;

                // FLogger.Log(LogType.Debug, "== Message "+i+" == \n" + message.ToString());
                //	foreach (string name in message.GetDynamicMemberNames()) FLogger.Log(LogType.Debug, message[name].GetType()+" "+ name);
            }
            FOutput.Flush();
        }