コード例 #1
0
ファイル: Dag.py プロジェクト: chargen/HSynth
   def addVariable(self, VarId, Check = True):
      # search for the Operation with the Same Properties

      i = 0

      if Check:
         while i < len(self.Content):
            if (self.Content[i].OperationType == DAGElement.EnumOperationType.VAR) and \
               (self.Content[i].VarId == VarId):

               # ...
               return i

            i += 1
      else:
         i = len(self.Content)

      NewElement = DAGElement(DAGElement.EnumOperationType.VAR)
      NewElement.VarId = VarId

      self.Content.append(NewElement)

      return i