JonYang преди 1 седмица
родител
ревизия
2e8b907f51
променени са 76 файла, в които са добавени 2939 реда и са изтрити 1141 реда
  1. BIN
      Output/bin/x64/Control.dll
  2. BIN
      Output/bin/x64/Control.pdb
  3. BIN
      Output/bin/x64/JSMotion.dll
  4. BIN
      Output/bin/x64/Module.dll
  5. BIN
      Output/bin/x64/Module.pdb
  6. BIN
      Output/bin/x64/configurations.db
  7. BIN
      Output/config/db/AxisConfiguration.db
  8. BIN
      Output/config/db/Hardware.db
  9. BIN
      Output/config/db/IOConfiguration.db
  10. BIN
      Output/config/db/MachineCalibration.db
  11. BIN
      Output/config/db/MachineSetup.db
  12. BIN
      Output/config/db/ModuleConfig.db
  13. BIN
      Output/config/db/Product1/Product.db
  14. BIN
      Output/dll/x64/Control.dll
  15. BIN
      Output/dll/x64/JSMotion.dll
  16. BIN
      Output/dll/x64/Module.dll
  17. 12 0
      Output/inc/Control/CRunButton.h
  18. 1 1
      Output/inc/Control/CViewInterface.h
  19. 2 0
      Output/inc/Control/CViewMatrix.h
  20. 5 2
      Output/inc/Module/AxisPara.h
  21. 12 1
      Output/inc/Module/CAxis.h
  22. 85 34
      Output/inc/Module/CBondHead.h
  23. 25 11
      Output/inc/Module/CBondMatrix.h
  24. 16 142
      Output/inc/Module/CCalibrationConfig.h
  25. 2 0
      Output/inc/Module/CCameraBase.h
  26. 15 27
      Output/inc/Module/CConfigBase.h
  27. 44 0
      Output/inc/Module/CConfigBaseManage.h
  28. 2 0
      Output/inc/Module/CError.h
  29. 9 2
      Output/inc/Module/CForceControl.h
  30. 9 2
      Output/inc/Module/CMachineCalibration.h
  31. 0 25
      Output/inc/Module/CManageDB.h
  32. 2 0
      Output/inc/Module/CMessageBox.h
  33. 35 154
      Output/inc/Module/CModuleConfig.h
  34. 10 4
      Output/inc/Module/CMultiTemplate.h
  35. 7 4
      Output/inc/Module/CPrStrategy.h
  36. 112 18
      Output/inc/Module/CProduct.h
  37. 1 0
      Output/inc/Module/CRCalib.h
  38. 1 0
      Output/inc/Module/CSingleTemplate.h
  39. 1 0
      Output/inc/Module/CUltraHead.h
  40. 2 0
      Output/inc/Module/CXYCalib.h
  41. 11 3
      Output/inc/Module/JAxis.h
  42. 8 4
      Output/inc/Module/JMotion.h
  43. 19 5
      Output/inc/Module/TipMatrix.h
  44. 17 0
      Output/inc/Public/dt.h
  45. BIN
      Output/lib/x64/Common.lib
  46. BIN
      Output/lib/x64/Control.lib
  47. BIN
      Output/lib/x64/Module.lib
  48. 13 1
      View/die-bonder-ui/MainWnd.cpp
  49. 5 1
      View/die-bonder-ui/MainWnd.h
  50. 315 46
      View/die-bonder-ui/OriginalWnd/DbTreeViewManager.cpp
  51. 11 1
      View/die-bonder-ui/OriginalWnd/DbTreeViewManager.h
  52. 3 3
      View/die-bonder-ui/OriginalWnd/MainAndSecondaryCamerasWnd.cpp
  53. 1 0
      View/die-bonder-ui/OriginalWnd/OriginalWnd.cpp
  54. 1 1
      View/die-bonder-ui/OriginalWnd/TreeViewManager/JCustomLabelControls.h
  55. 14 3
      View/die-bonder-ui/OriginalWnd/TreeViewManager/JIoMapPage.cpp
  56. 1 1
      View/die-bonder-ui/OriginalWnd/TreeViewManager/JIoMapPage.h
  57. 13 0
      View/die-bonder-ui/OriginalWnd/TreeViewManager/TreeViewManagerHead.h
  58. 1 1
      View/die-bonder-ui/SBTdie-bonder-ui.vcxproj
  59. 3 6
      View/die-bonder-ui/SBTdie-bonder-ui.vcxproj.filters
  60. 593 260
      View/die-bonder-ui/Src/BondMatrixProgramPage.cpp
  61. 100 6
      View/die-bonder-ui/Src/BondMatrixProgramPage.h
  62. 726 258
      View/die-bonder-ui/Src/BondMatrixProgramPage.ui
  63. 109 11
      View/die-bonder-ui/Src/DiagnosisPage/DiagnosisPage.cpp
  64. 23 1
      View/die-bonder-ui/Src/DiagnosisPage/DiagnosisPage.h
  65. 186 4
      View/die-bonder-ui/Src/DiagnosisPage/DiagnosisPage.ui
  66. 11 8
      View/die-bonder-ui/Src/RewriteControl/LightJoystickSwitchPage.cpp
  67. 2 1
      View/die-bonder-ui/Src/RewriteControl/MsgDlg/CustomMessageDlg.cpp
  68. 78 27
      View/die-bonder-ui/Src/RewriteControl/MsgDlg/CustomMessageDlg.ui
  69. 81 9
      View/die-bonder-ui/Src/Sql/SqlOperation.cpp
  70. 19 2
      View/die-bonder-ui/Src/Sql/SqlOperation.h
  71. 55 16
      View/die-bonder-ui/Src/WaferProgramPage.cpp
  72. 1 0
      View/die-bonder-ui/Src/WaferProgramPage.h
  73. 105 31
      View/die-bonder-ui/Src/WaffleProgramPage.cpp
  74. 1 0
      View/die-bonder-ui/Src/WaffleProgramPage.h
  75. 2 3
      View/die-bonder-ui/Src/common/JMessageTip.cpp
  76. 1 1
      View/die-bonder-ui/Src/common/JMessageTip.h

BIN
Output/bin/x64/Control.dll


BIN
Output/bin/x64/Control.pdb


BIN
Output/bin/x64/JSMotion.dll


BIN
Output/bin/x64/Module.dll


BIN
Output/bin/x64/Module.pdb


BIN
Output/bin/x64/configurations.db


BIN
Output/config/db/AxisConfiguration.db


BIN
Output/config/db/Hardware.db


BIN
Output/config/db/IOConfiguration.db


BIN
Output/config/db/MachineCalibration.db


BIN
Output/config/db/MachineSetup.db


BIN
Output/config/db/ModuleConfig.db


BIN
Output/config/db/Product1/Product.db


BIN
Output/dll/x64/Control.dll


BIN
Output/dll/x64/JSMotion.dll


BIN
Output/dll/x64/Module.dll


+ 12 - 0
Output/inc/Control/CRunButton.h

@@ -104,6 +104,7 @@ namespace ns_module
 			REGISTER_FUNCTION(BH_ToPickGrabPos),
 			REGISTER_FUNCTION(BH_ToLookUpGrabPos),
 			REGISTER_FUNCTION(BH_ToBondGrabPos),
+			REGISTER_FUNCTION(BH_ViewTest),
 			REGISTER_FUNCTION(WaferTransfer_Home),
 			REGISTER_FUNCTION(WaferTransfer_ToGetDiePos),
 			REGISTER_FUNCTION(WaferTransfer_ToTransferPos),
@@ -140,6 +141,7 @@ namespace ns_module
 			REGISTER_FUNCTION(ForceControl_SpringcCalib),
 			REGISTER_FUNCTION(ForceControl_CalculationResults),
 			REGISTER_FUNCTION(ForceControl_Test),
+			REGISTER_FUNCTION(ForceControl_FindZero),
 			REGISTER_FUNCTION(LookUpCalib_StartCalib),
 			REGISTER_FUNCTION(LookUpCalib_ToCalibPos),
 			REGISTER_FUNCTION(LookUpCalib_ToHeadCalibPos),
@@ -152,6 +154,9 @@ namespace ns_module
 			REGISTER_FUNCTION(RCalib_WaferTableCalib),
 			REGISTER_FUNCTION(RCalib_WaferTableToPos),
 			REGISTER_FUNCTION(ModuleMove),
+			REGISTER_FUNCTION(SetHotZoneOn),
+			REGISTER_FUNCTION(SetHotZoneOff),
+			
 		};
 
 
@@ -197,6 +202,10 @@ namespace ns_module
 		long BH_ToPickGrabPos(ST_BUTTON_FUN stInfo);
 		long BH_ToLookUpGrabPos(ST_BUTTON_FUN stInfo);
 		long BH_ToBondGrabPos(ST_BUTTON_FUN stInfo);
+		long BH_PickHTest(ST_BUTTON_FUN stInfo);
+		long BH_BondHTest(ST_BUTTON_FUN stInfo);
+		long BH_ViewTest(ST_BUTTON_FUN stInfo);
+		long NozzleHTest(ST_BUTTON_FUN stInfo);
 		long WaferTransfer_Home(ST_BUTTON_FUN stInfo);
 		long WaferTransfer_ToGetDiePos(ST_BUTTON_FUN stInfo);
 		long WaferTransfer_ToTransferPos(ST_BUTTON_FUN stInfo);
@@ -234,6 +243,7 @@ namespace ns_module
 		long ForceControl_SpringcCalib(ST_BUTTON_FUN stInfo);
 		long ForceControl_CalculationResults(ST_BUTTON_FUN stInfo);
 		long ForceControl_Test(ST_BUTTON_FUN stInfo);
+		long ForceControl_FindZero(ST_BUTTON_FUN stInfo);
 		long LookUpCalib_StartCalib(ST_BUTTON_FUN stInfo);
 		long LookUpCalib_ToCalibPos(ST_BUTTON_FUN stInfo);
 		long LookUpCalib_ToHeadCalibPos(ST_BUTTON_FUN stInfo);
@@ -247,6 +257,8 @@ namespace ns_module
 		long RCalib_WaferTableToPos(ST_BUTTON_FUN stInfo);
 
 		long ModuleMove(ST_BUTTON_FUN stInfo);
+		long SetHotZoneOn(ST_BUTTON_FUN stInfo);
+		long SetHotZoneOff(ST_BUTTON_FUN stInfo);
 	};
 
 }

+ 1 - 1
Output/inc/Control/CViewInterface.h

@@ -75,7 +75,7 @@ namespace ns_module
 		/// <param name="vecConfig">返回的配置信息</param>
 		/// <returns>成功返回0,否则返回错误码</returns>
 		long LoadConfigDB(string strTableName, vector<int> iGroupId, vector<CONFIG_BASE_STRUCT>& vecConfig);
-
+		long LoadConfigDB(string strTableName, vector<CONFIG_BASE_STRUCT>& vecConfig);
 		/// <summary>
 		/// 保存配置信息
 		/// </summary>

+ 2 - 0
Output/inc/Control/CViewMatrix.h

@@ -147,6 +147,8 @@ namespace ns_module
 		 */
 		long SetBondAllSelectPointInfo(std::vector<POINT_INFO_STRUCT>& stPointInfo);
 
+		LONG CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE eType, UINT iBondInfoId);
+		LONG ModifyBondMatrixTemplate(UINT iTemplateId);
 #pragma endregion
 
 #pragma region ÁϺÐÀà

+ 5 - 2
Output/inc/Module/AxisPara.h

@@ -35,6 +35,10 @@ struct CardData
     int m_nCardIndex;
 };
 
+struct PDOInfo{
+
+};
+
 struct AxisData{
     virtual void virtualMark(){};//!<提供用于转换的虚函数表
     
@@ -44,8 +48,7 @@ struct AxisData{
     int m_nCardIndex;                      //!<卡号,属于这种类型的第几张卡
     int m_nAxisIndexInCard;                //!<该轴在卡中的索引
 
-    int m_nAxisNumInCard;        //!<该轴对应卡所含轴的总轴数
-
+    int m_nDriverIndexInCard;        //!<该轴对应驱动器在卡中的索引(可能存在一个驱动器带多个轴)
 //********************************************************************
 //UI中不使用
     //int m_nBoardNum;                       //卡号,所有卡的排序;2024/10/28

+ 12 - 1
Output/inc/Module/CAxis.h

@@ -45,6 +45,7 @@ public:
 		}
 	}HOT_ZONE_ID_STRUCT; //
 
+	static void SetHotZone(bool bEnable);
 private:
 	AXIS_TYPE m_eAxisType = AXIS_TYPE::X;
 	string m_strAxisType;
@@ -69,7 +70,7 @@ private:
 	std::vector <ns_db::MODULE_HOT_ZONE_STRUCT> m_vecHotZoneList;
 
 	static std::mutex m_MutexHotZone;
-	bool m_bHotZoneEnable = false;
+	static bool m_bHotZoneEnable;
 	static std::vector<HOT_ZONE_ID_STRUCT> m_vecHotZoneId;
 
 	//轴当前位置,模拟测试时才会使用
@@ -136,6 +137,14 @@ public:
 	 */
 	int JSetTargetVel(double dVel);
 
+	/**设置最大速度(基准速度)user units
+	 */
+	int JSetMaxVelocity(double dMVel);
+
+	/**获取最大速度设置
+	 */
+    int JGetMaxVelocity(double& dMaxVel);
+
 	/**要按最大速度的比例设置速度(0-1)
 	 */
 	int JSetTargetVelR(double dVelRatio);
@@ -161,6 +170,8 @@ public:
 	LONG WriteSocketValueF(std::string ascii, double tValue);
 	LONG WriteSocketValueN(std::string ascii, int tValue);
 	LONG WriteSocketCommand(std::string ascii);
+	LONG GetSocketValueF(std::string ascii, float& tValue);
+	LONG GetSocketValueN(std::string ascii, int& tValue);
 
 	//LONG RunForcerBuffer();  //运行力控buffer,不断判断弹簧压合到特定位置,到特定位置控制力控轴停下来
 	//LONG RunSpringForcerBuffer();  //运行弹簧力控buffer,循环判断多段弹簧压合位置,每次到压合位置Z轴停下来

+ 85 - 34
Output/inc/Module/CBondHead.h

@@ -8,6 +8,7 @@
 #include "CTransferTable.h"
 #include "CXYCalib.h"
 #include "TipMatrix.h"
+
 class __declspec(dllexport) CBondHead :
     public CModule
 {
@@ -39,35 +40,59 @@ public:
 	void SetLookUpCamera(CCameraBase* camera) { m_pLookUpCamera = camera; }
 	void SetWaferTransferTable(CTransferTable* tt) { m_pWaferTransferTable = tt; }
 	void SetWaffleTransferTable(CTransferTable* tt) { m_pWaffleTransferTable = tt; }
-
+	virtual void SetHighCamera(CCameraBase* camera) {}
+	virtual void SetLowCamera(CCameraBase* camera) { m_pLowCamera = camera; }
+	virtual CXYCalib* GetLowCameraCalib() { return m_pLowXYCalib; }
+	virtual CXYCalib* GetHighCameraCalib() { return nullptr; }
+	virtual CCTDCalib* GetLowCTDCalib() { return m_pLowCTDCalib; }
 	//void SetForceControl(CForceControl* force) { m_pForceControl = force; }
 	CForceControl* GetForceControl() { return m_pForceControl; }
 	CXYCalib* GetLookUpCameraCalib() { return m_pLookUpXYCalib; }
 	CRCalib* GetHeadRCalib() { return m_pRCalib; }
 	bool GetIsLocationAll() { return m_bIsLocationAll; }
 
-	virtual void SetHighCamera(CCameraBase* camera) {}
-	virtual void SetLowCamera(CCameraBase* camera) { m_pLowCamera = camera; }
-	virtual CXYCalib* GetLowCameraCalib() { return m_pLowXYCalib; }
-	virtual CXYCalib* GetHighCameraCalib() { return nullptr; }
-	virtual CCTDCalib* GetLowCTDCalib() { return m_pLowCTDCalib; }
+
 
 
 	virtual LONG ToHome();
     virtual LONG ToSafePosition();
+	virtual LONG GetParam();
 	LONG XYMove(double x, double y, bool bSync = true);
 	LONG XYMoveTo(double x,double y, bool bSync = true);
 	LONG XYZMoveTo(double x, double y,double z);
 	LONG XYZRMoveTo(double x, double y, double z,double r);
 
-	LONG MoveToPreBondPoint();
-	LONG MoveToNextBondPoint();
 
-	virtual void SetPickHTestIndex(int index) = 0;
-	virtual void SetBondHTestIndex(int index) = 0;
-	virtual LONG PickHightTest();//调用之前先SetIndex
-	virtual LONG AllBondHighTest() = 0;
-	virtual LONG BondHighTest();
+#pragma region  自动流程
+
+	virtual LONG MoveToPickGrabPos(bool waitDone = true);
+	virtual LONG PickDie(int index);//拍照,取晶,并上行到上视拍照位,主要用于自动流程
+
+	virtual LONG XYZToLookUpGrabPos();  //注意Z轴 去安全位置
+	virtual LONG LookUpGrab(int index, X_Y_ANGLE_STRUCT& result);//移动到上视拍照位,拍照结果放到结构体中
+
+	virtual LONG MoveToBondGrabPos(int index, XY_DOUBLE_STRUCT grabPosOffset = { 0,0 });
+	virtual LONG BondGrab(int index, X_Y_ANGLE_STRUCT& result); //返回的拍照结果为物理单位
+	virtual LONG PcbAln();  //Pcb对点
+	virtual LONG ToBondPos_AddOffset(int index, X_Y_ANGLE_STRUCT bondOffset, X_Y_ANGLE_STRUCT lookUpOffset, bool waitDone = true);//传入物理位置
+	virtual LONG BondDieDown(int index) = 0;//传入物理位置
+	virtual LONG BondDieUp(bool waitDone = true);
+
+#pragma endregion
+
+
+#pragma region  手动流程
+	virtual LONG PlaceDie(int index, X_Y_ANGLE_STRUCT lookUpOffsetPixel) = 0;
+	virtual LONG HeadMoveToBondPos(int index, bool bGrab = true, X_Y_ANGLE_STRUCT lookUpOffsetPixel = { 0,0,0 });//移动到拾取位,带补偿
+
+#pragma endregion
+
+
+
+
+
+	LONG MoveToPreBondGrabPoint();
+	LONG MoveToNextBondGrabPoint();
 
 	virtual LONG VacuumOn(long lDelay);		//真空开,真空延时,ms
 	virtual LONG VacuumOff(long lDelay);		//真空关,吹汽延时,ms
@@ -86,30 +111,21 @@ public:
 	virtual LONG MoveNozzleToLowCamera();
 
 	//吸嘴取晶
-	virtual LONG MoveToPickGrabPos(bool waitDone = true);
-	virtual LONG PickGrab(int index, X_Y_ANGLE_STRUCT& result);//中转台拍照,返回拍照结果,拍照结果仅用于拾取偏移,不存储
-	//virtual LONG MoveToPickPos();//移动到拾取位,未拍照	
 
-	virtual LONG PickDie(int index);//拍照,取晶,并上行到上视拍照位,主要用于自动流程
-	
+	virtual LONG PickGrab(int index, X_Y_ANGLE_STRUCT& result);//中转台拍照,返回拍照结果,拍照结果仅用于拾取偏移,不存储
 	virtual LONG PickDieDown(int index, X_Y_ANGLE_STRUCT result);//传入拍照结果进行拾取补偿偏移
 	virtual LONG PickUpToGrabPos();
 	virtual LONG PickDieUp(bool waitDone = true);//上行到安全位置
 
 	//上视拍照
-	virtual LONG XYZToLookUpGrabPos();
-	virtual LONG LookUpGrab(int index,X_Y_ANGLE_STRUCT& result);//移动到上视拍照位,拍照结果放到结构体中
+
 	LONG MoveToLookUpAndGrab(int index, X_Y_ANGLE_STRUCT& result);
 
 	//吸嘴固晶
-	virtual LONG PlaceDie(int index, X_Y_ANGLE_STRUCT lookUpOffsetPixel) = 0;
-	virtual LONG HeadMoveToBondPos(int index, bool bGrab = true, X_Y_ANGLE_STRUCT lookUpOffsetPixel = {0,0,0});//移动到拾取位
-	virtual LONG CameraMoveToBondPos(int index, bool bGrab = true, X_Y_ANGLE_STRUCT lookUpOffsetPixel = { 0,0,0 });//移动到拾取位
-	virtual LONG MoveToBondGrabPos(int index);
-	virtual LONG BondGrab(int index, X_Y_ANGLE_STRUCT& result); //返回的拍照结果为物理单位
-	virtual LONG ToBondPos_AddOffset(int index, X_Y_ANGLE_STRUCT bondOffset, X_Y_ANGLE_STRUCT lookUpOffset,bool bIsHard = true, bool waitDone = true);//传入物理位置
-	virtual LONG BondDieDown(int index) = 0;//传入物理位置
-	virtual LONG BondDieUp(bool waitDone = true);
+	//virtual LONG CameraMoveToBondPos(int index, bool bGrab = true, X_Y_ANGLE_STRUCT lookUpOffsetPixel = { 0,0,0 });//移动到拾取位,带补偿,可用于观察补偿值是否正确
+	//virtual LONG ToBondGrabPos_AddOffset(int index, X_Y_ANGLE_STRUCT bondOffset, X_Y_ANGLE_STRUCT lookUpOffset, bool waitDone = true);//传入物理位置
+
+	virtual LONG BondCheck(int index) { return OK; };
 	virtual LONG FindForce(double force);		//寻压,寻找力控轴反馈位置
 	virtual LONG UpdateForce(double dForce);		//切换力的大小
 	virtual LONG GetCurForceCurrentPercent(short& current);
@@ -119,6 +135,9 @@ public:
 	//virtual LONG PickHightTest();
 	//virtual LONG BondHighTest();
 
+
+
+
 	//标定
 	//virtual LONG HighCameraCTDCalib() { return OK; }
 	virtual LONG LowCameraPosCalib();
@@ -136,12 +155,14 @@ public:
 	virtual LONG HighCameraXYCalib() { return OK; };
 	virtual LONG LookUpCameraXYCalib();
 
-	//创建流程模板
-	virtual LONG CreatePickTemp(int dieIndex);
-	virtual LONG CreateLookUpTemp(int dieIndex);
-	virtual LONG CreateBondTemp(int dieIndex);
-
+	//创建模板
+	virtual LONG CreateLowCameraTemp(UINT &iTemplateId);
+	virtual LONG CreateHighCameraTemp(UINT& iTemplateId);
+	virtual LONG CreateLookUpCameraTemp(UINT& iTemplateId);
 
+	//创建流程模板
+	virtual LONG CreateBondMatrixTemplate(BOND_MATRIX_TEMPLATE_TYPE eType, UINT iBondInfoId);
+	virtual LONG CreatePrStrategy(vector<UINT> vecTemplateId);
 	//力控标定
 	virtual LONG SpringForceCalib();
 	virtual LONG CurrentForceCalib();
@@ -167,6 +188,15 @@ public:
 	//力控测试
 	virtual LONG ForceTest();
 
+	//高度测试
+	virtual void SetPickHTestIndex(int index);
+	virtual void SetBondHTestIndex(int index);
+	virtual LONG PickHightTest();//调用之前先SetIndex
+	virtual LONG AllBondHighTest() = 0;
+	virtual LONG BondHighTest();
+
+	virtual LONG NozzleHighTest(int nozzleIndex);//index 比较难传?
+
 	//创建流程模板
 	//virtual LONG CreatePickTemp();
 	
@@ -174,6 +204,13 @@ public:
 
 	//virtual LONG CreateBondTemp();
 
+	//界面测试
+	void ViewTest() 
+	{
+		m_dSafePosZ++;
+		m_pModuleConfigDB->SetConfigParam(ULTRAHEAD_TABLE_NAME ,*GetConfigVector());
+	}
+
 protected:
 	BOND_PARAM m_stBondParam;
 	CBondMatrix* m_pBondMatrix = nullptr;
@@ -220,6 +257,9 @@ protected:
 	double m_dLookUpGrabPosY = 0;
 	double m_dLookUpGrabPosZ = 0;
 
+	//double m_dBond
+	double m_dBondGrabPosZ = 0;			//bondGrabPosZ
+
 	double m_dPreChangeNozzleDisY = 0;//预更换吸嘴偏差位置
 	double m_dNozzlePosZ = 0;		  //吸嘴架位置Z
 
@@ -248,8 +288,19 @@ protected:
 
 	double m_dGivenForceZPos = 0;		//拾取放置芯片时力控轴的反馈位置
 
-	double m_dBondGrabPosZ = 0;			//bondGrabPosZ
+
 
 	bool m_bAngleOffsetEnabled = false;
+
+	double m_dNozzleHTestX = 0;
+	double m_dNozzleHTestY = 0;
+	double m_dNozzleHTestSearchPosZ = 0;
+
+	//测高
+	int m_nPickHNozzleIndex = 0;
+	int m_nBondHNozzleIndex = 0;
+	double m_dPickContactPosZ = 0;   //拾取测高高度
+	double m_dBondContactPosZ = 0;		//固晶测高高度
+
 };
 

