using OTSDataType; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml; namespace OTSModelSharp { public class COTSGeneralParam : ISlo { //--------------------definition------------- int m_StdLibTypeIndex; 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; bool m_bSysSTD; int m_steelTechnologyl; string m_sSTDSelect; otsdataconst.DOMAIN_SHAPE m_nDefaultShape; otsdataconst.MEMBRANE_TYPE m_DefaultmembraneType; bool m_AutoBeamOff; /// /// AutoBeamOff:自动关高压开关 /// public bool AutoBeamOff { set { m_AutoBeamOff = value; } get { return m_AutoBeamOff; } } //--------------------public----------------- public COTSGeneralParam() { Init(); } public COTSGeneralParam(COTSGeneralParam a_oSource) { // can't copy itself if (a_oSource == this) { return; } // copy data over Duplicate(a_oSource); } public bool Equals(COTSGeneralParam 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_StdLibTypeIndex == a_oSource.m_StdLibTypeIndex) && (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 GetPartStdLibTypeIndex() { return m_StdLibTypeIndex; } public void SetPartStdLibTypeIndex(int a_index) { m_StdLibTypeIndex = a_index; } 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 bool GetSysSTD() { return m_bSysSTD; } public void SetSysSTD(bool a_bSysSTD) { m_bSysSTD = 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_StdLibTypeIndex = 0; 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_bSysSTD = false; m_steelTechnologyl = 0; m_sSTDSelect = (""); m_AutoBeamOff = false; } protected void Duplicate(COTSGeneralParam 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_StdLibTypeIndex = a_oSource.m_StdLibTypeIndex; 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_bSysSTD = a_oSource.m_bSysSTD; m_steelTechnologyl = a_oSource.m_steelTechnologyl; m_sSTDSelect = a_oSource.m_sSTDSelect; } 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(); xBool xbUseSysSTD = new xBool(); 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("StdLibTypeIndex", xnStdLibTypeIndex); slo.Register("StdLibFileName", xstrSTDSelect); slo.Register("SteelTechnology", xnSteelTechnology); slo.Register("DefaultShape", xnDefaultShape); slo.Register("UseSysSTD", xbUseSysSTD); 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); xnStdLibTypeIndex.AssignValue(m_StdLibTypeIndex); xnSteelTechnology.AssignValue(m_steelTechnologyl); xnDefaultShape.AssignValue((int)m_nDefaultShape); xbUseSysSTD.AssignValue(m_bSysSTD); 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_StdLibTypeIndex = xnStdLibTypeIndex.value(); m_steelTechnologyl = xnSteelTechnology.value(); m_nDefaultShape = (otsdataconst.DOMAIN_SHAPE)xnDefaultShape.value(); m_bSysSTD =Convert.ToBoolean(xbUseSysSTD.toString()); m_dDefaultArea = xbDefaultArea.value(); m_nPropertyDisplayMode= xnPropertyDisplayMode.value(); } } } }