新增更新状态按钮及其快捷键,优化用户操作体验
This commit is contained in:
@ -36,7 +36,8 @@ ButtonState = {
|
|||||||
"pushButton_save": False,
|
"pushButton_save": False,
|
||||||
"pushButton_prev_move": False,
|
"pushButton_prev_move": False,
|
||||||
"pushButton_pause": False,
|
"pushButton_pause": False,
|
||||||
"pushButton_next_move": False
|
"pushButton_next_move": False,
|
||||||
|
"pushButton_update_state": False
|
||||||
},
|
},
|
||||||
"Current": {
|
"Current": {
|
||||||
"pushButton_input_setting": True,
|
"pushButton_input_setting": True,
|
||||||
@ -44,7 +45,8 @@ ButtonState = {
|
|||||||
"pushButton_save": False,
|
"pushButton_save": False,
|
||||||
"pushButton_prev_move": False,
|
"pushButton_prev_move": False,
|
||||||
"pushButton_pause": False,
|
"pushButton_pause": False,
|
||||||
"pushButton_next_move": False
|
"pushButton_next_move": False,
|
||||||
|
"pushButton_update_state": False
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,6 +259,9 @@ class MainWindow_label_check(QMainWindow):
|
|||||||
self.point_peak_corrected = None
|
self.point_peak_corrected = None
|
||||||
self.annotation_tableWidget = None
|
self.annotation_tableWidget = None
|
||||||
|
|
||||||
|
self.move_state = None
|
||||||
|
self.last_move_state = None
|
||||||
|
|
||||||
self.ui.textBrowser_info.setStyleSheet("QTextBrowser { background-color: rgb(255, 255, 200); }")
|
self.ui.textBrowser_info.setStyleSheet("QTextBrowser { background-color: rgb(255, 255, 200); }")
|
||||||
PublicFunc.__styleAllButton__(self, ButtonState)
|
PublicFunc.__styleAllButton__(self, ButtonState)
|
||||||
|
|
||||||
@ -332,6 +337,7 @@ class MainWindow_label_check(QMainWindow):
|
|||||||
self.ui.pushButton_prev_move.clicked.connect(self.__slot_btn_move__)
|
self.ui.pushButton_prev_move.clicked.connect(self.__slot_btn_move__)
|
||||||
self.ui.pushButton_pause.clicked.connect(self.__slot_btn_move__)
|
self.ui.pushButton_pause.clicked.connect(self.__slot_btn_move__)
|
||||||
self.ui.pushButton_next_move.clicked.connect(self.__slot_btn_move__)
|
self.ui.pushButton_next_move.clicked.connect(self.__slot_btn_move__)
|
||||||
|
self.ui.pushButton_update_state.clicked.connect(self.__update_state__)
|
||||||
self.ui.radioButton_move_preset_1.toggled.connect(self.__change_autoplay_args__)
|
self.ui.radioButton_move_preset_1.toggled.connect(self.__change_autoplay_args__)
|
||||||
self.ui.radioButton_move_preset_2.toggled.connect(self.__change_autoplay_args__)
|
self.ui.radioButton_move_preset_2.toggled.connect(self.__change_autoplay_args__)
|
||||||
self.ui.radioButton_move_preset_3.toggled.connect(self.__change_autoplay_args__)
|
self.ui.radioButton_move_preset_3.toggled.connect(self.__change_autoplay_args__)
|
||||||
@ -354,6 +360,12 @@ class MainWindow_label_check(QMainWindow):
|
|||||||
self.ui.pushButton_pause.setShortcut(
|
self.ui.pushButton_pause.setShortcut(
|
||||||
QCoreApplication.translate("MainWindow", Params.LABEL_CHECK_BTN_PAUSE_SHORTCUT_KEY)
|
QCoreApplication.translate("MainWindow", Params.LABEL_CHECK_BTN_PAUSE_SHORTCUT_KEY)
|
||||||
)
|
)
|
||||||
|
self.ui.pushButton_update_state.setShortcut(
|
||||||
|
QCoreApplication.translate("MainWindow", Params.LABEL_CHECK_BTN_UPDATE_STATE_SHORTCUT_KEY)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@overrides
|
@overrides
|
||||||
def closeEvent(self, event):
|
def closeEvent(self, event):
|
||||||
@ -584,6 +596,8 @@ class MainWindow_label_check(QMainWindow):
|
|||||||
ButtonState["Current"]["pushButton_prev_move"] = True
|
ButtonState["Current"]["pushButton_prev_move"] = True
|
||||||
ButtonState["Current"]["pushButton_next_move"] = True
|
ButtonState["Current"]["pushButton_next_move"] = True
|
||||||
ButtonState["Current"]["pushButton_pause"] = True
|
ButtonState["Current"]["pushButton_pause"] = True
|
||||||
|
ButtonState["Current"]["pushButton_update_state"] = True
|
||||||
|
|
||||||
PublicFunc.finish_operation(self, ButtonState)
|
PublicFunc.finish_operation(self, ButtonState)
|
||||||
|
|
||||||
def __slot_btn_save__(self):
|
def __slot_btn_save__(self):
|
||||||
@ -603,6 +617,20 @@ class MainWindow_label_check(QMainWindow):
|
|||||||
PublicFunc.msgbox_output(self, result.info, Constants.TIPS_TYPE_INFO)
|
PublicFunc.msgbox_output(self, result.info, Constants.TIPS_TYPE_INFO)
|
||||||
PublicFunc.finish_operation(self, ButtonState)
|
PublicFunc.finish_operation(self, ButtonState)
|
||||||
|
|
||||||
|
def __update_state__(self):
|
||||||
|
if self.move_state == "moving":
|
||||||
|
self.ui.pushButton_pause.click()
|
||||||
|
self.move_state = "pause"
|
||||||
|
else:
|
||||||
|
if self.last_move_state == "prev":
|
||||||
|
self.ui.pushButton_prev_move.click()
|
||||||
|
elif self.last_move_state == "next":
|
||||||
|
self.ui.pushButton_next_move.click()
|
||||||
|
else:
|
||||||
|
self.ui.pushButton_next_move.click()
|
||||||
|
self.move_state = "moving"
|
||||||
|
|
||||||
|
|
||||||
def __slot_btn_move__(self):
|
def __slot_btn_move__(self):
|
||||||
if self.data is None:
|
if self.data is None:
|
||||||
return
|
return
|
||||||
@ -610,6 +638,8 @@ class MainWindow_label_check(QMainWindow):
|
|||||||
sender = self.sender()
|
sender = self.sender()
|
||||||
|
|
||||||
if sender == self.ui.pushButton_prev_move:
|
if sender == self.ui.pushButton_prev_move:
|
||||||
|
self.last_move_state = "prev"
|
||||||
|
self.move_state = "moving"
|
||||||
Config["AutoplayArgs"]["AutoplayMode"] = "prev"
|
Config["AutoplayArgs"]["AutoplayMode"] = "prev"
|
||||||
self.autoplay_xlim_start = int(self.ax0.get_xlim()[1] - Config["AutoplayArgs"]["MaxRange"])
|
self.autoplay_xlim_start = int(self.ax0.get_xlim()[1] - Config["AutoplayArgs"]["MaxRange"])
|
||||||
self.autoplay_xlim_end = int(self.ax0.get_xlim()[1])
|
self.autoplay_xlim_end = int(self.ax0.get_xlim()[1])
|
||||||
@ -621,6 +651,8 @@ class MainWindow_label_check(QMainWindow):
|
|||||||
self.timer_autoplay.start(Config["AutoplayArgs"]["MoveSpeed"])
|
self.timer_autoplay.start(Config["AutoplayArgs"]["MoveSpeed"])
|
||||||
PublicFunc.text_output(self.ui, Constants.LABEL_CHECK_PREV_MOVE, Constants.TIPS_TYPE_INFO)
|
PublicFunc.text_output(self.ui, Constants.LABEL_CHECK_PREV_MOVE, Constants.TIPS_TYPE_INFO)
|
||||||
elif sender == self.ui.pushButton_next_move:
|
elif sender == self.ui.pushButton_next_move:
|
||||||
|
self.last_move_state = "next"
|
||||||
|
self.move_state = "moving"
|
||||||
Config["AutoplayArgs"]["AutoplayMode"] = "next"
|
Config["AutoplayArgs"]["AutoplayMode"] = "next"
|
||||||
self.autoplay_xlim_start = int(self.ax0.get_xlim()[0])
|
self.autoplay_xlim_start = int(self.ax0.get_xlim()[0])
|
||||||
self.autoplay_xlim_end = int(self.ax0.get_xlim()[0] + Config["AutoplayArgs"]["MaxRange"])
|
self.autoplay_xlim_end = int(self.ax0.get_xlim()[0] + Config["AutoplayArgs"]["MaxRange"])
|
||||||
|
|||||||
@ -202,6 +202,7 @@ class Params:
|
|||||||
LABEL_CHECK_BTN_PREV_MOVE_SHORTCUT_KEY = "A"
|
LABEL_CHECK_BTN_PREV_MOVE_SHORTCUT_KEY = "A"
|
||||||
LABEL_CHECK_BTN_NEXT_MOVE_SHORTCUT_KEY = "D"
|
LABEL_CHECK_BTN_NEXT_MOVE_SHORTCUT_KEY = "D"
|
||||||
LABEL_CHECK_BTN_PAUSE_SHORTCUT_KEY = "S"
|
LABEL_CHECK_BTN_PAUSE_SHORTCUT_KEY = "S"
|
||||||
|
LABEL_CHECK_BTN_UPDATE_STATE_SHORTCUT_KEY = "Space"
|
||||||
|
|
||||||
# 数据精同步
|
# 数据精同步
|
||||||
PRECISELY_ALIGN_CONFIG_FILE_PATH: str = "./config/Config_precisely_align.yaml"
|
PRECISELY_ALIGN_CONFIG_FILE_PATH: str = "./config/Config_precisely_align.yaml"
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
## Form generated from reading UI file 'MainWindow_label_check.ui'
|
## Form generated from reading UI file 'MainWindow_label_check.ui'
|
||||||
##
|
##
|
||||||
## Created by: Qt User Interface Compiler version 6.8.2
|
## Created by: Qt User Interface Compiler version 6.9.2
|
||||||
##
|
##
|
||||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -156,6 +156,14 @@ class Ui_MainWindow_label_check(object):
|
|||||||
|
|
||||||
self.horizontalLayout_2.addWidget(self.pushButton_pause)
|
self.horizontalLayout_2.addWidget(self.pushButton_pause)
|
||||||
|
|
||||||
|
self.pushButton_update_state = QPushButton(self.groupBox_2)
|
||||||
|
self.pushButton_update_state.setObjectName(u"pushButton_update_state")
|
||||||
|
sizePolicy.setHeightForWidth(self.pushButton_update_state.sizePolicy().hasHeightForWidth())
|
||||||
|
self.pushButton_update_state.setSizePolicy(sizePolicy)
|
||||||
|
self.pushButton_update_state.setFont(font1)
|
||||||
|
|
||||||
|
self.horizontalLayout_2.addWidget(self.pushButton_update_state)
|
||||||
|
|
||||||
self.pushButton_next_move = QPushButton(self.groupBox_2)
|
self.pushButton_next_move = QPushButton(self.groupBox_2)
|
||||||
self.pushButton_next_move.setObjectName(u"pushButton_next_move")
|
self.pushButton_next_move.setObjectName(u"pushButton_next_move")
|
||||||
sizePolicy.setHeightForWidth(self.pushButton_next_move.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(self.pushButton_next_move.sizePolicy().hasHeightForWidth())
|
||||||
@ -505,6 +513,13 @@ class Ui_MainWindow_label_check(object):
|
|||||||
self.groupBox_2.setTitle(QCoreApplication.translate("MainWindow_label_check", u"\u81ea\u52a8\u64ad\u653e", None))
|
self.groupBox_2.setTitle(QCoreApplication.translate("MainWindow_label_check", u"\u81ea\u52a8\u64ad\u653e", None))
|
||||||
self.pushButton_prev_move.setText(QCoreApplication.translate("MainWindow_label_check", u"< <(A)", None))
|
self.pushButton_prev_move.setText(QCoreApplication.translate("MainWindow_label_check", u"< <(A)", None))
|
||||||
self.pushButton_pause.setText(QCoreApplication.translate("MainWindow_label_check", u"| |(S)", None))
|
self.pushButton_pause.setText(QCoreApplication.translate("MainWindow_label_check", u"| |(S)", None))
|
||||||
|
#if QT_CONFIG(tooltip)
|
||||||
|
self.pushButton_update_state.setToolTip(QCoreApplication.translate("MainWindow_label_check", u"\u6309\u4e0b\u540e\u6062\u590d\u4e0a\u6b21\u72b6\u6001", None))
|
||||||
|
#endif // QT_CONFIG(tooltip)
|
||||||
|
#if QT_CONFIG(whatsthis)
|
||||||
|
self.pushButton_update_state.setWhatsThis("")
|
||||||
|
#endif // QT_CONFIG(whatsthis)
|
||||||
|
self.pushButton_update_state.setText(QCoreApplication.translate("MainWindow_label_check", u"\u26aa( )", None))
|
||||||
self.pushButton_next_move.setText(QCoreApplication.translate("MainWindow_label_check", u"> >(D)", None))
|
self.pushButton_next_move.setText(QCoreApplication.translate("MainWindow_label_check", u"> >(D)", None))
|
||||||
self.groupBox_3.setTitle(QCoreApplication.translate("MainWindow_label_check", u"\u8bbe\u7f6e", None))
|
self.groupBox_3.setTitle(QCoreApplication.translate("MainWindow_label_check", u"\u8bbe\u7f6e", None))
|
||||||
self.label_moveLength_preset_1.setText(QCoreApplication.translate("MainWindow_label_check", u"10000", None))
|
self.label_moveLength_preset_1.setText(QCoreApplication.translate("MainWindow_label_check", u"10000", None))
|
||||||
|
|||||||
@ -237,6 +237,30 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_update_state">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>按下后恢复上次状态</string>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>⚪( )</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton_next_move">
|
<widget class="QPushButton" name="pushButton_next_move">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
|||||||
Reference in New Issue
Block a user