Просмотр исходного кода

fix bugs in the SpecialParticleForm.cs. Improve the classification logic when it's without the Xray data.

GSP 2 недель назад
Родитель
Сommit
35e8f7ecf8

+ 6 - 8
Bin/x64/Debug/Config/SysData/OTSProgMgrParam.pmf

@@ -1,21 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData RunMode="ProfessionalMode" SysType="IncA">
   <Member RegName="BrightnessContrastRegulateParam" AutoRegulateType="EveryPeriod" BrightPhaseElement="Al" BrightPhaseValue="124" DarkPhaseElement="C" DarkPhaseValue="11" InitialBrightness="45.53382111" InitialContrast="60.21995716" mag="100" Period="5" StdMaterialOTSPos="41475,-4357" ToRun="true" />
-  <Member RegName="GenParam" DefaultArea="1450" DefaultSampleName="Sample" DefaultShape="0" EngineType="1:ExpressionParse" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="Cleanness_ND1" SteelTechnology="0" />
+  <Member RegName="GenParam" DefaultArea="1450" DefaultSampleName="Sample" DefaultShape="0" EngineType="1:ExpressionParse" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="zz" SteelTechnology="0" />
   <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="1:MANUAL" MatrixStep="0" OverlapParam="0" ParticleSelectionCondition="">
     <Member RegName="BGGray" end="110" start="0" />
-    <Member RegName="IncArea" end="200" start="25" />
+    <Member RegName="IncArea" end="200" start="3" />
     <Member RegName="ParticleGray" end="255" start="0" />
   </Member>
-  <Member RegName="ImageScanParam" ImageResolution="4:_1536_1024" SatrtImageMode="1:Snake" ScanImageSpeed="0:low" StopMode="0:CoverMode" StopParamArea="10" StopParamFields="2" StopParamMeasTime="360" StopParamParticles="5000" />
-  <Member RegName="SpecialGrayParam" ToRun="true">
-    <Collection RegName="GrayRangeList">
-      <Member collectXray="true" diameterEnd="25" diameterStart="5" end="255" rngName="default" start="150" />
-    </Collection>
+  <Member RegName="ImageScanParam" ImageResolution="3:_1024_768" SatrtImageMode="0:Spiral" ScanImageSpeed="0:low" StopMode="0:CoverMode" StopParamArea="10" StopParamFields="2" StopParamMeasTime="360" StopParamParticles="5000" />
+  <Member RegName="SpecialGrayParam" ToRun="false">
+    <Collection RegName="GrayRangeList" />
   </Member>
   <Member RegName="StageData" ControlDelay="2000" MinMag="65" scanFieldSize="1270" xAxisDir="1:RIGHT_TOWARD" yAxisDir="0:UP_TOWARD">
     <Member RegName="XAxis" end="55000" start="-55000" />
     <Member RegName="YAxis" end="55000" start="-55000" />
   </Member>
-  <Member RegName="XrayParam" AnalyExpCount="1000" IfAutoId="true" KnownElements="C,N,O,F,Na,Mg,Al,Si,P,S,Ca,Ti,V,Cr,Mn,Fe,Zr,Nb,Mo,La,Ce" MidAnalyAQTime="300" QuantifyMinSize="5" ScanMode="0:PointMode" SmallPartAQTime="300" UseFilter="false" UsingXray="true" XrayLimit="200" />
+  <Member RegName="XrayParam" AnalyExpCount="1000" IfAutoId="true" KnownElements="C,N,O,F,Na,Mg,Al,Si,P,S,Ca,Ti,V,Cr,Mn,Fe,Zr,Nb,Mo,La,Ce" MidAnalyAQTime="300" QuantifyMinSize="5" ScanMode="0:PointMode" SmallPartAQTime="300" UseFilter="false" UsingXray="false" XrayLimit="200" />
 </XMLData>

+ 16 - 10
OTSCPP/OTSClassifyEngine/ExpressionClassifyEngine.cpp

