|
@@ -33,6 +33,10 @@ CompareItemDialog::CompareItemDialog(QWidget *parent)
|
|
ui->checkBoxOverload->setChecked(true);
|
|
ui->checkBoxOverload->setChecked(true);
|
|
ui->checkBoxPhase->setChecked(true);
|
|
ui->checkBoxPhase->setChecked(true);
|
|
|
|
|
|
|
|
+ m_listOtherRoadWgt.clear();
|
|
|
|
+ m_listOtherRoadWgt.push_back(ui->widget_mainRoad);
|
|
|
|
+ m_listOtherRoadWgt.push_back(ui->widget_secondRoad);
|
|
|
|
+
|
|
/* 设置可选的声卡通道信息 */
|
|
/* 设置可选的声卡通道信息 */
|
|
setSoundCardRoadList(SoundCards.getCurrentSoundCardInfo());
|
|
setSoundCardRoadList(SoundCards.getCurrentSoundCardInfo());
|
|
|
|
|
|
@@ -67,6 +71,49 @@ void CompareItemDialog::setSoundCardRoadList(const SoundCardPCMInfo_t& soundCard
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+/* 设置模式,是否是多项编辑 */
|
|
|
|
+void CompareItemDialog::setMultiEditMode(bool multiEdit)
|
|
|
|
+{
|
|
|
|
+ m_isMultiEdit = multiEdit;
|
|
|
|
+ if(!multiEdit)
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ /* 设置对比项名称输入框不可编辑 */
|
|
|
|
+ ui->lineEdit_compareItmName->setEnabled(false);
|
|
|
|
+ /* 设置通道不可编辑 */
|
|
|
|
+ // ui->widget_mainRoad->setMultiEditMode(false);
|
|
|
|
+ // ui->widget_secondRoad->setMultiEditMode(false);
|
|
|
|
+ /* 删除多余的通道 */
|
|
|
|
+ for(auto& widget : m_listOtherRoadWgt)
|
|
|
|
+ {
|
|
|
|
+ if(widget == ui->widget_mainRoad || widget == ui->widget_secondRoad)
|
|
|
|
+ {
|
|
|
|
+ widget->setMultiEditMode(false);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ delete widget;
|
|
|
|
+ widget = nullptr;
|
|
|
|
+ }
|
|
|
|
+ m_listOtherRoadWgt.clear();
|
|
|
|
+ m_listOtherRoadWgt.push_back(ui->widget_mainRoad);
|
|
|
|
+ m_listOtherRoadWgt.push_back(ui->widget_secondRoad);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/* 设置对比项名称列表。查重时使用 */
|
|
|
|
+void CompareItemDialog::setCompareItemNameList(const QList<QString>& listItemNames)
|
|
|
|
+{
|
|
|
|
+ m_listCompareItemNames = listItemNames;
|
|
|
|
+ /* 先去掉自身名称,防止编辑的时候直接报错 */
|
|
|
|
+ QString currentName = ui->lineEdit_compareItmName->text();
|
|
|
|
+ if(!currentName.isEmpty())
|
|
|
|
+ {
|
|
|
|
+ m_listCompareItemNames.removeAll(currentName);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
/* 设置默认的参数 */
|
|
/* 设置默认的参数 */
|
|
void CompareItemDialog::setDefaultParams(const CompareItemInfo_t& item)
|
|
void CompareItemDialog::setDefaultParams(const CompareItemInfo_t& item)
|
|
{
|
|
{
|
|
@@ -94,7 +141,8 @@ void CompareItemDialog::setDefaultParams(const CompareItemInfo_t& item)
|
|
ui->lineEditPhaseSensibility->setText(QString::number(item.paramPhase.nSensitivity));
|
|
ui->lineEditPhaseSensibility->setText(QString::number(item.paramPhase.nSensitivity));
|
|
ui->lineEditPhaseThreshold->setText(QString::number(std::abs(item.paramPhase.threshold.dThreshold)));
|
|
ui->lineEditPhaseThreshold->setText(QString::number(std::abs(item.paramPhase.threshold.dThreshold)));
|
|
|
|
|
|
- /* 先设置主通道和第二通道 */
|
|
|
|
|
|
+
|
|
|
|
+ /* 设置其他通道 */
|
|
for(const auto& road : item.mapRoad)
|
|
for(const auto& road : item.mapRoad)
|
|
{
|
|
{
|
|
if(road.nCompareRoadNum == 1) // 主通道
|
|
if(road.nCompareRoadNum == 1) // 主通道
|
|
@@ -112,11 +160,7 @@ void CompareItemDialog::setDefaultParams(const CompareItemInfo_t& item)
|
|
ui->widget_secondRoad->blockSignals(false);
|
|
ui->widget_secondRoad->blockSignals(false);
|
|
ui->widget_secondRoad->setDefaultParams(road);
|
|
ui->widget_secondRoad->setDefaultParams(road);
|
|
}
|
|
}
|
|
- }
|
|
|
|
- /* 设置其他通道 */
|
|
|
|
- for(const auto& road : item.mapRoad)
|
|
|
|
- {
|
|
|
|
- if(road.nCompareRoadNum > 2) // 其他通道
|
|
|
|
|
|
+ else if(road.nCompareRoadNum > 2) // 其他通道
|
|
{
|
|
{
|
|
auto pWgt = addOneRoadWidget(road.nCompareRoadNum, true);
|
|
auto pWgt = addOneRoadWidget(road.nCompareRoadNum, true);
|
|
/* 设置默认参数 */
|
|
/* 设置默认参数 */
|
|
@@ -188,25 +232,6 @@ void CompareItemDialog::do_selectOneRecordRoad(QString strPCMName)
|
|
/* 只在release模式下生效,debug可以设置重复的,方便测试 */
|
|
/* 只在release模式下生效,debug可以设置重复的,方便测试 */
|
|
#if C_RELEASE
|
|
#if C_RELEASE
|
|
/* 判断是否重复 */
|
|
/* 判断是否重复 */
|
|
- if(sender != ui->widget_mainRoad)
|
|
|
|
- {
|
|
|
|
- if(ui->widget_mainRoad->getCurrentPCMName() == strPCMName)
|
|
|
|
- {
|
|
|
|
- // 如果重复,则去掉重复的
|
|
|
|
- ui->widget_mainRoad->clearCurrentSelectRecordName();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(sender != ui->widget_secondRoad)
|
|
|
|
- {
|
|
|
|
- if(ui->widget_secondRoad->getCurrentPCMName() == strPCMName)
|
|
|
|
- {
|
|
|
|
- // 如果重复,则去掉重复的
|
|
|
|
- ui->widget_secondRoad->clearCurrentSelectRecordName();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
for(auto& it : m_listOtherRoadWgt)
|
|
for(auto& it : m_listOtherRoadWgt)
|
|
{
|
|
{
|
|
if(it == sender)
|
|
if(it == sender)
|
|
@@ -257,6 +282,34 @@ void CompareItemDialog::setQSS()
|
|
ui->widget_secondRoad->setQSS(m_qssRecordRoad);
|
|
ui->widget_secondRoad->setQSS(m_qssRecordRoad);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+/* 重载按下关闭按钮之前的操作 */
|
|
|
|
+bool CompareItemDialog::isOKClicked()
|
|
|
|
+{
|
|
|
|
+ /* 先取消所有的报警 */
|
|
|
|
+ cancelAllWarn();
|
|
|
|
+ /* 获取对比项的信息 */
|
|
|
|
+ if(!getCompareItemBaseInfo(m_compareItemInfo))
|
|
|
|
+ {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /* 获取录音通道信息 */
|
|
|
|
+ if(!getCompareRoadInfo(m_compareItemInfo))
|
|
|
|
+ {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /* 获取音频检测信息 */
|
|
|
|
+ if(!getAudioDetectInfo(m_compareItemInfo))
|
|
|
|
+ {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
/* 设置静音过载反相可编辑 */
|
|
/* 设置静音过载反相可编辑 */
|
|
void CompareItemDialog::setMOPEditable(EDBType type, bool editable)
|
|
void CompareItemDialog::setMOPEditable(EDBType type, bool editable)
|
|
{
|
|
{
|
|
@@ -307,19 +360,19 @@ void CompareItemDialog::setDetectParamInputOnlyNumber()
|
|
// 静音参数,只允许输入1~1000的整数
|
|
// 静音参数,只允许输入1~1000的整数
|
|
// QRegularExpression rx1("-[4-8][0-9]");
|
|
// QRegularExpression rx1("-[4-8][0-9]");
|
|
// ui->lineEditMuteThreshold->setValidator(new QRegularExpressionValidator(rx1, this));
|
|
// ui->lineEditMuteThreshold->setValidator(new QRegularExpressionValidator(rx1, this));
|
|
- ui->lineEditMuteThreshold->setValidator(new QIntValidator(40, 84, this));
|
|
|
|
- ui->lineEditMuteLen->setValidator(new QIntValidator(2, 90, this));
|
|
|
|
- ui->lineEditMuteSensibility->setValidator(new QIntValidator(22, 100, this));
|
|
|
|
|
|
+ ui->lineEditMuteThreshold->setValidator(new QIntValidator(m_silenceThresholdLow, m_silenceThresholdHigh, this));
|
|
|
|
+ ui->lineEditMuteLen->setValidator(new QIntValidator(m_silenceDurationLow, m_silenceDurationHigh, this));
|
|
|
|
+ ui->lineEditMuteSensibility->setValidator(new QIntValidator(m_silenceSensitivityLow, m_silenceSensitivityHigh, this));
|
|
|
|
|
|
// 过载参数
|
|
// 过载参数
|
|
- ui->lineEditOverloadThreshold->setValidator(new QIntValidator(0, 40, this));
|
|
|
|
- ui->lineEditOverloadLen->setValidator(new QIntValidator(2, 90, this));
|
|
|
|
- ui->lineEditOverloadSensibility->setValidator(new QIntValidator(22, 100, this));
|
|
|
|
|
|
+ ui->lineEditOverloadThreshold->setValidator(new QIntValidator(m_overloadThresholdLow, m_overloadThresholdHigh, this));
|
|
|
|
+ ui->lineEditOverloadLen->setValidator(new QIntValidator(m_overloadDurationLow, m_overloadDurationHigh, this));
|
|
|
|
+ ui->lineEditOverloadSensibility->setValidator(new QIntValidator(m_overloadSensitivityLow, m_overloadSensitivityHigh, this));
|
|
|
|
|
|
// 反相参数,阈值为浮点数,范围0.0~0.99
|
|
// 反相参数,阈值为浮点数,范围0.0~0.99
|
|
- ui->lineEditPhaseThreshold->setValidator(new StrictDoubleValidator(0.0, 0.99, 3, this));
|
|
|
|
- ui->lineEditPhaseLen->setValidator(new QIntValidator(10, 90, this));
|
|
|
|
- ui->lineEditPhaseSensibility->setValidator(new QIntValidator(20, 99, this));
|
|
|
|
|
|
+ ui->lineEditPhaseThreshold->setValidator(new StrictDoubleValidator(m_phaseThresholdLow, m_phaseThresholdHigh, 3, this));
|
|
|
|
+ ui->lineEditPhaseLen->setValidator(new QIntValidator(m_phaseDurationLow, m_phaseDurationHigh, this));
|
|
|
|
+ ui->lineEditPhaseSensibility->setValidator(new QIntValidator(m_phaseSensitivityLow, m_phaseSensitivityHigh, this));
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -338,7 +391,7 @@ SingleCompareRoadWidget* CompareItemDialog::addOneRoadWidget(int nIndex, bool bD
|
|
/* 设置可选通道列表 */
|
|
/* 设置可选通道列表 */
|
|
pWgt->setSoundCardRoadList(m_soundCardInfo);
|
|
pWgt->setSoundCardRoadList(m_soundCardInfo);
|
|
pWgt->setQSS(m_qssRecordRoad);
|
|
pWgt->setQSS(m_qssRecordRoad);
|
|
- pLayout->insertWidget(m_listOtherRoadWgt.size(), pWgt);
|
|
|
|
|
|
+ pLayout->insertWidget(m_listOtherRoadWgt.size() - 2, pWgt);
|
|
|
|
|
|
connect(pWgt, &SingleCompareRoadWidget::deleted, this, &CompareItemDialog::do_CompareRoadWgtDeleted);
|
|
connect(pWgt, &SingleCompareRoadWidget::deleted, this, &CompareItemDialog::do_CompareRoadWgtDeleted);
|
|
connect(pWgt, &SingleCompareRoadWidget::signal_selectRecordRoad, this, &CompareItemDialog::do_selectOneRecordRoad);
|
|
connect(pWgt, &SingleCompareRoadWidget::signal_selectRecordRoad, this, &CompareItemDialog::do_selectOneRecordRoad);
|
|
@@ -347,40 +400,26 @@ SingleCompareRoadWidget* CompareItemDialog::addOneRoadWidget(int nIndex, bool bD
|
|
return pWgt;
|
|
return pWgt;
|
|
}
|
|
}
|
|
|
|
|
|
-/* 重载按下关闭按钮之前的操作 */
|
|
|
|
-bool CompareItemDialog::isOKClicked()
|
|
|
|
-{
|
|
|
|
- /* 先取消所有的报警 */
|
|
|
|
- cancelAllWarn();
|
|
|
|
- /* 获取对比项的信息 */
|
|
|
|
- if(!getCompareItemBaseInfo(m_compareItemInfo))
|
|
|
|
- {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /* 获取录音通道信息 */
|
|
|
|
- if(!getCompareRoadInfo(m_compareItemInfo))
|
|
|
|
- {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /* 获取音频检测信息 */
|
|
|
|
- if(!getAudioDetectInfo(m_compareItemInfo))
|
|
|
|
- {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
|
|
|
|
- return true;
|
|
|
|
-}
|
|
|
|
|
|
|
|
/* 获取对比项的基础信息 */
|
|
/* 获取对比项的基础信息 */
|
|
bool CompareItemDialog::getCompareItemBaseInfo(CompareItemInfo_t& compareItemInfo)
|
|
bool CompareItemDialog::getCompareItemBaseInfo(CompareItemInfo_t& compareItemInfo)
|
|
{
|
|
{
|
|
- if(ui->lineEdit_compareItmName->text().isEmpty())
|
|
|
|
|
|
+ if(!m_isMultiEdit)
|
|
{
|
|
{
|
|
- setWarn(ui->lineEdit_compareItmName, true);
|
|
|
|
- TipWidget::display(TipWidget::OPERATOR_WARN, "对比项名称不能为空", this);
|
|
|
|
- return false;
|
|
|
|
|
|
+ if(ui->lineEdit_compareItmName->text().isEmpty())
|
|
|
|
+ {
|
|
|
|
+ setWarn(ui->lineEdit_compareItmName, true);
|
|
|
|
+ TipWidget::display(TipWidget::OPERATOR_WARN, "对比项名称不能为空", this);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ /* 检查名称和现有的是否重复 */
|
|
|
|
+ if(m_listCompareItemNames.contains(ui->lineEdit_compareItmName->text()))
|
|
|
|
+ {
|
|
|
|
+ setWarn(ui->lineEdit_compareItmName, true);
|
|
|
|
+ TipWidget::display(TipWidget::OPERATOR_WARN, "对比项名称已存在", this);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
compareItemInfo.strName = ui->lineEdit_compareItmName->text();
|
|
compareItemInfo.strName = ui->lineEdit_compareItmName->text();
|
|
compareItemInfo.isEnable = ui->checkBox_enable->isChecked();
|
|
compareItemInfo.isEnable = ui->checkBox_enable->isChecked();
|
|
@@ -392,32 +431,6 @@ bool CompareItemDialog::getCompareItemBaseInfo(CompareItemInfo_t& compareItemInf
|
|
bool CompareItemDialog::getCompareRoadInfo(CompareItemInfo_t& compareItemInfo)
|
|
bool CompareItemDialog::getCompareRoadInfo(CompareItemInfo_t& compareItemInfo)
|
|
{
|
|
{
|
|
compareItemInfo.mapRoad.clear();
|
|
compareItemInfo.mapRoad.clear();
|
|
- /* 获取主通道信息 */
|
|
|
|
- CompareItemRoadInfo_t mainRoadInfo;
|
|
|
|
- mainRoadInfo.strCompareRoadName = ui->widget_mainRoad->getRoadName();
|
|
|
|
- mainRoadInfo.nCompareRoadNum = ui->widget_mainRoad->getIndex();
|
|
|
|
- mainRoadInfo.isEnableRecord = ui->widget_mainRoad->isRecordEnabled();
|
|
|
|
- mainRoadInfo.scRoadInfo = ui->widget_mainRoad->getSoundCardRoadInfo();
|
|
|
|
- if(mainRoadInfo.strCompareRoadName.isEmpty())
|
|
|
|
- {
|
|
|
|
- ui->widget_mainRoad->setRoadNameWarn(true);
|
|
|
|
- TipWidget::display(TipWidget::OPERATOR_WARN, "主通道名称不能为空", this);
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- compareItemInfo.mapRoad.insert(mainRoadInfo.nCompareRoadNum, mainRoadInfo);
|
|
|
|
- /* 获取第二通道信息 */
|
|
|
|
- CompareItemRoadInfo_t secondRoadInfo;
|
|
|
|
- secondRoadInfo.strCompareRoadName = ui->widget_secondRoad->getRoadName();
|
|
|
|
- secondRoadInfo.nCompareRoadNum = ui->widget_secondRoad->getIndex();
|
|
|
|
- secondRoadInfo.isEnableRecord = ui->widget_secondRoad->isRecordEnabled();
|
|
|
|
- secondRoadInfo.scRoadInfo = ui->widget_secondRoad->getSoundCardRoadInfo();
|
|
|
|
- if(secondRoadInfo.strCompareRoadName.isEmpty())
|
|
|
|
- {
|
|
|
|
- ui->widget_secondRoad->setRoadNameWarn(true);
|
|
|
|
- TipWidget::display(TipWidget::OPERATOR_WARN, "第二通道名称不能为空", this);
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- compareItemInfo.mapRoad.insert(secondRoadInfo.nCompareRoadNum, secondRoadInfo);
|
|
|
|
|
|
|
|
/* 获取其他通道信息 */
|
|
/* 获取其他通道信息 */
|
|
for(SingleCompareRoadWidget* roadWgt : m_listOtherRoadWgt)
|
|
for(SingleCompareRoadWidget* roadWgt : m_listOtherRoadWgt)
|
|
@@ -436,29 +449,128 @@ bool CompareItemDialog::getCompareRoadInfo(CompareItemInfo_t& compareItemInfo)
|
|
compareItemInfo.mapRoad.insert(otherRoadInfo.nCompareRoadNum, otherRoadInfo);
|
|
compareItemInfo.mapRoad.insert(otherRoadInfo.nCompareRoadNum, otherRoadInfo);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* 判断通道名称是否重复 */
|
|
|
|
+ bool isDuplicate = false;
|
|
|
|
+ for(auto& widget1 : m_listOtherRoadWgt)
|
|
|
|
+ {
|
|
|
|
+ for(auto& widget2 : m_listOtherRoadWgt)
|
|
|
|
+ {
|
|
|
|
+ if(widget1 == widget2)
|
|
|
|
+ {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if(widget1->getRoadName() == widget2->getRoadName())
|
|
|
|
+ {
|
|
|
|
+ isDuplicate = true;
|
|
|
|
+ widget1->setRoadNameWarn(true);
|
|
|
|
+ widget2->setRoadNameWarn(true);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(isDuplicate)
|
|
|
|
+ {
|
|
|
|
+ TipWidget::display(TipWidget::OPERATOR_WARN, QString("通道名称重复"), this);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
/* 获取音频检测信息 */
|
|
/* 获取音频检测信息 */
|
|
bool CompareItemDialog::getAudioDetectInfo(CompareItemInfo_t& compareItemInfo)
|
|
bool CompareItemDialog::getAudioDetectInfo(CompareItemInfo_t& compareItemInfo)
|
|
{
|
|
{
|
|
|
|
+ int silenceThreshold = ui->lineEditMuteThreshold->text().toULongLong();
|
|
|
|
+ int silenceDuration = ui->lineEditMuteLen->text().toInt();
|
|
|
|
+ int silenceSensitivity = ui->lineEditMuteSensibility->text().toInt();
|
|
|
|
+
|
|
|
|
+ int overloadThreshold = ui->lineEditOverloadThreshold->text().toULongLong();
|
|
|
|
+ int overloadDuration = ui->lineEditOverloadLen->text().toInt();
|
|
|
|
+ int overloadSensitivity = ui->lineEditOverloadSensibility->text().toInt();
|
|
|
|
+
|
|
|
|
+ double phaseThreshold = ui->lineEditPhaseThreshold->text().toDouble();
|
|
|
|
+ int phaseDuration = ui->lineEditPhaseLen->text().toInt();
|
|
|
|
+ int phaseSensitivity = ui->lineEditPhaseSensibility->text().toInt();
|
|
|
|
+
|
|
|
|
+ /* 检测是否在范围内 */
|
|
|
|
+ bool isOverThreshold = false;
|
|
|
|
+
|
|
|
|
+ /* 检查静音参数 */
|
|
|
|
+ if(silenceThreshold < m_silenceThresholdLow || silenceThreshold > m_silenceThresholdHigh)
|
|
|
|
+ {
|
|
|
|
+ setWarn(ui->lineEditMuteThreshold, true);
|
|
|
|
+ isOverThreshold = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(silenceDuration < m_silenceDurationLow || silenceDuration > m_silenceDurationHigh)
|
|
|
|
+ {
|
|
|
|
+ setWarn(ui->lineEditMuteLen, true);
|
|
|
|
+ isOverThreshold = true;
|
|
|
|
+ }
|
|
|
|
+ if(silenceSensitivity < m_silenceSensitivityLow || silenceSensitivity > m_silenceSensitivityHigh)
|
|
|
|
+ {
|
|
|
|
+ setWarn(ui->lineEditMuteSensibility, true);
|
|
|
|
+ isOverThreshold = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /* 检查过载参数 */
|
|
|
|
+ if(overloadThreshold < m_overloadThresholdLow || overloadThreshold > m_overloadThresholdHigh)
|
|
|
|
+ {
|
|
|
|
+ setWarn(ui->lineEditOverloadThreshold, true);
|
|
|
|
+ isOverThreshold = true;
|
|
|
|
+ }
|
|
|
|
+ if(overloadDuration < m_overloadDurationLow || overloadDuration > m_overloadDurationHigh)
|
|
|
|
+ {
|
|
|
|
+ setWarn(ui->lineEditOverloadLen, true);
|
|
|
|
+ isOverThreshold = true;
|
|
|
|
+ }
|
|
|
|
+ if(overloadSensitivity < m_overloadSensitivityLow || overloadSensitivity > m_overloadSensitivityHigh)
|
|
|
|
+ {
|
|
|
|
+ setWarn(ui->lineEditOverloadSensibility, true);
|
|
|
|
+ isOverThreshold = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /* 检查反向参数 */
|
|
|
|
+ if(phaseThreshold < m_phaseThresholdLow || phaseThreshold > m_phaseThresholdHigh)
|
|
|
|
+ {
|
|
|
|
+ setWarn(ui->lineEditPhaseThreshold, true);
|
|
|
|
+ isOverThreshold = true;
|
|
|
|
+ }
|
|
|
|
+ if(phaseDuration < m_phaseDurationLow || phaseDuration > m_phaseDurationHigh)
|
|
|
|
+ {
|
|
|
|
+ setWarn(ui->lineEditPhaseLen, true);
|
|
|
|
+ isOverThreshold = true;
|
|
|
|
+ }
|
|
|
|
+ if(phaseSensitivity < m_phaseSensitivityLow || phaseSensitivity > m_phaseSensitivityHigh)
|
|
|
|
+ {
|
|
|
|
+ setWarn(ui->lineEditPhaseSensibility, true);
|
|
|
|
+ isOverThreshold = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(isOverThreshold)
|
|
|
|
+ {
|
|
|
|
+ TipWidget::display(TipWidget::OPERATOR_WARN, QString("检测参数超出范围"), this);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
/* 静音检测,注意阈值是负数,在输入框中是正数,这里需要转换一下 */
|
|
/* 静音检测,注意阈值是负数,在输入框中是正数,这里需要转换一下 */
|
|
compareItemInfo.paramMute.isEnable = ui->checkBoxMute->isChecked();
|
|
compareItemInfo.paramMute.isEnable = ui->checkBoxMute->isChecked();
|
|
- compareItemInfo.paramMute.threshold.nThreshold = -ui->lineEditMuteThreshold->text().toULongLong();
|
|
|
|
- compareItemInfo.paramMute.nLen = ui->lineEditMuteLen->text().toInt();
|
|
|
|
- compareItemInfo.paramMute.nSensitivity = ui->lineEditMuteSensibility->text().toInt();
|
|
|
|
|
|
+ compareItemInfo.paramMute.threshold.nThreshold = -silenceThreshold;
|
|
|
|
+ compareItemInfo.paramMute.nLen = silenceDuration;
|
|
|
|
+ compareItemInfo.paramMute.nSensitivity = silenceSensitivity;
|
|
|
|
|
|
/* 过载检测 */
|
|
/* 过载检测 */
|
|
compareItemInfo.paramOverload.isEnable = ui->checkBoxOverload->isChecked();
|
|
compareItemInfo.paramOverload.isEnable = ui->checkBoxOverload->isChecked();
|
|
- compareItemInfo.paramOverload.threshold.nThreshold = -ui->lineEditOverloadThreshold->text().toULongLong();
|
|
|
|
- compareItemInfo.paramOverload.nLen = ui->lineEditOverloadLen->text().toInt();
|
|
|
|
- compareItemInfo.paramOverload.nSensitivity = ui->lineEditOverloadSensibility->text().toInt();
|
|
|
|
|
|
+ compareItemInfo.paramOverload.threshold.nThreshold = -overloadThreshold;
|
|
|
|
+ compareItemInfo.paramOverload.nLen = overloadDuration;
|
|
|
|
+ compareItemInfo.paramOverload.nSensitivity = overloadSensitivity;
|
|
|
|
|
|
/* 反相检测 */
|
|
/* 反相检测 */
|
|
compareItemInfo.paramPhase.isEnable = ui->checkBoxPhase->isChecked();
|
|
compareItemInfo.paramPhase.isEnable = ui->checkBoxPhase->isChecked();
|
|
- compareItemInfo.paramPhase.threshold.dThreshold = -ui->lineEditPhaseThreshold->text().toDouble();
|
|
|
|
- compareItemInfo.paramPhase.nLen = ui->lineEditPhaseLen->text().toInt();
|
|
|
|
- compareItemInfo.paramPhase.nSensitivity = ui->lineEditPhaseSensibility->text().toInt();
|
|
|
|
|
|
+ compareItemInfo.paramPhase.threshold.dThreshold = -phaseThreshold;
|
|
|
|
+ compareItemInfo.paramPhase.nLen = phaseDuration;
|
|
|
|
+ compareItemInfo.paramPhase.nSensitivity = phaseSensitivity;
|
|
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -467,12 +579,23 @@ bool CompareItemDialog::getAudioDetectInfo(CompareItemInfo_t& compareItemInfo)
|
|
void CompareItemDialog::cancelAllWarn()
|
|
void CompareItemDialog::cancelAllWarn()
|
|
{
|
|
{
|
|
setWarn(ui->lineEdit_compareItmName, false);
|
|
setWarn(ui->lineEdit_compareItmName, false);
|
|
- ui->widget_mainRoad->setRoadNameWarn(false);
|
|
|
|
- ui->widget_secondRoad->setRoadNameWarn(false);
|
|
|
|
for(SingleCompareRoadWidget* roadWgt : m_listOtherRoadWgt)
|
|
for(SingleCompareRoadWidget* roadWgt : m_listOtherRoadWgt)
|
|
{
|
|
{
|
|
roadWgt->setRoadNameWarn(false);
|
|
roadWgt->setRoadNameWarn(false);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /* 取消检测参数的报警红框 */
|
|
|
|
+ setWarn(ui->lineEditMuteThreshold, false);
|
|
|
|
+ setWarn(ui->lineEditMuteLen, false);
|
|
|
|
+ setWarn(ui->lineEditMuteSensibility, false);
|
|
|
|
+
|
|
|
|
+ setWarn(ui->lineEditOverloadThreshold, false);
|
|
|
|
+ setWarn(ui->lineEditOverloadLen, false);
|
|
|
|
+ setWarn(ui->lineEditOverloadSensibility, false);
|
|
|
|
+
|
|
|
|
+ setWarn(ui->lineEditPhaseThreshold, false);
|
|
|
|
+ setWarn(ui->lineEditPhaseLen, false);
|
|
|
|
+ setWarn(ui->lineEditPhaseSensibility, false);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|