调试修改
This commit is contained in:
parent
09be8c7efa
commit
871de1e005
|
|
@ -319,11 +319,11 @@ DEVICEMANAGE_API(int) GetDeviceInfo(void *pHandle, sDeviceInfo *spDi, int budnum
|
||||||
DEVICEMANAGE_API(int) GetDeviceBoardTotalNum(void *pHandle);
|
DEVICEMANAGE_API(int) GetDeviceBoardTotalNum(void *pHandle);
|
||||||
DEVICEMANAGE_API(int) GetDeviceChTotalNum(void *pHandle, int bdidx);
|
DEVICEMANAGE_API(int) GetDeviceChTotalNum(void *pHandle, int bdidx);
|
||||||
|
|
||||||
// DEVICEMANAGE_API(int) GetDeviceUserInfo(void *pHandle, UserConfigInfo *pUCI);
|
DEVICEMANAGE_API(int) GetDeviceUserInfo(void *pHandle, UserConfigInfo *pUCI);
|
||||||
// DEVICEMANAGE_API(int) SetDeviceUserInfo(void *pHandle, UserConfigInfo *pUCI);
|
DEVICEMANAGE_API(int) SetDeviceUserInfo(void *pHandle, UserConfigInfo *pUCI);
|
||||||
// DEVICEMANAGE_API(int) GetDeviceBoardUserInfo(void *pHandle, UserConfigInfo *pUCI, int bdidx);
|
DEVICEMANAGE_API(int) GetDeviceBoardUserInfo(void *pHandle, UserConfigInfo *pUCI, int bdidx);
|
||||||
// DEVICEMANAGE_API(int) GetDeviceBoardChannelUserInfo(void *pHandle, UserConfigInfo *pUCI, int bdidx, int chidx);
|
DEVICEMANAGE_API(int) GetDeviceBoardChannelUserInfo(void *pHandle, UserConfigInfo *pUCI, int bdidx, int chidx);
|
||||||
// DEVICEMANAGE_API(int) SetDeviceBoardChannelUserInfo(void *pHandle, UserConfigInfo *pUCI, int bdidx, int chidx);
|
DEVICEMANAGE_API(int) SetDeviceBoardChannelUserInfo(void *pHandle, UserConfigInfo *pUCI, int bdidx, int chidx);
|
||||||
DEVICEMANAGE_API(int) GetDeviceBoardChannelConfiginfo(void *pHandle, OneChannelConfigInfo *pUCI, int bdidx, int chidx);
|
DEVICEMANAGE_API(int) GetDeviceBoardChannelConfiginfo(void *pHandle, OneChannelConfigInfo *pUCI, int bdidx, int chidx);
|
||||||
|
|
||||||
DEVICEMANAGE_API(int) DBCSetHightVoltage(void *pHandle, OneChannelConfigInfo *pUCI, int bdidx, int chidx);
|
DEVICEMANAGE_API(int) DBCSetHightVoltage(void *pHandle, OneChannelConfigInfo *pUCI, int bdidx, int chidx);
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,7 @@ bool MeasureDeviceController::SetDeviceMeasureConfigParams(const QString &device
|
||||||
ok = false;
|
ok = false;
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
config.m_eTransferModel = eSpecturmMode;
|
||||||
config.m_iDeviceGain = cfg_params.value("DeviceGain", 1).toInt();
|
config.m_iDeviceGain = cfg_params.value("DeviceGain", 1).toInt();
|
||||||
config.m_iDeviceGainSelectIndex = cfg_params.value("DeviceGainSelectIndex", 1).toInt();
|
config.m_iDeviceGainSelectIndex = cfg_params.value("DeviceGainSelectIndex", 1).toInt();
|
||||||
config.m_iSoftGain = cfg_params.value("SoftGain", 3000).toInt();
|
config.m_iSoftGain = cfg_params.value("SoftGain", 3000).toInt();
|
||||||
|
|
@ -136,7 +137,6 @@ bool MeasureDeviceController::SetDeviceMeasureConfigParams(const QString &device
|
||||||
config.m_iMaxEnergy = cfg_params.value("MaxEnergy", 1).toInt();
|
config.m_iMaxEnergy = cfg_params.value("MaxEnergy", 1).toInt();
|
||||||
config.m_iTotalMeasureTime = cfg_params.value("TotalMeasureTime", 10).toInt();
|
config.m_iTotalMeasureTime = cfg_params.value("TotalMeasureTime", 10).toInt();
|
||||||
|
|
||||||
config.m_eTransferModel = eSpecturmMode;
|
|
||||||
config.m_iFormTime = 3;
|
config.m_iFormTime = 3;
|
||||||
config.m_iFastChannelTrigerValue = 10;
|
config.m_iFastChannelTrigerValue = 10;
|
||||||
config.m_iHighVoltage = 0;
|
config.m_iHighVoltage = 0;
|
||||||
|
|
@ -257,9 +257,9 @@ QString MeasureDeviceController::GetMeasureGvfDataFilename()
|
||||||
if (measure_gvf_data_file_info.exists()) {
|
if (measure_gvf_data_file_info.exists()) {
|
||||||
if ( measure_gvf_data_file_info.suffix() != QString("gvf") )
|
if ( measure_gvf_data_file_info.suffix() != QString("gvf") )
|
||||||
continue;
|
continue;
|
||||||
QString measure_gvf_data_file_base_name = measure_gvf_data_file_info.baseName();
|
QString measure_gvf_datetime_str = measure_gvf_data_file_info.baseName().remove("GVHD__");
|
||||||
QDateTime data_time = QDateTime::fromString(measure_gvf_data_file_base_name, "GVHD__YYYY_MM_dd_hh_mm_ss_zzz");
|
QDateTime data_time = QDateTime::fromString(measure_gvf_datetime_str, "yyyy_MM_dd_hh_mm_ss_zzz");
|
||||||
if ( qAbs(_measure_start_time.toMSecsSinceEpoch() - data_time.toMSecsSinceEpoch()) < 1000 ) {
|
if ( qAbs(_measure_start_time.toMSecsSinceEpoch() - data_time.toMSecsSinceEpoch()) < (1000 * 10) ) {
|
||||||
measure_gvf_data_filename = measure_gvf_data_file_info.absoluteFilePath();
|
measure_gvf_data_filename = measure_gvf_data_file_info.absoluteFilePath();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,9 @@
|
||||||
#include <QSqlDatabase>
|
#include <QSqlDatabase>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include "QsLogManage.h"
|
#include "QsLogManage.h"
|
||||||
#include <QDebug>
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QThread>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
MeasureTask::MeasureTask(int socketDescriptor, QObject *parent)
|
MeasureTask::MeasureTask(int socketDescriptor, QObject *parent)
|
||||||
: QThread(parent), socketDescriptor(socketDescriptor)
|
: QThread(parent), socketDescriptor(socketDescriptor)
|
||||||
|
|
@ -23,10 +24,19 @@ void MeasureTask::run()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tcp_socket.setReadBufferSize(1024 * 1024);
|
tcp_socket.setReadBufferSize(1024 * 1024);
|
||||||
tcp_socket.waitForReadyRead(500);
|
|
||||||
QByteArray buffer;
|
QByteArray buffer;
|
||||||
while (tcp_socket.bytesAvailable()) {
|
if ( tcp_socket.waitForReadyRead(500) ) {
|
||||||
buffer.append(tcp_socket.readAll());
|
while (tcp_socket.bytesAvailable() < 2 ) {
|
||||||
|
if ( tcp_socket.waitForReadyRead(100) ) {
|
||||||
|
QByteArray len_buf = tcp_socket.read(2);
|
||||||
|
quint16 total_len = (uchar)len_buf[0] | ((uchar)len_buf[1] << 8);
|
||||||
|
while (buffer.size() < total_len) {
|
||||||
|
if (tcp_socket.waitForReadyRead(500)) {
|
||||||
|
buffer.append(tcp_socket.readAll());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( buffer.size() ) {
|
if ( buffer.size() ) {
|
||||||
QLOG_INFO() << QStringLiteral(u"请求数据长度:") << buffer.size();
|
QLOG_INFO() << QStringLiteral(u"请求数据长度:") << buffer.size();
|
||||||
|
|
@ -103,10 +113,21 @@ void MeasureTask::processStartMeasureCmd(QTcpSocket* socket, const QString &devi
|
||||||
const QString error = QStringLiteral(u"启动设置板卡%1通道%2测量参数失败").arg(board_id).arg(channel_id);
|
const QString error = QStringLiteral(u"启动设置板卡%1通道%2测量参数失败").arg(board_id).arg(channel_id);
|
||||||
errors.append(error);
|
errors.append(error);
|
||||||
}
|
}
|
||||||
|
QThread::msleep(100);
|
||||||
|
}
|
||||||
|
for (auto channel_config : channel_config_list) {
|
||||||
|
if (!channel_config.isValid())
|
||||||
|
continue;
|
||||||
|
QVariantMap channel_config_info = channel_config.toMap();
|
||||||
|
if (!channel_config_info.contains("BoardId") || !channel_config_info.contains("ChannelId"))
|
||||||
|
continue;
|
||||||
|
int board_id = channel_config_info["BoardId"].toInt();
|
||||||
|
int channel_id = channel_config_info["ChannelId"].toInt();
|
||||||
if (!MeasureDeviceController::Instance()->StartMeasure(device_guid, board_id, channel_id)) {
|
if (!MeasureDeviceController::Instance()->StartMeasure(device_guid, board_id, channel_id)) {
|
||||||
const QString error = QStringLiteral(u"启动板卡%1通道%2测量失败").arg(board_id).arg(channel_id);
|
const QString error = QStringLiteral(u"启动板卡%1通道%2测量失败").arg(board_id).arg(channel_id);
|
||||||
errors.append(error);
|
errors.append(error);
|
||||||
}
|
}
|
||||||
|
QThread::msleep(100);
|
||||||
}
|
}
|
||||||
QByteArray replay_data;
|
QByteArray replay_data;
|
||||||
QDataStream replay_data_stream(&replay_data, QIODevice::Append);
|
QDataStream replay_data_stream(&replay_data, QIODevice::Append);
|
||||||
|
|
@ -175,6 +196,7 @@ void MeasureTask::processSetDeviceMeasureConfigParamsCmd(QTcpSocket* socket, con
|
||||||
const QString error = QStringLiteral(u"设置板卡%1通道%2测量参数失败").arg(board_id).arg(channel_id);
|
const QString error = QStringLiteral(u"设置板卡%1通道%2测量参数失败").arg(board_id).arg(channel_id);
|
||||||
errors.append(error);
|
errors.append(error);
|
||||||
}
|
}
|
||||||
|
QThread::msleep(100);
|
||||||
}
|
}
|
||||||
QByteArray replay_data;
|
QByteArray replay_data;
|
||||||
QDataStream replay_data_stream(&replay_data, QIODevice::Append);
|
QDataStream replay_data_stream(&replay_data, QIODevice::Append);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user