gsp 4 лет назад
Родитель
Сommit
8d084b9e85

+ 6 - 6
ExtenderControl/Extender.cs

@@ -1477,7 +1477,7 @@ namespace Extender
         private IEdSpectrumProcessing EdSpectrumProcessing = null;
         // Use the autoIdSettings to define elements that are known or elements that you want to exclude. They also list elements that cannot be identified
         private IAutoIdSettings autoIdSettings = null;
-        private ISEMQuantSettings settings = null;
+        private ISEMQuantSettings quantSettings = null;
 
         private int XRayChannelLength = 2000;
         private long[] m_XrayData = null;
@@ -1495,7 +1495,7 @@ namespace Extender
             EdSpectrumProcessing = ProcessingFactory.CreateSpectrumProcessing();
             // Use the autoIdSettings to define elements that are known or elements that you want to exclude. They also list elements that cannot be identified
             autoIdSettings = ProcessingFactory.CreateAutoIdSettings();
-            settings = ProcessingFactory.CreateSEMQuantSettings();
+            quantSettings = ProcessingFactory.CreateSEMQuantSettings();
 
             EdSpectrumAcquisitionController.ExperimentFinished += this.OnEdSpectrumExperimentFinished;
             //EdSpectrumAcquisitionController.ExperimentStarted += this.OnEdSpectrumExperimentStarted;
@@ -1522,7 +1522,7 @@ namespace Extender
             EdSpectrumSettings.EdSettings.EnergyRange = 20;
             EdSpectrumSettings.EdSettings.NumberOfChannels = 4096;
 
-            //EdSpectrumSettings.ScanSettings.AcquisitionRegion.CreateFullFieldRegion(1.0 / 1024.0);
+           // EdSpectrumSettings.ScanSettings.AcquisitionRegion.CreateFullFieldRegion(1.0 / 1024.0);
         }
 
         void SetPointAcquistionRegion(double a_nX, double a_nY)
@@ -1601,9 +1601,9 @@ namespace Extender
             
             EdSpectrumProcessing.IdentifyElements(e.Value, autoIdSettings);
             // While it is possible to choose other elements, Oxygen is the only supported element by stoichiometry.
-            settings.CombinedElement = 8;
-            settings.Normalised = true;
-            ISEMQuantStatus quantStatus = EdSpectrumProcessing.SEMQuantifySpectrum(e.Value, settings);//(a_nChannelData, OIHelper::SEMQuantSettings);
+            quantSettings.CombinedElement = 8;
+            quantSettings.Normalised = true;
+            ISEMQuantStatus quantStatus = EdSpectrumProcessing.SEMQuantifySpectrum(e.Value, quantSettings);//(a_nChannelData, OIHelper::SEMQuantSettings);
             IEnumerable < ISEMQuantResult > Results = quantStatus.Results;
 
             //Get element result for single point

+ 53 - 44
HOZProject/FormHOZMain.cs

@@ -12,7 +12,7 @@ using System.IO;
 using System.Linq;
 using System.Runtime.InteropServices;
 using System.Text;
