Skip to content

Commit

Permalink
Add step progress bar at synthesis page.
Browse files Browse the repository at this point in the history
  • Loading branch information
KmolYuan committed Jun 30, 2019
1 parent 537770d commit a82afe1
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 51 deletions.
10 changes: 5 additions & 5 deletions core/synthesis/collections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,26 @@ def __init__(self, parent: MainWindowBase):
"""Create two widget page and using main window to make their parent."""
super(Collections, self).__init__(parent)
layout = QVBoxLayout(self)
tab_widget = QTabWidget(self)
layout.addWidget(tab_widget)
self.tab_widget = QTabWidget(self)
layout.addWidget(self.tab_widget)
self.setWindowIcon(QIcon(QPixmap(":/icons/collections.png")))
self.structure_widget = StructureWidget(parent)
self.configure_widget = ConfigureWidget(
self.structure_widget.add_collection,
parent
)
tab_widget.addTab(
self.tab_widget.addTab(
self.structure_widget,
self.structure_widget.windowIcon(),
"Structures"
)
tab_widget.addTab(
self.tab_widget.addTab(
self.configure_widget,
self.configure_widget.windowIcon(),
"Configuration"
)
self.structure_widget.configure_button.clicked.connect(
lambda: tab_widget.setCurrentIndex(1)
lambda: self.tab_widget.setCurrentIndex(1)
)
self.structure_widget.layout_sender.connect(
self.configure_widget.set_graph
Expand Down
28 changes: 19 additions & 9 deletions core/widgets/Ui_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,25 @@ def setupUi(self, MainWindow):
self.main_panel.addTab(self.inputs_tab, icon12, "")
self.synthesis_tab = QtWidgets.QWidget()
self.synthesis_tab.setObjectName("synthesis_tab")
self.verticalLayout_14 = QtWidgets.QVBoxLayout(self.synthesis_tab)
self.verticalLayout_14.setContentsMargins(3, 3, 3, 3)
self.verticalLayout_14.setObjectName("verticalLayout_14")
self.synthesis_splitter = QtWidgets.QSplitter(self.synthesis_tab)
self.synthesis_splitter.setOrientation(QtCore.Qt.Vertical)
self.synthesis_splitter.setObjectName("synthesis_splitter")
self.synthesis_tab_widget = QtWidgets.QTabWidget(self.synthesis_splitter)
self.verticalLayout_10 = QtWidgets.QVBoxLayout(self.synthesis_tab)
self.verticalLayout_10.setObjectName("verticalLayout_10")
self.synthesis_tab_widget = QtWidgets.QTabWidget(self.synthesis_tab)
self.synthesis_tab_widget.setObjectName("synthesis_tab_widget")
self.verticalLayout_14.addWidget(self.synthesis_splitter)
self.verticalLayout_10.addWidget(self.synthesis_tab_widget)
self.synthesis_progress = QtWidgets.QProgressBar(self.synthesis_tab)
self.synthesis_progress.setStyleSheet("QProgressBar {\n"
" border: 2px solid grey;\n"
" border-radius: 5px;\n"
"}\n"
"\n"
"QProgressBar::chunk {\n"
" background-color: #05B8CC;\n"
" width: 20px;\n"
"}")
self.synthesis_progress.setMaximum(3)
self.synthesis_progress.setTextVisible(False)
self.synthesis_progress.setObjectName("synthesis_progress")
self.verticalLayout_10.addWidget(self.synthesis_progress)
icon13 = QtGui.QIcon()
icon13.addPixmap(QtGui.QPixmap(":/icons/synthesis.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.main_panel.addTab(self.synthesis_tab, icon13, "")
Expand Down Expand Up @@ -261,7 +271,7 @@ def setupUi(self, MainWindow):
self.settings_scrollarea.setWidgetResizable(True)
self.settings_scrollarea.setObjectName("settings_scrollarea")
self.scrollAreaWidgetContents = QtWidgets.QWidget()
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 401, 733))
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 358, 692))
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents)
self.verticalLayout_3.setObjectName("verticalLayout_3")
Expand Down
50 changes: 27 additions & 23 deletions core/widgets/main.ui
Original file line number Diff line number Diff line change
Expand Up @@ -440,29 +440,33 @@
<attribute name="title">
<string>Synthesis</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_14">
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<widget class="QSplitter" name="synthesis_splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="QTabWidget" name="synthesis_tab_widget">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="synthesis_progress">
<property name="styleSheet">
<string notr="true">QProgressBar {
border: 2px solid grey;
border-radius: 5px;
}

