This commit is contained in:
tangchao0503
2026-03-18 15:56:06 +08:00
parent 06dffddfd0
commit b23aedc6c7
10 changed files with 164 additions and 41 deletions

View File

@ -232,20 +232,44 @@ void TwoMotorControl::display_motors_connectivity(std::vector<int> connectivity)
//std::cout << "-----------------------------------"<<connectivity.size()<< std::endl;
if (connectivity[0])
{
this->ui.xMotorStateLabel->setStyleSheet("QLabel{background-color:rgb(0,255,0);}");
this->ui.xMotorStateLabel->setStyleSheet(R"(
QLabel
{
background-color: #08FACE;
border-radius: 4px;
}
)");
}
else
{
this->ui.xMotorStateLabel->setStyleSheet("QLabel{background-color:rgb(255,0,0);}");
this->ui.xMotorStateLabel->setStyleSheet(R"(
QLabel
{
background-color: red;
border-radius: 4px;
}
)");
}
if (connectivity[1])
{
this->ui.yMotorStateLabel->setStyleSheet("QLabel{background-color:rgb(0,255,0);}");
this->ui.yMotorStateLabel->setStyleSheet(R"(
QLabel
{
background-color: #08FACE;
border-radius: 4px;
}
)");
}
else
{
this->ui.yMotorStateLabel->setStyleSheet("QLabel{background-color:rgb(255,0,0);}");
this->ui.yMotorStateLabel->setStyleSheet(R"(
QLabel
{
background-color: red;
border-radius: 4px;
}
)");
}
}
@ -440,7 +464,7 @@ void TwoMotorControl::onSaveRecordLine2File_btn()
fclose(RecordLineFileHandle);
delete[] data;
QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("保存成功!"));
//QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("保存成功!"));
}
void TwoMotorControl::onReadRecordLineFile_btn()
@ -499,5 +523,5 @@ void TwoMotorControl::onReadRecordLineFile_btn()
fclose(RecordLineFileHandle);
delete[] data;
QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("读取成功!"));
//QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("读取成功!"));
}