Esempio n. 1
0
    def _finalise(self, num_steps):
        """
        Updates the setting file with changes that occured in the vmd file.
        Will also display the img or stitch the movie. It will finally collect
        garbage.
        """
        io.settings_update(self.all_settings)
        self._copy_settings_file()
        self._store_imgs()
        if not all_settings['calibrate']:
            self._stitch_movie()
        else:
            self._display_img()

        self._garbage_collector()
Esempio n. 2
0
    def _display_img(self):
        """
        Displays the created image in the default viewer. Only works in linux!
        """
        if self.all_settings['mols_plotted'] > 0:
            if self.all_settings['load_in_vmd']:
                self.all_settings['tcl']['pic_filename'][self.PID] = \
                    self.tga_filepath
                io.vmd_variable_writer(self.all_settings, self.PID)

                vmd_bin = self.all_settings['vmd_exe']
                os.system(f"{vmd_bin} -nt -e {self.all_settings['vmd_script'][self.PID]}")
                io.settings_update(self.all_settings)

            if self.all_settings['show_img_after_vmd']:
                open_pic_cmd = "xdg-open %s" % (self.tga_filepath)
                subprocess.call(open_pic_cmd, shell=True)
        else:
            EXC.WARN("There were no wavefunctions plotted on the molecules!")