From be5a6792464eb0722a387b0ab74722d19c9a4a17 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 09 九月 2025 09:37:16 +0800
Subject: [PATCH] 1.Glass增加对应数据库字段的接口;
---
SourceCode/Bond/Servo/CPath.h | 1
SourceCode/Bond/Servo/Servo.vcxproj | 2
SourceCode/Bond/Servo/Servo.vcxproj.filters | 2
SourceCode/Bond/Servo/CGlass.cpp | 38 ++++++++++++
SourceCode/Bond/Servo/CServoUtilsTool.h | 15 +++++
SourceCode/Bond/Servo/CGlass.h | 2
SourceCode/Bond/Servo/CPath.cpp | 6 ++
SourceCode/Bond/Servo/CServoUtilsTool.cpp | 87 +++++++++++++++++++++++++++++
8 files changed, 153 insertions(+), 0 deletions(-)
diff --git a/SourceCode/Bond/Servo/CGlass.cpp b/SourceCode/Bond/Servo/CGlass.cpp
index ac69f80..493ba8d 100644
--- a/SourceCode/Bond/Servo/CGlass.cpp
+++ b/SourceCode/Bond/Servo/CGlass.cpp
@@ -107,6 +107,25 @@
return m_pPath;
}
+ std::string CGlass::getPathDescription()
+ {
+ std::string strOut, strPath;
+ char szBuffer[256];
+
+ CPath* pTemp = m_pPath;
+ while (pTemp != nullptr) {
+ pTemp->getSimpleDescription(strPath);
+ strOut.append(strPath);
+
+ pTemp = pTemp->getNext();
+ if (pTemp != nullptr) {
+ strOut.append(" -> ");
+ }
+ }
+
+ return strOut;
+ }
+
CPath* CGlass::getPathWithEq(unsigned int nEqId, unsigned int nUnit)
{
CPath* pTemp = m_pPath;
@@ -379,4 +398,23 @@
{
return m_params;
}
+
+ std::string CGlass::getParamsDescription()
+ {
+ std::string strOut;
+
+ char szBuffer[256];
+ for (auto p : m_params) {
+ if (!strOut.empty()) strOut.append(",");
+ if (p.getValueType() == PVT_INT) {
+ sprintf_s(szBuffer, 256, "%s:%d", p.getName().c_str(), p.getIntValue());
+ }
+ else if (p.getValueType() == PVT_DOUBLE) {
+ sprintf_s(szBuffer, 256, "%s:%f", p.getName().c_str(), p.getDoubleValue());
+ }
+ strOut.append(szBuffer);
+ }
+
+ return strOut;
+ }
}
diff --git a/SourceCode/Bond/Servo/CGlass.h b/SourceCode/Bond/Servo/CGlass.h
index 01dc31f..e828b77 100644
--- a/SourceCode/Bond/Servo/CGlass.h
+++ b/SourceCode/Bond/Servo/CGlass.h
@@ -48,6 +48,8 @@
CPath* getPathWithEq(unsigned int nEqId, unsigned int nUnit);
CPath* getPath();
void addPath(unsigned int nEqId, unsigned int nUnit);
+ std::string getPathDescription();
+ std::string getParamsDescription();
void serialize(CArchive& ar);
void setJobDataS(CJobDataS* pJobDataS);
void updateJobDataS(CJobDataS* pJobDataS);
diff --git a/SourceCode/Bond/Servo/CPath.cpp b/SourceCode/Bond/Servo/CPath.cpp
index ae140c6..1731ee9 100644
--- a/SourceCode/Bond/Servo/CPath.cpp
+++ b/SourceCode/Bond/Servo/CPath.cpp
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "CPath.h"
#include "ToolUnits.h"
+#include "CServoUtilsTool.h"
namespace SERVO {
@@ -46,6 +47,11 @@
strOut = strOut + ">";
}
+ void CPath::getSimpleDescription(std::string& strOut)
+ {
+ strOut = CServoUtilsTool::getEqUnitName(m_nEqID, m_nUnit);
+ }
+
void CPath::serialize(CArchive& ar)
{
if (ar.IsStoring()) {
diff --git a/SourceCode/Bond/Servo/CPath.h b/SourceCode/Bond/Servo/CPath.h
index 832ee07..ed17d8e 100644
--- a/SourceCode/Bond/Servo/CPath.h
+++ b/SourceCode/Bond/Servo/CPath.h
@@ -12,6 +12,7 @@
public:
void getDescription(std::string& strOut);
+ void getSimpleDescription(std::string& strOut);
void serialize(CArchive& ar);
CPath* getPrev();
CPath* getNext();
diff --git a/SourceCode/Bond/Servo/CServoUtilsTool.cpp b/SourceCode/Bond/Servo/CServoUtilsTool.cpp
new file mode 100644
index 0000000..841e980
--- /dev/null
+++ b/SourceCode/Bond/Servo/CServoUtilsTool.cpp
@@ -0,0 +1,87 @@
+#include "stdafx.h"
+#include "CServoUtilsTool.h"
+#include "Common.h"
+
+
+namespace SERVO {
+ CServoUtilsTool::CServoUtilsTool()
+ {
+
+ }
+
+ CServoUtilsTool::~CServoUtilsTool()
+ {
+
+ }
+
+ std::string CServoUtilsTool::getEqUnitName(int eqid, int unit)
+ {
+ /*
+#define EQ_ID_LOADPORT1 1
+#define EQ_ID_LOADPORT2 2
+#define EQ_ID_LOADPORT3 3
+#define EQ_ID_LOADPORT4 4
+#define EQ_ID_ARM_TRAY1 5
+#define EQ_ID_ARM_TRAY2 6
+#define EQ_ID_ALIGNER 7
+#define EQ_ID_FLIPER 8
+#define EQ_ID_VACUUMBAKE 9
+#define EQ_ID_Bonder1 10
+#define EQ_ID_Bonder2 11
+#define EQ_ID_BAKE_COOLING 12
+#define EQ_ID_MEASUREMENT 13
+#define EQ_ID_EFEM 100
+#define EQ_ID_ARM 101
+#define EQ_ID_OPERATOR_REMOVE 102
+*/
+ char szBuffer[256];
+ if (eqid == EQ_ID_LOADPORT1
+ || eqid == EQ_ID_LOADPORT2
+ || eqid == EQ_ID_LOADPORT3
+ || eqid == EQ_ID_LOADPORT4
+ ) {
+ sprintf_s(szBuffer, 256, "Port%d(Slot%d)", unit, eqid - EQ_ID_LOADPORT1 + 1);
+ return std::string(szBuffer);
+ }
+
+ if (eqid == EQ_ID_ALIGNER) {
+ return "Aligner";
+ }
+
+ if (eqid == EQ_ID_FLIPER) {
+ return "Fliper";
+ }
+
+ if (eqid == EQ_ID_VACUUMBAKE) {
+ if (unit == 0) return "烘烤A腔";
+ if (unit == 1) return "烘烤B腔";
+ }
+
+ if (eqid == EQ_ID_VACUUMBAKE) {
+ if (unit == 0) return "烘烤A腔";
+ if (unit == 1) return "烘烤B腔";
+ }
+
+ if (eqid == EQ_ID_Bonder1) {
+ return "Bonder1";
+ }
+
+ if (eqid == EQ_ID_Bonder2) {
+ return "Bonder2";
+ }
+
+ if (eqid == EQ_ID_BAKE_COOLING) {
+
+ if (unit == 0) return "后烘烤A腔";
+ if (unit == 1) return "冷却A";
+ if (unit == 0) return "后烘烤B腔";
+ if (unit == 1) return "冷却B";
+ }
+
+ if (eqid == EQ_ID_MEASUREMENT) {
+ return "AOI";
+ }
+
+ return "";
+ }
+}
diff --git a/SourceCode/Bond/Servo/CServoUtilsTool.h b/SourceCode/Bond/Servo/CServoUtilsTool.h
new file mode 100644
index 0000000..9e79f63
--- /dev/null
+++ b/SourceCode/Bond/Servo/CServoUtilsTool.h
@@ -0,0 +1,15 @@
+#pragma once
+
+
+namespace SERVO {
+ class CServoUtilsTool
+ {
+ public:
+ CServoUtilsTool();
+ virtual ~CServoUtilsTool();
+
+ public:
+ static std::string getEqUnitName(int eqid, int unit);
+ };
+}
+
diff --git a/SourceCode/Bond/Servo/Servo.vcxproj b/SourceCode/Bond/Servo/Servo.vcxproj
index fb0ab28..4ebda49 100644
--- a/SourceCode/Bond/Servo/Servo.vcxproj
+++ b/SourceCode/Bond/Servo/Servo.vcxproj
@@ -232,6 +232,7 @@
<ClInclude Include="CPortStatusReport.h" />
<ClInclude Include="CRobotTaskDlg.h" />
<ClInclude Include="CSVData.h" />
+ <ClInclude Include="CServoUtilsTool.h" />
<ClInclude Include="CVariable.h" />
<ClInclude Include="DeviceRecipeParamDlg.h" />
<ClInclude Include="GlassJson.h" />
@@ -403,6 +404,7 @@
<ClCompile Include="CPortStatusReport.cpp" />
<ClCompile Include="CRobotTaskDlg.cpp" />
<ClCompile Include="CSVData.cpp" />
+ <ClCompile Include="CServoUtilsTool.cpp" />
<ClCompile Include="CVariable.cpp" />
<ClCompile Include="DeviceRecipeParamDlg.cpp" />
<ClCompile Include="GlassJson.cpp" />
diff --git a/SourceCode/Bond/Servo/Servo.vcxproj.filters b/SourceCode/Bond/Servo/Servo.vcxproj.filters
index bc72b7f..9b23ec8 100644
--- a/SourceCode/Bond/Servo/Servo.vcxproj.filters
+++ b/SourceCode/Bond/Servo/Servo.vcxproj.filters
@@ -194,6 +194,7 @@
</ClCompile>
<ClCompile Include="DeviceRecipeParamDlg.cpp" />
<ClCompile Include="CSVData.cpp" />
+ <ClCompile Include="CServoUtilsTool.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="AlarmManager.h" />
@@ -412,6 +413,7 @@
</ClInclude>
<ClInclude Include="DeviceRecipeParamDlg.h" />
<ClInclude Include="CSVData.h" />
+ <ClInclude Include="CServoUtilsTool.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Servo.rc" />
--
Gitblit v1.9.3