fix(media): fix backboard camera display and mdns connection."
This commit is contained in:
@@ -1756,6 +1756,34 @@ void MainWidget::saveStatusListToFile(const QString& filePath)
|
||||
file.close();
|
||||
}
|
||||
|
||||
void MainWidget::saveDeviceInfoToFile(const QString& filePath, const QString& info)
|
||||
{
|
||||
QString actualFilePath = filePath;
|
||||
if (actualFilePath.isEmpty()) {
|
||||
QString defaultDirPath = QDir::currentPath() + "/TestLog";
|
||||
QDir dir(defaultDirPath);
|
||||
if (!dir.exists()) {
|
||||
if (!dir.mkpath(defaultDirPath)) {
|
||||
qWarning() << "Failed to create directory:" << defaultDirPath;
|
||||
return;
|
||||
}
|
||||
}
|
||||
//QString currentTime = QDateTime::currentDateTime().toString("yyyyMMdd_HHmmss");
|
||||
QString currentTime = QDateTime::currentDateTime().toString("yyyyMMdd");
|
||||
actualFilePath = defaultDirPath + "/device_info_" + currentTime + ".txt";
|
||||
}
|
||||
|
||||
QFile file(actualFilePath);
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
qWarning() << "Failed to open file:" << actualFilePath;
|
||||
return;
|
||||
}
|
||||
|
||||
QTextStream out(&file);
|
||||
out << info;
|
||||
file.close();
|
||||
}
|
||||
|
||||
void MainWidget::onCheckSerialRecvStatus() {
|
||||
|
||||
}
|
||||
@@ -2087,6 +2115,7 @@ void MainWidget::onUuidButtonClicked()
|
||||
UuidHwInfoEdit->setPlainText(displayText);
|
||||
qDebug() << "HTTP Server backBoardUuid is:" << backBoardUuid;
|
||||
qDebug() << "HTTP Server backBoardSn is:" << backBoardSn;
|
||||
saveDeviceInfoToFile(filePathLineEdit->text(), QString("MAC:") + cur_mac_addr + displayText);
|
||||
isRequestSuccessful = 0;
|
||||
return;
|
||||
}
|
||||
@@ -2412,7 +2441,7 @@ void MainWidget::onOpenFocusWindowClicked()
|
||||
QPushButton* button = qobject_cast<QPushButton*>(sender());
|
||||
if (button) {
|
||||
int itemIndex = button->property("getVideoIndex").toInt();
|
||||
qDebug() << "New Button clicked with itemIndex:" << itemIndex;
|
||||
qDebug() << "New Button clicked with itemIndex:" << itemIndex << " bord_id: " << isBackBoardOrAllBoard;
|
||||
if (itemIndex == FOCUS_WINDOWS_BUTTON) {
|
||||
if (isBackBoardOrAllBoard) {
|
||||
for (ClientHandler* handler : clients) {
|
||||
@@ -2652,14 +2681,18 @@ void MainWidget::onSendBackItemClicked()
|
||||
{
|
||||
qDebug() << "onSendBackItemClicked";
|
||||
if (connectedClientsCount) {
|
||||
qDebug() << "onSendBackItemClicked -- start 000";
|
||||
if (isBackBoardOrAllBoard == 0) {
|
||||
onHandleInvalidOperate("当前连接的是前板,请勿操作后板或整机页面的按键!!!");
|
||||
return;
|
||||
}
|
||||
qDebug() << "onSendBackItemClicked -- start 111";
|
||||
QPushButton* button = qobject_cast<QPushButton*>(sender());
|
||||
int itemIndex = button->property("backBoardTest").toInt();
|
||||
for (ClientHandler* handler : clients) {
|
||||
qDebug() << "onSendBackItemClicked -- start 222";
|
||||
if (isReplyOrTimeout && ((isBackBoardOrAllBoard) || (handler->getClientId() == handler->controlClientId))) {
|
||||
qDebug() << "onSendBackItemClicked -- start 333";
|
||||
handler->sendBackItem(itemIndex);
|
||||
isReplyOrTimeout = false;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user