From 331f447bb0e5eccf0b3161ab287c1372b14b8480 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期五, 08 八月 2025 11:53:58 +0800
Subject: [PATCH] 1.增加千传计数,保存计数,重启软件时恢复; 2.千传测试模式,打印相关日志,方便后期提取,用于统计; 3.千传模式时烘烤两腔体都要进入; 4.千传模式时,Fliper到Bonder修改为用手臂2取料; 5.修复千传模式不计运行时的问题; 6.千传模式,最后收料强制放入第一层; 6.修复Buf, 当任务未生成(在符合条件后仍有1秒间隙)而机器单元发送FetchOutJob时,数据检验失败的问题,增加Sleep, 缩小间隙;
---
SourceCode/Bond/Servo/BlButton.cpp | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/SourceCode/Bond/Servo/BlButton.cpp b/SourceCode/Bond/Servo/BlButton.cpp
index 5eb7694..ff75530 100644
--- a/SourceCode/Bond/Servo/BlButton.cpp
+++ b/SourceCode/Bond/Servo/BlButton.cpp
@@ -36,6 +36,7 @@
m_hIcon[1] = nullptr;
m_nIconWidth = 0;
m_nFlashState = 0;
+ m_bTextRight = FALSE;
}
@@ -159,6 +160,11 @@
return m_nFlashState != 0;
}
+void CBlButton::SetTextRight()
+{
+ m_bTextRight = TRUE;
+}
+
void CBlButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
HDC hDC = lpDrawItemStruct->hDC;
@@ -200,15 +206,24 @@
HICON hIcon = this->IsWindowEnabled() ? m_hIcon[0] : m_hIcon[01];
if (hIcon != nullptr) {
int xIcon = (rcClient.right - rcClient.top - m_nIconWidth) / 2;
+ if (m_bTextRight) {
+ xIcon = 15;
+ }
+
if (m_hMenu != nullptr) xIcon -= 10;
int yIcon = (rcClient.bottom - rcClient.top - m_nIconWidth) / 2;
- if (nTextLen != 0) {
+ if (nTextLen != 0 && !m_bTextRight) {
yIcon -= 8;
}
DrawIconEx(hDC, xIcon, yIcon,
hIcon, m_nIconWidth, m_nIconWidth, 0, 0, DI_NORMAL);
- rcText.top = yIcon + m_nIconWidth + 2;
+ if (m_bTextRight) {
+ rcText.left = xIcon + m_nIconWidth + 2;
+ }
+ else {
+ rcText.top = yIcon + m_nIconWidth + 2;
+ }
}
@@ -219,24 +234,25 @@
hFont = (HFONT)pFont->GetSafeHandle();
}
-
- ::SelectObject(hDC, hFont);
+ HFONT hOldFont = (HFONT)::SelectObject(hDC, hFont);
::SetBkMode(hDC, TRANSPARENT);
::SetTextColor(hDC, m_crText[state]);
+ UINT format1 = m_bTextRight ? DT_LEFT : DT_CENTER;
if ((BS_MULTILINE & GetStyle()) == BS_MULTILINE) {
CRect rcBound;
int height = DrawTextA(hDC, szText, (int)strlen(szText), &rcBound, DT_CENTER | DT_CALCRECT | DT_EDITCONTROL);
rcText.top = rcBound.top + (rcClient.bottom - rcClient.top - height) / 2;
rcText.bottom = rcText.top + height;
- DrawTextA(hDC, szText, (int)strlen(szText), &rcText, DT_CENTER | DT_EDITCONTROL);
+ DrawTextA(hDC, szText, (int)strlen(szText), &rcText, format1 | DT_EDITCONTROL);
}
else {
if (m_hMenu != nullptr) {
rcText.right -= (10);
}
- DrawTextA(hDC, szText, (int)strlen(szText), &rcText, DT_VCENTER | DT_CENTER | DT_SINGLELINE | DT_END_ELLIPSIS);
+ DrawTextA(hDC, szText, (int)strlen(szText), &rcText, format1 | DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS);
}
+ ::SelectObject(hDC, hOldFont);
// 是否有小圆点
@@ -283,8 +299,8 @@
::Polygon(hDC, pt, 3);
::SelectObject(hDC, hOldBrush);
::SelectObject(hDC, hOldPen);
- ::DeleteObject(hBrush);
- ::DeleteObject(hPen);
+ ::DeleteObject(hbrDrop); // 正确释放小三角使用的画刷
+ ::DeleteObject(hPenDrop); // 正确释放小三角的笔
}
}
--
Gitblit v1.9.3