Prechádzať zdrojové kódy

update the merged particle's record by set the subParticles field to "IsSubParticle"

GSP 1 mesiac pred
rodič
commit
bdaab21f0a

+ 7 - 4
OTSCPP/OTSImagePro/OTSImageProcess.cpp

@@ -2252,11 +2252,13 @@ namespace OTSIMGPROC
 
 			}
 			// calculate all the new segment's position.
-			std::vector <COTSParticle*> allSubParts;
-			allSubParts.push_back(p);
+			//std::vector <COTSParticle*> allSubParts;
+			COTSParticleList allSubParts;
+			allSubParts.push_back(COTSParticlePtr(p));
+			
 			for (auto other : pair.second)// Get the total area of all these particles for  the use of ele calcu.
 			{
-				allSubParts.push_back(other.get());
+				allSubParts.push_back(other);
 			}
 			for (auto subp : allSubParts)
 			{
@@ -2280,7 +2282,7 @@ namespace OTSIMGPROC
 					newseg->SetLength(s->GetLength());
 					newSegs.push_back(newseg);
 				}
-
+				
 			}
 
 			COTSFeaturePtr newFeature = COTSFeaturePtr(new COTSFeature());
@@ -2336,6 +2338,7 @@ namespace OTSIMGPROC
 			xray->SetElementQuantifyData(newCheList);
 			newPart->SetXrayInfo(xray);
 			newPart->SetConnectedParticlesSequentialString(partsStr);
+			newPart->SetSubParticles(allSubParts);
 			newPart->SetActualArea(allPartArea);
 			partTagId++;
 			newPart->SetParticleId(partTagId);

+ 18 - 0
OTSIncAMeasureApp/1-OTSMeasure/Measure/DBDataTransition/IncADataDB.cs

@@ -79,7 +79,25 @@ namespace OTSModelSharp
             return true;
         }
 
+        public bool UpdateIsParticleState(COTSParticleClr a_pParticle)
+        {
+
+            var tableInfoPtr = GetTableInfo();
+
+            var datastorePtr = GetDatastore();
 
+            String sSQLCommand = "Update IncAData SET SubParticles='IsSubParticle' WHERE FieldId = {0} AND ParticleId ={1};";
+            sSQLCommand = String.Format(sSQLCommand,
+     
+             a_pParticle.GetFieldId(),
+             a_pParticle.GetParticleId());
+            //var helper = new SQLiteHelper(datastorePtr);      
+            if (datastorePtr.RunCommand(sSQLCommand) != true)
+            {
+                return false;
+            }
+            return true;
+        }
 
         public KeyValuePair<string,SQLiteParameter[]> GetUpdataAIncACmd(COTSParticleClr a_pParticle)
         {

+ 5 - 1
OTSIncAReportApp/1-UI/frmMeasureRstMgr.cs

@@ -778,7 +778,10 @@ namespace OTSIncAReportApp
             foreach (COTSParticleClr part in mergedParts)
             {
                 partdb.SaveAParticle(part, part.GetXray());
-               
+                foreach (COTSParticleClr subpart in part.GetSubParticles())
+                {
+                    partdb.UpdateIsParticleState(subpart);
+                }
             }
             CPosXrayDBMgr pXrayDBMgr = pDBFileMgr.GetPosXrayDBMgr();
             CElementChemistryDB xraydb = pXrayDBMgr.GetElementChemistryDB();
@@ -790,6 +793,7 @@ namespace OTSIncAReportApp
             xraydb.SaveElementChemistriesList_Batch(ches);
             return true;
         }
+       
 
         private void ToolStripMenuItem_Zeroelementprocess_Click(object sender, EventArgs e)
         {