From bea6407b376a4e426f0b120bae569fba6ab867db Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期六, 08 十一月 2025 17:55:47 +0800
Subject: [PATCH] 1.CMaster.cpp 第 1644/1667/1691 行在记录 SV 曲线时通过 getGlassFromSlot(0) 取玻璃,而各设备的 initSlots() 都是从 1 开始编号(例如 CBonder.cpp (line 408)、CVacuumBake.cpp (line 415) 等)。槽位 0 永远不存在,所以 pGlass 始终是 nullptr,pGlass->addSVData(...) 的分支从未执行。结果 SERVO::CGlass::m_svDatas 里没有任何曲线数据,GlassJson::ToPrettyString 生成的 pretty 字符串也就没有 sv_datas,导出 CSV 时自然读不到曲线。 同一段代码还有一个潜在 Bug:虽然判断了 channel - 1 < bonderTypes.size(),但真正索引却用的是 bonderTypes[channel]。索引偏移会导致数据类型错位,最后一个通道甚至可能越界。即使修正了槽位,这里也需要同步改成 bonderTypes[channel - 1](另外两处 vacuumbakeTypes、coolingTypes 也一样)。
---
SourceCode/Bond/BoounionPLC/AxisSettingsDlg.h | 34 ++++++++++++++++++----------------
1 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/SourceCode/Bond/BoounionPLC/AxisSettingsDlg.h b/SourceCode/Bond/BoounionPLC/AxisSettingsDlg.h
index 0f0d198..565a385 100644
--- a/SourceCode/Bond/BoounionPLC/AxisSettingsDlg.h
+++ b/SourceCode/Bond/BoounionPLC/AxisSettingsDlg.h
@@ -1,7 +1,6 @@
锘�#pragma once
#include "BlButton.h"
#include "BLLabel.h"
-#include "RegexEdit.h"
#include "CBaseDlg.h"
#include "PLC.h"
#include "AxisManager.h"
@@ -17,19 +16,6 @@
#define LABEL_READY 3
#define LABEL_BUSY 4
#define LABEL_ERR 5
-
-// RegexEdit鎺т欢
-#define EDIT_MAX 10
-#define EDIT_MANUAL_SPEED 0
-#define EDIT_AUTO_SPEED 1
-#define EDIT_ACCE_TIME 2
-#define EDIT_DECE_TIME 3
-#define EDIT_MICROMENTUM 4
-#define EDIT_ANCHOR_POINT1 5
-#define EDIT_ANCHOR_POINT2 6
-#define EDIT_ANCHOR_POINT3 7
-#define EDIT_ANCHOR_POINT4 8
-#define EDIT_ANCHOR_POINT5 9
// BUTTON鎺т欢
#define BTN_MAX 15
@@ -72,6 +58,11 @@
CAxisSettingsDlg(CWnd* pParent = nullptr); // 鏍囧噯鏋勯�犲嚱鏁�
virtual ~CAxisSettingsDlg();
+
+private:
+ virtual BOOL PreAdjustControl(CWnd* pWnd);
+
+
// 瀵硅瘽妗嗘暟鎹�
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_DIALOG_AXIS_SETTINGS };
@@ -83,7 +74,6 @@
void SetLabelColor(CBLLabel& label, COLORREF color);
void SetLabelColorBasedOnState(CBLLabel& label, BOOL bState, COLORREF colorTrue, COLORREF colorFalse);
void UpdateLabels();
- void UpdateRegexEdit(CRegexEdit* pRegexEdit, const ValueRange& range, const CString& title);
void UpdatePageButtonStates();
void HideEditCursor(int nCtrlID);
int GetCurrentSelectedAxisID();
@@ -98,9 +88,16 @@
void WriteAxisDataToPLC(int nAxisId);
void HandleAxisOperation(AxisOperationType eOpType, bool bPressed);
void ReadPLCDataToUI(int nAxisId);
+ void ShowTipText(const char* pszText, float sec);
+ void HideTip();
+ bool IsFloatInRange(const std::string& strInput, double fLowerBound, double fUpperBound);
private:
CPLC* m_pPLC;
+ HBRUSH m_hbrTip;
+ HFONT m_hTipFont;
+ COLORREF m_crTipBack;
+ COLORREF m_crTipText;
// 褰撳墠閫変腑鐨勫畾浣嶉〉闈㈢储寮�
int m_currentPage;
@@ -111,7 +108,6 @@
// 鎺т欢
CBlButton* m_pBlBtns[BTN_MAX];
CBLLabel* m_pBlLabels[LABEL_MAX];
- CRegexEdit* m_pRegexEdit[EDIT_MAX];
CComboBox m_comboAxisNO;
CStatic m_staticAxisNO, m_staticAxisDescription, m_staticStartAddress;
@@ -158,7 +154,13 @@
afx_msg void OnBnClickedButtonAxisUpdateUi();
afx_msg void OnBnClickedButtonAxisDetailSettings();
afx_msg LRESULT OnUpdateDataToUI(WPARAM wParam, LPARAM lParam);
+ afx_msg void OnKillfocusEditAxisModitfyManualSpeed();
+ afx_msg void OnKillfocusEditAxisModitfyAutoSpeed();
+ afx_msg void OnKillfocusEditAxisModitfyDeceTime();
+ afx_msg void OnKillfocusEditAxisModitfyAcceTime();
+ afx_msg void OnEnKillfocusEditAxisModitfyMicromentum();
afx_msg void OnTimer(UINT_PTR nIDEvent);
afx_msg void OnClose();
+ afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
DECLARE_MESSAGE_MAP()
};
--
Gitblit v1.9.3