|
@@ -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)
|
|
|
{
|
|
@@ -1150,6 +1164,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();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1223,6 +1251,7 @@ namespace OTSMeasureApp
|
|
|
private void ribbonOrbRecentItem1_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
System.Diagnostics.Process.Start("notepad.exe", CSpecialGrayRangeParam.GetParamFileFullName());
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|