diff --git a/ChannelCharts.cpp b/ChannelCharts.cpp index 2b905a3..eb9a2f4 100644 --- a/ChannelCharts.cpp +++ b/ChannelCharts.cpp @@ -40,7 +40,10 @@ QCPGraph * graph = ui->dataPlot->addGraph(); graph->setName("时差(ns)"); graph->setAdaptiveSampling(true); // 默认启用自适应采样(绘图) - graph->setPen(QPen(QColor(0, 168, 140))); + QPen pen; + pen.setColor(QColor("#2ed573")); + pen.setWidth(2);//线宽 + graph->setPen(pen); // 时间坐标轴 seconds since Epoch (January 1, 1970, 00:00 UTC). QSharedPointer timeTicker(new QCPAxisTickerDateTime); @@ -120,8 +123,8 @@ graph->setName("阿伦方差"); graph->setAdaptiveSampling(true); // 默认启用自适应采样(绘图) QPen pen; - pen.setColor(QColor(0, 168, 140)); - pen.setWidth(3);//线宽 + pen.setColor(QColor("#2ed573")); + pen.setWidth(2);//线宽 graph->setPen(pen); QLinearGradient gradient(0, 0, 0, 400); diff --git a/ChannelCharts.cpp b/ChannelCharts.cpp index 2b905a3..eb9a2f4 100644 --- a/ChannelCharts.cpp +++ b/ChannelCharts.cpp @@ -40,7 +40,10 @@ QCPGraph * graph = ui->dataPlot->addGraph(); graph->setName("时差(ns)"); graph->setAdaptiveSampling(true); // 默认启用自适应采样(绘图) - graph->setPen(QPen(QColor(0, 168, 140))); + QPen pen; + pen.setColor(QColor("#2ed573")); + pen.setWidth(2);//线宽 + graph->setPen(pen); // 时间坐标轴 seconds since Epoch (January 1, 1970, 00:00 UTC). QSharedPointer timeTicker(new QCPAxisTickerDateTime); @@ -120,8 +123,8 @@ graph->setName("阿伦方差"); graph->setAdaptiveSampling(true); // 默认启用自适应采样(绘图) QPen pen; - pen.setColor(QColor(0, 168, 140)); - pen.setWidth(3);//线宽 + pen.setColor(QColor("#2ed573")); + pen.setWidth(2);//线宽 graph->setPen(pen); QLinearGradient gradient(0, 0, 0, 400); diff --git a/DataProcessAlgorithm.cpp b/DataProcessAlgorithm.cpp index 2b16bf7..0364a76 100644 --- a/DataProcessAlgorithm.cpp +++ b/DataProcessAlgorithm.cpp @@ -27,5 +27,6 @@ allan[0] = sum/(2*tau_2*(aN-2*d)); //delta的平方 allan[1] = sqrt(sum/(2*tau_2*(aN-2*d))); //delta + delete[] y; return allan[1]; } diff --git a/ChannelCharts.cpp b/ChannelCharts.cpp index 2b905a3..eb9a2f4 100644 --- a/ChannelCharts.cpp +++ b/ChannelCharts.cpp @@ -40,7 +40,10 @@ QCPGraph * graph = ui->dataPlot->addGraph(); graph->setName("时差(ns)"); graph->setAdaptiveSampling(true); // 默认启用自适应采样(绘图) - graph->setPen(QPen(QColor(0, 168, 140))); + QPen pen; + pen.setColor(QColor("#2ed573")); + pen.setWidth(2);//线宽 + graph->setPen(pen); // 时间坐标轴 seconds since Epoch (January 1, 1970, 00:00 UTC). QSharedPointer timeTicker(new QCPAxisTickerDateTime); @@ -120,8 +123,8 @@ graph->setName("阿伦方差"); graph->setAdaptiveSampling(true); // 默认启用自适应采样(绘图) QPen pen; - pen.setColor(QColor(0, 168, 140)); - pen.setWidth(3);//线宽 + pen.setColor(QColor("#2ed573")); + pen.setWidth(2);//线宽 graph->setPen(pen); QLinearGradient gradient(0, 0, 0, 400); diff --git a/DataProcessAlgorithm.cpp b/DataProcessAlgorithm.cpp index 2b16bf7..0364a76 100644 --- a/DataProcessAlgorithm.cpp +++ b/DataProcessAlgorithm.cpp @@ -27,5 +27,6 @@ allan[0] = sum/(2*tau_2*(aN-2*d)); //delta的平方 allan[1] = sqrt(sum/(2*tau_2*(aN-2*d))); //delta + delete[] y; return allan[1]; } diff --git a/PhaseDevice.cpp b/PhaseDevice.cpp index fa8ebd7..76678f0 100644 --- a/PhaseDevice.cpp +++ b/PhaseDevice.cpp @@ -36,18 +36,45 @@ { QString startCmd = PhaseProtocolBM::startMessure(); clientUtil->sendData(startCmd.toLocal8Bit()); + + // 2. 输出到日志文件中 + QDateTime now = QDateTime::currentDateTime(); + QString date = now.toString("yyyy-MM-dd"); + + // 2.1 原始字节数组数据 + QString filename = "netBytes.log"; + QString content = now.toString("yyyy-MM-dd HH:mm:ss.zzz") + " [send] " + startCmd; + QLogUtil::writeRawDataLogByDate(date, filename, content); } void PhaseDevice::stopWork() { QString stopCmd = PhaseProtocolBM::stopMessure(); clientUtil->sendData(stopCmd.toLocal8Bit()); + + // 2. 输出到日志文件中 + QDateTime now = QDateTime::currentDateTime(); + QString date = now.toString("yyyy-MM-dd"); + + // 2.1 原始字节数组数据 + QString filename = "netBytes.log"; + QString content = now.toString("yyyy-MM-dd HH:mm:ss.zzz") + " [send] " + stopCmd; + QLogUtil::writeRawDataLogByDate(date, filename, content); } void PhaseDevice::dataReceivedHandler(QByteArray data) { this->dataBuff.append(data); + // 2. 输出到日志文件中 + QDateTime now = QDateTime::currentDateTime(); + QString date = now.toString("yyyy-MM-dd"); + + // 2.1 原始字节数组数据 + QString filename = "netBytes.log"; + QString content = now.toString("yyyy-MM-dd HH:mm:ss.zzz") + " [recv] " + QByteUtil::binToHexString(data); + QLogUtil::writeRawDataLogByDate(date, filename, content); + PhaseDataDto * phaseData = new PhaseDataDto(this); if (PhaseProtocolBM::checkFrame(this->dataBuff) == true) { @@ -104,14 +131,18 @@ // 3.2 将通道数据写日志 QString chFilename = QString("CH_%1.log").arg(i + 1, 2, 10, QLatin1Char('0')); - QString channelDataStr = QString("%1 [%2] %3 %4 %5") - .arg(phaseData->timestamp) - .arg(phaseData->frameId) - .arg(phaseData->channelDataStr.at(i)) - .arg(QString::number(channelDelay)) - .arg(QString::number(phaseData->rawPhaseDiffData.at(i), 'f', 0)); +// QString channelDataStr = QString("%1 [%2] %3 %4 %5") +// .arg(phaseData->timestamp) +// .arg(phaseData->frameId) +// .arg(phaseData->channelDataStr.at(i)) +// .arg(QString::number(channelDelay)) +// .arg(QString::number(phaseData->rawPhaseDiffData.at(i), 'f', 0)); // std::cout << channelDataStr.toStdString() << std::endl; + QString channelDataStr = QString("%1 %2") + .arg(phaseData->timestamp) + .arg(QString::number(phaseData->channelBeforeDelay.at(i), 'e', 6)); + QLogUtil::writeChannelDataLogByDate(phaseData->timestamp.mid(0, 10), chFilename, channelDataStr); // 3.3 将补偿前的时差数据存入数据栈, 用于计算allen方差 @@ -154,6 +185,7 @@ for (int i = 1; i <= 16; i++) { int value = base + qrand() % 40; + base = value; buffer.append(QByteUtil::hexStringToBytes("00800000")).append(QByteUtil::ULongToBytes(value, 4)); } diff --git a/ChannelCharts.cpp b/ChannelCharts.cpp index 2b905a3..eb9a2f4 100644 --- a/ChannelCharts.cpp +++ b/ChannelCharts.cpp @@ -40,7 +40,10 @@ QCPGraph * graph = ui->dataPlot->addGraph(); graph->setName("时差(ns)"); graph->setAdaptiveSampling(true); // 默认启用自适应采样(绘图) - graph->setPen(QPen(QColor(0, 168, 140))); + QPen pen; + pen.setColor(QColor("#2ed573")); + pen.setWidth(2);//线宽 + graph->setPen(pen); // 时间坐标轴 seconds since Epoch (January 1, 1970, 00:00 UTC). QSharedPointer timeTicker(new QCPAxisTickerDateTime); @@ -120,8 +123,8 @@ graph->setName("阿伦方差"); graph->setAdaptiveSampling(true); // 默认启用自适应采样(绘图) QPen pen; - pen.setColor(QColor(0, 168, 140)); - pen.setWidth(3);//线宽 + pen.setColor(QColor("#2ed573")); + pen.setWidth(2);//线宽 graph->setPen(pen); QLinearGradient gradient(0, 0, 0, 400); diff --git a/DataProcessAlgorithm.cpp b/DataProcessAlgorithm.cpp index 2b16bf7..0364a76 100644 --- a/DataProcessAlgorithm.cpp +++ b/DataProcessAlgorithm.cpp @@ -27,5 +27,6 @@ allan[0] = sum/(2*tau_2*(aN-2*d)); //delta的平方 allan[1] = sqrt(sum/(2*tau_2*(aN-2*d))); //delta + delete[] y; return allan[1]; } diff --git a/PhaseDevice.cpp b/PhaseDevice.cpp index fa8ebd7..76678f0 100644 --- a/PhaseDevice.cpp +++ b/PhaseDevice.cpp @@ -36,18 +36,45 @@ { QString startCmd = PhaseProtocolBM::startMessure(); clientUtil->sendData(startCmd.toLocal8Bit()); + + // 2. 输出到日志文件中 + QDateTime now = QDateTime::currentDateTime(); + QString date = now.toString("yyyy-MM-dd"); + + // 2.1 原始字节数组数据 + QString filename = "netBytes.log"; + QString content = now.toString("yyyy-MM-dd HH:mm:ss.zzz") + " [send] " + startCmd; + QLogUtil::writeRawDataLogByDate(date, filename, content); } void PhaseDevice::stopWork() { QString stopCmd = PhaseProtocolBM::stopMessure(); clientUtil->sendData(stopCmd.toLocal8Bit()); + + // 2. 输出到日志文件中 + QDateTime now = QDateTime::currentDateTime(); + QString date = now.toString("yyyy-MM-dd"); + + // 2.1 原始字节数组数据 + QString filename = "netBytes.log"; + QString content = now.toString("yyyy-MM-dd HH:mm:ss.zzz") + " [send] " + stopCmd; + QLogUtil::writeRawDataLogByDate(date, filename, content); } void PhaseDevice::dataReceivedHandler(QByteArray data) { this->dataBuff.append(data); + // 2. 输出到日志文件中 + QDateTime now = QDateTime::currentDateTime(); + QString date = now.toString("yyyy-MM-dd"); + + // 2.1 原始字节数组数据 + QString filename = "netBytes.log"; + QString content = now.toString("yyyy-MM-dd HH:mm:ss.zzz") + " [recv] " + QByteUtil::binToHexString(data); + QLogUtil::writeRawDataLogByDate(date, filename, content); + PhaseDataDto * phaseData = new PhaseDataDto(this); if (PhaseProtocolBM::checkFrame(this->dataBuff) == true) { @@ -104,14 +131,18 @@ // 3.2 将通道数据写日志 QString chFilename = QString("CH_%1.log").arg(i + 1, 2, 10, QLatin1Char('0')); - QString channelDataStr = QString("%1 [%2] %3 %4 %5") - .arg(phaseData->timestamp) - .arg(phaseData->frameId) - .arg(phaseData->channelDataStr.at(i)) - .arg(QString::number(channelDelay)) - .arg(QString::number(phaseData->rawPhaseDiffData.at(i), 'f', 0)); +// QString channelDataStr = QString("%1 [%2] %3 %4 %5") +// .arg(phaseData->timestamp) +// .arg(phaseData->frameId) +// .arg(phaseData->channelDataStr.at(i)) +// .arg(QString::number(channelDelay)) +// .arg(QString::number(phaseData->rawPhaseDiffData.at(i), 'f', 0)); // std::cout << channelDataStr.toStdString() << std::endl; + QString channelDataStr = QString("%1 %2") + .arg(phaseData->timestamp) + .arg(QString::number(phaseData->channelBeforeDelay.at(i), 'e', 6)); + QLogUtil::writeChannelDataLogByDate(phaseData->timestamp.mid(0, 10), chFilename, channelDataStr); // 3.3 将补偿前的时差数据存入数据栈, 用于计算allen方差 @@ -154,6 +185,7 @@ for (int i = 1; i <= 16; i++) { int value = base + qrand() % 40; + base = value; buffer.append(QByteUtil::hexStringToBytes("00800000")).append(QByteUtil::ULongToBytes(value, 4)); } diff --git a/PhaseWindow.cpp b/PhaseWindow.cpp index 976f1d5..59201e9 100644 --- a/PhaseWindow.cpp +++ b/PhaseWindow.cpp @@ -222,8 +222,10 @@ } void PhaseWindow::on_btnMenuClose_clicked() { - // 发送结束指令 - device->stopWork(); + if (running == true) { + // 发送结束指令 + device->stopWork(); + } QTimer::singleShot(500, qApp, SLOT(quit())); } @@ -241,9 +243,10 @@ void PhaseWindow::on_startButt_clicked() { + createFolder(); + // 发送开始指令 device->startWork(); - createFolder(); running = true; } diff --git a/ChannelCharts.cpp b/ChannelCharts.cpp index 2b905a3..eb9a2f4 100644 --- a/ChannelCharts.cpp +++ b/ChannelCharts.cpp @@ -40,7 +40,10 @@ QCPGraph * graph = ui->dataPlot->addGraph(); graph->setName("时差(ns)"); graph->setAdaptiveSampling(true); // 默认启用自适应采样(绘图) - graph->setPen(QPen(QColor(0, 168, 140))); + QPen pen; + pen.setColor(QColor("#2ed573")); + pen.setWidth(2);//线宽 + graph->setPen(pen); // 时间坐标轴 seconds since Epoch (January 1, 1970, 00:00 UTC). QSharedPointer timeTicker(new QCPAxisTickerDateTime); @@ -120,8 +123,8 @@ graph->setName("阿伦方差"); graph->setAdaptiveSampling(true); // 默认启用自适应采样(绘图) QPen pen; - pen.setColor(QColor(0, 168, 140)); - pen.setWidth(3);//线宽 + pen.setColor(QColor("#2ed573")); + pen.setWidth(2);//线宽 graph->setPen(pen); QLinearGradient gradient(0, 0, 0, 400); diff --git a/DataProcessAlgorithm.cpp b/DataProcessAlgorithm.cpp index 2b16bf7..0364a76 100644 --- a/DataProcessAlgorithm.cpp +++ b/DataProcessAlgorithm.cpp @@ -27,5 +27,6 @@ allan[0] = sum/(2*tau_2*(aN-2*d)); //delta的平方 allan[1] = sqrt(sum/(2*tau_2*(aN-2*d))); //delta + delete[] y; return allan[1]; } diff --git a/PhaseDevice.cpp b/PhaseDevice.cpp index fa8ebd7..76678f0 100644 --- a/PhaseDevice.cpp +++ b/PhaseDevice.cpp @@ -36,18 +36,45 @@ { QString startCmd = PhaseProtocolBM::startMessure(); clientUtil->sendData(startCmd.toLocal8Bit()); + + // 2. 输出到日志文件中 + QDateTime now = QDateTime::currentDateTime(); + QString date = now.toString("yyyy-MM-dd"); + + // 2.1 原始字节数组数据 + QString filename = "netBytes.log"; + QString content = now.toString("yyyy-MM-dd HH:mm:ss.zzz") + " [send] " + startCmd; + QLogUtil::writeRawDataLogByDate(date, filename, content); } void PhaseDevice::stopWork() { QString stopCmd = PhaseProtocolBM::stopMessure(); clientUtil->sendData(stopCmd.toLocal8Bit()); + + // 2. 输出到日志文件中 + QDateTime now = QDateTime::currentDateTime(); + QString date = now.toString("yyyy-MM-dd"); + + // 2.1 原始字节数组数据 + QString filename = "netBytes.log"; + QString content = now.toString("yyyy-MM-dd HH:mm:ss.zzz") + " [send] " + stopCmd; + QLogUtil::writeRawDataLogByDate(date, filename, content); } void PhaseDevice::dataReceivedHandler(QByteArray data) { this->dataBuff.append(data); + // 2. 输出到日志文件中 + QDateTime now = QDateTime::currentDateTime(); + QString date = now.toString("yyyy-MM-dd"); + + // 2.1 原始字节数组数据 + QString filename = "netBytes.log"; + QString content = now.toString("yyyy-MM-dd HH:mm:ss.zzz") + " [recv] " + QByteUtil::binToHexString(data); + QLogUtil::writeRawDataLogByDate(date, filename, content); + PhaseDataDto * phaseData = new PhaseDataDto(this); if (PhaseProtocolBM::checkFrame(this->dataBuff) == true) { @@ -104,14 +131,18 @@ // 3.2 将通道数据写日志 QString chFilename = QString("CH_%1.log").arg(i + 1, 2, 10, QLatin1Char('0')); - QString channelDataStr = QString("%1 [%2] %3 %4 %5") - .arg(phaseData->timestamp) - .arg(phaseData->frameId) - .arg(phaseData->channelDataStr.at(i)) - .arg(QString::number(channelDelay)) - .arg(QString::number(phaseData->rawPhaseDiffData.at(i), 'f', 0)); +// QString channelDataStr = QString("%1 [%2] %3 %4 %5") +// .arg(phaseData->timestamp) +// .arg(phaseData->frameId) +// .arg(phaseData->channelDataStr.at(i)) +// .arg(QString::number(channelDelay)) +// .arg(QString::number(phaseData->rawPhaseDiffData.at(i), 'f', 0)); // std::cout << channelDataStr.toStdString() << std::endl; + QString channelDataStr = QString("%1 %2") + .arg(phaseData->timestamp) + .arg(QString::number(phaseData->channelBeforeDelay.at(i), 'e', 6)); + QLogUtil::writeChannelDataLogByDate(phaseData->timestamp.mid(0, 10), chFilename, channelDataStr); // 3.3 将补偿前的时差数据存入数据栈, 用于计算allen方差 @@ -154,6 +185,7 @@ for (int i = 1; i <= 16; i++) { int value = base + qrand() % 40; + base = value; buffer.append(QByteUtil::hexStringToBytes("00800000")).append(QByteUtil::ULongToBytes(value, 4)); } diff --git a/PhaseWindow.cpp b/PhaseWindow.cpp index 976f1d5..59201e9 100644 --- a/PhaseWindow.cpp +++ b/PhaseWindow.cpp @@ -222,8 +222,10 @@ } void PhaseWindow::on_btnMenuClose_clicked() { - // 发送结束指令 - device->stopWork(); + if (running == true) { + // 发送结束指令 + device->stopWork(); + } QTimer::singleShot(500, qApp, SLOT(quit())); } @@ -241,9 +243,10 @@ void PhaseWindow::on_startButt_clicked() { + createFolder(); + // 发送开始指令 device->startWork(); - createFolder(); running = true; } diff --git a/SetConfig.cpp b/SetConfig.cpp index d9b6273..ff5edaf 100644 --- a/SetConfig.cpp +++ b/SetConfig.cpp @@ -6,6 +6,8 @@ #include #include +extern bool running; + SetConfig::SetConfig(QWidget *parent) : QDialog(parent), ui(new Ui::SetConfig) @@ -40,6 +42,13 @@ ui->devInput->setText(QString::number(SettingConfig::getInstance().DEVICE_PORT)); ui->listenInput->setText(QString::number(SettingConfig::getInstance().LISTEN_PORT)); ui->logInput->setText(SettingConfig::getInstance().BASE_LOG_PATH); + + if (running == true) + { + ui->logInput->setReadOnly(true); + } else { + ui->logInput->setReadOnly(false); + } } SetConfig::~SetConfig() { diff --git a/ChannelCharts.cpp b/ChannelCharts.cpp index 2b905a3..eb9a2f4 100644 --- a/ChannelCharts.cpp +++ b/ChannelCharts.cpp @@ -40,7 +40,10 @@ QCPGraph * graph = ui->dataPlot->addGraph(); graph->setName("时差(ns)"); graph->setAdaptiveSampling(true); // 默认启用自适应采样(绘图) - graph->setPen(QPen(QColor(0, 168, 140))); + QPen pen; + pen.setColor(QColor("#2ed573")); + pen.setWidth(2);//线宽 + graph->setPen(pen); // 时间坐标轴 seconds since Epoch (January 1, 1970, 00:00 UTC). QSharedPointer timeTicker(new QCPAxisTickerDateTime); @@ -120,8 +123,8 @@ graph->setName("阿伦方差"); graph->setAdaptiveSampling(true); // 默认启用自适应采样(绘图) QPen pen; - pen.setColor(QColor(0, 168, 140)); - pen.setWidth(3);//线宽 + pen.setColor(QColor("#2ed573")); + pen.setWidth(2);//线宽 graph->setPen(pen); QLinearGradient gradient(0, 0, 0, 400); diff --git a/DataProcessAlgorithm.cpp b/DataProcessAlgorithm.cpp index 2b16bf7..0364a76 100644 --- a/DataProcessAlgorithm.cpp +++ b/DataProcessAlgorithm.cpp @@ -27,5 +27,6 @@ allan[0] = sum/(2*tau_2*(aN-2*d)); //delta的平方 allan[1] = sqrt(sum/(2*tau_2*(aN-2*d))); //delta + delete[] y; return allan[1]; } diff --git a/PhaseDevice.cpp b/PhaseDevice.cpp index fa8ebd7..76678f0 100644 --- a/PhaseDevice.cpp +++ b/PhaseDevice.cpp @@ -36,18 +36,45 @@ { QString startCmd = PhaseProtocolBM::startMessure(); clientUtil->sendData(startCmd.toLocal8Bit()); + + // 2. 输出到日志文件中 + QDateTime now = QDateTime::currentDateTime(); + QString date = now.toString("yyyy-MM-dd"); + + // 2.1 原始字节数组数据 + QString filename = "netBytes.log"; + QString content = now.toString("yyyy-MM-dd HH:mm:ss.zzz") + " [send] " + startCmd; + QLogUtil::writeRawDataLogByDate(date, filename, content); } void PhaseDevice::stopWork() { QString stopCmd = PhaseProtocolBM::stopMessure(); clientUtil->sendData(stopCmd.toLocal8Bit()); + + // 2. 输出到日志文件中 + QDateTime now = QDateTime::currentDateTime(); + QString date = now.toString("yyyy-MM-dd"); + + // 2.1 原始字节数组数据 + QString filename = "netBytes.log"; + QString content = now.toString("yyyy-MM-dd HH:mm:ss.zzz") + " [send] " + stopCmd; + QLogUtil::writeRawDataLogByDate(date, filename, content); } void PhaseDevice::dataReceivedHandler(QByteArray data) { this->dataBuff.append(data); + // 2. 输出到日志文件中 + QDateTime now = QDateTime::currentDateTime(); + QString date = now.toString("yyyy-MM-dd"); + + // 2.1 原始字节数组数据 + QString filename = "netBytes.log"; + QString content = now.toString("yyyy-MM-dd HH:mm:ss.zzz") + " [recv] " + QByteUtil::binToHexString(data); + QLogUtil::writeRawDataLogByDate(date, filename, content); + PhaseDataDto * phaseData = new PhaseDataDto(this); if (PhaseProtocolBM::checkFrame(this->dataBuff) == true) { @@ -104,14 +131,18 @@ // 3.2 将通道数据写日志 QString chFilename = QString("CH_%1.log").arg(i + 1, 2, 10, QLatin1Char('0')); - QString channelDataStr = QString("%1 [%2] %3 %4 %5") - .arg(phaseData->timestamp) - .arg(phaseData->frameId) - .arg(phaseData->channelDataStr.at(i)) - .arg(QString::number(channelDelay)) - .arg(QString::number(phaseData->rawPhaseDiffData.at(i), 'f', 0)); +// QString channelDataStr = QString("%1 [%2] %3 %4 %5") +// .arg(phaseData->timestamp) +// .arg(phaseData->frameId) +// .arg(phaseData->channelDataStr.at(i)) +// .arg(QString::number(channelDelay)) +// .arg(QString::number(phaseData->rawPhaseDiffData.at(i), 'f', 0)); // std::cout << channelDataStr.toStdString() << std::endl; + QString channelDataStr = QString("%1 %2") + .arg(phaseData->timestamp) + .arg(QString::number(phaseData->channelBeforeDelay.at(i), 'e', 6)); + QLogUtil::writeChannelDataLogByDate(phaseData->timestamp.mid(0, 10), chFilename, channelDataStr); // 3.3 将补偿前的时差数据存入数据栈, 用于计算allen方差 @@ -154,6 +185,7 @@ for (int i = 1; i <= 16; i++) { int value = base + qrand() % 40; + base = value; buffer.append(QByteUtil::hexStringToBytes("00800000")).append(QByteUtil::ULongToBytes(value, 4)); } diff --git a/PhaseWindow.cpp b/PhaseWindow.cpp index 976f1d5..59201e9 100644 --- a/PhaseWindow.cpp +++ b/PhaseWindow.cpp @@ -222,8 +222,10 @@ } void PhaseWindow::on_btnMenuClose_clicked() { - // 发送结束指令 - device->stopWork(); + if (running == true) { + // 发送结束指令 + device->stopWork(); + } QTimer::singleShot(500, qApp, SLOT(quit())); } @@ -241,9 +243,10 @@ void PhaseWindow::on_startButt_clicked() { + createFolder(); + // 发送开始指令 device->startWork(); - createFolder(); running = true; } diff --git a/SetConfig.cpp b/SetConfig.cpp index d9b6273..ff5edaf 100644 --- a/SetConfig.cpp +++ b/SetConfig.cpp @@ -6,6 +6,8 @@ #include #include +extern bool running; + SetConfig::SetConfig(QWidget *parent) : QDialog(parent), ui(new Ui::SetConfig) @@ -40,6 +42,13 @@ ui->devInput->setText(QString::number(SettingConfig::getInstance().DEVICE_PORT)); ui->listenInput->setText(QString::number(SettingConfig::getInstance().LISTEN_PORT)); ui->logInput->setText(SettingConfig::getInstance().BASE_LOG_PATH); + + if (running == true) + { + ui->logInput->setReadOnly(true); + } else { + ui->logInput->setReadOnly(false); + } } SetConfig::~SetConfig() { diff --git a/qss/pmdark.css b/qss/pmdark.css index c83b18d..8f29639 100644 --- a/qss/pmdark.css +++ b/qss/pmdark.css @@ -1,4 +1,4 @@ -QPalette{background:#444444;}*{outline:0px;color:#DCDCDC;} +QPalette{background:#444444;}*{outline:0px;color:#DCDCDC;} QWidget[form="true"] { background: #444444; @@ -13,6 +13,14 @@ border-style:none; } +QWidget[form="channel"] QLabel{ + border-radius:0px; + color:#DCDCDC; + background:none; + border-style:none; + font-size: 16px; +} + QWidget[form="title"],QWidget[nav="left"],QWidget[nav="top"] QAbstractButton{ border-style:none; border-radius:0px;