コード例 #1
0
    def on_foto_button_clicked_handler(self, *arg):
        import os.path
        i = 1
        sw = self.swin()
        while os.path.exists("p4vasp_STM_%04d.tga" % i):
            i += 1

        x = sw.win.x
        y = sw.win.y
        w = sw.win.w
        h = sw.win.h
        w1 = w + (4 - w % 4) % 4
        if w != w1:
            sw.win.resize(x, y, w1, h)
        cp4vasp.VisCheck()
        sw.win.redraw()
        cp4vasp.VisCheck()
        cp4vasp.VisSync()
        sw.win.saveScreenshot("p4vasp_STM_%04d.tga" % i)
コード例 #2
0
 def saveanim(self):
     import cp4vasp
     seq = self.system.STRUCTURE_SEQUENCE_L
     index = self.getSWinApplet().index
     #    msg().status("Save picture of the initial structure")
     #    yield 1
     #    self.setSeqIndex(-1)
     #    self.swin().win.redraw()
     #    cp4vasp.VisCheck()
     #    self.swin().win.saveScreenshot("p4vasp_initial.tga")
     #    msg().status("Save picture of the final structure")
     #    yield 1
     #    self.setSeqIndex(")
     #    self.swin().win.redraw()
     #    cp4vasp.VisCheck()
     #    self.swin().win.saveScreenshot("p4vasp_final.tga")
     sw = self.swin()
     x = sw.win.x
     y = sw.win.y
     w = sw.win.w
     h = sw.win.h
     w1 = w + (4 - w % 4) % 4
     if w != w1:
         sw.win.resize(x, y, w1, h)
     for i in range(len(seq)):
         msg().step(i + 1, len(seq))
         msg().status("Save step %d" % i)
         yield 1
         self.setSeqIndex(i)
         sw.win.redraw()
         cp4vasp.VisCheck()
         sw.win.saveScreenshot("p4vasp_step%03d.tga" % (i + 1))
     self.setSeqIndex(index)
     sw.win.redraw()
     cp4vasp.VisCheck()
     msg().status("OK")
     msg().step(0, 1)
コード例 #3
0
ファイル: StructureApplet.py プロジェクト: shxutoki/p4vasp
 def saveanim(self):
     import cp4vasp
     seq = self.system.STRUCTURE_SEQUENCE_L
     index = self.index
     msg().status("Save picture of the initial structure")
     yield 1
     self.setSeqIndex(-1)
     cp4vasp.VisCheck()
     self.swin.win.saveScreenshot("p4vasp_initial.tga")
     msg().status("Save picture of the final structure")
     yield 1
     self.setSeqIndex(-2)
     cp4vasp.VisCheck()
     self.swin.win.saveScreenshot("p4vasp_final.tga")
     for i in range(len(seq)):
         msg().step(i + 1, len(seq))
         msg().status("Save step %d" % i)
         yield 1
         self.setSeqIndex(i)
         cp4vasp.VisCheck()
         self.swin.win.saveScreenshot("p4vasp_step%03d.tga" % (i + 1))
     self.setSeqIndex(index)
     msg().status("OK")
     msg().step(0, 1)