|
@@ -0,0 +1,348 @@
|
|
|
+using OTSDataType;
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+using System.Text;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using System.Xml;
|
|
|
+using static OTSDataType.otsdataconst;
|
|
|
+
|
|
|
+namespace OTSModelSharp
|
|
|
+{
|
|
|
+ public class COTSCommonParam : ISlo
|
|
|
+ {
|
|
|
+ //--------------------definition-------------
|
|
|
+
|
|
|
+ double m_dDefaultArea;
|
|
|
+ int m_nPropertyDisplayMode;
|
|
|
+ bool m_bMeasSwitch;
|
|
|
+ string m_strDefaultSampleName;
|
|
|
+ string m_strMeasParamFileFolderName;
|
|
|
+ string m_strPartSTDLibFolderName;
|
|
|
+ string m_strLaboratoty;
|
|
|
+ string m_strAnalysisReferenceNumber;
|
|
|
+ string m_strCustomerName;
|
|
|
+ string m_strSampleDescription;
|
|
|
+ string m_strOperatorName;
|
|
|
+ string m_strComment;
|
|
|
+ OTS_CLASSIFY_ENGINE_TYPE m_EngineType=OTS_CLASSIFY_ENGINE_TYPE.InclutionPlusExpressionParse;
|
|
|
+ int m_steelTechnologyl;
|
|
|
+ string m_sSTDSelect;
|
|
|
+ otsdataconst.DOMAIN_SHAPE m_nDefaultShape;
|
|
|
+
|
|
|
+ otsdataconst.MEMBRANE_TYPE m_DefaultmembraneType;
|
|
|
+
|
|
|
+ bool m_AutoBeamOff;
|
|
|
+ /// <summary>
|
|
|
+ /// AutoBeamOff:自动关高压开关
|
|
|
+ /// </summary>
|
|
|
+ public bool AutoBeamOff
|
|
|
+ {
|
|
|
+ set
|
|
|
+ {
|
|
|
+ m_AutoBeamOff = value;
|
|
|
+ }
|
|
|
+ get
|
|
|
+ {
|
|
|
+ return m_AutoBeamOff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //--------------------public-----------------
|
|
|
+ public COTSCommonParam()
|
|
|
+ {
|
|
|
+ Init();
|
|
|
+ }
|
|
|
+ public COTSCommonParam(COTSCommonParam a_oSource)
|
|
|
+ {
|
|
|
+ // can't copy itself
|
|
|
+ if (a_oSource == this)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // copy data over
|
|
|
+ Copyfrom(a_oSource);
|
|
|
+ }
|
|
|
+ public bool Equals(COTSCommonParam a_oSource)
|
|
|
+ {
|
|
|
+ // return test result
|
|
|
+
|
|
|
+ return ((m_strDefaultSampleName.ToLower().IndexOf(a_oSource.m_strDefaultSampleName) == 0) &&
|
|
|
+ (m_bMeasSwitch == a_oSource.m_bMeasSwitch) &&
|
|
|
+ (m_strMeasParamFileFolderName.ToLower().IndexOf(a_oSource.m_strMeasParamFileFolderName) == 0) &&
|
|
|
+ (m_strPartSTDLibFolderName.ToLower().IndexOf(a_oSource.m_strPartSTDLibFolderName) == 0)) &&
|
|
|
+ (m_DefaultmembraneType == a_oSource.m_DefaultmembraneType) &&
|
|
|
+ (m_nDefaultShape == a_oSource.m_nDefaultShape) &&
|
|
|
+ (m_dDefaultArea == a_oSource.m_dDefaultArea) &&
|
|
|
+ (m_nPropertyDisplayMode == a_oSource.m_nPropertyDisplayMode);
|
|
|
+ }
|
|
|
+ public string GetSampleName()
|
|
|
+ {
|
|
|
+ return m_strDefaultSampleName;
|
|
|
+ }
|
|
|
+ public void SetSampleName(string a_strDefaultSampleName)
|
|
|
+ {
|
|
|
+ m_strDefaultSampleName = a_strDefaultSampleName;
|
|
|
+ }
|
|
|
+ public bool GetMeasurementSwitch()
|
|
|
+ {
|
|
|
+ return m_bMeasSwitch;
|
|
|
+ }
|
|
|
+ public void SetMeasurementSwitch(bool a_bSwitch)
|
|
|
+ {
|
|
|
+ m_bMeasSwitch = a_bSwitch;
|
|
|
+ }
|
|
|
+ public string GetMsrParamFileFolderName()
|
|
|
+ {
|
|
|
+ return m_strMeasParamFileFolderName;
|
|
|
+ }
|
|
|
+ public void SetMsrParamFileFolderName(string a_sMeasParamFileFolderName)
|
|
|
+ {
|
|
|
+ m_strMeasParamFileFolderName = a_sMeasParamFileFolderName;
|
|
|
+ }
|
|
|
+ public string GetPartSTDLibFolderName()
|
|
|
+ {
|
|
|
+ return m_strPartSTDLibFolderName;
|
|
|
+ }
|
|
|
+ public void SetPartSTDLibFolderName(string a_strPartSTDLibFolderName)
|
|
|
+ {
|
|
|
+ m_strPartSTDLibFolderName = a_strPartSTDLibFolderName;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public int PropertyDisplayMode()
|
|
|
+ {
|
|
|
+ return m_nPropertyDisplayMode;
|
|
|
+ }
|
|
|
+ public string GetLaboratoty()
|
|
|
+ {
|
|
|
+ return m_strLaboratoty;
|
|
|
+ }
|
|
|
+ public void SetLaboratoty(string a_Laboratoty)
|
|
|
+ {
|
|
|
+ m_strLaboratoty = a_Laboratoty;
|
|
|
+ }
|
|
|
+ public string GetAnalysisReferenceNumber()
|
|
|
+ {
|
|
|
+ return m_strAnalysisReferenceNumber;
|
|
|
+ }
|
|
|
+ public void SetAnalysisReferenceNumber(string a_AnalysisReferenceNumber)
|
|
|
+ {
|
|
|
+ m_strAnalysisReferenceNumber = a_AnalysisReferenceNumber;
|
|
|
+ }
|
|
|
+ public string GetCustomerName()
|
|
|
+ {
|
|
|
+ return m_strCustomerName;
|
|
|
+ }
|
|
|
+ public void SetCustomerName(string a_CustomerName)
|
|
|
+ {
|
|
|
+ m_strCustomerName = a_CustomerName;
|
|
|
+ }
|
|
|
+ public string GetSampleDescription()
|
|
|
+ {
|
|
|
+ return m_strSampleDescription;
|
|
|
+ }
|
|
|
+ public void SetSampleDescription(string a_SampleDescription)
|
|
|
+ {
|
|
|
+ m_strSampleDescription = a_SampleDescription;
|
|
|
+ }
|
|
|
+ public string GetOperatorName()
|
|
|
+ {
|
|
|
+ return m_strOperatorName;
|
|
|
+ }
|
|
|
+ public void SetOperatorName(string a_OperatorName)
|
|
|
+ {
|
|
|
+ m_strOperatorName = a_OperatorName;
|
|
|
+ }
|
|
|
+ public string GetComment()
|
|
|
+ {
|
|
|
+ return m_strComment;
|
|
|
+ }
|
|
|
+ public void SetComment(string a_Comment)
|
|
|
+ {
|
|
|
+ m_strComment = a_Comment;
|
|
|
+ }
|
|
|
+ // measure area shape
|
|
|
+ public otsdataconst.DOMAIN_SHAPE GetShape()
|
|
|
+ {
|
|
|
+ return m_nDefaultShape;
|
|
|
+ }
|
|
|
+ public void SetShape(otsdataconst.DOMAIN_SHAPE a_nShape)
|
|
|
+ {
|
|
|
+ m_nDefaultShape = a_nShape;
|
|
|
+ }
|
|
|
+ // measure default value
|
|
|
+ public double GetArea()
|
|
|
+ {
|
|
|
+ return m_dDefaultArea;
|
|
|
+ }
|
|
|
+ public void SetArea(double a_dArea)
|
|
|
+ {
|
|
|
+ m_dDefaultArea = a_dArea;
|
|
|
+ }
|
|
|
+
|
|
|
+ public otsdataconst.MEMBRANE_TYPE GetMembraneType()
|
|
|
+ {
|
|
|
+ return m_DefaultmembraneType;
|
|
|
+ }
|
|
|
+ public void GetMembraneType(otsdataconst.MEMBRANE_TYPE val)
|
|
|
+ {
|
|
|
+ m_DefaultmembraneType = val;
|
|
|
+ }
|
|
|
+
|
|
|
+ public OTS_CLASSIFY_ENGINE_TYPE GetEngineType() { return m_EngineType; }
|
|
|
+ public void SetEngineType(OTS_CLASSIFY_ENGINE_TYPE a_bSysSTD) { m_EngineType = a_bSysSTD; }
|
|
|
+
|
|
|
+ public int GetSteelTechnology() { return m_steelTechnologyl; }
|
|
|
+ public void SetSteelTechnology(int a_steelTechnology) { m_steelTechnologyl = a_steelTechnology; }
|
|
|
+ public string GetSTDSelect() { return m_sSTDSelect; }
|
|
|
+ public void SetSTDSelect(string a_sSTDSelect) { m_sSTDSelect = a_sSTDSelect; }
|
|
|
+ //--------------------protected--------------
|
|
|
+ // initialization
|
|
|
+ protected void Init()
|
|
|
+ {
|
|
|
+ m_strDefaultSampleName = ("");
|
|
|
+ m_bMeasSwitch = true;
|
|
|
+ m_strMeasParamFileFolderName = ("");
|
|
|
+ m_strPartSTDLibFolderName = ("");
|
|
|
+
|
|
|
+ m_DefaultmembraneType = otsdataconst.MEMBRANE_TYPE.Abrasive;
|
|
|
+ m_nDefaultShape = (otsdataconst.DOMAIN_SHAPE)(-1);
|
|
|
+ m_dDefaultArea = 0;
|
|
|
+
|
|
|
+
|
|
|
+ m_nPropertyDisplayMode = 0;
|
|
|
+ m_strLaboratoty = ("");
|
|
|
+ m_strAnalysisReferenceNumber = ("");
|
|
|
+ m_strCustomerName = ("");
|
|
|
+ m_strSampleDescription = ("");
|
|
|
+ m_strOperatorName = ("");
|
|
|
+ m_strComment = ("");
|
|
|
+ m_EngineType = OTS_CLASSIFY_ENGINE_TYPE.InclustionEngine;
|
|
|
+ m_steelTechnologyl = 0;
|
|
|
+ m_sSTDSelect = ("");
|
|
|
+
|
|
|
+ m_AutoBeamOff = false;
|
|
|
+ }
|
|
|
+ protected void Copyfrom(COTSCommonParam a_oSource)
|
|
|
+ {
|
|
|
+ // initialization
|
|
|
+ Init();
|
|
|
+ // copy data over
|
|
|
+ m_strDefaultSampleName = a_oSource.m_strDefaultSampleName;
|
|
|
+ m_bMeasSwitch = a_oSource.m_bMeasSwitch;
|
|
|
+ m_strMeasParamFileFolderName = a_oSource.m_strMeasParamFileFolderName;
|
|
|
+ m_strPartSTDLibFolderName = a_oSource.m_strPartSTDLibFolderName;
|
|
|
+
|
|
|
+ m_DefaultmembraneType = a_oSource.m_DefaultmembraneType;
|
|
|
+ m_nDefaultShape = a_oSource.m_nDefaultShape;
|
|
|
+ m_dDefaultArea = a_oSource.m_dDefaultArea;
|
|
|
+
|
|
|
+ m_nPropertyDisplayMode = a_oSource.m_nPropertyDisplayMode;
|
|
|
+ m_strLaboratoty = a_oSource.m_strLaboratoty;
|
|
|
+ m_strAnalysisReferenceNumber = a_oSource.m_strAnalysisReferenceNumber;
|
|
|
+ m_strCustomerName = a_oSource.m_strCustomerName;
|
|
|
+ m_strSampleDescription = a_oSource.m_strSampleDescription;
|
|
|
+ m_strOperatorName = a_oSource.m_strOperatorName;
|
|
|
+ m_strComment = a_oSource.m_strComment;
|
|
|
+ m_EngineType = a_oSource.m_EngineType;
|
|
|
+ m_steelTechnologyl = a_oSource.m_steelTechnologyl;
|
|
|
+ m_sSTDSelect = a_oSource.m_sSTDSelect;
|
|
|
+ }
|
|
|
+ public COTSCommonParam duplicate()
|
|
|
+ {
|
|
|
+ COTSCommonParam a_oSource = this;
|
|
|
+ // initialization
|
|
|
+ COTSCommonParam prm= new COTSCommonParam();
|
|
|
+ // copy data over
|
|
|
+ prm. m_strDefaultSampleName = a_oSource.m_strDefaultSampleName;
|
|
|
+ prm.m_bMeasSwitch = a_oSource.m_bMeasSwitch;
|
|
|
+ prm.m_strMeasParamFileFolderName = a_oSource.m_strMeasParamFileFolderName;
|
|
|
+ prm.m_strPartSTDLibFolderName = a_oSource.m_strPartSTDLibFolderName;
|
|
|
+
|
|
|
+ prm.m_DefaultmembraneType = a_oSource.m_DefaultmembraneType;
|
|
|
+ prm.m_nDefaultShape = a_oSource.m_nDefaultShape;
|
|
|
+ prm.m_dDefaultArea = a_oSource.m_dDefaultArea;
|
|
|
+
|
|
|
+ prm.m_nPropertyDisplayMode = a_oSource.m_nPropertyDisplayMode;
|
|
|
+ prm.m_strLaboratoty = a_oSource.m_strLaboratoty;
|
|
|
+ prm.m_strAnalysisReferenceNumber = a_oSource.m_strAnalysisReferenceNumber;
|
|
|
+ prm.m_strCustomerName = a_oSource.m_strCustomerName;
|
|
|
+ prm.m_strSampleDescription = a_oSource.m_strSampleDescription;
|
|
|
+ prm.m_strOperatorName = a_oSource.m_strOperatorName;
|
|
|
+ prm.m_strComment = a_oSource.m_strComment;
|
|
|
+ prm.m_EngineType = a_oSource.m_EngineType;
|
|
|
+ prm.m_steelTechnologyl = a_oSource.m_steelTechnologyl;
|
|
|
+ prm.m_sSTDSelect = a_oSource.m_sSTDSelect;
|
|
|
+ return prm;
|
|
|
+ }
|
|
|
+
|
|
|
+ public override void Serialize(bool isStoring, XmlDocument classDoc, XmlNode rootNode)
|
|
|
+ {
|
|
|
+ xString xstrDefaultSampleName = new xString();
|
|
|
+ xBool xbMeasSwitch = new xBool();
|
|
|
+ xString xstrMeasParamFileFolderName = new xString();
|
|
|
+ xString xstrPartSTDLibFolderName = new xString();
|
|
|
+ xString xstrSTDSelect = new xString();
|
|
|
+ xInt xnStdLibTypeIndex = new xInt();
|
|
|
+ xInt xnSteelTechnology = new xInt();
|
|
|
+ xInt xnDefaultShape = new xInt();
|
|
|
+ xString xEngineType = new xString();
|
|
|
+ xDouble xbDefaultArea = new xDouble();
|
|
|
+ xInt xnPropertyDisplayMode = new xInt();
|
|
|
+ Slo slo = new Slo();
|
|
|
+ slo.Register("DefaultSampleName", xstrDefaultSampleName);
|
|
|
+ slo.Register("MeasSwitch", xbMeasSwitch);
|
|
|
+ slo.Register("MeasParamFileFolderName", xstrMeasParamFileFolderName);
|
|
|
+ slo.Register("PartSTDLibFolderName", xstrPartSTDLibFolderName);
|
|
|
+
|
|
|
+ slo.Register("StdLibFileName", xstrSTDSelect);
|
|
|
+ slo.Register("SteelTechnology", xnSteelTechnology);
|
|
|
+ slo.Register("DefaultShape", xnDefaultShape);
|
|
|
+ slo.Register("EngineType", xEngineType);
|
|
|
+ slo.Register("DefaultArea", xbDefaultArea);
|
|
|
+ slo.Register("PropertyDisplayMode", xnPropertyDisplayMode);
|
|
|
+
|
|
|
+ if (isStoring)
|
|
|
+ {
|
|
|
+ xstrDefaultSampleName.AssignValue(m_strDefaultSampleName);
|
|
|
+ xbMeasSwitch.AssignValue(m_bMeasSwitch);
|
|
|
+ xstrMeasParamFileFolderName.AssignValue(m_strMeasParamFileFolderName);
|
|
|
+ xstrPartSTDLibFolderName.AssignValue(m_strPartSTDLibFolderName);
|
|
|
+ xstrSTDSelect.AssignValue(m_sSTDSelect);
|
|
|
+
|
|
|
+ xnSteelTechnology.AssignValue(m_steelTechnologyl);
|
|
|
+ xnDefaultShape.AssignValue((int)m_nDefaultShape);
|
|
|
+ xEngineType.AssignValue((int)m_EngineType+":"+m_EngineType.ToString());
|
|
|
+ xbDefaultArea.AssignValue(m_dDefaultArea);
|
|
|
+ xnPropertyDisplayMode.AssignValue(m_nPropertyDisplayMode);
|
|
|
+
|
|
|
+ slo.Serialize(true, classDoc, rootNode);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ slo.Serialize(false, classDoc, rootNode);
|
|
|
+
|
|
|
+ m_strDefaultSampleName = xstrDefaultSampleName.value();
|
|
|
+ m_bMeasSwitch = Convert.ToBoolean(xbMeasSwitch.toString());
|
|
|
+ m_strMeasParamFileFolderName = xstrMeasParamFileFolderName.value();
|
|
|
+ m_strPartSTDLibFolderName = xstrPartSTDLibFolderName.value();
|
|
|
+ m_sSTDSelect = xstrSTDSelect.value();
|
|
|
+
|
|
|
+ m_steelTechnologyl = xnSteelTechnology.value();
|
|
|
+ m_nDefaultShape = (otsdataconst.DOMAIN_SHAPE)xnDefaultShape.value();
|
|
|
+ if (xEngineType.value().Split(':').Length > 1)
|
|
|
+ {
|
|
|
+ m_EngineType = (OTS_CLASSIFY_ENGINE_TYPE)Convert.ToInt32(xEngineType.value().Split(':')[0]);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ m_dDefaultArea = xbDefaultArea.value();
|
|
|
+ m_nPropertyDisplayMode= xnPropertyDisplayMode.value();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|