diff --git a/b_asic/GUI/arrow.py b/b_asic/GUI/arrow.py index c598374d41d2726e8e44ca9bd1d20dc3a6e6114f..5fe2bbbe21ed416360949bd6a31cdc50bb54896f 100644 --- a/b_asic/GUI/arrow.py +++ b/b_asic/GUI/arrow.py @@ -35,7 +35,7 @@ class Arrow(QGraphicsLineItem): for port1, port2 in self._window.signalPortDict[self]: for operation, operation_ports in self._window.portDict.items(): if (port1 in operation_ports or port2 in operation_ports) and operation in self._window.opToSFG: - self._window.logger.info(f"Operation detected in existing sfg, removing sfg with name: {self._window.opToSFG[operation].name}.") + self._window.logger.info(f"Operation detected in existing SFG, removing SFG with name: {self._window.opToSFG[operation].name}.") del self._window.sfg_dict[self._window.opToSFG[operation].name] self._window.opToSFG = {op: self._window.opToSFG[op] for op in self._window.opToSFG if self._window.opToSFG[op] is not self._window.opToSFG[operation]} diff --git a/b_asic/GUI/drag_button.py b/b_asic/GUI/drag_button.py index 52d8416b7fbcefcabc60c57373135cd95df52dc8..b0c479098561483ba322a404cb395e0fea1909e6 100644 --- a/b_asic/GUI/drag_button.py +++ b/b_asic/GUI/drag_button.py @@ -140,7 +140,7 @@ class DragButton(QPushButton): if self in self._window.opToSFG: self._window.logger.info( - f"Operation detected in existing sfg, removing sfg with name: {self._window.opToSFG[self].name}.") + f"Operation detected in existing SFG, removing SFG with name: {self._window.opToSFG[self].name}.") del self._window.sfg_dict[self._window.opToSFG[self].name] self._window.opToSFG = { op: self._window.opToSFG[op] for op in self._window.opToSFG if self._window.opToSFG[op] is not self._window.opToSFG[self]} diff --git a/b_asic/GUI/gui_interface.py b/b_asic/GUI/gui_interface.py index 4fbb5c4ad14622a8a86cd37cfa114c72079d0660..d29559d78a5ca8709074ef496c0178b68b71e30e 100644 --- a/b_asic/GUI/gui_interface.py +++ b/b_asic/GUI/gui_interface.py @@ -302,7 +302,7 @@ class Ui_main_window(object): self.edit_menu.setTitle(_translate("main_window", "Edit")) self.view_menu.setTitle(_translate("main_window", "View")) self.run_menu.setTitle(_translate("main_window", "Run")) - self.actionShowPC.setText(_translate("main_window", "Show PC")) + self.actionShowPC.setText(_translate("main_window", "Show PG")) self.help_menu.setTitle(_translate("main_window", "Help")) self.actionSimulateSFG.setText(_translate("main_window", "Simulate SFG")) self.aboutBASIC.setText(_translate("main_window", "About B-ASIC")) @@ -310,7 +310,7 @@ class Ui_main_window(object): self.keybindsBASIC.setText(_translate("main_window", "Keybinds")) self.load_menu.setText(_translate("main_window", "Load SFG")) self.save_menu.setText(_translate("main_window", "Save SFG")) - self.load_operations.setText(_translate("main_window", "Load Operations")) + self.load_operations.setText(_translate("main_window", "Load operations")) self.exit_menu.setText(_translate("main_window", "Exit")) self.exit_menu.setShortcut(_translate("main_window", "Ctrl+Q")) self.actionToolbar.setText(_translate("main_window", "Toolbar")) diff --git a/b_asic/GUI/main_window.py b/b_asic/GUI/main_window.py index d53ead66c19df1513fb86e7039614ea5b578508a..24e16b23e9359378e2b27301ffc7748252ef06d3 100644 --- a/b_asic/GUI/main_window.py +++ b/b_asic/GUI/main_window.py @@ -133,7 +133,7 @@ class MainWindow(QMainWindow): def create_toolbar_view(self): self.toolbar = self.addToolBar("Toolbar") self.toolbar.addAction("Create SFG", self.create_SFG_from_toolbar) - self.toolbar.addAction("Clear Workspace", self.clear_workspace) + self.toolbar.addAction("Clear workspace", self.clear_workspace) def resizeEvent(self, event): self.ui.operation_box.setGeometry( @@ -167,7 +167,7 @@ class MainWindow(QMainWindow): if not accepted: return - self.logger.info(f"Saving sfg to path: {module}.") + self.logger.info(f"Saving SFG to path: {module}.") operation_positions = dict() for operation_drag, operation_scene in self.dragOperationSceneDict.items(): operation_positions[operation_drag.operation.graph_id] = ( @@ -179,10 +179,10 @@ class MainWindow(QMainWindow): sfg, suffix=f"positions = {str(operation_positions)}")) except Exception as e: self.logger.error( - f"Failed to save sfg to path: {module}, with error: {e}.") + f"Failed to save SFG to path: {module}, with error: {e}.") return - self.logger.info(f"Saved sfg to path: {module}.") + self.logger.info(f"Saved SFG to path: {module}.") def save_work(self): self.sfg_widget = SelectSFGWindow(self) @@ -196,7 +196,7 @@ class MainWindow(QMainWindow): if not accepted: return - self.logger.info(f"Loading sfg from path: {module}.") + self.logger.info(f"Loading SFG from path: {module}.") try: sfg, positions = python_to_sfg(module) except ImportError as e: @@ -206,7 +206,7 @@ class MainWindow(QMainWindow): while sfg.name in self.sfg_dict: self.logger.warning( - f"Duplicate sfg with name: {sfg.name} detected. Please choose a new name.") + f"Duplicate SFG with name: {sfg.name} detected. Please choose a new name.") name, accepted = QInputDialog.getText( self, "Change SFG Name", "Name: ", QLineEdit.Normal) if not accepted: @@ -240,7 +240,7 @@ class MainWindow(QMainWindow): self.opToSFG[self.operationDragDict[op]] = sfg self.sfg_dict[sfg.name] = sfg - self.logger.info(f"Loaded sfg from path: {module}.") + self.logger.info(f"Loaded SFG from path: {module}.") self.update() def exit_app(self): @@ -248,7 +248,7 @@ class MainWindow(QMainWindow): QApplication.quit() def clear_workspace(self): - self.logger.info("Clearing workspace from operations and sfgs.") + self.logger.info("Clearing workspace from operations and SFGs.") self.pressed_operations.clear() self.pressed_ports.clear() self.operationItemSceneList.clear() @@ -433,7 +433,7 @@ class MainWindow(QMainWindow): __file__), "operation_icons", f"custom_operation.png") attr_button.setIcon(QIcon(icon_path)) attr_button.setIconSize(QSize(55, 55)) - attr_button.setToolTip("No sfg") + attr_button.setToolTip("No SFG") attr_button.setStyleSheet(""" QToolTip { background-color: white; color: black }""") attr_button.setParent(None) @@ -489,7 +489,7 @@ class MainWindow(QMainWindow): def _connect_button(self, *event): if len(self.pressed_ports) < 2: self.logger.warning( - "Can't connect less than two ports. Please select more.") + "Cannot connect less than two ports. Please select at least two.") return for i in range(len(self.pressed_ports) - 1): @@ -498,12 +498,12 @@ class MainWindow(QMainWindow): destination = self.pressed_ports[i + 1] if source is not self.pressed_ports[i + 1] else self.pressed_ports[i] if source.port.operation is destination.port.operation: - self.logger.warning("Can't connect to the same port") + self.logger.warning("Cannot connect to the same port") continue if type(source.port) == type(destination.port): self.logger.warning( - f"Can't connect port of type: {type(source.port).__name__} to port of type: {type(destination.port).__name__}.") + f"Cannot connect port of type: {type(source.port).__name__} to port of type: {type(destination.port).__name__}.") continue self.connect_button(source, destination) @@ -547,7 +547,7 @@ class MainWindow(QMainWindow): def _simulate_sfg(self): for sfg, properties in self.dialog.properties.items(): - self.logger.info(f"Simulating sfg with name: {sfg.name}.") + self.logger.info(f"Simulating SFG with name: {sfg.name}.") simulation = FastSimulation( sfg, input_providers=properties["input_values"]) l_result = simulation.run_for( @@ -560,7 +560,7 @@ class MainWindow(QMainWindow): if properties["show_plot"]: self.logger.info( - f"Opening plot for sfg with name: {sfg.name}.") + f"Opening plot for SFG with name: {sfg.name}.") self.logger.info( "To save the plot press 'Ctrl+S' when the plot is focused.") self.plot = Plot(simulation, sfg, self) diff --git a/b_asic/GUI/properties_window.py b/b_asic/GUI/properties_window.py index 7ad87c0b1de31175bc2a3649ee5a6d50e5cb3efc..1ec93f1c5d5c8a9bbbc1d9142722617876b096d7 100644 --- a/b_asic/GUI/properties_window.py +++ b/b_asic/GUI/properties_window.py @@ -51,7 +51,7 @@ class PropertiesWindow(QDialog): if self.operation.operation.input_count > 0: self.latency_layout = QHBoxLayout() - self.latency_label = QLabel("Set Latency For Input Ports (-1 for None):") + self.latency_label = QLabel("Set latency for input ports (-1 for None):") self.latency_layout.addWidget(self.latency_label) self.vertical_layout.addLayout(self.latency_layout) @@ -86,7 +86,7 @@ class PropertiesWindow(QDialog): if self.operation.operation.output_count > 0: self.latency_layout = QHBoxLayout() - self.latency_label = QLabel("Set Latency For Output Ports (-1 for None):") + self.latency_label = QLabel("Set latency for output ports (-1 for None):") self.latency_layout.addWidget(self.latency_label) self.vertical_layout.addLayout(self.latency_layout) diff --git a/b_asic/GUI/show_pc_window.py b/b_asic/GUI/show_pc_window.py index 3b74f36215f75e9f5d4409cc05773c163a12a1ea..6ad31cac14cbd426f5d379f25ecd997914d3ff74 100644 --- a/b_asic/GUI/show_pc_window.py +++ b/b_asic/GUI/show_pc_window.py @@ -13,10 +13,10 @@ class ShowPCWindow(QDialog): self._window = window self.check_box_dict = dict() self.setWindowFlags(Qt.WindowTitleHint | Qt.WindowCloseButtonHint) - self.setWindowTitle("Show PC") + self.setWindowTitle("Show precedence graph") self.dialog_layout = QVBoxLayout() - self.pc_btn = QPushButton("Show PC") + self.pc_btn = QPushButton("Show PG") self.pc_btn.clicked.connect(self.show_precedence_graph) self.dialog_layout.addWidget(self.pc_btn) self.setLayout(self.dialog_layout) @@ -42,7 +42,7 @@ class ShowPCWindow(QDialog): def show_precedence_graph(self): for check_box, sfg in self.check_box_dict.items(): if check_box.isChecked(): - self._window.logger.info(f"Creating a precedence chart from sfg with name: {sfg}.") + self._window.logger.info(f"Creating a precedence graph from SFG with name: {sfg}.") self._window.sfg_dict[sfg].show_precedence_graph() self.accept() diff --git a/b_asic/GUI/simulate_sfg_window.py b/b_asic/GUI/simulate_sfg_window.py index e609048133712432b8748f4eb7a59bec7bf597ea..8fd5226765ff0875659b8184cde55a704c969d1d 100644 --- a/b_asic/GUI/simulate_sfg_window.py +++ b/b_asic/GUI/simulate_sfg_window.py @@ -35,13 +35,13 @@ class SimulateSFGWindow(QDialog): spin_box = QSpinBox() spin_box.setRange(0, 2147483647) - options_layout.addRow("Iteration Count: ", spin_box) + options_layout.addRow("Iteration count: ", spin_box) check_box_plot = QCheckBox() - options_layout.addRow("Plot Results: ", check_box_plot) + options_layout.addRow("Plot results: ", check_box_plot) check_box_all = QCheckBox() - options_layout.addRow("Get All Results: ", check_box_all) + options_layout.addRow("Get all results: ", check_box_all) sfg_layout.addLayout(options_layout) @@ -54,7 +54,7 @@ class SimulateSFGWindow(QDialog): if sfg.input_count > 0: input_label = QHBoxLayout() - input_label = QLabel("Input Values:") + input_label = QLabel("Input values:") options_layout.addRow(input_label) input_grid = QGridLayout() @@ -123,13 +123,13 @@ class SimulateSFGWindow(QDialog): "input_values": input_values } - # If we plot we should also print the entire data, since you can't really interact with the graph. + # If we plot we should also print the entire data, since you cannot really interact with the graph. if self.properties[sfg]["show_plot"]: self.properties[sfg]["all_results"] = True continue - self._window.logger.info(f"Skipping simulation of sfg with name: {sfg.name}, due to previous errors.") + self._window.logger.info(f"Skipping simulation of SFG with name: {sfg.name}, due to previous errors.") self.accept() self.simulate.emit()