+ 25 - 11
Output/inc/Module/CBondMatrix.h

@@ -28,10 +28,15 @@ namespace ns_mat
 		PICKBOND_PARAM_STRUCT stCalibPickParam;		//校准台取晶参数
 		PICKBOND_PARAM_STRUCT stBondParam;			//固晶台固晶参数
 
+		bool bIsAllBondAln = false;						//固晶点是否逐个对点
+		bool bIsPcbAln = false;							//是否Pcb对点
+
 		UINT nTemplate_BondFront = 0;					//固前检测模板ID号 0为不检测
 		UINT nTemplate_BondBack = 0;					//固后检测模板ID号 0为不检测
 		//UINT nTemplate_SearchModel;					//到模板位置后是否拍照 0为不拍照
-		UINT nTemplate_Bond = 0;						//固晶点对点模板ID号 
+		UINT nTemplate_PcbAln = 0;						//PCB 对点 
+
+		UINT nTemplate_BondAln = 0;						//固晶点对点模板ID号 
 		UINT nTemplate_Calib = 0;						//中转台校准模板号  0为不拍照
 		UINT nTemplate_LookUp = 0;						//上视对点模板号    0为不拍照
 
@@ -47,6 +52,7 @@ namespace ns_mat
 		UINT iPcbMatId;						//对应的pcb号
 		CALIB_DIE_TYPE nCalibType;			//校准方式 0:不校准  1:下视校准  2:校准台校准
 		DIE_SOURCE nWaffleOrWaffer;			//0:华夫盒,1:晶圆台
+		double dDieHeight;				//芯片厚度
 		PICK_PARAM nPickParam;
 		BOND_PARAM nBondParam;
 	}PROCESS_INFO_STRUCT;
@@ -106,11 +112,14 @@ namespace ns_mat
 
 		X_Y_ANGLE_STRUCT stLookUpOffset;	//上视拍照偏差结果
 		XY_DOUBLE_STRUCT stSetBondPosition;	//程序设置的固晶位置
+
+		X_Y_ANGLE_STRUCT stAlnOffset;		//固晶点对点偏移
+		X_Y_ANGLE_STRUCT stPcbAlnOffset;		//PCB 对点偏移
+
 		XY_DOUBLE_STRUCT stAlnBondPosition;	//对点后的固晶位置
-		XY_DOUBLE_STRUCT stAlnOffset;		//固晶点对点偏移
-		double dAlnAngle;					//对点角度
-		XY_DOUBLE_STRUCT stCheckOffset;		//固后检测结果
-		double dCheckAngle;					//固后检测角度 
+		//double dAlnAngle;					//对点角度
+		X_Y_ANGLE_STRUCT stCheckOffset;		//固后检测结果
+		//double dCheckAngle;					//固后检测角度 
 
 		_BONDED_STATUS_STRUCT()
 		{
@@ -122,9 +131,9 @@ namespace ns_mat
 			stPtLeftTop = 0;
 			stSetBondPosition = 0;
 			stAlnBondPosition = 0;
-			dAlnAngle = 0;
-			dCheckAngle = 0;
-			stCheckOffset = 0.0;
+			//dAlnAngle = 0;
+			//dCheckAngle = 0;
+			stCheckOffset = { 0,0,0 };
 		}
 	} BOND_STATUS_STRUCT;
 
@@ -194,7 +203,7 @@ namespace ns_mat
 		LONG SetCurrentIndex(UINT nIndex);				//设置当前固晶点
 
 		LONG GetAllBondMatrixInfo(std::vector <POINT_INFO_STRUCT>& stPointInfo);
-		//获取包括当前固晶点开始的下个固晶点
+		//获取包括当前固晶点开始的下个固晶点  若返回-1 说明已经到结尾,没有下一个了
 		UINT GetNextBondIndex(UINT nIndex);							//获取从当前固晶点开始的下个固晶点
 		UINT GetPrevBondIndex(UINT nIndex);
 
@@ -212,8 +221,8 @@ namespace ns_mat
 		LONG GetAllBondParam(UINT nPtIndex,BOND_PARAM& bondParam);
 		LONG GetAllPickParam(UINT nPtIndex, PICK_PARAM& pickParam);
 
-		LONG SetBondParam(int nPtIndex, BOND_PARAM bondParam);	//要找到同一矩阵的所有点?
-		LONG SetPickParam(int nPtIndex, PICK_PARAM pickParam);  //要找到同一矩阵的所有点?
+		LONG SetBondParam(int nPtIndex, const BOND_PARAM& bondParam);	//要找到同一矩阵的所有点?
+		LONG SetPickParam(int nPtIndex, const PICK_PARAM& pickParam);  //要找到同一矩阵的所有点?
 
 		/// <summary>
 		/// 设置固晶点对点信息,设置时,固晶点编号所应就的PCB一起设置并计算对点的位置
@@ -226,6 +235,11 @@ namespace ns_mat
 		/// <returns></returns>
 		LONG SetBondAlnInfo(UINT nPtIndex, XY_DOUBLE_STRUCT stBasePosn, DOUBLE dBaseAngle, XY_DOUBLE_STRUCT stAlnPosn, DOUBLE dAlnAngle);
 		
+
+		LONG SetPcbAlnOffset(X_Y_ANGLE_STRUCT offset);  //设置PCB补偿参数
+		LONG GetPcbAlnOffset(int index, X_Y_ANGLE_STRUCT& offset);
+
+
 		LONG SetBondAlnOffset(int index, X_Y_ANGLE_STRUCT offset);	//流程数据
 		LONG SetLookupOffset(int index, X_Y_ANGLE_STRUCT offset);	//流程数据
 		LONG ResetAlnStatus(UINT nPtIndex);										//清除对点状态,固晶点编号所对应的PCB一起清除

+ 16 - 142
Output/inc/Module/CCalibrationConfig.h

@@ -1,7 +1,7 @@
 #pragma once
 
 #include "CDataBaseOperate.H"
-#include "CConfigBase.h"
+#include "CConfigBaseManage.h"
 
 #ifdef CALIB_CONFIG_DLL
 #define DLL_CALIB_CONFIG_API __declspec(dllexport)
@@ -19,159 +19,33 @@
 #define VERTICAL_MEASURE_TABLE_NAME                     "Vertical_Measure"
 #define CALIB_TIP_RESULT                                "Tip_R_CTD_CalibResult"
 
