def node_clicked(self, it_index): print "it_index =", it_index if(self.tree_clickable == True): #TODO Think of a more robust way to "disconnect" ... next line try: self.centre_widget.update_command_lst.disconnect( self.update_low_level_command_lst) except: print "<< update_low_level_command_lst >> already disconnected" print "TreeNavWidget(node_clicked)" item = self.tree_out.std_mod.itemFromIndex(it_index) prn_lst_lst_cmd(item.idials_node) lin_num = item.idials_node.lin_num print "clicked item lin_num (self.tree_out.std_mod) =", lin_num cmd_ovr = "goto " + str(lin_num) self.cmd_exe(cmd_ovr) self.centre_widget.set_widget(nxt_cmd = item.idials_node.command_lst[0], curr_step = self.idials_runner.current_node) self.check_reindex_pop() update_info(self) self.check_gray_outs() self.reconnect_when_ready() self.centre_widget.update_command_lst.connect( self.update_low_level_command_lst)
def update_after_finished(self): self.chouse_if_predict_or_report() update_info(self) self.txt_bar.end_motion() self.just_reindexed = False tmp_curr = self.idials_runner.current_node prn_lst_lst_cmd(tmp_curr) if ( tmp_curr.ll_command_lst[0][0] == "refine_bravais_settings" and tmp_curr.success is True ): self.idials_runner.run(command=["mkchi"], ref_to_class=None) self.idials_runner.current_node.ll_command_lst = [["reindex"]] elif tmp_curr.ll_command_lst[0][0] == "reindex" and tmp_curr.success is True: self.just_reindexed = True try: self.my_pop.close() except BaseException as e: # We don't want to catch bare exceptions but don't know # what this was supposed to catch. Log it. logger.debug( "Caught unknown exception type %s: %s", type(e).__name__, e ) logger.debug("no need to close reindex table") elif tmp_curr.ll_command_lst[0][0] == "export" and tmp_curr.success is True: self.gui2_log = try_move_last_info(tmp_curr, self.gui2_log) self.check_reindex_pop() self.check_gray_outs() self.reconnect_when_ready() if ( tmp_curr.ll_command_lst[0][0] == "generate_mask" and tmp_curr.success is True ): self.img_view.my_painter.reset_mask_tool(None) elif ( tmp_curr.ll_command_lst[0][0] == "modify_geometry" and tmp_curr.success is True ): self.img_view.my_painter.reset_bc_tool(None) with open(self.storage_path + "/dui_files/bkp.pickle", "wb") as bkp_out: pickle.dump(self.idials_runner, bkp_out)
def refresh_my_gui(self): lin_num = self.idials_runner.current_node.lin_num logger.debug("doing goto: %s", lin_num) cmd_ovr = "goto " + str(lin_num) self.cmd_exe(cmd_ovr) self.centre_par_widget.set_widget( nxt_cmd=self.idials_runner.current_node.ll_command_lst[0][0], curr_step=self.idials_runner.current_node, ) self.check_reindex_pop() self.chouse_if_predict_or_report() update_info(self) self.check_gray_outs() self.reconnect_when_ready() logger.info("\n ... recovering from previous run of GUI \n")
def node_clicked(self, it_index): logger.debug("\n it_index = %s", it_index) logger.debug(" type(it_index) = %s", type(it_index)) if self.tree_clickable: # TODO Think of a more robust way to "disconnect" ... next line try: self.centre_par_widget.update_command_lst_high_level.disconnect( self.update_low_level_command_lst ) except BaseException as e: # We don't want to catch bare exceptions but don't know # what this was supposed to catch. Log it. logger.info(" Caught unknown exception type %s: %s", type(e).__name__, e) logger.info("\n Tst A1 \n") item = self.tree_out.std_mod.itemFromIndex(it_index) prn_lst_lst_cmd(item.idials_node) lin_num = item.idials_node.lin_num cmd_ovr = "goto " + str(lin_num) self.cmd_exe(cmd_ovr) self.centre_par_widget.set_widget( nxt_cmd=item.idials_node.ll_command_lst[0][0], curr_step=self.idials_runner.current_node, ) self.check_reindex_pop() self.chouse_if_predict_or_report() update_info(self) self.check_gray_outs() self.reconnect_when_ready() self.centre_par_widget.update_command_lst_high_level.connect( self.update_low_level_command_lst )
def cmd_exe(self, new_cmd): # Running NOT in parallel update_info(self) self.idials_runner.run(command=new_cmd, ref_to_class=None) self.check_reindex_pop() self.reconnect_when_ready()
def tab_changed(self, num=0): self.view_tab_num = num self.chouse_if_predict_or_report() update_info(self)
def update_after_finished(self): update_info(self) self.txt_bar.end_motion() self.just_reindexed = False if(self.idials_runner.make_next == True): tmp_curr = self.idials_runner.current_node.prev_step nxt_cmd = get_next_step(tmp_curr) print "get_next_step(tmp_curr) =", nxt_cmd if(nxt_cmd != "reindex" and tmp_curr.success == True): self.centre_widget.set_widget(nxt_cmd = nxt_cmd) self.idials_runner.current_node.command_lst[0] = nxt_cmd else: tmp_curr = self.idials_runner.current_node if(tmp_curr.command_lst[0] == "refine_bravais_settings" and tmp_curr.success == True): if(self.idials_runner.make_next == False): self.idials_runner.run(command = ["mkchi"], ref_to_class = None) self.idials_runner.current_node.command_lst[0] = "reindex" elif(tmp_curr.command_lst[0] == "reindex" and tmp_curr.success == True): self.just_reindexed = True try: self.my_pop.close() except: print "no need to close reindex table" elif(tmp_curr.command_lst[0] == "integrate" and tmp_curr.success == True): if(self.idials_runner.make_next == False): self.idials_runner.run(command = ["mkchi"], ref_to_class = None) mtz_name = str(self.centre_widget.widg_lst[5].my_widget. sipler_widget.mtz_name_lin.text()) print "MTZ name =", mtz_name mtz_export_par = "mtz.hklout=" + mtz_name self.cmd_launch(["export", mtz_export_par]) if(tmp_curr.command_lst[0] != "refine_bravais_settings" and tmp_curr.command_lst[0] != "integrate" and self.run_all == True): self.run_clicked() self.check_reindex_pop() self.check_gray_outs() self.reconnect_when_ready() with open(self.storage_path + "/dui_files/bkp.pickle", "wb") as bkp_out: pickle.dump(self.idials_runner, bkp_out)
def tab_changed(self, num): self.view_tab_num = num update_info(self)