def readmmp_info_opengroup_setitem(self, key, val, interp):
     """
     [extends superclass method]
     """
     #bruce 080507 refactoring (split this out of the superclass method)
     if key == ['nanotube-parameters']:
         # val includes all the parameters, separated by commas.
         n, m, type, endings = val.split(",")
         self.n = int(n)
         self.m = int(m)
         self.type = type.lstrip()
         self.endings = endings.lstrip()
         # Create the nanotube.
         from cnt.model.Nanotube import Nanotube
         self.nanotube = Nanotube()  # Returns a 5x5 CNT.
         self.nanotube.setChirality(self.n, self.m)
         self.nanotube.setType(self.type)
         self.nanotube.setEndings(self.endings)
         # The endpoints are recomputed every time it is edited.
     else:
         Group.readmmp_info_opengroup_setitem(self, key, val, interp)
     return
Exemplo n.º 2
0
 def readmmp_info_opengroup_setitem( self, key, val, interp ):
     """
     [extends superclass method]
     """
     #bruce 080507 refactoring (split this out of the superclass method)
     if key == ['nanotube-parameters']:
         # val includes all the parameters, separated by commas.
         n, m, type, endings = val.split(",")
         self.n = int(n)
         self.m = int(m)
         self.type = type.lstrip()
         self.endings = endings.lstrip()
         # Create the nanotube.
         from cnt.model.Nanotube import Nanotube
         self.nanotube = Nanotube() # Returns a 5x5 CNT.
         self.nanotube.setChirality(self.n, self.m)
         self.nanotube.setType(self.type)
         self.nanotube.setEndings(self.endings)
         # The endpoints are recomputed every time it is edited.
     else:
         Group.readmmp_info_opengroup_setitem( self, key, val, interp)
     return