-
-//#define BOND_LOW_CAMERA_CALIB_TABLE_NAME			"BondLowCamera"
-//#define BOND_HIGH_CAMERA_CALIB_TABLE_NAME			"BondHighCamera"
-//#define BOND_WAFFLE_CAMERA_CALIB_TABLE_NAME			"WaffleCamera"
-//#define BOND_WAFER_CAMERA_CALIB_TABLE_NAME			"WaferCamera"
-//#define BOND_LOOKUP_CAMERA_CALIB_TABLE_NAME			"BHLookUpCamera"
-
+const static std::vector<std::string> g_vetCalibrationConfigTableName = {
+		CALIB_CTD_TABLE_NAME,
+		CALIB_XY_TABLE_NAME,
+		CALIB_R_TABLE_NAME,
+		CALIB_STEP_R_RESULT_TABLE_NAME,
+		FORCE_CONTROL_TABLE_NAME,
+		HORIZONTAL_MEASURE_TABLE_NAME,
+		VERTICAL_MEASURE_TABLE_NAME,   
+		CALIB_TIP_RESULT           
+};
 
 namespace ns_db
 {
-
-	//struct NozzleCalibParam
-	//{
-	//	int nNozzleId = 0;
-	//	XY_DOUBLE_STRUCT stRotCenter = { 0,0 }; //吸嘴对应的旋转中心X
-	//	XY_DOUBLE_STRUCT stBHHighCameraToNozzle = { 0,0 };
-	//	XY_DOUBLE_STRUCT stBHLowCameraToNozzle = { 0,0 };
-	//	XY_DOUBLE_STRUCT stWHCameraToNozzle = { 0,0 };
-	//	bool bIsRotationCalib = false;	//已校准标记
-	//	bool bIsHighCTDCalib = false;		//已校准标记
-	//	bool bIsLowCTDCalib = false;         //已校准标记
-	//	int nRTempID = 0;                   //旋转中心标定吸嘴模板ID
-	//	//int nCTDBHLookUpTempID = 0;           //CTD标定上视模板ID
-	//	//int nCTDHighBondTempID = 0;             //CTD标定固晶相机模板ID
-	//	//int nCTDLowBondTempID = 0;             //CTD标定固晶相机模板ID
-	//	int nCTDWHNozzleTempID = 0;             //华夫盒取晶头上视相机
-
-	//};
-
     class DLL_CALIB_CONFIG_API CCalibrationConfig : public CDataBaseOperate
     {
 	public:
 		CCalibrationConfig();
-
-		LONG GetConfigParam(string strTableName, vector<MODULE_CONFIG_STRUCT>& vecConfig);
-		LONG GetConfigParam(string strTableName, vector<CONFIG_BASE_STRUCT>& vecConfig);
-
-		LONG SetConfigParam(string strTableName, vector<MODULE_CONFIG_STRUCT> vecconfig);
-		LONG SetConfigParam(string strTableName, vector<CONFIG_BASE_STRUCT> vecconfig);
-
-	private:
-		std::unique_ptr<CConfigBase> m_ConfigBaseDb;
-
+		CConfigBaseManage* m_pConfigBaseManage;
 		LONG SaveDB() override;
 		LONG LoadDB() override;
 
-		static std::mutex m_mutex;
-
-
-#pragma region XYCALIB
-	private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecXYCalibParam;
-	public:
-		LONG GetXYCalibParam(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetXYCalibParam() { return m_vecXYCalibParam; }
-		LONG SetXYCalibParam(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetXYCalibParam(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-
-#pragma endregion
-
-#pragma region LookUpCalib
-	private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecCTDCalibParam;
-	public:
-		LONG GetCTDCalibParam(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetCTDCalibParam() { return m_vecCTDCalibParam; }
-		LONG SetCTDCalibParam(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetCTDCalibParam(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-#pragma endregion
-
-#pragma region RCalib
-	private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecRCalibParam;
-	public:
-		LONG GetRCalibParam(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetRCalibParam() { return m_vecRCalibParam; }
-		LONG SetRCalibParam(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetRCalibParam(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-#pragma endregion
-
-#pragma region ForceCalib
-	private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecForceCalib;
 	public:
-		LONG GetForceCalibParam(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetForceCalibParam() { return m_vecForceCalib; }
-		LONG SetForceCalibParam(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetForceCalibParam(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-
-#pragma endregion 
-
-#pragma region 吸嘴相关标定结果
-
-		//vector<NozzleCalibParam> m_vetNozzleCalibParam;
-
-		//LONG LoadNozzleCalibParam(vector<NozzleCalibParam>& nozzleParam);
-		//LONG SaveCalibForceParam();
-		////LONG SaveCalibForceParam(int headID, string name, FORCE_CONTROL VecCalib_R);
-
-		//LONG GetNozzleCalibParam(int index, NozzleCalibParam& param);
-		//LONG SetNozzleCalibParam(int index, NozzleCalibParam param);
-
-#pragma endregion
+		vector<CONFIG_BASE_STRUCT> GetConfigParam(string sTableName);
+		LONG GetConfigParam(string sTableName, vector<MODULE_CONFIG_STRUCT>* vecconfig);
 
-//#pragma region BondHighCamera
-//	private:
-//		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_BondHighCamera;
-//	public:
-//		LONG GetConfigParam_BondHighCamera(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-//		vector<CONFIG_BASE_STRUCT> GetConfigParam_BondHighCamera() { return m_vecConfig_BondHighCamera; };
-//		LONG SetConfigParam_BondHighCamera(vector<CONFIG_BASE_STRUCT> vecconfig);
-//		LONG SetConfigParam_BondHighCamera(vector<MODULE_CONFIG_STRUCT> vecconfig);
-//#pragma endregion	
-//
-//#pragma region BondLowCamera
-//	private:
-//		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_BondLowCamera;
-//	public:
-//		LONG GetConfigParam_BondLowCamera(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-//		vector<CONFIG_BASE_STRUCT> GetConfigParam_BondLowCamera() { return m_vecConfig_BondLowCamera; };
-//		LONG SetConfigParam_BondLowCamera(vector<CONFIG_BASE_STRUCT> vecconfig);
-//		LONG SetConfigParam_BondLowCamera(vector<MODULE_CONFIG_STRUCT> vecconfig);
-//#pragma endregion	
-//
-//#pragma region WaferCamera
-//	private:
-//		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_WaferCamera;
-//	public:
-//		LONG GetConfigParam_WaferCamera(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-//		vector<CONFIG_BASE_STRUCT> GetConfigParam_WaferCamera() { return m_vecConfig_WaferCamera; };
-//		LONG SetConfigParam_WaferCamera(vector<CONFIG_BASE_STRUCT> vecconfig);
-//		LONG SetConfigParam_WaferCamera(vector<MODULE_CONFIG_STRUCT> vecconfig);
-//#pragma endregion	
-//
-//#pragma region WaffleCamera
-//	private:
-//		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_WaffleCamera;
-//	public:
-//		LONG GetConfigParam_WaffleCamera(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-//		vector<CONFIG_BASE_STRUCT> GetConfigParam_WaffleCamera() { return m_vecConfig_WaffleCamera; };
-//		LONG SetConfigParam_WaffleCamera(vector<CONFIG_BASE_STRUCT> vecconfig);
-//		LONG SetConfigParam_WaffleCamera(vector<MODULE_CONFIG_STRUCT> vecconfig);
-//#pragma endregion	
-//
-//#pragma region BHLookUpCamera
-//	private:
-//		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_BHLookUpCamera;
-//	public:
-//		LONG GetConfigParam_BHLookUpCamera(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-//		vector<CONFIG_BASE_STRUCT> GetConfigParam_BHLookUpCamera() { return m_vecConfig_BHLookUpCamera; };
-//		LONG SetConfigParam_BHLookUpCamera(vector<CONFIG_BASE_STRUCT> vecconfig);
-//		LONG SetConfigParam_BHLookUpCamera(vector<MODULE_CONFIG_STRUCT> vecconfig);
-//#pragma endregion	
+		LONG SetConfigParam(string sTableName, vector<CONFIG_BASE_STRUCT> vecconfig, bool bSendNotice = true);
+		LONG SetConfigParam(string sTableName, vector<MODULE_CONFIG_STRUCT> vecconfig, bool bSendNotice = true);
 
     };
 

+ 2 - 0
Output/inc/Module/CCameraBase.h

@@ -54,6 +54,8 @@ public:
     int GetCameraID() { return m_iCameraId; };
     string GetCameraDescribe() { return m_sDescribe; };
     bool IsEnable() { return m_bEnable; };
+    UINT GetImageMaxWidth() { return m_iWidthMax; };
+    UINT GetImageMaxHeight() { return m_iHeightMax; };
     UINT GetImageWidthCenter();
     UINT GetImageHeightCenter();
     LONG SaveImage2File(ImageInfo image, const char* fileName);//±£´æÍ¼Ïñµ½Îļþ

+ 15 - 27
Output/inc/Module/CConfigBase.h

@@ -124,33 +124,17 @@ namespace ns_db
 
 	}MODULE_CONFIG_STRUCT;
 
-	// 定义函数指针类型
-	using GetFunctionPtr = vector<CONFIG_BASE_STRUCT>(*)();
-	using SetFunctionPtr = std::function<LONG(CDataBaseOperate*, std::vector<CONFIG_BASE_STRUCT>)>;
-
-	typedef struct 
-	{
-		GetFunctionPtr get;
-		SetFunctionPtr set;
-	} CONFIG_FUNCTION_PTR;
-
-
 	class DLL_CONFIG_BASE_API CConfigBase
 	{
-	private:
-		// 函数注册表
-		std::map<std::string, CONFIG_FUNCTION_PTR> m_FunctionRegistry;
-
 	public:
-		// 注册函数
-		void RegisterFunction(const std::string& name,GetFunctionPtr get, SetFunctionPtr set);
-		LONG CallSetFunction(const std::string& name, CDataBaseOperate* obj, std::vector<CONFIG_BASE_STRUCT> vecconfig);
-		
-		CConfigBase(string sPathFile, CppSQLite3DB* pDB);
 
+		CConfigBase(string sPathFile,string sTableName, CppSQLite3DB* pDB);
+
+		LONG LoadConfigDB(string strTableName);
 		LONG LoadConfigDB(string strTableName, vector<CONFIG_BASE_STRUCT>& vecConfig);
 		LONG SaveConfigDB(string strTableName, vector<CONFIG_BASE_STRUCT>* vecConfig);
-
+		LONG SaveConfigDB(string strTableName);
+	public:
 		LONG Read(vector<CONFIG_BASE_STRUCT> stConfig, const CHAR* key, string& value);
 		LONG Read(vector<CONFIG_BASE_STRUCT> stConfig, const CHAR* key, CHAR* value, UINT len);
 		LONG Read(vector<CONFIG_BASE_STRUCT> stConfig, const CHAR* key, LONG* value);
@@ -168,17 +152,21 @@ namespace ns_db
 		LONG Write(vector<CONFIG_BASE_STRUCT>* stConfig, const CHAR* key, bool value);
 
 		LONG Append(vector<CONFIG_BASE_STRUCT>* stConfig, MODULE_CONFIG_STRUCT config);
-
+	public:
 		//在ConfigBase 中查找 ModuleConfig 中需要的数据
-		LONG GetConfigParam(vector<CONFIG_BASE_STRUCT> stConfig, vector<MODULE_CONFIG_STRUCT>* vecconfig);
-
+		LONG GetConfigParam(vector<CONFIG_BASE_STRUCT> stBaseConfig, vector<MODULE_CONFIG_STRUCT>* vecconfig);
+		LONG GetConfigParam(vector<MODULE_CONFIG_STRUCT>* vecconfig);
+		LONG GetConfigParam(vector<CONFIG_BASE_STRUCT>& vecconfig);
 		//将ModuleConfig的数据设置到ConfigBase中
-		LONG SetConfigParam(vector<CONFIG_BASE_STRUCT>* stConfig, vector<MODULE_CONFIG_STRUCT> vecconfig);
+		LONG SetConfigParam(vector<CONFIG_BASE_STRUCT>* stBaseConfig, vector<MODULE_CONFIG_STRUCT> vecconfig);
+		LONG SetConfigParam(vector<MODULE_CONFIG_STRUCT> vecconfig);
+		LONG SetConfigParam(vector<CONFIG_BASE_STRUCT> vecconfig);
 
 	private:
-		CppSQLite3DB* m_pDB;
+		CppSQLite3DB*	m_pDB;
 		std::string     m_sPathFile = "";
-
+		std::string		m_sTableName = "";
+		std::vector<CONFIG_BASE_STRUCT> m_vecBaseConfig;
 	};
 
 

+ 44 - 0
Output/inc/Module/CConfigBaseManage.h

@@ -0,0 +1,44 @@
+#pragma once
+#include "CppSQLite3.h"
+#include "dt.h"
+
+#include "CProduct.h"
+#include "CMachineSetup.h"
+#define CONFIG_BASE_DLL
+#define DATABASEOPERATE_DLL
+#include "CConfigBase.h"
+
+#include <string>
+#include <windows.h>
+#include <mutex>
+
+using namespace std;
+
+namespace ns_db
+{
+    class __declspec(dllexport) CConfigBaseManage
+    {
+    private:
+        std::map<std::string, CConfigBase*> g_mapConfigBase;
+
+    public:
+        static CConfigBaseManage* GetInstance();
+
+        static CConfigBaseManage* m_pInstance;
+        static std::mutex m_Mutex;
+
+        CConfigBaseManage();
+
+        void AddConfigBase(std::string sTableName,CConfigBase* pConfigBase);
+        CConfigBase* GetCofigBasePtr(std::string sTableName);
+   
+        LONG GetConfigParam(string sTableName, vector<CONFIG_BASE_STRUCT>& vecconfig);
+        LONG GetConfigParam(string sTableName, vector<MODULE_CONFIG_STRUCT>* vecModuleConfig);
+
+        LONG SetConfigParam(string sTableName, vector<CONFIG_BASE_STRUCT>* vecBaseConfig, vector<MODULE_CONFIG_STRUCT> vecModuleConfig);
+        LONG SetConfigParam(string sTableName, vector<MODULE_CONFIG_STRUCT> vecconfig);
+        LONG SetConfigParam(string sTableName, vector<CONFIG_BASE_STRUCT> vecconfig);
+    };
+
+
+}

+ 2 - 0
Output/inc/Module/CError.h

@@ -48,6 +48,7 @@ typedef enum
 	ERR_SET_STEP_PARAM_FAIL,
 	ERR_MODLE_INII_FAIL,
 	ERR_CALIB_FAIL, 
+	ERROR_TABLE_NOT_FOUND,
 	ERR_HOT_ZONE_FAIL,
 	ERR_UNKNOWN_BUTTON_CMD
 }ERRID_COMMON;
@@ -81,6 +82,7 @@ const static map<ERRID_COMMON, string> g_mapErrorChsDescribe = {
 	{ERR_GET_STEP_PARAM_FAIL," 获取Step运行参数错误。"},
 	{ERR_SET_STEP_PARAM_FAIL," 设置Step运行参数错误。"},
 	{ERR_CALIB_FAIL,"标定过程失败"},
+	{ERROR_TABLE_NOT_FOUND,"错误的表名称"},
 	{ERR_HOT_ZONE_FAIL,"触发防撞热区错误"},
 	{ERR_UNKNOWN_BUTTON_CMD,"按钮未找到对应的命令"}
 };

+ 9 - 2
Output/inc/Module/CForceControl.h

@@ -59,13 +59,15 @@ public:
      * @return 操作结果,LONG 类型,通常 0 表示成功,非 0 表示失败
      * 该函数只控制 Z 轴进行高度测试,不控制 XY 轴,使用前应先控制 XY 轴到位
      */
-    LONG HightTest(/*double force, */double givenForce, double searchPos, double& hight);
+    LONG HightTest(/*double force, *//*double givenForce,*/ double searchPos, double& hight);
 
 
 
-    //寻
+    //寻
     LONG FindForce(double actForce, double searchForce = 500, double givenForceZ = 4000);
 
+
+
     /**
      * @brief 顶针高度测试函数
      * @param force 测试时所需的力值
@@ -149,6 +151,9 @@ public:
 private:
     void DataChangNotice(string strDbName, string strTableName);
 
+    //根据给定电流,下压到得到停止信号
+    LONG FindContactPos(double current);
+
 private:
     vector<MODULE_CONFIG_STRUCT> m_vecConfigStruct;
     CAxis* m_pAxisX = nullptr;  // X 轴对象指针,用于控制 X 方向的运动
@@ -172,4 +177,6 @@ private:
 
     double m_dTestForce = 0;
     double m_dTestResult = 0;
+
+    const int m_nTimeOut = 30000;
 };

+ 9 - 2
Output/inc/Module/CMachineCalibration.h

@@ -115,8 +115,8 @@ namespace ns_db
         //得到关系式: 力 = 电流 * A + B
         int nHeadId = 0;
         std::string sHeadName = "";
-        double dA1 = 1;     //电流系数
-        double dA2 = 1;     //弹簧系数
+        double dA1 = 0;     //电流系数
+        double dA2 = 0;     //弹簧系数
         double dB = 0;
         double dGivenForceZPos = 0;//压合距离,用于判断接触
         std::string sCurrentPts = "";
@@ -127,6 +127,13 @@ namespace ns_db
         double dGivenCurrent = 0;//压合距离,用于判断接触
         vector<POINTF> vetSpringPts;   //POINTF的x弹簧压合位置,y 为力
 
+        double dZeroForceCurrent = 0; //0g力对应的电流
+        double dMinCurrent = 0;  //音圈电机最小电流
+        double dMaxCurrent = 0;  //音圈电机最大电流
+        double dMaxPressDistance = 0; //力控轴最大压合距离,用于安全防护
+        //double dMaxCurrentForce = 0;  //最大电流对应的力
+
+
         double dFTestSearchPosZ = 0;//力控测试搜索位置
         double dTestPosX = 0;
         double dTestPosY = 0;

+ 0 - 25
Output/inc/Module/CManageDB.h

@@ -19,31 +19,6 @@ using namespace std;
 
 namespace ns_db
 {
-    const static std::map<std::string, std::string> g_mapDatabaseList = {
-        {MODULECONFIG_DATABASE_NAME ,  BONDHEAD_CONFIG_TABLE_NAME},
-        {MODULECONFIG_DATABASE_NAME ,  WAFERHEAD_CONFIG_TABLE_NAME},
-        {MODULECONFIG_DATABASE_NAME ,  WAFFLEHEAD_CONFIG_TABLE_NAME},
-        {MODULECONFIG_DATABASE_NAME ,  EJECTOR_CONFIG_TABLE_NAME},
-        {MODULECONFIG_DATABASE_NAME ,  WAFERTABLE_CONFIG_TABLE_NAME},
-        {MODULECONFIG_DATABASE_NAME ,  WAFER_CALIB_TABLE_CONFIG_TABLE_NAME},
-        {MODULECONFIG_DATABASE_NAME ,  WAFFLE_CALIB_TABLE_CONFIG_TABLE_NAME	},
-        {MODULECONFIG_DATABASE_NAME ,  BOND_TABLE_CONFIG_TABLE_NAME},
-        {MODULECONFIG_DATABASE_NAME ,  NOZZLE_TABLE_CONFIG_TABLE_NAME},
-        {MODULECONFIG_DATABASE_NAME ,  HARDWARE_SWICH_TABLE_NAME},
-        {MODULECONFIG_DATABASE_NAME ,  ULTRAHEAD_TABLE_NAME	},
-        {MODULECONFIG_DATABASE_NAME ,  ULTRAHEAD_DIAGNOSIS_TABLE_NAME},
-
-        {CALIBCONFIG_DATABASE_NAME , CALIB_CTD_TABLE_NAME},
-        {CALIBCONFIG_DATABASE_NAME , CALIB_XY_TABLE_NAME},
-        {CALIBCONFIG_DATABASE_NAME , CALIB_R_TABLE_NAME	},
-        {CALIBCONFIG_DATABASE_NAME , CALIB_STEP_R_RESULT_TABLE_NAME},
-        {CALIBCONFIG_DATABASE_NAME , FORCE_CONTROL_TABLE_NAME },
-        {CALIBCONFIG_DATABASE_NAME , HORIZONTAL_MEASURE_TABLE_NAME },
-        {CALIBCONFIG_DATABASE_NAME , VERTICAL_MEASURE_TABLE_NAME},
-        {CALIBCONFIG_DATABASE_NAME , CALIB_TIP_RESULT}
-
-    };
-
     class __declspec(dllexport) CManageDB
     {
     public:

+ 2 - 0
Output/inc/Module/CMessageBox.h

@@ -53,6 +53,7 @@ enum AlarmID
 	WriteAcsBufferError,
 	GetAcsBufferError,
 	WriteSocketError,
+	GetSocketError,
 	WriteSerialError,
 	SetAxisParamError,
 
@@ -95,6 +96,7 @@ enum AlarmID
 	RCalibError,
 	HandEyeCalibError,
 	FindForceTimeOut,
+	ExceedMaxPressDis,//³¬³ö×î´óѹºÏ¾àÀë
 
 	//Ìáʾ
 	PleasePlaceCalss,

+ 35 - 154
Output/inc/Module/CModuleConfig.h

@@ -5,7 +5,7 @@
 #include <windows.h>
 #include <mutex>
 
-#include "CConfigBase.h"
+#include "CConfigBaseManage.h"
 #include "CDataBaseOperate.h"
 
 namespace ns_db
@@ -33,19 +33,45 @@ namespace ns_db
 #define HARDWARE_SWICH_TABLE_NAME					"HardwareSwich"
 #define ULTRAHEAD_TABLE_NAME						"UltraHead"
 #define ULTRAHEAD_DIAGNOSIS_TABLE_NAME				"UltraHead_Diagnosis"
+
+#define BONDHEAD_BUTTON_CONFIG_TABLE_NAME					"EutecticHead_Button"
+#define WAFERHEAD_BUTTON_CONFIG_TABLE_NAME					"WaferHead_Button"
+#define WAFFLEHEAD_BUTTON_CONFIG_TABLE_NAME				"WaffleHead_Button"
+#define EJECTOR_BUTTON_CONFIG_TABLE_NAME					"Ejector_Button"
+#define WAFERTABLE_BUTTON_CONFIG_TABLE_NAME				"WaferTable_Button"
+#define MATERIAL_BUTTON_BOX_CONFIG_TABLE_NAME				"MaterialBox_Button"
+#define WAFER_CALIB_BUTTON_TABLE_CONFIG_TABLE_NAME			"WaferCalibTable_Button"
+#define WAFFLE_CALIB_BUTTON_TABLE_CONFIG_TABLE_NAME		"WaffleCalibTable_Button"
+#define BOND_BUTTON_TABLE_CONFIG_TABLE_NAME				"BondTable_Button"
+#define NOZZLE_BUTTON_TABLE_CONFIG_TABLE_NAME				"NozzleTable_Button"
+#define ULTRAHEAD_BUTTON_TABLE_NAME						"UltraHead_Button"
 	
-	const static std::string g_mapModuleConfigDbList[] = {
+	const static std::vector<std::string> g_vetModuleConfigTableName = {
 		BONDHEAD_CONFIG_TABLE_NAME,
 		WAFERHEAD_CONFIG_TABLE_NAME,
 		WAFFLEHEAD_CONFIG_TABLE_NAME,
 		EJECTOR_CONFIG_TABLE_NAME,
 		WAFERTABLE_CONFIG_TABLE_NAME,
+		MATERIAL_BOX_CONFIG_TABLE_NAME,
 		WAFER_CALIB_TABLE_CONFIG_TABLE_NAME,
 		WAFFLE_CALIB_TABLE_CONFIG_TABLE_NAME,
 		BOND_TABLE_CONFIG_TABLE_NAME,
 		NOZZLE_TABLE_CONFIG_TABLE_NAME,
 		HARDWARE_SWICH_TABLE_NAME,
 		ULTRAHEAD_TABLE_NAME,
+		
+		BONDHEAD_BUTTON_CONFIG_TABLE_NAME,
+		WAFERHEAD_BUTTON_CONFIG_TABLE_NAME,
+		WAFFLEHEAD_BUTTON_CONFIG_TABLE_NAME,
+		EJECTOR_BUTTON_CONFIG_TABLE_NAME,
+		WAFERTABLE_BUTTON_CONFIG_TABLE_NAME,
+		MATERIAL_BUTTON_BOX_CONFIG_TABLE_NAME,
+		WAFER_CALIB_BUTTON_TABLE_CONFIG_TABLE_NAME,
+		WAFFLE_CALIB_BUTTON_TABLE_CONFIG_TABLE_NAME,
+		BOND_BUTTON_TABLE_CONFIG_TABLE_NAME,
+		NOZZLE_BUTTON_TABLE_CONFIG_TABLE_NAME,
+		ULTRAHEAD_BUTTON_TABLE_NAME,
+
 		ULTRAHEAD_DIAGNOSIS_TABLE_NAME
 	};
 
@@ -54,165 +80,20 @@ namespace ns_db
 	public:
 		CModuleConfig();
 
-		LONG GetConfigParam(string strTableName, vector<MODULE_CONFIG_STRUCT>& vecConfig);
-		LONG GetConfigParam(string strTableName, vector<CONFIG_BASE_STRUCT>& vecConfig);
-
-		LONG SetConfigParam(string strTableName, vector<MODULE_CONFIG_STRUCT> vecconfig);
-		LONG SetConfigParam(string strTableName, vector<CONFIG_BASE_STRUCT> vecconfig);
-
 	private:
-		std::unique_ptr<CConfigBase> m_ConfigBaseDb;
-
+		//CConfigBase* m_ConfigBaseDb;
+		CConfigBaseManage* m_pConfigBaseManage;
 		LONG SaveDB() override;
 		LONG LoadDB() override;
 
-		/*LONG Read(vector<CONFIG_BASE_STRUCT> stConfig, const CHAR* key, string& value);
-		LONG Read(vector<CONFIG_BASE_STRUCT> stConfig, const CHAR* key, CHAR* value, UINT len);
-		LONG Read(vector<CONFIG_BASE_STRUCT> stConfig, const CHAR* key, LONG* value);
-		LONG Read(vector<CONFIG_BASE_STRUCT> stConfig, const CHAR* key, ULONG* value);
-		LONG Read(vector<CONFIG_BASE_STRUCT> stConfig, const CHAR* key, INT* value);
-		LONG Read(vector<CONFIG_BASE_STRUCT> stConfig, const CHAR* key, DOUBLE* value);
-		LONG Read(vector<CONFIG_BASE_STRUCT> stConfig, const CHAR* key, bool* value);
-
-		LONG Write(vector<CONFIG_BASE_STRUCT>* stConfig, const CHAR* key, const CHAR* value);
-		LONG Write(vector<CONFIG_BASE_STRUCT>* stConfig, const CHAR* key, string value);
-		LONG Write(vector<CONFIG_BASE_STRUCT>* stConfig, const CHAR* key, LONG value);
-		LONG Write(vector<CONFIG_BASE_STRUCT>* stConfig, const CHAR* key, ULONG value);
-		LONG Write(vector<CONFIG_BASE_STRUCT>* stConfig, const CHAR* key, INT value);
-		LONG Write(vector<CONFIG_BASE_STRUCT>* stConfig, const CHAR* key, DOUBLE value);
-		LONG Write(vector<CONFIG_BASE_STRUCT>* stConfig, const CHAR* key, bool value);*/
-
-		/*LONG GetConfigParam(vector<CONFIG_BASE_STRUCT> stConfig, vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		LONG SetConfigParam(vector<CONFIG_BASE_STRUCT>* stConfig, vector<MODULE_CONFIG_STRUCT> vecconfig);*/
-
-#pragma region HardwareSwich
-private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_HardwareSwich;
-	public:
-		LONG GetConfigParam_HardwareSwich(string name,bool* flag);
-		vector<CONFIG_BASE_STRUCT> GetConfigParam_HardwareSwich() { return m_vecConfig_HardwareSwich; };
-		LONG SetConfigParam_HardwareSwich(vector<CONFIG_BASE_STRUCT> vecconfig);
-		LONG SetConfigParam_HardwareSwich(vector<MODULE_CONFIG_STRUCT> vecconfig);
-#pragma endregion	
-
-#pragma region BondHead
-private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_BondHead;
-	public:
-		LONG GetConfigParam_BondHead(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetConfigParam_BondHead() { return m_vecConfig_BondHead; };
-		LONG SetConfigParam_BondHead(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetConfigParam_BondHead(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-#pragma endregion	
-
-
-#pragma region WaferHead
-	private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_WaferHead;
-	public:
-		LONG GetConfigParam_WaferHead(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetConfigParam_WaferHead() { return m_vecConfig_WaferHead; };
-		LONG SetConfigParam_WaferHead(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetConfigParam_WaferHead(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-#pragma endregion
-
-#pragma region WaffleHead
-	private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_WaffleHead;
-	public:
-		LONG GetConfigParam_WaffleHead(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetConfigParam_WaffleHead() { return m_vecConfig_WaffleHead; };
-		LONG SetConfigParam_WaffleHead(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetConfigParam_WaffleHead(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-#pragma endregion
-
-#pragma region Ejector
-	private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_Ejector;
-	public:
-		LONG GetConfigParam_Ejector(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetConfigParam_Ejector() { return m_vecConfig_Ejector; };
-		LONG SetConfigParam_Ejector(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetConfigParam_Ejector(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-#pragma endregion
-
-#pragma region WaferTable
-	private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_WaferTable;
-	public:
-		LONG GetConfigParam_WaferTable(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetConfigParam_WaferTable() { return m_vecConfig_WaferTable; };
-		LONG SetConfigParam_WaferTable(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetConfigParam_WaferTable(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-#pragma endregion
-
-#pragma region MaterialBox
-	private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_MaterialBox;
-	public:
-		LONG GetConfigParam_MaterialBox(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetConfigParam_MaterialBox() { return m_vecConfig_MaterialBox; };
-		LONG SetConfigParam_MaterialBox(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetConfigParam_MaterialBox(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-#pragma endregion
-		
-#pragma region CalibTable
-	private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_WaferCalibTable;
-		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_WaffleCalibTable;
-	public:
-		//LONG GetConfigParamg_CalibTable(int moduleType, vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		LONG GetConfigParam_WaferCalibTable(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		LONG GetConfigParam_WaffleCalibTable(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetConfigParam_WaferCalibTable() { return m_vecConfig_WaferCalibTable; };
-		vector<CONFIG_BASE_STRUCT> GetConfigParam_WaffleCalibTable() { return m_vecConfig_WaffleCalibTable; };
-		LONG SetConfigParam_WaferCalibTable(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetConfigParam_WaffleCalibTable(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetConfigParam_WaferCalibTable(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetConfigParam_WaffleCalibTable(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-		//LONG SetConfigParam_CalibTable(int moduleType, vector<MODULE_CONFIG_STRUCT> vecconfig);
-#pragma endregion
-
-#pragma region BondTable
-	private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_BondTable;
-	public:
-		LONG GetConfigParam_BondTable(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetConfigParam_BondTable() { return m_vecConfig_BondTable; };
-		LONG SetConfigParam_BondTable(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetConfigParam_BondTable(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-#pragma endregion
-
-#pragma region NozzleTable
-	private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_NozzleTable;
 	public:
-		LONG GetConfigParam_NozzleTable(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetConfigParam_NozzleTable() { return m_vecConfig_NozzleTable; };
-		LONG SetConfigParam_NozzleTable(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetConfigParam_NozzleTable(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-#pragma endregion
+		LONG GetConfigParam_HardwareSwich(string sKey, bool* flag);
 
-#pragma region UltraHead
-	private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_UltraHead;
-	public:
-		LONG GetConfigParam_UltraHead(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetConfigParam_UltraHead() { return m_vecConfig_UltraHead; };
-		LONG SetConfigParam_UltraHead(vector<CONFIG_BASE_STRUCT> vecconfig, bool isCallBack = true);
-		LONG SetConfigParam_UltraHead(vector<MODULE_CONFIG_STRUCT> vecconfig, bool isCallBack = true);
-#pragma endregion
-
-#pragma region UltraHead_Diagnosis
-	private:
-		std::vector<CONFIG_BASE_STRUCT>  m_vecConfig_UltraHeadDiagnosis;
-	public:
-		LONG GetConfigParam_UltraHeadDiagnosis(vector<MODULE_CONFIG_STRUCT>* vecconfig);
-		vector<CONFIG_BASE_STRUCT> GetConfigParam_UltraHeadDiagnosis() { return m_vecConfig_UltraHeadDiagnosis; };
-		LONG SetConfigParam_UltraHeadDiagnosis(vector<CONFIG_BASE_STRUCT> vecconfig);
-		LONG SetConfigParam_UltraHeadDiagnosis(vector<MODULE_CONFIG_STRUCT> vecconfig);
-#pragma endregion
+		vector<CONFIG_BASE_STRUCT> GetConfigParam(string sTableName);
+		LONG GetConfigParam(string sTableName, vector<MODULE_CONFIG_STRUCT>* vecconfig);
 
+		LONG SetConfigParam(string sTableName,vector<CONFIG_BASE_STRUCT> vecconfig,bool bSendNotice = true);
+		LONG SetConfigParam(string sTableName,vector<MODULE_CONFIG_STRUCT> vecconfig, bool bSendNotice = true);
 
 	};
 

+ 10 - 4
Output/inc/Module/CMultiTemplate.h

@@ -19,8 +19,8 @@ namespace ns_pr
 		//PR_OUTPUT_TYPE type;			//方法类型
 
 		//XY_DOUBLE_STRUCT AbsPos;		//绝对位置
-		XY_DOUBLE_STRUCT RefPos;		//参考位置,以下偏差均以此为基准
-		double score;						//分数
+        X_Y_ANGLE_STRUCT RefPos;		//参考位置,以下偏差均以此为基准
+		double score;					//分数
 		double x;						//x方向偏差(微米)
 		double y;						//y方向偏差(微米)
 		union
@@ -85,12 +85,18 @@ namespace ns_pr
         // 返回值:如果初始化成功,返回true;否则返回false
         bool IsInitSuccess() { return m_bIsInitSuccess; };
 
+        // 通过策略Id,设置参考位置
+        // 参数:iStrategyId - 策略ID;stRef - 用于存储参考位置的结构体
+        // 返回值:操作成功返回OK,否则返回错误码
+        LONG SetAlnRefById(UINT iStrategyId);
+
         // 搜索多模板,返回一组Pr策略得到的绝对,X、Y(微米)以及角度(度)
         // 参数:stVecTemplate - 模板向量;
         // 参数:nDelayTakePicture - 拍照延时;
+        // 参数:bUseCurrPos - 第一个模板使用当前位置;
         // 参数:stOutAln - 输出的搜索结果结构体
         // 返回值:操作成功返回OK,否则返回错误码
-        LONG SearchMultipleTemplate(vector<PR_TEMPLATE> stVecTemplate, UINT nDelayTakePicture, X_Y_ANGLE_STRUCT& stOutAln);
+        LONG SearchMultipleTemplate(vector<PR_TEMPLATE> stVecTemplate, UINT nDelayTakePicture,bool bUseCurrPos, X_Y_ANGLE_STRUCT& stOutAln);
 
         /// <summary>
         /// 根据PR策略Id,进行模板匹配,输出计算后的结果
@@ -99,7 +105,7 @@ namespace ns_pr
         /// <param name="nDelayTakePicture">拍照延时</param>
         /// <param name="stOutAln">输出值 对点结果</param>
         /// <returns>成功返加OK,否则返回错误码</returns>
-        LONG SearchAlnModels(UINT iStrategyId, UINT nDelayTakePicture, FIND_MULTI_TEMP_STRUCT& stOutAln);
+        LONG SearchAlnModels(UINT iStrategyId, UINT nDelayTakePicture, bool bUseCurrPos, FIND_MULTI_TEMP_STRUCT& stOutAln);
 
         // 创建对齐模型
         // 参数:vecTemplateId - 模板ID向量

+ 7 - 4
Output/inc/Module/CPrStrategy.h

@@ -67,7 +67,7 @@ namespace ns_pr
          * @param stOffset 输出值,包含与当前位置的偏差值,单位为 um(微米),用于表示匹配结果的位置和角度偏差。
          * @return LONG 操作结果,成功返回 OK,否则返回相应的错误码。
          */
-        LONG SearchModels(UINT iId, UINT nDelayTakePicture, FIND_MULTI_TEMP_STRUCT& stOffset);
+        LONG SearchModels(UINT iId, UINT nDelayTakePicture, bool bUseCurrPos, FIND_MULTI_TEMP_STRUCT& stOffset);
         /**
          * @brief 重载的 SearchModels 函数,使用不同的输出结构体。
          *
@@ -76,7 +76,7 @@ namespace ns_pr
          * @param stOffset 输出值,包含与当前位置的偏差值,用 X_Y_ANGLE_STRUCT 结构体表示,单位为 um(微米)和角度。
          * @return LONG 操作结果,成功返回 OK,否则返回相应的错误码。
          */
-        LONG SearchModels(UINT iId, UINT nDelayTakePicture, X_Y_ANGLE_STRUCT& stOffset);
+        LONG SearchModels(UINT iId, UINT nDelayTakePicture, bool bUseCurrPos, X_Y_ANGLE_STRUCT& stOffset);
         /**
          * @brief 创建模板。
          *
@@ -101,8 +101,11 @@ namespace ns_pr
          */
         LONG CreatePrStrategy(vector<UINT> vecTemplateId);
 
-        static LONG GetPrMethodByTemplate(UINT iId,UINT &iPrMethod);
-        static LONG EditTemplate(UINT iId);
+        //设置策略参考点
+        LONG SetPrStrategyRef(UINT iStrategyId);
+
+        static LONG GetPrMethodByTemplate(UINT iTemplateId,UINT &iPrMethod);
+        static LONG EditTemplate(UINT iTemplateId);
     };
 
 }

+ 112 - 18
Output/inc/Module/CProduct.h

@@ -8,6 +8,7 @@
 #include <map>
 
 #include "CDataBaseOperate.h"
+#include "CMachineCalibration.h"
 
 #ifdef PRODUCT_DLL
 #define DLL_PRODUCT_API __declspec(dllexport)
@@ -30,6 +31,8 @@
 #define STEP_PUBLIC_DATA_TABLE_NAME                     "StepPublicData"
 #define ALN_STRATEGY_TABLE_NAME                         "PR_Strategy"
 #define PR_TEMPLATE_TABLE_NAME							"PR_Template"
+#define PR_BONDINSP_TABLE_NAME							"PR_BondInsp"
+#define NOZZLE_PARAM_TABLE_NAME							"NozzleParam"
 
 #define NO_GRAB_TEMPLATE_ID			0
 
@@ -70,6 +73,20 @@ namespace ns_db
 		XY_DOUBLE_STRUCT RightBottomPoint{ 0,0 };		//矩阵右下角点位置(相对位置)
 		vector<XY_LONG_STRUCT> vetNoUsedPt;				//不使用的点
 	};
+
+	//吸嘴参数
+	struct NozzleParam : TABLE_INFO_BASE
+	{
+		int nNozzleIndex = 0;
+		XY_DOUBLE_STRUCT position{ 0,0 };
+		NozzleCalibParam calibParam;
+
+		double dNozzleHeigh = 0; //在固定位置进行标定
+		int nMaxAllowUseNum = 10000;
+		int nUsedNum = 0;
+
+	};
+
 	//取(固)晶参数
 	typedef struct _PICKBOND_PARAM_STRUCT : TABLE_INFO_BASE
 	{
@@ -78,10 +95,12 @@ namespace ns_db
 		bool bCheckBlock;						//阻塞检测
 		bool bCheckLose;						//漏晶检测
 		bool bFindForce;						//是否寻压
-		double dPreLev;							//预备高度
+		double dPreLevOffset;							//预备高度(Offset)
 
 		double dForce;							//取(固)压力
-		double dWorkLev;						//取(固)高度(寻压则无高度)
+		double dWorkLevOffset;						//取(固)高度(寻压则无高度) (Offset)
+
+		//double dContactHigh;                   //接触高度,通过测高获取
 
 		UINT iGrabDelay;						//拍图延时
 		UINT iPickOrBondDelay;					//取(固)延时
@@ -99,28 +118,47 @@ namespace ns_db
 	};
 	enum DIE_SOURCE { BY_NUL = 0 /*未指定*/, BY_WAFFLE = 1 /*华夫盒*/, BY_WAFER = 2/*晶片台*/ };
 
+	enum BOND_MATRIX_TEMPLATE_TYPE {
+		TEMPLATE_WAFER_PICK = 0,						
+								
+		TEMPLATE_TRANSFER_PICK,					
+		TEMPLATE_LOOKUP,
+		TEMPLATE_WORKTABLE_BOND,
+		TEMPLATE_WORKTABLE_BOND_ALN,
+
+		TEMPLATE_BONDFRONT,
+		TEMPLATE_BONDBACK
+	};
+
 	//固晶信息
 	typedef struct BOND_INFO_STRUCT : TABLE_INFO_BASE
 	{
 		UINT iInfoId;							//固晶信息Id
 		//UINT iModuleId;							//模组Id
 		DIE_SOURCE eDieSource;					//晶片来源
+		double dDieHeight;						//芯片高度
 		UINT iDieMatrixId;						//使用的晶片台号或华夫盒矩阵号
+		CALIB_DIE_TYPE eCalibType;				//校准方式
+		bool m_bIsAllBondAln = false;           //是否逐个固晶对点
+		bool m_bIsPcbAln = false;				//是否 PCB对点
+
 		UINT iPickParamId;						//取晶参数Id
-		UINT iPickPRStrategyId;					//取晶PR策略Id
 		UINT iCalibBondParamId;					//校准台固晶参数Id
-		UINT iPickHeadId;						//取晶吸嘴Id号
-		UINT iBondHeadId;						//固晶吸嘴Id号
 		UINT iCalibPickParamId;					//校准台取晶参数Id
-		UINT iBondPRStrategyId;					//固晶PR策略Id
 		UINT iBondParamId;						//固晶参数Id
 
-		CALIB_DIE_TYPE eCalibType;				//校准方式
-		UINT iCalibPRStrategyId;				//校准台PR策略Id
-		UINT iLookUpPRStrategyId;				//下视PR策略Id
+		UINT iPickHeadId;						//取晶吸嘴Id号
+		UINT iBondHeadId;						//固晶吸嘴Id号
+
+		UINT iPickPRStrategyId = 0;					//取晶PR策略Id
+		UINT iBondAlnPRStrategyId = 0;				//固晶PR策略Id
+		UINT iPcbAlnPRStrategyId = 0;				//PCB 对点策略ID
+
+		UINT iCalibPRStrategyId = 0;				//校准台PR策略Id
+		UINT iLookUpPRStrategyId = 0;				//下视PR策略Id
+		UINT iBondFrontPRStrategyId = 0;			//固前检测模板ID号 0为不检测
+		UINT iBondBackPRStrategyId = 0;				//固后检测模板ID号 0为不检测
 
-		UINT iBondFrontPRStrategyId;			//固前检测模板ID号 0为不检测
-		UINT iBondBackPRStrategyId;				//固后检测模板ID号 0为不检测
 
 		X_Y_ANGLE_STRUCT stOffset;				//固晶点补偿(从编程的固晶点位置偏移)
 
@@ -256,6 +294,35 @@ namespace ns_db
 
 	} PR_TEMPLATE;
 
+	typedef struct _PR_BONDINSP : TABLE_INFO_BASE
+	{
+		UINT iID;                     // Auto-incremented ID
+		UINT iTableId;                // Table ID
+		string sTableType;            // Table type (VARCHAR)
+		UINT iCameraId;               // Camera ID
+		UINT iModelId;                // Model ID
+		INT iPosnX;                   // Position X
+		INT iPosnY;                   // Position Y
+		INT iPosnZ;                   // Position Z (default: 0)
+		INT iPosnR;                   // Position Rotation (default: 0)
+		INT iCameraX;                 // Camera X (default: 0)
+		INT iCameraY;                 // Camera Y (default: 0)
+		INT iCameraLev;               // Camera Level
+		double dFindAngle;            // Find angle
+		UINT iMinScore;               // Minimum score
+		UINT iNumMatches;             // Number of matches
+		double dRangeX1;              // Range X1 (default: -1)
+		double dRangeY1;              // Range Y1 (default: -1)
+		double dRangeX2;              // Range X2 (default: -1)
+		double dRangeY2;              // Range Y2 (default: -1)
+		double dPermErrorX;           // Permanent error in X (default: 0)
+		double dPermErrorY;           // Permanent error in Y (default: 0)
+		double dPermErrorAgent;       // Permanent error agent (default: 0)
+		string sDate;                 // Date (default: current timestamp)
+		UINT iFindType;               // Find type (default: 0)
+	} PR_BONDINSP;
+
+
 	typedef struct _PR_STRATEGY : TABLE_INFO_BASE
 	{
 		UINT iStrategyId;						//PR策略ID
@@ -361,7 +428,7 @@ namespace ns_db
 	public:
 		LONG GetPointMatrix(UINT iMatrixId, PROGRAM_POINT_MATRIX_STRUCT& stPointMatrix);
 		LONG GetAllPointMatrix(std::vector<PROGRAM_POINT_MATRIX_STRUCT>& vecPointMatrix);
-		LONG AddPointMatrix(int bondMatrixID, PROGRAM_POINT_MATRIX_STRUCT subMatrix,int& newId);
+		LONG AddPointMatrix(int bondMatrixID, PROGRAM_POINT_MATRIX_STRUCT subMatrix, int& newId);
 		LONG SetPointMatrix(int matrixID, PROGRAM_POINT_MATRIX_STRUCT dieMatrix);
 		LONG SetAllPointMatrix(std::vector<PROGRAM_POINT_MATRIX_STRUCT> vecPointMatrix, bool isCallBack = true);
 		LONG DeletePointMatrix(int bondMatrixId, int subMatrixID);
@@ -378,7 +445,7 @@ namespace ns_db
 		std::vector<BOND_INFO_STRUCT> GetAllBondInfoData() { return m_VecBondInfoData; };
 		LONG GetBondInfoData(UINT iInfoId, BOND_INFO_STRUCT& stBondInfoData);
 		LONG SetBondInfoData(int infoId, BOND_INFO_STRUCT stBondInfoData);
-		LONG AddBondInfoData(BOND_INFO_STRUCT stBondInfoData,int& newInfoId);//需要指定矩阵ID
+		LONG AddBondInfoData(BOND_INFO_STRUCT stBondInfoData, int& newInfoId);//需要指定矩阵ID
 		LONG DeleteBondInfoData(int infoId);
 
 #pragma endregion
@@ -391,9 +458,10 @@ namespace ns_db
 		LONG SaveBondParam();
 
 	public:
+		std::vector<PICKBOND_PARAM_STRUCT> GetAllBondParamData() { return m_VecBondParam; };
 		LONG GetBondParam(UINT iParamId, PICKBOND_PARAM_STRUCT& stBondParam);
 		LONG SetBondParam(int paramId, PICKBOND_PARAM_STRUCT stBondParam);
-		LONG AddBondParam(PICKBOND_PARAM_STRUCT stBondParam,int& newId);//需要指定bondInfo 的id,将数据进行
+		LONG AddBondParam(PICKBOND_PARAM_STRUCT stBondParam, int& newId);//需要指定bondInfo 的id,将数据进行
 		LONG DeleteBondParam(int paramId);
 
 #pragma endregion
@@ -408,7 +476,7 @@ namespace ns_db
 
 #pragma endregion
 
-#pragma region
+#pragma region 一维矩阵:暂用于吸嘴矩阵
 	private:
 		std::vector<OneDimMatrixInfo>  m_vetOneDimMatrix;
 		LONG LoadOneMatrixInfo();
@@ -417,6 +485,24 @@ namespace ns_db
 
 #pragma endregion
 
+
+#pragma region 吸嘴参数
+	private:
+		std::vector <NozzleParam> m_vecNozzleParam;
+		LONG LoadNozzleParam();
+		LONG SaveNozzleParam();
+	public:
+		LONG GetNozzleParam(int index, NozzleParam& param);
+		LONG GetAllNozzleParam(std::vector <NozzleParam>& vecNozzleParam);
+
+		LONG SetNozzleParam(int index, NozzleParam param, bool isCallBack = true);
+		LONG SetAllNozzleParam(std::vector <NozzleParam>, bool isCallBack = true);
+
+
+#pragma endregion
+
+
+
 #pragma region StepListDetail 表
 
 	private:
@@ -451,7 +537,7 @@ namespace ns_db
 		LONG SavePrStrategy();
 	public:
 		std::vector<PR_STRATEGY>  GetPrStrategy() { return m_vecPrStrategy; };
-		LONG AddPrStrategy(vector<UINT> vecTemplateId);
+		LONG AddPrStrategy(vector<UINT> vecTemplateId, X_Y_ANGLE_STRUCT stRef = { 0,0,0 });
 #pragma endregion
 
 
@@ -467,8 +553,16 @@ namespace ns_db
 #pragma endregion
 
 
-	};
-
+#pragma region PR_BondInsp 表
+	private:
+		std::vector<PR_BONDINSP>  m_vecPrBondInsp;
 
+		LONG LoadPrBondInsp();
+		LONG SavePrBondInsp();
+	public:
+		std::vector<PR_BONDINSP>  GetPrBondInsp() { return m_vecPrBondInsp; };
+		LONG AddPrBondInsp(PR_BONDINSP stBondInsp);
+#pragma endregion
+	};
 
 }

+ 1 - 0
Output/inc/Module/CRCalib.h

@@ -162,4 +162,5 @@ private:
     CXYCalib* m_pXYCalib = nullptr;
 
     int  m_nTestTempId = 0;
+    X_Y_ANGLE_STRUCT m_stCalibTestOffset{ 0,0,0 };
 };

+ 1 - 0
Output/inc/Module/CSingleTemplate.h

@@ -46,6 +46,7 @@ namespace ns_pr
     {
     private:
         bool m_bIsInitSuccess; // 标记初始化是否成功
+        bool m_bGrabDoneCloseLamp = false;
         CProduct* m_pCProduct = nullptr; // 指向产品相关对象的指针,可能用于与数据库交互获取产品信息
         //ILocalizationManager* m_pLocalizationManager = nullptr; // 本地化管理对象指针,暂时注释掉,可能在后续功能扩展中使用
         CPixelLocation* m_pPixelLocation = nullptr; // 像素位置处理对象指针,用于处理图像中像素位置相关操作

+ 1 - 0
Output/inc/Module/CUltraHead.h

@@ -54,6 +54,7 @@ public:
     LONG ToBondPos_AddOffset(int index, X_Y_ANGLE_STRUCT bondOffset, X_Y_ANGLE_STRUCT lookUpOffset, bool bIsHard = true, bool waitDone = true);//传入物理位置
     LONG BondDieDown(int index);//传入物理位置
     LONG BondDieUp(bool waitDone = true);
+    LONG BondCheck(int index);
 
     LONG CreateTemplate_LowCamera(SEARCH_OUT eResultSelect, UINT& iTemplateId);
     LONG SearchTemplate(UINT iTemplateId, X_Y_ANGLE_STRUCT& stOffset);

+ 2 - 0
Output/inc/Module/CXYCalib.h

@@ -134,5 +134,7 @@ private:
 
     // 存储9个标定位置对应的相对像素坐标
     std::vector<JVision::Point2D> m_relativePixels;
+
+    XY_DOUBLE_STRUCT m_stTestResult{ 0,0 };
 };
 

+ 11 - 3
Output/inc/Module/JAxis.h

@@ -195,6 +195,9 @@ public:
     //轴硬件使能
     virtual int AxisOn() = 0;
 
+    //PDO数据初始化
+    virtual int InitPDO() = 0;
+
     //轴断硬件使能
     virtual int AxisOff() = 0;
 
@@ -239,10 +242,10 @@ public:
     virtual const AxisData* GetAxisData() const /*{return m_stData;}*/ = 0;
 
     //设置轴数据结构体中的数据(新增)
-    //virtual int SetAxisData(const AxisData* data) = 0;
+    virtual int SetAxisData(AxisData* data) = 0;
 
 
-    //获取轴当前的轴类型,如Servo,Forcer,Step;其实没有意义,需要删除2024/11/25
+    //获取轴当前的轴类型,如Servo,Forcer,Step;
     virtual AxisType GetAxisType() = 0;
 
 
@@ -309,6 +312,8 @@ public:
     //virtual int WriteSockValue(std::string sSerial,std::any tValue)=0;
     virtual int WriteSockValueN(std::string sSerial,int nValue)=0;
     virtual int WriteSockValueF(std::string sSerial,float fValue)=0;
+    virtual int GetSockValueN(std::string sSerial,int &nValue) = 0;
+    virtual int GetSockValueF(std::string sSerial,float &nValue) = 0;
 
     virtual int WriteSockCommand(std::string sSerial)=0;
 
@@ -339,6 +344,9 @@ public:
     virtual int SetTargetVel(double dVel) = 0;
     virtual int SetTargetVelR(double dVelRatio) = 0;
 
+    //设置最大速度(基准速度),user units
+    virtual int SetMaxVelocity(double dMVel) = 0;
+
 
     //超时会返回错误码,直接停止并退出
     //启动绝对位移运动,user units
@@ -367,7 +375,7 @@ public:
     virtual int MoveGear() = 0;
     //设置从轴的齿轮比(只有齿轮运动模式才有)
     //主轴齿数,从轴齿数,离合区;单位均为pulse
-    virtual int SetGearRatio(long nMEven,long nSEven,long nMasterSlope = 0 ) = 0;
+    virtual int SetGearRatio(long nMEven,long nSEven,long nMasterSlope = 1000 ) = 0;
     //设置本从轴的主轴
     virtual int SetGearMaster(const JAxis* pMaster) = 0;
 

+ 8 - 4
Output/inc/Module/JMotion.h

@@ -21,6 +21,7 @@ class AxesParamPage;
 class AxesMapPage;
 class IOMapPage;
 class CoordTest;
+class ExtIOMapPage;
 
 struct bInitOK
 {
@@ -49,6 +50,8 @@ public:
     bool ShowCoordPage();
     //显示轴测试界面
     bool ShowAxisTestPage(std::string sAxisName);
+    //显示AIO/DOS调试界面
+    bool ShowExtIOMapPage();
 
     //获取轴参数界面指针
     AxesParamPage* getAxesParaPage();
@@ -119,6 +122,7 @@ private:
     AxesMapPage* m_pAxesMapPage = nullptr;
     IOMapPage* m_pIOMapPage = nullptr;
     CoordTest* m_pCoordTestPage = nullptr;
+    ExtIOMapPage* m_pExtIOMapPage = nullptr;
 
     /*
      * 下面为JMotion中使用的轴,卡,IO信息,坐标系
@@ -157,10 +161,10 @@ private:
     std::map<std::string,CAnalogInput*> m_mpAi;
 
 
-    // 多卡多数字模块的输入输出
-    // 如:m_pExtDi(0,0)代表0号卡的0号数字模块
-    std::vector<std::vector<CDigitInput*>> m_vExtDi;//[c_nMaxCardNum][c_nMaxDigitModuleNum];
-    std::vector<std::vector<CDigitOutput*>> m_vExtDo;//[c_nMaxCardNum][c_nMaxDigitModuleNum];
+    // // 多卡多数字模块的输入输出
+    // // 如:m_pExtDi(0,0)代表0号卡的0号数字模块
+    // std::vector<std::vector<CDigitInput*>> m_vExtDi;//[c_nMaxCardNum][c_nMaxDigitModuleNum];
+    // std::vector<std::vector<CDigitOutput*>> m_vExtDo;//[c_nMaxCardNum][c_nMaxDigitModuleNum];
 
 
     //对应的多坐标系

+ 19 - 5
Output/inc/Module/TipMatrix.h

@@ -4,11 +4,16 @@
 #define FIRST_TIP_MATRIX_INDEX 1
 namespace ns_mat
 {
-	struct NozzleParam 
-	{
-		XY_DOUBLE_STRUCT position{ 0,0 };
-		NozzleCalibParam calibParam;
-	};
+	//struct NozzleParam 
+	//{
+	//	XY_DOUBLE_STRUCT position{ 0,0 };
+	//	NozzleCalibParam calibParam;
+
+	//	double dNozzleHeigh = 0; //Ôڹ̶¨Î»ÖýøÐб궨
+	//	int nMaxAllowUseNum = 10000;
+	//	int nUsedNum = 0;
+
+	//};
 
 
 	class __declspec(dllexport) TipMatrix
@@ -42,6 +47,14 @@ namespace ns_mat
 		LONG GetWHCameraToNozzle(int index, XY_DOUBLE_STRUCT& cameraToNozzle);
 		LONG SetWHCameraToNozzle(int index, XY_DOUBLE_STRUCT cameraToNozzle);
 
+		LONG SetNozzleHigh(int index, double pos);
+		LONG GetNozzleHigh(int index, double& pos);
+
+		LONG SetNozzleMaxAllowUseNum(int nozzleIndex, int num);
+		LONG GetNozzleMaxAllowUseNum(int nozzleIndex, int& num);
+
+		LONG SetNozzleUsedNum(int nozzleIndex, int num);
+		LONG GetNozzleUsedNum(int nozzleIndex, int& num);
 
 
 	private:
@@ -61,6 +74,7 @@ namespace ns_mat
 
 		CManageDB* m_pCManageDB = nullptr;
 
+		bool m_bIsPrTest = false;
 		int m_nMatrixID = 1;
 
 		std::string m_sName = "TipMatrix";

+ 17 - 0
Output/inc/Public/dt.h

@@ -161,6 +161,23 @@ typedef struct _X_Y_ANGLE_STRUCT
 		y = _y;
 		a = _a;
 	};
+
+	_X_Y_ANGLE_STRUCT operator+(const _X_Y_ANGLE_STRUCT& a)
+	{
+		_X_Y_ANGLE_STRUCT b;
+		b.x = this->x + a.x;
+		b.y = this->y + a.y;
+		b.a = this->a + a.a;
+		return b;
+	};
+	_X_Y_ANGLE_STRUCT operator-(const _X_Y_ANGLE_STRUCT& a)
+	{
+		_X_Y_ANGLE_STRUCT b;
+		b.x = this->x - a.x;
+		b.y = this->y - a.y;
+		b.a = this->a - a.a;
+		return b;
+	};
 }X_Y_ANGLE_STRUCT;
 
 struct X_Y_Z_R_STRUCT

BIN
Output/lib/x64/Common.lib


BIN
Output/lib/x64/Control.lib


BIN
Output/lib/x64/Module.lib


+ 13 - 1
View/die-bonder-ui/MainWnd.cpp

@@ -7,6 +7,7 @@
 #include <QDialogButtonBox>
 #include "Src/common/JLogAllOutput.h"
 #include "Src/SystemInfoPage/SystemInfoPage.h"
+#include "Src/common/JMessageTip.h"
 
 MainWnd::MainWnd(QWidget* parent)
     : QMainWindow(parent)
@@ -247,6 +248,11 @@ void MainWnd::GetDisableFeaturesSlots(bool isDisable)
     ui->label_logo_m->setDisabled(isDisable);
 }
 
+int MainWnd::GetRunButDoneSlot(ns_module::ST_BUTTON_DONE butDone)
+{
+    return JMessageTip::CreateCustomMessageDlg(butDone);
+}
+
 void MainWnd::applyTheme(int themeValue)
 {
     QString qssFileName;
@@ -849,7 +855,13 @@ void MainWnd::onCurrentWidgetChanged()
 
 void MainWnd::Init()
 {
-    m_sqlOper = &SqlOperation::GetInstance();
+    qRegisterMetaType<ns_module::ST_BUTTON_DONE>("ns_module::ST_BUTTON_DONE");
+
+    
+    m_sqlOper = SqlOperation::GetInstance();
+    connect(m_sqlOper, &SqlOperation::SendRunButDoneSig,
+        this, &MainWnd::GetRunButDoneSlot);
+
     m_sqlOper->LoadSql();
     m_pCameraBind = new CameraBind;
 

+ 5 - 1
View/die-bonder-ui/MainWnd.h

@@ -96,6 +96,10 @@ private slots:
      */
     void GetDisableFeaturesSlots(bool isDisable);
 
+    /**消息弹框
+    */
+    int  GetRunButDoneSlot(ns_module::ST_BUTTON_DONE butDone);
+
 private:
     Ui::MainWnd* ui;
 
@@ -114,7 +118,7 @@ private:
 
     /**所有sql 数据加载
      */
-    SqlOperation* m_sqlOper;
+    SqlOperation* m_sqlOper = nullptr;
     QTranslator translator;
 };
 #endif // MAINWND_H

+ 315 - 46
View/die-bonder-ui/OriginalWnd/DbTreeViewManager.cpp

@@ -117,7 +117,10 @@ void DbTreeViewManager::Init()
     m_pTreeViewDown = new QTreeView(this);
     m_pCModel       = new QStandardItemModel(this);
 
-    m_sqlOper       = &SqlOperation::GetInstance();
+    m_sqlOper       = SqlOperation::GetInstance();
+
+    connect(m_sqlOper, &SqlOperation::UpDbTreeViewManager3DataSig,
+        this, &DbTreeViewManager::UpDbTreeViewManager3DataSlots);
 
     m_pTreeCViewInterface = ns_module::CViewInterface::GetInstance();
 
@@ -966,7 +969,8 @@ QStandardItem* DbTreeViewManager::findFirstThirdLevelItemDFS(QStandardItem *pare
 
 void DbTreeViewManager::onItemChanged(QStandardItem *item)
 {
-    if (m_blockItemChanged || m_isRestoring) {
+    if (m_blockItemChanged || m_isRestoring) 
+    {
         return; // 防止递归和恢复期间触发
     }
 
@@ -975,7 +979,8 @@ void DbTreeViewManager::onItemChanged(QStandardItem *item)
     Qt::CheckState state = item->checkState();
 
     // 更新所有子项的复选框状态
-    for (int i = 0; i < item->rowCount(); ++i) {
+    for (int i = 0; i < item->rowCount(); ++i)
+    {
         QStandardItem *child = item->child(i);
         if (child) {
             child->setCheckState(state);
@@ -1015,7 +1020,35 @@ void DbTreeViewManager::onItemChanged(QStandardItem *item)
     saveCheckedPaths();
 }
 
+void DbTreeViewManager::UpDbTreeViewManager3DataSlots(QString strDbName, QString strTableName)
+{
+    if (m_isRepeatSave)
+    {
+        m_isRepeatSave = false;
+        return;
+    }
+    
+
+    if (m_currentConfigName == "Home" || // 自定义窗口不刷新
+        m_currentConfigName == "Programme" ||
+        m_currentConfigName == "Msg")
+    {
 
+    }
+    else 
+    {
+
+        /**TODO:yang
+         *这里目前是一个大坑,数据同步
+         */
+        int userPrivilege = 0x1;
+        QList<ST_TABLE_CONTROL_DATA> tableControlDatas;
+        bool allChangeFlag = false;
+
+        m_sqlOper->GetThirdDirControlDataToUpdataUi(strTableName, userPrivilege, tableControlDatas, allChangeFlag);
+        UpdateShowAll3MenuControl(tableControlDatas);
+    }
+}
 
 // 初始化和设置按钮
 void DbTreeViewManager::setupButton()
@@ -1059,6 +1092,13 @@ void DbTreeViewManager::setupButton()
 
 void DbTreeViewManager::updateButtonsVisibility()
 {
+    //std::vector<QPushButton*> veBut;
+    //veBut.push_back(ButtonBack);
+    //veBut.push_back(buttonUp);
+    //veBut.push_back(buttonDown);
+    //veBut.push_back(buttonLeft);
+    //veBut.push_back(buttonRight);
+
     if (m_currentConfigName == "Home" || 
         m_currentConfigName == "Programme" ||
         m_currentConfigName=="Msg")
@@ -2052,6 +2092,7 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
     m_veComboBoxCont.clear();
     m_veTimeCont.clear();
     m_veSwitchCont.clear();
+    m_veTreemCustomText.clear();
 
     // 创建新的 "字段展示" 窗口,并赋值给 m_thirdLevelFieldWnd
     m_thirdLevelFieldWnd = new QWidget(m_pOriginalWndMenuPage);
@@ -2904,6 +2945,9 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                     ST_COMBINED_CONT _a;
                     //_a.pGetBut = btnGet;
                    // _a.pSetBut = btnSet;
+                     _a.pGetBut = nullptr;
+                     _a.pSetBut = nullptr;
+
                     _a.pLineC = comboInput;
                     _a.strConfigurationsName = fieldTableName;
                     _a.strfieldName = fieldName;
@@ -2972,12 +3016,22 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                 } 
                 else if (fieldType == "Text")
                 {
-                    rightLayout->addWidget(JIoMapPage::JCreateJText(fieldValue));
-                    rightLayout->addWidget(JIoMapPage::JCreateJText(fieldUnits));
+                    ST_TREEM_CUSTOM_TEXT textCus;
+                    textCus.strConfigurationsName = fieldTableName;
+                    textCus.strfieldName = fieldName;
+                    textCus.strfieldDescribe = fieldDescribe;
+
+                    textCus.pfieldValue = JIoMapPage::JCreateJText(fieldValue);
+                    textCus.pfieldUnits = JIoMapPage::JCreateJText(fieldUnits);
+                    rightLayout->addWidget(textCus.pfieldValue);
+                    rightLayout->addWidget(textCus.pfieldUnits);
+
+
+                    m_veTreemCustomText.push_back(textCus);
                 } 
                 else if (fieldType == "IoPage")
                 {
-                    rightLayout->addWidget(JIoMapPage::CreateIoPage(control));
+                    rightLayout->addWidget(JIoMapPage::CreateIoPage(control.strName.c_str()));
                 }
                 else if (fieldType == "AxisTestPage")
                 {
@@ -3014,52 +3068,233 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
 }
 
 
-void DbTreeViewManager::updateParentCheckState(QStandardItem *item)
+void DbTreeViewManager::UpdateShowAll3MenuControl(QList<ST_TABLE_CONTROL_DATA>& data)
+{
+    if (data.isEmpty())
+    {
+        return;
+    }
+
+    for (const ST_TABLE_CONTROL_DATA& tableData : data)
+    {
+        for (const CONFIG_BASE_STRUCT& control : tableData.controlDataList)
+        {
+            QString fieldName           = QString::fromLocal8Bit(control.strName.c_str());
+            QString fieldDescribe       = QString::fromLocal8Bit(control.strDescribe.c_str());
+            //QString fieldDescribe_Eng = QString::fromLocal8Bit(control.strDescribe_Eng.c_str());
+            QString fieldDescribe_Eng   = "no Eng";
+            int fieldUserGrade          = control.iUserGrade;
+            QString fieldType           = QString::fromLocal8Bit(control.strType.c_str());
+            QString fieldValue          = QString::fromLocal8Bit(control.strValue.c_str());
+            QString fieldDefult         = QString::fromLocal8Bit(control.strDefult.c_str());
+            QString fieldUpLimit        = QString::fromLocal8Bit(control.strUpperLimit.c_str());
+            QString fieldDownLimit      = QString::fromLocal8Bit(control.strLowerLimit.c_str());
+            QString fieldUnits          = QString::fromLocal8Bit(control.strUnit.c_str());
+            QString strAxisType         = QString::fromLocal8Bit(control.strAxisType.c_str());
+            QString strstrModuleType    = m_str2DirModuleType;
+            int groupId                 = control.iGroupId;
+
+            QString fieldTableName = extractBeforeComma(tableData.tableName);
+
+
+            if (fieldType == "input" || fieldType == "LONG" || fieldType == "STRING")
+            {
+                for (auto& a: m_veInputCont)
+                {
+                    if (a.strConfigurationsName == fieldTableName &&
+                        a.strfieldName == fieldName &&
+                        a.strfieldDescribe == fieldDescribe)
+                    {
+                        if (a.plineEdit)
+                        {
+                            a.plineEdit->setText(fieldValue);
+                        }
+                        break;
+                    }
+                }
+            }
+            else if (fieldType == "JRadio")
+            {
+                for (auto& a : m_veRadioCont)
+                {
+                    if (a.strConfigurationsName == fieldTableName &&
+                        a.strfieldName == fieldName &&
+                        a.strfieldDescribe == fieldDescribe)
+                    {
+                        if (a.pradioGroup)
+                        {
+                            for (QAbstractButton* button : a.pradioGroup->buttons())
+                            {
+                                // 这个选中逻辑需要重新做
+                                if (button->text() == fieldDefult)
+                                {
+                                    button->setChecked(true);
+                                    break;
+                                }
+                            }
+                        }
+                        break;
+                    }
+                }
+            }
+            else if (fieldType == "BOOL")
+            {
+
+                /* ST_CHECKBOX_CONT _a;
+                 _a.pcheckBox = checkBox;
+                 _a.strConfigurationsName = fieldTableName;
+                 _a.strfieldName = fieldName;
+                 _a.strfieldDescribe = fieldDescribe;
+
+                 m_veCheckBoxCont.push_back(_a);*/
+            }
+            else if (fieldType == "JCheckBox")
+            {
+
+            }
+            else if (fieldType == "ComboBox")
+            {
+
+
+                //ST_COMBOBOX_CONT _a;
+                //_a.pcomboBox = comboBox;
+                //_a.strConfigurationsName = fieldTableName;
+                //_a.strfieldName = fieldName;
+                //_a.strfieldDescribe = fieldDescribe;
+
+                //m_veComboBoxCont.push_back(_a);
+            }
+            else if (fieldType == "time")
+            {
+                //ST_TIME_CONT _a;
+                //_a.ptimeEdit = timeEdit;
+                //_a.strConfigurationsName = fieldTableName;
+                //_a.strfieldName = fieldName;
+                //_a.strfieldDescribe = fieldDescribe;
+
+                //m_veTimeCont.push_back(_a);
+            }
+            else if (fieldType == "switch")
+            {
+
+                /*ST_SWITCH_CONT _a;
+                _a.pswitchBox = switchBox;
+                _a.strConfigurationsName = fieldTableName;
+                _a.strfieldName = fieldName;
+                _a.strfieldDescribe = fieldDescribe;
+
+                m_veSwitchCont.push_back(_a);*/
+            }
+            else if (fieldType == "JLocation" || fieldType == "POSITION")//TODO: POSITION 逐渐抛弃
+            {
+                for (auto& a : m_veCombinedCont)
+                {
+                    if (//a.strConfigurationsName == fieldTableName &&
+                        a.strfieldName == fieldName &&
+                        a.strfieldDescribe == fieldDescribe)
+                    {
+                        if (a.pLineC)
+                        {
+                            a.pLineC->setText(fieldValue);
+                        }
+                        break;
+                    }
+                }
+
+            }
+            else if (fieldType == "Text")
+            {
+                for (auto& a : m_veTreemCustomText)
+                {
+                    if (//a.strConfigurationsName == fieldTableName &&
+                        a.strfieldName == fieldName &&
+                        a.strfieldDescribe == fieldDescribe)
+                    {
+                        if (a.pfieldValue)
+                        {
+                            a.pfieldValue->setText(fieldValue);
+                        }
+
+                        if (a.pfieldUnits)
+                        {
+                            a.pfieldUnits->setText(fieldUnits);
+                        }
+                        break;
+                    }
+                }
+            }
+            else if (fieldType == "IoPage")
+            {
+                
+            }
+            else if (fieldType == "AxisTestPage")
+            {
+                
+            }
+        }
+    }
+}
+
+void DbTreeViewManager::UpdateParentCheckState(QStandardItem *item)
 {
     if (!item)
+    {
         return;
+    }
 
     QStandardItem *parentItem = item->parent();
     if (!parentItem)
+    {
         return;
+    }
 
     bool allChecked = true;
     bool noneChecked = true;
 
-    for (int i = 0; i < parentItem->rowCount(); ++i) {
+    for (int i = 0; i < parentItem->rowCount(); ++i) 
+    {
         QStandardItem *child = parentItem->child(i);
-        if (child->checkState() != Qt::Checked) {
+        if (child->checkState() != Qt::Checked) 
+        {
             allChecked = false;
         }
-        if (child->checkState() == Qt::Checked) {
+        if (child->checkState() == Qt::Checked) 
+        {
             noneChecked = false;
         }
     }
 
-    if (allChecked) {
+    if (allChecked) 
+    {
         parentItem->setCheckState(Qt::Checked);
-    } else {
+    } 
+    else 
+    {
         parentItem->setCheckState(Qt::Unchecked);
     }
 
-    if (noneChecked) {
+    if (noneChecked) 
+    {
         qDebug() << "noneChecked状态为:" << noneChecked;
 
     }
 
     // 递归更新上一级
-    updateParentCheckState(parentItem);
+    UpdateParentCheckState(parentItem);
 }
 
 
 void DbTreeViewManager::onButtonBackClicked()
 {
     PromptSaveChanges();
-    if (m_thirdLevelFieldWnd) {
+    if (m_thirdLevelFieldWnd) 
+    {
         // 当前在第三层目录,返回到上一层目录
         //qDebug() << "当前在第三层目录,准备返回上一层。";
-        for(int i=0;i<5;i++){
-            if(currentMenuId == menuArray[i].menuId){
+        for(int i=0;i<5;i++)
+        {
+            if(currentMenuId == menuArray[i].menuId)
+            {
                 menuArray[i].isthird = false;
             }
         }
@@ -3071,32 +3306,41 @@ void DbTreeViewManager::onButtonBackClicked()
 
         // 显示目录树和分隔线
         m_pTreeViewDown->show();
-        for (auto separator : m_mapFirstLevelSeparators) {
+        for (auto separator : m_mapFirstLevelSeparators) 
+        {
             if (separator)
+            {
                 separator->show();
+            }
         }
 
         // 获取当前导航路径
         QStringList path;
         QLayout* layout = m_pNavigationWidget->layout();
-        if (!layout) {
+        if (!layout)
+        {
             qWarning() << "导航栏没有布局,无法获取路径。";
             return;
         }
-        for (int i = 0; i < layout->count(); ++i) {
+        for (int i = 0; i < layout->count(); ++i) 
+        {
             QLayoutItem* item = layout->itemAt(i);
-            if (item && item->widget()) {
+            if (item && item->widget()) 
+            {
                 QLabel* label = qobject_cast<QLabel*>(item->widget());
-                if (label) {
+                if (label)
+                {
                     QString text = label->text().trimmed();
-                    if (!text.isEmpty()) {
+                    if (!text.isEmpty()) 
+                    {
                         path << text;
                     }
                 }
             }
         }
 
-        if (path.isEmpty()) {
+        if (path.isEmpty()) 
+        {
            // qWarning() << "导航路径为空,无法返回上一层。";
             return;
         }
@@ -3104,14 +3348,16 @@ void DbTreeViewManager::onButtonBackClicked()
         // 移除最后一个目录名称以返回上一层
         path.removeLast();
 
-        if (path.isEmpty()) {
+        if (path.isEmpty()) 
+        {
            // qDebug() << "已经在根目录,无法返回。";
             return;
         }
 
         // 根据新的路径查找对应的 QModelIndex
         QModelIndex parentIndex = findItemByPath(path);
-        if (!parentIndex.isValid()) {
+        if (!parentIndex.isValid()) 
+        {
             //qWarning() << "无法找到路径对应的目录项:" << path;
             return;
         }
@@ -3125,7 +3371,8 @@ void DbTreeViewManager::onButtonBackClicked()
 
         // 检查父目录是否为第三层目录
         QStandardItem* parentItem = m_pCModel->itemFromIndex(parentIndex);
-        if (!parentItem) {
+        if (!parentItem) 
+        {
             qWarning() << "父目录项无效。";
             return;
         }
@@ -3134,11 +3381,14 @@ void DbTreeViewManager::onButtonBackClicked()
         bool isThirdLevel = false;
         int directoryId = -1;
         QString multiTableName = "";
-        if (dataVar.canConvert<QJsonObject>()) {
+        if (dataVar.canConvert<QJsonObject>()) 
+        {
             QJsonObject dataObj = dataVar.toJsonObject();
-            if (dataObj.contains("IsThirdLevel") && dataObj["IsThirdLevel"].toBool()) {
+            if (dataObj.contains("IsThirdLevel") && dataObj["IsThirdLevel"].toBool()) 
+            {
                 isThirdLevel = true;
-                if (dataObj.contains("Id")) {
+                if (dataObj.contains("Id")) 
+                {
                     directoryId = dataObj["Id"].toInt();
                 }
                 if (dataObj.contains("TableName"))
@@ -3148,8 +3398,10 @@ void DbTreeViewManager::onButtonBackClicked()
             }
         }
 
-        if (isThirdLevel) {
-            if (directoryId == -1) {
+        if (isThirdLevel)
+        {
+            if (directoryId == -1)
+            {
                 qWarning() << "无效的 DirectoryId,无法加载第三层目录内容。";
                 return;
             }
@@ -3165,12 +3417,17 @@ void DbTreeViewManager::onButtonBackClicked()
             //QJsonObject data = fetchThirdLevelData(directoryId, userPrivilege);
             // 显示字段展示窗口
             //displayThirdLevelFields(data, false); // 传递参数表示非 Home 界面
-        } else {
+        } 
+        else 
+        {
             // 父目录不是第三层目录,确保目录树和分隔线可见
             m_pTreeViewDown->show();
-            for (auto separator : m_mapFirstLevelSeparators) {
+            for (auto separator : m_mapFirstLevelSeparators) 
+            {
                 if (separator)
+                {
                     separator->show();
+                }
             }
         }
         return;
@@ -3180,25 +3437,29 @@ void DbTreeViewManager::onButtonBackClicked()
    // qDebug() << "当前不在第三层目录,尝试在目录树中返回上一层。";
 
     QModelIndex currentIndex = m_pTreeViewDown->currentIndex();
-    if (!currentIndex.isValid()) {
+    if (!currentIndex.isValid()) 
+    {
        // qWarning() << "当前没有选中的目录项,无法返回。";
         return;
     }
 
     QStandardItem* currentItem = m_pCModel->itemFromIndex(currentIndex);
-    if (!currentItem) {
+    if (!currentItem) 
+    {
       //  qWarning() << "当前选中的目录项无效。";
         return;
     }
 
     QStandardItem* parentItem = currentItem->parent();
-    if (!parentItem) {
+    if (!parentItem) 
+    {
       //  qDebug() << "当前已经在根目录,无法返回。";
         return;
     }
 
     QModelIndex parentIndex = m_pCModel->indexFromItem(parentItem);
-    if (!parentIndex.isValid()) {
+    if (!parentIndex.isValid())
+    {
        // qWarning() << "父目录的 QModelIndex 无效。";
         return;
     }
@@ -3215,11 +3476,14 @@ void DbTreeViewManager::onButtonBackClicked()
     bool isThirdLevel = false;
     int directoryId = -1;
     QString multiTableName = "";
-    if (dataVar.canConvert<QJsonObject>()) {
+    if (dataVar.canConvert<QJsonObject>()) 
+    {
         QJsonObject dataObj = dataVar.toJsonObject();
-        if (dataObj.contains("IsThirdLevel") && dataObj["IsThirdLevel"].toBool()) {
+        if (dataObj.contains("IsThirdLevel") && dataObj["IsThirdLevel"].toBool()) 
+        {
             isThirdLevel = true;
-            if (dataObj.contains("Id")) {
+            if (dataObj.contains("Id"))
+            {
                 directoryId = dataObj["Id"].toInt();
             }
             if (dataObj.contains("TableName"))
@@ -3229,8 +3493,10 @@ void DbTreeViewManager::onButtonBackClicked()
         }
     }
 
-    if (isThirdLevel) {
-        if (directoryId == -1) {
+    if (isThirdLevel) 
+    {
+        if (directoryId == -1) 
+        {
             qWarning() << "无效的 DirectoryId,无法加载第三层目录内容。";
             return;
         }
@@ -3781,9 +4047,9 @@ void DbTreeViewManager::displayThirdLevelButtons(const QList<CONFIG_BASE_STRUCT>
     // 使用绝对定位创建按钮
     for (int i = 0; i < buttons.size() && i < 12; ++i)
     {
-        int buttonId = buttons[i].iGroupId;
+        int buttonId = std::stoi(buttons[i].strValue);
         QString buttonIcon = QString::fromStdString(buttons[i].sIcon);
-        QString buttonText = QString::fromStdString(buttons[i].strName);
+        QString buttonText = QString::fromStdString(buttons[i].strDescribe);
         QString strCallFun = QString::fromStdString(buttons[i].strCallFun);
         bool isEnabled = buttons[i].bEnable;
 
@@ -4085,7 +4351,7 @@ void DbTreeViewManager::loadExpandedPaths()
 void DbTreeViewManager::Level3MenuAllSaveBut(QVBoxLayout* pVBox)
 {
     QHBoxLayout* fieldLayout = new QHBoxLayout;
-    fieldLayout->setSpacing(5);
+    fieldLayout->setSpacing(15);
 
     QPushButton* pSaveBut = new QPushButton(tr("Save", "保存"));
     pSaveBut->setFixedSize(80, 28);
@@ -4117,12 +4383,14 @@ void DbTreeViewManager::Level3MenuAllSaveBut(QVBoxLayout* pVBox)
             {
                 if (JMessageTip::Message_question(tr("Modifications detected, do you want to save?", "检测到修改内容,是否保存?"), this) == QMessageBox::Yes)
                 {
+                    m_isRepeatSave = true;
                     emit saveClicked();
                 }
             }
         });
 
     fieldLayout->addWidget(pSaveBut);
+    fieldLayout->addSpacing(13);
     pVBox->addLayout(fieldLayout);
 }
 
@@ -4143,6 +4411,7 @@ void DbTreeViewManager::PromptSaveChanges()
     {
         if (JMessageTip::Message_question(tr("Modifications detected, do you want to save?", "检测到修改内容,是否保存?"), this) == QMessageBox::Yes) 
         {
+            m_isRepeatSave = true;
             emit saveClicked();
         }
         else

+ 11 - 1
View/die-bonder-ui/OriginalWnd/DbTreeViewManager.h

@@ -149,6 +149,9 @@ private slots:
      */
     void onItemChanged(QStandardItem *item);
 
+    /**更新表名称
+    */
+    void UpDbTreeViewManager3DataSlots(QString strDbName, QString strTableName);
 private:
     /**三级菜单独的保存按钮
      */
@@ -159,6 +162,9 @@ private:
     void DelMemoryWnd(QWidget* pWid);
 
 private:
+    /**是否重复保存
+     */
+    bool                    m_isRepeatSave = false;
     /** 编程界面
     */
     QPointer<ProgrammPage>  m_pProgrammPage;
@@ -265,6 +271,7 @@ private:
     std::vector<ST_COMBOBOX_CONT>   m_veComboBoxCont;
     std::vector<ST_TIME_CONT>       m_veTimeCont;
     std::vector<ST_SWITCH_CONT>     m_veSwitchCont;
+    std::vector<ST_TREEM_CUSTOM_TEXT>     m_veTreemCustomText;
     ns_module::CViewInterface*      m_pTreeCViewInterface = nullptr;
 
     /**二级表目录的名称
@@ -322,7 +329,7 @@ private:
      * @brief 更新父项的复选框状态(如果所有子项选中则父项也选中,否则取消)
      * @param item 当前变更的子项
      */
-    void updateParentCheckState(QStandardItem *item);
+    void UpdateParentCheckState(QStandardItem *item);
 
     /**
      * @brief 更新按钮可见性:Home 界面隐藏,其他配置显示
@@ -426,6 +433,9 @@ private:
      */
     void displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DATA>& data, bool allChangeFalg, bool isHome);
 
+    /**更新显示三级菜单所有控件
+     */
+    void UpdateShowAll3MenuControl(QList<ST_TABLE_CONTROL_DATA>& data);
 
     /**
      * @brief 保存当前选中的复选框路径到 QSettings

+ 3 - 3
View/die-bonder-ui/OriginalWnd/MainAndSecondaryCamerasWnd.cpp

@@ -30,7 +30,7 @@ MainAndSecondaryCamerasWnd::MainAndSecondaryCamerasWnd(QWidget* parent)
     m_veCurrentSelectGroup_R.isBond = false;
     m_veCurrentSelectGroup_L.isBond = false;
     m_timerMaterial = new QTimer(this);
-   // connect(m_timerMaterial, &QTimer::timeout, this, &MainAndSecondaryCamerasWnd::UpdateMaterialByTimer);
+    connect(m_timerMaterial, &QTimer::timeout, this, &MainAndSecondaryCamerasWnd::UpdateMaterialByTimer);
     m_pCViewInterface = ns_module::CViewInterface::GetInstance();
 }
 
@@ -113,7 +113,7 @@ void MainAndSecondaryCamerasWnd::InitPage()
             }
             else
             {
-                m_pMainCameraBind->m_vecCamera[i].eType = MATERIAL_BOX;
+                m_pMainCameraBind->m_vecCamera[i].eType = MATERIAL_BOND;
                 manager = new CameraImageHandler(num, m_pMainCameraBind->m_vecCamera[i]);
             }
 
@@ -357,7 +357,7 @@ void MainAndSecondaryCamerasWnd::initLeftAndRightWidget() {
 
         }
     }
-    m_timerMaterial->start(10000);
+    m_timerMaterial->start(5000);
 }
 
 void MainAndSecondaryCamerasWnd::BindImageOrMaterial(int location, int index) 

+ 1 - 0
View/die-bonder-ui/OriginalWnd/OriginalWnd.cpp

@@ -152,6 +152,7 @@ void OriginalWnd::InitForm()
 void OriginalWnd::InitTreeViewManager()
 {
     //TODO: 不行的话直接m_pCameraBind 传递当前指针,这样不会存在释放问题
+    //m_pCameraBind
     m_pdbTreeViewManager.reset(new DbTreeViewManager(ui->menuFunctionsSwitchWidget, this));
     connect(m_pdbTreeViewManager.get(), &DbTreeViewManager::RunFunSignals, this, &OriginalWnd::JRunFunSlots);
 

+ 1 - 1
View/die-bonder-ui/OriginalWnd/TreeViewManager/JCustomLabelControls.h

@@ -55,7 +55,7 @@ public:
         }
         else
         {
-            m_pCamera->GetViewMotion()->SetIoStatus(m_strName.toStdString(), m_bClicked);
+            m_pCamera->GetViewMotion()->SetIoStatus(m_strName.toStdString(), (ns_db::DIGIT_IO_LEVEL)m_bClicked);
         }
     }
 

+ 14 - 3
View/die-bonder-ui/OriginalWnd/TreeViewManager/JIoMapPage.cpp

@@ -4,10 +4,10 @@
 
 JIoMapPage::JIoMapPage() {}
 
-QWidget* JIoMapPage::CreateIoPage(const CONFIG_BASE_STRUCT& control)
+QWidget* JIoMapPage::CreateIoPage(const QString& strName)
 {
     // 1.用到表中的变量
-    QString strName = control.strName.c_str();
+    //QString strName = control.strName.c_str();
 
     // 2. 创建垂直布局
     QHBoxLayout* pHLayout = new QHBoxLayout();
@@ -15,7 +15,8 @@ QWidget* JIoMapPage::CreateIoPage(const CONFIG_BASE_STRUCT& control)
     IoStateLab* pIoState = new IoStateLab();
     pIoState->setIoName(strName);
     QLabel* pAxisNmae = new QLabel();
-    QString strAxisName = tr("AxisNmae:", "轴名称:");
+    QString strAxisName = tr("IO Nmae:", "IO名称:");
+    strAxisName += "    ";
     strAxisName += strName;
     pAxisNmae->setText(strAxisName);
 
@@ -41,6 +42,16 @@ QWidget* JIoMapPage::CreateIoPage(const CONFIG_BASE_STRUCT& control)
     // 改变状态标记
     pHLayout->addWidget(pIoState);
     QWidget* pWidget = new QWidget;
+    pWidget->setStyleSheet(
+        /*  "QWidget:hover {"
+          "   background-color: #AACBFC;"
+          "   border: 1px solid #AACBFC;"
+          "}"*/
+        "QWidget { background-color: #D8E8FD; }"
+       /* "QLabel:hover { background-color: #AACBFC; }"
+        "QLabel { background-color: #D8E8FD; }"*/
+    );
+
     pWidget->setLayout(pHLayout);
     return pWidget;
 }

+ 1 - 1
View/die-bonder-ui/OriginalWnd/TreeViewManager/JIoMapPage.h

@@ -20,7 +20,7 @@ public:
 
     /**io 界面,先获取全部,后续可用,没用到的后续修改
      */
-    static QWidget* CreateIoPage(const CONFIG_BASE_STRUCT& control);
+    static QWidget* CreateIoPage(const QString& strName);
 
     /**轴测试页面
      */

+ 13 - 0
View/die-bonder-ui/OriginalWnd/TreeViewManager/TreeViewManagerHead.h

@@ -53,6 +53,19 @@
 #include "CViewInterface.h"
 #include "Src/Sql/SqlOperation.h"
 #include "Src/Sql/GetUiConfigFormDB.h"
+#include "JCustomLabelControls.h"
+class AutoResizeLabel;
+
+//自定义Text 控件 Custom
+struct ST_TREEM_CUSTOM_TEXT
+{
+    QString strConfigurationsName;
+    QString strfieldName;
+    QString strfieldDescribe;
+
+    QPointer<AutoResizeLabel> pfieldValue;
+    QPointer<AutoResizeLabel> pfieldUnits;
+};
 
 // 组合控件
 struct ST_COMBINED_CONT

+ 1 - 1
View/die-bonder-ui/SBTdie-bonder-ui.vcxproj

@@ -311,7 +311,7 @@
     <QtMoc Include="Src\MatrixDialogs\NoBondPtEditDialog.h" />
     <QtMoc Include="Src\DiagnosisPage\DiagnosisPage.h" />
     <ClInclude Include="Src\Sql\GetUiConfigFormDB.h" />
-    <ClInclude Include="Src\Sql\SqlOperation.h" />
+    <QtMoc Include="Src\Sql\SqlOperation.h" />
     <QtMoc Include="Src\CameraBind.h" />
     <QtMoc Include="OriginalWnd\CameraDataHandleAndShow.h">
     </QtMoc>

+ 3 - 6
View/die-bonder-ui/SBTdie-bonder-ui.vcxproj.filters

@@ -458,6 +458,9 @@
     <QtMoc Include="Src\DiagnosisPage\DiagnosisPage.h">
       <Filter>Source Files\Src\DiagnosisPage</Filter>
     </QtMoc>
+    <QtMoc Include="Src\Sql\SqlOperation.h">
+      <Filter>Header Files\Src\Sql</Filter>
+    </QtMoc>
   </ItemGroup>
   <ItemGroup>
     <CustomBuild Include="debug\moc_predefs.h.cbt">
@@ -842,9 +845,6 @@
     <None Include="dark.qss">
       <Filter>Resource Files</Filter>
     </None>
-    <None Include="dark.qss">
-      <Filter>Resource Files</Filter>
-    </None>
     <None Include="Src\Res\qss\dark.qss">
       <Filter>Source Files\Src\Res\qss</Filter>
     </None>
@@ -864,9 +864,6 @@
     <ClInclude Include="Src\common\JLogAllOutput.h">
       <Filter>Header Files\Src\common</Filter>
     </ClInclude>
-    <ClInclude Include="Src\Sql\SqlOperation.h">
-      <Filter>Header Files\Src\Sql</Filter>
-    </ClInclude>
     <ClInclude Include="CameraDistribute.h">
       <Filter>Header Files\Src</Filter>
     </ClInclude>

Файловите разлики са ограничени, защото са твърде много
+ 593 - 260
View/die-bonder-ui/Src/BondMatrixProgramPage.cpp


+ 100 - 6
View/die-bonder-ui/Src/BondMatrixProgramPage.h

@@ -32,15 +32,20 @@ private:
 	//void AddOutMatrixPage(int vectorIndex, PROGRAM_BOND_MATRIX_STRUCT matrixData);
 
 	XY_DOUBLE_STRUCT BondGetAxisPosition(std::string ModuleType, XY_DOUBLE_STRUCT& pos);
+	XY_DOUBLE_STRUCT BondMoveToXYAxisPosition(std::string ModuleType, XY_DOUBLE_STRUCT& pos);
 	//往后端新增矩阵数据
 	void AddMatrixParam();
 
 	//更新参数,根据选择的点更新界面参数显示
 	void UpdatePageParam();
 
+	//更新取/固晶参数,根据选择的点更新界面参数显示
+	void UpdatePagePickPlaceParam();
+
 	//参数被修改后发送给后端
 	void ParamChangeEvent();
-	int ParamSaveAsEvent();
+	int BondInfoParamSaveAsEvent();
+	int ParamSaveAsEvent(ns_db::PICKBOND_PARAM_STRUCT &m_curWaferPickParam);
 
 	//参数被修改后发送给后端
 	void MatrixChangeEvent();
@@ -54,6 +59,16 @@ private:
 	void initPage();
 
 
+	// 初始化取晶控件连接
+	void connectWaferPickControls();   // 华夫盒取晶
+	void connectCalibPickControls();   // 中转台取晶
+	// 初始化放晶控件连接
+	void connectCalibPlaceControls();
+	void connectBondControls();
+
+
+	void ShowCurrentMatrix(int bondMatrixId);
+
 protected:
 	bool eventFilter(QObject* watched, QEvent* event) override;
 
@@ -62,9 +77,79 @@ private slots:
 	void onNoBondPtsClicked(QLineEdit* lineEdit, int index, int parentIndex);
 
 	void UpdateShowBondInfoData(UINT iInfoId);
-	void onComboBoxIndexChanged(int index);
+	void onComboBoxCurrentMatrixChanged(int index);  // 切换矩阵
+	void onComboBoxIndexChangedForMatrixParam(int index);
+	void onComboBoxIndexChangedForParam(int index);
 	void onComboBoxPopup(QComboBox* comboBox);
 
+	//ModifyParam
+	void onSetParamPickTempClicked();
+	void onSetParamPreBondClicked();
+	void onSetParamPostBondClicked();
+	void onSetParamBondClicked();
+	void onSetParamLookUpClicked();
+	void onSetParamCalibPickClicked();
+	//CreateParam
+	void onCreateParamPickTempClicked();
+	void onCreateParamPreBondClicked();
+	void onCreateParamPostBondClicked();
+	void onCreateParamBondClicked();
+	void onCreateParamLookUpClicked();
+	void onCreateParamCalibPickClicked();
+
+	// ——— 取晶槽函数 ———
+	// 取晶头取晶
+	void onCheckBoxPickBlockCheckClicked(bool);
+	void onCheckBoxPickLoseCheckClicked(bool);
+	void onCheckBoxPickFindForceCheckClicked(bool);
+	void onDoubleSpinBoxPrePickZEditingFinished();
+	void onDoubleSpinBoxPickForceEditingFinished();
+	void onDoubleSpinBoxPickPosZEditingFinished();
+	void onSpinBoxPickGrabDelayEditingFinished();
+	void onSpinBoxPickDelayEditingFinished();
+	void onSpinBoxPickBlockCheckDelayEditingFinished();
+	void onSpinBoxPickVacDelayEditingFinished();
+	void onSpinBoxPickBlowDelayEditingFinished();
+
+	// 中转台取晶
+	void onCheckBoxPickBlockCheck_2Clicked(bool);
+	void onCheckBoxPickLoseCheck_2Clicked(bool);
+	void onCheckBoxPickFindForceCheck_2Clicked(bool);
+	void onDoubleSpinBoxPrePickZ_2EditingFinished();
+	void onDoubleSpinBoxPickForce_2EditingFinished();
+	void onDoubleSpinBoxPickPosZ_2EditingFinished();
+	void onSpinBoxPickGrabDelay_2EditingFinished();
+	void onSpinBoxPickDelay_2EditingFinished();
+	void onSpinBoxPickBlockCheckDelay_2EditingFinished();
+	void onSpinBoxPickVacDelay_2EditingFinished();
+	void onSpinBoxPickBlowDelay_2EditingFinished();
+
+	// "中转台放晶" 控件的槽函数
+	void onCheckBoxBondBlockCheckClicked(bool isChecked);
+	void onCheckBoxBondLoseCheckClicked(bool isChecked);
+	void onCheckBoxBondFindForceClicked(bool isChecked);
+	void onDoubleSpinBoxPreBondPosZEditingFinished();
+	void onDoubleSpinBoxBondForceEditingFinished();
+	void onDoubleSpinBoxBondPosZEditingFinished();
+	void onSpinBoxBondGrabDelayEditingFinished();
+	void onSpinBoxBondBlockCheckDelayEditingFinished();
+	void onSpinBoxBondDelayEditingFinished();
+	void onSpinBoxBondVacDelayEditingFinished();
+	void onSpinBoxBondBlowDelayEditingFinished();
+
+	// "固晶台固晶" 控件的槽函数
+	void onCheckBoxBondBlockCheck_2Clicked(bool isChecked);
+	void onCheckBoxBondLoseCheck_2Clicked(bool isChecked);
+	void onCheckBoxBondFindForce_2Clicked(bool isChecked);
+	void onDoubleSpinBoxPreBondPosZ_2EditingFinished();
+	void onDoubleSpinBoxBondForce_2EditingFinished();
+	void onDoubleSpinBoxBondPosZ_2EditingFinished();
+	void onSpinBoxBondGrabDelay_2EditingFinished();
+	void onSpinBoxBondBlockCheckDelay_2EditingFinished();
+	void onSpinBoxBondDelay_2EditingFinished();
+	void onSpinBoxBondVacDelay_2EditingFinished();
+	void onSpinBoxBondBlowDelay_2EditingFinished();
+
 private:
 	Ui::BondMatrixProgramPageClass ui;
 
@@ -72,16 +157,21 @@ private:
 
 	CProduct* m_pProduct = nullptr;
 
+
+	std::vector<ns_db::PR_STRATEGY>  m_vecPrStrategy;
+	std::vector<ns_db::PR_TEMPLATE>  m_vecPrTemplate;
+	std::vector<ns_db::PR_BONDINSP>  m_vecPrBondInsp;
+
 	//当前界面显示的参数
 	ns_db::BOND_INFO_STRUCT m_curBondInfo;
 
-	ns_db::PICKBOND_PARAM_STRUCT m_curWaferPickParam;
+	ns_db::PICKBOND_PARAM_STRUCT m_curWaferPickParam;//取晶头取晶
 
-	ns_db::PICKBOND_PARAM_STRUCT m_curCalibPlaceParam;
+	ns_db::PICKBOND_PARAM_STRUCT m_curCalibPlaceParam;//中转台固晶
 
-	ns_db::PICKBOND_PARAM_STRUCT m_curCalibPickParam;
+	ns_db::PICKBOND_PARAM_STRUCT m_curCalibPickParam;//中转台取晶
 
-	ns_db::PICKBOND_PARAM_STRUCT m_curBondParam;
+	ns_db::PICKBOND_PARAM_STRUCT m_curBondParam;//固晶台固晶
 
 	ns_mat::POINT_INFO_STRUCT m_curPointInfo;
 
@@ -112,4 +202,8 @@ private:
 
 	//QComboBox* comboBoxParagramSet;
 	QMap<QComboBox*, int> m_mapParagramSetComboBox;
+
+	QVBoxLayout* verticalLayout_tem = new QVBoxLayout();
+
+	bool   m_assss = false;
 };

Файловите разлики са ограничени, защото са твърде много
+ 726 - 258
View/die-bonder-ui/Src/BondMatrixProgramPage.ui


+ 109 - 11
View/die-bonder-ui/Src/DiagnosisPage/DiagnosisPage.cpp

@@ -1,6 +1,8 @@
 #include "DiagnosisPage.h"
 #include "../common/JQCommon.h"
 #include "QPainter"
+#include "OriginalWnd/TreeViewManager/JIoMapPage.h"
+#include "QListWidget"
 
 DiagnosisPage::DiagnosisPage(QWidget *parent)
     : QWidget(parent)
@@ -17,18 +19,20 @@ void DiagnosisPage::Init()
 {
     this->setAttribute(Qt::WA_DeleteOnClose);
     ui.axisSwitchTabPage->tabBar()->hide();
-    ui.axisSwitchTabPage->setCurrentIndex(0);
+    SwitchTabPage(0);
+
     ui.retBut->setIcon(QIcon(":/images/home_openFile.png"));
 
 
     ui.axisListTree->setHeaderHidden(true);
     ui.axisListTree->setEditTriggers(QAbstractItemView::NoEditTriggers);
 
-    QSharedPointer<ns_module::CViewInterface> pCViewInterface(ns_module::CViewInterface::GetInstance());
+    ns_module::CViewInterface* pCViewInterface = ns_module::CViewInterface::GetInstance();
 
     if (pCViewInterface)
     {
         m_veCAxis = pCViewInterface->GetViewMotion()->GetAxisList();
+        m_veCIO = pCViewInterface->GetViewMotion()->GetIoList();
         // 创建模型
         m_model = new QStandardItemModel(this);
         QString strModeA;
@@ -75,8 +79,9 @@ void DiagnosisPage::SwitchOperationAxisPage(bool isSwitch)
         ui.titleLable->setText(strMode);
 
         // 设置状态
-        m_IsDriveEnabled = m_pCurrOpenCAxis->JIsDriveEnabled();
-        ui.xAxisEnabledRadioBut->setChecked(m_IsDriveEnabled);
+        //m_IsDriveEnabled = m_pCurrOpenCAxis->JIsDriveEnabled();
+        //ui.xAxisEnabledRadioBut->setChecked(m_IsDriveEnabled);
+        m_IsDriveEnabled = false;
 
         // 获取正负限位是否打开
         bool bEnabledNeg, bEnabledPos;
@@ -89,8 +94,10 @@ void DiagnosisPage::SwitchOperationAxisPage(bool isSwitch)
             ui.posLineEdit->setText(QString::number(dSoftLimitPos,'f',2));
         }
 
-        
-        //ui.speedLineEdit->setText(QString::number(0));
+        double dMaxVel;
+        m_pCurrOpenCAxis->JGetMaxVelocity(dMaxVel);
+        ui.speedLineEdit->setText(QString::number(dMaxVel, 'f', 2));
+        ui.speedMaxLineEdit->setText(QString::number(dMaxVel, 'f', 2));
 
         // 设置定时获取速度
         const int nRunTime = 300; //所有新开的定时器都用这个
@@ -98,9 +105,12 @@ void DiagnosisPage::SwitchOperationAxisPage(bool isSwitch)
     }
     else
     {
-        killTimer(m_nTimerID);
-        m_nTimerID = 0;
-        ui.axisSwitchTabPage->setCurrentIndex(0);
+        if (m_nTimerID > 0)
+        {
+            killTimer(m_nTimerID);
+            m_nTimerID = -1;
+        }
+        SwitchTabPage(0);
     }
 }
 
@@ -263,6 +273,33 @@ void DiagnosisPage::uncheckAllItems(const QModelIndex& parent /*= QModelIndex()*
     }
 }
 
+void DiagnosisPage::SwitchTabPage(int nSwitch)
+{
+    ui.axisSwitchTabPage->setCurrentIndex(nSwitch);
+    if (nSwitch == 0)
+    {
+        ui.AllHomeBut->show();
+        ui.AllEnableBut->show();
+        ui.AllIOPageBut->show();
+        ui.retBut->hide();
+    }
+    else if (nSwitch == 1)
+    {
+        ui.AllHomeBut->hide();
+        ui.AllEnableBut->hide();
+        ui.AllIOPageBut->hide();
+        ui.retBut->show();
+    }
+    else if (nSwitch == 2)
+    {
+        ui.AllHomeBut->hide();
+        ui.AllEnableBut->hide();
+        ui.AllIOPageBut->hide();
+        ui.retBut->show();
+    }
+    m_nCurrIndex = nSwitch;
+}
+
 void DiagnosisPage::timerEvent(QTimerEvent* event)
 {
     if (m_nTimerID == event->timerId())
@@ -317,14 +354,14 @@ void DiagnosisPage::on_axisListTree_doubleClicked(const QModelIndex& index)
             currentItem += "_";
             currentItem += itemName;
             // 给轴窗口
-            ui.axisSwitchTabPage->setCurrentIndex(1);
+            SwitchTabPage(1);
 
             for (auto& a : m_veCAxis)
             {
                 QString strMode = QString::fromLocal8Bit(a->GetAxisName().c_str());
                 if (strMode == currentItem)
                 {
-                    m_pCurrOpenCAxis.reset(a);
+                    m_pCurrOpenCAxis = a;
 
                     SwitchOperationAxisPage(true);
                     break;
@@ -350,14 +387,69 @@ void DiagnosisPage::on_xAxisDisable_clicked()
     }
 
     ui.xAxisDisable->setText(strText);
+    ui.xAxisEnabledRadioBut->setChecked(m_IsDriveEnabled);
 }
 
 
+void DiagnosisPage::on_AllEnableBut_clicked()
+{
+    for (auto a : m_veCAxis)
+    {
+        if (m_AllIsDriveEnabled)
+        {
+            a->AxisOn();
+        }
+        else
+        {
+            a->AxisOff();
+        }
+        
+    }
+
+
+    QString strText = tr("All Enable", "所有开使能");
+    if (m_AllIsDriveEnabled)
+    {
+        strText = tr("All Disable", "所有关使能");
+    }
+
+    ui.AllEnableBut->setText(strText);
+    m_AllIsDriveEnabled = !m_AllIsDriveEnabled;
+}
+
+void DiagnosisPage::on_AllIOPageBut_clicked()
+{
+    SwitchTabPage(2);
+    if (!m_isInitIo)
+    {
+        QScrollArea* scrollArea = new QScrollArea;
+        scrollArea->setWidgetResizable(true);
+        QWidget* contentWidget = new QWidget;
+        QVBoxLayout* contentLayout = new QVBoxLayout(contentWidget);
+
+
+        for (auto a : m_veCIO)
+        {
+            QString strMode = QString::fromLocal8Bit(a->GetName().c_str());
+            contentLayout->addWidget(JIoMapPage::CreateIoPage(strMode));
+        }
+        scrollArea->setWidget(contentWidget);
+        ui.ioUi->addWidget(scrollArea);
+
+        m_isInitIo = true;
+    }
+}
+
 void DiagnosisPage::on_xAxisHomeBut_clicked()
 {
     m_pCurrOpenCAxis->Home();
 }
 
+void DiagnosisPage::on_AllHomeBut_clicked()
+{
+    ns_module::CViewInterface::GetInstance()->GetViewMotion()->ToHome();
+}
+
 void DiagnosisPage::on_setPosBut_clicked()
 {
     double xNeg = ui.negLineEdit->text().toDouble();
@@ -383,6 +475,12 @@ void DiagnosisPage::on_setSpeedBut_clicked()
 }
 
 
+void DiagnosisPage::on_setMaxSpeedBut_clicked()
+{
+    double doSpeed = ui.speedMaxLineEdit->text().toDouble();
+    m_pCurrOpenCAxis->JSetMaxVelocity(doSpeed);
+}
+
 void DiagnosisPage::on_retBut_clicked()
 {
     SwitchOperationAxisPage(false);

+ 23 - 1
View/die-bonder-ui/Src/DiagnosisPage/DiagnosisPage.h

@@ -48,6 +48,11 @@ private:
     void paintAllBranches(const QModelIndex& parentIndex, QPainter& painter);
 
     void uncheckAllItems(const QModelIndex& parent = QModelIndex());
+
+    /**切换Tab页面
+     */
+    void SwitchTabPage(int nSwitch);
+
 private:
     void timerEvent(QTimerEvent* event) override; 
 
@@ -58,14 +63,22 @@ private slots:
 
     void on_xAxisDisable_clicked();
 
+    void on_AllEnableBut_clicked();
+
+    void on_AllIOPageBut_clicked();
+
     void on_xAxisHomeBut_clicked();
 
+    void on_AllHomeBut_clicked();
+
     void on_setPosBut_clicked();
 
     void on_setNegBut_clicked();
 
     void on_setSpeedBut_clicked();
 
+    void on_setMaxSpeedBut_clicked();
+
     void on_retBut_clicked();
 
 private:
@@ -79,18 +92,27 @@ private:
      */
     std::vector<CAxis*>     m_veCAxis;
 
+    
+    /*所有io 信息
+    */
+    vector<CIO*>            m_veCIO;
+
     /**当前轴指针
      */
     //std::unique_ptr<CAxis>  m_pCurrOpenCAxis;
-    QSharedPointer<CAxis>   m_pCurrOpenCAxis;
+    CAxis*                  m_pCurrOpenCAxis = nullptr;
 
     /**使能
      */
     bool                    m_IsDriveEnabled = false;
+    bool                    m_AllIsDriveEnabled = true;
 
     /**定时获取位置
     */
     int                     m_nTimerID = -1;
+
+    int                     m_nCurrIndex = 0;
+    bool                    m_isInitIo = false;
 };
 
 #endif  //__DIAGNOSISPAGE_H__

+ 186 - 4
View/die-bonder-ui/Src/DiagnosisPage/DiagnosisPage.ui

@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>490</width>
+    <width>480</width>
     <height>1178</height>
    </rect>
   </property>
@@ -26,7 +26,7 @@
     </rect>
    </property>
    <property name="currentIndex">
-    <number>0</number>
+    <number>1</number>
    </property>
    <widget class="QWidget" name="AxisTab">
     <attribute name="title">
@@ -76,6 +76,12 @@
       <layout class="QHBoxLayout" name="horizontalLayout_3">
        <item>
         <widget class="QLabel" name="label_6">
+         <property name="minimumSize">
+          <size>
+           <width>70</width>
+           <height>0</height>
+          </size>
+         </property>
          <property name="font">
           <font>
            <pointsize>12</pointsize>
@@ -91,11 +97,21 @@
          <property name="enabled">
           <bool>false</bool>
          </property>
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>40</height>
+          </size>
+         </property>
          <property name="font">
           <font>
            <pointsize>12</pointsize>
           </font>
          </property>
+         <property name="styleSheet">
+          <string notr="true">color: rgb(255, 170, 0);
+background-color: rgb(0, 0, 0);</string>
+         </property>
          <property name="text">
           <string>0</string>
          </property>
@@ -170,12 +186,18 @@
         <x>20</x>
         <y>270</y>
         <width>401</width>
-        <height>51</height>
+        <height>62</height>
        </rect>
       </property>
       <layout class="QHBoxLayout" name="horizontalLayout_4">
        <item>
         <widget class="QPushButton" name="xAxisDisable">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>44</height>
+          </size>
+         </property>
          <property name="font">
           <font>
            <pointsize>12</pointsize>
@@ -191,6 +213,12 @@
        </item>
        <item>
         <widget class="QPushButton" name="xAxisHomeBut">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>44</height>
+          </size>
+         </property>
          <property name="font">
           <font>
            <pointsize>12</pointsize>
@@ -233,6 +261,15 @@
          </item>
          <item>
           <widget class="QLineEdit" name="negLineEdit">
+           <property name="minimumSize">
+            <size>
+             <width>0</width>
+             <height>34</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>0</string>
+           </property>
            <property name="alignment">
             <set>Qt::AlignCenter</set>
            </property>
@@ -240,6 +277,12 @@
          </item>
          <item>
           <widget class="QPushButton" name="setNegBut">
+           <property name="minimumSize">
+            <size>
+             <width>0</width>
+             <height>34</height>
+            </size>
+           </property>
            <property name="text">
             <string>Set</string>
            </property>
@@ -264,6 +307,15 @@
          </item>
          <item>
           <widget class="QLineEdit" name="posLineEdit">
+           <property name="minimumSize">
+            <size>
+             <width>0</width>
+             <height>34</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>0</string>
+           </property>
            <property name="alignment">
             <set>Qt::AlignCenter</set>
            </property>
@@ -271,6 +323,12 @@
          </item>
          <item>
           <widget class="QPushButton" name="setPosBut">
+           <property name="minimumSize">
+            <size>
+             <width>0</width>
+             <height>34</height>
+            </size>
+           </property>
            <property name="text">
             <string>Set</string>
            </property>
@@ -292,6 +350,12 @@
       <layout class="QHBoxLayout" name="horizontalLayout_7">
        <item>
         <widget class="QLabel" name="label_4">
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>0</height>
+          </size>
+         </property>
          <property name="text">
           <string>Set Speed</string>
          </property>
@@ -299,6 +363,15 @@
        </item>
        <item>
         <widget class="QLineEdit" name="speedLineEdit">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>34</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>0</string>
+         </property>
          <property name="alignment">
           <set>Qt::AlignCenter</set>
          </property>
@@ -306,6 +379,60 @@
        </item>
        <item>
         <widget class="QPushButton" name="setSpeedBut">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>34</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>Set</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="layoutWidget_2">
+      <property name="geometry">
+       <rect>
+        <x>10</x>
+        <y>220</y>
+        <width>311</width>
+        <height>41</height>
+       </rect>
+      </property>
+      <layout class="QHBoxLayout" name="horizontalLayout_8">
+       <item>
+        <widget class="QLabel" name="label_5">
+         <property name="text">
+          <string extracomment="设置最大速度">Set Max Speed</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLineEdit" name="speedMaxLineEdit">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>34</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>0</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="setMaxSpeedBut">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>34</height>
+          </size>
+         </property>
          <property name="text">
           <string>Set</string>
          </property>
@@ -359,6 +486,22 @@
      </layout>
     </widget>
    </widget>
+   <widget class="QWidget" name="io">
+    <attribute name="title">
+     <string>io</string>
+    </attribute>
+    <widget class="QWidget" name="verticalLayoutWidget">
+     <property name="geometry">
+      <rect>
+       <x>0</x>
+       <y>0</y>
+       <width>471</width>
+       <height>1071</height>
+      </rect>
+     </property>
+     <layout class="QVBoxLayout" name="ioUi"/>
+    </widget>
+   </widget>
   </widget>
   <widget class="QPushButton" name="retBut">
    <property name="geometry">
@@ -373,7 +516,7 @@
     <string notr="true"/>
    </property>
    <property name="text">
-    <string extracomment="返回选择所有轴"/>
+    <string/>
    </property>
   </widget>
   <widget class="QFrame" name="frame">
@@ -395,6 +538,45 @@
     <enum>QFrame::Raised</enum>
    </property>
   </widget>
+  <widget class="QPushButton" name="AllHomeBut">
+   <property name="geometry">
+    <rect>
+     <x>10</x>
+     <y>20</y>
+     <width>121</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string extracomment="所有轴回零">All Home</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="AllEnableBut">
+   <property name="geometry">
+    <rect>
+     <x>140</x>
+     <y>20</y>
+     <width>121</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string extracomment="所有轴使能">All Enable</string>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="AllIOPageBut">
+   <property name="geometry">
+    <rect>
+     <x>270</x>
+     <y>20</y>
+     <width>121</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>IO</string>
+   </property>
+  </widget>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <resources/>

+ 11 - 8
View/die-bonder-ui/Src/RewriteControl/LightJoystickSwitchPage.cpp

@@ -82,17 +82,20 @@ void LightJoystickSwitchPage::UpDataAxisToUi()
             if (axisToLayout.contains(val))
             {
                 QLayout* layout = axisToLayout.value(val);
-                for (int i = 0; i < layout->count(); ++i) 
+                if (layout)
                 {
-                    QWidget* widget = layout->itemAt(i)->widget();
-                    if (widget && widget->inherits("QLineEdit")) 
+                    for (int i = 0; i < layout->count(); ++i)
                     {
-                        JReLineEdit* lineEdit = qobject_cast<JReLineEdit*>(widget);
-                        if (lineEdit)
+                        QWidget* widget = layout->itemAt(i)->widget();
+                        if (widget && widget->inherits("QLineEdit"))
                         {
-                            double pos = 0;
-                            m_pCameraBind->YGetAxisPosition(m_moveAxisInfo.ModuleType, val.toStdString(), pos);
-                            lineEdit->setText(QString::number(pos, 'f', 2));
+                            JReLineEdit* lineEdit = qobject_cast<JReLineEdit*>(widget);
+                            if (lineEdit)
+                            {
+                                double pos = 0;
+                                m_pCameraBind->YGetAxisPosition(m_moveAxisInfo.ModuleType, val.toStdString(), pos);
+                                lineEdit->setText(QString::number(pos, 'f', 2));
+                            }
                         }
                     }
                 }

+ 2 - 1
View/die-bonder-ui/Src/RewriteControl/MsgDlg/CustomMessageDlg.cpp

@@ -17,7 +17,8 @@ CustomMessageDlg::~CustomMessageDlg()
 
 void CustomMessageDlg::RunMsgWnd(const ns_module::ST_BUTTON_DONE& butDone)
 {
-
+    ui->tIDlabel_errID->setText(QString::number(butDone.lError));
+    ui->errorInfoTextEdit->setText(butDone.strErrMeassage.c_str());
 }
 
 void CustomMessageDlg::mousePressEvent(QMouseEvent* event)

+ 78 - 27
View/die-bonder-ui/Src/RewriteControl/MsgDlg/CustomMessageDlg.ui

@@ -6,24 +6,39 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>573</width>
-    <height>341</height>
+    <width>657</width>
+    <height>422</height>
    </rect>
   </property>
+  <property name="minimumSize">
+   <size>
+    <width>0</width>
+    <height>0</height>
+   </size>
+  </property>
   <property name="windowTitle">
    <string>Dialog</string>
   </property>
+  <property name="styleSheet">
+   <string notr="true">background-color: rgb(236,236,249);</string>
+  </property>
   <widget class="QLabel" name="bgLabel">
    <property name="geometry">
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>571</width>
-     <height>31</height>
+     <width>651</width>
+     <height>48</height>
     </rect>
    </property>
+   <property name="minimumSize">
+    <size>
+     <width>0</width>
+     <height>48</height>
+    </size>
+   </property>
    <property name="styleSheet">
-    <string notr="true">background-color: rgb(170, 170, 255);</string>
+    <string notr="true">background-color: rgb(95,92,223);</string>
    </property>
    <property name="text">
     <string/>
@@ -32,10 +47,10 @@
   <widget class="QWidget" name="horizontalLayoutWidget">
    <property name="geometry">
     <rect>
-     <x>360</x>
+     <x>370</x>
      <y>0</y>
-     <width>211</width>
-     <height>31</height>
+     <width>281</width>
+     <height>41</height>
     </rect>
    </property>
    <layout class="QHBoxLayout" name="horizontalLayout">
@@ -44,6 +59,10 @@
     </property>
     <item>
      <widget class="QLabel" name="tIDLabel">
+      <property name="styleSheet">
+       <string notr="true">background-color: rgb(95,92,223);
+color: white</string>
+      </property>
       <property name="text">
        <string>ID:</string>
       </property>
@@ -54,6 +73,10 @@
     </item>
     <item>
      <widget class="QLabel" name="tIDlabel_errID">
+      <property name="styleSheet">
+       <string notr="true">background-color: rgb(95,92,223);
+color: white</string>
+      </property>
       <property name="text">
        <string>oxfffffff</string>
       </property>
@@ -82,6 +105,10 @@
         <height>27</height>
        </size>
       </property>
+      <property name="styleSheet">
+       <string notr="true">background-color: rgb(95,92,223);
+color: white</string>
+      </property>
       <property name="text">
        <string>X</string>
       </property>
@@ -92,12 +119,16 @@
   <widget class="QLabel" name="bgTitleLabel">
    <property name="geometry">
     <rect>
-     <x>0</x>
+     <x>10</x>
      <y>0</y>
-     <width>331</width>
-     <height>29</height>
+     <width>271</width>
+     <height>41</height>
     </rect>
    </property>
+   <property name="styleSheet">
+    <string notr="true">background-color: rgb(95,92,223);
+color: white</string>
+   </property>
    <property name="text">
     <string>Process FailuRE</string>
    </property>
@@ -106,9 +137,9 @@
    <property name="geometry">
     <rect>
      <x>0</x>
-     <y>40</y>
-     <width>441</width>
-     <height>291</height>
+     <y>50</y>
+     <width>501</width>
+     <height>371</height>
     </rect>
    </property>
    <layout class="QVBoxLayout" name="verticalLayout">
@@ -132,8 +163,14 @@
       </item>
       <item>
        <widget class="QTextEdit" name="errorInfoTextEdit">
+        <property name="minimumSize">
+         <size>
+          <width>328</width>
+          <height>146</height>
+         </size>
+        </property>
         <property name="styleSheet">
-         <string notr="true">background-color: rgb(197, 197, 197);</string>
+         <string notr="true">background-color: rgb(236,236,249);</string>
         </property>
        </widget>
       </item>
@@ -142,30 +179,40 @@
     <item>
      <widget class="QTextEdit" name="errorDetailsInfoTextEdit">
       <property name="styleSheet">
-       <string notr="true">background-color: rgb(197, 197, 197);</string>
+       <string notr="true">background-color: rgb(236,236,249);</string>
       </property>
      </widget>
     </item>
    </layout>
   </widget>
-  <widget class="QWidget" name="verticalLayoutWidget_2">
+  <widget class="QWidget" name="layoutWidget">
    <property name="geometry">
     <rect>
-     <x>460</x>
-     <y>40</y>
-     <width>101</width>
-     <height>151</height>
+     <x>510</x>
+     <y>50</y>
+     <width>141</width>
+     <height>101</height>
     </rect>
    </property>
    <layout class="QVBoxLayout" name="verticalLayout_2">
+    <property name="spacing">
+     <number>6</number>
+    </property>
     <item>
      <widget class="QPushButton" name="closeBut">
+      <property name="enabled">
+       <bool>true</bool>
+      </property>
       <property name="sizePolicy">
-       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-        <horstretch>99</horstretch>
-        <verstretch>70</verstretch>
+       <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+        <horstretch>136</horstretch>
+        <verstretch>48</verstretch>
        </sizepolicy>
       </property>
+      <property name="styleSheet">
+       <string notr="true">background-color: rgb(123,121,255);
+color: white</string>
+      </property>
       <property name="text">
        <string>Close</string>
       </property>
@@ -174,11 +221,15 @@
     <item>
      <widget class="QPushButton" name="retryBut">
       <property name="sizePolicy">
-       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-        <horstretch>99</horstretch>
-        <verstretch>70</verstretch>
+       <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
+        <horstretch>136</horstretch>
+        <verstretch>48</verstretch>
        </sizepolicy>
       </property>
+      <property name="styleSheet">
+       <string notr="true">background-color: rgb(123,121,255);
+color: white</string>
+      </property>
       <property name="text">
        <string>Retry</string>
       </property>

+ 81 - 9
View/die-bonder-ui/Src/Sql/SqlOperation.cpp

@@ -20,6 +20,7 @@
 #include "../common/JMessageTip.h"
 #include "CManageDB.h"
 
+
 SqlOperation::SqlOperation()
 {
     m_pCViewInterface = ns_module::CViewInterface::GetInstance();
@@ -32,10 +33,10 @@ SqlOperation::SqlOperation()
     RegeditFun();
 }
 
-SqlOperation& SqlOperation::GetInstance()
+SqlOperation* SqlOperation::GetInstance()
 {
     static SqlOperation instance;
-    return instance;
+    return &instance;
 }
 
 void SqlOperation::RegeditFun()
@@ -569,7 +570,8 @@ int SqlOperation::GetThirdDirControlData(QString multiTableName, const int& user
                         {
                             allChangeFlag = false;
                         }
-                    } else
+                    } 
+                    else
                     {
                         for (int& groupId : vecGroup)
                         {
@@ -594,6 +596,33 @@ int SqlOperation::GetThirdDirControlData(QString multiTableName, const int& user
     return 0;
 }
 
+int SqlOperation::GetThirdDirControlDataToUpdataUi(QString multiTableName, const int& userPrivilege, QList<ST_TABLE_CONTROL_DATA>& data, bool& allChangeFalg)
+{
+    vector<int> vecCalibGroupId;
+    vector<CONFIG_BASE_STRUCT> vecCalibConfig;
+    if (m_pCViewInterface == nullptr)
+    {
+        ErrorInfo(QObject::tr("SqlOperation:Initialization failed, please check", "初始化失败,请检查"));
+        return -1;
+    }
+
+    int rtn = m_pCViewInterface->LoadConfigDB(multiTableName.toStdString(), vecCalibGroupId, vecCalibConfig);
+    if (rtn != OK)
+    {
+        JLogAllOutput::cmd_debug("读取底层表格数据出错");
+        return -1;
+    }
+
+    ST_TABLE_CONTROL_DATA stData = {};
+    stData.tableName = multiTableName;
+    for (auto a: vecCalibConfig)
+    {
+        stData.controlDataList.append(a);
+    }
+
+    data.push_back(stData);
+}
+
 int SqlOperation::updateControlData(QString tableName, QString name, const QString& currentValue)
 {
     if (m_pCViewInterface == nullptr)
@@ -622,9 +651,16 @@ int SqlOperation::updateControlData(QString tableName, QString name, const QStri
 
 int SqlOperation::GetThirdDirButtons(QString multiTableName, const int& userPrivilege, QList<CONFIG_BASE_STRUCT>& buttons)
 {
-    QStringList tableNames = multiTableName.split(",");
+    QStringList tableNames = multiTableName.split(";");
     for (const QString& name : tableNames)
     {
+        QStringList nameAndGroups = name.split(",");
+        vector<int> vecGroup;
+        for (int i = 1; i < nameAndGroups.size(); i++)
+        {
+            vecGroup.push_back(nameAndGroups[i].toInt());
+        }
+
         for (ST_TABLE_CONTROL_DATA& tableData : m_allControlData)
         {
             //寻找表格对应的所有控件
@@ -633,14 +669,50 @@ int SqlOperation::GetThirdDirButtons(QString multiTableName, const int& userPriv
                 //寻找用户等级对应的控件
                 for (CONFIG_BASE_STRUCT& value : tableData.controlDataList)
                 {
-                    if (value.iUserGrade == userPrivilege)
+                    if (vecGroup.size() == 0)
                     {
-                        buttons.append(value);
+                        if (value.iUserGrade == userPrivilege && value.strType == "Button")
+                        {
+                            buttons.append(value);
+                        }
+                    } else
+                    {
+                        for (int& groupId : vecGroup)
+                        {
+                            //if (value.iUserGrade == userPrivilege)
+                            if (value.iUserGrade == userPrivilege && value.strType == "Button")
+                            {
+                                buttons.append(value);
+                            }
+                        }
                     }
                 }
             }
         }
+
     }
+
+
+
+    //QStringList tableNames = multiTableName.split(",");
+    //for (const QString& name : tableNames)
+    //{
+    //    for (ST_TABLE_CONTROL_DATA& tableData : m_allControlData)
+    //    {
+    //        //寻找表格对应的所有控件
+    //        if (tableData.tableName == name)
+    //        {
+    //            //寻找用户等级对应的控件
+    //            for (CONFIG_BASE_STRUCT& value : tableData.controlDataList)
+    //            {
+    //                if (value.iUserGrade == userPrivilege)
+    //                {
+    //                    buttons.append(value);
+    //                }
+    //            }
+    //        }
+    //    }
+    //}
     return 0;
 }
 
@@ -717,13 +789,13 @@ int SqlOperation::LoadControlDataFromModule(std::string tableName, ST_TABLE_CONT
 
 void SqlOperation::DataChange(string strDbName, string strTableName)
 {
-
+    emit UpDbTreeViewManager3DataSig(strDbName.c_str(), strTableName.c_str());
 }
 
 BUTTON_TYPE SqlOperation::StartMessageWnd(MESSAGE_INFO stMsgInfo)
 {
     // 所有动作执行完毕,开始运动
-
+    //emit AllAxisOperationsCompleted(stMsgInfo);
 
     return BUTTON_TYPE::CLOSE_BUTTON;
 }
@@ -731,5 +803,5 @@ BUTTON_TYPE SqlOperation::StartMessageWnd(MESSAGE_INFO stMsgInfo)
 
 void SqlOperation::RunButDone(ns_module::ST_BUTTON_DONE butDone)
 {
-    JMessageTip::CreateCustomMessageDlg(butDone);
+    emit SendRunButDoneSig(butDone);
 }

+ 19 - 2
View/die-bonder-ui/Src/Sql/SqlOperation.h

@@ -57,13 +57,14 @@ struct ST_APP_CONFIG
 };
 
 
-class SqlOperation
+class SqlOperation :public QObject
 {
+    Q_OBJECT
 public:
     SqlOperation();
 
     // 获取单例实例
-    static SqlOperation& GetInstance();
+    static SqlOperation* GetInstance();
 
 public:
 
@@ -102,6 +103,7 @@ public:
 
     //根据多个表格名字获取三级目录下的控件信息,包括按钮
     int GetThirdDirControlData(QString multiTableName, const int& userPrivilege, QList<ST_TABLE_CONTROL_DATA>& data,bool& allChangeFalg);
+    int GetThirdDirControlDataToUpdataUi(QString multiTableName, const int& userPrivilege, QList<ST_TABLE_CONTROL_DATA>& data,bool& allChangeFalg);
 
     //根据多个表格名字获取三级目录下的按钮, 仅仅获取按钮
     int GetThirdDirButtons(QString multiTableName, const int& userPrivilege, QList<CONFIG_BASE_STRUCT>& buttons);
@@ -133,6 +135,21 @@ private:
    static BUTTON_TYPE StartMessageWnd(MESSAGE_INFO stMsgInfo);
 
    void   RunButDone(ns_module::ST_BUTTON_DONE butDone);
+
+signals:
+    /**更新表名称
+     */
+    void UpDbTreeViewManager3DataSig(QString strDbName, QString strTableName);
+
+    /**消息弹框
+     */
+    int  SendRunButDoneSig(ns_module::ST_BUTTON_DONE butDone);
+
+    /**耗时操作完成(轴运动完毕,所有操作)
+     */
+    void AllAxisOperationsCompleted(MESSAGE_INFO stMsgInfo);
+
+
 private:
 
     ns_module::CViewInterface* m_pCViewInterface;

+ 55 - 16
View/die-bonder-ui/Src/WaferProgramPage.cpp

@@ -106,6 +106,24 @@ XY_DOUBLE_STRUCT WaferProgramPage::WaferGetAxisPosition(std::string ModuleType,
     return pos;
 }
 
+XY_DOUBLE_STRUCT WaferProgramPage::WaferMoveToXYAxisPosition(std::string ModuleType, XY_DOUBLE_STRUCT& pos)
+{
+    if (m_pProgramCViewInterface == nullptr)
+    {
+        XY_DOUBLE_STRUCT errorPt = pos;  // 可以根据需要返回一个错误状态
+
+        // 弹出消息框显示位置
+        QString positionString = QString("Unable to retrieve axis position for module type: %1").arg(QString::fromStdString(ModuleType));
+        QMessageBox::information(this, "Axis Position Error", positionString);
+        return errorPt;
+    }
+
+    m_pProgramCViewInterface->GetViewMotion()->ModuleMoveTo(ModuleType, "X", pos.x);
+    m_pProgramCViewInterface->GetViewMotion()->ModuleMoveTo(ModuleType, "Y", pos.y);
+
+    return pos;
+}
+
 void WaferProgramPage::AddMatrixPage(int vectorIndex, _PROGRAM_WAFER_MATRIX_STRUCT matrixData) {
     int matrixNum = m_vecWaferMatrix.size();
     int newMatrixID = ++matrixNum;
@@ -132,8 +150,8 @@ void WaferProgramPage::AddMatrixPage(int vectorIndex, _PROGRAM_WAFER_MATRIX_STRU
     QPushButton* pushButtonDelete = new QPushButton(this);
     pushButtonDelete->setObjectName(QString::fromUtf8("buttonDelete"));
     pushButtonDelete->setText(tr("Delete"));
-    pushButtonDelete->setFixedWidth(62);
-    subGridLayout->addWidget(pushButtonDelete, 0, 3, 1, 1);  // 添加到标题右侧的第四列
+    //pushButtonDelete->setFixedWidth(30);
+    subGridLayout->addWidget(pushButtonDelete, 0, 3, 1, 2);  // 添加到标题右侧的第四列
     vecControls.push_back(pushButtonDelete);
 
     // 删除按钮点击事件
@@ -190,24 +208,24 @@ void WaferProgramPage::AddMatrixPage(int vectorIndex, _PROGRAM_WAFER_MATRIX_STRU
     subGridLayout->addWidget(labelLeftTop, 4, 0, 1, 1);
     vecControls.push_back(labelLeftTop);
 
-    // Set all DoubleSpinBox width to 100
+    // Set all DoubleSpinBox width to 95
     DoubleSpinBox* doubleSpinBoxLeftTopX = new DoubleSpinBox(this);
     doubleSpinBoxLeftTopX->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopX"));
     doubleSpinBoxLeftTopX->setValue(matrixData.LeftTopPoint.x);
-    doubleSpinBoxLeftTopX->setFixedWidth(100);  // Set fixed width to 100
+    doubleSpinBoxLeftTopX->setFixedWidth(95);  // Set fixed width to 95
     subGridLayout->addWidget(doubleSpinBoxLeftTopX, 4, 1, 1, 1);
     vecControls.push_back(doubleSpinBoxLeftTopX);
 
     DoubleSpinBox* doubleSpinBoxLeftTopY = new DoubleSpinBox(this);
     doubleSpinBoxLeftTopY->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopY"));
     doubleSpinBoxLeftTopY->setValue(matrixData.LeftTopPoint.y);
-    doubleSpinBoxLeftTopY->setFixedWidth(100);  // Set fixed width to 100
+    doubleSpinBoxLeftTopY->setFixedWidth(95);  // Set fixed width to 95
     subGridLayout->addWidget(doubleSpinBoxLeftTopY, 4, 2, 1, 1);
     vecControls.push_back(doubleSpinBoxLeftTopY);
 
     // Adding button to get LeftTop position
-    QPushButton* buttonLeftTop = new QPushButton("Get Pos", this);
-    buttonLeftTop->setFixedWidth(62);
+    QPushButton* buttonLeftTop = new QPushButton("GP", this);
+    buttonLeftTop->setFixedWidth(30);
     subGridLayout->addWidget(buttonLeftTop, 4, 3, 1, 1);  // Position the button next to LeftTopPos
     /*connect(buttonLeftTop, &QPushButton::clicked, this, [=]() {
         QString position = QString("X: %1, Y: %2").arg(doubleSpinBoxLeftTopX->value()).arg(doubleSpinBoxLeftTopY->value());
@@ -222,6 +240,13 @@ void WaferProgramPage::AddMatrixPage(int vectorIndex, _PROGRAM_WAFER_MATRIX_STRU
         doubleSpinBoxLeftTopY->setValue(position.y);  // 更新 Y 轴
         });
 
+    QPushButton* buttonMoveToLeftTop = new QPushButton("MT", this);
+    buttonMoveToLeftTop->setFixedWidth(30);
+    subGridLayout->addWidget(buttonMoveToLeftTop, 4, 4, 1, 1);
+    connect(buttonMoveToLeftTop, &QPushButton::clicked, this, [=]() {
+        XY_DOUBLE_STRUCT position = WaferGetAxisPosition("WaferTable", m_vecWaferMatrix[vectorIndex].LeftTopPoint);
+        });
+
     QLabel* labelRightTopPos = new QLabel(this);
     labelRightTopPos->setObjectName(QString::fromUtf8("labelRightTopPos"));
     labelRightTopPos->setText(tr("Right Top Pos "));
@@ -231,20 +256,20 @@ void WaferProgramPage::AddMatrixPage(int vectorIndex, _PROGRAM_WAFER_MATRIX_STRU
     DoubleSpinBox* doubleSpinBoxRightTopX = new DoubleSpinBox(this);
     doubleSpinBoxRightTopX->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopX"));
     doubleSpinBoxRightTopX->setValue(matrixData.RightTopPoint.x);
-    doubleSpinBoxRightTopX->setFixedWidth(100);  // Set fixed width to 100
+    doubleSpinBoxRightTopX->setFixedWidth(95);  // Set fixed width to 95
     subGridLayout->addWidget(doubleSpinBoxRightTopX, 5, 1, 1, 1);
     vecControls.push_back(doubleSpinBoxRightTopX);
 
     DoubleSpinBox* doubleSpinBoxRightTopY = new DoubleSpinBox(this);
     doubleSpinBoxRightTopY->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopY"));
     doubleSpinBoxRightTopY->setValue(matrixData.RightTopPoint.y);
-    doubleSpinBoxRightTopY->setFixedWidth(100);  // Set fixed width to 100
+    doubleSpinBoxRightTopY->setFixedWidth(95);  // Set fixed width to 95
     subGridLayout->addWidget(doubleSpinBoxRightTopY, 5, 2, 1, 1);
     vecControls.push_back(doubleSpinBoxRightTopY);
 
     // Adding button to get RightTop position
-    QPushButton* buttonRightTop = new QPushButton("Get Pos", this);
-    buttonRightTop->setFixedWidth(62);
+    QPushButton* buttonRightTop = new QPushButton("GP", this);
+    buttonRightTop->setFixedWidth(30);
     subGridLayout->addWidget(buttonRightTop, 5, 3, 1, 1);  // Position the button next to RightTopPos
 
     connect(buttonRightTop, &QPushButton::clicked, this, [=]() {
@@ -256,6 +281,13 @@ void WaferProgramPage::AddMatrixPage(int vectorIndex, _PROGRAM_WAFER_MATRIX_STRU
         doubleSpinBoxRightTopY->setValue(position.y);  // 更新 Y 轴
         });
 
+    QPushButton* buttonMoveToRightTop = new QPushButton("MT", this);
+    buttonMoveToRightTop->setFixedWidth(30);
+    subGridLayout->addWidget(buttonMoveToRightTop, 5, 4, 1, 1);
+    connect(buttonMoveToRightTop, &QPushButton::clicked, this, [=]() {
+        XY_DOUBLE_STRUCT position = WaferGetAxisPosition("WaferTable", m_vecWaferMatrix[vectorIndex].RightTopPoint);
+        });
+
     QLabel* labelRightButtomPos = new QLabel(this);
     labelRightButtomPos->setObjectName(QString::fromUtf8("labelRightButtomPos"));
     labelRightButtomPos->setText(tr("Right Buttom pos"));
@@ -265,20 +297,20 @@ void WaferProgramPage::AddMatrixPage(int vectorIndex, _PROGRAM_WAFER_MATRIX_STRU
     DoubleSpinBox* doubleSpinBoxRightButtomX = new DoubleSpinBox(this);
     doubleSpinBoxRightButtomX->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomX"));
     doubleSpinBoxRightButtomX->setValue(matrixData.RightBottomPoint.x);
-    doubleSpinBoxRightButtomX->setFixedWidth(100);  // Set fixed width to 100
+    doubleSpinBoxRightButtomX->setFixedWidth(95);  // Set fixed width to 95
     subGridLayout->addWidget(doubleSpinBoxRightButtomX, 6, 1, 1, 1);
     vecControls.push_back(doubleSpinBoxRightButtomX);
 
     DoubleSpinBox* doubleSpinBoxRightButtomY = new DoubleSpinBox(this);
     doubleSpinBoxRightButtomY->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomY"));
     doubleSpinBoxRightButtomY->setValue(matrixData.RightBottomPoint.y);
-    doubleSpinBoxRightButtomY->setFixedWidth(100);  // Set fixed width to 100
+    doubleSpinBoxRightButtomY->setFixedWidth(95);  // Set fixed width to 95
     subGridLayout->addWidget(doubleSpinBoxRightButtomY, 6, 2, 1, 1);
     vecControls.push_back(doubleSpinBoxRightButtomY);
 
     // Adding button to get RightBottom position
-    QPushButton* buttonRightButtom = new QPushButton("Get Pos", this);
-    buttonRightButtom->setFixedWidth(62);
+    QPushButton* buttonRightButtom = new QPushButton("GP", this);
+    buttonRightButtom->setFixedWidth(30);
     subGridLayout->addWidget(buttonRightButtom, 6, 3, 1, 1);  // Position the button next to RightBottomPos
 
     connect(buttonRightButtom, &QPushButton::clicked, this, [=]() {
@@ -290,6 +322,13 @@ void WaferProgramPage::AddMatrixPage(int vectorIndex, _PROGRAM_WAFER_MATRIX_STRU
         doubleSpinBoxRightButtomY->setValue(position.y);  // 更新 Y 轴
         });
 
+    QPushButton* buttonMoveToRightButtom = new QPushButton("MT", this);
+    buttonMoveToRightButtom->setFixedWidth(30);
+    subGridLayout->addWidget(buttonMoveToRightButtom, 6, 4, 1, 1);
+    connect(buttonMoveToRightButtom, &QPushButton::clicked, this, [=]() {
+        XY_DOUBLE_STRUCT position = WaferGetAxisPosition("WaferTable", m_vecWaferMatrix[vectorIndex].RightBottomPoint);
+        });
+
     QLabel* labelNoBondPts = new QLabel(this);
     labelNoBondPts->setObjectName(QString::fromUtf8("labelNoBondPts"));
     labelNoBondPts->setText(tr("No Bond Points"));
@@ -302,7 +341,7 @@ void WaferProgramPage::AddMatrixPage(int vectorIndex, _PROGRAM_WAFER_MATRIX_STRU
     lineEditNoBondPts->setCursor(Qt::PointingHandCursor);
     lineEditNoBondPts->setProperty("vectorIndex", vectorIndex);  // Store the index
     lineEditNoBondPts->installEventFilter(this);
-    subGridLayout->addWidget(lineEditNoBondPts, 7, 1, 1, 3);
+    subGridLayout->addWidget(lineEditNoBondPts, 7, 1, 1, 4);
     vecControls.push_back(lineEditNoBondPts);
 
     outMatrixGridLayout->addLayout(subGridLayout, 0, 0);

+ 1 - 0
View/die-bonder-ui/Src/WaferProgramPage.h

@@ -57,6 +57,7 @@ private:
     void initPage();
     bool eventFilter(QObject* obj, QEvent* event);
     XY_DOUBLE_STRUCT WaferGetAxisPosition(std::string ModuleType, XY_DOUBLE_STRUCT& pos);
+    XY_DOUBLE_STRUCT WaferMoveToXYAxisPosition(std::string ModuleType, XY_DOUBLE_STRUCT& pos);
 
 private slots:
     void onNoBondPtsClickedWafer(QLineEdit* lineEdit, int index);

+ 105 - 31
View/die-bonder-ui/Src/WaffleProgramPage.cpp

@@ -115,6 +115,30 @@ XY_DOUBLE_STRUCT WaffleProgramPage::WaffleGetAxisPosition(std::string ModuleType
 	m_pProgramCViewInterface->GetViewMotion()->GetAxisPosition(ModuleType, "X", pos.x);
 	m_pProgramCViewInterface->GetViewMotion()->GetAxisPosition(ModuleType, "Y", pos.y);
 
+	m_pProgramCViewInterface->GetViewMotion()->ModuleMoveTo(ModuleType, "X", pos.x);
+	m_pProgramCViewInterface->GetViewMotion()->ModuleMoveTo(ModuleType, "Y", pos.y);
+
+	return pos;
+}
+
+
+XY_DOUBLE_STRUCT WaffleProgramPage::WaffleMoveToXYAxisPosition(std::string ModuleType, XY_DOUBLE_STRUCT& pos)
+{
+	if (m_pProgramCViewInterface == nullptr)
+	{
+		XY_DOUBLE_STRUCT errorPt = pos;  // 可以根据需要返回一个错误状态
+
+		// 弹出消息框显示位置
+		QString positionString = QString("Unable to retrieve axis position for module type: %1").arg(QString::fromStdString(ModuleType));
+		QMessageBox::information(this, "Axis Position Error", positionString);
+
+
+		return errorPt;
+	}
+
+	m_pProgramCViewInterface->GetViewMotion()->ModuleMoveTo(ModuleType, "X", pos.x);
+	m_pProgramCViewInterface->GetViewMotion()->ModuleMoveTo(ModuleType, "Y", pos.y);
+
 	return pos;
 }
 
@@ -166,7 +190,7 @@ void WaffleProgramPage::AddMatrixPage(int vectorIndex, PROGRAM_WAFFLE_MATRIX_STR
 	QPushButton* pushButtonAdd = new QPushButton(outWidget);
 	pushButtonAdd->setObjectName(QString::fromUtf8("button Add"));
 	pushButtonAdd->setText(tr("Add sub Matrix"));
-	matrixGridLayout->addWidget(pushButtonAdd, 0, 2, 1, 2);
+	matrixGridLayout->addWidget(pushButtonAdd, 0, 2, 1, 3);
 	pushButtonAdd->setProperty("type", "default");
 
 	connect(pushButtonAdd, &QPushButton::clicked, this, [=]() {
@@ -252,7 +276,7 @@ void WaffleProgramPage::AddMatrixPage(int vectorIndex, PROGRAM_WAFFLE_MATRIX_STR
 
 	SpinBox* spinBoxRow = new SpinBox(outWidget);
 	spinBoxRow->setObjectName(QString::fromUtf8("spinBoxRow"));
-	spinBoxRow->setFixedWidth(100);  // Set fixed width to 100
+	spinBoxRow->setFixedWidth(95);  // Set fixed width to 95
 	matrixGridLayout->addWidget(spinBoxRow, 2, 1, 1, 1);
 	vecControls.push_back(spinBoxRow);
 
@@ -264,7 +288,7 @@ void WaffleProgramPage::AddMatrixPage(int vectorIndex, PROGRAM_WAFFLE_MATRIX_STR
 
 	SpinBox* spinBoxCol = new SpinBox(outWidget);
 	spinBoxCol->setObjectName(QString::fromUtf8("spinBoxCol"));
-	spinBoxCol->setFixedWidth(100);  // Set fixed width to 100
+	spinBoxCol->setFixedWidth(95);  // Set fixed width to 95
 	matrixGridLayout->addWidget(spinBoxCol, 2, 2, 1, 1);
 	vecControls.push_back(spinBoxCol);
 
@@ -276,24 +300,34 @@ void WaffleProgramPage::AddMatrixPage(int vectorIndex, PROGRAM_WAFFLE_MATRIX_STR
 
 	DoubleSpinBox* doubleSpinBoxLeftTopX = new DoubleSpinBox(outWidget);
 	doubleSpinBoxLeftTopX->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopX"));
-	doubleSpinBoxLeftTopX->setFixedWidth(100);  // Set fixed width to 100
+	doubleSpinBoxLeftTopX->setFixedWidth(95);  // Set fixed width to 95
 	matrixGridLayout->addWidget(doubleSpinBoxLeftTopX, 4, 1, 1, 1);
 	vecControls.push_back(doubleSpinBoxLeftTopX);
 
 	DoubleSpinBox* doubleSpinBoxLeftTopY = new DoubleSpinBox(outWidget);
 	doubleSpinBoxLeftTopY->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopY"));
-	doubleSpinBoxLeftTopY->setFixedWidth(100);  // Set fixed width to 100
+	doubleSpinBoxLeftTopY->setFixedWidth(95);  // Set fixed width to 95
 	matrixGridLayout->addWidget(doubleSpinBoxLeftTopY, 4, 2, 1, 1);
 	vecControls.push_back(doubleSpinBoxLeftTopY);
 
-	QPushButton* buttonLeftTop = new QPushButton("Get Pos", this);
-	buttonLeftTop->setFixedWidth(62);  // Set the same width for the button
+	QPushButton* buttonLeftTop = new QPushButton("GP", this);
+	buttonLeftTop->setFixedWidth(30);  // Set the same width for the button
 	matrixGridLayout->addWidget(buttonLeftTop, 4, 3, 1, 1);  // Position the button next to LeftTopPos
 	connect(buttonLeftTop, &QPushButton::clicked, this, [=]() {
 		XY_DOUBLE_STRUCT position = WaffleGetAxisPosition("WaffleHead", m_vecWaffleMatrix[vectorIndex].LeftTopPoint);
 		doubleSpinBoxLeftTopX->setValue(position.x);  // Update X axis
 		doubleSpinBoxLeftTopY->setValue(position.y);  // Update Y axis
 		});
+	//MoveTo
+	QPushButton* buttonMoveToLeftTop = new QPushButton("MT", this);
+	buttonMoveToLeftTop->setFixedWidth(30);  // Set the same width for the button
+	matrixGridLayout->addWidget(buttonMoveToLeftTop, 4, 4, 1, 1);  // Position the button next to LeftTopPos
+	connect(buttonMoveToLeftTop, &QPushButton::clicked, this, [=]() {
+		XY_DOUBLE_STRUCT position = WaffleMoveToXYAxisPosition("WaffleHead", m_vecWaffleMatrix[vectorIndex].LeftTopPoint);
+		//doubleSpinBoxLeftTopX->setValue(position.x);  // Update X axis
+		//doubleSpinBoxLeftTopY->setValue(position.y);  // Update Y axis
+		});
+
 
 	QLabel* labelRightTopPos = new QLabel(outWidget);
 	labelRightTopPos->setObjectName(QString::fromUtf8("labelRightTopPos"));
@@ -303,18 +337,18 @@ void WaffleProgramPage::AddMatrixPage(int vectorIndex, PROGRAM_WAFFLE_MATRIX_STR
 
 	DoubleSpinBox* doubleSpinBoxRightTopX = new DoubleSpinBox(outWidget);
 	doubleSpinBoxRightTopX->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopX"));
-	doubleSpinBoxRightTopX->setFixedWidth(100);  // Set fixed width to 100
+	doubleSpinBoxRightTopX->setFixedWidth(95);  // Set fixed width to 95
 	matrixGridLayout->addWidget(doubleSpinBoxRightTopX, 5, 1, 1, 1);
 	vecControls.push_back(doubleSpinBoxRightTopX);
 
 	DoubleSpinBox* doubleSpinBoxRightTopY = new DoubleSpinBox(outWidget);
 	doubleSpinBoxRightTopY->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopY"));
-	doubleSpinBoxRightTopY->setFixedWidth(100);  // Set fixed width to 100
+	doubleSpinBoxRightTopY->setFixedWidth(95);  // Set fixed width to 95
 	matrixGridLayout->addWidget(doubleSpinBoxRightTopY, 5, 2, 1, 1);
 	vecControls.push_back(doubleSpinBoxRightTopY);
 
-	QPushButton* buttonRightTop = new QPushButton("Get Pos", this);
-	buttonRightTop->setFixedWidth(62);  // Set the same width for the button
+	QPushButton* buttonRightTop = new QPushButton("GP", this);
+	buttonRightTop->setFixedWidth(30);  // Set the same width for the button
 	matrixGridLayout->addWidget(buttonRightTop, 5, 3, 1, 1);  // Position the button next to RightTopPos
 	connect(buttonRightTop, &QPushButton::clicked, this, [=]() {
 		XY_DOUBLE_STRUCT position = WaffleGetAxisPosition("WaffleHead", m_vecWaffleMatrix[vectorIndex].RightTopPoint);
@@ -322,6 +356,14 @@ void WaffleProgramPage::AddMatrixPage(int vectorIndex, PROGRAM_WAFFLE_MATRIX_STR
 		doubleSpinBoxRightTopY->setValue(position.y);  // Update Y axis
 		});
 
+	//MoveTo
+	QPushButton* buttonMoveRightTop = new QPushButton("MT", this);
+	buttonMoveRightTop->setFixedWidth(30);  // Set the same width for the button
+	matrixGridLayout->addWidget(buttonMoveRightTop, 5, 4, 1, 1);  // Position the button next to LeftTopPos
+	connect(buttonMoveRightTop, &QPushButton::clicked, this, [=]() {
+		XY_DOUBLE_STRUCT position = WaffleMoveToXYAxisPosition("WaffleHead", m_vecWaffleMatrix[vectorIndex].RightTopPoint);
+		});
+
 	QLabel* labelRightButtomPos = new QLabel(outWidget);
 	labelRightButtomPos->setObjectName(QString::fromUtf8("labelRightButtomPos"));
 	labelRightButtomPos->setText(tr("Right Buttom pos"));
@@ -330,18 +372,18 @@ void WaffleProgramPage::AddMatrixPage(int vectorIndex, PROGRAM_WAFFLE_MATRIX_STR
 
 	DoubleSpinBox* doubleSpinBoxRightButtomX = new DoubleSpinBox(outWidget);
 	doubleSpinBoxRightButtomX->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomX"));
-	doubleSpinBoxRightButtomX->setFixedWidth(100);  // Set fixed width to 100
+	doubleSpinBoxRightButtomX->setFixedWidth(95);  // Set fixed width to 95
 	matrixGridLayout->addWidget(doubleSpinBoxRightButtomX, 6, 1, 1, 1);
 	vecControls.push_back(doubleSpinBoxRightButtomX);
 
 	DoubleSpinBox* doubleSpinBoxRightButtomY = new DoubleSpinBox(outWidget);
 	doubleSpinBoxRightButtomY->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomY"));
-	doubleSpinBoxRightButtomY->setFixedWidth(100);  // Set fixed width to 100
+	doubleSpinBoxRightButtomY->setFixedWidth(95);  // Set fixed width to 95
 	matrixGridLayout->addWidget(doubleSpinBoxRightButtomY, 6, 2, 1, 1);
 	vecControls.push_back(doubleSpinBoxRightTopX);
 
-	QPushButton* buttonRightButtom = new QPushButton("Get Pos", this);
-	buttonRightButtom->setFixedWidth(62);  // Set the same width for the button
+	QPushButton* buttonRightButtom = new QPushButton("GP", this);
+	buttonRightButtom->setFixedWidth(30);  // Set the same width for the button
 	matrixGridLayout->addWidget(buttonRightButtom, 6, 3, 1, 1);  // Position the button next to RightBottomPos
 	connect(buttonRightButtom, &QPushButton::clicked, this, [=]() {
 		XY_DOUBLE_STRUCT position = WaffleGetAxisPosition("WaffleHead", m_vecWaffleMatrix[vectorIndex].RightBottomPoint);
@@ -349,6 +391,14 @@ void WaffleProgramPage::AddMatrixPage(int vectorIndex, PROGRAM_WAFFLE_MATRIX_STR
 		doubleSpinBoxRightButtomY->setValue(position.y);  // Update Y axis
 		});
 
+	//MoveTo
+	QPushButton* buttonMoveRightButtom = new QPushButton("MT", this);
+	buttonMoveRightButtom->setFixedWidth(30);  // Set the same width for the button
+	matrixGridLayout->addWidget(buttonMoveRightButtom, 6, 4, 1, 1);  // Position the button next to LeftTopPos
+	connect(buttonMoveRightButtom, &QPushButton::clicked, this, [=]() {
+		XY_DOUBLE_STRUCT position = WaffleMoveToXYAxisPosition("WaffleHead", m_vecWaffleMatrix[vectorIndex].RightBottomPoint);
+		});
+
 	QLabel* labelNoBondPts = new QLabel(outWidget);
 	labelNoBondPts->setObjectName(QString::fromUtf8("labelNoBondPts"));
 	labelNoBondPts->setText(tr("No Bond Points"));
@@ -357,7 +407,7 @@ void WaffleProgramPage::AddMatrixPage(int vectorIndex, PROGRAM_WAFFLE_MATRIX_STR
 
 	QLineEdit* lineEditNoBondPts = new QLineEdit(outWidget);
 	lineEditNoBondPts->setObjectName(QString::fromUtf8("lineEditNoBondPts"));
-	matrixGridLayout->addWidget(lineEditNoBondPts, 7, 1, 1, 3);
+	matrixGridLayout->addWidget(lineEditNoBondPts, 7, 1, 1, 4);
 	vecControls.push_back(lineEditNoBondPts);
 
 	lineEditNoBondPts->setReadOnly(true);
@@ -485,7 +535,7 @@ void WaffleProgramPage::AddSubMatrixPage(int vectorIndex, int subVectorIndex, PR
 	QPushButton* pushButtonDelete = new QPushButton(subWidget);
 	pushButtonDelete->setObjectName(QString::fromUtf8("button delete"));
 	pushButtonDelete->setText(tr("Delete"));
-	subGridLayout->addWidget(pushButtonDelete, 0, 3, 1, 1);
+	subGridLayout->addWidget(pushButtonDelete, 0, 3, 1, 2);
 
 	connect(pushButtonDelete, &QPushButton::clicked, this, [=]() {
 
@@ -554,15 +604,15 @@ void WaffleProgramPage::AddSubMatrixPage(int vectorIndex, int subVectorIndex, PR
 
 	DoubleSpinBox* doubleSpinBoxLeftTopX = new DoubleSpinBox(subWidget);
 	doubleSpinBoxLeftTopX->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopX"));
-	doubleSpinBoxLeftTopX->setFixedWidth(100);  // Set fixed width to 100
-	doubleSpinBoxLeftTopX->setFixedWidth(100);  // Set fixed width to 100
+	doubleSpinBoxLeftTopX->setFixedWidth(95);  // Set fixed width to 95
+	doubleSpinBoxLeftTopX->setFixedWidth(95);  // Set fixed width to 95
 	subGridLayout->addWidget(doubleSpinBoxLeftTopX, 4, 1, 1, 1);
 	vecControls.push_back(doubleSpinBoxLeftTopX);
 
 	DoubleSpinBox* doubleSpinBoxLeftTopY = new DoubleSpinBox(subWidget);
 	doubleSpinBoxLeftTopY->setObjectName(QString::fromUtf8("doubleSpinBoxLeftTopY"));
-	doubleSpinBoxLeftTopY->setFixedWidth(100);  // Set fixed width to 100
-	doubleSpinBoxLeftTopY->setFixedWidth(100);  // Set fixed width to 100
+	doubleSpinBoxLeftTopY->setFixedWidth(95);  // Set fixed width to 95
+	doubleSpinBoxLeftTopY->setFixedWidth(95);  // Set fixed width to 95
 	subGridLayout->addWidget(doubleSpinBoxLeftTopY, 4, 2, 1, 1);
 	vecControls.push_back(doubleSpinBoxLeftTopY);
 
@@ -574,13 +624,13 @@ void WaffleProgramPage::AddSubMatrixPage(int vectorIndex, int subVectorIndex, PR
 
 	DoubleSpinBox* doubleSpinBoxRightTopX = new DoubleSpinBox(subWidget);
 	doubleSpinBoxRightTopX->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopX"));
-	doubleSpinBoxRightTopX->setFixedWidth(100);  // Set fixed width to 100
+	doubleSpinBoxRightTopX->setFixedWidth(95);  // Set fixed width to 95
 	subGridLayout->addWidget(doubleSpinBoxRightTopX, 5, 1, 1, 1);
 	vecControls.push_back(doubleSpinBoxRightTopX);
 
 	DoubleSpinBox* doubleSpinBoxRightTopY = new DoubleSpinBox(subWidget);
 	doubleSpinBoxRightTopY->setObjectName(QString::fromUtf8("doubleSpinBoxRightTopY"));
-	doubleSpinBoxRightTopY->setFixedWidth(100);  // Set fixed width to 100
+	doubleSpinBoxRightTopY->setFixedWidth(95);  // Set fixed width to 95
 	subGridLayout->addWidget(doubleSpinBoxRightTopY, 5, 2, 1, 1);
 	vecControls.push_back(doubleSpinBoxRightTopY);
 
@@ -592,13 +642,13 @@ void WaffleProgramPage::AddSubMatrixPage(int vectorIndex, int subVectorIndex, PR
 
 	DoubleSpinBox* doubleSpinBoxRightButtomX = new DoubleSpinBox(subWidget);
 	doubleSpinBoxRightButtomX->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomX"));
-	doubleSpinBoxRightButtomX->setFixedWidth(100);  // Set fixed width to 100
+	doubleSpinBoxRightButtomX->setFixedWidth(95);  // Set fixed width to 95
 	subGridLayout->addWidget(doubleSpinBoxRightButtomX, 6, 1, 1, 1);
 	vecControls.push_back(doubleSpinBoxRightButtomX);
 
 	DoubleSpinBox* doubleSpinBoxRightButtomY = new DoubleSpinBox(subWidget);
 	doubleSpinBoxRightButtomY->setObjectName(QString::fromUtf8("doubleSpinBoxRightButtomY"));
-	doubleSpinBoxRightButtomY->setFixedWidth(100);  // Set fixed width to 100
+	doubleSpinBoxRightButtomY->setFixedWidth(95);  // Set fixed width to 95
 	subGridLayout->addWidget(doubleSpinBoxRightButtomY, 6, 2, 1, 1);
 	vecControls.push_back(doubleSpinBoxRightTopX);
 
@@ -623,8 +673,8 @@ void WaffleProgramPage::AddSubMatrixPage(int vectorIndex, int subVectorIndex, PR
 	vecControls.push_back(lineEditNoBondPts);
 
 	// Left Top Position X and Y
-	QPushButton* buttonLeftTop = new QPushButton("Get Pos", subWidget);
-	buttonLeftTop->setFixedWidth(62);  // 设置固定宽度
+	QPushButton* buttonLeftTop = new QPushButton("GP", subWidget);
+	buttonLeftTop->setFixedWidth(30);  // 设置固定宽度
 	subGridLayout->addWidget(buttonLeftTop, 4, 3, 1, 1);  // 添加按钮到4行3列
 
 	connect(buttonLeftTop, &QPushButton::clicked, this, [=]() {
@@ -633,9 +683,17 @@ void WaffleProgramPage::AddSubMatrixPage(int vectorIndex, int subVectorIndex, PR
 		doubleSpinBoxLeftTopY->setValue(position.y);  // 更新 Y 轴
 		});
 
+	//MoveTo
+	QPushButton* buttonMoveLeftTop = new QPushButton("MT", subWidget);
+	buttonMoveLeftTop->setFixedWidth(30);  // Set the same width for the button
+	subGridLayout->addWidget(buttonMoveLeftTop, 4, 4, 1, 1);  // Position the button next to LeftTopPos
+	connect(buttonMoveLeftTop, &QPushButton::clicked, this, [=]() {
+		XY_DOUBLE_STRUCT position = WaffleMoveToXYAxisPosition("WaffleHead", m_vecWaffleMatrix[subVectorIndex].LeftTopPoint);
+		});
+
 	// Right Top Position X and Y
-	QPushButton* buttonRightTop = new QPushButton("Get Pos", subWidget);
-	buttonRightTop->setFixedWidth(62);  // 设置固定宽度
+	QPushButton* buttonRightTop = new QPushButton("GP", subWidget);
+	buttonRightTop->setFixedWidth(30);  // 设置固定宽度
 	subGridLayout->addWidget(buttonRightTop, 5, 3, 1, 1);  // 添加按钮到5行3列
 
 	connect(buttonRightTop, &QPushButton::clicked, this, [=]() {
@@ -644,9 +702,17 @@ void WaffleProgramPage::AddSubMatrixPage(int vectorIndex, int subVectorIndex, PR
 		doubleSpinBoxRightTopY->setValue(position.y);  // 更新 Y 轴
 		});
 
+	//MoveTo
+	QPushButton* buttonMoveRightTop = new QPushButton("MT", subWidget);
+	buttonMoveRightTop->setFixedWidth(30);  // Set the same width for the button
+	subGridLayout->addWidget(buttonMoveRightTop, 5, 4, 1, 1);  // Position the button next to LeftTopPos
+	connect(buttonMoveRightTop, &QPushButton::clicked, this, [=]() {
+		XY_DOUBLE_STRUCT position = WaffleMoveToXYAxisPosition("WaffleHead", m_vecWaffleMatrix[subVectorIndex].RightTopPoint);
+		});
+
 	// Right Bottom Position X and Y
-	QPushButton* buttonRightButtom = new QPushButton("Get Pos", subWidget);
-	buttonRightButtom->setFixedWidth(62);  // 设置固定宽度
+	QPushButton* buttonRightButtom = new QPushButton("GP", subWidget);
+	buttonRightButtom->setFixedWidth(30);  // 设置固定宽度
 	subGridLayout->addWidget(buttonRightButtom, 6, 3, 1, 1);  // 添加按钮到6行3列
 
 	connect(buttonRightButtom, &QPushButton::clicked, this, [=]() {
@@ -655,6 +721,14 @@ void WaffleProgramPage::AddSubMatrixPage(int vectorIndex, int subVectorIndex, PR
 		doubleSpinBoxRightButtomY->setValue(position.y);  // 更新 Y 轴
 		});
 
+	//MoveTo
+	QPushButton* buttonMoveRightButtom = new QPushButton("MT", subWidget);
+	buttonMoveRightButtom->setFixedWidth(30);  // Set the same width for the button
+	subGridLayout->addWidget(buttonMoveRightButtom, 6, 4, 1, 1);  // Position the button next to LeftTopPos
+	connect(buttonMoveRightButtom, &QPushButton::clicked, this, [=]() {
+		XY_DOUBLE_STRUCT position = WaffleMoveToXYAxisPosition("WaffleHead", m_vecWaffleMatrix[subVectorIndex].RightBottomPoint);
+		});
+
 	//layout->addLayout(subGridLayout, 11, 0);
 
 	QFrame* line = new QFrame(subWidget);

+ 1 - 0
View/die-bonder-ui/Src/WaffleProgramPage.h

@@ -37,6 +37,7 @@ private:
 
 
 	XY_DOUBLE_STRUCT WaffleGetAxisPosition(std::string ModuleType, XY_DOUBLE_STRUCT& pos);
+	XY_DOUBLE_STRUCT WaffleMoveToXYAxisPosition(std::string ModuleType, XY_DOUBLE_STRUCT& pos);
 
 	void initPage();
 

+ 2 - 3
View/die-bonder-ui/Src/common/JMessageTip.cpp

@@ -37,10 +37,9 @@ void JMessageTip::Message_critical(const QString& title, const QString& text, QW
 
 }
 
-void JMessageTip::CreateCustomMessageDlg(const ns_module::ST_BUTTON_DONE& butDone)
+int JMessageTip::CreateCustomMessageDlg(const ns_module::ST_BUTTON_DONE& butDone)
 {
     CustomMessageDlg dlg;
     dlg.RunMsgWnd(butDone);
-    dlg.exec();
-
+    return dlg.exec();
 }

+ 1 - 1
View/die-bonder-ui/Src/common/JMessageTip.h

@@ -42,7 +42,7 @@ public:
 
     /**先创建一个
      */
-    static void CreateCustomMessageDlg(const ns_module::ST_BUTTON_DONE& butDone);
+    static int CreateCustomMessageDlg(const ns_module::ST_BUTTON_DONE& butDone);
 };
 
 #endif  //__JMESSAGETIP_H__

Някои файлове не бяха показани, защото твърде много файлове са промени