From 656228d05e6fa5200ae41621d2250de210d95600 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期二, 03 二月 2026 15:34:43 +0800
Subject: [PATCH] 1.Slot小方块大小用两种配置,LoadPort和其它的分开

---
 SourceCode/Bond/Servo/ServoGraph.h |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/ServoGraph.h b/SourceCode/Bond/Servo/ServoGraph.h
index d409660..296aae7 100644
--- a/SourceCode/Bond/Servo/ServoGraph.h
+++ b/SourceCode/Bond/Servo/ServoGraph.h
@@ -62,6 +62,11 @@
 #define HMGRAPH_HT_NOWHERE			0x1
 #define HMGRAPH_HT_ITEM				0x2
 
+enum class SlotBarPos {
+	None = 0,
+	Top,
+	Bottom
+};
 
 class CServoGraph
 {
@@ -94,6 +99,8 @@
 			this->box2BackgroundColor = RGB(0, 255, 255);;
 			this->box2FrameColor = RGB(255, 255, 0);;
 			this->bBox2Visible = FALSE;
+			this->m_pData = nullptr;
+			this->slotBarPos = SlotBarPos::None;
 		};
 		~INDICATEBOX() {};
 
@@ -110,6 +117,9 @@
 		COLORREF box2FrameColor;
 		BOOL bBox2Visible;
 		std::vector<void*> m_contexts;
+		void* m_pData;
+		SlotBarPos slotBarPos;
+		std::vector<COLORREF> slotColors;
 	};
 
 	class INDICATEBKGND
@@ -142,9 +152,11 @@
 	LRESULT OnTimer(WPARAM wParam, LPARAM lParam);
 	LRESULT OnPaint(WPARAM wParam, LPARAM lParam);
 	LRESULT OnMouseMove(WPARAM wParam, LPARAM lParam);
+	LRESULT OnSize(WPARAM wParam, LPARAM lParam);
 	LRESULT OnLButtonDown(WPARAM wParam, LPARAM lParam);
 
 public:
+	void Invalidata();
 	void AddImage(int id, char* pszPath, int x, int y);
 	void AddIndicateBox(int id, int x, int y, int width);
 	void AddIndicateBox(int id, int x, int y, int width,
@@ -154,6 +166,8 @@
 	BOOL RemoveIndicateBoxAllContext(int id);
 	const std::vector<void*>& GetIndicateBoxContexts(int id);
 	bool IsIndicateBoxContextsEmpty(int id);
+	void SetIndicateBoxData(int id, void* pData);
+	void* GetIndicateBoxData(int id);
 	void ShowIndicateBoxInterior(int id, COLORREF color);
 	void HideIndicateBoxInterior(int id);
 	CServoGraph::INDICATEBOX* GetIndicateBox(int id);
@@ -172,6 +186,10 @@
 	void UpdateImageAngle(int id, float angle);
 	void UpdateIndicateBox1Colors(int id, COLORREF newBackgroundColor, COLORREF newFrameColor1, COLORREF newFrameColor2);
 	void UpdateIndicateBox2Colors(int id, COLORREF newBackgroundColor, COLORREF newFrameColor);
+	void SetIndicateBoxSlotBarPosition(int id, SlotBarPos pos);
+	void SetIndicateBoxSlotColors(int id, const std::vector<COLORREF>& colors);
+	void SetSlotBarSize(int size);
+	void SetSlotBarSizeByCount(int size8, int sizeOther);
 
 private:
 	void DrawImage(HDC hMemDC, IMAGE& item);
@@ -187,6 +205,9 @@
 	std::vector<INDICATEBKGND> m_indicateBkgnds;
 	void* m_pHighItem;
 	HWND m_hWndTooltip;
+	int m_slotBarSize;
+	int m_slotBarSize8;
+	int m_slotBarSizeOther;
 };
 
 #endif // !defined(AFX_EQUIPMENTGRAPH_H__FBB8916A_DE77_4EA3_9C21_E51E6B06194C__INCLUDED_)

--
Gitblit v1.9.3