QProgressBar::chunk {
background-color: #05B8CC;
width: 20px;
}</string>
</property>
<property name="maximum">
<number>3</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<widget class="QTabWidget" name="synthesis_tab_widget">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -543,8 +547,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>401</width>
<height>733</height>
<width>358</width>
<height>692</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
Expand Down
41 changes: 27 additions & 14 deletions core/widgets/main_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ def __appearance(self):
# Version label
self.version_label.setText(__version__)

# Entities tables.
self.entities_tab.tabBar().setStatusTip("Switch the tabs to change to another view mode.")
# Entities tables
self.entities_tab.tabBar().setStatusTip(
"Switch the tabs to change to another view mode."
)

self.entities_point = PointTableWidget(self.entities_point_widget)
self.entities_point.cellDoubleClicked.connect(self.edit_point)
Expand Down Expand Up @@ -234,7 +236,7 @@ def table_clear_selection():
self.canvas_splitter.insertWidget(0, self.main_canvas)
self.canvas_splitter.setSizes([600, 10, 30])

# Selection label on status bar right side.
# Selection label on status bar right side
selection_label = SelectionLabel(self)
self.entities_point.selectionLabelUpdate.connect(
selection_label.update_select_point
Expand All @@ -244,12 +246,12 @@ def table_clear_selection():
)
self.status_bar.addPermanentWidget(selection_label)

# FPS label on status bar right side.
# FPS label on status bar right side
fps_label = FPSLabel(self)
self.main_canvas.fps_updated.connect(fps_label.update_text)
self.status_bar.addPermanentWidget(fps_label)

# Inputs widget.
# Inputs widget
self.inputs_widget = InputsWidget(self)
self.inputs_tab_layout.addWidget(self.inputs_widget)
self.free_move_button.toggled.connect(self.inputs_widget.variable_value_reset)
Expand All @@ -266,7 +268,7 @@ def inputs_set_selection(selections: Sequence[int], _: bool):
self.main_canvas.noselected.connect(self.inputs_widget.clear_selection)
self.inputs_widget.update_preview_button.clicked.connect(self.main_canvas.update_preview_path)

# Number and type synthesis.
# Number and type synthesis
self.structure_synthesis = StructureSynthesis(self)
self.synthesis_tab_widget.addTab(
self.structure_synthesis,
Expand Down Expand Up @@ -294,35 +296,46 @@ def inputs_set_selection(selections: Sequence[int], _: bool):
"Dimensional"
)

# File widget settings.
@Slot()
def set_design_progress():
"""Synthesis progress bar."""
pos = self.synthesis_tab_widget.currentIndex()
if pos == 1:
pos += self.collection_tab_page.tab_widget.currentIndex()
elif pos == 2:
pos += 1
self.synthesis_progress.setValue(pos)

self.synthesis_tab_widget.currentChanged.connect(set_design_progress)
self.collection_tab_page.tab_widget.currentChanged.connect(set_design_progress)

# File widget settings
self.database_widget = DatabaseWidget(self)
self.vc_layout.addWidget(self.database_widget)
self.database_widget.commit_add.clicked.connect(self.commit)
self.database_widget.branch_add.clicked.connect(self.commit_branch)
self.action_stash.triggered.connect(self.database_widget.stash)

# YAML editor.
# YAML editor
self.yaml_editor = YamlEditor(self)

# Console dock will hide when startup.
# Console dock will hide when startup
self.console_widget.hide()

# Connect to GUI button switching.
# Connect to GUI button
self.console_disconnect_button.setEnabled(not ARGUMENTS.debug_mode)
self.console_connect_button.setEnabled(ARGUMENTS.debug_mode)

# Splitter stretch factor.
# Splitter stretch factor
self.main_splitter.setStretchFactor(0, 4)
self.main_splitter.setStretchFactor(1, 15)
self.mechanism_panel_splitter.setSizes([500, 200])
self.synthesis_splitter.setSizes([100, 500])

# Enable mechanism menu actions when shows.
self.menu_mechanism.aboutToShow.connect(self.enable_mechanism_actions)

# Start a new window.
@Slot()
def new_main_window():
"""Start a new window."""
run = self.__class__()
run.show()

Expand Down
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
**Features**:

+ Change the list widget of graph atlas into tree widget.
+ Add step progress bar at synthesis page.
+ UI improvement of synthesis pages.
+ Add slides links in documentation.

Expand Down

0 comments on commit a82afe1

Please sign in to comment.