Commit e282d7c8 authored by Oscar Gustafsson's avatar Oscar Gustafsson
Browse files

Updated casing etc of GUI

parent 8a4e239e
Pipeline #31123 passed with stage
in 1 minute and 17 seconds
......@@ -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]}
......
......@@ -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]}
......
......@@ -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"))
......
......@@ -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)
......
......@@ -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)
......
......@@ -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()
......
......@@ -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()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment