Browse Source

添加SysMgrApp中的Nlog输出

CXS 3 years ago
parent
commit
381757e086

+ 0 - 2
OTSIncAMeasureApp/0-OTSModel/OTSDataType/otsdataconst.cs

@@ -9,8 +9,6 @@ namespace OTSDataType
 {
     public class otsdataconst
     {
-
-
         // minimum double enter
         public const double MIN_ENTER_VALUE = 0.000001;
 

+ 6 - 0
OTSSysMgrApp/ControllerSettingForm.cs

@@ -266,6 +266,7 @@ namespace OTSSysMgrApp
                     {
                         MessageBox.Show(str2, "Tip");
                     }
+                    log.Info("Image capture success!");
                 }
                 catch (Exception ex)
                 {
@@ -334,6 +335,7 @@ namespace OTSSysMgrApp
 
                     }
                 }
+                log.Info("Single point collection succeeded!");
             }
             catch (Exception ex)
             {
@@ -906,6 +908,7 @@ namespace OTSSysMgrApp
                         lbXrayCount.Text = nXrayCount.ToString();
                     }
                 }
+                log.Info("Multipoint collection succeeded!");
             }
             catch (Exception ex)
             {
@@ -980,6 +983,7 @@ namespace OTSSysMgrApp
                         lbXrayCount.Text = nXrayCount.ToString();
                     }
                 }
+                log.Info("Area collection successful!");
             }
             catch (Exception ex)
             {
@@ -1041,6 +1045,7 @@ namespace OTSSysMgrApp
                 chartXRay.Refresh();
                 //EDS过程结束
                 cfun.EDSFinishedInstance();
+                log.Info("Cleared successfully!");
             }
             catch (Exception ex)
             {
@@ -1107,6 +1112,7 @@ namespace OTSSysMgrApp
                         showXRayElementResultForm.ShowDialog();
                     }
                 }
+                log.Info("Element analysis success!");
             }
             catch (Exception ex)
             {

+ 1 - 0
OTSSysMgrApp/OTSSystemManagerForms.cs

@@ -327,6 +327,7 @@ namespace OTSSysMgrApp
                 {
                     bool result = WriteXMLFileVersion(selectVersion);
                 }
+                log.Info("The current energy spectrum selection version is " + selectVersion);
             }
             catch (Exception ex)
             {

+ 43 - 2
OTSSysMgrApp/SemTestForms.cs

@@ -484,13 +484,15 @@ namespace OTSSysMgrApp
                 if (!ConnectionState)
                 {
                     ShowMessage(2);
+                    log.Error(table["message3"].ToString());
                 }
                 else
                 {
                     string str = table["str1"].ToString();
-                  
+                    
                     BtnConnect.Text = str;
                     GetBtnState(true);
+                    log.Info("The energy spectrum is connected");
                 }
             }
             else
@@ -499,6 +501,7 @@ namespace OTSSysMgrApp
                 //断开电镜连接
                 if (cfun.DisConnectSem())
                 {
+                    log.Info(table["message10"].ToString());
                 }
                 else
                 {
@@ -518,6 +521,7 @@ namespace OTSSysMgrApp
                 cfun.DisConnectSem();
                 //释放DLL内存
                 cfun.FreeHardware();
+                
             }
             catch (Exception ex)
             {
@@ -542,11 +546,13 @@ namespace OTSSysMgrApp
                     tbPositionX.Text = Convert.ToDouble(PositionX).ToString();
                     tbPositionY.Text = Convert.ToDouble(PositionY).ToString();
                     tbPositionR.Text = Convert.ToDouble(PositionR).ToString();
+                    log.Info("X,Y-axis coordinates:(" + tbPositionX.Text + "," + tbPositionY.Text+")");
                 }
                 else
                 {
                     //配置结果提示
                     ShowMessage(6);
+                    log.Error("Failed to obtain the X and Y coordinates");
                 }
             }
             catch (Exception ex)
@@ -600,10 +606,12 @@ namespace OTSSysMgrApp
                 {
                     //配置结果提示
                     ShowMessage(3);
+                    log.Info("Set successfully, current X and Y coordinates should be:(" + PositionX.ToString() + "," + PositionY.ToString() + ")");
                 }
                 else
                 {
                     ShowMessage(4);
+                    log.Error("Failed to set X and Y coordinates!");
                 }
             }
             catch (Exception ex)
@@ -672,11 +680,13 @@ namespace OTSSysMgrApp
                 {
                     //赋值 显示
                     tbBeamBlank.Text = Convert.ToString(a_nBeamBlank);
+                    log.Info("Beam baffle:" + tbBeamBlank.Text);
                 }
                 else
                 {
                     //配置结果提示
                     ShowMessage(6);
+                    log.Error("Failed to obtain the Beam baffle!");
                 }
             }
             catch (Exception ex)
@@ -709,10 +719,12 @@ namespace OTSSysMgrApp
                 {
                     //配置结果提示
                     ShowMessage(3);
+                    log.Info("etting successful!The current beam baffle should be:" + tbSBeamBlank.Text);
                 }
                 else
                 {
                     ShowMessage(4);
+                    log.Error("Beam baffle setting failed!");
                 }
             }
             catch (Exception ex)
@@ -733,11 +745,13 @@ namespace OTSSysMgrApp
                 {
                     //赋值 显示
                     tbBrightness.Text = Convert.ToString(a_dBrightness);
+                    log.Info("Brightness:" + tbBrightness.Text);
                 }
                 else
                 {
                     //配置结果提示
                     ShowMessage(6);
+                    log.Error("Failed to obtain the Brightness");
                 }
             }
             catch (Exception ex)
@@ -771,10 +785,12 @@ namespace OTSSysMgrApp
                 {
                     //配置结果提示
                     ShowMessage(3);
+                    log.Info("Setting successful!, the current brightness should be:" + tbSBrightness.Text);
                 }
                 else
                 {
                     ShowMessage(4);
+                    log.Error("Brightness setting failed!");
                 }
             }
             catch (Exception ex)
@@ -795,11 +811,13 @@ namespace OTSSysMgrApp
                 {
                     //赋值 显示
                     tbContrast.Text = Convert.ToString(a_dContrast);
+                    log.Info("Contrast:" + tbContrast.Text);
                 }
                 else
                 {
                     //配置结果提示
                     ShowMessage(6);
+                    log.Error("Failed to obtain contrast!");
                 }
             }
             catch (Exception ex)
@@ -833,10 +851,12 @@ namespace OTSSysMgrApp
                 {
                     //配置结果提示
                     ShowMessage(3);
+                    log.Info("Set successfully, the current contrast should be:" + tbSContrast.Text);
                 }
                 else
                 {
                     ShowMessage(4);
+                    log.Error("Contrast setting failed!");
                 }
             }
             catch (Exception ex)
@@ -857,11 +877,13 @@ namespace OTSSysMgrApp
                 {
                     //赋值 显示
                     tbFWD.Text = Convert.ToString(a_dWorkingDistance);
+                    log.Info("WorkingDistance:" + tbFWD.Text);
                 }
                 else
                 {
                     //配置结果提示
                     ShowMessage(6);
+                    log.Error("Fail to obtain the WorkingDistance!");
                 }
             }
             catch (Exception ex)
@@ -895,10 +917,12 @@ namespace OTSSysMgrApp
                 {
                     //配置结果提示
                     ShowMessage(3);
+                    log.Info("Setting successful!, the current working distance should be:"+ tbSFWD.Text);
                 }
                 else
                 {
                     ShowMessage(4);
+                    log.Error("Working distance setting failed!");
                 }
             }
             catch (Exception ex)
@@ -919,11 +943,13 @@ namespace OTSSysMgrApp
                 {
                     //赋值 显示
                     tbKV.Text = Convert.ToString(a_dKV);
+                    log.Info("Electron microscope voltage:" + tbKV.Text);
                 }
                 else
                 {
                     //配置结果提示
                     ShowMessage(6);
+                    log.Error("Failed to obtain electron microscope voltage value!");
                 }
             }
             catch (Exception ex)