@@ -45,20 +45,26 @@ bool ExpressionClassifyEngine::Init()
 bool ExpressionClassifyEngine::ClassifyExpression(COTSParticlePtr particle, CPosXrayPtr xray)
 {
 
-	if (particle != nullptr && xray != nullptr)//process the particle with the xray data
+	if (particle != nullptr )//process the particle with the xray data
 	{
-		auto& originalPartEles = xray->GetElementQuantifyData();//find all the elements containing in the particle xray.
-
-		//zero element process,if satisfied the condition than set the particular element percentage to 0.and make it 100% of all the other element percentage.
-
-		auto partEles = ZeroElementProcess(particle, xray);//
-
-
+		
 		std::map<std::string, CElementChemistryPtr> mapChemistrys;
-		for (auto ch : partEles)
+		CElementChemistriesList partEles;
+		//zero element process,if satisfied the condition than set the particular element percentage to 0.and make it 100% of all the other element percentage.
+		if (xray != nullptr)
 		{
-			mapChemistrys[ch->GetName().GetBuffer()] = ch;
+			auto& originalPartEles = xray->GetElementQuantifyData();//find all the elements containing in the particle xray.
+			 partEles = ZeroElementProcess(particle, xray);//
+			for (auto ch : partEles)
+			{
+				mapChemistrys[ch->GetName().GetBuffer()] = ch;
+			}
 		}
+		
+
+
+		
+		
 
 		PartSTDRuleItemList ruleItems = m_std->GetSTDRuleItems();
 		std::vector<PartSTDRuleItemPtr> matchedItems;

+ 2 - 7
OTSCPP/OTSClrInterface/ClassificationClr/OTSClassifyEngineClr.cpp

@@ -42,14 +42,9 @@ namespace OTSCLRINTERFACE {
 	{
 		auto part = particle->GetOTSParticlePtr();
 		auto xraydata = part->GetXrayInfo();
-		if (xraydata != nullptr)
-		{
+		
 			return engine->ClassifyExpression(part, xraydata);
-		}
-		else
-		{
-			return false;
-		}
+		
 	}
 
 	bool COTSClassifyEngineClr::ClassifyBySpectrum(COTSParticleClr^ particle)

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

@@ -224,7 +224,7 @@ namespace OTSDataType
             // remove BES image background
             RemoveImgBGAndGetParticles(pImgProcessParam, pixelsize);
 
-            var specialPartsparam = pMsrParam.GetSpecialGrayRangeParam();
+            var specialPartsparam = pMsrParam.GetImageProcessParam().GetSpecialGreyRangeParam();
 
             if (specialPartsparam != null && specialPartsparam.GetIsToRun())
             {

+ 3 - 18
OTSIncAMeasureApp/0-OTSModel/OTSDataType/CSampleParam.cs

@@ -17,7 +17,6 @@ namespace OTSDataType
         private COTSImgScanPrm m_poImageScanParam;
         private COTSImageProcParam m_poImageProcessParam;
         private COTSXRayParam m_poXRayParam;
-        private CSpecialGrayRangeParam m_specialGrayRangeParam=new CSpecialGrayRangeParam();
         private STEEL_TECHNOLOGY m_SteelTech;
         private CSlopFocusParam m_SlopParam;
         // soft pack id
@@ -26,21 +25,7 @@ namespace OTSDataType
 
         public CSlopFocusParam SlopParam { get => m_SlopParam; set => m_SlopParam = value; }
 
-        public CSpecialGrayRangeParam GetSpecialGrayRangeParam()
-        {
-            //if (m_specialGrayRangeParam == null)
-            //{
-            //    m_specialGrayRangeParam = new CSpecialGrayRangeParam();
-            //}
-           
-            return m_specialGrayRangeParam;
-        }
-
-        public void SetSpecialGrayRangeParam(CSpecialGrayRangeParam value)
-        {
-            m_specialGrayRangeParam = value;
-            m_poImageProcessParam.SetSpecialGreyRangeParam(value);
-        }
+      
 
         public CSampleParam()
         {
@@ -106,7 +91,7 @@ namespace OTSDataType
             slo.Register("SlopFocusParam", m_SlopParam);
             slo.Register("ImageScanParam", m_poImageScanParam);
             slo.Register("ImageProcessParam", m_poImageProcessParam);
-            slo.Register("SpecialGrayParam", m_specialGrayRangeParam);
+            slo.Register("SpecialGrayParam", m_poImageProcessParam.GetSpecialGreyRangeParam());
             slo.Register("XRayParam", m_poXRayParam);
 
             if (isStoring)
@@ -167,7 +152,7 @@ namespace OTSDataType
 
         }
         public COTSImgScanPrm GetImageScanParam() { return m_poImageScanParam; }
-        public COTSImageProcParam GetImageProcessParam() { m_poImageProcessParam.SetSpecialGreyRangeParam(m_specialGrayRangeParam); return m_poImageProcessParam; }
+        public COTSImageProcParam GetImageProcessParam() {  return m_poImageProcessParam; }
         public COTSXRayParam GetXRayParam() { return m_poXRayParam; }
         // STDSwitch
         public OTS_CLASSIFY_ENGINE_TYPE GetEngineType() { return m_engineType; }

+ 1 - 1
OTSIncAMeasureApp/2-OTSMeasureParamManage/COTSMeasureParam.cs

@@ -314,7 +314,7 @@ namespace OTSMeasureApp
             String sSTDName = m_pParam.GetSTDSelect();
             poMsrParams.SetSTDName(sSTDName);
             poMsrParams.SetSteelTechnology((STEEL_TECHNOLOGY)m_pParam.GetSteelTechnology());
-            poMsrParams.SetSpecialGrayRangeParam(defaultParam.SpecialGrayRangeParam.Duplicate());
+            poMsrParams.GetImageProcessParam().SetSpecialGreyRangeParam(defaultParam.SpecialGrayRangeParam.Duplicate());
             // set sample parameters
             pSample.SetName(strNewSampleName);
             pSample.SetSampleHoleName(pHole.GetName());

+ 1 - 1
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSPropertyWindow.cs

@@ -350,7 +350,7 @@ namespace OTSMeasureApp
             m_cotsprogmgrparamfile.SetImageProcParam(WSample.GetMsrParams().GetImageProcessParam().Duplicate());
             m_cotsprogmgrparamfile.SetImageScanParam(WSample.GetMsrParams().GetImageScanParam().Duplicate());
             m_cotsprogmgrparamfile.SetXRayParam(WSample.GetMsrParams().GetXRayParam().Duplicate());
-            m_cotsprogmgrparamfile.SpecialGrayRangeParam = WSample.GetMsrParams().GetSpecialGrayRangeParam().Duplicate();
+            m_cotsprogmgrparamfile.SpecialGrayRangeParam = WSample.GetMsrParams().GetImageProcessParam().GetSpecialGreyRangeParam().Duplicate();
             OTSModelSharp.COTSCommonParam m_cgenparam = m_cotsprogmgrparamfile.GetCommonParam();
             m_cgenparam.SetEngineType(WSample.GetMsrParams().GetEngineType());
             m_cgenparam.SetSteelTechnology((int)WSample.GetMsrParams().GetSteelTechnology());

+ 2 - 1
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/OTSMeasureStatusWindow.cs

@@ -1637,6 +1637,7 @@ namespace OTSMeasureApp
             COTSSample WSample = m_MeasureAppForm.m_ProjRstData.GetWorkingSample();
             SpecialParticleForm specialParticleForm = new SpecialParticleForm( m_MeasureAppForm, originalBseData, GetIWidth(), GetIHeight(), WSample);
             DialogResult dialogResult = specialParticleForm.ShowDialog();
+            WSample.GetMsrParams().GetImageProcessParam().SetSpecialGreyRangeParam(specialParticleForm.specialGray);
         }
 
         private void toolStripMenuItem2_Click(object sender, EventArgs e)
@@ -1645,7 +1646,7 @@ namespace OTSMeasureApp
             SetContextMenuEnabled(true);
             m_imagetype = ImageType.RemoveBGImage;
             ShowColoredRemoveBGImage();
-            //m_CurrentMultiple = 0;
+          
             panelXray.Visible = false;
         }
 

+ 0 - 221
OTSIncAMeasureApp/7-OTSProgMgrInfo/SpecialParticleForm.Designer.cs

@@ -1,221 +0,0 @@
-
-namespace OTSMeasureApp
-{
-    partial class SpecialParticleForm
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.dg1 = new System.Windows.Forms.DataGridView();
-            this.confirm = new System.Windows.Forms.Button();
-            this.button2 = new System.Windows.Forms.Button();
-            this.button1 = new System.Windows.Forms.Button();
-            this.button3 = new System.Windows.Forms.Button();
-            this.groupBox1 = new System.Windows.Forms.GroupBox();
-            this.checkBox1 = new System.Windows.Forms.CheckBox();
-            this.RegName = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.start = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.end = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.diameterStart = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.diameterEnd = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.collectXray = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.rangeChoose = new System.Windows.Forms.DataGridViewButtonColumn();
-            ((System.ComponentModel.ISupportInitialize)(this.dg1)).BeginInit();
-            this.groupBox1.SuspendLayout();
-            this.SuspendLayout();
-            // 
-            // dg1
-            // 
-            this.dg1.AllowUserToAddRows = false;
-            this.dg1.AllowUserToDeleteRows = false;
-            this.dg1.AllowUserToOrderColumns = true;
-            this.dg1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.dg1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.RegName,
-            this.start,
-            this.end,
-            this.diameterStart,
-            this.diameterEnd,
-            this.collectXray,
-            this.rangeChoose});
-            this.dg1.Location = new System.Drawing.Point(2, 2);
-            this.dg1.Name = "dg1";
-            this.dg1.RowTemplate.Height = 23;
-            this.dg1.Size = new System.Drawing.Size(779, 312);
-            this.dg1.TabIndex = 2;
-            this.dg1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dg1_CellContentClick);
-            // 
-            // confirm
-            // 
-            this.confirm.Location = new System.Drawing.Point(538, 378);
-            this.confirm.Name = "confirm";
-            this.confirm.Size = new System.Drawing.Size(87, 25);
-            this.confirm.TabIndex = 3;
-            this.confirm.Text = "确定";
-            this.confirm.UseVisualStyleBackColor = true;
-            this.confirm.Click += new System.EventHandler(this.confirm_Click);
-            // 
-            // button2
-            // 
-            this.button2.Location = new System.Drawing.Point(646, 378);
-            this.button2.Name = "button2";
-            this.button2.Size = new System.Drawing.Size(87, 24);
-            this.button2.TabIndex = 4;
-            this.button2.Text = "取消";
-            this.button2.UseVisualStyleBackColor = true;
-            this.button2.Click += new System.EventHandler(this.button2_Click);
-            // 
-            // button1
-            // 
-            this.button1.Location = new System.Drawing.Point(40, 378);
-            this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(66, 25);
-            this.button1.TabIndex = 5;
-            this.button1.Text = "增加";
-            this.button1.UseVisualStyleBackColor = true;
-            this.button1.Click += new System.EventHandler(this.button1_Click);
-            // 
-            // button3
-            // 
-            this.button3.Location = new System.Drawing.Point(130, 379);
-            this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(62, 22);
-            this.button3.TabIndex = 6;
-            this.button3.Text = "删除";
-            this.button3.UseVisualStyleBackColor = true;
-            this.button3.Click += new System.EventHandler(this.button3_Click);
-            // 
-            // groupBox1
-            // 
-            this.groupBox1.Controls.Add(this.checkBox1);
-            this.groupBox1.Location = new System.Drawing.Point(4, 318);
-            this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(776, 45);
-            this.groupBox1.TabIndex = 7;
-            this.groupBox1.TabStop = false;
-            // 
-            // checkBox1
-            // 
-            this.checkBox1.AutoSize = true;
-            this.checkBox1.Location = new System.Drawing.Point(21, 18);
-            this.checkBox1.Name = "checkBox1";
-            this.checkBox1.Size = new System.Drawing.Size(48, 16);
-            this.checkBox1.TabIndex = 0;
-            this.checkBox1.Text = "启用";
-            this.checkBox1.UseVisualStyleBackColor = true;
-            // 
-            // RegName
-            // 
-            this.RegName.DataPropertyName = "RegName";
-            this.RegName.HeaderText = "名称";
-            this.RegName.Name = "RegName";
-            this.RegName.Width = 80;
-            // 
-            // start
-            // 
-            this.start.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.start.DataPropertyName = "start";
-            this.start.HeaderText = "开始灰度(0-255)";
-            this.start.Name = "start";
-            // 
-            // end
-            // 
-            this.end.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.end.DataPropertyName = "end";
-            this.end.HeaderText = "结束灰度(0-255)";
-            this.end.Name = "end";
-            // 
-            // diameterStart
-            // 
-            this.diameterStart.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.diameterStart.DataPropertyName = "diameterStart";
-            this.diameterStart.HeaderText = "开始直径(微米)";
-            this.diameterStart.Name = "diameterStart";
-            // 
-            // diameterEnd
-            // 
-            this.diameterEnd.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.diameterEnd.DataPropertyName = "diameterEnd";
-            this.diameterEnd.HeaderText = "结束直径(微米)";
-            this.diameterEnd.Name = "diameterEnd";
-            // 
-            // collectXray
-            // 
-            this.collectXray.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.collectXray.DataPropertyName = "collectXray";
-            this.collectXray.HeaderText = "是否采集Xray";
-            this.collectXray.Name = "collectXray";
-            this.collectXray.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.collectXray.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            // 
-            // rangeChoose
-            // 
-            this.rangeChoose.HeaderText = "可视化选择";
-            this.rangeChoose.Name = "rangeChoose";
-            this.rangeChoose.Text = "GrayLevel";
-            this.rangeChoose.UseColumnTextForButtonValue = true;
-            // 
-            // SpecialParticleForm
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(784, 414);
-            this.Controls.Add(this.groupBox1);
-            this.Controls.Add(this.button3);
-            this.Controls.Add(this.button1);
-            this.Controls.Add(this.button2);
-            this.Controls.Add(this.confirm);
-            this.Controls.Add(this.dg1);
-            this.MaximumSize = new System.Drawing.Size(800, 453);
-            this.MinimumSize = new System.Drawing.Size(800, 453);
-            this.Name = "SpecialParticleForm";
-            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "特殊灰度阈值颗粒提取";
-            ((System.ComponentModel.ISupportInitialize)(this.dg1)).EndInit();
-            this.groupBox1.ResumeLayout(false);
-            this.groupBox1.PerformLayout();
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.DataGridView dg1;
-        private System.Windows.Forms.Button confirm;
-        private System.Windows.Forms.Button button2;
-        private System.Windows.Forms.Button button1;
-        private System.Windows.Forms.Button button3;
-        private System.Windows.Forms.GroupBox groupBox1;
-        private System.Windows.Forms.CheckBox checkBox1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn RegName;
-        private System.Windows.Forms.DataGridViewTextBoxColumn start;
-        private System.Windows.Forms.DataGridViewTextBoxColumn end;
-        private System.Windows.Forms.DataGridViewTextBoxColumn diameterStart;
-        private System.Windows.Forms.DataGridViewTextBoxColumn diameterEnd;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn collectXray;
-        private System.Windows.Forms.DataGridViewButtonColumn rangeChoose;
-    }
-}

