using System;
|
using System.Collections.Generic;
|
|
namespace TProduct.PumpGraph.Dxf
|
{
|
public class JieZhiFullPara : Eventech.Model.IJsonString//实际就是TProduct.Model.JieZhiFullPara
|
{
|
public JieZhiFullPara()
|
{
|
this.CatalogID = 1;
|
this.ID = 1;
|
this.Name = "清水";
|
this.MinDensity = "1000";//kg/m³
|
this.NormalDensity = "1000";//kg/m³
|
this.MaxDensity = "1000";//kg/m³
|
this.CalcDensity = 1000;//kg/m³
|
|
this.MinViscosity = "1";//cSt(mm²/s)
|
this.NormalViscosity = "1";//cSt(mm²/s)
|
this.MaxViscosity = "1";//cSt(mm²/s)
|
this.CalcViscosity = 1;
|
|
this.MaxTemperature = "20";//℃
|
this.NormalTemperature = "20";//℃
|
this.MinTemperature = "20";//℃
|
this.VisoCorrectCoeff = null;
|
this.PH = "7";
|
}
|
//默认介质
|
public static JieZhiFullPara Default
|
{
|
get
|
{
|
JieZhiFullPara defaultJieZi = new JieZhiFullPara();
|
defaultJieZi.CatalogID = 1;
|
defaultJieZi.ID = 1;
|
defaultJieZi.Name = "清水";
|
|
defaultJieZi.MinDensity = "1000";//kg/m³
|
defaultJieZi.NormalDensity = "1000";//kg/m³
|
defaultJieZi.MaxDensity = "1000";//kg/m³
|
defaultJieZi.CalcDensity = 1000;//kg/m³
|
|
defaultJieZi.MinViscosity = "1";//cSt(mm²/s)
|
defaultJieZi.NormalViscosity = "1";//cSt(mm²/s)
|
defaultJieZi.MaxViscosity = "1";//cSt(mm²/s)
|
defaultJieZi.CalcViscosity = 1;
|
|
defaultJieZi.MaxTemperature = "20";//℃
|
defaultJieZi.NormalTemperature = "20";//℃
|
defaultJieZi.MinTemperature = "20";//℃
|
|
defaultJieZi.MaxVaporPressure = "/";
|
defaultJieZi.MinVaporPressure = "/";
|
defaultJieZi.NormalVaporPressure = "/";
|
|
defaultJieZi.SpecificHeat = "/";
|
defaultJieZi.PH = "7";
|
return defaultJieZi;
|
}
|
}
|
|
public JieZhiFullPara(string jsonString)
|
{
|
FromJsonString(jsonString);
|
}
|
public bool IsWaterDensity
|
{
|
get
|
{
|
if (Math.Abs(CalcDensity - 1000) < 10)
|
return true;
|
else
|
return false;
|
}
|
}
|
|
//获取 比重
|
public double GetBiZhong()
|
{
|
return CalcDensity / 1000;
|
}
|
|
//获取 温度
|
public double GetTemperature()
|
{
|
try
|
{
|
if (!string.IsNullOrEmpty(this.NormalTemperature))
|
{
|
return Convert.ToDouble(this.NormalTemperature);
|
}
|
if (!string.IsNullOrEmpty(this.MaxTemperature))
|
{
|
return Convert.ToDouble(this.MaxTemperature);
|
}
|
if (!string.IsNullOrEmpty(this.MinTemperature))
|
{
|
return Convert.ToDouble(this.MinTemperature);
|
}
|
return 20;
|
}
|
catch
|
{
|
return 20;
|
}
|
}
|
|
#region 属性
|
|
public long ID
|
{
|
get { return _id; }
|
set { _id = value; }
|
}
|
private long _id = 0;
|
|
private long _catalogID = 0;
|
|
public long CatalogID
|
{
|
get { return _catalogID; }
|
set { _catalogID = value; }
|
}
|
|
|
public string Name
|
{
|
get { return _name; }
|
set { _name = value; }
|
}
|
private string _name;
|
|
// 1厘泊(1cP)=1毫帕斯卡 .秒 (1mPa.s)
|
// 1泊(P)= 0.1帕*秒(Pa*S)
|
// 1厘泊(CP)= 0.01泊(P)= 1毫帕*秒(mPa*S)
|
//1 CSt =Eventech.Model.UnitViscosity.CP*1000/比重
|
|
public int ViscosityUnit { get; set; }//黏度单位: Eventech.Model.UnitViscosity.CSt =0; Eventech.Model.UnitViscosity.CP=5
|
|
public string NormalViscosity { get; set; }//额定粘度
|
|
public string MinViscosity { get; set; }//最小粘度
|
|
public string MaxViscosity { get; set; }//最大粘度
|
|
|
public double CalcViscosity { get; set; }//用于选型的粘度(cSt)
|
|
|
public string MinTemperature { get; set; }//最小温度
|
|
public string NormalTemperature { get; set; }//额定温度
|
|
public string MaxTemperature { get; set; }//最大温度
|
|
public string MinDensity { get; set; }//最小密度
|
|
public string NormalDensity { get; set; }//额定密度
|
|
public string MaxDensity { get; set; }//最大密度
|
|
|
public double CalcDensity { get; set; }//用于选型的密度
|
|
|
public string MinVaporPressure { get; set; }//最小气化压力(Bar)
|
|
public string NormalVaporPressure { get; set; }//额定气化压力(Bar)
|
|
public string MaxVaporPressure { get; set; }//最大气化压力(Bar)
|
|
//气化压力转成KPa
|
public string Disp_VaporPressure_KPa()
|
{
|
try
|
{
|
double vapar = 0;
|
if (!string.IsNullOrEmpty(MaxVaporPressure))
|
{
|
if (double.TryParse(MaxVaporPressure, out vapar))
|
{
|
return (vapar * 100).ToString();
|
}
|
}
|
|
if (!string.IsNullOrEmpty(NormalVaporPressure))
|
{
|
if (double.TryParse(NormalVaporPressure, out vapar))
|
{
|
return (vapar * 100).ToString();
|
}
|
}
|
|
if (!string.IsNullOrEmpty(MinVaporPressure))
|
{
|
if (double.TryParse(MinVaporPressure, out vapar))
|
{
|
return (vapar * 100).ToString();
|
}
|
}
|
|
|
return "";
|
}
|
catch
|
{
|
return "";
|
}
|
}
|
|
|
//黏度修正系数
|
public Eventech.Model.ViscosityCorrectCoeff VisoCorrectCoeff { get; set; }
|
|
//比热
|
public string SpecificHeat { get; set; }
|
|
|
public string PH
|
{
|
get { return _ph; }
|
set { _ph = value; }
|
}
|
private string _ph = "7";
|
|
#region 颗粒
|
//是否含有颗粒
|
private string _isHaveKeLi4Ds = "0";
|
|
public string IsHaveKeLi4Ds
|
{
|
get { return _isHaveKeLi4Ds; }
|
set { _isHaveKeLi4Ds = value; }
|
}
|
public bool IsHaveKeLi
|
{
|
get
|
{
|
if (string.IsNullOrEmpty(_isHaveKeLi4Ds))
|
return false;
|
if (_isHaveKeLi4Ds == "1")
|
return true;
|
else
|
return false;
|
}
|
}
|
//颗粒百分比
|
private string _keliRatio;
|
|
public string KeliRatio
|
{
|
get { return _keliRatio; }
|
set { _keliRatio = value; }
|
}
|
//颗粒尺寸(mm)
|
private string _keliChiCun = "";
|
|
public string KeliChiCun
|
{
|
get { return _keliChiCun; }
|
set { _keliChiCun = value; }
|
}
|
#endregion
|
|
//含固量
|
|
public string HanGuLiang
|
{
|
set { _hanguliang = value; }
|
get { return _hanguliang; }
|
}
|
|
//腐蚀成分
|
private string _fuShiChengFeng;
|
|
public string FuShiChengFeng
|
{
|
get { return _fuShiChengFeng; }
|
set { _fuShiChengFeng = value; }
|
}
|
|
//腐蚀/磨蚀剂
|
private string _fuShiMoShiJi;
|
|
public string FuShiMoShiJi
|
{
|
get { return _fuShiMoShiJi; }
|
set { _fuShiMoShiJi = value; }
|
}
|
|
//腐蚀
|
|
public string FuShi
|
{
|
set { _fushi = value; }
|
get { return _fushi; }
|
}
|
public string _fushi = null;
|
public string FuShiString
|
{
|
get
|
{
|
if (_fushi == "1")
|
return "是";
|
else
|
return "否";
|
}
|
}
|
|
//磨蚀
|
|
public string MoShi
|
{
|
set { _moshi = value; }
|
get { return _moshi; }
|
}
|
public string _moshi = null;
|
public string MoShiString
|
{
|
get
|
{
|
if (_moshi == "1")
|
return "是";
|
else
|
return "否";
|
}
|
}
|
|
//有毒
|
|
public string YouDu
|
{
|
set { _youdu = value; }
|
get { return _youdu; }
|
}
|
public string _youdu = null;
|
public string YouDuString
|
{
|
get
|
{
|
if (_youdu == "1")
|
return "是";
|
else
|
return "否";
|
}
|
}
|
|
//易燃
|
|
public string YiRan { get; set; }
|
|
//易爆
|
|
public string YiBao { get; set; }
|
|
//介质特性
|
private string _hanguliang;
|
|
public string JieZhiTeXing
|
{
|
set { _jiezhitexing = value; }
|
get { return _jiezhitexing; }
|
}
|
private string _jiezhitexing;
|
|
//浓度
|
|
public string Concentration { get; set; }
|
|
//离子成分H
|
|
public string LiZhiNongDuH
|
{
|
set { _lizhinongduh = value; }
|
get { return _lizhinongduh; }
|
}
|
private string _lizhinongduh;
|
//离子成分CL
|
|
public string LiZhiNongDuCL
|
{
|
set { _lizhinongducl = value; }
|
get { return _lizhinongducl; }
|
}
|
private string _lizhinongducl;
|
//离子成分F
|
|
public string LiZhiNongDuF
|
{
|
set { _lizhinongduf = value; }
|
get { return _lizhinongduf; }
|
}
|
private string _lizhinongduf;
|
//离子成分SO4
|
|
public string LiZhiNongDuSO4
|
{
|
set { _lizhinongduso4 = value; }
|
get { return _lizhinongduso4; }
|
}
|
private string _lizhinongduso4;
|
//离子成分NO3
|
|
public string LiZhiNongDuNO3
|
{
|
set { _lizhinongduno3 = value; }
|
get { return _lizhinongduno3; }
|
}
|
private string _lizhinongduno3;
|
//硫化氢浓度
|
|
public string NongDuH2S { get; set; }
|
|
//其他物质名称/浓度 (名称)
|
|
public string NongDuOtherName { get; set; }
|
//其他物质名称/浓度 (浓度)
|
|
public string NongDuOtherPercent { get; set; }
|
|
|
|
#endregion
|
|
public string ToJsonString()
|
{
|
Dictionary<string, string> dict = new Dictionary<string, string>();
|
dict["ID"] = this.ID.ToString();
|
dict["CatID"] = this.CatalogID.ToString();
|
|
dict["Name"] = this.Name.ToString();
|
|
dict["MD"] = this.CalcDensity.ToString();
|
dict["ND"] = this.CalcViscosity.ToString();
|
|
if (!string.IsNullOrEmpty(PH))
|
dict["PH"] = this.PH.ToString();
|
if (!string.IsNullOrEmpty(IsHaveKeLi4Ds))
|
dict["HKL"] = this.IsHaveKeLi4Ds.ToString();
|
if (!string.IsNullOrEmpty(this._keliRatio))
|
dict["HKR"] = this._keliRatio.ToString();
|
if (!string.IsNullOrEmpty(_fuShiChengFeng))
|
dict["FSCF"] = this._fuShiChengFeng.ToString();
|
if (!string.IsNullOrEmpty(this.JieZhiTeXing))
|
dict["TX"] = this.JieZhiTeXing;
|
if (!string.IsNullOrEmpty(this.HanGuLiang))
|
dict["HGL"] = this.HanGuLiang.ToString();
|
if (!string.IsNullOrEmpty(this.LiZhiNongDuH))
|
dict["LzndH"] = this.LiZhiNongDuH.ToString();
|
if (!string.IsNullOrEmpty(this.LiZhiNongDuCL))
|
dict["LzndCL"] = this.LiZhiNongDuCL.ToString();
|
if (!string.IsNullOrEmpty(this.LiZhiNongDuF))
|
dict["LzndF"] = this.LiZhiNongDuF.ToString();
|
if (!string.IsNullOrEmpty(this.LiZhiNongDuSO4))
|
dict["LzndSO4"] = this.LiZhiNongDuSO4.ToString();
|
if (!string.IsNullOrEmpty(this.LiZhiNongDuNO3))
|
dict["LzndNO3"] = this.LiZhiNongDuNO3.ToString();
|
if (!string.IsNullOrEmpty(FuShi))
|
dict["FuShi"] = this.FuShi.ToString();
|
if (!string.IsNullOrEmpty(FuShiMoShiJi))
|
dict["FSMSJ"] = this.FuShiMoShiJi.ToString();
|
|
|
if (!string.IsNullOrEmpty(MoShi))
|
dict["MoShi"] = this.MoShi.ToString();
|
if (!string.IsNullOrEmpty(YouDu))
|
dict["YouDu"] = this.YouDu.ToString();
|
if (!string.IsNullOrEmpty(YiRan))
|
dict["YiRan"] = this.YiRan.ToString();
|
if (!string.IsNullOrEmpty(YiBao))
|
dict["YiBao"] = this.YiBao.ToString();
|
|
if (!string.IsNullOrEmpty(NongDuH2S))
|
dict["HSA"] = this.NongDuH2S;
|
if (!string.IsNullOrEmpty(SpecificHeat))
|
dict["SHA"] = this.SpecificHeat;
|
|
if (!string.IsNullOrEmpty(NormalViscosity))
|
dict["RatVA"] = this.NormalViscosity;
|
if (!string.IsNullOrEmpty(MaxViscosity))
|
dict["MaxVA"] = this.MaxViscosity;
|
if (!string.IsNullOrEmpty(MinViscosity))
|
dict["MinVA"] = this.MinViscosity;
|
|
if (!string.IsNullOrEmpty(NormalDensity))
|
dict["RatDA"] = this.NormalDensity;
|
if (!string.IsNullOrEmpty(MinDensity))
|
dict["MinDA"] = this.MinDensity;
|
if (!string.IsNullOrEmpty(MaxDensity))
|
dict["MaxDA"] = this.MaxDensity;
|
|
if (!string.IsNullOrEmpty(MaxVaporPressure))
|
dict["MaxVP"] = this.MaxVaporPressure;
|
if (!string.IsNullOrEmpty(NormalVaporPressure))
|
dict["RatVP"] = this.NormalVaporPressure;
|
if (!string.IsNullOrEmpty(MinVaporPressure))
|
dict["MinVP"] = this.MinVaporPressure;
|
|
if (!string.IsNullOrEmpty(MinTemperature))
|
dict["MinTA"] = this.MinTemperature;
|
if (!string.IsNullOrEmpty(MaxTemperature))
|
dict["MaxTA"] = this.MaxTemperature;
|
if (!string.IsNullOrEmpty(NormalTemperature))
|
dict["RatTA"] = this.NormalTemperature;
|
|
if (!string.IsNullOrEmpty(Concentration))
|
dict["CAC"] = this.Concentration;
|
if (!string.IsNullOrEmpty(NongDuOtherPercent))
|
dict["OTA"] = this.NongDuOtherPercent;
|
if (!string.IsNullOrEmpty(NongDuOtherName))
|
dict["OCA"] = this.NongDuOtherName;
|
if (!string.IsNullOrEmpty(KeliChiCun))
|
dict["KLC"] = this.KeliChiCun;
|
|
if (VisoCorrectCoeff != null)
|
{
|
dict["VCCF"] = this.VisoCorrectCoeff.ToDsString();
|
}
|
string json = (new System.Web.Script.Serialization.JavaScriptSerializer()).Serialize(dict);
|
|
return json;
|
}
|
|
public void FromJsonString(string jsonString)
|
{
|
if (string.IsNullOrEmpty(jsonString))
|
return;
|
Dictionary<string, string> dict = (new System.Web.Script.Serialization.JavaScriptSerializer()).Deserialize(jsonString, typeof(Dictionary<string, string>)) as Dictionary<string, string>;
|
|
if (dict.ContainsKey("ID"))
|
this.ID = Convert.ToInt64(dict["ID"]);
|
if (dict.ContainsKey("CatID"))
|
this.CatalogID = Convert.ToInt64(dict["CatID"]);
|
if (dict.ContainsKey("Name"))
|
this.Name = dict["Name"];
|
|
if (dict.ContainsKey("MD"))
|
{
|
double de = 0;
|
if (double.TryParse(dict["MD"], out de))
|
this.CalcDensity = de;
|
}
|
|
if (dict.ContainsKey("ND"))
|
{
|
double de = 0;
|
if (double.TryParse(dict["ND"], out de))
|
this.CalcViscosity = de;
|
}
|
|
if (dict.ContainsKey("PH"))
|
this.PH = dict["PH"];
|
if (dict.ContainsKey("HKL"))
|
this.IsHaveKeLi4Ds = dict["HKL"]; //是否含有颗粒
|
if (dict.ContainsKey("HKR"))
|
this._keliRatio = dict["HKR"]; //颗粒百分比
|
if (dict.ContainsKey("KLC"))
|
this.KeliChiCun = dict["KLC"];
|
|
if (dict.ContainsKey("FSCF"))
|
this._fuShiChengFeng = dict["FSCF"]; //腐蚀成分
|
|
if (dict.ContainsKey("TX"))
|
this.JieZhiTeXing = dict["TX"];
|
if (dict.ContainsKey("HGL"))
|
this.HanGuLiang = dict["HGL"];
|
if (dict.ContainsKey("LzndH"))
|
this.LiZhiNongDuH = dict["LzndH"];
|
if (dict.ContainsKey("LzndCL"))
|
this.LiZhiNongDuCL = dict["LzndCL"];
|
if (dict.ContainsKey("LzndF"))
|
this.LiZhiNongDuF = dict["LzndF"];
|
if (dict.ContainsKey("LzndSO4"))
|
this.LiZhiNongDuSO4 = dict["LzndSO4"];
|
if (dict.ContainsKey("LzndNO3"))
|
this.LiZhiNongDuNO3 = dict["LzndNO3"];
|
if (dict.ContainsKey("FuShi"))
|
this.FuShi = dict["FuShi"];
|
if (dict.ContainsKey("MoShi"))
|
this.MoShi = dict["MoShi"];
|
if (dict.ContainsKey("YouDu"))
|
this.YouDu = dict["YouDu"];
|
if (dict.ContainsKey("YiRan"))
|
this.YiRan = dict["YiRan"];
|
if (dict.ContainsKey("YiBao"))
|
this.YiBao = dict["YiBao"];
|
|
|
|
|
if (dict.ContainsKey("OCA"))
|
this.NongDuOtherPercent = dict["OCA"];
|
if (dict.ContainsKey("FSMSJ"))
|
this.FuShiMoShiJi = dict["FSMSJ"];
|
|
if (dict.ContainsKey("CAC"))
|
this.Concentration = dict["CAC"];
|
|
if (dict.ContainsKey("HSA"))
|
this.NongDuH2S = dict["HSA"];
|
if (dict.ContainsKey("SHA"))
|
this.SpecificHeat = dict["SHA"];
|
if (dict.ContainsKey("OTA"))
|
this.NongDuOtherName = dict["OTA"];
|
|
|
if (dict.ContainsKey("RatVA"))
|
this.NormalViscosity = dict["RatVA"];
|
if (dict.ContainsKey("MaxVA"))
|
this.MaxViscosity = dict["MaxVA"];
|
if (dict.ContainsKey("MinVA"))
|
this.MinViscosity = dict["MinVA"];
|
|
if (dict.ContainsKey("RatDA"))
|
this.NormalDensity = dict["RatDA"];
|
if (dict.ContainsKey("MaxDA"))
|
this.MaxDensity = dict["MaxDA"];
|
if (dict.ContainsKey("MinDA"))
|
this.MinDensity = dict["MinDA"];
|
|
|
if (dict.ContainsKey("RatVP"))
|
this.NormalVaporPressure = dict["RatVP"];
|
if (dict.ContainsKey("MaxVP"))
|
this.MaxVaporPressure = dict["MaxVP"];
|
if (dict.ContainsKey("MinVP"))
|
this.MinVaporPressure = dict["MinVP"];
|
|
if (dict.ContainsKey("RatTA"))
|
this.NormalTemperature = dict["RatTA"];
|
if (dict.ContainsKey("MaxTA"))
|
this.MaxTemperature = dict["MaxTA"];
|
if (dict.ContainsKey("MinTA"))
|
this.MinTemperature = dict["MinTA"];
|
|
if (dict.ContainsKey("VCCF") && !string.IsNullOrEmpty(dict["VCCF"]))
|
{
|
this.VisoCorrectCoeff = new Eventech.Model.ViscosityCorrectCoeff(dict["VCCF"]);
|
}
|
}
|
|
public override string ToString()
|
{
|
return this.Name;
|
//return base.ToString();
|
}
|
}
|
}
|