From 7fb74c4bcc6e91d819aa63cdc13bebfb560f2d77 Mon Sep 17 00:00:00 2001 From: leverington Date: Tue, 6 Aug 2024 15:59:45 +0200 Subject: [PATCH] the calibration now accepts 1 channel at a time --- hit2023v2_RMS/device.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/hit2023v2_RMS/device.cpp b/hit2023v2_RMS/device.cpp index 885de39..7eb7075 100644 --- a/hit2023v2_RMS/device.cpp +++ b/hit2023v2_RMS/device.cpp @@ -111,7 +111,7 @@ void Device::configure(DeviceConfig &cfg) ctrlSetGain(deviceConfig.gain); ctrlSetClusterThreshold(deviceConfig.threshold); ctrlSetClusterSize(deviceConfig.clustersize); - //ctrlSetCalibrationFactor(deviceConfig.calibrationFactor); + ctrlSetCalibrationFactor(deviceConfig.calibrationFactor); ctrlConfigBunch(deviceConfig.dma_bunch, deviceConfig.eth_bunch); ctrlConfigPeer(ipshort, DEV_BASE_DATA_PORT+ deviceConfig.device_id); } @@ -519,15 +519,22 @@ int Device::ctrlSetCalibrationFactor(int calibrationFactor[320]) QVector rxdata; QVector txdata; - + int status = -1; // Append each calibration factor to txdata for (int i = 0; i < 320; ++i) { + txdata.append(static_cast(i)); txdata.append(static_cast(calibrationFactor[i])); + // Perform the queryCtrl operation with the populated txdata + status = queryCtrl(COMMAND_SET_CALIBRATION_FACTOR, txdata, rxdata); + rxdata.clear(); + txdata.clear(); + //if (status == DEV_CTRL_ERROR) {return DEV_CTRL_ERROR;} + } - // Perform the queryCtrl operation with the populated txdata - return queryCtrl(COMMAND_SET_CALIBRATION_FACTOR, txdata, rxdata); + return DEV_CTRL_OK; + }