-
+using SenseShield;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using static MeasureThread.ThreadStatusEventArgs;
@@ -284,57 +284,66 @@ namespace HOZProject
         #region 窗体加载
         private void FormHOZMain_Load(object sender, EventArgs e)
         {
-            //加载控件的点击事件
-            this.Click += new EventHandler(FormHOZMain_Click);
-            plFill.Click += new EventHandler(FormHOZMain_Click);
-            plTop.Click += new EventHandler(FormHOZMain_Click);
-            plLeft.Click += new EventHandler(FormHOZMain_Click);
-            plLeftContent.Click += new EventHandler(FormHOZMain_Click);
-            pbImage.Click += new EventHandler(FormHOZMain_Click);
-
-            //加载窗口移动事件
-            this.MouseDown += new MouseEventHandler(FormHOZMain_MouseDown);
-            this.plTop.MouseDown += new MouseEventHandler(FormHOZMain_MouseDown);
-            //新建
-            NewCreate();
-            //实例初始化窗体对象
-            if (uControl_Init == null)
-            {
-                uControl_Init = new UControl_Init(this);
-                uControl_Init.ReloadConfig();
-            }
-            logwin = new OTSMeasureOutputNlog();
-            logwin.Show();
-            logwin.Height = this.Height;
-            logwin.Left = this.Left - logwin.Width;
-            logwin.Top = this.Top;
-           
-            NLog.Config.LoggingRule lr = NLog.LogManager.Configuration.LoggingRules.FirstOrDefault(
-                r => r.Targets.Any(
-                    t => "control" == t.Name
-                )
-            );
-            if (lr != null)
+            try
             {
-              
+               // DogDecrypting.decrypting(100);//参数为许可号
+                                              //加载控件的点击事件
+                this.Click += new EventHandler(FormHOZMain_Click);
+                plFill.Click += new EventHandler(FormHOZMain_Click);
+                plTop.Click += new EventHandler(FormHOZMain_Click);
+                plLeft.Click += new EventHandler(FormHOZMain_Click);
+                plLeftContent.Click += new EventHandler(FormHOZMain_Click);
+                pbImage.Click += new EventHandler(FormHOZMain_Click);
+
+                //加载窗口移动事件
+                this.MouseDown += new MouseEventHandler(FormHOZMain_MouseDown);
+                this.plTop.MouseDown += new MouseEventHandler(FormHOZMain_MouseDown);
+                //新建
+                NewCreate();
+                //实例初始化窗体对象
+                if (uControl_Init == null)
+                {
+                    uControl_Init = new UControl_Init(this);
+                    uControl_Init.ReloadConfig();
+                }
+                logwin = new OTSMeasureOutputNlog();
+                logwin.Show();
+                logwin.Height = this.Height;
+                logwin.Left = this.Left - logwin.Width;
+                logwin.Top = this.Top;
+
+                NLog.Config.LoggingRule lr = NLog.LogManager.Configuration.LoggingRules.FirstOrDefault(
+                    r => r.Targets.Any(
+                        t => "control" == t.Name
+                    )
+                );
+                if (lr != null)
+                {
 
-            }
 
+                }
 
 
 
-            log = NLog.LogManager.GetCurrentClassLogger();
-            ConfigurationParameter();
-            this.Left= this.Location.X + logwin.Width / 2;
+
+                log = NLog.LogManager.GetCurrentClassLogger();
+                ConfigurationParameter();
+                this.Left = this.Location.X + logwin.Width / 2;
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message, "错误:", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                this.Close();
+            }
         }
-        #endregion
+            #endregion
 
-        #region 创建切孔列表信息
-        /// <summary>
-        /// 创建切孔列表信息
-        /// </summary>
-        /// <param name="ListCutHole"></param>
-        public void CreateCutHoleList(List<CutHole> ListCutHole)
+            #region 创建切孔列表信息
+            /// <summary>
+            /// 创建切孔列表信息
+            /// </summary>
+            /// <param name="ListCutHole"></param>
+            public void CreateCutHoleList(List<CutHole> ListCutHole)
         {
             //清空左侧Panel中的切孔控件
             ClearPanelControls();

+ 4 - 0
HOZProject/UnitControl.csproj

@@ -53,6 +53,10 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\bin\Debug\NLog.dll</HintPath>
     </Reference>
+    <Reference Include="SlmRuntimeCSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\bin\Debug\SlmRuntimeCSharp.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Configuration" />
     <Reference Include="System.Core" />

+ 1 - 1
HOZProject/UserControls/UControl_Init.cs

@@ -346,7 +346,7 @@ namespace HOZProject
             //设置对话框标题
             pOpenFileDialog.Title = "选择模板文件";
             //默认目录
-            //pOpenFileDialog.InitialDirectory = @"\\192.168.1.101\fib auto\FIB Recipe\";
+            pOpenFileDialog.InitialDirectory = @"\\192.168.1.101\fib auto\FIB Recipe\";
             //设置打开文件类型
             pOpenFileDialog.Filter = "ely文件(*.ely)|*.ely";
             ////监测文件是否存在