Selaa lähdekoodia

Merge branch 'dev' into Release2.3

gsp 3 vuotta sitten
vanhempi
commit
736cc7f4c9

+ 5 - 0
OTSCPP/OTSClrInterface/ClassificationClr/OTSClassifyEngineClr.cpp

@@ -27,6 +27,11 @@ namespace OTSCLRINTERFACE {
 			break;
 		}
 	}
+	bool COTSClassifyEngineClr::ReloadEngineDB()
+	{
+		return engine->Init();
+	
+	}
 
 
 

+ 2 - 0
OTSCPP/OTSClrInterface/ClassificationClr/OTSClassifyEngineClr.h

@@ -21,6 +21,8 @@ namespace OTSCLRINTERFACE {
 	public:
 		COTSClassifyEngineClr(EngineType engineType, System::String^ libFileName);
 
+		bool ReloadEngineDB();
+
 
 
 		bool Classify(COTSParticleClr^ particle);//

+ 3 - 3
OTSIncAMeasureApp/0-OTSModel/Measure/1-OTSInclution/SmplMeasureInclution.cs

@@ -43,7 +43,7 @@ namespace OTSModelSharp
             curFldData.SemPos = semPos;
            
             //first step:remove background of the bse image and compound all the finded particles.
-            COTSXRayParam pXRayParam = m_Sample.GetMsrParams().GetXRayParam();
+          
             log.Info("Begin to process image and get all particles!");
             GetOriginalParticles();
             
@@ -51,8 +51,8 @@ namespace OTSModelSharp
             log.Info("Begin to filter particles!");
             FilterParticles();
 
-            
-      
+            COTSXRayParam pXRayParam = m_Sample.GetMsrParams().GetXRayParam();
+
             if (pXRayParam.GetUsingXray() == true)
             {
                 Thread.Sleep(100);

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

@@ -24,7 +24,7 @@ namespace OTSDataType
 
         public CSpecialGrayRangeParam GetSpecialGrayRangeParam()
         {
-            m_specialGrayRangeParam.LoadParam();
+          
             return m_specialGrayRangeParam;
         }
 

+ 32 - 3
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -14,6 +14,8 @@ using static OTSDataType.otsdataconst;
 using System.Diagnostics;
 using OTSModelSharp.ServiceInterface;
 using OTSMeasureApp._0_OTSModel.Measure.ParamData;
+using OTSCLRINTERFACE;
+using System.IO;
 
 namespace OTSMeasureApp 
 {
@@ -86,7 +88,7 @@ namespace OTSMeasureApp
 
         // 测量线程当前状态  True: 正在测量;  False: 测量结束 
         public bool MeasureThreadRunFlag { get => m_MsrThreadWrapper.BGWorkThreadIsRunning();  }
-
+        public FileSystemWatcher fileWatcher = new FileSystemWatcher(Application.StartupPath+ @"\Config\SysData");
         public OTSIncAMeasureAppForm()
         {
 
@@ -132,11 +134,23 @@ namespace OTSMeasureApp
             //初始化测量线程
 
             m_MsrThreadWrapper = new CMeasureThreadWrapper(this);//must be the last sentence of this procedure.
+            fileWatcher.Changed += FileWatcher_Changed;
+            fileWatcher.EnableRaisingEvents=true;
         }
 
+        private void FileWatcher_Changed(object sender, FileSystemEventArgs e)
+        {
+            if (e.Name == "SpecialGrayConfig.xml")
+            {
+                m_ProjParam.m_specialRanges.LoadParam();
+                foreach (var s in this.m_ProjData.GetSampleList())
+                {
+                    s.GetMsrParams().GetSpecialGrayRangeParam().LoadParam();
+                }
 
-
-
+            }
+           
+        }
 
         private void OTSIncAMeasureAppForm_Load(object sender, EventArgs e)
         {
@@ -1151,6 +1165,20 @@ namespace OTSMeasureApp
                     log.Error("OTSPartA_STDEditor:" + ex.ToString());
                 }
             }
+            //reload the setup data just now
+            foreach (var s in this.m_ProjData.GetSampleList())
+            {
+               var stdname= s.GetMsrParams().GetSTDName();
+                if (stdname != "NoSTD")
+                {
+                    if (!stdname.Contains(".db"))
+                    {
+                        stdname += ".db";
+                    }
+                    var m_classifyEngine = new COTSClassifyEngineClr(EngineType.ParticleClassifyEng, stdname);
+                    m_classifyEngine.ReloadEngineDB();
+                }
+            }
         }
 
   
@@ -1224,6 +1252,7 @@ namespace OTSMeasureApp
         private void ribbonOrbRecentItem1_Click(object sender, EventArgs e)
         {
             System.Diagnostics.Process.Start("notepad.exe", CSpecialGrayRangeParam.GetParamFileFullName());
+          
         }
     }
 }