예제 #1
0
 public virtual string GetLoopIndexName()
 {
     if (GetParentINode().GetParentINode() != null)
     {
         if (GetParentINode().GetParentINode().GetINodeType() == "IForLoop")
         {
             IForLoop f = (IForLoop)GetParentINode().GetParentINode();
             return(f.GetILoopIndex().GetName());
         }
         else
         {
             return("");
         }
     }
     else
     {
         return("");
     }
 }
예제 #2
0
        public virtual LinkedList <INode> ZeroIndegreeNodesList(IDiagram iDiagram, bool isTopIDiagram)
        {
            LinkedList <INode> zeroindegreelist = new LinkedList <INode>();

            //Put the IConstant in current IDiagram into the zeroindegreelist
            foreach (IConstant temp in iDiagram.getIConstants())
            {
                if (temp.GetParentId() == iDiagram.GetNodeId())
                {
                    zeroindegreelist.AddLast(temp);
                }
            }

            //Put the INPUT IDataAccessor in current IDiagram into the zeroindegreelist
            foreach (IDataAccessor temp in iDiagram.getIDataAccessors())
            {
                if (temp.GetParentId() == iDiagram.GetNodeId() && temp.GetDirection() == Direction.INPUT)
                {
                    zeroindegreelist.AddLast(temp);
                }
            }

            //For the situation that the current IDiagram isn't the top IDiagram
            if (!isTopIDiagram)
            {
                INode n = INode.GetIdToINode()[iDiagram.GetParentId()];

                if (n.GetINodeType() == "ICaseStructure")
                {
                    ICaseStructure c = (ICaseStructure)n;
                    //Put the ICaseSelector into the zeroindegreelist
                    if (c.GetICaseSelector().IsConnectedIDiagram(iDiagram))
                    {
                        zeroindegreelist.AddLast(c.GetICaseSelector());
                    }
                    //Put the input ITunnel into the zeroindegreelist
                    foreach (ITunnel t in c.GetITunnels())
                    {
                        if (t.GetIsInput() && t.GetParentId() == iDiagram.GetParentId())
                        {
                            zeroindegreelist.AddLast(t);
                        }
                    }
                }

                else if (n.GetINodeType() == "IForLoop")
                {
                    IForLoop forloop = (IForLoop)n;

                    //Put the output connected ILoopIndex into the zeroindegreelist
                    if (forloop.GetILoopIndex().GetIsOutputConnected())
                    {
                        zeroindegreelist.AddLast(forloop.GetILoopIndex());
                    }
                    //Put the output connceted ILoopMax into the zeroindegreelist
                    if (forloop.GetILoopMax().GetIsOutputConnected())
                    {
                        zeroindegreelist.AddLast(forloop.GetILoopMax());
                    }
                    //Put the ILeftShiftRegister into the zeroindegreelist
                    foreach (ILeftShiftRegister ls in forloop.GetILeftShiftRegisters())
                    {
                        if (ls.GetParentId() == iDiagram.GetParentId())
                        {
                            zeroindegreelist.AddLast(ls);
                        }
                    }
                    //Put the input ITunnel into the zeroindegreelist
                    foreach (ITunnel t in forloop.GetITunnels())
                    {
                        if (t.GetIsInput() && t.GetParentId() == iDiagram.GetParentId())
                        {
                            zeroindegreelist.AddLast(t);
                        }
                    }
                }
            }

            return(zeroindegreelist);
        }
예제 #3
0
파일: ITunnel.cs 프로젝트: byuccl/DFIR-XML
        public virtual string GetILoopIndexName()
        {
            IForLoop forloop = (IForLoop)GetParentINode();

            return(forloop.GetILoopIndex().GetName());
        }