Exemple #1
0
        private string GetChannelName(EventChannelInfo eventChannelInfo, CUDDNode currentStateDD, Valuation lastValuation, Valuation currentValuation)
        {
            string channelName = eventChannelInfo.name;

            if (eventChannelInfo.type == EventChannelInfo.EventType.ASYNC_CHANNEL_INPUT)
            {
                channelName += "?";
            }
            else if (eventChannelInfo.type == EventChannelInfo.EventType.ASYNC_CHANNEL_OUTPUT)
            {
                channelName += "!";
            }

            switch (eventChannelInfo.type)
            {
            case EventChannelInfo.EventType.ASYNC_CHANNEL_INPUT:
                ChannelQueue channelBuffer1 = lastValuation.Channels[eventChannelInfo.name];
                foreach (ExpressionValue elementValue in channelBuffer1.Peek())
                {
                    int value = int.Parse(elementValue.ExpressionID);
                    channelName += value + ".";
                }
                break;

            case EventChannelInfo.EventType.ASYNC_CHANNEL_OUTPUT:
                ChannelQueue channelBuffer2 = currentValuation.Channels[eventChannelInfo.name];
                foreach (ExpressionValue elementValue in channelBuffer2.ToArray()[channelBuffer2.Size - 1])
                {
                    int value = int.Parse(elementValue.ExpressionID);
                    channelName += value + ".";
                }
                break;
            }

            channelName = channelName.TrimEnd('.');
            return(channelName);
        }