Commit 8142abd4 authored by 翟艳秋(20软)'s avatar 翟艳秋(20软)

fix some bugs and fit ocr with low quality films

parent ad04a182
...@@ -13,15 +13,40 @@ ...@@ -13,15 +13,40 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Dialog</string> <string>Dialog</string>
</property> </property>
<widget class="QDialogButtonBox" name="buttonBox"> <layout class="QGridLayout" name="gridLayout">
<property name="geometry"> <item row="0" column="2">
<rect> <widget class="QPushButton" name="pushButton_2">
<x>220</x> <property name="text">
<y>250</y> <string>表格路径</string>
<width>341</width> </property>
<height>32</height> </widget>
</rect> </item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_3">
<property name="enabled">
<bool>false</bool>
</property> </property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_4">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_2"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>旁白语速:</string>
</property>
</widget>
</item>
<item row="3" column="1" alignment="Qt::AlignHCenter">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="toolTip"> <property name="toolTip">
<string/> <string/>
</property> </property>
...@@ -38,130 +63,22 @@ ...@@ -38,130 +63,22 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label"> </item>
<property name="geometry"> <item row="0" column="0">
<rect>
<x>40</x>
<y>40</y>
<width>72</width>
<height>15</height>
</rect>
</property>
<property name="text">
<string>视频路径:</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit">
<property name="geometry">
<rect>
<x>130</x>
<y>40</y>
<width>231</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>390</x>
<y>40</y>
<width>101</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>选择文件</string>
</property>
</widget>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>20</x>
<y>90</y>
<width>111</width>
<height>16</height>
</rect>
</property>
<property name="text"> <property name="text">
<string>旁白脚本表格:</string> <string>旁白脚本表格:</string>
</property> </property>
</widget> </widget>
<widget class="QLineEdit" name="lineEdit_2"> </item>
<property name="geometry"> <item row="1" column="0">
<rect>
<x>130</x>
<y>90</y>
<width>231</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="pushButton_2">
<property name="geometry">
<rect>
<x>390</x>
<y>90</y>
<width>101</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>表格路径</string>
</property>
</widget>
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>30</x>
<y>140</y>
<width>111</width>
<height>16</height>
</rect>
</property>
<property name="text"> <property name="text">
<string>旁白说话人:</string> <string>旁白说话人:</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label_4"> </item>
<property name="geometry"> </layout>
<rect>
<x>30</x>
<y>200</y>
<width>111</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>旁白语速:</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_3">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>130</x>
<y>140</y>
<width>231</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>130</x>
<y>200</y>
<width>231</width>
<height>21</height>
</rect>
</property>
</widget>
</widget> </widget>
<resources/> <resources/>
<connections> <connections>
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'assemble_dialog.ui' # Form implementation generated from reading ui file 'd:\AddCaption\cur_version\accessibility_movie_2\assemble_dialog.ui'
# #
# Created by: PyQt5 UI code generator 5.12 # Created by: PyQt5 UI code generator 5.15.4
# #
# WARNING! All changes made in this file will be lost! # WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtCore, QtGui, QtWidgets
...@@ -13,46 +15,48 @@ class Ui_Dialog(object): ...@@ -13,46 +15,48 @@ class Ui_Dialog(object):
def setupUi(self, Dialog): def setupUi(self, Dialog):
Dialog.setObjectName("Dialog") Dialog.setObjectName("Dialog")
Dialog.resize(585, 326) Dialog.resize(585, 326)
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) self.gridLayout = QtWidgets.QGridLayout(Dialog)
self.buttonBox.setGeometry(QtCore.QRect(220, 250, 341, 32)) self.gridLayout.setObjectName("gridLayout")
self.buttonBox.setToolTip("")
self.buttonBox.setToolTipDuration(-1)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setCenterButtons(False)
self.buttonBox.setObjectName("buttonBox")
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(40, 40, 72, 15))
self.label.setObjectName("label")
self.lineEdit = QtWidgets.QLineEdit(Dialog)
self.lineEdit.setGeometry(QtCore.QRect(130, 40, 231, 21))
self.lineEdit.setObjectName("lineEdit")
self.pushButton = QtWidgets.QPushButton(Dialog) self.pushButton = QtWidgets.QPushButton(Dialog)
self.pushButton.setGeometry(QtCore.QRect(390, 40, 101, 31))
self.pushButton.setObjectName("pushButton") self.pushButton.setObjectName("pushButton")
self.label_2 = QtWidgets.QLabel(Dialog) self.gridLayout.addWidget(self.pushButton, 0, 2, 1, 1)
self.label_2.setGeometry(QtCore.QRect(20, 90, 111, 16))
self.label_2.setObjectName("label_2")
self.lineEdit_2 = QtWidgets.QLineEdit(Dialog)
self.lineEdit_2.setGeometry(QtCore.QRect(130, 90, 231, 21))
self.lineEdit_2.setObjectName("lineEdit_2")
self.pushButton_2 = QtWidgets.QPushButton(Dialog)
self.pushButton_2.setGeometry(QtCore.QRect(390, 90, 101, 31))
self.pushButton_2.setObjectName("pushButton_2")
self.label_3 = QtWidgets.QLabel(Dialog)
self.label_3.setGeometry(QtCore.QRect(30, 140, 111, 16))
self.label_3.setObjectName("label_3")
self.label_4 = QtWidgets.QLabel(Dialog) self.label_4 = QtWidgets.QLabel(Dialog)
self.label_4.setGeometry(QtCore.QRect(30, 200, 111, 16))
self.label_4.setObjectName("label_4") self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
self.label_3 = QtWidgets.QLabel(Dialog)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
self.lineEdit_3 = QtWidgets.QLineEdit(Dialog) self.lineEdit_3 = QtWidgets.QLineEdit(Dialog)
self.lineEdit_3.setEnabled(False) self.lineEdit_3.setEnabled(False)
self.lineEdit_3.setGeometry(QtCore.QRect(130, 140, 231, 21))
self.lineEdit_3.setObjectName("lineEdit_3") self.lineEdit_3.setObjectName("lineEdit_3")
self.gridLayout.addWidget(self.lineEdit_3, 2, 1, 1, 1)
self.lineEdit_4 = QtWidgets.QLineEdit(Dialog) self.lineEdit_4 = QtWidgets.QLineEdit(Dialog)
self.lineEdit_4.setEnabled(False) self.lineEdit_4.setEnabled(False)
self.lineEdit_4.setGeometry(QtCore.QRect(130, 200, 231, 21))
self.lineEdit_4.setObjectName("lineEdit_4") self.lineEdit_4.setObjectName("lineEdit_4")
self.gridLayout.addWidget(self.lineEdit_4, 3, 1, 1, 1)
self.lineEdit = QtWidgets.QLineEdit(Dialog)
self.lineEdit.setObjectName("lineEdit")
self.gridLayout.addWidget(self.lineEdit, 0, 1, 1, 1)
self.label_2 = QtWidgets.QLabel(Dialog)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
self.lineEdit_2 = QtWidgets.QLineEdit(Dialog)
self.lineEdit_2.setObjectName("lineEdit_2")
self.gridLayout.addWidget(self.lineEdit_2, 1, 1, 1, 1)
self.label = QtWidgets.QLabel(Dialog)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
self.pushButton_2 = QtWidgets.QPushButton(Dialog)
self.pushButton_2.setObjectName("pushButton_2")
self.gridLayout.addWidget(self.pushButton_2, 1, 2, 1, 1)
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setToolTip("")
self.buttonBox.setToolTipDuration(-1)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setCenterButtons(False)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 4, 1, 1, 1, QtCore.Qt.AlignHCenter)
self.retranslateUi(Dialog) self.retranslateUi(Dialog)
self.buttonBox.accepted.connect(Dialog.accept) self.buttonBox.accepted.connect(Dialog.accept)
...@@ -62,9 +66,9 @@ class Ui_Dialog(object): ...@@ -62,9 +66,9 @@ class Ui_Dialog(object):
def retranslateUi(self, Dialog): def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate _translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog")) Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
self.label.setText(_translate("Dialog", "视频路径:"))
self.pushButton.setText(_translate("Dialog", "选择文件")) self.pushButton.setText(_translate("Dialog", "选择文件"))
self.label_4.setText(_translate("Dialog", "旁白语速:"))
self.label_3.setText(_translate("Dialog", "旁白说话人:"))
self.label_2.setText(_translate("Dialog", "旁白脚本表格:")) self.label_2.setText(_translate("Dialog", "旁白脚本表格:"))
self.label.setText(_translate("Dialog", "视频路径:"))
self.pushButton_2.setText(_translate("Dialog", "表格路径")) self.pushButton_2.setText(_translate("Dialog", "表格路径"))
self.label_3.setText(_translate("Dialog", "旁白说话人:"))
self.label_4.setText(_translate("Dialog", "旁白语速:"))
\ No newline at end of file
...@@ -186,7 +186,9 @@ def detect_subtitle(img: np.ndarray) -> Union[str, None]: ...@@ -186,7 +186,9 @@ def detect_subtitle(img: np.ndarray) -> Union[str, None]:
subTitle = '' subTitle = ''
height = down_b - up_b height = down_b - up_b
img = img[int(up_b - height * 0.7):int(down_b + height * 0.7)] img = img[int(up_b - height * 0.7):int(down_b + height * 0.7)]
# img = cv2.resize(img, (int(img.shape[1] * 0.5), int(img.shape[0] * 0.5))) # 针对低帧率的视频做图像放大处理
if img.shape[1] < 1000:
img = cv2.resize(img, (int(img.shape[1] * 1.5), int(img.shape[0] * 1.5)))
res = ocr.ocr(img, cls=True) res = ocr.ocr(img, cls=True)
sorted(res, key=lambda text: text[0][0][1]) sorted(res, key=lambda text: text[0][0][1])
if len(res) == 0: if len(res) == 0:
......
...@@ -655,7 +655,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -655,7 +655,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
previewed_audio[os.path.basename(path)] = 1 previewed_audio[os.path.basename(path)] = 1
def openVideoFile(self): def openVideoFile(self):
path = QFileDialog.getOpenFileUrl(self, "选择待导入视频", QUrl(os.getcwd()), "Video Files(*.mp4 *.rmvb *mkv *avi)")[0] path = QFileDialog.getOpenFileUrl(self, "选择待导入视频", QUrl(os.getcwd()), "Video Files(*.mp4 *.rmvb *mkv *avi *.);; 所有文件(*.*)")[0]
print(path.url()[8:]) print(path.url()[8:])
if len(path.url()) == 0 or not os.path.exists(path.url()[8:]): if len(path.url()) == 0 or not os.path.exists(path.url()[8:]):
return path return path
...@@ -801,10 +801,6 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -801,10 +801,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
def btn_pressed_preview_audio_slot(self): def btn_pressed_preview_audio_slot(self):
for t in self.all_threads:
if t.name == "single_speech_synthesis" and t.is_alive():
self.prompt_dialog.show_with_msg("音频正在合成,请稍候")
return
btn = self.sender() btn = self.sender()
# 法1:按照物理位置。这样的结果不太对 # 法1:按照物理位置。这样的结果不太对
idx = self.pb_tableWidget.indexAt(btn.pos()) idx = self.pb_tableWidget.indexAt(btn.pos())
...@@ -816,6 +812,13 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -816,6 +812,13 @@ class MainWindow(QMainWindow, Ui_MainWindow):
audio_path = os.path.dirname(self.projectContext.excel_path) + ( audio_path = os.path.dirname(self.projectContext.excel_path) + (
"/tmp/%.2f.wav" % pos_sec) "/tmp/%.2f.wav" % pos_sec)
print("待播放的音频文件为", audio_path) print("待播放的音频文件为", audio_path)
if audio_path is not None:
# 确认该音频是否正在合成中
for t in self.all_threads:
if t.name == "single_speech_synthesis" and t.is_alive():
if audio_path in t._args:
self.prompt_dialog.show_with_msg("音频正在合成,请稍候")
return
# 2、如果找到了该音频,则新起一个线程播放 # 2、如果找到了该音频,则新起一个线程播放
if audio_path != None and os.path.exists(audio_path): if audio_path != None and os.path.exists(audio_path):
t = RunThread(funcName=self.play_audio, t = RunThread(funcName=self.play_audio,
...@@ -1325,9 +1328,14 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -1325,9 +1328,14 @@ class MainWindow(QMainWindow, Ui_MainWindow):
def change_audio_speed(self): def change_audio_speed(self):
combo = self.sender() combo = self.sender()
idx = self.pb_tableWidget.indexAt(combo.pos()) idx = self.pb_tableWidget.indexAt(combo.pos())
print("index:", idx.row()) row = idx.row()
print("index:", row)
# 将audio_player的资源置空 # 将audio_player的资源置空
print("释放当前播放的音频文件") print("释放当前播放的音频文件")
self.audio_player.setMedia(QMediaContent()) self.audio_player.setMedia(QMediaContent())
self.projectContext.aside_list[idx.row()].speed = combo.currentText() self.projectContext.aside_list[row].speed = combo.currentText()
self.do_generate_audio_by_aside_row(idx.row()) # 更新字幕旁白表格里对应行的语速
\ No newline at end of file all_idx = self.projectContext.aside_subtitle_2contentId(self.projectContext.aside_list[row])
self.projectContext.all_elements[int(all_idx)].speed = combo.currentText()
self.all_tableWidget.setItem(int(all_idx), constant.Content.SpeedColumnNumber, QTableWidgetItem(combo.currentText()))
self.do_generate_audio_by_aside_row(row)
\ No newline at end of file
...@@ -21,6 +21,7 @@ class Ui_MainWindow(object): ...@@ -21,6 +21,7 @@ class Ui_MainWindow(object):
" padding: 5px;\n" " padding: 5px;\n"
"}") "}")
self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget = QtWidgets.QWidget(MainWindow)
# self.centralwidget.setStyleSheet("font: 9pt \"黑体\";")
self.centralwidget.setObjectName("centralwidget") self.centralwidget.setObjectName("centralwidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget)
self.horizontalLayout.setObjectName("horizontalLayout") self.horizontalLayout.setObjectName("horizontalLayout")
...@@ -206,6 +207,7 @@ class Ui_MainWindow(object): ...@@ -206,6 +207,7 @@ class Ui_MainWindow(object):
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.all_tab) self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.all_tab)
self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.all_tableWidget = QtWidgets.QTableWidget(self.all_tab) self.all_tableWidget = QtWidgets.QTableWidget(self.all_tab)
# self.all_tableWidget.setStyleSheet("font: 9pt \"微软雅黑\";")
self.all_tableWidget.setObjectName("all_tableWidget") self.all_tableWidget.setObjectName("all_tableWidget")
self.all_tableWidget.setColumnCount(0) self.all_tableWidget.setColumnCount(0)
self.all_tableWidget.setRowCount(0) self.all_tableWidget.setRowCount(0)
...@@ -240,6 +242,7 @@ class Ui_MainWindow(object): ...@@ -240,6 +242,7 @@ class Ui_MainWindow(object):
self.shuiping.setStretch(1, 5) self.shuiping.setStretch(1, 5)
self.verticalLayout.addLayout(self.shuiping) self.verticalLayout.addLayout(self.shuiping)
self.verticalWidget_2 = QtWidgets.QWidget(self.centralwidget) self.verticalWidget_2 = QtWidgets.QWidget(self.centralwidget)
# self.verticalWidget_2.setStyleSheet("font: 9pt \"微软雅黑\";")
self.verticalWidget_2.setObjectName("verticalWidget_2") self.verticalWidget_2.setObjectName("verticalWidget_2")
self.chuizhi = QtWidgets.QVBoxLayout(self.verticalWidget_2) self.chuizhi = QtWidgets.QVBoxLayout(self.verticalWidget_2)
self.chuizhi.setObjectName("chuizhi") self.chuizhi.setObjectName("chuizhi")
...@@ -330,18 +333,26 @@ class Ui_MainWindow(object): ...@@ -330,18 +333,26 @@ class Ui_MainWindow(object):
self.statusbar.setObjectName("statusbar") self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar) MainWindow.setStatusBar(self.statusbar)
self.setting = QtWidgets.QAction(MainWindow) self.setting = QtWidgets.QAction(MainWindow)
# font = QtGui.QFont()
# font.setFamily("微软雅黑")
# self.setting.setFont(font)
self.setting.setObjectName("setting") self.setting.setObjectName("setting")
self.action_open_project = QtWidgets.QAction(MainWindow) self.action_open_project = QtWidgets.QAction(MainWindow)
# self.action_open_project.setFont(font)
self.action_open_project.setObjectName("action_open_project") self.action_open_project.setObjectName("action_open_project")
self.import_movie = QtWidgets.QAction(MainWindow) self.import_movie = QtWidgets.QAction(MainWindow)
# self.import_movie.setFont(font)
self.import_movie.setObjectName("import_movie") self.import_movie.setObjectName("import_movie")
self.actions = QtWidgets.QAction(MainWindow) self.actions = QtWidgets.QAction(MainWindow)
self.actions.setObjectName("actions") self.actions.setObjectName("actions")
self.action_save = QtWidgets.QAction(MainWindow) self.action_save = QtWidgets.QAction(MainWindow)
# self.action_save.setFont(font)
self.action_save.setObjectName("action_save") self.action_save.setObjectName("action_save")
self.action_undo = QtWidgets.QAction(MainWindow) self.action_undo = QtWidgets.QAction(MainWindow)
# self.action_undo.setFont(font)
self.action_undo.setObjectName("action_undo") self.action_undo.setObjectName("action_undo")
self.action_redo = QtWidgets.QAction(MainWindow) self.action_redo = QtWidgets.QAction(MainWindow)
# self.action_redo.setFont(font)
self.action_redo.setObjectName("action_redo") self.action_redo.setObjectName("action_redo")
self.action_3 = QtWidgets.QAction(MainWindow) self.action_3 = QtWidgets.QAction(MainWindow)
self.action_3.setObjectName("action_3") self.action_3.setObjectName("action_3")
...@@ -352,10 +363,12 @@ class Ui_MainWindow(object): ...@@ -352,10 +363,12 @@ class Ui_MainWindow(object):
self.action_operate = QtWidgets.QAction(MainWindow) self.action_operate = QtWidgets.QAction(MainWindow)
self.action_operate.setObjectName("action_operate") self.action_operate.setObjectName("action_operate")
self.action_export = QtWidgets.QAction(MainWindow) self.action_export = QtWidgets.QAction(MainWindow)
# self.action_export.setFont(font)
self.action_export.setObjectName("action_export") self.action_export.setObjectName("action_export")
self.action_insert_aside_from_now = QtWidgets.QAction(MainWindow) self.action_insert_aside_from_now = QtWidgets.QAction(MainWindow)
self.action_insert_aside_from_now.setObjectName("action_insert_aside_from_now") self.action_insert_aside_from_now.setObjectName("action_insert_aside_from_now")
self.action_create = QtWidgets.QAction(MainWindow) self.action_create = QtWidgets.QAction(MainWindow)
# self.action_create.setFont(font)
self.action_create.setObjectName("action_create") self.action_create.setObjectName("action_create")
self.menu.addAction(self.action_create) self.menu.addAction(self.action_create)
self.menu.addAction(self.action_open_project) self.menu.addAction(self.action_open_project)
......
...@@ -174,6 +174,7 @@ class ProjectContext: ...@@ -174,6 +174,7 @@ class ProjectContext:
return return
with open(self.conf_path, 'r', encoding='utf8') as f: with open(self.conf_path, 'r', encoding='utf8') as f:
info = json.load(f) info = json.load(f)
# print(json.dumps(info, ensure_ascii=False, indent=4))
self.video_path = info["video_path"] self.video_path = info["video_path"]
self.excel_path = info["excel_path"] self.excel_path = info["excel_path"]
self.speaker_info = info["speaker_info"]["speaker_id"] self.speaker_info = info["speaker_info"]["speaker_id"]
...@@ -208,7 +209,6 @@ class ProjectContext: ...@@ -208,7 +209,6 @@ class ProjectContext:
} }
f.write(json.dumps(info)) f.write(json.dumps(info))
def setVideoPath(self, video_path): def setVideoPath(self, video_path):
self.video_path = video_path self.video_path = video_path
......
...@@ -141,7 +141,7 @@ class Operation_Dialog(QDialog, Ui_Dialog): ...@@ -141,7 +141,7 @@ class Operation_Dialog(QDialog, Ui_Dialog):
assert start_time_f < end_time_f assert start_time_f < end_time_f
if row_number < rowCount: if row_number < rowCount:
# 要求结束时间在下一行的起始时间前面,对增加和修改都适用 # 要求结束时间在下一行的起始时间前面,对增加和修改都适用
assert float(self.mainWindow.projectContext.all_elements[list_idx+1].st_time_sec) > end_time_f assert float(self.mainWindow.projectContext.all_elements[list_idx+1].st_time_sec) >= end_time_f
# 要求起始时间在上一行后面,在下一行前面 # 要求起始时间在上一行后面,在下一行前面
if self.comboBox_2.currentText() == "增加一行": if self.comboBox_2.currentText() == "增加一行":
......
This diff is collapsed.
Markdown is supported
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