LAPTOP-SNT8I5JK\Boounion
2025-09-19 81df82be1f5f401b80780f65e5811685d9a8e4c4
SourceCode/Bond/SGMeasurement/PLCSignalListener.cpp
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "PLCSignalListener.h"
// === 日志打印类型 ===
@@ -247,13 +247,10 @@
            // 上升沿触发
            switch (i) {
            case 0:
               // Start 命令
               if (m_cbStart) {
                  m_cbStart();
                  WriteOutValues(OutValuesArray{ 0.0, 0.0, 0.0, 0.0 });
                  if (m_pPlc->SetBitDeviceEx(m_station, PLC_BIT_DEVICE_TYPE, PLC_ACK_BASE_BIT + i) == 0) {
                     m_vecAckSent[i] = true;
                     m_vecAckCounter[i] = 0;
                  }
                  std::string strProductID;
                  if (ReadProductID(strProductID)) {
@@ -262,21 +259,31 @@
                     LOG_MSG(msg, LOG_TYPE_SUCCESS);
                  }
               }
               // 发送应答信号
               if (m_pPlc->SetBitDeviceEx(m_station, PLC_BIT_DEVICE_TYPE, PLC_ACK_BASE_BIT + i) == 0) {
                  m_vecAckSent[i] = true;
                  m_vecAckCounter[i] = 0;
               }
               break;
            case 1:
               // Stop 命令
               if (m_cbStop) {
                  m_cbStop();
                  if (m_pPlc->SetBitDeviceEx(m_station, PLC_BIT_DEVICE_TYPE, PLC_ACK_BASE_BIT + i) == 0) {
                     m_vecAckSent[i] = true;
                     m_vecAckCounter[i] = 0;
                  }
               }
               // Analyze 命令
               if (m_cbAnalyze) {
                  auto results = m_cbAnalyze();
                  WriteOutValues(results);
               }
               // 发送应答信号
               if (m_pPlc->SetBitDeviceEx(m_station, PLC_BIT_DEVICE_TYPE, PLC_ACK_BASE_BIT + i) == 0) {
                  m_vecAckSent[i] = true;
                  m_vecAckCounter[i] = 0;
               }
               break;
            }
         }