修改转速警报延时小数问题
This commit is contained in:
parent
5c9a3f0bc5
commit
033bb1c02d
@ -1087,12 +1087,12 @@ void ConfigMgr::Load(QString filename) {
|
|||||||
QJsonObject alarm = channel["alarm"].toObject();
|
QJsonObject alarm = channel["alarm"].toObject();
|
||||||
speed_data->danger_high[j].level = alarm["danger_high_level"].toDouble();
|
speed_data->danger_high[j].level = alarm["danger_high_level"].toDouble();
|
||||||
speed_data->danger_high[j].hysteresis = alarm["danger_high_hysteresis"].toDouble();
|
speed_data->danger_high[j].hysteresis = alarm["danger_high_hysteresis"].toDouble();
|
||||||
speed_data->danger_high[j].delay = alarm["danger_high_delay"].toInt();
|
speed_data->danger_high[j].delay = alarm["danger_high_delay"].toDouble();
|
||||||
speed_data->danger_high[j].enable = alarm["danger_high_enable"].toBool();
|
speed_data->danger_high[j].enable = alarm["danger_high_enable"].toBool();
|
||||||
speed_data->danger_high[j].latch = alarm["danger_high_latch"].toBool();
|
speed_data->danger_high[j].latch = alarm["danger_high_latch"].toBool();
|
||||||
speed_data->alert_high[j].level = alarm["alert_high_level"].toDouble();
|
speed_data->alert_high[j].level = alarm["alert_high_level"].toDouble();
|
||||||
speed_data->alert_high[j].hysteresis = alarm["alert_high_hysteresis"].toDouble();
|
speed_data->alert_high[j].hysteresis = alarm["alert_high_hysteresis"].toDouble();
|
||||||
speed_data->alert_high[j].delay = alarm["alert_high_delay"].toInt();
|
speed_data->alert_high[j].delay = alarm["alert_high_delay"].toDouble();
|
||||||
speed_data->alert_high[j].enable = alarm["alert_high_enable"].toBool();
|
speed_data->alert_high[j].enable = alarm["alert_high_enable"].toBool();
|
||||||
speed_data->alert_high[j].latch = alarm["alert_high_latch"].toBool();
|
speed_data->alert_high[j].latch = alarm["alert_high_latch"].toBool();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -240,6 +240,8 @@ void MainWindow::createMenu(const QString &rootTitle, QPushButton *parent) {
|
|||||||
QAction *get_sub_card_voltage = mainMenu->addAction("获取电压范围");
|
QAction *get_sub_card_voltage = mainMenu->addAction("获取电压范围");
|
||||||
QAction *get_vib_version = mainMenu->addAction("获取振动板卡辅助程序版本");
|
QAction *get_vib_version = mainMenu->addAction("获取振动板卡辅助程序版本");
|
||||||
QAction *get_card_processID = mainMenu->addAction("获取进程号");
|
QAction *get_card_processID = mainMenu->addAction("获取进程号");
|
||||||
|
mainMenu->addSeparator();
|
||||||
|
QAction *vib_relay = mainMenu->addAction("继电器配置");
|
||||||
|
|
||||||
// 绑定 **鼠标事件过滤器**,确保只响应右键
|
// 绑定 **鼠标事件过滤器**,确保只响应右键
|
||||||
// 设置右键菜单策略
|
// 设置右键菜单策略
|
||||||
@ -271,6 +273,7 @@ void MainWindow::createMenu(const QString &rootTitle, QPushButton *parent) {
|
|||||||
QObject::connect(copy_sub_card, &QAction::triggered, this, &MainWindow::onMenuActionTriggered);
|
QObject::connect(copy_sub_card, &QAction::triggered, this, &MainWindow::onMenuActionTriggered);
|
||||||
QObject::connect(move_sub_card, &QAction::triggered, this, &MainWindow::onMenuActionTriggered);
|
QObject::connect(move_sub_card, &QAction::triggered, this, &MainWindow::onMenuActionTriggered);
|
||||||
QObject::connect(high_speed_current, &QAction::triggered, this, &MainWindow::onMenuActionTriggered);
|
QObject::connect(high_speed_current, &QAction::triggered, this, &MainWindow::onMenuActionTriggered);
|
||||||
|
QObject::connect(vib_relay, &QAction::triggered, this, &MainWindow::onMenuActionTriggered);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::createMenuSet(const QString &rootTitle, QPushButton *parent) {
|
void MainWindow::createMenuSet(const QString &rootTitle, QPushButton *parent) {
|
||||||
@ -467,8 +470,8 @@ void MainWindow::onMenuActionTriggered() {
|
|||||||
GetCardProcessID(button_id);
|
GetCardProcessID(button_id);
|
||||||
}else if(action->text() == "复制板卡配置"){
|
}else if(action->text() == "复制板卡配置"){
|
||||||
CopySubCard(button_id);
|
CopySubCard(button_id);
|
||||||
}else if(action->text() == "移动板卡配置"){
|
}else if(action->text() == "继电器配置"){
|
||||||
MoveSubCard(button_id);
|
VibRealy(button_id);
|
||||||
}
|
}
|
||||||
break; // 找到按钮后,跳出循环
|
break; // 找到按钮后,跳出循环
|
||||||
}
|
}
|
||||||
@ -1117,6 +1120,18 @@ void MainWindow::MoveSubCard(int slot){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void MainWindow::VibRealy(int slot){
|
||||||
|
slot_no = slot;
|
||||||
|
std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no);
|
||||||
|
if(base_ptr != nullptr){
|
||||||
|
QMessageBox::warning(this, QStringLiteral("警告"), QStringLiteral("当前板卡为空板卡!"));
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
if(base_ptr->card_type_ != kCardVibSingle){
|
||||||
|
QMessageBox::warning(this, QStringLiteral("警告"), QStringLiteral("请选择振动板卡进行配置!"));
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
}
|
||||||
void MainWindow::readData(const QByteArray &data) {
|
void MainWindow::readData(const QByteArray &data) {
|
||||||
qDebug() << "Received from server:" << data;
|
qDebug() << "Received from server:" << data;
|
||||||
|
|
||||||
|
|||||||
@ -68,6 +68,7 @@ private:
|
|||||||
void GetCardProcessID(int slot);
|
void GetCardProcessID(int slot);
|
||||||
void CopySubCard(int slot);
|
void CopySubCard(int slot);
|
||||||
void MoveSubCard(int slot);
|
void MoveSubCard(int slot);
|
||||||
|
void VibRealy(int slot);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user