예제 #1
0
        public Boundary GetInternalBoundary(RenderContext context)
        {
            Boundary bound = new Boundary();

            CompositionInstance mainComposition = AutosarApplication.GetInstance().Compositions.GetMainComposition();

            if (mainComposition.Equals(this))
            {
                foreach (CompositionInstance composition in AutosarApplication.GetInstance().Compositions)
                {
                    if (composition != mainComposition)
                    {
                        bound += composition.GetBoundary(context);
                    }
                }
            }


            foreach (ComponentInstance component in ComponentInstances)
            {
                bound += component.GetBoundary(context);
            }
            foreach (PortPainter port in InternalPortsInstances)
            {
                bound += port.GetBoundary(context);
            }
            foreach (PortConnection connection in Connections)
            {
                bound += connection.GetBoundary(context);
            }
            return(bound);
        }
예제 #2
0
        public PortsConnectionsList GetConnections()
        {
            PortsConnectionsList list = new PortsConnectionsList();

            /* Check in component instances in main composition */
            CompositionInstance mainComposition = AutosarApplication.GetInstance().Compositions.GetMainComposition();

            if (mainComposition.Equals(this))
            {
            }
            else
            {
                foreach (PortConnection connection in mainComposition.Connections)
                {
                    foreach (PortPainter port in this.Ports)
                    {
                        if (connection.Port1.GUID.Equals(port.GUID) || connection.Port2.GUID.Equals(port.GUID))
                        {
                            list.Add(connection);
                        }
                    }
                }
            }
            return(list);
        }