Procházet zdrojové kódy

Merge branch 'Release3.3' of http://36.129.169.60:30080/gogsadmin/OTS into Release3.3

zhangjiaxin před 1 měsícem
rodič
revize
2f20911745

binární
Bin/x64/Debug/Config/SysData/Cleanness_ND2.db


binární
Bin/x64/Debug/Config/SysData/SeaMineral.db


+ 1 - 1
Bin/x64/Debug/Resources/XMLData/AppResource_ZH.xml

@@ -1805,7 +1805,7 @@
 <Form>
     <Name>frmInitializeTwoPointRectangle</Name>
     <Controls>
-	  <Control name="frmInitializeTwoPointRectangle" text="两点法画矩形" />
+	  <Control name="frmInitializeTwoPointRectangle" text="取点定界法" />
 	  <Control name="groupBox1" text="左上角点" />
 	  <Control name="bn_FirstPoint" text="获取" />
 	  <Control name="groupBox2" text="右下角点" />

+ 26 - 3
OTSCPP/OTSClassifyEngine/ExpressionParseEngine/ParticleSTDDB.cpp

@@ -1,4 +1,4 @@
-#include "stdafx.h"
+#include "stdafx.h"
 #include "ParticleSTDDB.h"
 #include "ParticleSTDTable.h"
 #include "ParticleSTD.h"
@@ -7,6 +7,27 @@
 
 namespace OTSClassifyEngine
 {
+	namespace{
+		
+		std::string utf8ToGbk(const std::string& utf8Str) {
+			// 第一步:UTF-8转UTF-16
+			int wcsLen = MultiByteToWideChar(CP_UTF8, 0, utf8Str.c_str(), -1, nullptr, 0);
+			wchar_t* wcsBuf = new wchar_t[wcsLen];
+			MultiByteToWideChar(CP_UTF8, 0, utf8Str.c_str(), -1, wcsBuf, wcsLen);
+
+			// 第二步:UTF-16转GBK
+			int gbkLen = WideCharToMultiByte(CP_ACP, 0, wcsBuf, -1, nullptr, 0, nullptr, nullptr);
+			char* gbkBuf = new char[gbkLen];
+			WideCharToMultiByte(CP_ACP, 0, wcsBuf, -1, gbkBuf, gbkLen, nullptr, nullptr);
+
+			std
+				::string gbkStr(gbkBuf);
+			delete[] wcsBuf;
+			delete[] gbkBuf;
+			return gbkStr;
+		}
+	
+	}
 	using namespace OTSSQLITE;
 	CParticleSTDDB::CParticleSTDDB(CDBStoreBasePtr a_datastore)
 	{
@@ -130,7 +151,8 @@ namespace OTSClassifyEngine
 		CString sIncAName;
 		nCol = (int)CParticleSTDTable::ColumnID::S_StrName - (int)CParticleSTDTable::ColumnID::MIN;
 		sIncAName = a_query->GetColStringValue(nCol, _T(""));
-		stdItem->SetName(sIncAName.GetString());
+		std::string gbkName = utf8ToGbk(sIncAName.GetString());	
+		stdItem->SetName(gbkName);
 
 		CString sColor;
 		nCol = (int)CParticleSTDTable::ColumnID::S_COLOR - (int)CParticleSTDTable::ColumnID::MIN;
@@ -244,7 +266,8 @@ namespace OTSClassifyEngine
 		CString grpName;
 		nCol = (int)CParticleSTDTable::ColumnID::N_GroupId - (int)CParticleSTDTable::ColumnID::MIN+(int)CSTDGroupTable::ColumnID::S_NAME- (int)CSTDGroupTable::ColumnID::MIN+1;
 		grpName = a_query->GetColStringValue(nCol, _T(""));
-		stdItem->SetGrpName(grpName.GetString());
+		std::string gbkGrpName = utf8ToGbk(grpName.GetString());	
+		stdItem->SetGrpName(gbkGrpName);
 
 		CString grpColor;
 		nCol = (int)CParticleSTDTable::ColumnID::N_GroupId - (int)CParticleSTDTable::ColumnID::MIN + (int)CSTDGroupTable::ColumnID::S_COLOR - (int)CSTDGroupTable::ColumnID::MIN+1;

+ 2 - 2
OTSIncAMeasureApp/0-OTSModel/OTSDataType/CSampleParam.cs

@@ -41,8 +41,8 @@ namespace OTSDataType
             m_poImageScanParam = new COTSImgScanPrm();
             m_poImageProcessParam = new COTSImageProcParam();
             m_poXRayParam = new COTSXRayParam();
-            
-            //m_SlopParam = new CSlopFocusParam();
+
+            m_SlopParam = new CSlopFocusParam();
         }
         void Duplicate(CSampleParam a_oSource)
         {

+ 10 - 1
OTSIncAMeasureApp/1-OTSMeasure/Measure/DBDataTransition/ElementChemistryDB.cs

@@ -310,7 +310,16 @@ namespace OTSModelSharp.DTLBase
                 nCol = (int)CElementChemistryTable.ColumnID.S_NAME - (int)CElementChemistryTable.ColumnID.MIN;
                 string cheName = Convert.ToString(row[nCol]);
                 nCol = (int)CElementChemistryTable.ColumnID.F_PERCENTAGE - (int)CElementChemistryTable.ColumnID.MIN;
-                double percentage = Convert.ToDouble(row[nCol]);
+
+                double percentage = 0;
+                try
+                {
+                    percentage = Convert.ToDouble(row[nCol]);
+                }
+                catch
+                {
+                    percentage = 0;
+                }
                 CElementChemistryClr che = new CElementChemistryClr(cheName, percentage);
 
                 if (!mapXrayInfo.ContainsKey(fldvec))