Beispiel #1
0
 def store_clicked(b):
     l=line.value
     v=varName.value
     name=self.__getObjectName(self)
     store=self.__getStorageName()
     if mode.value=="Time":
         t=time.value
         print_("Storing fields at t=",t,"on line",l,"from",directoryName,"in",self.path,"to variable",v)
         cmdBase="%s.sampleTime('%s','%s','%s')" % (name,directoryName,l,t)
         if store:
             sname,sval=store
             cmd="%s=%s('%s',lambda:%s)" % (v,sname,v,cmdBase)
             val=sval(v,lambda:self.sampleTime(directoryName,l,t))
         else:
             cmd="%s=%s" % (v,cmdBase)
             val=self.sampleTime(directoryName,l,t)
     elif mode.value=="Field":
         f=field.value
         print_("Storing fields",f," at all times on line",l,"from",directoryName,"in",self.path,"to variable",v)
         cmdBase="%s.sampleField('%s','%s','%s')" % (name,directoryName,l,f)
         if store:
             sname,sval=store
             cmd="%s=%s('%s',lambda:%s)" % (v,sname,v,cmdBase)
             val=sval(v,lambda:self.sampleField(directoryName,l,f))
         else:
             cmd="%s=%s" % (v,cmdBase)
             val=self.sampleField(directoryName,l,f)
     else:
         print_("Unknown mode",mode)
         return
     create_code_cell(cmd,"below")
     get_ipython().push({v:val})
     varName.value=""
 def store_clicked(b):
     l=line.value
     v=varName.value
     name=self.__getObjectName(self)
     store=self.__getStorageName()
     if mode.value=="Time":
         t=time.value
         print_("Storing fields at t=",t,"on line",l,"from",directoryName,"in",self.path,"to variable",v)
         cmdBase="%s.sampleTime('%s','%s','%s')" % (name,directoryName,l,t)
         if store:
             sname,sval=store
             cmd="%s=%s('%s',lambda:%s)" % (v,sname,v,cmdBase)
             val=sval(v,lambda:self.sampleTime(directoryName,l,t))
         else:
             cmd="%s=%s" % (v,cmdBase)
             val=self.sampleTime(directoryName,l,t)
     elif mode.value=="Field":
         f=field.value
         print_("Storing fields",f," at all times on line",l,"from",directoryName,"in",self.path,"to variable",v)
         cmdBase="%s.sampleField('%s','%s','%s')" % (name,directoryName,l,f)
         if store:
             sname,sval=store
             cmd="%s=%s('%s',lambda:%s)" % (v,sname,v,cmdBase)
             val=sval(v,lambda:self.sampleField(directoryName,l,f))
         else:
             cmd="%s=%s" % (v,cmdBase)
             val=self.sampleField(directoryName,l,f)
     else:
         print_("Unknown mode",mode)
         return
     create_code_cell(cmd,"below")
     get_ipython().push({v:val})
     varName.value=""
Beispiel #3
0
 def store_clicked(b):
     p = pData.value
     v = varName.value
     name = self.__getObjectName(self)
     store = self.__getStorageName()
     print_("Storing Pickled Data from", p, "to variable", v)
     cmd = "%s.pickledData('%s')" % (name, p)
     if store:
         sname, sval = store
         create_code_cell("%s=%s('%s',lambda:%s)" % (v, sname, v, cmd),
                          "below")
         val = sval(v, lambda: self.pickledData(p))
     else:
         create_code_cell("%s=%s" % (v, cmd), "below")
         val = self.pickledData(p)
     get_ipython().push({v: val})
     varName.value = ""
Beispiel #4
0
 def store_clicked(b):
     v = varName.value
     f = list(fieldsSelected)
     print_("Storing", f, "from", directoryName, "in", self.path,
            "to variable", v)
     name = self.__getObjectName(self)
     store = self.__getStorageName()
     cmd = "%s.timeline('%s',%s)" % (name, directoryName, str(f))
     if store:
         sname, sval = store
         create_code_cell("%s=%s('%s',lambda:%s)" % (v, sname, v, cmd),
                          "below")
         val = sval(v, lambda: self.timeline(directoryName, f))
     else:
         create_code_cell("%s=%s" % (v, cmd), "below")
         val = self.timeline(directoryName, f)
     get_ipython().push({v: val})
     varName.value = ""
Beispiel #5
0
 def store_clicked(b):
     l = line.value
     v = varName.value
     name = self.__getObjectName(self)
     store = self.__getStorageName()
     t = time.value
     print_("Storing distribution at t=", t, "on line", l, "from",
            directoryName, "in", self.path, "to variable", v)
     cmd = "%s.distribution('%s','%s','%s')" % (name, directoryName, l,
                                                t)
     if store:
         sname, sval = store
         create_code_cell("%s=%s('%s',lambda:%s)" % (v, sname, v, cmd),
                          "below")
         val = sval(v, lambda: self.distribution(directoryName, l, t))
     else:
         create_code_cell("%s=%s" % (v, cmd), "below")
         val = self.distribution(directoryName, l, t)
     get_ipython().push({v: val})
     varName.value = ""
 def store_clicked(b):
     p=pData.value
     v=varName.value
     name=self.__getObjectName(self)
     store=self.__getStorageName()
     print_("Storing Pickled Data from",p,"to variable",v)
     cmd="%s.pickledData('%s')" % (name,p)
     if store:
         sname,sval=store
         create_code_cell(
             "%s=%s('%s',lambda:%s)" % (v,sname,v,cmd),
             "below")
         val=sval(v,lambda:self.pickledData(p))
     else:
         create_code_cell(
             "%s=%s" % (v,cmd),
             "below")
         val=self.pickledData(p)
     get_ipython().push({v:val})
     varName.value=""
 def store_clicked(b):
     v=varName.value
     f=list(fieldsSelected)
     print_("Storing",f,"from",directoryName,"in",self.path,"to variable",v)
     name=self.__getObjectName(self)
     store=self.__getStorageName()
     cmd="%s.timeline('%s',%s)" % (name,directoryName,str(f))
     if store:
         sname,sval=store
         create_code_cell(
             "%s=%s('%s',lambda:%s)" % (v,sname,v,cmd),
             "below")
         val=sval(v,lambda:self.timeline(directoryName,f))
     else:
         create_code_cell(
             "%s=%s" % (v,cmd),
             "below")
         val=self.timeline(directoryName,f)
     get_ipython().push({v:val})
     varName.value=""
 def store_clicked(b):
     l=line.value
     v=varName.value
     name=self.__getObjectName(self)
     store=self.__getStorageName()
     t=time.value
     print_("Storing distribution at t=",t,"on line",l,"from",directoryName,"in",self.path,"to variable",v)
     cmd="%s.distribution('%s','%s','%s')" % (name,directoryName,l,t)
     if store:
         sname,sval=store
         create_code_cell(
             "%s=%s('%s',lambda:%s)" % (v,sname,v,cmd),
             "below")
         val=sval(v,lambda:self.distribution(directoryName,l,t))
     else:
         create_code_cell(
             "%s=%s" % (v,cmd),
             "below")
         val=self.distribution(directoryName,l,t)
     get_ipython().push({v:val})
     varName.value=""