def close_signal_frame(self, signal_frame: SignalFrame): try: self.project_manager.write_signal_information_to_project_file(signal_frame.signal) try: proto = self.signal_protocol_dict[signal_frame] except KeyError: proto = None if proto is not None: self.close_protocol(proto) del self.signal_protocol_dict[signal_frame] if self.signal_tab_controller.ui.scrlAreaSignals.minimumHeight() > signal_frame.height(): self.signal_tab_controller.ui.scrlAreaSignals.setMinimumHeight( self.signal_tab_controller.ui.scrlAreaSignals.minimumHeight() - signal_frame.height()) if signal_frame.signal is not None: # Non-Empty Frame (when a signal and not a protocol is opened) self.file_proxy_model.open_files.discard(signal_frame.signal.filename) signal_frame.eliminate() self.compare_frame_controller.ui.treeViewProtocols.expandAll() self.set_frame_numbers() self.refresh_main_menu() except Exception as e: Errors.generic_error(self.tr("Failed to close"), str(e), traceback.format_exc()) self.unsetCursor()
def close_signal_frame(self, signal_frame: SignalFrame): try: self.project_manager.write_signal_information_to_project_file( signal_frame.signal) try: proto = self.signal_protocol_dict[signal_frame] except KeyError: proto = None if proto is not None: self.close_protocol(proto) del self.signal_protocol_dict[signal_frame] if self.signal_tab_controller.ui.scrlAreaSignals.minimumHeight( ) > signal_frame.height(): self.signal_tab_controller.ui.scrlAreaSignals.setMinimumHeight( self.signal_tab_controller.ui.scrlAreaSignals. minimumHeight() - signal_frame.height()) if signal_frame.signal is not None: # Non-Empty Frame (when a signal and not a protocol is opened) self.file_proxy_model.open_files.discard( signal_frame.signal.filename) signal_frame.eliminate() self.compare_frame_controller.ui.treeViewProtocols.expandAll() self.set_frame_numbers() self.refresh_main_menu() except Exception as e: Errors.generic_error(self.tr("Failed to close"), str(e), traceback.format_exc()) self.unsetCursor()
def add_empty_frame(self, filename: str, proto): self.__set_getting_started_status(False) sig_frame = SignalFrame(proto_analyzer=proto, undo_stack=self.undo_stack, project_manager=self.project_manager, proto_bits=proto.decoded_proto_bits_str, parent=self) sig_frame.ui.lineEditSignalName.setText(filename) sig_frame.setMinimumHeight(sig_frame.height()) sig_frame.set_empty_frame_visibilities() self.__create_connects_for_signal_frame(signal_frame=sig_frame) self.ui.splitter.insertWidget(self.num_frames, sig_frame) return sig_frame