mrDarker
2025-10-22 e8a27bb203fe2aff70390a5eca002d7438da9b0f
SourceCode/Bond/BondEq/View/IOMonitoringDlg.cpp
@@ -25,7 +25,7 @@
{
   m_nCurrentPage = 1;
   m_nTotalPages = 1;
   m_nRowsPerPage = 10;
   m_nRowsPerPage = 16;
   m_nCols = 6;
}
@@ -59,7 +59,7 @@
   // 计算页数
   m_nCurrentPage = 1;
   m_nTotalPages = (m_displayData.size() + m_nRowsPerPage - 1) / m_nRowsPerPage;
   m_nTotalPages = ((int)m_displayData.size() + m_nRowsPerPage - 1) / m_nRowsPerPage;
}
void CIOMonitoringDlg::SetPLC(CPLC* pPLC)
@@ -161,7 +161,7 @@
   ScreenToClient(&nextButtonRect);
   int buttonHeight = prevButtonRect.Height();     // 按钮的高度
   int topMargin = rect.Height() * 0.05;           // 顶部保留 5% 的高度
   int topMargin = int(rect.Height() * 0.05);      // 顶部保留 5% 的高度
   int bottomMargin = buttonHeight + topMargin;    // 底部保留按钮高度加间距
   int sideMargin = topMargin;                     // 左右间距与顶部间距相同
   int groupSpacing = 20;                          // 两组之间的间距
@@ -214,8 +214,8 @@
   // 创建动态控件
   CBLLabel* pStatic = new CBLLabel();
   DWORD style = WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE; // 确保垂直居中
   if (hasBorder) {
      style |= WS_BORDER; // 添加边框
   if (!hasBorder) {
      pStatic->DisableBorder();
   }
   pStatic->Create(text, style, CRect(x, y, x + width, y + height), this, id);
@@ -234,6 +234,8 @@
   UserRole enRole = userManager.getCurrentUserRole();
   if (clickCallback && (enRole == UserRole::SuperAdmin || enRole == UserRole::Operator)) {
      pStatic->SetClickCallback(clickCallback);
      pStatic->SetRoundedCorners(TRUE, 5);
      pStatic->DisableBorder();
   }
   // 存储控件指针
@@ -490,7 +492,7 @@
         MC::SOFT_COMPONENT enComponent;
         if (ParsePLCAddress(CString(data.inputAddress.c_str()), enComponent, nAddress)) {
            int nOffset = nAddress - inputStartAddr;
            if (nOffset >= 0 && nOffset < nDataSize) {
            if (nOffset >= 0 && nOffset < (int)nDataSize) {
               int byteIndex = nOffset / 8;
               int bitIndex = nOffset % 8;
               data.bInputStates = CToolUnits::getBit(pData[byteIndex], bitIndex);
@@ -511,7 +513,7 @@
         MC::SOFT_COMPONENT enComponent;
         if (ParsePLCAddress(CString(data.outputAddress.c_str()), enComponent, nAddress)) {
            int nOffset = nAddress - outputStartAddr;
            if (nOffset >= 0 && nOffset < nDataSize) {
            if (nOffset >= 0 && nOffset < (int)nDataSize) {
               int byteIndex = nOffset / 8;
               int bitIndex = nOffset % 8;
               data.bOutputStates = CToolUnits::getBit(pData[byteIndex], bitIndex);
@@ -604,8 +606,8 @@
   }
   GetWindowRect(&dlgRect);
   int dlgWidth = dlgRect.Width() * 2;
   int dlgHeight = dlgRect.Height() * 2;
   int dlgWidth = dlgRect.Width() * 3;
   int dlgHeight = dlgRect.Height() * 3;
   if (dlgWidth > screenRect.Width()) {
      dlgWidth = screenRect.Width();