コード例 #1
0
        public static SimulinkPort FromDomainPort(ISIS.GME.Dsml.CyPhyML.Interfaces.SimulinkPort port)
        {
            if (port.Attributes.SimulinkPortDirection != ISIS.GME.Dsml.CyPhyML.Classes.SimulinkPort.AttributesClass.SimulinkPortDirection_enum.@out)
            {
                return(null);
            }
            else
            {
                var result = new SimulinkPort(GetPortId(port));
                result.AddConnectedInputPorts(port, new HashSet <ISIS.GME.Dsml.CyPhyML.Interfaces.SimulinkPort>());

                return(result);
            }
        }
コード例 #2
0
        public static SimulinkBlock FromDomainModel(ISIS.GME.Dsml.CyPhyML.Interfaces.SimulinkModel domainModel)
        {
            var result = new SimulinkBlock(GetBlockName(domainModel), domainModel.Attributes.BlockType);

            foreach (var param in domainModel.Children.SimulinkParameterCollection)
            {
                var simulinkParam = SimulinkParameter.FromDomainParameter(param);
                if (simulinkParam != null)
                {
                    result.Parameters.Add(simulinkParam);
                }
            }

            foreach (var port in domainModel.Children.SimulinkPortCollection)
            {
                var simulinkPort = SimulinkPort.FromDomainPort(port);
                if (simulinkPort != null)
                {
                    result.OutgoingPorts.Add(simulinkPort);
                }
            }

            return(result);
        }