+ 0 - 242
OTSIncAMeasureApp/7-OTSProgMgrInfo/SpecialParticleForm.cs

@@ -1,242 +0,0 @@
-using OTSCommon;
-using OTSDataType;
-using OTSMeasureApp._0_OTSModel.OTSDataType;
-using OTSModelSharp.ServiceCenter;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using System.Xml;
-
-namespace OTSMeasureApp
-{
-    public partial class SpecialParticleForm : Form
-    {
-        //private string xmlPath = "";
-        private string str_RegName = "default";
-        private string str_start = "0";
-        private string str_end = "100";
-        private string str_diameterStart = "0";
-        private string str_diameterEnd = "100";
-
-        OTSIncAMeasureAppForm m_mainForm;
-        OTSMeasureStatusWindow m_measureStatuWindow;
-       byte[] m_BseData;
-        int m_imageWidth;
-        int m_imageHeight;
-        //国际化
-        OTSCommon.Language lan;
-        Hashtable table;
-
-        //the datasource of datagridview
-        DataSet ds1;
-       
-        public CSpecialGrayRangeParam specialGray=new CSpecialGrayRangeParam();
-
-        public SpecialParticleForm(OTSIncAMeasureAppForm mainForm,byte[] bBseData,int width,int height,COTSSample cursample)
-        {
-            InitializeComponent();
-            //this.xmlPath = xmlPath;
-            m_mainForm = mainForm;
-
-            m_measureStatuWindow = mainForm.m_MessureStatuWindow ;
-
-            m_BseData = bBseData;
-            m_imageWidth = width;
-            m_imageHeight = height;
-            specialGray = cursample.GetMsrParams().GetSpecialGrayRangeParam();
-            //ShowXmlInfo();
-            ShowparamInfo();
-
-            //国际化
-            lan = new OTSCommon.Language(this);
-            table = lan.GetNameTable(this.Name);
-        }
-
-        //private void ShowXmlInfo()
-        //{
-
-        //     ds1 = XMLoperate.GetXMLRegList(xmlPath, "Member");
-        //    if (ds1.Tables.Count > 0)
-        //    {
-        //        dg1.DataSource = ds1.Tables[0];
-
-        //        var ds2 = XMLoperate.GetXMLRegList(xmlPath, "XMLData");
-
-        //        var ifrun = Convert.ToBoolean(ds2.Tables[0].Rows[0]["ToRun"]);
-
-        //        checkBox1.Checked = ifrun;
-
-        //    }
-            
-        //}
-        private void ShowparamInfo()
-        {
-
-            ds1 = new DataSet();
-            ds1.Tables.Clear();
-            ds1.Tables.Add();
-            var t = ds1.Tables[0];
-            t.Columns.Add("RegName");
-            t.Columns.Add("start");
-            t.Columns.Add("end");
-            t.Columns.Add("diameterStart");
-            t.Columns.Add("diameterEnd");
-            t.Columns.Add("collectXray");
-            foreach (var rang in specialGray.GetSpecialGreyRanges())
-            {
-              var r= t.Rows.Add();
-               
-                r["RegName"]=rang.rngname;
-               r["start"]=rang.range.GetStart().ToString();
-                r["end"]=rang.range.GetEnd().ToString();
-                r["diameterStart"]=rang.diameterRange.GetStart().ToString();
-                r["diameterEnd"]=rang.diameterRange.GetEnd().ToString();
-                r["collectXray"]=rang.ifCollectXray.ToString();
-             
-            }
-
-
-
-
-
-             
-            if (ds1.Tables.Count > 0)
-            {
-                dg1.DataSource = ds1.Tables[0];
-
-                //var ds2 = XMLoperate.GetXMLRegList(xmlPath, "XMLData");
-
-                //var ifrun = Convert.ToBoolean(ds2.Tables[0].Rows[0]["ToRun"]);
-
-               
-
-            }
-
-            checkBox1.Checked = specialGray.IsToRun;
-
-        }
-
-
-
-
-
-        private void button1_Click(object sender, EventArgs e)
-        {
-            if (ds1.Tables.Count == 0)
-            {
-                
-                var t = new DataTable();
-                t.Columns.Add(new DataColumn("RegName"));
-                t.Columns.Add(new DataColumn("start"));
-                t.Columns.Add(new DataColumn("end"));
-                t.Columns.Add(new DataColumn("diameterStart"));
-                t.Columns.Add(new DataColumn("diameterEnd"));
-                t.Columns.Add(new DataColumn("collectXray"));
-                ds1.Tables.Add(t);
-            }
-            var nr = ds1.Tables[0].NewRow();
-
-            nr["RegName"] = str_RegName;
-            nr["start"] = str_start;
-            nr["end"] = str_end;
-            nr["diameterStart"] = str_diameterStart;
-            nr["diameterEnd"] = str_diameterEnd;
-            nr["collectXray"] = "false";
-           
-            ds1.Tables[0].Rows.Add(nr);
-            dg1.DataSource = ds1.Tables[0];
-
-        }
-
-        private void button3_Click(object sender, EventArgs e)
-        {
-            if (ds1.Tables[0].Rows.Count > 0)
-            {
-                ds1.Tables[0].Rows.RemoveAt(dg1.CurrentRow.Index);
-            }
-           
-        }
-
-        private void dg1_CellContentClick(object sender, DataGridViewCellEventArgs e)
-        {
-            if (dg1.Columns[e.ColumnIndex].Name == "rangeChoose" && e.RowIndex >= 0)
-            {
-                frmSpecialGrayParticle toolWindow = new frmSpecialGrayParticle(m_mainForm, m_measureStatuWindow);
-                int grayStart = 0;
-                int grayEnd = 0;
-                if (m_BseData != null)
-                {
-                    Bitmap bitmap = CImageHandler.ToGrayBitmap(m_BseData, m_imageWidth, m_imageHeight);
-                    toolWindow.BseImg = bitmap;
-                    toolWindow.SetBBseData(m_BseData);
-     
-                    grayStart = Convert.ToInt32( dg1.Rows[e.RowIndex].Cells["start"].Value);
-                    grayEnd = Convert.ToInt32(dg1.Rows[e.RowIndex].Cells["end"].Value);
-                    //设置可视化中的属性
-                    toolWindow.BseGrayMinValue = grayStart;
-                    toolWindow.BseGrayMaxValue = grayEnd;
-                }
-                DialogResult dialogResult = toolWindow.ShowDialog();
-                if (dialogResult == DialogResult.OK)
-                {
-                    dg1.Rows[e.RowIndex].Cells["start"].Value = toolWindow.BseGrayMinValue;
-                    dg1.Rows[e.RowIndex].Cells["end"].Value = toolWindow.BseGrayMaxValue;
-                }
-
-            }
-        }
-
-        private void confirm_Click(object sender, EventArgs e)
-        {
-            var rngs = specialGray.GetSpecialGreyRanges();
-            rngs.Clear();
-            for (int i = 0;i< dg1.Rows.Count; i++)
-            {
-
-                //设置参数
-                CSpecialGrayRange specialRng = new CSpecialGrayRange();
-                
-                specialRng.rngname = dg1.Rows[i].Cells["RegName"].Value.ToString();
-                specialRng.range.SetStart(Convert.ToInt32( dg1.Rows[i].Cells["start"].Value));
-                specialRng.range.SetEnd(Convert.ToInt32(dg1.Rows[i].Cells["end"].Value));
-                specialRng.diameterRange.SetStart(Convert.ToInt32(dg1.Rows[i].Cells["diameterStart"].Value));
-                specialRng.diameterRange.SetEnd(Convert.ToInt32(dg1.Rows[i].Cells["diameterEnd"].Value));
-                if (dg1.Rows[i].Cells["collectXray"].Value == DBNull.Value || dg1.Rows[i].Cells["collectXray"].Value.ToString().ToLower() == "false")
-                {
-                    specialRng.ifCollectXray =false;
-                }
-                else
-                {
-                    specialRng.ifCollectXray =true;
-                }
-
-               
-                rngs.Add(specialRng);    
-              
-
-            }
-            specialGray.SetSpecailGrayRanges(rngs);
-            specialGray.IsToRun=checkBox1.Checked;
-
-            //XMLoperate.UpdateSpecialGrayXMLFile(xmlPath, dg1, checkBox1.Checked);
-            this.Close();
-
-        }
-
-        private void button2_Click(object sender, EventArgs e)
-        {
-            this.Close();
-        }
-
-      
-    }
-}

