Beispiel #1
0
 def getConnectionList(self):
     """Return a list of instance connections."""
     ret = []
     with self.lock:
         for conn in self.connections:
             dstInstance = conn.getDstInstance().getName()
             dstIO = str(conn.getDstIO().direction)
             dstItemList = vtype.itemListStr(conn.getDstItemList())
             dstItem = "%s%s" % (dstIO, dstItemList)
             #dstSubItem=conn.getDstSubItem()
             if conn.getSrcInstance() is None:
                 ret.append([
                     None, None, None, dstInstance, dstIO, dstItemList,
                     conn.getInitialValue().value
                 ])
             else:
                 srcInstance = conn.getSrcInstance().getName()
                 srcIO = str(conn.getSrcIO().direction)
                 srcItemList = vtype.itemListStr(conn.getSrcItemList())
                 srcItem = "%s%s" % (srcIO, srcItemList)
                 #srcSubItem=conn.getSrcSubItem()
                 ret.append([
                     srcInstance, srcItem, "", dstInstance, dstItem, "",
                     None
                 ])
     return ret
Beispiel #2
0
 def getConnectionList(self):
     """Return a list of instance connections."""
     ret=[]
     with self.lock:
         for conn in self.connections:
             dstInstance=conn.getDstInstance().getName()
             dstIO=str(conn.getDstIO().direction)
             dstItemList=vtype.itemListStr(conn.getDstItemList())
             dstItem="%s%s"%(dstIO, dstItemList)
             #dstSubItem=conn.getDstSubItem()
             if conn.getSrcInstance() is None:
                 ret.append( [ None, None, None,
                               dstInstance, dstIO, dstItemList,
                               conn.getInitialValue().value ] )
             else:
                 srcInstance=conn.getSrcInstance().getName()
                 srcIO=str(conn.getSrcIO().direction)
                 srcItemList=vtype.itemListStr(conn.getSrcItemList())
                 srcItem="%s%s"%(srcIO, srcItemList)
                 #srcSubItem=conn.getSrcSubItem()
                 ret.append( [ srcInstance, srcItem, "",
                               dstInstance, dstItem, "",
                               None ] )
     return ret
Beispiel #3
0
 def dstString(self):
     """Return the destination as a splitIO()-able string."""
     itemStr=vtype.itemListStr(self.dstItemList)
     dstDir=self.dstIO.getDir()
     # now fix the naming for 'self':
     if self.dstInstance.getName() == keywords.Self:
         if dstDir == function_io.inputs:
             dstDirStr=keywords.ExtIn
         elif dstDir == function_io.outputs:
             dstDirStr=keywords.ExtOut
         if dstDir == function_io.subnetInputs:
             dstDirStr=keywords.In #str(function_io.subnetInputs)
         elif dstDir == function_io.subnetOutputs:
             dstDirStr=keywords.Out #str(function_io.subnetOutputs)
     else:
         dstDirStr=str(dstDir)
     retstr="%s:%s%s"%(self.dstInstance.getName(), dstDirStr, itemStr)
     return retstr
Beispiel #4
0
 def srcString(self):
     """Return the source as a splitIO()-able string."""
     if self.srcInstance is None:
         return ""
     itemStr=vtype.itemListStr(self.srcItemList)
     srcDir=self.srcIO.getDir()
     # now fix the naming for 'self':
     if self.srcInstance.getName() == keywords.Self:
         if srcDir == function_io.inputs:
             srcDirStr=keywords.ExtIn
         elif srcDir == function_io.outputs:
             srcDirStr=keywords.ExtOut
         if srcDir == function_io.subnetInputs:
             srcDirStr=keywords.In #str(function_io.subnetInputs)
         elif srcDir == function_io.subnetOutputs:
             srcDirStr=keywords.Out #str(function_io.subnetOutputs)
     else:
         srcDirStr=str(srcDir)
     retstr="%s:%s%s"%(self.srcInstance.getName(), srcDirStr, itemStr)
     return retstr