Jelajahi Sumber

check the SubParticles field ,if not exist then create in the report app.

GSP 1 bulan lalu
induk
melakukan
0d87bf111e

+ 2 - 2
OTSCPP/OTSRptCalculate/DTL/IncADataTable.cpp

@@ -1,4 +1,4 @@
-#pragma once
+#pragma once
 #include "stdafx.h"
 #include "IncADataTable.h"
 #include "DBConst.h"
@@ -45,7 +45,7 @@ namespace OTSSQLITE
 		AddColumn(std::make_pair(_T("GroupId"), ColumnType::ID::INT));
 		AddColumn(std::make_pair(_T("GroupName"), ColumnType::ID::STRING));
 		AddColumn(std::make_pair(_T("GroupColor"), ColumnType::ID::STRING));
-
+		AddColumn(std::make_pair(_T("SubParticles"), ColumnType::ID::STRING));
 		ASSERT(GetColumnCount() == ((int)ColumnID::MAX - (int)ColumnID::MIN) + 1);
 
 		SetTableName(g_sIncAData);

+ 3 - 2
OTSCPP/OTSRptCalculate/DTL/IncADataTable.h

@@ -1,4 +1,4 @@
-#pragma once
+#pragma once
 #include "CSQLiteTable.h"
 
 namespace OTSSQLITE
@@ -43,7 +43,8 @@ namespace OTSSQLITE
 			N_GRPID = 28,
 			S_GRPNAME = 29,
 			S_GRPCOLOR = 30,
-			MAX = 30
+			S_SUBPARTICLES = 31,
+			MAX = 31
 			
 		};
 

+ 2 - 9
OTSIncAMeasureApp/1-OTSMeasure/Measure/DBDataTransition/IncADataDB.cs

@@ -25,20 +25,13 @@ namespace OTSModelSharp
         {
             var tableInfoPtr = GetTableInfo();
             var datastorePtr = GetDatastore();
-            //Rectangle prec = (Rectangle)a_pParticle.GetParticleRect();
-            //System.Drawing.Point pos = (System.Drawing.Point)a_pParticle.GetSEMPos();
+          
 
             System.Drawing.Rectangle rec = (System.Drawing.Rectangle)a_pParticle.GetParticleRect();
             System.Drawing.Point xrayPos = (System.Drawing.Point)a_pParticle.GetXRayPos();
             System.Drawing.Point semPos = (System.Drawing.Point)a_pParticle.GetSEMPos();
             System.Drawing.Point otsfieldPos= (System.Drawing.Point)a_pParticle.GetFieldOTSPos();   
-            //int l = 0;
-            //int t = 0;
-            //int r = 0;
-            //int b = 0;
-            //a_pParticle.GetOTSRect(ref l, ref t, ref r, ref b);
-            //COTSRect cOTSRect = new COTSRect(l,t,r,b);
-            //System.Drawing.PointF otsPos=cOTSRect.GetCenterPoint();
+           
             String sInsertFormat = tableInfoPtr.GetInsertCommandFormatString(true);
             var cmd = tableInfoPtr.GetInsertCommand(true);
 

+ 1 - 1
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -108,7 +108,7 @@ namespace OTSIncAReportGraph.Controls
         //包含particle的field的列表对象
         public List<DisplayRectangle> m_list_allDfield = null;
         //这里要做成控件,不要是窗体
-        private List<DisplayParticle> m_list_allDPart_original = null;
+        private List<DisplayParticle> m_list_allDPart_original = new List<DisplayParticle> ();
         public List<DisplayRectangle> m_CurGBFields = new List<DisplayRectangle>();
         public List<DisplayRectangle> m_CurGBParticles = new List<DisplayRectangle>();
 

+ 10 - 2
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/FieldData.cs

@@ -1,4 +1,5 @@
-using OTSCommon.DBOperate.Model;
+using DevExpress.CodeParser;
+using OTSCommon.DBOperate.Model;
 using System;
 using System.Collections.Generic;
 using System.Data;
@@ -29,7 +30,14 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             //获取field信息
             string sql = "select fieldid,fieldposx,fieldposy from field ";//select fieldid,fieldposx,fieldposy from field
             DataTable DT = dbHelper.ExecuteDataTable(sql, null);
-
+            string checksql = "SELECT COUNT(*) AS field_exists FROM pragma_table_info('IncAData') WHERE name = 'SubParticles';";
+            var checkresult = dbHelper.ExecuteQueryResult(checksql);
+            if (Convert.ToInt32( checkresult) == 0)
+            {
+                string alterSql = "ALTER TABLE IncAData ADD COLUMN SubParticles TEXT";
+                dbHelper.ExecuteQueryResult(alterSql);
+            } 
+            
             string sqlp = "select * from IncAData where SubParticles isnull or SubParticles='IsSubParticle'";
             DataTable DTP = dbHelper.ExecuteDataTable(sqlp, null);
             //获取Segment信息

+ 5 - 9
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/SqlHelper.cs

@@ -449,17 +449,13 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         }
 
 
-        public int ExecuteQueryResult(string queryString)
+        public object ExecuteQueryResult(string queryString)
         {
-            int result = -1;
-            try
-            {
+            //int result = -1;
+           
                 dbCommand.CommandText = queryString;
-                result = dbCommand.ExecuteNonQuery();
-            }
-            catch/* (Exception e)*/
-            {
-            }
+              var  result = dbCommand.ExecuteScalar();
+           
 
             return result;
         }