@@ -957,10 +983,12 @@ namespace OTSSysMgrApp
                 {
                     //配置结果提示
                     ShowMessage(3);
+                    log.Info("Setting successful!, the current voltage value should be:" + tbSKV.Text);
                 }
                 else
                 {
                     ShowMessage(4);
+                    log.Error("Voltage setting failed!");
                 }
             }
             catch (Exception ex)
@@ -981,11 +1009,13 @@ namespace OTSSysMgrApp
                 {
                     //赋值 显示
                     tbMagnification.Text = Convert.ToString(a_dMagnification);
+                    log.Info("SemMagnification:" + tbMagnification.Text);
                 }
                 else
                 {
                     //配置结果提示
                     ShowMessage(6);
+                    log.Error("Fail to obtain the SemMagnification!");
                 }
             }
             catch (Exception ex)
@@ -1019,11 +1049,12 @@ namespace OTSSysMgrApp
                 {
                     //配置结果提示
                     ShowMessage(3);
-                    MessageBox.Show(cfun.GetMagnification().ToString());
+                    log.Info("Setting successful!, the current magnification should be:");
                 }
                 else
                 {
                     ShowMessage(4);
+                    log.Error("Magnification setting failed!");
                 }
             }
             catch (Exception ex)
@@ -1045,6 +1076,7 @@ namespace OTSSysMgrApp
                 {
                     //赋值 显示
                     tbSpotSize.Text = Convert.ToString(a_dSpotSize);
+                    log.Info("Spot size:" + tbSpotSize.Text);
                 }
                 else
                 {
@@ -1083,10 +1115,12 @@ namespace OTSSysMgrApp
                 {
                     //配置结果提示
                     ShowMessage(3);
+                    log.Info("Setting successful!, the current spot size should be:");
                 }
                 else
                 {
                     ShowMessage(4);
+                    log.Error("Spot size setting failed!");
                 }
             }
             catch (Exception ex)
@@ -1107,11 +1141,13 @@ namespace OTSSysMgrApp
                 {
                     //赋值 显示
                     cbHT.Checked = Convert.ToBoolean(a_bHTValue);
+                    log.Info("HT:" + cbHT.Checked.ToString());
                 }
                 else
                 {
                     //配置结果提示
                     ShowMessage(6);
+                    log.Error("Fail to obtain the HT!");
                 }
             }
             catch (Exception ex)
@@ -1134,10 +1170,12 @@ namespace OTSSysMgrApp
                 {
                     //配置结果提示
                     ShowMessage(3);
+                    log.Info("Setting successful!, the current voltage should be:" + cbSHT.Checked.ToString());
                 }
                 else
                 {
                     ShowMessage(4);
+                    log.Error("Voltage setting failed!");
                 }
             }
             catch (Exception ex)
@@ -1158,11 +1196,13 @@ namespace OTSSysMgrApp
                     //赋值 显示
                     tbGSemScanFieldX.Text = Convert.ToDouble(result.Width).ToString();
                     tbSemScanFieldY.Text = Convert.ToDouble(result.Height).ToString();
+                    log.Info("SemScanFieldX,SemScanFieldY:(" + tbGSemScanFieldX.Text + "," + tbSemScanFieldY.Text + ")");
                 }
                 else
                 {
                     //配置结果提示
                     ShowMessage(6);
+                    log.Error("Fail to obtain the SemScanFieldX,SemScanFieldY!");
                 }
             }
             catch (Exception ex)
@@ -1192,6 +1232,7 @@ namespace OTSSysMgrApp
                 cfun.SetSemScanField100(xySize);
                 //配置结果提示
                 ShowMessage(3);
+                log.Info("etting successful!, the current scanning matrix X, the Y-axis should be:(" + tbGSemScanFieldX.Text + "," + tbSemScanFieldY.Text + ")");
             }
             catch (Exception ex)
             {