예제 #1
0
 def on_ParamsUpdate_mouseClick(self,event):
     model = self.get_Model()
     if model == None: return
     #
     params = self.get_Params()
     model.set_param(**params)
     self.UpdateGuiFromModel()
예제 #2
0
 def on_ParamsUpdate_mouseClick(self, event):
     model = self.get_Model()
     if model == None: return
     #
     params = self.get_Params()
     model.set_param(**params)
     self.UpdateGuiFromModel()
예제 #3
0
파일: wxXrrBuilder.py 프로젝트: cbiwer/tdl
 def UpdateModelFromGui(self):
     """
     create a new model instance
     """
     mname = self.components.SaveName.text.strip()
     if len(mname) == 0:
         print "Model save name required"
         return
     #
     params = self.get_Params()
     theta = self.get_Theta()
     delta = float(self.components.SlabDelta.text)
     layers = self.components.LayerList.items
     layers = self.sort_LayerList(layers, reverse=False)
     #
     mlayers = []
     for layer in layers:
         comp = compound.parse_fmt_formula(str(layer[1]))
         if comp == []:
             print "Error parsing formula"
             return
         thick = float(layer[2])
         density = float(layer[3])
         rough = float(layer[4])
         m = interface_model.Layer(comp=comp, density=density, roughness=rough, thickness=thick)
         mlayers.append(copy.copy(m))
     #
     model = interface_model.Model(substrate=None, layers=mlayers, top=None, theta=theta, params=params)
     model.slabify(delta=delta)
     model.set_param(fyel=params["fyel"])
     #
     if model:
         self.set_data(mname, model)
         self.components.Model.text = mname
예제 #4
0
 def UpdateModelFromGui(self):
     """
     create a new model instance
     """
     mname = self.components.SaveName.text.strip()
     if len(mname) == 0:
         print "Model save name required"
         return
     #
     params = self.get_Params()
     theta = self.get_Theta()
     delta = float(self.components.SlabDelta.text)
     layers = self.components.LayerList.items
     layers = self.sort_LayerList(layers, reverse=False)
     #
     mlayers = []
     for layer in layers:
         comp = compound.parse_fmt_formula(str(layer[1]))
         if comp == []:
             print "Error parsing formula"
             return
         thick = float(layer[2])
         density = float(layer[3])
         rough = float(layer[4])
         m = interface_model.Layer(comp=comp,
                                   density=density,
                                   roughness=rough,
                                   thickness=thick)
         mlayers.append(copy.copy(m))
     #
     model = interface_model.Model(substrate=None,
                                   layers=mlayers,
                                   top=None,
                                   theta=theta,
                                   params=params)
     model.slabify(delta=delta)
     model.set_param(fyel=params['fyel'])
     #
     if model:
         self.set_data(mname, model)
         self.components.Model.text = mname