+ 0 - 141
OTSIncAMeasureApp/7-OTSProgMgrInfo/SpecialParticleForm.resx

@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <metadata name="RegName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="start.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="end.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="diameterStart.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="diameterEnd.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="collectXray.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="rangeChoose.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-</root>

+ 3 - 3
OTSIncAMeasureApp/OTSIncAMeasureApp.csproj

@@ -444,10 +444,10 @@
     <Compile Include="7-OTSProgMgrInfo\OtherSelection.Designer.cs">
       <DependentUpon>OtherSelection.cs</DependentUpon>
     </Compile>
-    <Compile Include="7-OTSProgMgrInfo\SpecialParticleForm.cs">
+    <Compile Include="5-OTSMeasureStatuImageFun\SpecialParticleForm.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="7-OTSProgMgrInfo\SpecialParticleForm.Designer.cs">
+    <Compile Include="5-OTSMeasureStatuImageFun\SpecialParticleForm.Designer.cs">
       <DependentUpon>SpecialParticleForm.cs</DependentUpon>
     </Compile>
     <Compile Include="7-OTSProgMgrInfo\Stage\DlgStageEdit.cs">
@@ -697,7 +697,7 @@
     <EmbeddedResource Include="7-OTSProgMgrInfo\OtherSelection.resx">
       <DependentUpon>OtherSelection.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="7-OTSProgMgrInfo\SpecialParticleForm.resx">
+    <EmbeddedResource Include="5-OTSMeasureStatuImageFun\SpecialParticleForm.resx">
       <DependentUpon>SpecialParticleForm.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="7-OTSProgMgrInfo\Stage\DlgStageEdit.resx">