C# ngtools
This commit is contained in:
commit
2c0a9d7c49
BIN
.vs/NGTools/DesignTimeBuild/.dtbcache
Normal file
BIN
.vs/NGTools/DesignTimeBuild/.dtbcache
Normal file
Binary file not shown.
1035
.vs/NGTools/config/applicationhost.config
Normal file
1035
.vs/NGTools/config/applicationhost.config
Normal file
File diff suppressed because it is too large
Load Diff
BIN
.vs/NGTools/v16/.suo
Normal file
BIN
.vs/NGTools/v16/.suo
Normal file
Binary file not shown.
0
.vs/NGTools/v16/Server/sqlite3/db.lock
Normal file
0
.vs/NGTools/v16/Server/sqlite3/db.lock
Normal file
BIN
.vs/NGTools/v16/Server/sqlite3/storage.ide
Normal file
BIN
.vs/NGTools/v16/Server/sqlite3/storage.ide
Normal file
Binary file not shown.
1250
AGA8_10/Detail.cs
Normal file
1250
AGA8_10/Detail.cs
Normal file
File diff suppressed because it is too large
Load Diff
1811
AGA8_10/FlowCal.cs
Normal file
1811
AGA8_10/FlowCal.cs
Normal file
File diff suppressed because it is too large
Load Diff
163
AGA8_10/GB11062.cs
Normal file
163
AGA8_10/GB11062.cs
Normal file
@ -0,0 +1,163 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace NG_Tools
|
||||
{
|
||||
public class GB11062
|
||||
{
|
||||
|
||||
int iNCC;// number of components
|
||||
int[] aiCID = new int[21];// component IDs
|
||||
double[] dXi = new double[21];// mole fraction of component i
|
||||
Detail ptDetail;
|
||||
public GB11062()
|
||||
{
|
||||
|
||||
ptDetail = new Detail();
|
||||
for (int i = 0; i < NG_Cal.NUMBEROFCOMPONENTS; i++) dXi[i] = 0;
|
||||
|
||||
|
||||
}// Detail()
|
||||
public void Run(ref NG_Cal.GasPropsSTRUCT ptAGA10)
|
||||
{
|
||||
|
||||
int i;
|
||||
// Check for gas composition change
|
||||
ptAGA10.bForceUpdate = (ptAGA10.bForceUpdate || ptDetail.compositionchange(ref ptAGA10));
|
||||
// assign component IDs and values
|
||||
if (ptAGA10.bForceUpdate)
|
||||
{
|
||||
iNCC = -1;
|
||||
for (i = 0; i < NG_Cal.NUMBEROFCOMPONENTS; i++)
|
||||
{
|
||||
if (ptAGA10.adMixture[i] > 0.0)
|
||||
{
|
||||
iNCC = iNCC + 1;
|
||||
aiCID[iNCC] = i;
|
||||
dXi[iNCC] = ptAGA10.adMixture[i];
|
||||
}
|
||||
}
|
||||
iNCC = iNCC + 1;
|
||||
//calculate composition dependent quantities; ported from original
|
||||
//FORTRAN functions paramdl() and chardl()
|
||||
|
||||
GasPropsCal(ref ptAGA10);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void GasPropsCal(ref NG_Cal.GasPropsSTRUCT ptAGA10)
|
||||
{
|
||||
double[] adTableMri = new double[NG_Cal.NUMBEROFCOMPONENTS] { 16.0430, 28.0135, 44.0100, 30.0700, 44.0970, 18.0153, 34.0820, 2.0159, 28.0100, 31.9988, 58.1230, 58.1230, 72.1500, 72.1500, 86.1770, 100.2040, 114.2310, 128.2580, 142.2850, 4.0026, 39.9480 };
|
||||
double[] adTablePc = new double[NG_Cal.NUMBEROFCOMPONENTS] { 4.604, 3.399, 7.382, 4.88, 4.249, 22.118, 9.005, 1.297, 3.499, 5.081, 3.648, 3.797, 3.381, 3.369, 3.012, 2.736, 2.486, 0, 0, 0.2275, 4.876 };
|
||||
double[] adTableTc = new double[NG_Cal.NUMBEROFCOMPONENTS] { 190.55, 126.1, 304.19, 305.43, 369.82, 647.3, 373.5, 33.2, 132.92, 154.7, 408.13, 425.16, 460.39, 469.6, 507.4, 540.2, 568.76, 0, 0, 5.2, 150.82 };
|
||||
double[] adTableBzsx = new double[NG_Cal.NUMBEROFCOMPONENTS] { 15, 0, 0, 13, 9.5, 0, 45.5, 74.2, 74.2, 0, 8.4, 8.4, 8.3, 8.3, 7.7, 7.0, 0, 0, 0, 0, 0 };
|
||||
double[] adTableBzxx = new double[NG_Cal.NUMBEROFCOMPONENTS] { 5.0, 0, 0, 2.9, 2.1, 0, 4.3, 4.0, 12.5, 0, 1.8, 1.8, 1.4, 1.4, 1.2, 1.0, 0.96, 0, 0, 0, 0 };
|
||||
double[,] adTableZn = new double[3, NG_Cal.NUMBEROFCOMPONENTS]
|
||||
{{0.9976,0.9995,0.9933,0.99,0.9789,0.93,0.99,1.0006,0.9993,0.999,0.958,0.9572,0.9377,0.918,0.892,0.83,0.742,0.613,0.434,1.0005,0.999},
|
||||
{0.998,0.9997,0.9944,0.9915,0.9821,0.945,0.99,1.0006,0.9995,0.9992,0.968,0.965,0.948,0.937,0.913,0.866,0.802,0.71,0.584,1.0005,0.9992},
|
||||
{0.9981,0.9997,0.9944,0.992,0.9834,0.952,0.99,1.0006,0.9996,0.9993,0.971,0.9682,0.953,0.945,0.919,0.876,0.817,0.735,0.623,1.0005,0.9993}};
|
||||
double[,] adTableSqrtbj = new double[3, NG_Cal.NUMBEROFCOMPONENTS]
|
||||
{{0.049,0.0224,0.0819,0.1,0.1453,0.2646,0.1,-0.004,0.0265,0.0316,0.2049,0.2069,0.251,0.2864,0.3286,0.4123,0.5079,0.6221,0.7523,0.0006,0.0316},
|
||||
{0.0447,0.0173,0.0748,0.0922,0.1338,0.2345,0.1,-0.0048,0.0224,0.0283,0.1789,0.1871,0.228,0.251,0.295,0.3661,0.445,0.5385,0.645,0.0002,0.0283},
|
||||
{0.0436,0.0173,0.0728,0.0894,0.1288,0.2191,0.1,-0.0051,0.02,0.0265,0.1703,0.1783,0.2168,0.2345,0.2846,0.3521,0.4278,0.5148,0.614,0,0.0265}};
|
||||
double[,] adTableHhvMol = new double[4, NG_Cal.NUMBEROFCOMPONENTS]
|
||||
{{892.97,0,0,1564.34,2224.01,45.074,562.94,286.63,282.8,0,2874.2,2883.82,3535.98,3542.89,4203.23,4862.87,5522.4,6182.91,6842.69,0,0},
|
||||
{891.56,0,0,1562.14,2221.1,44.433,562.38,286.15,282.91,0,2870.58,2879.76,3531.68,3538.6,4198.24,4857.18,5516.01,6175.82,6834.9,0,0},
|
||||
{891.09,0,0,1561.41,2220.13,44.224,562.19,285.99,282.95,0,2869.38,2878.57,3530.24,3537.17,4196.58,4855.29,5513.88,6173.46,6832.31,0,0},
|
||||
{890.63,0,0,1560.69,2219.17,44.016,562.01,285.83,282.98,0,2868.2,2877.4,3528.83,3535.77,4194.95,4853.43,5511.8,6171.15,6829.77,0,0}};
|
||||
double[,] adTableLhvMol = new double[4, NG_Cal.NUMBEROFCOMPONENTS]
|
||||
{{802.82,0,0,1429.12,2043.71,0,517.87,241.56,282.8,0,2648.83,2658.45,3265.54,3272.45,3887.71,4502.28,5116.73,5732.17,6346.88,0,0},
|
||||
{802.69,0,0,1428.84,2043.37,0,517.95,241.72,282.91,0,2648.42,2657.6,3265.08,3272,3887.21,4501.72,5116.11,5731.49,6346.14,0,0},
|
||||
{802.65,0,0,1428.74,2043.23,0,517.97,241.76,282.95,0,2648.26,2657.45,3264.89,3271.83,3887.01,4501.49,5115.87,5731.22,6345.85,0,0},
|
||||
{802.6,0,0,1428.64,2043.11,0,517.99,241.81,282.98,0,2648.12,2657.32,3264.73,3271.67,3886.84,4501.3,5115.66,5730.99,6345.59,0,0}};
|
||||
|
||||
int i;
|
||||
|
||||
double dMair = 28.9626;
|
||||
double dZair = 0;
|
||||
|
||||
for (i = 0; i < NG_Cal.NUMBEROFCOMPONENTS; i++)
|
||||
{
|
||||
if (ptAGA10.adMixture[i] != 0)
|
||||
{
|
||||
ptAGA10.Pc += adTablePc[i] * ptAGA10.adMixture[i];
|
||||
ptAGA10.TC += adTableTc[i] * ptAGA10.adMixture[i];
|
||||
if (adTableBzsx[i] != 0)
|
||||
{
|
||||
ptAGA10.Bzsx += ptAGA10.adMixture[i] / adTableBzsx[i];
|
||||
ptAGA10.Bzxx += ptAGA10.adMixture[i] / adTableBzxx[i];
|
||||
}
|
||||
|
||||
if (i >= 10 & i <= 18)
|
||||
{
|
||||
ptAGA10.C4j += ptAGA10.adMixture[i] * adTableMri[i];
|
||||
}
|
||||
if (i >= 12 & i <= 18)
|
||||
{
|
||||
ptAGA10.C5j += ptAGA10.adMixture[i] * adTableMri[i];
|
||||
}
|
||||
if (i >= 14 & i <= 18)
|
||||
{
|
||||
ptAGA10.C6j += ptAGA10.adMixture[i] * adTableMri[i];
|
||||
}
|
||||
if (i == 3)
|
||||
{
|
||||
ptAGA10.C2 += ptAGA10.adMixture[i] * adTableMri[i];
|
||||
}
|
||||
|
||||
switch (ptAGA10.dCbtj)
|
||||
{
|
||||
case 2:
|
||||
ptAGA10.dZb11062 += adTableSqrtbj[0, i] * ptAGA10.adMixture[i];
|
||||
ptAGA10.dHhvMol += adTableHhvMol[0, i] * ptAGA10.adMixture[i];
|
||||
ptAGA10.dLhvMol += adTableLhvMol[0, i] * ptAGA10.adMixture[i];
|
||||
dZair = 0.99941;
|
||||
break;
|
||||
case 1:
|
||||
ptAGA10.dZb11062 += adTableSqrtbj[1, i] * ptAGA10.adMixture[i];
|
||||
ptAGA10.dHhvMol += adTableHhvMol[1, i] * ptAGA10.adMixture[i];
|
||||
ptAGA10.dLhvMol += adTableLhvMol[1, i] * ptAGA10.adMixture[i];
|
||||
dZair = 0.99958;
|
||||
break;
|
||||
case 0:
|
||||
ptAGA10.dZb11062 += adTableSqrtbj[2, i] * ptAGA10.adMixture[i];
|
||||
ptAGA10.dHhvMol += adTableHhvMol[2, i] * ptAGA10.adMixture[i];
|
||||
ptAGA10.dLhvMol += adTableLhvMol[2, i] * ptAGA10.adMixture[i];
|
||||
dZair = 0.99963;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ptAGA10.Bzsx = 1 / ptAGA10.Bzsx;
|
||||
ptAGA10.Bzxx = 1 / ptAGA10.Bzxx;
|
||||
ptAGA10.dZb11062 = 1 - ptAGA10.dZb11062 * ptAGA10.dZb11062;
|
||||
ptAGA10.dHhvm = ptAGA10.dHhvMol / ptAGA10.dMrx;
|
||||
ptAGA10.dLhvm = ptAGA10.dLhvMol / ptAGA10.dMrx;
|
||||
ptAGA10.dHhvv = ptAGA10.dHhvMol * ptAGA10.dPb / ptAGA10.dTb / 8314.510 / ptAGA10.dZb11062;
|
||||
ptAGA10.dLhvv = ptAGA10.dLhvMol * ptAGA10.dPb / ptAGA10.dTb / 8314.510 / ptAGA10.dZb11062;
|
||||
ptAGA10.dRD_Ideal11062 = ptAGA10.dMrx / dMair;
|
||||
ptAGA10.dRD_Real11062 = ptAGA10.dRD_Ideal11062 * dZair / ptAGA10.dZb11062;
|
||||
|
||||
ptAGA10.dRhob11062 = ptAGA10.dMrx * ptAGA10.dPb / 8314.51 / ptAGA10.dTb / ptAGA10.dZb11062;
|
||||
ptAGA10.dRhof11062 = ptAGA10.dMrx * ptAGA10.dPf / 8314.51 / ptAGA10.dTf / ptAGA10.dZf;
|
||||
ptAGA10.dWobbeIndex = ptAGA10.dHhvv / Math.Sqrt(ptAGA10.dRD_Real11062);
|
||||
ptAGA10.C3j = ptAGA10.C4j + ptAGA10.adMixture[4] * adTableMri[4];
|
||||
ptAGA10.C2j = ptAGA10.C3j + ptAGA10.adMixture[3] * adTableMri[3];
|
||||
ptAGA10.C3C4 = ptAGA10.adMixture[4] * adTableMri[4] + ptAGA10.adMixture[ 10] * adTableMri[10] +ptAGA10.adMixture[11] * adTableMri[11];
|
||||
ptAGA10.TotalC = ptAGA10.C2j + ptAGA10.adMixture[0] * adTableMri[0];
|
||||
|
||||
ptAGA10.TotalC = ptAGA10.TotalC * ptAGA10.dPb / 8314.51 / ptAGA10.dTb / ptAGA10.dZb11062;
|
||||
ptAGA10.C2 = ptAGA10.C2 * ptAGA10.dPb / 8314.51 / ptAGA10.dTb / ptAGA10.dZb11062;
|
||||
ptAGA10.C3C4 = ptAGA10.C3C4 * ptAGA10.dPb / 8314.51 / ptAGA10.dTb / ptAGA10.dZb11062;
|
||||
ptAGA10.C2j = ptAGA10.C2j * ptAGA10.dPb / 8314.51 / ptAGA10.dTb / ptAGA10.dZb11062;
|
||||
ptAGA10.C3j = ptAGA10.C3j * ptAGA10.dPb / 8314.51 / ptAGA10.dTb / ptAGA10.dZb11062;
|
||||
ptAGA10.C4j = ptAGA10.C4j * ptAGA10.dPb / 8314.51 / ptAGA10.dTb / ptAGA10.dZb11062;
|
||||
ptAGA10.C5j = ptAGA10.C5j * ptAGA10.dPb / 8314.51 / ptAGA10.dTb / ptAGA10.dZb11062;
|
||||
ptAGA10.C6j = ptAGA10.C6j * ptAGA10.dPb / 8314.51 / ptAGA10.dTb / ptAGA10.dZb11062;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
521
AGA8_10/NG_Cal.cs
Normal file
521
AGA8_10/NG_Cal.cs
Normal file
@ -0,0 +1,521 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace NG_Tools
|
||||
{
|
||||
public class NG_Cal
|
||||
{
|
||||
public const int NORMAL = 9000;
|
||||
public const int NG_Cal_INITIALIZED = 9001;
|
||||
public const int MEMORY_ALLOCATION_ERROR = 9002;
|
||||
public const int GENERAL_CALCULATION_FAILURE = 9003;
|
||||
public const int MAX_NUM_OF_ITERATIONS_EXCEEDED = 9004;
|
||||
public const int NEGATIVE_DENSITY_DERIVATIVE = 9005;
|
||||
public const int MAX_DENSITY_IN_BRAKET_EXCEEDED = 9006;
|
||||
/* number of components */
|
||||
public const int NUMBEROFCOMPONENTS = 21;
|
||||
/* maximum number of tries within search routines */
|
||||
public const int MAX_NUM_OF_ITERATIONS = 100;
|
||||
/* default tolerance limits */
|
||||
public const double P_CHG_TOL = 0.001; /* 0.001 Pa */
|
||||
public const double T_CHG_TOL = 0.001; /* 0.001 of a Kelvin */
|
||||
/* maximum allowable P & T */
|
||||
public const double P_MAX = 1.379e8; // maximum pressure (Pa) ~= 20,000 psi
|
||||
public const double P_MIN = 0.0; // maximum pressure = 0
|
||||
public const double T_MAX = 473.15; // maximum temperature (K) ~= 392 F
|
||||
public const double T_MIN = 143.0; // maximum temperature (K) ~= -200 F
|
||||
/* universal gas constant, in two configurations */
|
||||
public const double RGASKJ = 8.314510e-3; /* in kJ mol^-1 K^-1 */
|
||||
public const double RGAS = 8.314510; /* in J mol^-1 K^-1 */
|
||||
/* the main data structure used by this library */
|
||||
public struct GasPropsSTRUCT
|
||||
{ /* corresponds to the control group in meter classes */
|
||||
|
||||
public int lStatus; /* calculation status 计算状态 */
|
||||
public bool bForceUpdate; /*执行全部计算的标志 signal to perform full calculation */
|
||||
public double[] adMixture; /*气体摩尔组成 Composition in mole fraction */
|
||||
public double[] adMixtureV; /*气体体积组成 Composition in mole fraction */
|
||||
public double[] adMixtureD; /*气体质量组成 Composition in mole fraction */
|
||||
public int dCbtj; //参比条件 101325 0,15,20
|
||||
public double dPb; /*参比压力 Contract base Pressure (Pa) */
|
||||
public double dTb; /* 参比温度Contract base temperature (K) */
|
||||
public double dPf; /*绝对压力 Absolute Pressure (Pa) */
|
||||
public double dTf; /*工况温度 Flowing temperature (K) */
|
||||
// basic output from AGA 8 Detail method
|
||||
public double dMrx; /*分子量 mixture molar mass */
|
||||
public double dZb; /* 标况压缩因子compressibility at contract base condition */
|
||||
public double dZf; /* 工况压缩因子compressibility at flowing condition */
|
||||
public double dFpv; /*超压缩系数 supercompressibility */
|
||||
public double dDb; /* 标况摩尔密度molar density at contract base conditions (moles/dm3) */
|
||||
public double dDf; /*工况摩尔密度 molar density at flowing conditions (moles/dm3) */
|
||||
public double dRhob; /* 标况质量密度mass density at contract base conditions (kg/m3) */
|
||||
public double dRhof; /*工况质量密度 mass density at flowing conditions (kg/m3) */
|
||||
public double dRD_Ideal; /* 理想气体的相对密度ideal gas relative density */
|
||||
public double dRD_Real; /* 真实气体的相对密度real gas relative density */
|
||||
// additional output
|
||||
public double dHo; /*理想气体的比焓 ideal gas specific enthalpy */
|
||||
public double dH; /*真实气体的焓 real gas specific enthalpy (J/kg) */
|
||||
public double dS; /* 真实气体的熵real gas specific entropy (J/kg-mol.K)*/
|
||||
public double dCpi; /*理想气体定压热容 ideal gas constant pressure heat capacity (J/kg-mol.K)*/
|
||||
public double dCp; /* 定压热容real gas constant pressure heat capacity (J/kg-mol.K)*/
|
||||
public double dCv; /*定容积热容 real gas constant volume heat capacity (J/kg-mol.K)*/
|
||||
public double dk; /* 比热比ratio of specific heats */
|
||||
public double dKappa; /*等熵指数 isentropic exponent, denoted with Greek letter kappa */
|
||||
public double dSOS; /* 声速speed of sound (m/s) */
|
||||
public double dCstar; /*临界流函数 critical flow factor C* */
|
||||
|
||||
// 11062 输出
|
||||
|
||||
public double dHhvMol; //摩尔高位发热量
|
||||
public double dLhvMol; //摩尔低位发热量
|
||||
public double dHhvv; //体积高位发热量
|
||||
public double dLhvv; //体积低位发热量
|
||||
public double dHhvm; //质量高位发热量
|
||||
public double dLhvm; //质量地位发热量
|
||||
|
||||
public double dZb11062; //标况压缩因子
|
||||
public double dRhob11062; /* 标况质量密度mass density at contract base conditions (kg/m3) */
|
||||
public double dRhof11062; /*工况质量密度 mass density at flowing conditions (kg/m3) */
|
||||
public double dRD_Ideal11062; /* 理想气体的相对密度ideal gas relative density */
|
||||
public double dRD_Real11062; /* 真实气体的相对密度real gas relative density */
|
||||
public double dWobbeIndex; /* 真实气体的沃泊指数 */
|
||||
|
||||
|
||||
public double Pc; // '临界压力
|
||||
public double TC; /// '临界温度
|
||||
public double Bzsx; // '爆炸上限
|
||||
public double Bzxx; // '爆炸下限
|
||||
public double TotalC; // '总炭含量 (kg/m3)
|
||||
public double C2; // 'C2组分含量 (kg/m3)
|
||||
public double C2j; // 'C2以上组分含量 (kg/m3)
|
||||
public double C3j; // 'C3以上组分含量 (kg/m3)
|
||||
public double C4j; // 'C4以上组分含量 (kg/m3)
|
||||
public double C5j; // 'C5以上组分含量 (kg/m3)
|
||||
public double C6j; // 'C6以上组分含量 (kg/m3)
|
||||
public double C3C4; // 'C3C4组分含量 (kg/m3)
|
||||
|
||||
}
|
||||
public struct FlowParStruct //流量相关参数
|
||||
{
|
||||
//流量计算输入参数信息
|
||||
public int dFlowCalbz; //流量计算标准
|
||||
public int dZcalbz; //压缩因子计算标准
|
||||
public int dCbtj; //计量参比条件压力
|
||||
public double dPb_M; //计量参比条件压力
|
||||
public double dTb_M; //计量参比条件温度
|
||||
public double dPb_E; //燃烧参比条件压力
|
||||
public double dTb_E; //燃烧参比条件温度
|
||||
public double dPatm;//当地大气压
|
||||
public int dPatmUnit;//当地大气压单位
|
||||
public double[] dNG_Compents;//天然气组分
|
||||
|
||||
public int dMeterType;// 流量计类别
|
||||
public int dCoreType;//节流装置类型
|
||||
public int dPtmode; //取压方式
|
||||
public int dPipeType; // 管道类型
|
||||
public double dPipeD; //管道内径
|
||||
public int dLenUnit; //长度单位
|
||||
public double dPipeDtemp; //管道内径参考温度
|
||||
public int dPileDtempUint; //温度单位
|
||||
public int dPipeMaterial; //管道材料
|
||||
|
||||
public double dOrificeD; //孔板孔径
|
||||
public int dOrificeUnit; //长度单位
|
||||
public double dOrificeDtemp; //孔板内径参考温度
|
||||
public int dOrificeDtempUnit; //温度单位
|
||||
public int dOrificeMaterial; //孔板材料
|
||||
public int dOrificeSharpness; //锐利度系数计算方法
|
||||
public double dOrificeRk; //孔板入口圆弧半径
|
||||
public int dOrificeRkLenUint;//长度单位
|
||||
public double dPf;//输入压力
|
||||
public int dPfUnit;//压力单位
|
||||
public int dPfType; //压力类型
|
||||
public double dTf; //输入温度
|
||||
public int dTfUnit;//温度单位
|
||||
public double dDp; //输入差压
|
||||
public int dDpUnit; //压力单位
|
||||
public int dVFlowUnit; //体积流量单位
|
||||
public int dMFlowUnit; //'NG_Par(33) = ComboBox15.SelectedIndex '质量流量单位
|
||||
public int dEFlowUnit; //'NG_Par(34) = ComboBox16.SelectedIndex '能量流量单位
|
||||
public double dCd;//流出系数
|
||||
public double dMeterFactor;//仪表系数
|
||||
public double dPulseNum;//脉冲数
|
||||
public double dVFlowMax; //'NG_par(39)=’最大体积流量
|
||||
public double dVFlowMin; //'NG_par(40)=’最小体积流量
|
||||
public double dVFlowCon;//'NG_par(41)=’常用流量
|
||||
public double dPfRange; //'NG_par(42)=’压力量程
|
||||
public double dDpRange; //'NG_par(43)=’差压量程
|
||||
public double dTfRange; //'NG_par(44)=’温度计量程
|
||||
|
||||
//流量计算输出参数
|
||||
public double dE; //'求渐近速度系数 E
|
||||
public double dFG; //'求相对密度系数 FG
|
||||
public double dFT; //'求流动温度系数 'FT
|
||||
public double dDViscosity; //'求动力粘度 dlnd
|
||||
public double dDExpCoefficient; //'求可膨胀系数
|
||||
public double dRnPipe; //'管道雷诺数
|
||||
public double dBk; //'孔板锐利度系数Bk
|
||||
public double dRoughNessPipe; //'管道粗糙度系数 Gme
|
||||
public double dCdCorrect; //'修正后的流出系数
|
||||
public double dCdNozell; //'喷嘴的流出系数
|
||||
public double dVFlowb;//'标况体积流量 m³、s
|
||||
public double dVFlowf; //'工况体积流量
|
||||
public double dMFlowb;//'标况质量流量
|
||||
public double dEFlowb;//'标况能量流量
|
||||
public double dVelocityFlow;//'管道内天然气流速
|
||||
public double dPressLost;//'压力损失
|
||||
public double dBeta;//'直径比
|
||||
public double dKappa;//'等熵指数
|
||||
|
||||
}
|
||||
|
||||
//public struct SqgyParStruct //输气工艺相关参数
|
||||
//{
|
||||
// public int dCalName; //计算项目
|
||||
// public int dPipleD; //管道内径mm
|
||||
// public int dPipleDw; //管道内径外径mm
|
||||
// public int dPipleBh; //管道壁厚 mm
|
||||
// public double dPipleTotalLength; //管道总长度 km
|
||||
// public double dPiplePointLength; //管道任意点长度 km
|
||||
// public double dPstart; //起点压力终点压力MPa
|
||||
// public double dPend; //终点压力MPa
|
||||
// public double dFlow; //输气能力
|
||||
// public double dRd;//相对密度
|
||||
// public double dZf;//压缩因子
|
||||
// public double[] dNG_Compents;//天然气组分
|
||||
|
||||
// public double dPavg;//管道平均压力
|
||||
// public double dPavgPoint;//管道任意点的平均压力
|
||||
|
||||
|
||||
//}
|
||||
|
||||
/* enumerations for tracking gas components */
|
||||
enum gascomp
|
||||
{
|
||||
XiC1 = 0, XiN2, XiCO2, XiC2, XiC3,
|
||||
XiH2O, XiH2S, XiH2, XiCO, XiO2, XiIC4, XiNC4,
|
||||
XiIC5, XiNC5, XiNC6, XiNC7, XiNC8, XiNC9, XiNC10, XiHe, XiAr
|
||||
};
|
||||
|
||||
|
||||
/* FUNCTION PROTOTYPES */
|
||||
/* prototypes for initialization */
|
||||
// int NG_Cal_Init(void) ; /* initialize library */
|
||||
// int NG_Cal_UnInit(void) ; /* un-initialize library */
|
||||
///* function prototype for basic VOS calculation */
|
||||
// double SOS(ref AGA10.GasPropsSTRUCT ) ;
|
||||
///* function prototype for a C* calculation */
|
||||
// double Crit(ref AGA10.GasPropsSTRUCT , double) ;
|
||||
|
||||
|
||||
|
||||
public Therm ptTherm;
|
||||
public Detail ptDetail;
|
||||
|
||||
/**************************************************************************
|
||||
|
||||
* Function : NG_Cal_Init()
|
||||
* Arguments : void
|
||||
* Returns : int
|
||||
* Purpose : Initializes library; creates required objects
|
||||
* Revisions :
|
||||
**************************************************************************/
|
||||
|
||||
public int NG_Cal_Init()
|
||||
{
|
||||
//create object for calculating density
|
||||
if (null == (ptDetail = new Detail()))
|
||||
{
|
||||
return MEMORY_ALLOCATION_ERROR;
|
||||
}
|
||||
|
||||
//create object for calculating thermodynamic properties
|
||||
if (null == (ptTherm = new Therm()))
|
||||
{
|
||||
return MEMORY_ALLOCATION_ERROR;
|
||||
}
|
||||
|
||||
return NG_Cal_INITIALIZED;
|
||||
|
||||
}// NG_Cal_Init
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
|
||||
* Function : NG_Cal_UnInit()
|
||||
* Arguments : void
|
||||
* Returns : int
|
||||
* Purpose : Un-initializes library; deletes objects
|
||||
* Revisions :
|
||||
**************************************************************************/
|
||||
|
||||
public int NG_Cal_UnInit()
|
||||
{
|
||||
// delete the objects (if they exist)
|
||||
ptDetail = null;
|
||||
ptTherm = null;
|
||||
return 0;
|
||||
|
||||
}// NG_Cal_UnInit
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* Function : SOS()
|
||||
* Arguments : Pointers to external AGA10 data struct
|
||||
* Returns : double
|
||||
* Purpose : calculates speed of sound and other parameters
|
||||
* Revisions :
|
||||
**************************************************************************/
|
||||
|
||||
public double SOS(ref GasPropsSTRUCT ptAGA10)
|
||||
{
|
||||
// check if library is ready; initialize if necessary
|
||||
if (null == ptDetail || null == ptTherm)
|
||||
{
|
||||
NG_Cal_UnInit();
|
||||
NG_Cal_Init();
|
||||
|
||||
}
|
||||
|
||||
switch (ptAGA10 .dCbtj )
|
||||
{
|
||||
case 2:
|
||||
ptAGA10.dPb = 101325;
|
||||
ptAGA10.dTb = 273.15;
|
||||
break;
|
||||
case 1:
|
||||
ptAGA10.dPb = 101325;
|
||||
ptAGA10.dTb = 288.15;
|
||||
break;
|
||||
case 0:
|
||||
ptAGA10.dPb = 101325;
|
||||
ptAGA10.dTb = 293.15;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//Call function to calculate densities and thermodynamic properties
|
||||
ptTherm.Run(ref ptAGA10, ref ptDetail);
|
||||
|
||||
//the basic sound speed calculation doesn't calculate C*; initialize to zero
|
||||
ptAGA10.dCstar = 0.0;
|
||||
|
||||
//return the speed of sound to caller
|
||||
|
||||
return ptAGA10.dSOS;
|
||||
|
||||
}// VOS()
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
|
||||
* Function : Crit()
|
||||
* Arguments : Pointers to external AGA10 data struct, Detail and Therm
|
||||
* objects and a double precision float (gas velocity in plenum)
|
||||
* Returns : double
|
||||
* Purpose : calculates C*
|
||||
* Revisions :
|
||||
**************************************************************************/
|
||||
|
||||
public double Crit(ref NG_Cal.GasPropsSTRUCT ptAGA10, double dPlenumVelocity)
|
||||
{
|
||||
//variables local to function
|
||||
double DH, DDH, S, H;
|
||||
double tolerance = 1.0;
|
||||
double R, P, T, Z;
|
||||
|
||||
int i;
|
||||
|
||||
//check objects for readiness; try to initialize if not
|
||||
if (null == ptDetail || null == ptTherm)
|
||||
{
|
||||
NG_Cal_UnInit();
|
||||
|
||||
if (NG_Cal_INITIALIZED != NG_Cal_Init())
|
||||
{
|
||||
|
||||
ptAGA10.lStatus = MEMORY_ALLOCATION_ERROR; return 0.0;
|
||||
|
||||
}
|
||||
}
|
||||
switch (ptAGA10.dCbtj)
|
||||
{
|
||||
case 2:
|
||||
ptAGA10.dPb = 101325;
|
||||
ptAGA10.dTb = 273.15;
|
||||
break;
|
||||
case 1:
|
||||
ptAGA10.dPb = 101325;
|
||||
ptAGA10.dTb = 288.15;
|
||||
break;
|
||||
case 0:
|
||||
ptAGA10.dPb = 101325;
|
||||
ptAGA10.dTb = 293.15;
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
//begin by calculating densities and thermodynamic properties
|
||||
ptTherm.Run(ref ptAGA10, ref ptDetail);
|
||||
|
||||
//DH is enthalpy change from plenum to throat; this is our initial guess
|
||||
|
||||
DH = (ptAGA10.dSOS * ptAGA10.dSOS - dPlenumVelocity * dPlenumVelocity) / 2.0;
|
||||
|
||||
//trap plenum conditions before we alter the data stucture's contents
|
||||
S = ptAGA10.dS;
|
||||
|
||||
H = ptAGA10.dH;
|
||||
|
||||
R = ptAGA10.dRhof;
|
||||
P = ptAGA10.dPf;
|
||||
Z = ptAGA10.dZf;
|
||||
T = ptAGA10.dTf;
|
||||
|
||||
//initialize delta of DH to an arbitrary value outside of
|
||||
|
||||
//convergence tolerance
|
||||
DDH = 10.0;
|
||||
|
||||
//Via simple repetition, search for a pressure, temperature and sound speed
|
||||
|
||||
//at a nozzle throat which provide constant enthalpy, given the entropy known
|
||||
//at the plenum. Abort if loop executes more than 100 times without convergence.
|
||||
for (i = 1; i < MAX_NUM_OF_ITERATIONS; i++)
|
||||
{
|
||||
|
||||
// calculate P and T to satisfy H and S
|
||||
ptTherm.HS_Mode(ref ptAGA10, ref ptDetail, H - DH, S, true);
|
||||
|
||||
//calculate new thermo, including SOS
|
||||
ptTherm.Run(ref ptAGA10, ref ptDetail);
|
||||
|
||||
//hold DH for tolerance check
|
||||
|
||||
DDH = DH;
|
||||
|
||||
// recalculate DH
|
||||
|
||||
DH = (ptAGA10.dSOS * ptAGA10.dSOS - dPlenumVelocity * dPlenumVelocity) / 2.0;
|
||||
|
||||
// end loop if tolerance reached
|
||||
|
||||
if (Math.Abs(DDH - DH) < tolerance) break;
|
||||
}
|
||||
|
||||
//C* is the real gas critical flow constant (not to be confused with Cperf or CRi)
|
||||
ptAGA10.dCstar = (ptAGA10.dRhof * ptAGA10.dSOS) / Math.Sqrt(R * P * Z);
|
||||
|
||||
//put the original plenum pressure and temperature back
|
||||
|
||||
ptAGA10.dPf = P;
|
||||
ptAGA10.dTf = T;
|
||||
|
||||
//restore fluid props to plenum conditions
|
||||
ptTherm.Run(ref ptAGA10, ref ptDetail);
|
||||
|
||||
GB11062 ptGB11062 = new GB11062();
|
||||
|
||||
ptGB11062.Run(ref ptAGA10 );
|
||||
|
||||
//return the critical flow function to caller
|
||||
return ptAGA10.dCstar;
|
||||
|
||||
}// Crit()
|
||||
|
||||
/**************************************************************************
|
||||
|
||||
* Function : Crit()
|
||||
* Arguments : Pointers to external AGA10 data struct, Detail and Therm
|
||||
* objects and a double precision float (gas velocity in plenum)
|
||||
* Returns : double
|
||||
* Purpose : calculates C*
|
||||
* Revisions :
|
||||
**************************************************************************/
|
||||
|
||||
public double Zcal(ref NG_Cal.GasPropsSTRUCT ptAGA10, double dPlenumVelocity)
|
||||
{
|
||||
//variables local to function
|
||||
|
||||
|
||||
|
||||
//check objects for readiness; try to initialize if not
|
||||
if (null == ptDetail || null == ptTherm)
|
||||
{
|
||||
NG_Cal_UnInit();
|
||||
|
||||
if (NG_Cal_INITIALIZED != NG_Cal_Init())
|
||||
{
|
||||
|
||||
ptAGA10.lStatus = MEMORY_ALLOCATION_ERROR; return 0.0;
|
||||
|
||||
}
|
||||
}
|
||||
switch (ptAGA10.dCbtj)
|
||||
{
|
||||
case 2:
|
||||
ptAGA10.dPb = 101325;
|
||||
ptAGA10.dTb = 273.15;
|
||||
break;
|
||||
case 1:
|
||||
ptAGA10.dPb = 101325;
|
||||
ptAGA10.dTb = 288.15;
|
||||
break;
|
||||
case 0:
|
||||
ptAGA10.dPb = 101325;
|
||||
ptAGA10.dTb = 293.15;
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
//begin by calculating densities and thermodynamic properties
|
||||
ptTherm.Run(ref ptAGA10, ref ptDetail);
|
||||
|
||||
|
||||
GB11062 ptGB11062 = new GB11062();
|
||||
|
||||
ptGB11062.Run(ref ptAGA10);
|
||||
|
||||
//return the critical flow function to caller
|
||||
return ptAGA10.dZf;
|
||||
|
||||
}// Z()
|
||||
|
||||
/**************************************************************************
|
||||
* Function : Cperf()
|
||||
* Arguments : pointer to external AGA10 data struct
|
||||
* Returns : double
|
||||
* Purpose : calculates isentropic perfect gas critical flow function
|
||||
* Revisions :
|
||||
**************************************************************************/
|
||||
|
||||
double Cperf(ref NG_Cal.GasPropsSTRUCT ptAGA10)
|
||||
{
|
||||
|
||||
double k, root, exponent;
|
||||
|
||||
k = ptAGA10.dKappa; root = 2.0 / (k + 1.0);
|
||||
exponent = (k + 1.0) / (k - 1.0);
|
||||
|
||||
// isentropic perfect gas critical flow function C*i
|
||||
return (Math.Sqrt(k * Math.Pow(root, exponent)));
|
||||
|
||||
}// Cperf
|
||||
/**************************************************************************
|
||||
* Function : CRi()
|
||||
* Arguments : pointer to external AGA10 data struct
|
||||
* Returns : double
|
||||
* Purpose : calculates isentropic real gas critical flow function CRi
|
||||
* Revisions :
|
||||
**************************************************************************/
|
||||
|
||||
double CRi(ref NG_Cal.GasPropsSTRUCT ptAGA10)
|
||||
{
|
||||
return (Cperf(ref ptAGA10) / Math.Sqrt(ptAGA10.dZf));
|
||||
}// CRi()
|
||||
}
|
||||
}
|
60
AGA8_10/NG_Cal.csproj
Normal file
60
AGA8_10/NG_Cal.csproj
Normal file
@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{186107A4-D8E6-46C1-A6CE-65E5C4F14C1B}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>NG_Cal</RootNamespace>
|
||||
<AssemblyName>NG_Cal</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FlowCal.cs" />
|
||||
<Compile Include="NG_Cal.cs" />
|
||||
<Compile Include="Detail.cs" />
|
||||
<Compile Include="GB11062.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Therm.cs" />
|
||||
<Compile Include="UnitConvert.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
BIN
AGA8_10/NG_TOOLS.snk
Normal file
BIN
AGA8_10/NG_TOOLS.snk
Normal file
Binary file not shown.
65
AGA8_10/NG_Tools.csproj
Normal file
65
AGA8_10/NG_Tools.csproj
Normal file
@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{186107A4-D8E6-46C1-A6CE-65E5C4F14C1B}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>NG_Tools</RootNamespace>
|
||||
<AssemblyName>NG_Tools</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<RegisterForComInterop>true</RegisterForComInterop>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FlowCal.cs" />
|
||||
<Compile Include="NG_Cal.cs" />
|
||||
<Compile Include="Detail.cs" />
|
||||
<Compile Include="GB11062.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Therm.cs" />
|
||||
<Compile Include="UnitConvert.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
36
AGA8_10/Properties/AssemblyInfo.cs
Normal file
36
AGA8_10/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的常规信息通过以下
|
||||
// 特性集控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("NG_Tools")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("NG_Tools")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017 廖德云 ldeyun@163.com")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 使此程序集中的类型
|
||||
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
|
||||
// 则将该类型上的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("7f6505ae-7989-41df-9888-b7b7c2e4ed67")]
|
||||
|
||||
// 程序集的版本信息由下面四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
534
AGA8_10/Therm.cs
Normal file
534
AGA8_10/Therm.cs
Normal file
@ -0,0 +1,534 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using System.Text;
|
||||
namespace NG_Tools
|
||||
{
|
||||
public class Therm
|
||||
{
|
||||
// member data
|
||||
//double dT;// current temperature, in Kelvins
|
||||
//double dP;// current pressure, in Pascals
|
||||
//double dD;// molar density, in moles/dm3
|
||||
//double dRho;// mass density, in kg/m3
|
||||
double dPdD;// partial deriv of P wrt D
|
||||
double dPdT;// partial deriv of P wrt T
|
||||
double dSi;// ideal gas specific entropy, kJ/kg.K
|
||||
double dTold;// temperature previously used
|
||||
double dMrxold;// mixture molar mass previously used
|
||||
double[] GK_root = new double[5] { 0.14887433898163121088, 0.43339539412924719080, 0.67940956829902440263, 0.86506336668898451073, 0.97390652851717172008 };
|
||||
double[] GK_weight = new double[5] { 0.29552422471475286217, 0.26926671930999634918, 0.21908636251598204295, 0.14945134915058059038, 0.066671344308688137179 };
|
||||
//set the number of points for quadrature
|
||||
int GK_points = 5;
|
||||
//equation constants for ideal gas heat capacity, enthalpy and entropy
|
||||
double[,] ThermConstants = new double[21, 11] {{-29776.4, 7.95454, 43.9417, 1037.09, 1.56373, 813.205, -24.9027, 1019.98,-10.1601, 1070.14,-20.0615},
|
||||
{-3495.34, 6.95587, 0.272892, 662.738,-0.291318,-680.562, 1.78980, 1740.06, 0.0, 100.0, 4.49823},
|
||||
{ 20.7307, 6.96237, 2.68645, 500.371,-2.56429,-530.443, 3.91921, 500.198, 2.13290, 2197.22, 5.81381},
|
||||
{-37524.4, 7.98139, 24.3668, 752.320, 3.53990, 272.846, 8.44724, 1020.13,-13.2732, 869.510,-22.4010},
|
||||
{-56072.1, 8.14319,37.0629,735.402,9.38159,247.190,13.4556, 1454.78,-11.7342, 984.518,-24.0426},
|
||||
{-13773.1, 7.97183, 6.27078,2572.63,2.05010,1156.72,0.0,100.0,0.0,100.0,-3.24989},
|
||||
{-10085.4, 7.94680,-0.08380,433.801,2.85539, 843.792,6.31595, 1481.43,-2.88457, 1102.23,-0.51551},
|
||||
{-5565.60, 6.66789, 2.33458,2584.98,.749019, 559.656,0.0,100.0,0.0,100.0,-7.94821},
|
||||
{-2753.49, 6.95854, 2.02441,1541.22,.096774, 3674.81,0.0,100.0,0.0,100.0,6.23387},
|
||||
{-3497.45, 6.96302, 2.40013, 2522.05, 2.21752, 1154.15, 0.0,100.0,0.0,100.0,9.19749},
|
||||
{-72387.0, 17.8143, 58.2062, 1787.39, 40.7621, 808.645, 0.0,100.0,0.0,100.0,-44.1341},
|
||||
{-72674.8, 18.6383, 57.4178, 1792.73, 38.6599, 814.151, 0.0,100.0,0.0,100.0,-46.1938},
|
||||
{-91505.5, 21.3861, 74.3410, 1701.58, 47.0587, 775.899, 0.0,100.0,0.0,100.0,-60.2474},
|
||||
{-83845.2, 22.5012, 69.5789, 1719.58, 46.2164, 802.174, 0.0,100.0,0.0,100.0,-62.2197},
|
||||
{-94982.5, 26.6225, 80.3819, 1718.49, 55.6598, 802.069, 0.0,100.0,0.0,100.0,-77.5366},
|
||||
{-103353.0, 30.4029, 90.6941, 1669.32, 63.2028, 786.001, 0.0,100.0,0.0,100.0,-92.0164},
|
||||
{-109674.0, 34.0847, 100.253, 1611.55, 69.7675, 768.847, 0.0,100.0,0.0,100.0,-106.149},
|
||||
{-122599.0, 38.5014, 111.446, 1646.48, 80.5015, 781.588, 0.0,100.0,0.0,100.0,-122.444},
|
||||
{-133564.0, 42.7143, 122.173, 1654.85, 90.2255, 785.564, 0.0,100.0,0.0,100.0,-138.006},
|
||||
{0.0,4.9680,0.0,100.0,0.0,100.0,0.0,100.0,0.0,100.0,0.0},
|
||||
{0.0,4.9680,0.0,100.0,0.0,100.0,0.0,100.0,0.0,100.0,0.0}};
|
||||
// enumerations for indexing of coefficients
|
||||
//public enum CoefficientList { coefA = 0, coefB, coefC, coefD, coefE, coefF, coefG, coefH, coefI, coefJ, coefK } ;
|
||||
public int coefA = 0;
|
||||
public int coefB = 1;
|
||||
public int coefC = 2;
|
||||
public int coefD = 3;
|
||||
public int coefE = 4;
|
||||
public int coefF = 5;
|
||||
public int coefG = 6;
|
||||
public int coefH = 7;
|
||||
public int coefI = 8;
|
||||
public int coefJ = 9;
|
||||
public int coefK = 10;
|
||||
// conversion constant for thermochemical calories to Joules: 1 cal(IT) = 4.1840 J
|
||||
const double CalTH = 4.1840;
|
||||
public Therm()
|
||||
{
|
||||
// initialize 3 history-sensitive variables
|
||||
dSi = 0.0;
|
||||
dTold = 0.0;
|
||||
dMrxold = 0.0;
|
||||
}//Therm()
|
||||
/**************************************************************************
|
||||
*Function:Math.Coth()
|
||||
*Arguments:double
|
||||
*Returns:double
|
||||
*Purpose:calculate hyperbolic cotangent; used in Ho calculations
|
||||
*Revisions:
|
||||
*Notes:Not a Therm object class member, just a utility for this
|
||||
*file. The C++ language has no intrinsic support for
|
||||
*hyperbolic cotangent
|
||||
**************************************************************************/
|
||||
double coth(double x)
|
||||
{
|
||||
return Math.Cosh(x) / Math.Sinh(x);
|
||||
}// Math.Coth()
|
||||
/**************************************************************************
|
||||
*Function:Run()
|
||||
*Arguments:ref AGA10.GasPropsSTRUCT , Detail *
|
||||
*Returns:void
|
||||
*Purpose:overall execution control; top level math for SOS and k
|
||||
*Revisions:
|
||||
**************************************************************************/
|
||||
public void Run(ref NG_Cal.GasPropsSTRUCT ptAGA10, ref Detail ptD)
|
||||
{
|
||||
//local variables
|
||||
double c, x, y, z;
|
||||
//first run basic set of functions within AGA 8 (1994) Detail Method
|
||||
ptD.Run(ref ptAGA10);
|
||||
//find first partial derivative of Z wrt D
|
||||
ptD.dZdD(ptAGA10.dDf);
|
||||
//find real gas cv, cp, specific enthalpy and entropy
|
||||
CprCvrHS(ref ptAGA10, ref ptD);
|
||||
//ratio of real gas specific heats
|
||||
ptAGA10.dk = ptAGA10.dCp / ptAGA10.dCv;
|
||||
//solve c in three steps, for clarity and ease of debugging
|
||||
x = ptAGA10.dk * NG_Cal.RGAS * 1000.0 * ptAGA10.dTf;
|
||||
y = ptAGA10.dMrx;
|
||||
z = ptAGA10.dZf + ptAGA10.dDf * ptD.ddZdD;
|
||||
//calculate c, which is SOS^2
|
||||
c = (x / y) * z;
|
||||
//speed of sound
|
||||
ptAGA10.dSOS = Math.Sqrt(c);
|
||||
//calculate the real gas isentropic exponent
|
||||
//using expression functionally equivalent to Equation 3.2
|
||||
ptAGA10.dKappa = (c * ptAGA10.dRhof) / ptAGA10.dPf;
|
||||
return;
|
||||
}//Run()
|
||||
/**************************************************************************
|
||||
*Function:CpiMolar()
|
||||
*Arguments:ref AGA10.GasPropsSTRUCT
|
||||
*Returns:double
|
||||
*Purpose:Calculate constant pressure ideal gas molar heat capacity
|
||||
*in (J/mol-K), applying eqns from Aly, Lee, McFall
|
||||
*Notes:For continuity, the original constants and eqn's have been
|
||||
*retained. Conversion from thermochemical calories(th) to
|
||||
*Joules is applied after the primary calculations are complete.
|
||||
*Revisions:
|
||||
**************************************************************************/
|
||||
double CpiMolar(ref NG_Cal.GasPropsSTRUCT ptAGA10)
|
||||
{
|
||||
double Cp = 0.0;
|
||||
double Cpx;
|
||||
double DT, FT, HT, JT;
|
||||
double Dx, Fx, Hx, Jx;
|
||||
double T;
|
||||
int i;
|
||||
//to maximize readability of this section, use intermediate variable T
|
||||
T = ptAGA10.dTf;
|
||||
//calculate heat capacity for each component
|
||||
for (i = 0; i < NG_Cal.NUMBEROFCOMPONENTS; i++)
|
||||
{
|
||||
//skip species whose concentration is zero
|
||||
if (ptAGA10.adMixture[i] <= 0.0) continue;
|
||||
//initialize Cp of species to zero
|
||||
Cpx = 0.0;
|
||||
// calculate species intermediate terms
|
||||
DT = ThermConstants[i, coefD] / T;
|
||||
FT = ThermConstants[i, coefF] / T;
|
||||
HT = ThermConstants[i, coefH] / T;
|
||||
JT = ThermConstants[i, coefJ] / T;
|
||||
// use intermediate terms to avoid redundant calcs
|
||||
Dx = DT / Math.Sinh(DT);
|
||||
Fx = FT / Math.Cosh(FT);
|
||||
Hx = HT / Math.Sinh(HT);
|
||||
Jx = JT / Math.Cosh(JT);
|
||||
Cpx += ThermConstants[i, coefB];
|
||||
Cpx += ThermConstants[i, coefC] * Dx * Dx;
|
||||
Cpx += ThermConstants[i, coefE] * Fx * Fx;
|
||||
Cpx += ThermConstants[i, coefG] * Hx * Hx;
|
||||
Cpx += ThermConstants[i, coefI] * Jx * Jx;
|
||||
//use current mole fraction to weight the contribution
|
||||
Cpx *= ptAGA10.adMixture[i];
|
||||
//add this contribution to the sum
|
||||
Cp += Cpx;
|
||||
}
|
||||
// convert from cal(th)/mol-K to J/mol-K
|
||||
Cp *= CalTH;
|
||||
return Cp;
|
||||
}//CpiMolar()
|
||||
/**************************************************************************
|
||||
*Function:Ho()
|
||||
*Arguments:ref AGA10.GasPropsSTRUCT
|
||||
*Returns:double
|
||||
*Purpose:Calculate ideal gas specific enthalpy (J/kg)
|
||||
*Notes:For continuity, the original constants and eqn's have been
|
||||
*retained. Conversion from thermochemical calories(th) to
|
||||
*Joules is applied after the primary calculations are complete.
|
||||
*Revisions:
|
||||
**************************************************************************/
|
||||
double Ho(ref NG_Cal.GasPropsSTRUCT ptAGA10)
|
||||
{
|
||||
double H = 0.0; double Hx;
|
||||
double DT, FT, HT, JT;
|
||||
double cothDT, tanhFT, cothHT, tanhJT; double T;
|
||||
int i;
|
||||
// to maximize readability of this section, use intermediate variable T
|
||||
T = ptAGA10.dTf;
|
||||
for (i = 0; i < NG_Cal.NUMBEROFCOMPONENTS; i++)
|
||||
{
|
||||
// skip species whose concentration is zero
|
||||
if (ptAGA10.adMixture[i] <= 0.0) continue;
|
||||
Hx = 0.0;
|
||||
// calculate species intermediate terms
|
||||
DT = ThermConstants[i, coefD] / T;
|
||||
FT = ThermConstants[i, coefF] / T; HT = ThermConstants[i, coefH] / T; JT = ThermConstants[i, coefJ] / T;
|
||||
cothDT = coth(DT); tanhFT = Math.Tanh(FT); cothHT = coth(HT); tanhJT = Math.Tanh(JT);
|
||||
Hx += ThermConstants[i, coefA];
|
||||
Hx += ThermConstants[i, coefB] * T;
|
||||
Hx += ThermConstants[i, coefC] * ThermConstants[i, coefD] * cothDT;
|
||||
Hx -= ThermConstants[i, coefE] * ThermConstants[i, coefF] * tanhFT;
|
||||
Hx += ThermConstants[i, coefG] * ThermConstants[i, coefH] * cothHT;
|
||||
Hx -= ThermConstants[i, coefI] * ThermConstants[i, coefJ] * tanhJT;
|
||||
//use current mole fraction to weight the contribution
|
||||
Hx *= ptAGA10.adMixture[i];
|
||||
//add this contribution to the sum
|
||||
H += Hx;
|
||||
}
|
||||
//convert from cal(th)/g-mol to kJ/kg-mol
|
||||
H *= CalTH;
|
||||
//convert from kJ/kg-mol to J/kg
|
||||
H /= ptAGA10.dMrx;
|
||||
// return in J/kg
|
||||
return H * 1.0e3;
|
||||
}
|
||||
// Ho()
|
||||
/**************************************************************************
|
||||
*Function:So()
|
||||
*Arguments:ref AGA10.GasPropsSTRUCT
|
||||
*Returns:double
|
||||
*Purpose:ideal gas specific entropy (J/kg-K)
|
||||
*Notes:For continuity, the original constants and eqn's have been
|
||||
*retained. Conversion from thermochemical calories(th) to
|
||||
*Joules is applied after the primary calculations are complete.
|
||||
*Revisions:
|
||||
**************************************************************************/
|
||||
double So(ref NG_Cal.GasPropsSTRUCT ptAGA10)
|
||||
{
|
||||
double S = 0.0; double Sx;
|
||||
double DT, FT, HT, JT;
|
||||
double cothDT, tanhFT, cothHT, tanhJT; double sinhDT, coshFT, sinhHT, coshJT; double T;
|
||||
int i;
|
||||
// to improve readability of this section, use intermediate variable T
|
||||
T = ptAGA10.dTf;
|
||||
for (i = 0; i < NG_Cal.NUMBEROFCOMPONENTS; i++)
|
||||
{
|
||||
// skip species whose concentration is zero
|
||||
if (ptAGA10.adMixture[i] <= 0.0) continue;
|
||||
Sx = 0.0;
|
||||
// calculate species intermediate terms
|
||||
DT = ThermConstants[i, coefD] / T;
|
||||
FT = ThermConstants[i, coefF] / T;
|
||||
HT = ThermConstants[i, coefH] / T;
|
||||
JT = ThermConstants[i, coefJ] / T;
|
||||
cothDT = coth(DT); tanhFT = Math.Tanh(FT); cothHT = coth(HT);
|
||||
tanhJT = Math.Tanh(JT);
|
||||
sinhDT = Math.Sinh(DT); coshFT = Math.Cosh(FT); sinhHT = Math.Sinh(HT); coshJT = Math.Cosh(JT);
|
||||
Sx += ThermConstants[i, coefK];
|
||||
Sx += ThermConstants[i, coefB] * Math.Log(T);
|
||||
Sx += ThermConstants[i, coefC] * (DT * cothDT - Math.Log(sinhDT));
|
||||
Sx -= ThermConstants[i, coefE] * (FT * tanhFT - Math.Log(coshFT));
|
||||
Sx += ThermConstants[i, coefG] * (HT * cothHT - Math.Log(sinhHT));
|
||||
Sx -= ThermConstants[i, coefI] * (JT * tanhJT - Math.Log(coshJT));
|
||||
//use current mole fraction to weight the contribution
|
||||
Sx *= ptAGA10.adMixture[i];
|
||||
//add this contribution to the sum
|
||||
S += Sx;
|
||||
}
|
||||
//convert cal(th)/mol-K basis to to kJ/kg mol-K
|
||||
S *= CalTH;
|
||||
//convert from kJ/kg mol-K to kJ/kg-K
|
||||
S /= ptAGA10.dMrx;
|
||||
// return in J/kg-K
|
||||
return S * 1.0e3;
|
||||
}//So()
|
||||
/**************************************************************************
|
||||
*Function:CprCvrHS()
|
||||
*Arguments:ref AGA10.GasPropsSTRUCT , Detail *
|
||||
*Returns:void
|
||||
*Purpose:reasonably efficient group calculation of Cp, Cv, H and S
|
||||
*Revisions:
|
||||
**************************************************************************/
|
||||
void CprCvrHS(ref NG_Cal.GasPropsSTRUCT ptAGA10, ref Detail ptD)
|
||||
{
|
||||
double Cvinc, Cvr, Cpr;
|
||||
double Hinc;
|
||||
double Sinc;
|
||||
double Smixing;
|
||||
double Cp, Si;
|
||||
double a, b, x;
|
||||
int i;
|
||||
//initialize integrals to zero
|
||||
Cvinc = 0.0;
|
||||
Hinc = 0.0;
|
||||
Sinc = 0.0;
|
||||
//initialize entropy of mixing
|
||||
Smixing = 0.0;
|
||||
//find ideal gas Cp
|
||||
Cp = CpiMolar(ref ptAGA10);
|
||||
//find ideal gas enthalpy
|
||||
ptAGA10.dHo = Ho(ref ptAGA10);
|
||||
//find ideal gas entropy
|
||||
Si = So(ref ptAGA10);
|
||||
//calculate ideal gas specific heat capacity at constant pressure in J/kgK
|
||||
ptAGA10.dCpi = (Cp * 1000.0) / ptAGA10.dMrx;
|
||||
//integrate partial derivatives from D=0 to D=D, applying Gauss-Kronrod quadrature
|
||||
for (i = 0; i < GK_points; i++)
|
||||
{
|
||||
// set calculation point at + abscissa
|
||||
x = ptAGA10.dDf * (1.0 + GK_root[i]) / 2.0;
|
||||
//get Z at D
|
||||
ptD.zdetail(x);
|
||||
ptD.dZdT(x);
|
||||
ptD.d2ZdT2(x);
|
||||
//gather contributions at + abscissa; applying weighting factor
|
||||
Hinc += GK_weight[i] * ptD.ddZdT / x;
|
||||
Cvinc += GK_weight[i] * (2.0 * ptD.ddZdT + ptAGA10.dTf * ptD.dd2ZdT2) / x;
|
||||
Sinc += GK_weight[i] * (ptD.dZ + ptAGA10.dTf * ptD.ddZdT - 1.0) / x;
|
||||
//set calculation point at - abscissa
|
||||
x = ptAGA10.dDf * (1.0 - GK_root[i]) / 2.0;
|
||||
//get Z at D
|
||||
ptD.zdetail(x);
|
||||
//calculate 1st and 2nd partial derivatives of Z wrt T
|
||||
ptD.dZdT(x);
|
||||
ptD.d2ZdT2(x);
|
||||
//gather contributions at - abscissa; applying weighting factor
|
||||
Hinc += GK_weight[i] * ptD.ddZdT / x;
|
||||
Cvinc += GK_weight[i] * (2.0 * ptD.ddZdT + ptAGA10.dTf * ptD.dd2ZdT2) / x;
|
||||
Sinc += GK_weight[i] * (ptD.dZ + ptAGA10.dTf * ptD.ddZdT - 1.0) / x;
|
||||
}
|
||||
//return Z and partial derivatives to full molar density
|
||||
ptD.zdetail(ptAGA10.dDf);
|
||||
ptD.dZdT(ptAGA10.dDf);
|
||||
ptD.d2ZdT2(ptAGA10.dDf);
|
||||
//complete Cv molar
|
||||
Cvr = Cp - NG_Cal.RGAS * (1.0 + ptAGA10.dTf * Cvinc * 0.5 * ptAGA10.dDf);
|
||||
//intermediate values for Cp, containing 2 partial derivatives
|
||||
a = (ptAGA10.dZf + ptAGA10.dTf * ptD.ddZdT);
|
||||
b = (ptAGA10.dZf + ptAGA10.dDf * ptD.ddZdD);
|
||||
//calculate dPdT, the partial derivative of P wrt T, at D
|
||||
dPdT = NG_Cal.RGAS * ptAGA10.dDf * a;
|
||||
//calculate dPdD, the partial derivative of P wrt D, at T
|
||||
dPdD = NG_Cal.RGAS * ptAGA10.dTf * b;
|
||||
//equation completing molar Cp, cancelling appropriate terms
|
||||
Cpr = Cvr + NG_Cal.RGAS * ((a * a) / b);
|
||||
//change from molar to mass basis
|
||||
Cpr /= ptAGA10.dMrx;
|
||||
Cvr /= ptAGA10.dMrx;
|
||||
// write to the data stucture
|
||||
ptAGA10.dCv = Cvr * 1000.0; // convert from joules/kgK to kilojoules/kgK
|
||||
ptAGA10.dCp = Cpr * 1000.0;
|
||||
// calculate specific enthalpy
|
||||
ptAGA10.dH = ptAGA10.dHo + 1000.0 * NG_Cal.RGAS * ptAGA10.dTf * (ptAGA10.dZf - 1.0 - ptAGA10.dTf * Hinc * 0.5 * ptAGA10.dDf) / ptAGA10.dMrx;
|
||||
// calculate entropy of mixing
|
||||
for (i = 0; i < NG_Cal.NUMBEROFCOMPONENTS; i++)
|
||||
{
|
||||
if (ptAGA10.adMixture[i] != 0) Smixing += ptAGA10.adMixture[i] * Math.Log(ptAGA10.adMixture[i]);
|
||||
}
|
||||
Smixing *= NG_Cal.RGAS;
|
||||
// calculate specific entropy
|
||||
ptAGA10.dS = Si - Smixing - 1000.0 * NG_Cal.RGAS * (Math.Log(ptAGA10.dPf / 101325.0) - Math.Log(ptAGA10.dZf) + Sinc * 0.5 * ptAGA10.dDf) / ptAGA10.dMrx;
|
||||
return;
|
||||
}//CprCvrHS()
|
||||
/**************************************************************************
|
||||
*Function:HS_Mode()
|
||||
*Arguments:ref AGA10.GasPropsSTRUCT , Detail *, double, double, bool
|
||||
*Returns:void
|
||||
*Purpose:Calculates a pressure & temperature from known enthalpy & entropy,
|
||||
*with or without prior estimates.This function has a role in the
|
||||
*calculation of C*.
|
||||
*Solution based on a doubly-nested trial & error algorithm and Newton's
|
||||
*method.
|
||||
*
|
||||
*For illustrative purpose, two approaches are supported by this example.
|
||||
*If you are starting without advance knowledge of P & T, set the input parm
|
||||
*bGuess to false, thus specifying a conservative search approach.
|
||||
*If, however, you have a basis for guessing P & T (plenum conditions of a
|
||||
*critical flow nozzle, for example) set P & T via GasPropsSTRUCT and set
|
||||
*bGuess = true. The initial guess allows the search function to be more
|
||||
*aggressive and, typically, faster.
|
||||
*
|
||||
*Revisions:
|
||||
**************************************************************************/
|
||||
public void HS_Mode(ref NG_Cal.GasPropsSTRUCT ptAGA10, ref Detail ptD, double H, double S, bool bGuess)
|
||||
{
|
||||
double s0, s1, s2, t0, t1, t2, tmin, tmax; double h0, h1, h2, p0, p1, p2, px, pmin, pmax; double delta1, delta2;
|
||||
double tolerance = 0.001;// convergence tolerance (used for both H and S searches)
|
||||
int i, j;
|
||||
//s0and h0 are our real gas reference points
|
||||
s0 = S;
|
||||
h0 = H;
|
||||
//calling function specifies whether search parameters are supplied thru ptAGA10 or unknown
|
||||
if (bGuess)
|
||||
{
|
||||
t1 = ptAGA10.dTf; px = ptAGA10.dPf; pmax = px * 2.0; pmin = px * 0.1;
|
||||
tmax = t1 * 1.5; tmin = t1 * 0.67;
|
||||
}
|
||||
else// use arbitrary, generic limits
|
||||
{
|
||||
t1 = 273.15;
|
||||
px = 1013250.0; // 10 atmospheres
|
||||
pmax = NG_Cal.P_MAX;
|
||||
pmin = 10000.0; // 10 kPa
|
||||
tmax = NG_Cal.T_MAX;
|
||||
tmin = NG_Cal.T_MIN;
|
||||
}
|
||||
// set the temperature differential
|
||||
t2 = t1 + 10.0;
|
||||
///////////////////////////////////////////
|
||||
//begin double trial-and-error, searching for T & P
|
||||
//run the calculation with initial guesses
|
||||
ptD.Run(ref ptAGA10);
|
||||
//h1 is difference between h given and h@Tf, Pf
|
||||
h1 = this.H(ref ptAGA10, ref ptD) - h0;
|
||||
//outer loop: search for a t2 which will satisfy constant enthalpy
|
||||
for (i = 0; i < NG_Cal.MAX_NUM_OF_ITERATIONS; i++)
|
||||
{
|
||||
ptAGA10.dTf = t2;
|
||||
p1 = px;// reset one bracket
|
||||
p2 = px * 0.1;// set other bracket to 0.1x the upper bracket
|
||||
ptAGA10.dPf = p1;
|
||||
ptD.Run(ref ptAGA10);
|
||||
s1 = this.S(ref ptAGA10, ref ptD) - s0;
|
||||
//inside loop: search for a p2 which will satisfy constant entropy
|
||||
for (j = 0; j < NG_Cal.MAX_NUM_OF_ITERATIONS; j++)
|
||||
{
|
||||
ptAGA10.dPf = p2; ptD.Run(ref ptAGA10);
|
||||
s2 = this.S(ref ptAGA10, ref ptD) - s0;
|
||||
//calculate our proportional change
|
||||
delta2 = Math.Abs(s1 - s2) / s0; // close enough?
|
||||
if (delta2 < tolerance) break;
|
||||
//revise our estimate to p2
|
||||
p0 = p2;
|
||||
p2 = (p1 * s2 - p2 * s1) / (s2 - s1);
|
||||
//check for negative pressure and clamp to pmin for safety
|
||||
if (p2 <= pmin)
|
||||
{
|
||||
p2 = pmin;
|
||||
}
|
||||
//check if we've created an unrealistic pressure
|
||||
if (p2 >= pmax) p2 = pmax; // swap values
|
||||
p1 = p0;
|
||||
s1 = s2;
|
||||
}
|
||||
// check for failure to converge
|
||||
if (j >= NG_Cal.MAX_NUM_OF_ITERATIONS) ptAGA10.lStatus = NG_Cal.MAX_NUM_OF_ITERATIONS_EXCEEDED;
|
||||
//calc enthalpy at guessed P & current iter T
|
||||
h2 = this.H(ref ptAGA10, ref ptD) - h0;
|
||||
//calculate our proportional change
|
||||
delta1 = Math.Abs(h1 - h2) / h0;
|
||||
// close enough?
|
||||
if (delta1 < tolerance && i > 0) break;
|
||||
//revise our estimate to t2
|
||||
t0 = t2;
|
||||
t2 = (t1 * h2 - t2 * h1) / (h2 - h1);
|
||||
//check if we've created an unrealistic temperature
|
||||
if (t2 >= tmax) t2 = tmax;
|
||||
//revise t2, if necessary
|
||||
if (t2 <= tmin)
|
||||
{
|
||||
t2 = t0 + 10.0;
|
||||
ptAGA10.dTf = t2; ptD.Run(ref ptAGA10);
|
||||
h2 = this.H(ref ptAGA10, ref ptD) - h0;
|
||||
}
|
||||
t1 = t0;
|
||||
h1 = h2;
|
||||
}
|
||||
// check for failure to converge
|
||||
if (i >= NG_Cal.MAX_NUM_OF_ITERATIONS) ptAGA10.lStatus = NG_Cal.MAX_NUM_OF_ITERATIONS_EXCEEDED;
|
||||
}//HS_Mode()
|
||||
/**************************************************************************
|
||||
*Function:H()
|
||||
*Arguments:ref AGA10.GasPropsSTRUCT , Detail *
|
||||
*Returns:double
|
||||
*Purpose:real gas specific enthalpy
|
||||
*Revisions:
|
||||
**************************************************************************/
|
||||
double H(ref NG_Cal.GasPropsSTRUCT ptAGA10, ref Detail ptD)
|
||||
{
|
||||
double Hinc; double x; int i;
|
||||
//initialize integral
|
||||
Hinc = 0.0;
|
||||
//find ideal gas enthalpy
|
||||
ptAGA10.dHo = Ho(ref ptAGA10);
|
||||
//integrate partial derivatives from D=0 to D=D, applying Gauss-Kronrod quadrature
|
||||
for (i = 0; i < GK_points; i++)
|
||||
{
|
||||
//calculate 1st and 2nd partial derivatives of Z wrt T
|
||||
x = ptAGA10.dDf * (1.0 + GK_root[i]) / 2.0; ptD.zdetail(x);
|
||||
ptD.dZdT(x);
|
||||
ptD.d2ZdT2(x);
|
||||
Hinc += GK_weight[i] * ptD.ddZdT / x; if (i == 10) break;
|
||||
x = ptAGA10.dDf * (1.0 - GK_root[i]) / 2.0; ptD.zdetail(x);
|
||||
ptD.dZdT(x); ptD.d2ZdT2(x);
|
||||
Hinc += GK_weight[i] * ptD.ddZdT / x;
|
||||
}
|
||||
ptD.zdetail(ptAGA10.dDf); ptD.dZdT(ptAGA10.dDf); ptD.d2ZdT2(ptAGA10.dDf);
|
||||
// calculate specific enthalpy
|
||||
ptAGA10.dH = ptAGA10.dHo + 1000.0 * NG_Cal.RGAS * ptAGA10.dTf *
|
||||
(ptAGA10.dZf - 1.0 - ptAGA10.dTf * Hinc * 0.5 * ptAGA10.dDf) / ptAGA10.dMrx;
|
||||
return (ptAGA10.dH);
|
||||
} // H()
|
||||
/**************************************************************************
|
||||
*Function:S()
|
||||
*Arguments:ref AGA10.GasPropsSTRUCT , Detail *
|
||||
*Returns:double
|
||||
*Purpose:real gas specific entropy
|
||||
*Revisions:
|
||||
**************************************************************************/
|
||||
double S(ref NG_Cal.GasPropsSTRUCT ptAGA10, ref Detail ptD)
|
||||
{
|
||||
double Sinc; double Smixing; double x;
|
||||
int i;
|
||||
//initialize integral
|
||||
Sinc = 0.0;
|
||||
//initialize entropy of mixing
|
||||
Smixing = 0.0;
|
||||
//integrate partial derivatives from D=0 to D=D, applying Gauss-Kronrod quadrature
|
||||
for (i = 0; i < GK_points; i++)
|
||||
{
|
||||
//calculate 1st and 2nd partial derivatives of Z wrt T
|
||||
x = ptAGA10.dDf * (1.0 + GK_root[i]) / 2.0; ptD.zdetail(x);
|
||||
ptD.dZdT(x); ptD.d2ZdT2(x);
|
||||
Sinc += GK_weight[i] * (ptD.dZ + ptAGA10.dTf * ptD.ddZdT - 1.0) / x;
|
||||
if (i == 10) break;
|
||||
x = ptAGA10.dDf * (1.0 - GK_root[i]) / 2.0; ptD.zdetail(x);
|
||||
ptD.dZdT(x); ptD.d2ZdT2(x);
|
||||
Sinc += GK_weight[i] * (ptD.dZ + ptAGA10.dTf * ptD.ddZdT - 1.0) / x;
|
||||
}
|
||||
//reset Z and partial deivatives dZdT and d2ZdT2
|
||||
ptD.zdetail(ptAGA10.dDf);
|
||||
ptD.dZdT(ptAGA10.dDf);
|
||||
ptD.d2ZdT2(ptAGA10.dDf);
|
||||
//find ideal gas entropy, but only if temperature or composition have changed
|
||||
if (ptAGA10.dTf != dTold || ptAGA10.dMrx != dMrxold)
|
||||
{
|
||||
dSi = So(ref ptAGA10); dTold = ptAGA10.dTf; dMrxold = ptAGA10.dMrx;
|
||||
}
|
||||
//calculate entropy of mixing
|
||||
for (i = 0; i < NG_Cal.NUMBEROFCOMPONENTS; i++)
|
||||
{
|
||||
if (ptAGA10.adMixture[i] != 0) Smixing += ptAGA10.adMixture[i] * Math.Log(ptAGA10.adMixture[i]);
|
||||
}
|
||||
Smixing *= NG_Cal.RGAS;
|
||||
// calculate specific entropy
|
||||
ptAGA10.dS = dSi - Smixing - 1000.0 * NG_Cal.RGAS * (Math.Log(ptAGA10.dPf / 101325.0) - Math.Log(ptAGA10.dZf) + Sinc * 0.5 * ptAGA10.dDf) / ptAGA10.dMrx;
|
||||
return (ptAGA10.dS);
|
||||
} // S()
|
||||
}
|
||||
}
|
407
AGA8_10/UnitConvert.cs
Normal file
407
AGA8_10/UnitConvert.cs
Normal file
@ -0,0 +1,407 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using System.Text;
|
||||
|
||||
namespace NG_Tools
|
||||
{
|
||||
public class UnitConvert
|
||||
{
|
||||
public double Converter(string UnitName, double oldValue, int oldunit, int newunit, int Xsdws)
|
||||
{
|
||||
double returnValue = 0;
|
||||
//On Error Resume Next VBConversions Warning: On Error Resume Next not supported in C#
|
||||
//Dim strUnit() As String
|
||||
double[] dataUnit = new double[] { 0 };
|
||||
|
||||
//ReDim strUnit(UnitNum)
|
||||
//RereDim dataUnit(UnitNum)
|
||||
switch (UnitName)
|
||||
{
|
||||
case "tj":
|
||||
|
||||
dataUnit = new double[8];
|
||||
|
||||
|
||||
//strUnit(0) = "立方米(m3)"
|
||||
//strUnit(1) = "升(L, dm3)"
|
||||
//strUnit(2) = "立方厘米(cm3, ml, c.c)"
|
||||
//strUnit(3) = "立方英尺(ft3)"
|
||||
//strUnit(4) = "立方英寸(in3)"
|
||||
//strUnit(5) = "英加仑(UKgal)"
|
||||
//strUnit(6) = "美加仑(U.Sgal)"
|
||||
//strUnit(7) = "美油桶(USbbl)"
|
||||
|
||||
dataUnit[0] = 1;
|
||||
dataUnit[1] = 1000;
|
||||
dataUnit[2] = 1000000;
|
||||
dataUnit[3] = 35.3147;
|
||||
dataUnit[4] = 61023.7;
|
||||
dataUnit[5] = 219.969;
|
||||
dataUnit[6] = 264.172;
|
||||
dataUnit[7] = 6.28994;
|
||||
break;
|
||||
|
||||
case "zl":
|
||||
|
||||
//strUnit(0) = "千克(公斤)(kg)"
|
||||
//strUnit(1) = "克(g)"
|
||||
//strUnit(2) = "毫克(mg)"
|
||||
//strUnit(3) = "吨(t)"
|
||||
//strUnit(4) = "英吨(长吨)(UKton)"
|
||||
//strUnit(5) = "美吨(短吨)(U.Ston)"
|
||||
//strUnit(6) = "磅(lb)"
|
||||
//strUnit(7) = "盎司(oz)"
|
||||
dataUnit = new double[8]; //As Double
|
||||
|
||||
|
||||
dataUnit[0] = 1;
|
||||
dataUnit[1] = 1000;
|
||||
dataUnit[2] = 1000000;
|
||||
dataUnit[3] = 0.001;
|
||||
dataUnit[4] = 0.000984207;
|
||||
dataUnit[5] = 0.00110231;
|
||||
dataUnit[6] = 2.20462;
|
||||
dataUnit[7] = 35.274;
|
||||
break;
|
||||
case "rl":
|
||||
//strUnit(0) = "焦耳(J)"
|
||||
//strUnit(1) = "马力小时(Hp·h)"
|
||||
//strUnit(2) = "公斤力·米(kgf·m)"
|
||||
//strUnit(3) = "升·大气压(L·atm)"
|
||||
//strUnit(4) = "尔格(erg)"
|
||||
//strUnit(5) = "千卡(kacl)"
|
||||
//strUnit(6) = "千瓦小时(kW·h)"
|
||||
//strUnit(7) = "英马力小时(UKHp·h)"
|
||||
//strUnit(8) = "英尺·磅力(ft·lbf)"
|
||||
//strUnit(9) = "英热单位(BTU)"
|
||||
dataUnit = new double[10]; // As Double
|
||||
|
||||
|
||||
dataUnit[0] = 1;
|
||||
dataUnit[1] = 0.000000377672;
|
||||
dataUnit[2] = 0.101972;
|
||||
dataUnit[3] = 0.00986923;
|
||||
dataUnit[4] = 107;
|
||||
dataUnit[5] = 0.000238846;
|
||||
dataUnit[6] = 0.000000277778;
|
||||
dataUnit[7] = 0.000000372506;
|
||||
dataUnit[8] = 0.737562;
|
||||
dataUnit[9] = 0.000947813;
|
||||
break;
|
||||
|
||||
|
||||
case "nlll":
|
||||
//strUnit(0) = "兆焦/秒(MJ/s)"
|
||||
//strUnit(1) = "兆焦/小时(MJ/h)"
|
||||
//strUnit(2) = "兆焦/天(MJ/d)"
|
||||
//strUnit(3) = "千卡/秒(kcal/s)"
|
||||
//strUnit(4) = "千卡/小时(kcal/h)"
|
||||
//strUnit(5) = "英热单位/秒(BTU/s)"
|
||||
//strUnit(6) = "英热单位/小时(BTU/h)"
|
||||
|
||||
dataUnit = new double[7]; //As Double
|
||||
|
||||
dataUnit[0] = 1;
|
||||
dataUnit[1] = 3600;
|
||||
dataUnit[2] = 86400;
|
||||
dataUnit[3] = 238.846;
|
||||
dataUnit[4] = 859845.6;
|
||||
dataUnit[5] = 947.813;
|
||||
dataUnit[6] = 3412126.8;
|
||||
break;
|
||||
|
||||
case "zlll":
|
||||
|
||||
//strUnit(0) = "千克(公斤)/秒(kg/s)"
|
||||
//strUnit(1) = "千克(公斤)/分(kg/Min)"
|
||||
//strUnit(2) = "千克(公斤)/时(kg/h)"
|
||||
//strUnit(3) = "磅/秒(lb/s)"
|
||||
//strUnit(4) = "磅/分(lb/Min)"
|
||||
//strUnit(5) = "磅/时(lb/h)"
|
||||
//strUnit(6) = "吨/时(t/h)"
|
||||
//strUnit(7) = "英吨(长吨)/时(UKton/h)"
|
||||
//strUnit(8) = "美吨(短吨)/小时(U.Ston/h)"
|
||||
|
||||
dataUnit = new double[9]; //As Double
|
||||
|
||||
dataUnit[0] = 1;
|
||||
dataUnit[1] = 60;
|
||||
dataUnit[2] = 3600;
|
||||
dataUnit[3] = 2.20462;
|
||||
dataUnit[4] = 132.2772;
|
||||
dataUnit[5] = 7936.632;
|
||||
dataUnit[6] = 3.6;
|
||||
dataUnit[7] = 3.543145;
|
||||
dataUnit[8] = 3.968316;
|
||||
break;
|
||||
case "tjll":
|
||||
//strUnit(0) = "立方米/秒(m3/s)"
|
||||
//strUnit(1) = "万立方米/天(m3/d)"
|
||||
//strUnit(1) = "立方米/时(m3/h)"
|
||||
//strUnit(2) = "立方米/分(m3/Min)"
|
||||
//strUnit(3) = "升/时(L/h)"
|
||||
//strUnit(4) = "升/分(L/Min)"
|
||||
//strUnit(5) = "升/秒(L/s)"
|
||||
//strUnit(6) = "立方英尺/时(ft3/h)"
|
||||
//strUnit(7) = "立方英尺/分(ft3/Min)"
|
||||
//strUnit(8) = "立方英尺/秒(ft3/s)"
|
||||
//strUnit(9) = "立方英尺/秒(ft3/s)"
|
||||
//strUnit(10) = "立方英尺/天(ft3/d)"
|
||||
|
||||
//strUnit(11) = "英加仑/秒(UKgal/s)"
|
||||
//strUnit(12) = "美加仑/秒(U.Sgal/s)"
|
||||
//strUnit(13) = "美油桶/秒(USbbl/s)"
|
||||
|
||||
|
||||
dataUnit = new double[13]; //As Double
|
||||
|
||||
dataUnit[0] = 1;
|
||||
dataUnit[1] = 8.64;
|
||||
dataUnit[2] = 3600;
|
||||
dataUnit[3] = 60;
|
||||
dataUnit[4] = 3600000;
|
||||
dataUnit[5] = 60000;
|
||||
dataUnit[6] = 1000;
|
||||
dataUnit[7] = 127132.92;
|
||||
dataUnit[8] = 2118.882;
|
||||
dataUnit[8] = 0.0245240972222222;
|
||||
dataUnit[9] = 35.3147;
|
||||
dataUnit[10] = 219.969;
|
||||
dataUnit[11] = 264.172;
|
||||
dataUnit[12] = 6.28994;
|
||||
break;
|
||||
|
||||
|
||||
case "yl":
|
||||
//strUnit(0) = "帕(Pa)"
|
||||
//strUnit(1) = "千帕(kPa)"
|
||||
//strUnit(2) = "兆帕(Mpa)"
|
||||
//strUnit(3) = "标准大气压(atm)"
|
||||
//strUnit(4) = "毫巴(mbar)"
|
||||
//strUnit(5) = "巴(bar)"
|
||||
//strUnit(6) = "千克力/平方米(kgf/m2)"
|
||||
//strUnit(7) = "千克力/平方厘米(kgf/cm2)"
|
||||
//strUnit(8) = "毫米汞柱(mmHg)"
|
||||
//strUnit(9) = "毫米水柱4℃(mmH2O)"
|
||||
//strUnit(10) = "磅/平方英寸(psi)"
|
||||
|
||||
dataUnit = new double[11]; //As Double
|
||||
|
||||
dataUnit[0] = 1;
|
||||
dataUnit[1] = 0.001;
|
||||
dataUnit[2] = 0.000001;
|
||||
dataUnit[3] = 0.00000986923266716013;
|
||||
dataUnit[4] = 0.01;
|
||||
dataUnit[5] = 0.00001;
|
||||
dataUnit[6] = 0.101971621;
|
||||
dataUnit[7] = 0.0000101972;
|
||||
dataUnit[8] = 0.007500638;
|
||||
dataUnit[9] = 0.101972;
|
||||
dataUnit[10] = 0.000145038;
|
||||
break;
|
||||
|
||||
case "wd":
|
||||
switch (newunit)
|
||||
{
|
||||
case 0:
|
||||
switch (oldunit)
|
||||
{
|
||||
case 0:
|
||||
returnValue = oldValue;
|
||||
break;
|
||||
case 1: //K->℃
|
||||
returnValue = oldValue - 273.15;
|
||||
break;
|
||||
case 2: //F->℃
|
||||
returnValue = (oldValue - 32) / 1.8;
|
||||
break;
|
||||
case 3: //R->℃
|
||||
returnValue = oldValue / 1.8 - 273.15;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
switch (oldunit)
|
||||
{
|
||||
case 0: //℃->K
|
||||
returnValue = oldValue + 273.15;
|
||||
break;
|
||||
case 1:
|
||||
returnValue = oldValue;
|
||||
break;
|
||||
case 2: //F->K
|
||||
returnValue = (oldValue - 32) / 1.8 + 273.15;
|
||||
break;
|
||||
case 3: //R->K
|
||||
returnValue = oldValue / 1.8;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
switch (oldunit)
|
||||
{
|
||||
case 0: //C->F
|
||||
returnValue = oldValue * 1.8 + 32;
|
||||
break;
|
||||
case 1: //k->f
|
||||
returnValue = (oldValue - 273.15) * 1.8 + 32;
|
||||
break;
|
||||
case 2:
|
||||
returnValue = oldValue;
|
||||
break;
|
||||
case 3: //R->F
|
||||
returnValue = oldValue - 273.15 * 1.8 + 32;
|
||||
break;
|
||||
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch (oldunit)
|
||||
{
|
||||
case 0: //C->R
|
||||
returnValue = (oldValue + 273.15) * 1.8;
|
||||
break;
|
||||
case 1: //K->R
|
||||
returnValue = oldValue * 1.8;
|
||||
break;
|
||||
case 2: //F->R
|
||||
returnValue = (oldValue - 32) + 273.15 * 1.8;
|
||||
break;
|
||||
case 3:
|
||||
returnValue = oldValue;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return returnValue;
|
||||
case "cd":
|
||||
//米(m)
|
||||
//分米(dm)
|
||||
//厘米(cm)
|
||||
//毫米(mm)
|
||||
//英尺(ft)
|
||||
//英寸(in)
|
||||
//英里(mile)
|
||||
//英寻(fm)
|
||||
//海里(nmile)
|
||||
//埃(a)
|
||||
//码(yd)
|
||||
//密尔(mil)
|
||||
//杆<(rad)
|
||||
|
||||
dataUnit = new double[14]; //As Double
|
||||
|
||||
|
||||
dataUnit[0] = 1;
|
||||
dataUnit[1] = 10;
|
||||
dataUnit[2] = 100;
|
||||
dataUnit[3] = 1000;
|
||||
dataUnit[4] = 3.28038;
|
||||
dataUnit[5] = 39.3700787401575;
|
||||
dataUnit[6] = 0.001;
|
||||
dataUnit[7] = 0.000621504039776259;
|
||||
dataUnit[8] = 0.546746856205577;
|
||||
dataUnit[9] = 0.000539956803455;
|
||||
dataUnit[10] = 10000000000.0D;
|
||||
dataUnit[11] = 1.093613;
|
||||
dataUnit[12] = 39370.0787401575;
|
||||
dataUnit[13] = 0.198838781515947;
|
||||
break;
|
||||
|
||||
case "mj":
|
||||
|
||||
|
||||
//平方米m2
|
||||
//平方分米dm2
|
||||
//平方厘米cm2
|
||||
//平方毫米mm2
|
||||
//平方英尺ft2
|
||||
//平方英寸in2
|
||||
//平方公里km2
|
||||
//公顷ha
|
||||
//公亩are
|
||||
//英亩acre
|
||||
//平方英里sq -mile
|
||||
//平方码yd2
|
||||
|
||||
dataUnit = new double[12]; //As Double
|
||||
|
||||
|
||||
dataUnit[0] = 1;
|
||||
dataUnit[1] = 100;
|
||||
dataUnit[2] = 10000;
|
||||
dataUnit[3] = 1000000;
|
||||
dataUnit[4] = 10.7608929444;
|
||||
dataUnit[5] = 1550.0031;
|
||||
dataUnit[6] = 0.000001;
|
||||
dataUnit[7] = 0.0001;
|
||||
dataUnit[8] = 0.01;
|
||||
dataUnit[9] = 0.0002471;
|
||||
dataUnit[10] = 0.000000386102158;
|
||||
dataUnit[11] = 1.19599;
|
||||
break;
|
||||
//小时
|
||||
//分钟
|
||||
//天
|
||||
//秒
|
||||
|
||||
case "sj":
|
||||
dataUnit = new double[4]; //As Double
|
||||
|
||||
dataUnit[0] = 1;
|
||||
dataUnit[1] = 60;
|
||||
dataUnit[2] = 0.0416666666666667;
|
||||
dataUnit[3] = 3600;
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case "sd":
|
||||
break;
|
||||
//米每秒
|
||||
//厘米每秒
|
||||
//
|
||||
}
|
||||
if (newunit == oldunit)
|
||||
{
|
||||
return oldValue;
|
||||
|
||||
}
|
||||
return SsWr(oldValue * dataUnit[newunit] / dataUnit[oldunit], Xsdws);
|
||||
|
||||
}
|
||||
|
||||
private double SsWr(double value, int weishu)
|
||||
{
|
||||
long tempValue = 0;
|
||||
double SorR = 0;
|
||||
try
|
||||
{
|
||||
tempValue = (long)(value * Math.Pow(10, weishu));
|
||||
|
||||
SorR = System.Convert.ToInt32((value * Math.Pow(10, weishu) - tempValue) * 10);
|
||||
if (SorR >= 5)
|
||||
{
|
||||
tempValue++;
|
||||
}
|
||||
return tempValue / Math.Pow(10, weishu);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
return value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
BIN
AGA8_10/bin/Debug/NG_Tools.dll
Normal file
BIN
AGA8_10/bin/Debug/NG_Tools.dll
Normal file
Binary file not shown.
BIN
AGA8_10/bin/Debug/NG_Tools.pdb
Normal file
BIN
AGA8_10/bin/Debug/NG_Tools.pdb
Normal file
Binary file not shown.
BIN
AGA8_10/bin/Release/NG_Tools.dll
Normal file
BIN
AGA8_10/bin/Release/NG_Tools.dll
Normal file
Binary file not shown.
BIN
AGA8_10/bin/Release/NG_Tools.pdb
Normal file
BIN
AGA8_10/bin/Release/NG_Tools.pdb
Normal file
Binary file not shown.
10
AGA8_10/obj/Debug/AGA8_10.csproj.FileListAbsolute.txt
Normal file
10
AGA8_10/obj/Debug/AGA8_10.csproj.FileListAbsolute.txt
Normal file
@ -0,0 +1,10 @@
|
||||
e:\ldy\documents\visual studio 2013\Projects\AGA8_10\AGA8_10\obj\Debug\AGA8_10.csprojResolveAssemblyReference.cache
|
||||
E:\My Documents\Desktop\AGA8_10\AGA8_10\obj\Debug\AGA8_10.csprojResolveAssemblyReference.cache
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\obj\Debug\AGA8_10.dll
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\bin\Debug\AGA8_10.dll
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\bin\Debug\AGA8_10.pdb
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\obj\Debug\AGA8_10.pdb
|
||||
E:\My Documents\Desktop\AGA8_10\AGA8_10\bin\Debug\NG_Cal.dll
|
||||
E:\My Documents\Desktop\AGA8_10\AGA8_10\bin\Debug\NG_Cal.pdb
|
||||
E:\My Documents\Desktop\AGA8_10\AGA8_10\obj\Debug\NG_Cal.dll
|
||||
E:\My Documents\Desktop\AGA8_10\AGA8_10\obj\Debug\NG_Cal.pdb
|
BIN
AGA8_10/obj/Debug/AGA8_10.csprojResolveAssemblyReference.cache
Normal file
BIN
AGA8_10/obj/Debug/AGA8_10.csprojResolveAssemblyReference.cache
Normal file
Binary file not shown.
BIN
AGA8_10/obj/Debug/DesignTimeResolveAssemblyReferences.cache
Normal file
BIN
AGA8_10/obj/Debug/DesignTimeResolveAssemblyReferences.cache
Normal file
Binary file not shown.
BIN
AGA8_10/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Normal file
BIN
AGA8_10/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Normal file
Binary file not shown.
BIN
AGA8_10/obj/Debug/NG_Cal.VerifiSys.resources
Normal file
BIN
AGA8_10/obj/Debug/NG_Cal.VerifiSys.resources
Normal file
Binary file not shown.
13
AGA8_10/obj/Debug/NG_Cal.csproj.FileListAbsolute.txt
Normal file
13
AGA8_10/obj/Debug/NG_Cal.csproj.FileListAbsolute.txt
Normal file
@ -0,0 +1,13 @@
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\bin\Debug\NG_Cal.dll
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\bin\Debug\NG_Cal.pdb
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\obj\Debug\NG_Cal.dll
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\obj\Debug\NG_Cal.pdb
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\obj\Debug\NG_Cal.csprojResolveAssemblyReference.cache
|
||||
E:\ldy\Desktop\AGA8_10\AGA8_10\bin\Debug\NG_Cal.dll
|
||||
E:\ldy\Desktop\AGA8_10\AGA8_10\bin\Debug\NG_Cal.pdb
|
||||
E:\ldy\Desktop\AGA8_10\AGA8_10\obj\Debug\NG_Cal.dll
|
||||
E:\ldy\Desktop\AGA8_10\AGA8_10\obj\Debug\NG_Cal.pdb
|
||||
E:\My Documents\Desktop\AGA8_10\AGA8_10\bin\Debug\NG_Tools.dll
|
||||
E:\My Documents\Desktop\AGA8_10\AGA8_10\bin\Debug\NG_Tools.pdb
|
||||
E:\My Documents\Desktop\AGA8_10\AGA8_10\obj\Debug\NG_Tools.dll
|
||||
E:\My Documents\Desktop\AGA8_10\AGA8_10\obj\Debug\NG_Tools.pdb
|
BIN
AGA8_10/obj/Debug/NG_Cal.csproj.GenerateResource.Cache
Normal file
BIN
AGA8_10/obj/Debug/NG_Cal.csproj.GenerateResource.Cache
Normal file
Binary file not shown.
BIN
AGA8_10/obj/Debug/NG_Cal.csprojResolveAssemblyReference.cache
Normal file
BIN
AGA8_10/obj/Debug/NG_Cal.csprojResolveAssemblyReference.cache
Normal file
Binary file not shown.
BIN
AGA8_10/obj/Debug/NG_Cal.dll
Normal file
BIN
AGA8_10/obj/Debug/NG_Cal.dll
Normal file
Binary file not shown.
BIN
AGA8_10/obj/Debug/NG_Cal.pdb
Normal file
BIN
AGA8_10/obj/Debug/NG_Cal.pdb
Normal file
Binary file not shown.
39
AGA8_10/obj/Debug/NG_Tools.csproj.FileListAbsolute.txt
Normal file
39
AGA8_10/obj/Debug/NG_Tools.csproj.FileListAbsolute.txt
Normal file
@ -0,0 +1,39 @@
|
||||
E:\My Documents\Desktop\AGA8_10\AGA8_10\bin\Debug\NG_Tools.dll
|
||||
E:\My Documents\Desktop\AGA8_10\AGA8_10\bin\Debug\NG_Tools.pdb
|
||||
E:\My Documents\Desktop\AGA8_10\AGA8_10\obj\Debug\NG_Tools.dll
|
||||
E:\My Documents\Desktop\AGA8_10\AGA8_10\obj\Debug\NG_Tools.pdb
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\bin\Debug\NG_Tools.dll
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\bin\Debug\NG_Tools.pdb
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\bin\Debug\NG_Tools.tlb
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\obj\Debug\NG_Tools.dll
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\obj\Debug\NG_Tools.pdb
|
||||
C:\Users\Intouch\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\bin\Debug\NG_Tools.dll
|
||||
C:\Users\Intouch\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\bin\Debug\NG_Tools.pdb
|
||||
C:\Users\Intouch\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\bin\Debug\NG_Tools.tlb
|
||||
C:\Users\Intouch\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\obj\Debug\NG_Tools.dll
|
||||
C:\Users\Intouch\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\obj\Debug\NG_Tools.pdb
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\AGA8_10\AGA8_10\obj\Debug\NG_Tools.csprojResolveAssemblyReference.cache
|
||||
C:\Users\ldeyu\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\bin\Debug\NG_Tools.dll
|
||||
C:\Users\ldeyu\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\bin\Debug\NG_Tools.pdb
|
||||
C:\Users\ldeyu\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\bin\Debug\NG_Tools.tlb
|
||||
C:\Users\ldeyu\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\obj\Debug\NG_Tools.csprojAssemblyReference.cache
|
||||
C:\Users\ldeyu\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\obj\Debug\NG_Tools.dll
|
||||
C:\Users\ldeyu\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\obj\Debug\NG_Tools.pdb
|
||||
D:\MyDocument\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\bin\Debug\NG_Tools.dll
|
||||
D:\MyDocument\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\bin\Debug\NG_Tools.pdb
|
||||
D:\MyDocument\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\bin\Debug\NG_Tools.tlb
|
||||
D:\MyDocument\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\obj\Debug\NG_Tools.csprojAssemblyReference.cache
|
||||
D:\MyDocument\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\obj\Debug\NG_Tools.dll
|
||||
D:\MyDocument\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\obj\Debug\NG_Tools.pdb
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\bin\Debug\NG_Tools.dll
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\bin\Debug\NG_Tools.pdb
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\bin\Debug\NG_Tools.tlb
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\obj\Debug\NG_Tools.dll
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\obj\Debug\NG_Tools.pdb
|
||||
E:\My Documents\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\bin\Debug\NG_Tools.dll
|
||||
E:\My Documents\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\bin\Debug\NG_Tools.pdb
|
||||
E:\My Documents\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\bin\Debug\NG_Tools.tlb
|
||||
E:\My Documents\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\obj\Debug\NG_Tools.dll
|
||||
E:\My Documents\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\obj\Debug\NG_Tools.pdb
|
||||
E:\My Documents\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\obj\Debug\NG_Tools.csprojAssemblyReference.cache
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\obj\Debug\NG_Tools.csprojAssemblyReference.cache
|
BIN
AGA8_10/obj/Debug/NG_Tools.csprojAssemblyReference.cache
Normal file
BIN
AGA8_10/obj/Debug/NG_Tools.csprojAssemblyReference.cache
Normal file
Binary file not shown.
BIN
AGA8_10/obj/Debug/NG_Tools.csprojResolveAssemblyReference.cache
Normal file
BIN
AGA8_10/obj/Debug/NG_Tools.csprojResolveAssemblyReference.cache
Normal file
Binary file not shown.
BIN
AGA8_10/obj/Debug/NG_Tools.dll
Normal file
BIN
AGA8_10/obj/Debug/NG_Tools.dll
Normal file
Binary file not shown.
BIN
AGA8_10/obj/Debug/NG_Tools.pdb
Normal file
BIN
AGA8_10/obj/Debug/NG_Tools.pdb
Normal file
Binary file not shown.
BIN
AGA8_10/obj/NG_Tools.csproj.UnmanagedRegistration.cache
Normal file
BIN
AGA8_10/obj/NG_Tools.csproj.UnmanagedRegistration.cache
Normal file
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
||||
ac7dff52d59b5a0ed089bc9959ede1638673797d
|
15
AGA8_10/obj/Release/NG_Tools.csproj.FileListAbsolute.txt
Normal file
15
AGA8_10/obj/Release/NG_Tools.csproj.FileListAbsolute.txt
Normal file
@ -0,0 +1,15 @@
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\bin\Release\NG_Tools.dll
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\bin\Release\NG_Tools.pdb
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\obj\Release\NG_Tools.dll
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\obj\Release\NG_Tools.pdb
|
||||
E:\ldy\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\obj\Release\NG_Tools.csprojAssemblyReference.cache
|
||||
D:\MyDocument\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\bin\Release\NG_Tools.dll
|
||||
D:\MyDocument\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\bin\Release\NG_Tools.pdb
|
||||
D:\MyDocument\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\obj\Release\NG_Tools.csprojAssemblyReference.cache
|
||||
D:\MyDocument\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\obj\Release\NG_Tools.dll
|
||||
D:\MyDocument\Documents\Visual Studio 2019\projects\NGTools\AGA8_10\obj\Release\NG_Tools.pdb
|
||||
E:\My Documents\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\bin\Release\NG_Tools.dll
|
||||
E:\My Documents\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\bin\Release\NG_Tools.pdb
|
||||
E:\My Documents\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\obj\Release\NG_Tools.csprojAssemblyReference.cache
|
||||
E:\My Documents\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\obj\Release\NG_Tools.dll
|
||||
E:\My Documents\Documents\Visual Studio 2013\Projects\NGTools\AGA8_10\obj\Release\NG_Tools.pdb
|
BIN
AGA8_10/obj/Release/NG_Tools.csprojAssemblyReference.cache
Normal file
BIN
AGA8_10/obj/Release/NG_Tools.csprojAssemblyReference.cache
Normal file
Binary file not shown.
BIN
AGA8_10/obj/Release/NG_Tools.dll
Normal file
BIN
AGA8_10/obj/Release/NG_Tools.dll
Normal file
Binary file not shown.
BIN
AGA8_10/obj/Release/NG_Tools.pdb
Normal file
BIN
AGA8_10/obj/Release/NG_Tools.pdb
Normal file
Binary file not shown.
31
NGTools.sln
Normal file
31
NGTools.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29306.81
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NGTools", "NGTools\NGTools.csproj", "{4648AFC3-9367-4C90-83FA-8603945B1834}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NG_Tools", "AGA8_10\NG_Tools.csproj", "{186107A4-D8E6-46C1-A6CE-65E5C4F14C1B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4648AFC3-9367-4C90-83FA-8603945B1834}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4648AFC3-9367-4C90-83FA-8603945B1834}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4648AFC3-9367-4C90-83FA-8603945B1834}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4648AFC3-9367-4C90-83FA-8603945B1834}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{186107A4-D8E6-46C1-A6CE-65E5C4F14C1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{186107A4-D8E6-46C1-A6CE-65E5C4F14C1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{186107A4-D8E6-46C1-A6CE-65E5C4F14C1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{186107A4-D8E6-46C1-A6CE-65E5C4F14C1B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E2703171-2EE3-4829-99C3-250059D5A902}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
BIN
NGTools.v12.suo
Normal file
BIN
NGTools.v12.suo
Normal file
Binary file not shown.
1
NGTools/ASHX/APPTools.ashx
Normal file
1
NGTools/ASHX/APPTools.ashx
Normal file
@ -0,0 +1 @@
|
||||
<%@ WebHandler Language="C#" CodeBehind="APPTools.ashx.cs" Class="NGTools.ASHX.APPTools" %>
|
245
NGTools/ASHX/APPTools.ashx.cs
Normal file
245
NGTools/ASHX/APPTools.ashx.cs
Normal file
@ -0,0 +1,245 @@
|
||||
using NGTools.Tools;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace NGTools.ASHX
|
||||
{
|
||||
/// <summary>
|
||||
/// APPTools 的摘要说明
|
||||
/// </summary>
|
||||
public class APPTools : IHttpHandler
|
||||
{
|
||||
|
||||
public void ProcessRequest(HttpContext context)
|
||||
{
|
||||
context.Response.ContentType = "text/plain";
|
||||
|
||||
if (context.Request["action"] == "getJldMobile") //手机端select使用
|
||||
{
|
||||
|
||||
string strPhoneNo = context.Request.Form["phoneNo"];
|
||||
|
||||
DataTable dtUser = MySQLHelper.ExecuteDataTable(stringSQL.strSQL_User + strPhoneNo + "' or user_account='" + strPhoneNo + "' or phoneNo='" + strPhoneNo + "'");
|
||||
|
||||
if (dtUser.Rows.Count < 1)
|
||||
{
|
||||
context.Response.Write(dtUser.Rows.Count);
|
||||
context.Response.End();
|
||||
}
|
||||
|
||||
string strUserName = dtUser.Rows[0]["user_name"].ToString();
|
||||
string strORG_Parent_ID = dtUser.Rows[0]["ORG_ID"].ToString();
|
||||
|
||||
|
||||
|
||||
DataTable dtTree = new DataTable(); ;
|
||||
if (strUserName == "廖德云")
|
||||
{
|
||||
|
||||
dtTree = _GetTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
dtTree = _GetTable(strORG_Parent_ID);
|
||||
}
|
||||
DataView dv = dtTree.DefaultView;
|
||||
dv.RowFilter = "ORG_PARENT_ID <> 'MS00'";
|
||||
DataTable dtTemp = dv.ToTable(false, "ORG_ID", "ORG_NAME");
|
||||
|
||||
|
||||
string jsonDWZC = JSONConvert.ToJson(dtTemp, "DWZC");
|
||||
|
||||
DataTable dtTreeTemp = dtTemp.Copy();
|
||||
|
||||
string JSONJLd = "\"JLD\":[{";
|
||||
|
||||
DataTable dtJld = MySQLHelper.ExecuteDataTable("select * from jld");
|
||||
|
||||
for (int i = 0; i < dtTreeTemp.Rows.Count; i++)
|
||||
{
|
||||
dv = dtJld.DefaultView;
|
||||
dv.RowFilter = "ORG_ID='" + dtTreeTemp.Rows[i]["ORG_ID"] + "'";
|
||||
dtTemp = dv.ToTable(false, "ID", "JLD_Name");
|
||||
if (dtTemp.Rows.Count == 0)
|
||||
{
|
||||
JSONJLd += "{},";
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
JSONJLd += JSONConvert.ToJson(dtTemp, dtTreeTemp.Rows[i]["ORG_ID"].ToString());
|
||||
}
|
||||
JSONJLd = JSONJLd.TrimEnd(',') + ",";
|
||||
|
||||
}
|
||||
|
||||
JSONJLd = JSONJLd.TrimEnd(',') + "}]";
|
||||
|
||||
string json = "[{" + jsonDWZC + "},{" + JSONJLd + "}]";
|
||||
context.Response.Write(json);
|
||||
context.Response.End();
|
||||
}
|
||||
|
||||
if (context.Request["action"] == "getJldPar")
|
||||
{
|
||||
|
||||
string jldID = context.Request.Form["jldid"];
|
||||
string strGN = context.Request.Form["gnmk"];
|
||||
DataTable dtJldPar = MySQLHelper.ExecuteDataTable("select * from jldpar where JLD_ID='" + jldID + "' and gnmk='" + strGN + "'");
|
||||
|
||||
string json = JSONConvert.DataTableToJsonList(dtJldPar);
|
||||
|
||||
context.Response.Write(json);
|
||||
context.Response.End();
|
||||
}
|
||||
|
||||
if (context.Request["action"] == "getJldMobilePicker") //手机端select使用
|
||||
{
|
||||
|
||||
string strPhoneNo = context.Request.Form["phoneNo"];
|
||||
|
||||
DataTable dtUser = MySQLHelper.ExecuteDataTable(stringSQL.strSQL_User + strPhoneNo + "' or user_account='" + strPhoneNo + "' or phoneNo='" + strPhoneNo + "'");
|
||||
|
||||
if (dtUser.Rows.Count < 1)
|
||||
{
|
||||
context.Response.Write(dtUser.Rows.Count);
|
||||
context.Response.End();
|
||||
}
|
||||
|
||||
string strUserName = dtUser.Rows[0]["user_name"].ToString();
|
||||
string strORG_Parent_ID = dtUser.Rows[0]["ORG_ID"].ToString();
|
||||
|
||||
DataTable dtTree = new DataTable(); ;
|
||||
if (strUserName == "廖德云")
|
||||
{
|
||||
|
||||
dtTree = _GetTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
dtTree = _GetTable(strORG_Parent_ID);
|
||||
}
|
||||
DataView dv = dtTree.DefaultView;
|
||||
dv.RowFilter = "ORG_PARENT_ID <> 'MS00'";
|
||||
DataTable dtDWZC = dv.ToTable(false, "ORG_ID", "ORG_NAME");
|
||||
DataTable dtJld = MySQLHelper.ExecuteDataTable("select * from jld");
|
||||
|
||||
|
||||
string json = "[";
|
||||
for (int i = 0; i < dtDWZC.Rows.Count; i++)
|
||||
{
|
||||
json += "{\"value\":\"" + dtDWZC.Rows[i]["ORG_ID"] + "\",\"text\":\"" + dtDWZC.Rows[i]["ORG_NAME"] + "\"";
|
||||
dv = dtJld.DefaultView;
|
||||
dv.RowFilter = "ORG_ID='" + dtDWZC.Rows[i]["ORG_ID"] + "'";
|
||||
DataTable dtTemp = dv.ToTable(false, "ID", "JLD_Name");
|
||||
if (dtTemp.Rows.Count > 0)
|
||||
{
|
||||
json += ",\"children\": [";
|
||||
for (int j = 0; j < dtTemp.Rows.Count; j++)
|
||||
{
|
||||
json += "{" + "\"value\":\"" + dtTemp.Rows[j]["ID"] + "\",\"text\":\"" + dtTemp.Rows[j]["JLD_Name"] + "\"},";
|
||||
}
|
||||
json = json.TrimEnd(',') + "]},";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
json = json.TrimEnd(',') + "]";
|
||||
|
||||
context.Response.Write(json);
|
||||
context.Response.End();
|
||||
}
|
||||
|
||||
|
||||
if (context.Request["action"] == "APPLogin")
|
||||
{
|
||||
|
||||
|
||||
JsEncryptHelper jsHelper = new JsEncryptHelper();
|
||||
string userName = context.Request.Form["account"];
|
||||
string passWord = context.Request.Form["password"];
|
||||
|
||||
string strtemp = "";
|
||||
DataTable dtUser = MySQLHelper.ExecuteDataTable(stringSQL.strSQL_User + userName + "' or user_account='" + userName + "' or phoneNo='" + userName + "'");
|
||||
if (dtUser.Rows.Count > 0)
|
||||
{
|
||||
//if (dtUser.Rows[0]["loginflag"].ToString() == "0" || dtUser.Rows[0]["loginflag"].ToString() == "")
|
||||
//{
|
||||
|
||||
strtemp = dtUser.Rows[0]["pswd"].ToString();
|
||||
if (dtUser.Rows[0]["pswd"].ToString() == passWord)
|
||||
{
|
||||
|
||||
|
||||
|
||||
string strSQL = "insert into loginrecord (user_id,login_DateTime,IP) values (" + "'" + dtUser.Rows[0]["user_account"].ToString() + "','" + DateTime.Now + "')";
|
||||
int num = MySQLHelper.ExecuteNonQuery(strSQL);
|
||||
|
||||
//string Json = "[{";
|
||||
//Json += "\"statue\":\"OK\"," + "\"userName\":\"" + dtUser.Rows[0]["user_name"].ToString() + "\",";
|
||||
//Json += "\"userAccount\":\"" + dtUser.Rows[0]["user_account"].ToString() + "\",";
|
||||
//Json += "\"userOrgID\":\"" + dtUser.Rows[0]["ORG_ID"].ToString() + "\",";
|
||||
//Json += "\"regDateTime\":\"" + dtUser.Rows[0]["regDateTime"].ToString() + "\"}]";
|
||||
|
||||
context.Response.Write("OK");
|
||||
context.Response.End();
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Response.Write("密码错误,请仔细想想....");
|
||||
context.Response.End();
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// context.Response.Write("这个账户在别的客户端已登录");
|
||||
// context.Response.End();
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Response.Write("没有这个用户,请仔细想想你注册时用名字....");
|
||||
context.Response.End();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询组织结构数据库表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DataTable _GetTable(string strORG_PARENT_ID = "MS00")
|
||||
{
|
||||
DataTable dtOrg = new DataTable();
|
||||
if (strORG_PARENT_ID == "MS00")
|
||||
{
|
||||
dtOrg = MySQLHelper.ExecuteDataTable("select * from organization order by ID");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
dtOrg = MySQLHelper.ExecuteDataTable("select * from organization where ORG_ID='" + strORG_PARENT_ID + "' or ORG_PARENT_ID='" + strORG_PARENT_ID + "'");
|
||||
}
|
||||
return dtOrg;
|
||||
}
|
||||
|
||||
public bool IsReusable
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
1
NGTools/ASHX/ExportXls.ashx
Normal file
1
NGTools/ASHX/ExportXls.ashx
Normal file
@ -0,0 +1 @@
|
||||
<%@ WebHandler Language="C#" CodeBehind="ExportXls.ashx.cs" Class="NGTools.ASHX.ExportXls" %>
|
46
NGTools/ASHX/ExportXls.ashx.cs
Normal file
46
NGTools/ASHX/ExportXls.ashx.cs
Normal file
@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace NGTools.ASHX
|
||||
{
|
||||
/// <summary>
|
||||
/// ExportXls 的摘要说明
|
||||
/// </summary>0
|
||||
public class ExportXls : IHttpHandler
|
||||
{
|
||||
|
||||
public void ProcessRequest(HttpContext context)
|
||||
{
|
||||
context.Response.ContentType = "text/plain";
|
||||
string sActionType = context.Request.Params.Get("ActionType") == null ? "" : context.Request["ActionType"].Trim();
|
||||
if (sActionType.Equals("EasyUIDataGridToExcle"))
|
||||
{
|
||||
#region 將EasyUI的DataGrid中的數據 導出Excle
|
||||
context.Response.Clear();
|
||||
context.Response.Buffer = true;
|
||||
context.Response.Charset = "utf-8";
|
||||
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
context.Response.AppendHeader("content-disposition", "attachment;filename=\"" + HttpUtility.HtmlEncode(context.Request["txtName"] ?? DateTime.Now.ToString("yyyyMMdd")) + ".xls\"");
|
||||
context.Response.ContentType = "Application/ms-excel";
|
||||
context.Response.Write("<html>\n<head>\n");
|
||||
context.Response.Write("<style type=\"text/css\">\n.pb{font-size:13px;border-collapse:collapse;} " +
|
||||
"\n.pb th{font-weight:bold;text-align:center;border:0.5pt solid windowtext;padding:2px;} " +
|
||||
"\n.pb td{border:0.5pt solid windowtext;padding:2px;}\n</style>\n</head>\n");
|
||||
context.Response.Write("<body>\n" + context.Request["txtContent"] + "\n</body>\n</html>");
|
||||
context.Response.Flush();
|
||||
context.Response.End();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsReusable
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
1
NGTools/ASHX/FLowCal.ashx
Normal file
1
NGTools/ASHX/FLowCal.ashx
Normal file
@ -0,0 +1 @@
|
||||
<%@ WebHandler Language="C#" CodeBehind="FLowCal.ashx.cs" Class="NGTools.ASHX.FLowCal" %>
|
1070
NGTools/ASHX/FLowCal.ashx.cs
Normal file
1070
NGTools/ASHX/FLowCal.ashx.cs
Normal file
File diff suppressed because it is too large
Load Diff
1
NGTools/ASHX/getTreeCombox.ashx
Normal file
1
NGTools/ASHX/getTreeCombox.ashx
Normal file
@ -0,0 +1 @@
|
||||
<%@ WebHandler Language="C#" CodeBehind="getTreeCombox.ashx.cs" Class="NGTools.ASHX.getTreeCombox" %>
|
1275
NGTools/ASHX/getTreeCombox.ashx.cs
Normal file
1275
NGTools/ASHX/getTreeCombox.ashx.cs
Normal file
File diff suppressed because it is too large
Load Diff
1
NGTools/ASHX/login.ashx
Normal file
1
NGTools/ASHX/login.ashx
Normal file
@ -0,0 +1 @@
|
||||
<%@ WebHandler Language="C#" CodeBehind="login.ashx.cs" Class="NGTools.ASHX.login" %>
|
298
NGTools/ASHX/login.ashx.cs
Normal file
298
NGTools/ASHX/login.ashx.cs
Normal file
@ -0,0 +1,298 @@
|
||||
using NGTools.Tools;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace NGTools.ASHX
|
||||
{
|
||||
/// <summary>
|
||||
/// login 的摘要说明
|
||||
/// </summary>
|
||||
public class login : IHttpHandler
|
||||
{
|
||||
|
||||
public void ProcessRequest(HttpContext context)
|
||||
{ JsEncryptHelper jsHelper = new JsEncryptHelper();
|
||||
string a = "";
|
||||
string b = "";
|
||||
string userName = "";
|
||||
string passWord = "";
|
||||
context.Response.ContentType = "text/plain";
|
||||
|
||||
if (context.Request["action"] == "login")
|
||||
{
|
||||
context.Response.ContentType = "text/plain";
|
||||
|
||||
if (context.Request.QueryString["UID"] != "")
|
||||
{
|
||||
a = context.Request.QueryString["UID"];
|
||||
b = context.Request.QueryString["P"];
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
a = context.Request["username"] + "";
|
||||
b = context.Request["passwd"] + "";
|
||||
}
|
||||
|
||||
userName = jsHelper.Decrypt(a);
|
||||
passWord = jsHelper.Decrypt(b);
|
||||
|
||||
|
||||
string json = "";
|
||||
DataTable dtUser = MySQLHelper.ExecuteDataTable(stringSQL.strSQL_User + userName + "' or user_account='" + userName + "' or phoneNo='" + userName + "'");
|
||||
if (dtUser.Rows.Count > 0)
|
||||
{
|
||||
if (dtUser.Rows[0]["loginflag"].ToString() == "0" || dtUser.Rows[0]["loginflag"].ToString() == "")
|
||||
{
|
||||
|
||||
|
||||
if (dtUser.Rows[0]["pswd"].ToString() == passWord)
|
||||
{
|
||||
context.Session["userName"] = dtUser.Rows[0]["user_name"].ToString(); ; //用户名
|
||||
context.Session["userAccount"] = dtUser.Rows[0]["user_account"].ToString(); //用户账号
|
||||
context.Session["userOrgID"] = dtUser.Rows[0]["ORG_ID"].ToString(); ;//所属单位ID
|
||||
context.Session["userRole"] = dtUser.Rows[0]["role"].ToString(); ;//用户角色
|
||||
context.Session["userAuthority"] = dtUser.Rows[0]["authority"].ToString(); //用户权限
|
||||
context.Session["phoneNo"] = dtUser.Rows[0]["phoneNo"].ToString(); //用户电话
|
||||
context.Session["regDateTime"] = dtUser.Rows[0]["regDateTime"].ToString(); //用户电话
|
||||
|
||||
string strSQL = "update user set loginflag='1' ,logintime='" + DateTime.Now + "' where user_name='" + userName + "' or user_account='" + userName + "' or phoneNo='" + userName + "'";
|
||||
int num = MySQLHelper.ExecuteNonQuery(strSQL);
|
||||
context.Session.Timeout = 5;
|
||||
|
||||
|
||||
strSQL = "insert into loginrecord (user_id,login_DateTime,IP) values (" + "'" + dtUser.Rows[0]["user_account"].ToString() + "','" + DateTime.Now + "')";
|
||||
num = MySQLHelper.ExecuteNonQuery(strSQL);
|
||||
|
||||
//string Json = "[{";
|
||||
//Json += "\"statue\":\"OK\"," + "\"userName\":\"" + dtUser.Rows[0]["user_name"].ToString() + "\",";
|
||||
//Json += "\"userAccount\":\"" + dtUser.Rows[0]["user_account"].ToString() + "\",";
|
||||
//Json += "\"userOrgID\":\"" + dtUser.Rows[0]["ORG_ID"].ToString() + "\",";
|
||||
//Json += "\"regDateTime\":\"" + dtUser.Rows[0]["regDateTime"].ToString() + "\"}]";
|
||||
|
||||
json = "OK";
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
json = "密码错误,请仔细想想....";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
json = "这个账户在别的客户端已登录";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
json = "没有这个用户,请仔细想想你注册时用名字....";
|
||||
}
|
||||
context.Response.Write(json);
|
||||
context.Response.End();
|
||||
}
|
||||
|
||||
if (context.Request["action"] == "loginMobile")
|
||||
{
|
||||
context.Response.ContentType = "text/plain";
|
||||
|
||||
userName = context.Request.QueryString["UID"];
|
||||
passWord = context.Request.QueryString["P"];
|
||||
|
||||
|
||||
string json = "";
|
||||
DataTable dtUser = MySQLHelper.ExecuteDataTable(stringSQL.strSQL_User + userName + "' or user_account='" + userName + "' or phoneNo='" + userName + "'");
|
||||
if (dtUser.Rows.Count > 0)
|
||||
{
|
||||
if (dtUser.Rows[0]["loginflag"].ToString() == "0" || dtUser.Rows[0]["loginflag"].ToString() == "")
|
||||
{
|
||||
|
||||
|
||||
if (dtUser.Rows[0]["pswd"].ToString() == passWord)
|
||||
{
|
||||
context.Session["userName"] = dtUser.Rows[0]["user_name"].ToString(); ; //用户名
|
||||
context.Session["userAccount"] = dtUser.Rows[0]["user_account"].ToString(); //用户账号
|
||||
context.Session["userOrgID"] = dtUser.Rows[0]["ORG_ID"].ToString(); ;//所属单位ID
|
||||
context.Session["userRole"] = dtUser.Rows[0]["role"].ToString(); ;//用户角色
|
||||
context.Session["userAuthority"] = dtUser.Rows[0]["authority"].ToString(); //用户权限
|
||||
context.Session["phoneNo"] = dtUser.Rows[0]["phoneNo"].ToString(); //用户电话
|
||||
context.Session["regDateTime"] = dtUser.Rows[0]["regDateTime"].ToString(); //用户电话
|
||||
|
||||
string strSQL = "update user set loginflag='1' ,logintime='" + DateTime.Now + "' where user_name='" + userName + "' or user_account='" + userName + "' or phoneNo='" + userName + "'";
|
||||
int num = MySQLHelper.ExecuteNonQuery(strSQL);
|
||||
context.Session.Timeout = 5;
|
||||
|
||||
|
||||
strSQL = "insert into loginrecord (user_id,login_DateTime,IP) values (" + "'" + dtUser.Rows[0]["user_account"].ToString() + "','" + DateTime.Now + "')";
|
||||
num = MySQLHelper.ExecuteNonQuery(strSQL);
|
||||
|
||||
//string Json = "[{";
|
||||
//Json += "\"statue\":\"OK\"," + "\"userName\":\"" + dtUser.Rows[0]["user_name"].ToString() + "\",";
|
||||
//Json += "\"userAccount\":\"" + dtUser.Rows[0]["user_account"].ToString() + "\",";
|
||||
//Json += "\"userOrgID\":\"" + dtUser.Rows[0]["ORG_ID"].ToString() + "\",";
|
||||
//Json += "\"regDateTime\":\"" + dtUser.Rows[0]["regDateTime"].ToString() + "\"}]";
|
||||
|
||||
json = "OK";
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
json = "密码错误,请仔细想想....";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
json = "这个账户在别的客户端已登录";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
json = "没有这个用户,请仔细想想你注册时用名字....";
|
||||
}
|
||||
context.Response.Write(json);
|
||||
context.Response.End();
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (context.Request["action"] == "modPass")
|
||||
{
|
||||
|
||||
context.Response.ContentType = "text/plain";
|
||||
|
||||
//string userName = context.Request.Form["username"];
|
||||
//string oldpasswd = context.Request.Form["oldpasswd"];
|
||||
//string newpasswd = context.Request.Form["newpasswd"];
|
||||
|
||||
|
||||
a = context.Request["username"] + "";
|
||||
b = context.Request["oldpasswd"] + "";
|
||||
string c = context.Request["newpasswd"] + "";
|
||||
userName = jsHelper.Decrypt(a);
|
||||
string oldpasswd = jsHelper.Decrypt(b);
|
||||
string newpasswd = jsHelper.Decrypt(c);
|
||||
|
||||
context.Response.Write(_modPass(userName, oldpasswd, newpasswd));
|
||||
context.Response.End(); ;
|
||||
}
|
||||
if (context.Request["action"] == "ZC")
|
||||
{
|
||||
a = context.Request["userAccount"] + "";
|
||||
b = context.Request["userName"] + "";
|
||||
string c = context.Request["passwd"] + "";
|
||||
string d = context.Request["phoneNo"] + "";
|
||||
string userAccount = jsHelper.Decrypt(a);
|
||||
userName = jsHelper.Decrypt(b);
|
||||
string passwd = jsHelper.Decrypt(c);
|
||||
string phoneNo = jsHelper.Decrypt(d);
|
||||
|
||||
|
||||
context.Response.Write(_ZC(userAccount, userName, passwd, phoneNo));
|
||||
context.Response.End(); ;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private string _ZC(string userAccount, string userName, string passwd, string phoneNo)
|
||||
{
|
||||
|
||||
string json = "";
|
||||
|
||||
|
||||
DataTable dtUser = MySQLHelper.ExecuteDataTable(stringSQL.strSQL_User + userName + "' or user_account='" + userAccount + "' or phoneNo='" + phoneNo + "'");
|
||||
if (dtUser.Rows.Count == 0)
|
||||
{
|
||||
string strSQL = "insert into user (";
|
||||
strSQL += "user_account,";
|
||||
strSQL += "user_name,";
|
||||
strSQL += "pswd,";
|
||||
strSQL += "ORG_ID,";
|
||||
strSQL += "regDateTime,";
|
||||
strSQL += "phoneNo) values(";
|
||||
strSQL += "'" + userAccount + "',";
|
||||
strSQL += "'" + userName + "',";
|
||||
strSQL += "'" + passwd + "',";
|
||||
strSQL += "'" + userAccount + "00',";
|
||||
strSQL += "'" + DateTime.Now + "',";
|
||||
strSQL += "'" + phoneNo + "')";
|
||||
int intState = 0;
|
||||
intState = MySQLHelper.ExecuteNonQuery(strSQL);
|
||||
if (intState >= 0)
|
||||
{
|
||||
|
||||
strSQL = "insert into organization (";
|
||||
strSQL += "ORG_ID,";
|
||||
strSQL += "ORG_Name,";
|
||||
strSQL += "ORG_PARENT_ID,";
|
||||
strSQL += "ORG_TYPE) values(";
|
||||
strSQL += "'" + userAccount + "00',";
|
||||
strSQL += "'" + userName + "00',";
|
||||
strSQL += "'" + "MS00" + "',";
|
||||
strSQL += "'" + "公司" + "')";
|
||||
intState = 0;
|
||||
intState = MySQLHelper.ExecuteNonQuery(strSQL);
|
||||
|
||||
json = "OK";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
json = "注册失败";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
json = "账户、电话号码或姓名已被注册,请重新输入!";
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
private string _modPass(string userName, string oldpasswd, string newpasswd)
|
||||
{
|
||||
|
||||
string json = ""; ;
|
||||
DataTable dtUser = MySQLHelper.ExecuteDataTable(stringSQL.strSQL_User + userName + "' or user_account='" + userName + "' or phoneNo='" + userName + "'");
|
||||
if (dtUser.Rows.Count > 0)
|
||||
{
|
||||
if (dtUser.Rows[0]["pswd"].ToString() == oldpasswd)
|
||||
{
|
||||
string strSQL = "update user set pswd='" + newpasswd + "' where user_name='" + userName + "' or user_account='" + userName + "' or phoneNo='" + userName + "'";
|
||||
int intState = 0;
|
||||
intState = MySQLHelper.ExecuteNonQuery(strSQL);
|
||||
if (intState >= 0)
|
||||
{
|
||||
json = "ok";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
json = "用户名或密码有误,请仔细想想....";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
json = "没有这个用户!";
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public bool IsReusable
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
BIN
NGTools/MB.zip
Normal file
BIN
NGTools/MB.zip
Normal file
Binary file not shown.
32
NGTools/MYJS/JsEncryptHelper.js
Normal file
32
NGTools/MYJS/JsEncryptHelper.js
Normal file
File diff suppressed because one or more lines are too long
922
NGTools/MYJS/MyTools.js
Normal file
922
NGTools/MYJS/MyTools.js
Normal file
@ -0,0 +1,922 @@
|
||||
//<reference path="../EASYUI/locale/easyui-lang-zh_CN.js" />
|
||||
|
||||
|
||||
/*
|
||||
关键词 主界面的easyui-accordion 菜单树加载 动态添加accordion和子菜单
|
||||
|
||||
@auhor 作者 廖德云 修改来自网络
|
||||
|
||||
@param 参数 Myaccord:easyui-accordion MyTab:center中的tab 《div》
|
||||
|
||||
@example 示例
|
||||
|
||||
@link 链接
|
||||
|
||||
@namespace 命名空间
|
||||
|
||||
@requires 依赖模块
|
||||
|
||||
@return 返回值
|
||||
|
||||
@version 版本号
|
||||
|
||||
*/
|
||||
|
||||
function getLeftTree(Myaccord, MyTab, url) { //动态加载二级菜单
|
||||
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
dataType: "json",
|
||||
url: url,
|
||||
success: function (data) {
|
||||
|
||||
//alert(JSON.stringify(data));
|
||||
|
||||
sessionStorage.setItem("AllMenu", JSON.stringify(data));
|
||||
|
||||
addTab("主页", "main.aspx", false);
|
||||
|
||||
$.each(data, function (i, n) {// 加载父类节点及一级菜单
|
||||
var id = n.id;
|
||||
Myaccord.accordion('add', {
|
||||
title: n.text,
|
||||
iconCls: n.iconCls,
|
||||
selected: true,
|
||||
content: '<div style="padding:10px"><ul id="tree-' + id + '" name="' + n.text + '"></ul></div>'
|
||||
});
|
||||
//// 解析整个页面
|
||||
$.parser.parse();
|
||||
// 第二层生成树节点
|
||||
if (!n.children || n.children.length == 0) {
|
||||
return true;
|
||||
}
|
||||
$("#tree-" + id).tree({
|
||||
data: n.children,
|
||||
//animate : true,
|
||||
lines: true,// 显示虚线效果
|
||||
onClick: function (node) {
|
||||
if (node.attributes) {
|
||||
var tabTitle = node.text;
|
||||
var url = node.attributes;
|
||||
var openMode = node.state;
|
||||
var icon = node.iconCls;
|
||||
var pid = node.id;
|
||||
addTab(tabTitle, url, true);
|
||||
} else {
|
||||
$(this).tree(node.state === 'closed' ? 'expand' : 'collapse', node.target);
|
||||
node.state = node.state === 'closed' ? 'open' : 'closed';
|
||||
}
|
||||
},
|
||||
|
||||
onSelect: function (node) {
|
||||
$(this).tree(node.state === 'closed' ? 'expand' : 'collapse', node.target);
|
||||
node.state = node.state === 'closed' ? 'open' : 'closed';
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
// 主窗体的tab控件添加两个工具栏按钮
|
||||
MyTab.tabs({
|
||||
tools: [{
|
||||
iconCls: 'icon-reload',
|
||||
border: false,
|
||||
handler: function () {
|
||||
// $('#home-datagrid').datagrid('reload');
|
||||
// 刷新当前的tab
|
||||
$('.panel:visible > .panel-body > iframe').get(0).contentDocument.location.reload(true);
|
||||
}
|
||||
},
|
||||
{
|
||||
iconCls: 'icon-cancel',
|
||||
border: false,
|
||||
handler: function () {
|
||||
// $('#home-datagrid').datagrid('reload');
|
||||
// 关闭所有的tab
|
||||
var tiles = new Array();
|
||||
var tabs = MyTab.tabs('tabs');
|
||||
var len = tabs.length;
|
||||
//关闭所有
|
||||
if (len > 0) {
|
||||
for (var j = 0; j < len; j++) {
|
||||
var a = tabs[j].panel('options').title;
|
||||
tiles.push(a);
|
||||
}
|
||||
for (var i = 0; i < tiles.length; i++) {
|
||||
if (tiles[i] != "主页") {
|
||||
MyTab.tabs('close', tiles[i]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//,
|
||||
//{
|
||||
// iconCls: 'icon-cancel',
|
||||
// border: false,
|
||||
// handler: function () {
|
||||
// // $('#home-datagrid').datagrid('reload');
|
||||
// // 关闭所有的tab
|
||||
// var tab = MyTab.tabs('getSelected');
|
||||
// var title = tabs.panel('options').title;
|
||||
// MyTab.tabs('close', title);
|
||||
// }
|
||||
//}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
function getTree(MyTree, url) { //动态加载菜单
|
||||
//$.messager.alert("提示",10);
|
||||
MyTree.tree({
|
||||
animate: true,
|
||||
checkbox: false,
|
||||
url: url,
|
||||
onSelect: function (node) {
|
||||
$(this).tree(node.state === 'closed' ? 'expand' : 'collapse', node.target);
|
||||
node.state = node.state === 'closed' ? 'open' : 'closed';
|
||||
|
||||
},
|
||||
onLoadSuccess: function (node, data) {
|
||||
|
||||
MyTree.show();
|
||||
},
|
||||
//onLoadError: function (arguments) {
|
||||
// $.messager.alert("提示",JSON.stringify(arguments));
|
||||
//}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getDataGrid(MyGrid, url, parm, toolbar) { //动态加载网格控件表格
|
||||
//动态加载标题和数据
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: url,// "../../../ASHX/GetHistoryData.ashx?action=getjson" + "&t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
//async: true,//异步请求,默认为true。如果需要发送同步请求发送false
|
||||
data: { par: parm },
|
||||
success: function (data) {
|
||||
MyGrid.datagrid({
|
||||
loadMsg: '正在加载数据请稍后...',
|
||||
pageSize: 20,
|
||||
pageList: [20, 30, 40, 50, 100],
|
||||
fitColumns: true,
|
||||
pagination: true,
|
||||
striped: true, //奇偶行是否区分
|
||||
singleSelect: true,//单选模式
|
||||
rownumbers: true,//行号
|
||||
fitColumns: true,
|
||||
//height: window.innerHeight - 45 - 58,
|
||||
toolbar: toolbar,
|
||||
fit: true,
|
||||
columns: [data.title] //动态取标题
|
||||
});
|
||||
MyGrid.datagrid({ loadFilter: pagerFilter }).datagrid('loadData', data.rows); //动态取数据
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
//为网格添加分页
|
||||
function pagerFilter(data) {
|
||||
//$.messager.alert("提示",JSON.stringify(data));
|
||||
if (typeof data.length == 'number' && typeof data.splice == 'function') { // 判断数据是否是数组
|
||||
data = {
|
||||
total: data.length,
|
||||
rows: data
|
||||
}
|
||||
}
|
||||
var dg = $(this);
|
||||
var opts = dg.datagrid('options');
|
||||
var pager = dg.datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
dg.datagrid('loadData', data);
|
||||
}
|
||||
});
|
||||
if (!data.originalRows) {
|
||||
data.originalRows = (data.rows);
|
||||
}
|
||||
var start = (opts.pageNumber - 1) * parseInt(opts.pageSize);
|
||||
var end = start + parseInt(opts.pageSize);
|
||||
data.rows = (data.originalRows.slice(start, end));
|
||||
return data;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//例如我们希望输出的数字长度是固定的,假设为10,如果数字为123,则输出0000000123,不够位数就在之前补足0,这里提供了三种不同的方式实现JS代码给数字补0 的操作
|
||||
//原文:http://www.jb51.net/article/62499.htm
|
||||
|
||||
//取后两位转成数字 +1 再转成固定的两位字符串
|
||||
function PrefixInteger(str, length) {
|
||||
var str1 = str.substr(0, str.length - length);
|
||||
var str2 = str.substr(str.length - length, length);
|
||||
var num = parseInt(str2) + 1;
|
||||
var str3 = (Array(length).join('0') + num).slice(-length);
|
||||
return (str1 + str3);
|
||||
}
|
||||
|
||||
|
||||
//扩展datagrid:动态加入删除editor
|
||||
|
||||
$.extend($.fn.datagrid.methods, {
|
||||
addEditor: function (jq, param) {
|
||||
if (param instanceof Array) {
|
||||
$.each(param, function (index, item) {
|
||||
var e = $(jq).datagrid('getColumnOption', item.field);
|
||||
e.editor = item.editor;
|
||||
});
|
||||
} else {
|
||||
var e = $(jq).datagrid('getColumnOption', param.field);
|
||||
e.editor = param.editor;
|
||||
}
|
||||
},
|
||||
removeEditor: function (jq, param) {
|
||||
if (param instanceof Array) {
|
||||
$.each(param, function (index, item) {
|
||||
var e = $(jq).datagrid('getColumnOption', item);
|
||||
e.editor = {};
|
||||
});
|
||||
} else {
|
||||
var e = $(jq).datagrid('getColumnOption', param);
|
||||
e.editor = {};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function sumZf() {
|
||||
|
||||
var summ = 0;
|
||||
if ($('#NG_C1').numberbox('getValue') != "") { summ += parseFloat($('#NG_C1').numberbox('getValue')) };
|
||||
if ($('#NG_N2').numberbox('getValue') != "") { summ += parseFloat($('#NG_N2').numberbox('getValue')) };
|
||||
if ($('#NG_CO2').numberbox('getValue') != "") { summ += parseFloat($('#NG_CO2').numberbox('getValue')) };
|
||||
if ($('#NG_C2').numberbox('getValue') != "") { summ += parseFloat($('#NG_C2').numberbox('getValue')) };
|
||||
if ($('#NG_C3').numberbox('getValue') != "") { summ += parseFloat($('#NG_C3').numberbox('getValue')) };
|
||||
if ($('#NG_H2O').numberbox('getValue') != "") { summ += parseFloat($('#NG_H2O').numberbox('getValue')) };
|
||||
if ($('#NG_H2S').numberbox('getValue') != "") { summ += parseFloat($('#NG_H2S').numberbox('getValue')) };
|
||||
if ($('#NG_H2').numberbox('getValue') != "") { summ += parseFloat($('#NG_H2').numberbox('getValue')) };
|
||||
if ($('#NG_CO').numberbox('getValue') != "") { summ += parseFloat($('#NG_CO').numberbox('getValue')) };
|
||||
if ($('#NG_O2').numberbox('getValue') != "") { summ += parseFloat($('#NG_O2').numberbox('getValue')) };
|
||||
if ($('#NG_iC4').numberbox('getValue') != "") { summ += parseFloat($('#NG_iC4').numberbox('getValue')) };
|
||||
if ($('#NG_nC4').numberbox('getValue') != "") { summ += parseFloat($('#NG_nC4').numberbox('getValue')) };
|
||||
if ($('#NG_iC5').numberbox('getValue') != "") { summ += parseFloat($('#NG_iC5').numberbox('getValue')) };
|
||||
if ($('#NG_nC5').numberbox('getValue') != "") { summ += parseFloat($('#NG_nC5').numberbox('getValue')) };
|
||||
if ($('#NG_C6').numberbox('getValue') != "") { summ += parseFloat($('#NG_C6').numberbox('getValue')) };
|
||||
if ($('#NG_C7').numberbox('getValue') != "") { summ += parseFloat($('#NG_C7').numberbox('getValue')) };
|
||||
if ($('#NG_C8').numberbox('getValue') != "") { summ += parseFloat($('#NG_C8').numberbox('getValue')) };
|
||||
if ($('#NG_C9').numberbox('getValue') != "") { summ += parseFloat($('#NG_C9').numberbox('getValue')) };
|
||||
if ($('#NG_C10').numberbox('getValue') != "") { summ += parseFloat($('#NG_C10').numberbox('getValue')) };
|
||||
if ($('#NG_He').numberbox('getValue') != "") { summ += parseFloat($('#NG_He').numberbox('getValue')) };
|
||||
if ($('#NG_Ar').numberbox('getValue') != "") { summ += parseFloat($('#NG_Ar').numberbox('getValue')) };
|
||||
|
||||
|
||||
$('#NG_SUM').numberbox('setValue', summ);
|
||||
return summ;
|
||||
};
|
||||
function strZf() {
|
||||
var summ = "";
|
||||
summ += $('#NG_C1').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_N2').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_CO2').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_C2').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_C3').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_H2O').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_H2S').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_H2').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_CO').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_O2').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_iC4').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_nC4').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_iC5').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_nC5').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_C6').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_C7').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_C8').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_C9').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_C10').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_He').numberbox('getValue') + "_";;
|
||||
summ += $('#NG_Ar').numberbox('getValue') + "_";;
|
||||
return summ;
|
||||
};
|
||||
|
||||
function Zore() {
|
||||
$('#NG_C1').numberbox('setValue', 0);
|
||||
$('#NG_N2').numberbox('setValue', 0);
|
||||
$('#NG_CO2').numberbox('setValue', 0);
|
||||
$('#NG_C2').numberbox('setValue', 0);
|
||||
$('#NG_C3').numberbox('setValue', 0);
|
||||
$('#NG_H2O').numberbox('setValue', 0);
|
||||
$('#NG_H2S').numberbox('setValue', 0);
|
||||
$('#NG_H2').numberbox('setValue', 0);
|
||||
$('#NG_CO').numberbox('setValue', 0);
|
||||
$('#NG_O2').numberbox('setValue', 0);
|
||||
$('#NG_iC4').numberbox('setValue', 0);
|
||||
$('#NG_nC4').numberbox('setValue', 0);
|
||||
$('#NG_iC5').numberbox('setValue', 0);
|
||||
$('#NG_nC5').numberbox('setValue', 0);
|
||||
$('#NG_C6').numberbox('setValue', 0);
|
||||
$('#NG_C7').numberbox('setValue', 0);
|
||||
$('#NG_C8').numberbox('setValue', 0);
|
||||
$('#NG_C9').numberbox('setValue', 0);
|
||||
$('#NG_C10').numberbox('setValue', 0);
|
||||
$('#NG_He').numberbox('setValue', 0);
|
||||
$('#NG_Ar').numberbox('setValue', 0);
|
||||
$('#NG_SUM').numberbox('setValue', 0);
|
||||
|
||||
};
|
||||
|
||||
|
||||
function getFormJson(frm) {
|
||||
var o = {};
|
||||
var a = $(frm).serializeArray();
|
||||
|
||||
$.each(a, function () {
|
||||
if (this.name == "password") {
|
||||
//this.value = $.md5(this.value) //md5操作
|
||||
this.value = this.value;
|
||||
}
|
||||
if (o[this.name] !== undefined) {
|
||||
if (!o[this.name].push) {
|
||||
o[this.name] = [o[this.name]];
|
||||
}
|
||||
o[this.name].push(this.value || '');
|
||||
} else {
|
||||
o[this.name] = this.value || '';
|
||||
}
|
||||
});
|
||||
return o;
|
||||
}
|
||||
// 遍历清空表单值
|
||||
function clearForm() {
|
||||
try {
|
||||
var div = document.getElementById("formPar");//建议不要用数字定义ID
|
||||
var inputs = div.getElementsByTagName("input");
|
||||
|
||||
var inputID
|
||||
//alert(inputs.length);
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
|
||||
inputID = (inputs[i].id);
|
||||
var inputName = inputs[i].className.split(' ')[0];
|
||||
if (inputName == "easyui-numberbox") {
|
||||
$('#' + inputID).numberbox('setValue', "");
|
||||
|
||||
}
|
||||
if (inputName == "easyui-combobox") {
|
||||
$('#' + inputID).combobox('setValue', "");
|
||||
|
||||
}
|
||||
if (inputName == "easyui-textbox") {
|
||||
$('#' + inputID).numberbox('setValue', "");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
var div = document.getElementById("Result");//建议不要用数字定义ID
|
||||
var inputs = div.getElementsByTagName("input");
|
||||
|
||||
var inputID
|
||||
//alert(inputs.length);
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
|
||||
inputID = (inputs[i].id);
|
||||
var inputName = inputs[i].className.split(' ')[0];
|
||||
if (inputName == "easyui-numberbox") {
|
||||
$('#' + inputID).numberbox('setValue', "");
|
||||
|
||||
}
|
||||
if (inputName == "easyui-combobox") {
|
||||
$('#' + inputID).combobox('setValue', "");
|
||||
|
||||
}
|
||||
if (inputName == "easyui-textbox") {
|
||||
$('#' + inputID).numberbox('setValue', "");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
var div = document.getElementById("ddPar");//建议不要用数字定义ID
|
||||
var inputs = div.getElementsByTagName("input");
|
||||
|
||||
var inputID
|
||||
//alert(inputs.length);
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
|
||||
inputID = (inputs[i].id);
|
||||
var inputName = inputs[i].className.split(' ')[0];
|
||||
if (inputName == "easyui-numberbox") {
|
||||
$('#' + inputID).numberbox('setValue', "");
|
||||
|
||||
}
|
||||
if (inputName == "easyui-combobox") {
|
||||
$('#' + inputID).combobox('setValue', "");
|
||||
|
||||
}
|
||||
if (inputName == "easyui-textbox") {
|
||||
$('#' + inputID).numberbox('setValue', "");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function initialCom() {
|
||||
try {
|
||||
$("#GDLX").combobox({ data: GDLX, valueField: 'ID', textField: 'text' });
|
||||
$('#GDLX').combobox('select', GDLX[0].ID);
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#GDCZ').combobox({ data: GDCZ, valueField: 'ID', textField: 'text' });
|
||||
$('#GDCZ').combobox('select', GDCZ[2].ID);
|
||||
|
||||
} catch (e) {
|
||||
|
||||
|
||||
}
|
||||
try {
|
||||
|
||||
$('#CYSLLJLX').combobox({ data: CYSLLJLX, valueField: 'ID', textField: 'text' });
|
||||
$('#CYSLLJLX').combobox('select', CYSLLJLX[0].ID);
|
||||
|
||||
|
||||
} catch (e) {
|
||||
|
||||
|
||||
}
|
||||
try {
|
||||
$('#JLJCZ').combobox({ data: JLJCZ, valueField: 'ID', textField: 'text' });
|
||||
$('#JLJCZ').combobox('select', JLJCZ[9].ID);
|
||||
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
$('#QYFS').combobox({ data: QYFS, valueField: 'ID', textField: 'text' });
|
||||
$('#QYFS').combobox('select', QYFS[0].ID);
|
||||
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
$('#CBTJ').combobox({ data: CBTJ, valueField: 'ID', textField: 'text' });
|
||||
$('#CBTJ').combobox('select', CBTJ[0].ID);
|
||||
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
$('#CYCS').combobox({ data: CycsCom, valueField: 'ID', textField: 'text' });
|
||||
$('#CYCS').combobox('select', CycsCom[0].ID);
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
//用于判断是否是对象类型,是否是数组,获取对象长度
|
||||
function isObj(object) {
|
||||
return object && typeof (object) == 'object' && Object.prototype.toString.call(object).toLowerCase() == "[object object]";
|
||||
}
|
||||
|
||||
function isArray(object) {
|
||||
return object && typeof (object) == 'object' && object.constructor == Array;
|
||||
}
|
||||
|
||||
function getLength(object) {
|
||||
var count = 0;
|
||||
for (var i in object) count++;
|
||||
return count;
|
||||
}
|
||||
//
|
||||
function Compare(objA, objB) {
|
||||
if (!isObj(objA) || !isObj(objB)) return false; //判断类型是否正确
|
||||
if (getLength(objA) != getLength(objB)) return false; //判断长度是否一致
|
||||
return CompareObj(objA, objB, true);//默认为true
|
||||
}
|
||||
|
||||
function CompareObj(objA, objB, flag) {
|
||||
for (var key in objA) {
|
||||
if (!flag) //跳出整个循环
|
||||
break;
|
||||
if (!objB.hasOwnProperty(key)) { flag = false; break; }
|
||||
if (!isArray(objA[key])) { //子级不是数组时,比较属性值
|
||||
if (objB[key] != objA[key]) { flag = false; break; }
|
||||
} else {
|
||||
if (!isArray(objB[key])) { flag = false; break; }
|
||||
var oA = objA[key], oB = objB[key];
|
||||
if (oA.length != oB.length) { flag = false; break; }
|
||||
for (var k in oA) {
|
||||
if (!flag) //这里跳出循环是为了不让递归继续
|
||||
break;
|
||||
flag = CompareObj(oA[k], oB[k], flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
|
||||
function getQueryString(name) {
|
||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
||||
var r = window.location.search.substr(1).match(reg);// alert(unescape(r[2]));
|
||||
if (r != null) return unescape(r[2]); return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 指定年月日 日期字符串加月数
|
||||
* @param dateStr
|
||||
* @param monthCount 需要加的月数,负数为减
|
||||
*/
|
||||
function addMonth(dateStr, monthCount) {
|
||||
var date = new Date(dateStr);
|
||||
var newDate = date.addMonths(monthCount);
|
||||
return dateToString(newDate, DateFormart.DATETIME_HORIZONTAL_24);
|
||||
};
|
||||
//设置转换方法
|
||||
Date.prototype.pattern = function (fmt) {
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"h+": this.getHours() % 12 == 0 ? 12 : this.getHours() % 12, //小时
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
var week = {
|
||||
"0": "\u65e5",
|
||||
"1": "\u4e00",
|
||||
"2": "\u4e8c",
|
||||
"3": "\u4e09",
|
||||
"4": "\u56db",
|
||||
"5": "\u4e94",
|
||||
"6": "\u516d"
|
||||
};
|
||||
if (/(y+)/.test(fmt)) {
|
||||
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
}
|
||||
if (/(E+)/.test(fmt)) {
|
||||
fmt = fmt.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? "\u661f\u671f" : "\u5468") : "") + week[this.getDay() + ""]);
|
||||
}
|
||||
for (var k in o) {
|
||||
if (new RegExp("(" + k + ")").test(fmt)) {
|
||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
}
|
||||
}
|
||||
return fmt;
|
||||
};
|
||||
|
||||
var DateFormart = {
|
||||
YEAR: "yyyy",
|
||||
YEAR_MONTH_HORIZONTAL: "yyyy-MM",
|
||||
DATE_HORIZONTAL: "yyyy-MM-dd",
|
||||
DATETIME_HORIZONTAL_12: "yyyy-MM-dd hh:mm:ss",
|
||||
DATETIME_HORIZONTAL_24: "yyyy-MM-dd HH:mm:ss",
|
||||
YEAR_MONTH_SLASH: "yyyy/MM",
|
||||
DATE_SLASH: "yyyy/MM/dd",
|
||||
DATETIME_SLASH_8: 'yyyyMMdd',
|
||||
DATETIME_SLASHL_12: "yyyy/MM/dd hh:mm:ss",
|
||||
DATETIME_SLASH_24: "yyyy/MM/dd HH:mm:ss"
|
||||
};
|
||||
/**
|
||||
* js的Date类型转换成formart格式的字符串, 支持的格式见DateFormart
|
||||
* 调用的方式例如:
|
||||
* var date = new Date();
|
||||
* var str = dateToString(date,DateFormart.DATETIME_HORIZONTAL_24);
|
||||
* @param datetime js中的Date对象
|
||||
* @param formart 转换成的字符串格式,支持的格式有参考DateFormart
|
||||
* */
|
||||
function dateToString(date, formart) {
|
||||
var f = "" + formart; //如果不加这个,pattern方法识别不了。
|
||||
var str = date.pattern(f);
|
||||
return str;
|
||||
}
|
||||
|
||||
Date.prototype.dateToString = function (date, formart) {
|
||||
return dateToString(date, formart);
|
||||
};
|
||||
|
||||
Date.isLeapYear = function (year) {
|
||||
return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0));
|
||||
};
|
||||
|
||||
Date.getDaysInMonth = function (year, month) {
|
||||
return [31, (Date.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
|
||||
};
|
||||
|
||||
Date.prototype.isLeapYear = function () {
|
||||
return Date.isLeapYear(this.getFullYear());
|
||||
};
|
||||
|
||||
Date.prototype.getDaysInMonth = function () {
|
||||
return Date.getDaysInMonth(this.getFullYear(), this.getMonth());
|
||||
};
|
||||
|
||||
Date.prototype.addMonths = function (value) {
|
||||
//debugger;
|
||||
var n = this.getDate();
|
||||
this.setDate(1);
|
||||
this.setMonth(this.getMonth() + parseInt(value));
|
||||
this.setDate(Math.min(n, this.getDaysInMonth()));
|
||||
return this;
|
||||
};
|
||||
|
||||
//计算日期差
|
||||
function GetDateDiff(startTime, endTime, diffType) {
|
||||
//将xxxx-xx-xx的时间格式,转换为 xxxx/xx/xx的格式
|
||||
startTime = startTime.replace(/\-/g, "/").split(' ')[0];
|
||||
endTime = endTime.replace(/\-/g, "/").split(' ')[0];
|
||||
|
||||
//将计算间隔类性字符转换为小写
|
||||
diffType = diffType.toLowerCase();
|
||||
var sTime = new Date(startTime); //开始时间
|
||||
var eTime = new Date(endTime); //结束时间
|
||||
//作为除数的数字
|
||||
var timeType = 1;
|
||||
switch (diffType) {
|
||||
case "second":
|
||||
timeType = 1000;
|
||||
break;
|
||||
case "minute":
|
||||
timeType = 1000 * 60;
|
||||
break;
|
||||
case "hour":
|
||||
timeType = 1000 * 3600;
|
||||
break;
|
||||
case "day":
|
||||
timeType = 1000 * 3600 * 24;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return parseInt((eTime.getTime() - sTime.getTime()) / parseInt(timeType));
|
||||
}
|
||||
|
||||
//设置次数 返回是否到期或归零
|
||||
function setremainTimes(userID,menuID) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "../../ASHX/getTreeCombox.ashx?action=setRemainTimes" + "&t=" + Date.parse(new Date()),
|
||||
//dataType: "json",
|
||||
data: { userID:userID , menuID: menuID },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
//alert(data);
|
||||
if (data == "0") {
|
||||
try {
|
||||
$('#saveBtn').linkbutton('disable');
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#ExportXls').linkbutton('disable');
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
$('#inP').numberbox('disable', true); //设置输入框为禁用
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#NG_C1').numberbox('disable', true); //设置输入框为禁用
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//设置次数 返回是否到期或归零
|
||||
function getEnable(userID, menuID) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "../../ASHX/getTreeCombox.ashx?action=getEnable" + "&t=" + Date.parse(new Date()),
|
||||
//dataType: "json",
|
||||
data: { userID: userID, menuID: menuID },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
//alert(data);
|
||||
|
||||
if (data == "0") {
|
||||
try {
|
||||
$('#saveBtn').linkbutton('disable');
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#ExportXls').linkbutton('disable');
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#inP').numberbox('disable', true); //设置输入框为禁用
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#NG_C1').numberbox('disable', true); //设置输入框为禁用
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getTime() {
|
||||
|
||||
var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
|
||||
|
||||
var date = new Date();
|
||||
|
||||
var year = date.getFullYear();
|
||||
|
||||
var month = date.getMonth() + 1;
|
||||
|
||||
var da = date.getDate();
|
||||
|
||||
var hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
|
||||
|
||||
var minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
|
||||
|
||||
var second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
|
||||
|
||||
var week = date.getDay();
|
||||
|
||||
var time = year + "年" + month + "月" + da + "日 " + hour + ":" + minute + ":" + second + " " + weeks[week];
|
||||
|
||||
return time;
|
||||
|
||||
}
|
||||
|
||||
function copyZf() {
|
||||
var strNGPar = "{";
|
||||
|
||||
strNGPar += '"NG_C1":"' + $('#NG_C1').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_N2":"' + $('#NG_N2').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_CO2":"' + $('#NG_CO2').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_C2":"' + $('#NG_C2').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_C3":"' + $('#NG_C3').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_H2O":"' + $('#NG_H2O').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_H2S":"' + $('#NG_H2S').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_H2":"' + $('#NG_H2').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_CO":"' + $('#NG_CO').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_O2":"' + $('#NG_O2').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_iC4":"' + $('#NG_iC4').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_nC4":"' + $('#NG_nC4').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_iC5":"' + $('#NG_iC5').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_nC5":"' + $('#NG_nC5').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_C6":"' + $('#NG_C6').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_C7":"' + $('#NG_C7').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_C8":"' + $('#NG_C8').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_C9":"' + $('#NG_C9').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_C10":"' + $('#NG_C10').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_He":"' + $('#NG_He').numberbox('getValue') + '",';
|
||||
strNGPar += '"NG_Ar":"' + $('#NG_Ar').numberbox('getValue') + '"}';
|
||||
|
||||
sessionStorage.setItem("NGPar", strNGPar);
|
||||
|
||||
}
|
||||
|
||||
function pasteZf() {
|
||||
|
||||
var strNGPar =JSON.parse( sessionStorage.getItem("NGPar"));
|
||||
|
||||
$('#NG_C1').numberbox('setValue', strNGPar.NG_C1);
|
||||
$('#NG_N2').numberbox('setValue', strNGPar.NG_N2);
|
||||
$('#NG_CO2').numberbox('setValue', strNGPar.NG_CO2);
|
||||
$('#NG_C2').numberbox('setValue', strNGPar.NG_C2);
|
||||
$('#NG_C3').numberbox('setValue', strNGPar.NG_C3);
|
||||
$('#NG_H2O').numberbox('setValue', strNGPar.NG_H2O);
|
||||
$('#NG_H2S').numberbox('setValue', strNGPar.NG_H2S);
|
||||
$('#NG_H2').numberbox('setValue', strNGPar.NG_H2);
|
||||
$('#NG_CO').numberbox('setValue', strNGPar.NG_CO);
|
||||
$('#NG_O2').numberbox('setValue', strNGPar.NG_O2);
|
||||
$('#NG_iC4').numberbox('setValue', strNGPar.NG_iC4);
|
||||
$('#NG_nC4').numberbox('setValue', strNGPar.NG_nC4);
|
||||
$('#NG_iC5').numberbox('setValue', strNGPar.NG_iC5);
|
||||
$('#NG_nC5').numberbox('setValue', strNGPar.NG_nC5);
|
||||
$('#NG_C6').numberbox('setValue', strNGPar.NG_C6);
|
||||
$('#NG_C7').numberbox('setValue', strNGPar.NG_C7);
|
||||
$('#NG_C8').numberbox('setValue', strNGPar.NG_C8);
|
||||
$('#NG_C9').numberbox('setValue', strNGPar.NG_C9);
|
||||
$('#NG_C10').numberbox('setValue', strNGPar.NG_C10);
|
||||
$('#NG_He').numberbox('setValue', strNGPar.NG_He);
|
||||
$('#NG_Ar').numberbox('setValue', strNGPar.NG_Ar);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* jquery 初始化form插件,传入一个json对象,为form赋值
|
||||
* version: 1.0.0-2013.06.24
|
||||
* @requires jQuery v1.5 or later
|
||||
* Copyright (c) 2013
|
||||
* note: 1、此方法能赋值一般所有表单,但考虑到checkbox的赋值难度,以及表单中很少用checkbox,这里不对checkbox赋值
|
||||
* 2、此插件现在只接收json赋值,不考虑到其他的来源数据
|
||||
* 3、对于特殊的textarea,比如CKEditor,kindeditor...,他们的赋值有提供不同的自带方法,这里不做统一,如果项目中有用到,不能正确赋值,请单独赋值
|
||||
*/
|
||||
|
||||
function initForm (frm,options) {
|
||||
|
||||
alert(111);
|
||||
//默认参数
|
||||
var defaults = {
|
||||
jsonValue: "",
|
||||
exclude: [], //不需要进行初始化的name,将name字符串数组传入
|
||||
isDebug: false //是否需要调试,这个用于开发阶段,发布阶段请将设置为false,默认为false,true将会把name value打印出来
|
||||
}
|
||||
//设置参数
|
||||
var setting = $.extend({}, defaults, options);
|
||||
var form = frm;
|
||||
jsonValue = setting.jsonValue;
|
||||
//如果传入的json字符串,将转为json对象
|
||||
if ($.type(setting.jsonValue) === "string") {
|
||||
jsonValue = $.parseJSON(jsonValue);
|
||||
}
|
||||
//如果传入的json对象为空,则不做任何操作
|
||||
if (!$.isEmptyObject(jsonValue)) {
|
||||
var debugInfo = "";
|
||||
$.each(jsonValue, function (key, value) {
|
||||
//是否开启调试,开启将会把name value打印出来
|
||||
if (setting.isDebug) {
|
||||
//alert("name:"+key+"; value:"+value);
|
||||
debugInfo += "name:" + key + "; value:" + value + " || ";
|
||||
}
|
||||
if (setting.exclude.indexOf(key) == -1) {
|
||||
|
||||
var formField = form.find("[name='" + key + "']");
|
||||
if ($.type(formField[0]) === "undefined") {
|
||||
if (setting.isDebug) {
|
||||
alert("can not find name:[" + key + "] in form!!!"); //没找到指定name的表单
|
||||
}
|
||||
} else {
|
||||
var fieldTagName = formField[0].tagName.toLowerCase();
|
||||
if (fieldTagName == "input") {
|
||||
if (formField.attr("type") == "radio") {
|
||||
$("input:radio[name='" + key + "'][value='" + value + "']").attr("checked", "checked");
|
||||
} else {
|
||||
formField.val(value);
|
||||
}
|
||||
} else if (fieldTagName == "select") {
|
||||
//do something special
|
||||
formField.val(value);
|
||||
} else if (fieldTagName == "textarea") {
|
||||
//do something special
|
||||
formField.val(value);
|
||||
} else {
|
||||
formField.val(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
if (setting.isDebug) {
|
||||
alert(debugInfo);
|
||||
}
|
||||
}
|
||||
return form; //返回对象,提供链式操作
|
||||
}
|
322
NGTools/MYJS/MyToolsMobile.js
Normal file
322
NGTools/MYJS/MyToolsMobile.js
Normal file
@ -0,0 +1,322 @@
|
||||
|
||||
/*
|
||||
* jquery 初始化form插件,传入一个json对象,为form赋值
|
||||
* version: 1.0.0-2013.06.24
|
||||
* @requires jQuery v1.5 or later
|
||||
* Copyright (c) 2013
|
||||
* note: 1、此方法能赋值一般所有表单,但考虑到checkbox的赋值难度,以及表单中很少用checkbox,这里不对checkbox赋值
|
||||
* 2、此插件现在只接收json赋值,不考虑到其他的来源数据
|
||||
* 3、对于特殊的textarea,比如CKEditor,kindeditor...,他们的赋值有提供不同的自带方法,这里不做统一,如果项目中有用到,不能正确赋值,请单独赋值
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.extend({
|
||||
initForm: function (options) {
|
||||
//默认参数
|
||||
var defaults = {
|
||||
jsonValue: "",
|
||||
isDebug: false //是否需要调试,这个用于开发阶段,发布阶段请将设置为false,默认为false,true将会把name value打印出来
|
||||
}
|
||||
//设置参数
|
||||
var setting = $.extend({}, defaults, options);
|
||||
var form = this;
|
||||
jsonValue = setting.jsonValue;
|
||||
//如果传入的json字符串,将转为json对象
|
||||
if ($.type(setting.jsonValue) === "string") {
|
||||
jsonValue = $.parseJSON(jsonValue);
|
||||
}
|
||||
//如果传入的json对象为空,则不做任何操作
|
||||
if (!$.isEmptyObject(jsonValue)) {
|
||||
var debugInfo = "";
|
||||
$.each(jsonValue, function (key, value) {
|
||||
//是否开启调试,开启将会把name value打印出来
|
||||
if (setting.isDebug) {
|
||||
alert("name:" + key + "; value:" + value);
|
||||
debugInfo += "name:" + key + "; value:" + value + " || ";
|
||||
}
|
||||
var formField = form.find("[name='" + key + "']");
|
||||
if ($.type(formField[0]) === "undefined") {
|
||||
if (setting.isDebug) {
|
||||
alert("can not find name:[" + key + "] in form!!!"); //没找到指定name的表单
|
||||
}
|
||||
} else {
|
||||
var fieldTagName = formField[0].tagName.toLowerCase();
|
||||
if (fieldTagName == "input") {
|
||||
if (formField.attr("type") == "radio") {
|
||||
$("input:radio[name='" + key + "'][value='" + value + "']").attr("checked", "checked");
|
||||
} else {
|
||||
formField.val(value);
|
||||
}
|
||||
} else if (fieldTagName == "select") {
|
||||
//do something special
|
||||
formField.val(value);
|
||||
formField.val(value).selectmenu('refresh', true);
|
||||
|
||||
} else if (fieldTagName == "textarea") {
|
||||
//do something special
|
||||
formField.val(value);
|
||||
} else {
|
||||
formField.val(value);
|
||||
}
|
||||
}
|
||||
})
|
||||
if (setting.isDebug) {
|
||||
alert(debugInfo);
|
||||
}
|
||||
}
|
||||
return form; //返回对象,提供链式操作
|
||||
},
|
||||
getFormJson: function () {
|
||||
var o = {};
|
||||
var a =this.serializeArray();
|
||||
|
||||
$.each(a, function () {
|
||||
if (this.name == "password") {
|
||||
//this.value = $.md5(this.value) //md5操作
|
||||
this.value = this.value;
|
||||
}
|
||||
if (o[this.name] !== undefined) {
|
||||
if (!o[this.name].push) {
|
||||
o[this.name] = [o[this.name]];
|
||||
}
|
||||
o[this.name].push(this.value || '');
|
||||
} else {
|
||||
o[this.name] = this.value || '';
|
||||
}
|
||||
});
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
})(jQuery)
|
||||
|
||||
|
||||
|
||||
function sumZfM() {
|
||||
|
||||
var summ = 0;
|
||||
|
||||
if ($('#NG_C1').val() != "") { summ += parseFloat($('#NG_C1').val()) };
|
||||
if ($('#NG_N2').val() != "") { summ += parseFloat($('#NG_N2').val()) };
|
||||
if ($('#NG_CO2').val() != "") { summ += parseFloat($('#NG_CO2').val()) };
|
||||
if ($('#NG_C2').val() != "") { summ += parseFloat($('#NG_C2').val()) };
|
||||
if ($('#NG_C3').val() != "") { summ += parseFloat($('#NG_C3').val()) };
|
||||
if ($('#NG_H2O').val() != "") { summ += parseFloat($('#NG_H2O').val()) };
|
||||
if ($('#NG_H2S').val() != "") { summ += parseFloat($('#NG_H2S').val()) };
|
||||
if ($('#NG_H2').val() != "") { summ += parseFloat($('#NG_H2').val()) };
|
||||
if ($('#NG_CO').val() != "") { summ += parseFloat($('#NG_CO').val()) };
|
||||
if ($('#NG_O2').val() != "") { summ += parseFloat($('#NG_O2').val()) };
|
||||
if ($('#NG_iC4').val() != "") { summ += parseFloat($('#NG_iC4').val()) };
|
||||
if ($('#NG_nC4').val() != "") { summ += parseFloat($('#NG_nC4').val()) };
|
||||
if ($('#NG_iC5').val() != "") { summ += parseFloat($('#NG_iC5').val()) };
|
||||
if ($('#NG_nC5').val() != "") { summ += parseFloat($('#NG_nC5').val()) };
|
||||
if ($('#NG_C6').val() != "") { summ += parseFloat($('#NG_C6').val()) };
|
||||
if ($('#NG_C7').val() != "") { summ += parseFloat($('#NG_C7').val()) };
|
||||
if ($('#NG_C8').val() != "") { summ += parseFloat($('#NG_C8').val()) };
|
||||
if ($('#NG_C9').val() != "") { summ += parseFloat($('#NG_C9').val()) };
|
||||
if ($('#NG_C10').val() != "") { summ += parseFloat($('#NG_C10').val()) };
|
||||
if ($('#NG_He').val() != "") { summ += parseFloat($('#NG_He').val()) };
|
||||
if ($('#NG_Ar').val() != "") { summ += parseFloat($('#NG_Ar').val()) };
|
||||
|
||||
$('#NG_SUM').val(summ);
|
||||
return summ;
|
||||
};
|
||||
|
||||
function strZfM() {
|
||||
var summ = "";
|
||||
summ += $('#NG_C1').val() + "_";;
|
||||
|
||||
summ += $('#NG_N2').val() + "_";;
|
||||
summ += $('#NG_CO2').val() + "_";;
|
||||
summ += $('#NG_C2').val() + "_";;
|
||||
summ += $('#NG_C3').val() + "_";;
|
||||
summ += $('#NG_H2O').val() + "_";;
|
||||
summ += $('#NG_H2S').val() + "_";;
|
||||
summ += $('#NG_H2').val() + "_";;
|
||||
summ += $('#NG_CO').val() + "_";;
|
||||
summ += $('#NG_O2').val() + "_";;
|
||||
summ += $('#NG_iC4').val() + "_";;
|
||||
summ += $('#NG_nC4').val() + "_";;
|
||||
summ += $('#NG_iC5').val() + "_";;
|
||||
summ += $('#NG_nC5').val() + "_";;
|
||||
summ += $('#NG_C6').val() + "_";;
|
||||
summ += $('#NG_C7').val() + "_";;
|
||||
summ += $('#NG_C8').val() + "_";;
|
||||
summ += $('#NG_C9').val() + "_";;
|
||||
summ += $('#NG_C10').val() + "_";;
|
||||
summ += $('#NG_He').val() + "_";;
|
||||
summ += $('#NG_Ar').val() + "_";;
|
||||
return summ;
|
||||
};
|
||||
|
||||
function copyZfM() {
|
||||
var strNGPar = "{";
|
||||
|
||||
strNGPar += '"NG_C1":"' + $('#NG_C1').val() + '",';
|
||||
strNGPar += '"NG_N2":"' + $('#NG_N2').val() + '",';
|
||||
strNGPar += '"NG_CO2":"' + $('#NG_CO2').val() + '",';
|
||||
strNGPar += '"NG_C2":"' + $('#NG_C2').val() + '",';
|
||||
strNGPar += '"NG_C3":"' + $('#NG_C3').val() + '",';
|
||||
strNGPar += '"NG_H2O":"' + $('#NG_H2O').val() + '",';
|
||||
strNGPar += '"NG_H2S":"' + $('#NG_H2S').val() + '",';
|
||||
strNGPar += '"NG_H2":"' + $('#NG_H2').val() + '",';
|
||||
strNGPar += '"NG_CO":"' + $('#NG_CO').val() + '",';
|
||||
strNGPar += '"NG_O2":"' + $('#NG_O2').val() + '",';
|
||||
strNGPar += '"NG_iC4":"' + $('#NG_iC4').val() + '",';
|
||||
strNGPar += '"NG_nC4":"' + $('#NG_nC4').val() + '",';
|
||||
strNGPar += '"NG_iC5":"' + $('#NG_iC5').val() + '",';
|
||||
strNGPar += '"NG_nC5":"' + $('#NG_nC5').val() + '",';
|
||||
strNGPar += '"NG_C6":"' + $('#NG_C6').val() + '",';
|
||||
strNGPar += '"NG_C7":"' + $('#NG_C7').val() + '",';
|
||||
strNGPar += '"NG_C8":"' + $('#NG_C8').val() + '",';
|
||||
strNGPar += '"NG_C9":"' + $('#NG_C9').val() + '",';
|
||||
strNGPar += '"NG_C10":"' + $('#NG_C10').val() + '",';
|
||||
strNGPar += '"NG_He":"' + $('#NG_He').val() + '",';
|
||||
strNGPar += '"NG_Ar":"' + $('#NG_Ar').val() + '"}';
|
||||
|
||||
sessionStorage.setItem("NGPar", strNGPar);
|
||||
|
||||
}
|
||||
|
||||
function pasteZfM() {
|
||||
|
||||
var strNGPar = JSON.parse(sessionStorage.getItem("NGPar"));
|
||||
|
||||
$('#NG_C1').val( strNGPar.NG_C1);
|
||||
$('#NG_N2').val( strNGPar.NG_N2);
|
||||
$('#NG_CO2').val( strNGPar.NG_CO2);
|
||||
$('#NG_C2').val( strNGPar.NG_C2);
|
||||
$('#NG_C3').val( strNGPar.NG_C3);
|
||||
$('#NG_H2O').val( strNGPar.NG_H2O);
|
||||
$('#NG_H2S').val( strNGPar.NG_H2S);
|
||||
$('#NG_H2').val( strNGPar.NG_H2);
|
||||
$('#NG_CO').val( strNGPar.NG_CO);
|
||||
$('#NG_O2').val( strNGPar.NG_O2);
|
||||
$('#NG_iC4').val( strNGPar.NG_iC4);
|
||||
$('#NG_nC4').val( strNGPar.NG_nC4);
|
||||
$('#NG_iC5').val( strNGPar.NG_iC5);
|
||||
$('#NG_nC5').val( strNGPar.NG_nC5);
|
||||
$('#NG_C6').val( strNGPar.NG_C6);
|
||||
$('#NG_C7').val( strNGPar.NG_C7);
|
||||
$('#NG_C8').val( strNGPar.NG_C8);
|
||||
$('#NG_C9').val( strNGPar.NG_C9);
|
||||
$('#NG_C10').val( strNGPar.NG_C10);
|
||||
$('#NG_He').val( strNGPar.NG_He);
|
||||
$('#NG_Ar').val( strNGPar.NG_Ar);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function ZoreM() {
|
||||
$('#NG_C1').val( 0);
|
||||
$('#NG_N2').val( 0);
|
||||
$('#NG_CO2').val( 0);
|
||||
$('#NG_C2').val( 0);
|
||||
$('#NG_C3').val( 0);
|
||||
$('#NG_H2O').val( 0);
|
||||
$('#NG_H2S').val( 0);
|
||||
$('#NG_H2').val( 0);
|
||||
$('#NG_CO').val( 0);
|
||||
$('#NG_O2').val( 0);
|
||||
$('#NG_iC4').val( 0);
|
||||
$('#NG_nC4').val( 0);
|
||||
$('#NG_iC5').val( 0);
|
||||
$('#NG_nC5').val( 0);
|
||||
$('#NG_C6').val( 0);
|
||||
$('#NG_C7').val( 0);
|
||||
$('#NG_C8').val( 0);
|
||||
$('#NG_C9').val( 0);
|
||||
$('#NG_C10').val( 0);
|
||||
$('#NG_He').val( 0);
|
||||
$('#NG_Ar').val( 0);
|
||||
$('#NG_SUM').val(0);
|
||||
|
||||
};
|
||||
|
||||
|
||||
//设置次数 返回是否到期或归零
|
||||
function setremainTimes(userID, menuID) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "../../ASHX/getTreeCombox.ashx?action=setRemainTimes" + "&t=" + Date.parse(new Date()),
|
||||
//dataType: "json",
|
||||
data: { userID: userID, menuID: menuID },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
//alert(data);
|
||||
if (data == "0") {
|
||||
try {
|
||||
$('#saveBtn').prop('disabled',true).addClass("ui-disabled");
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#ExportXls').prop('disabled',true).addClass("ui-disabled");
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
$('#inP').prop('disabled', 'disabled').addClass("ui-disabled"); //设置输入框为禁用
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#NG_C1').prop('disabled',true).addClass("ui-disabled"); //设置输入框为禁用
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//设置次数 返回是否到期或归零
|
||||
function getEnable(userID, menuID) {
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "../../ASHX/getTreeCombox.ashx?action=getEnable" + "&t=" + Date.parse(new Date()),
|
||||
//dataType: "json",
|
||||
data: { userID: userID, menuID: menuID },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
//alert(data);
|
||||
|
||||
if (data == "0") {
|
||||
try {
|
||||
$('#saveBtn').attr('disabled', "");
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#ExportXls').prop('disabled',true).addClass("ui-disabled");
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#inP').prop('disabled',true).addClass("ui-disabled"); //设置输入框为禁用
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#NG_C1').prop('disabled',true).addClass("ui-disabled"); //设置输入框为禁用
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
return "";
|
||||
}
|
335
NGTools/MYJS/SQGYJS.js
Normal file
335
NGTools/MYJS/SQGYJS.js
Normal file
@ -0,0 +1,335 @@
|
||||
var GDZone =
|
||||
[
|
||||
{ "text": "一级地区有套管穿越三、四级公路的管道", "ID": "0.72" },
|
||||
{ "text": "一级地区无套管穿越三、四级公路的管道", "ID": "0.6" },
|
||||
{ "text": "一级地区有套管穿越一、二级公路、高速公路、铁路的管道", "ID": "0.6" },
|
||||
{ "text": "一级地区输气站内及其200米内,截断阀室及其50米内的管道", "ID": "0.5" },
|
||||
{ "text": "一级地区人群聚集场所的管道", "ID": "0.5" },
|
||||
{ "text": "二级地区有套管穿越三、四级公路的管道", "ID": "0.6" },
|
||||
{ "text": "二级地区无套管穿越三、四级公路的管道", "ID": "0.5" },
|
||||
{ "text": "二级地区有套管穿越一、二级公路、高速公路、铁路的管道", "ID": "0.6" },
|
||||
{ "text": "二级地区输气站内及其200米内,截断阀室及其50米内的管道", "ID": "0.5" },
|
||||
{ "text": "二级地区人群聚集场所的管道", "ID": "0.5" },
|
||||
{ "text": "三级地区有套管穿越三、四级公路的管道", "ID": "0.5" },
|
||||
{ "text": "三级地区无套管穿越三、四级公路的管道", "ID": "0.5" },
|
||||
{ "text": "三级地区有套管穿越一、二级公路、高速公路、铁路的管道", "ID": "0.5" },
|
||||
{ "text": "三级地区输气站内及其200米内,截断阀室及其50米内的管道", "ID": "0.5" },
|
||||
{ "text": "三级地区人群聚集场所的管道", "ID": "0.5" },
|
||||
{ "text": "四级地区有套管穿越三、四级公路的管道", "ID": "0.4" },
|
||||
{ "text": "四级地区无套管穿越三、四级公路的管道", "ID": "0.4" },
|
||||
{ "text": "四级地区有套管穿越一、二级公路、高速公路、铁路的管道", "ID": "0.4" },
|
||||
{ "text": "四级地区输气站内及其200米内,截断阀室及其50米内的管道", "ID": "0.4" },
|
||||
{ "text": "四级地区人群聚集场所的管道", "ID": "0.4" }
|
||||
]
|
||||
|
||||
var HjgyXS = [
|
||||
{ "text": "手工电弧焊", "ID": "0.7" },
|
||||
{ "text": "有垫环对焊焊接", "ID": "0.9" },
|
||||
{ "text": "无垫环对焊焊接", "ID": "0.7" },
|
||||
{ "text": "手工双面加强焊接", "ID": "0.95" },
|
||||
{ "text": "自动双面焊接", "ID": "1.0" },
|
||||
{ "text": "自动单面焊接", "ID": "0.8" }]
|
||||
|
||||
|
||||
var TZXS = [
|
||||
|
||||
{ "text": "干沙土", "ID": "1.0" },
|
||||
{ "text": "很湿的沙土", "ID": "3.0" },
|
||||
{ "text": "潮湿的粘土", "ID": "1.35" },
|
||||
{ "text": "无法确定", "ID": "1.5" },
|
||||
]
|
||||
|
||||
|
||||
var TZXS = [
|
||||
|
||||
{ "text": "10#钢", "ID": "205" },
|
||||
{ "text": "20#钢", "ID": "245" },
|
||||
{ "text": "16Mn钢", "ID": "345" },
|
||||
{ "text": "09MnV钢", "ID": "295" },
|
||||
{ "text": "A3F钢", "ID": "240" },
|
||||
]
|
||||
|
||||
|
||||
|
||||
var SQGYJSCS = [
|
||||
|
||||
{ "text": "输气能力(m³/d)", "ID": "0" },
|
||||
{ "text": "管道内径(mm)", "ID": "1" },
|
||||
{ "text": "管道长度(km)", "ID": "2" },
|
||||
{ "text": "起点表压力(MPa)", "ID": "3" },
|
||||
{ "text": "终点表压力(MPa)", "ID": "4" },
|
||||
{ "text": "管存量(m³)", "ID": "5" },
|
||||
]
|
||||
|
||||
|
||||
var SQGYJSGS = [
|
||||
|
||||
{ "text": "威莫斯公式", "ID": "0" },
|
||||
{ "text": "潘汉德尔修正公式", "ID": "1" },
|
||||
{ "text": "前苏联早期公式", "ID": "2" },
|
||||
{ "text": "前苏联近期公式", "ID": "3" },
|
||||
//{ "text": "终点压力", "ID": "4" },
|
||||
]
|
||||
var SQGLX = [
|
||||
|
||||
{ "text": "水平输气管", "ID": "0" },
|
||||
{ "text": "地形起伏输气管", "ID": "1" },
|
||||
//{ "text": "管道长度", "ID": "2" },
|
||||
//{ "text": "起点压力", "ID": "3" },
|
||||
//{ "text": "终点压力", "ID": "4" },
|
||||
]
|
||||
|
||||
//pipeDw
|
||||
//pipeBH
|
||||
//pipeL
|
||||
//startP
|
||||
//endP
|
||||
//flowSQ
|
||||
//XDMD
|
||||
//Zf
|
||||
//Tavg
|
||||
|
||||
|
||||
function SQGYJS(jsCS, JSGS, par) {
|
||||
//alert(JSON.stringify(par));
|
||||
var Dn = (parseFloat(par.pipeDw) - 2 * parseFloat(par.pipeBH)) / 10;
|
||||
var result = 0;
|
||||
|
||||
|
||||
try {
|
||||
var Ps = parseFloat(par.startP) + 0.101325;
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
var Pe = parseFloat(par.endP) + 0.101325;
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
var RD = parseFloat(par.XDMD);
|
||||
var T = parseFloat(par.Tavg) + 273.15;
|
||||
var L = parseFloat(par.pipeL);
|
||||
var Z = parseFloat(par.Zf);
|
||||
var Zn = parseFloat(par.Zn);
|
||||
var Q = parseFloat(par.flowSQ);
|
||||
|
||||
|
||||
|
||||
var Exlxs = XLXS(parseFloat(par.pipeDw));
|
||||
|
||||
//alert(Ps + "_" + Pe + "_" + RD + "_" + T + "_" + L + "_" + Z + "_" + Dn+ "_" + Q);
|
||||
|
||||
|
||||
|
||||
|
||||
switch (jsCS) {
|
||||
|
||||
case "0": //输气能力
|
||||
|
||||
var ZRDTL = Z * RD * T * L;
|
||||
var ZRDTL051 = Z * Math.pow(RD, 0.961) * T * L;
|
||||
var PowZRDTL05 = Math.pow(ZRDTL, 0.5);
|
||||
var PowZRDTL051 = Math.pow(ZRDTL051, 0.51);
|
||||
|
||||
var powDn83 = Math.pow(Dn, 8 / 3);
|
||||
var powDn253 = Math.pow(Dn, 2.53);
|
||||
var powDn27 = Math.pow(Dn, 2.7);
|
||||
var powDn26 = Math.pow(Dn, 2.6);
|
||||
var powPsPe05 = Math.pow((Ps * Ps - Pe * Pe), 0.5);
|
||||
var powPsPe051 = Math.pow((Ps * Ps - Pe * Pe), 0.51);
|
||||
|
||||
switch (JSGS) {
|
||||
case "0": //10.8432=5033/10^(8/3)
|
||||
result = 5033 * powDn83 * powPsPe05 / PowZRDTL05;
|
||||
break;
|
||||
case "1": //24.8244=11522/10^(8/3)
|
||||
//alert(Exlxs + "_" + powDn253 + "_" + powPsPe051 + "_" + PowZRDTL051 + "_" + L + "_" + Z + "_" + Dn + "_" + Q);
|
||||
result = 11522 * Exlxs * powDn253 * powPsPe051 / PowZRDTL051;
|
||||
break;
|
||||
case "2": //24.8244=11522/10^(8/3)
|
||||
|
||||
result = 4464.2 * powDn27 * powPsPe05 / PowZRDTL05;
|
||||
break;
|
||||
case "3": //24.8244=11522/10^(8/3)
|
||||
result = 6775.6 * Exlxs * 1 * powDn26 * powPsPe05 / PowZRDTL05;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
case "1": //管道内径计算
|
||||
var ZRDTL = Z * RD * T * L;
|
||||
var ZRDTL051 = Z * Math.pow(RD, 0.961) * T * L;
|
||||
var PowZRDTL05 = Math.pow(ZRDTL, 0.5);
|
||||
var PowZRDTL051 = Math.pow(ZRDTL051, 0.51);
|
||||
var powPsPe05 = Math.pow((Ps * Ps - Pe * Pe), 0.5);
|
||||
var powPsPe051 = Math.pow((Ps * Ps - Pe * Pe), 0.51);
|
||||
|
||||
switch (JSGS) {
|
||||
case "0": //10.8432=5033/10^(8/3)
|
||||
result = Math.pow(Q / (5033 * powPsPe05 / PowZRDTL05), 3 / 8) * 10; //* Math.pow(Dn, 8 / 3)
|
||||
break;
|
||||
case "1": //24.8244=11522/10^(8/3)
|
||||
|
||||
//result = Math.pow(Q / (11522 * powPsPe051 / PowZRDTL051), 1 / 2.53)*10; //* Math.pow(Dn, 2.53)
|
||||
//Exlxs = XLXS(parseFloat(result));
|
||||
result = Math.pow(Q / (11522 * Exlxs * powPsPe051 / PowZRDTL051), 1 / 2.53) * 10; //* Math.pow(Dn, 2.53)
|
||||
|
||||
break;
|
||||
case "2": //24.8244=11522/10^(8/3)
|
||||
result = Math.pow(Q / (4464.2 * powPsPe05 / PowZRDTL05), 1 / 2.7) * 10; //* Math.pow(Dn, 2.7)
|
||||
break;
|
||||
case "3": //24.8244=11522/10^(8/3)
|
||||
result = Math.pow(Q / (6775.6 * Exlxs * 1 * powPsPe05 / PowZRDTL05), 1 / 2.6) * 10; //* Math.pow(Dn, 2.6)
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
}
|
||||
break;
|
||||
|
||||
case "2": //管道长度
|
||||
var ZRDTL = Z * RD * T;
|
||||
var ZRDTL051 = Z * Math.pow(RD, 0.961) * T;
|
||||
var PowZRDTL05 = Math.pow(ZRDTL, 0.5);
|
||||
var PowZRDTL051 = Math.pow(ZRDTL051, 0.51);
|
||||
|
||||
var powDn83 = Math.pow(Dn, 8 / 3);
|
||||
var powDn253 = Math.pow(Dn, 2.53);
|
||||
var powDn27 = Math.pow(Dn, 2.7);
|
||||
var powDn26 = Math.pow(Dn, 2.6);
|
||||
var powPsPe05 = Math.pow((Ps * Ps - Pe * Pe), 0.5);
|
||||
var powPsPe051 = Math.pow((Ps * Ps - Pe * Pe), 0.51);
|
||||
|
||||
switch (JSGS) {
|
||||
case "0": //10.8432=5033/10^(8/3)
|
||||
result = Math.pow(5033 * powDn83 * powPsPe05 / PowZRDTL05 / Q, 2);
|
||||
break;
|
||||
case "1": //24.8244=11522/10^(8/3)
|
||||
result = Math.pow(11522 * Exlxs * powDn253 * powPsPe051 / PowZRDTL051 / Q, 1 / 0.51);
|
||||
break;
|
||||
case "2": //24.8244=11522/10^(8/3)
|
||||
result = Math.pow(4464.2 * powDn27 * powPsPe05 / PowZRDTL05 / Q, 2);
|
||||
break;
|
||||
case "3": //24.8244=11522/10^(8/3)
|
||||
result = Math.pow(6775.6 * Exlxs * 1 * powDn26 * powPsPe05 / PowZRDTL05 / Q, 2);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case "3": //起点压力
|
||||
var ZRDTL = Z * RD * T * L;
|
||||
var ZRDTL051 = Z * Math.pow(RD, 0.961) * T * L;
|
||||
var PowZRDTL05 = Math.pow(ZRDTL, 0.5);
|
||||
var PowZRDTL051 = Math.pow(ZRDTL051, 0.51);
|
||||
|
||||
var powDn83 = Math.pow(Dn, 8 / 3);
|
||||
var powDn253 = Math.pow(Dn, 2.53);
|
||||
var powDn27 = Math.pow(Dn, 2.7);
|
||||
var powDn26 = Math.pow(Dn, 2.6);
|
||||
//var powPsPe05 = Math.pow((Ps * Ps - Pe * Pe), 0.5);
|
||||
//var powPsPe051 = Math.pow((Ps * Ps - Pe * Pe), 0.51);
|
||||
|
||||
switch (JSGS) {
|
||||
case "0": //10.8432=5033/10^(8/3)
|
||||
result = Math.sqrt(Math.pow(Q / (5033 * powDn83 / PowZRDTL05), 2) + Pe * Pe);
|
||||
break;
|
||||
case "1": //24.8244=11522/10^(8/3)
|
||||
result = Math.sqrt(Math.pow(Q / (11522 * Exlxs * powDn253 / PowZRDTL051), 1 / 0.51) + Pe * Pe);;
|
||||
break;
|
||||
case "2": //24.8244=11522/10^(8/3)
|
||||
result = Math.sqrt(Math.pow(Q / (4464.2 * powDn27 / PowZRDTL05), 2) + Pe * Pe);
|
||||
break;
|
||||
case "3": //24.8244=11522/10^(8/3)
|
||||
result = Math.sqrt(Math.pow(Q / (6775.6 * Exlxs * 1 * powDn26 / PowZRDTL05), 2) + Pe * Pe);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
result = result - 0.101325;
|
||||
|
||||
break;
|
||||
|
||||
case "4": //终点压力
|
||||
|
||||
var ZRDTL = Z * RD * T * L;
|
||||
var ZRDTL051 = Z * Math.pow(RD, 0.961) * T * L;
|
||||
var PowZRDTL05 = Math.pow(ZRDTL, 0.5);
|
||||
var PowZRDTL051 = Math.pow(ZRDTL051, 0.51);
|
||||
|
||||
var powDn83 = Math.pow(Dn, 8 / 3);
|
||||
var powDn253 = Math.pow(Dn, 2.53);
|
||||
var powDn27 = Math.pow(Dn, 2.7);
|
||||
var powDn26 = Math.pow(Dn, 2.6);
|
||||
//var powPsPe05 = Math.pow((Ps * Ps - Pe * Pe), 0.5);
|
||||
//var powPsPe051 = Math.pow((Ps * Ps - Pe * Pe), 0.51);
|
||||
|
||||
switch (JSGS) {
|
||||
case "0": //10.8432=5033/10^(8/3)
|
||||
result = Math.sqrt(Ps * Ps - Math.pow(Q / (5033 * powDn83 / PowZRDTL05), 2));
|
||||
break;
|
||||
case "1": //24.8244=11522/10^(8/3)
|
||||
result = Math.sqrt(Ps * Ps - Math.pow(Q / (11522 * Exlxs * powDn253 / PowZRDTL051), 1 / 0.51));
|
||||
break;
|
||||
case "2": //24.8244=11522/10^(8/3)
|
||||
result = Math.sqrt(Ps * Ps - Math.pow(Q / (4464.2 * powDn27 / PowZRDTL05), 2));
|
||||
break;
|
||||
case "3": //24.8244=11522/10^(8/3)
|
||||
result = Math.sqrt(Ps * Ps - Math.pow(Q / (6775.6 * Exlxs * 1 * powDn26 / PowZRDTL05), 2));
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
result = result - 0.101325;
|
||||
|
||||
break;
|
||||
|
||||
case "5": //管存量
|
||||
var V = 3.1415926 * Dn * Dn * L * 1000 / 40000;
|
||||
//alert(Dn +"_"+V);
|
||||
result = V * ((Ps + Pe) / 2) * Zn * 293.15 / Z / T / 0.101325;
|
||||
|
||||
|
||||
default:
|
||||
}
|
||||
//alert(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
function XLXS(pipeDNJ) {
|
||||
var pD = parseFloat(pipeDNJ);
|
||||
//alert(pD);
|
||||
if (pD > 0 & pD < 300) {
|
||||
return 0.84;
|
||||
}
|
||||
else if (pD >= 300 & pD < 400) {
|
||||
return 0.85;
|
||||
}
|
||||
else if (pD >= 400 & pD < 500) {
|
||||
return 0.84;
|
||||
}
|
||||
else if (pD >= 500 & pD < 600) {
|
||||
return 0.87;
|
||||
}
|
||||
else if (pD >= 700 & pD < 800) {
|
||||
return 0.9;
|
||||
}
|
||||
else if (pD >= 800 & pD < 1000) {
|
||||
return 0.91;
|
||||
}
|
||||
else {
|
||||
return 0.85;
|
||||
}
|
||||
}
|
||||
|
92
NGTools/MYJS/constant.js
Normal file
92
NGTools/MYJS/constant.js
Normal file
@ -0,0 +1,92 @@
|
||||
var NGComCon = [
|
||||
|
||||
{ "ID": "0", "NGCom": "{\"NG_C1\":\"88.36\",\"NG_N2\":\"0.68\",\"NG_CO2\":\"1.57\",\"NG_C2\":\"6.25\",\"NG_C3\":\"2.4\",\"NG_H2O\":\"0\",\"NG_H2S\":\"0\",\"NG_H2\":\"0.04\",\"NG_CO\":\"0\",\"NG_O2\":\"0\",\"NG_iC4\":\"0.15\",\"NG_nC4\":\"0.35\",\"NG_iC5\":\"0.05\",\"NG_nC5\":\"0.1\",\"NG_C6\":\"0.01\",\"NG_C7\":\"0\",\"NG_C8\":\"0\",\"NG_C9\":\"0\",\"NG_C10\":\"0\",\"NG_He\":\"0.04\",\"NG_Ar\":\"0\"}" },
|
||||
{ "ID": "1", "NGCom": "{\"NG_C1\":\"92.47\",\"NG_N2\":\"1.75\",\"NG_CO2\":\"0.68\",\"NG_C2\":\"3.5\",\"NG_C3\":\"0.98\",\"NG_H2O\":\"0\",\"NG_H2S\":\"0\",\"NG_H2\":\"0\",\"NG_CO\":\"0\",\"NG_O2\":\"0\",\"NG_iC4\":\"0.34\",\"NG_nC4\":\"0.22\",\"NG_iC5\":\"0\",\"NG_nC5\":\"0.06\",\"NG_C6\":\"0\",\"NG_C7\":\"0\",\"NG_C8\":\"0\",\"NG_C9\":\"0\",\"NG_C10\":\"0\",\"NG_He\":\"0\",\"NG_Ar\":\"0\"}" },
|
||||
{ "ID": "2", "NGCom": "{\"NG_C1\":\"96.52333\",\"NG_N2\":\"0.25941\",\"NG_CO2\":\"0.5954\",\"NG_C2\":\"1.818\",\"NG_C3\":\"0.45945\",\"NG_H2O\":\"0\",\"NG_H2S\":\"0\",\"NG_H2\":\"0\",\"NG_CO\":\"0\",\"NG_O2\":\"0\",\"NG_iC4\":\"0.09767\",\"NG_nC4\":\"0.10067\",\"NG_iC5\":\"0.04728\",\"NG_nC5\":\"0.03239\",\"NG_C6\":\"0.0664\",\"NG_C7\":\"0\",\"NG_C8\":\"0\",\"NG_C9\":\"0\",\"NG_C10\":\"0\",\"NG_He\":\"0\",\"NG_Ar\":\"0\"}" },
|
||||
{ "ID": "3", "NGCom": "{\"NG_C1\":\"90.6724\",\"NG_N2\":\"3.1284\",\"NG_CO2\":\"0.4676\",\"NG_C2\":\"4.5279\",\"NG_C3\":\"0.828\",\"NG_H2O\":\"0\",\"NG_H2S\":\"0\",\"NG_H2\":\"0\",\"NG_CO\":\"0\",\"NG_O2\":\"0\",\"NG_iC4\":\"0.1037\",\"NG_nC4\":\"0.1563\",\"NG_iC5\":\"0.0321\",\"NG_nC5\":\"0.0443\",\"NG_C6\":\"0.0393\",\"NG_C7\":\"0\",\"NG_C8\":\"0\",\"NG_C9\":\"0\",\"NG_C10\":\"0\",\"NG_He\":\"0\",\"NG_Ar\":\"0\"}" },
|
||||
{ "ID": "4", "NGCom": "{\"NG_C1\":\"86.29\",\"NG_N2\":\"2\",\"NG_CO2\":\"0.5\",\"NG_C2\":\"5\",\"NG_C3\":\"3\",\"NG_H2O\":\"0.01\",\"NG_H2S\":\"0.1\",\"NG_H2\":\"0.01\",\"NG_CO\":\"0.01\",\"NG_O2\":\"0.02\",\"NG_iC4\":\"1.1\",\"NG_nC4\":\"0.9\",\"NG_iC5\":\"0.35\",\"NG_nC5\":\"0.25\",\"NG_C6\":\"0.2\",\"NG_C7\":\"0.1\",\"NG_C8\":\"0.05\",\"NG_C9\":\"0.02\",\"NG_C10\":\"0.01\",\"NG_He\":\"0.04\",\"NG_Ar\":\"0.04\"}" },
|
||||
{ "ID": "5", "NGCom": "{\"NG_C1\":\"81.441\",\"NG_N2\":\"13.465\",\"NG_CO2\":\"0.985\",\"NG_C2\":\"3.3\",\"NG_C3\":\"0.605\",\"NG_H2O\":\"0\",\"NG_H2S\":\"0\",\"NG_H2\":\"0\",\"NG_CO\":\"0\",\"NG_O2\":\"0\",\"NG_iC4\":\"0.1\",\"NG_nC4\":\"0.104\",\"NG_iC5\":\"0\",\"NG_nC5\":\"0\",\"NG_C6\":\"0\",\"NG_C7\":\"0\",\"NG_C8\":\"0\",\"NG_C9\":\"0\",\"NG_C10\":\"0\",\"NG_He\":\"0\",\"NG_Ar\":\"0\"}" },
|
||||
{ "ID": "6", "NGCom": "{\"NG_C1\":\"81.212\",\"NG_N2\":\"5.702\",\"NG_CO2\":\"7.585\",\"NG_C2\":\"4.303\",\"NG_C3\":\"0.895\",\"NG_H2O\":\"0\",\"NG_H2S\":\"0\",\"NG_H2\":\"0\",\"NG_CO\":\"0\",\"NG_O2\":\"0\",\"NG_iC4\":\"0.151\",\"NG_nC4\":\"0.152\",\"NG_iC5\":\"0\",\"NG_nC5\":\"0\",\"NG_C6\":\"0\",\"NG_C7\":\"0\",\"NG_C8\":\"0\",\"NG_C9\":\"0\",\"NG_C10\":\"0\",\"NG_He\":\"0\",\"NG_Ar\":\"0\"}" },
|
||||
{ "ID": "7", "NGCom": "{\"NG_C1\":\"100\",\"NG_N2\":\"0\",\"NG_CO2\":\"0\",\"NG_C2\":\"0\",\"NG_C3\":\"0\",\"NG_H2O\":\"0\",\"NG_H2S\":\"0\",\"NG_H2\":\"0\",\"NG_CO\":\"0\",\"NG_O2\":\"0\",\"NG_iC4\":\"0\",\"NG_nC4\":\"0\",\"NG_iC5\":\"0\",\"NG_nC5\":\"0\",\"NG_C6\":\"0\",\"NG_C7\":\"0\",\"NG_C8\":\"0\",\"NG_C9\":\"0\",\"NG_C10\":\"0\",\"NG_He\":\"0\",\"NG_Ar\":\"0\"}" }
|
||||
]
|
||||
|
||||
|
||||
var CycsCom = [
|
||||
{ "ID": 0, "text": "21446-2008" },
|
||||
{ "ID": 1, "text": "11062-2014" },
|
||||
{ "ID": 2, "text": "AGA10-1" },
|
||||
{ "ID": 3, "text": "AGA10-2" },
|
||||
{ "ID": 4, "text": "AGA10-3" },
|
||||
{ "ID": 5, "text": "HighN2" },
|
||||
{ "ID": 6, "text": "HighCO2" },
|
||||
{ "ID": 7, "text": "纯甲烷" }
|
||||
]
|
||||
|
||||
|
||||
var GDLX = [
|
||||
{ "ID": 0, "text": "新冷拔无缝管" },
|
||||
{ "ID": 1, "text": "新热拉无缝管" },
|
||||
{ "ID": 2, "text": "新轧制无缝管" },
|
||||
{ "ID": 3, "text": "新纵缝焊接管" },
|
||||
{ "ID": 4, "text": "新螺旋焊接管" },
|
||||
{ "ID": 5, "text": "轻微绣蚀钢管" },
|
||||
{ "ID": 6, "text": "有结皮钢管" },
|
||||
{ "ID": 7, "text": "严重结皮钢管" },
|
||||
{ "ID": 8, "text": "涂沥青新钢管" },
|
||||
{ "ID": 9, "text": "涂沥青一般钢管" },
|
||||
{ "ID": 10, "text": "镀锌钢管" },
|
||||
{ "ID": 11, "text": "锈蚀钢管" }]
|
||||
|
||||
var GDCZ = [
|
||||
{ "ID": 0, "text": "A13号钢、15号钢" },
|
||||
{ "ID": 1, "text": "10号钢" },
|
||||
{ "ID": 2, "text": "20号钢" },
|
||||
{ "ID": 3, "text": "45钢" },
|
||||
{ "ID": 4, "text": "1Cr13.2Cr13" },
|
||||
{ "ID": 5, "text": "1Cr17" },
|
||||
{ "ID": 6, "text": "12Cr1MoV" },
|
||||
{ "ID": 7, "text": "Cr6SiMo" },
|
||||
{ "ID": 8, "text": "2Cr12Ni1MoWV" },
|
||||
{ "ID": 9, "text": "1Cr18Ni9Ti" },
|
||||
{ "ID": 10, "text": "普通碳钢" },
|
||||
{ "ID": 11, "text": "工业用铜" }];
|
||||
|
||||
var JLJCZ = [
|
||||
{ "ID": 0, "text": "A13号钢、15号钢" },
|
||||
{ "ID": 1, "text": "10号钢" },
|
||||
{ "ID": 2, "text": "20号钢" },
|
||||
{ "ID": 3, "text": "45钢" },
|
||||
{ "ID": 4, "text": "1Cr13.2Cr13" },
|
||||
{ "ID": 5, "text": "1Cr17" },
|
||||
{ "ID": 6, "text": "12Cr1MoV" },
|
||||
{ "ID": 7, "text": "Cr6SiMo" },
|
||||
{ "ID": 8, "text": "2Cr12Ni1MoWV" },
|
||||
{ "ID": 9, "text": "1Cr18Ni9Ti" },
|
||||
{ "ID": 10, "text": "普通碳钢" },
|
||||
{ "ID": 11, "text": "工业用铜" },
|
||||
{ "ID": 12, "text": "黄铜" },
|
||||
{ "ID": 13, "text": "红铜" }];
|
||||
|
||||
|
||||
|
||||
var CYSLLJLX = [{ "ID": 0, "text": "标准孔板" },
|
||||
{ "ID": 1, "text": "ISA1932标准喷嘴" }];
|
||||
|
||||
|
||||
var QYFS = [{ "ID": 0, "text": "法兰取压" },
|
||||
{ "ID": 1, "text": "角接取压" }];
|
||||
|
||||
|
||||
var CBTJ = [{ "ID": 0, "text": "0.101325MPa,20℃" },
|
||||
{ "ID": 1, "text": "0.101325MPa,15℃" },
|
||||
{ "ID": 2, "text": "0.101325MPa,0℃" }];
|
||||
|
||||
var jldType = [{ "ID": "CYS", "text": "差压式流量计" },
|
||||
{ "ID": "SDS", "text": "速度式流量计" },
|
||||
{ "ID": "YSPZ", "text": "音速喷嘴" }];
|
||||
|
||||
var orgType = [{ "ID": "公司", "text": "公司" },
|
||||
{ "ID": "场站", "text": "场站" }, { "ID": "班组", "text": "班组" }, { "ID": "部门", "text": "部门" },];
|
||||
|
||||
var qxData = [{ "ID": "管理员", "text": "管理员" },
|
||||
{ "ID": "操作员", "text": "操作员" }];
|
28
NGTools/MobilePages/.project
Normal file
28
NGTools/MobilePages/.project
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>MobilePages</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.aptana.ide.core.unifiedBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.aptana.projects.webnature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1573048961836</id>
|
||||
<name></name>
|
||||
<type>26</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||
<arguments>1.0-name-matches-false-false-node_modules</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
743
NGTools/MobilePages/A_FlowCal/Orifice.aspx
Normal file
743
NGTools/MobilePages/A_FlowCal/Orifice.aspx
Normal file
@ -0,0 +1,743 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Orifice.aspx.cs" Inherits="NGTools.MobilePages.A_FlowCal.Orifice" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>差压式流量计算</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
|
||||
<script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
|
||||
<script src="../../MYJS/constant.js"></script>
|
||||
<script src="../../MYJS/MyToolsMobile.js"></script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div data-role="page" id="pageOne">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>差压式流量计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab" class="ui-btn-active">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab" class="ui-btn">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
<form method="post" id="WorkPar">
|
||||
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="DWCZ" style="width: 110px; font-size: small;">单位/场站</label>
|
||||
<select id="DWCZ" required="required" data-mini="true">
|
||||
<option value="-1">请选择场站:</option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="JLD" style="width: 110px; font-size: small;">计量点名称</label>
|
||||
<select id="JLD" required="required" data-mini="true">
|
||||
<option value="-1">请选择计量点:</option>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="inP" style="width: 110px; font-size: small;">表压力(MPa):</label>
|
||||
<input style="width: 90px" name="inP" id="inP" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="inDp" style="width: 110px; font-size: small;">差压(kPa):</label>
|
||||
<input style="width: 90px" name="inDp" id="inDp" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="inWd" style="width: 110px; font-size: small;">温度(℃):</label>
|
||||
<input style="width: 90px" name="inWd" id="inWd" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="DDDQY" style="width: 110px; font-size: small;">大气压(MPa):</label>
|
||||
<input style="width: 90px" name="DDDQY" id="DDDQY" required="required" type="text" value="" data-mini="true" />
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="GDZJ" style="width: 110px; font-size: small;">管道内径(mm):</label>
|
||||
<input style="width: 90px" name="GDZJ" id="GDZJ" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="JLJZJ" style="width: 110px; font-size: small;">节流件内径(mm):</label>
|
||||
<input style="width: 90px" name="JLJZJ" id="JLJZJ" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="GDLX" style="width: 110px; font-size: small;">管道类型:</label>
|
||||
<select name="GDLX" id="GDLX" required="required" data-mini="true">
|
||||
<option value="-1">请选择管道类型:</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td style="width: 50%">
|
||||
<label for="GDCZ" style="width: 110px; font-size: small;">管道材质:</label>
|
||||
<select name="GDCZ" id="GDCZ" required="required" data-mini="true">
|
||||
<option value="-1">请选择管道材质:</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="CYSLLJLX" style="width: 110px; font-size: small;">流量计类型:</label>
|
||||
<select name="CYSLLJLX" id="CYSLLJLX" required="required" data-mini="true">
|
||||
<option value="-1">请选择流量计类型:</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td style="width: 50%">
|
||||
<label for="JLJCZ" style="width: 110px; font-size: small;">节流件材质:</label>
|
||||
<select name="JLJCZ" id="JLJCZ" required="required" data-mini="true">
|
||||
<option value="-1">请选择节流件材质:</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="QYFS" style="width: 110px; font-size: small;">取压方式:</label>
|
||||
<select name="QYFS" id="QYFS" required="required" data-mini="true">
|
||||
<option value="-1">请选择取压方式:</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td style="width: 50%">
|
||||
<label for="CBTJ" style="width: 110px; font-size: small;">参比条件:</label>
|
||||
<select name="CBTJ" id="CBTJ" required="required" data-mini="true">
|
||||
<option value="-1">请选择参比条件:</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="page" id="pageTwo">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>差压式流量计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab" class="ui-btn-active">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
<form method="post" id="frmNGCom">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<a onclick="ZoreM()" class="ui-btn " data-mini="true">全部清零</a>
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<a onclick="copyZfM()" class="ui-btn " data-mini="true">复制组分</a>
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<a onclick="pasteZfM()" class="ui-btn " data-mini="true">粘贴组分</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="CYCS">常用组分:</label>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<select id="CYCS" required="required" data-mini="true">
|
||||
<option value="-1">请选择常用组分:</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C1">甲烷C1:</label><input style="width: 80px" name="NG_C1" id="NG_C1" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_N2">氮气N2:</label><input style="width: 80px" name="NG_N2" id="NG_N2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_CO2">二氧化碳CO2:</label><input style="width: 80px" name="NG_CO2" id="NG_CO2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C2">乙烷C2:</label><input style="width: 80px" name="NG_C2" id="NG_C2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C3">丙烷C3:</label><input style="width: 80px" name="NG_C3" id="NG_C3" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2O">水H2O:</label><input style="width: 80px" name="NG_H2O" id="NG_H2O" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2S">硫化氢H2S:</label><input style="width: 80px" name="NG_H2S" id="NG_H2S" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2">氢气H2:</label><input style="width: 80px" name="NG_H2" id="NG_H2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_CO">一氧化碳CO:</label><input style="width: 80px" name="NG_CO" id="NG_CO" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_O2">氧气O2:</label><input style="width: 80px" name="NG_O2" id="NG_O2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_iC4">异丁烷iC4:</label><input style="width: 80px" name="NG_iC4" id="NG_iC4" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_nC4">正丁烷nC4:</label><input style="width: 80px" name="NG_nC4" id="NG_nC4" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_iC5">异戊烷iC5:</label><input style="width: 80px" name="NG_iC5" id="NG_iC5" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_nC5">正戊烷nC5:</label><input style="width: 80px" name="NG_nC5" id="NG_nC5" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C6">己烷C6:</label><input style="width: 80px" name="NG_C6" id="NG_C6" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C7">庚烷C7:</label><input style="width: 80px" name="NG_C7" id="NG_C7" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C8">辛烷C8:</label><input style="width: 80px" name="NG_C8" id="NG_C8" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C9">壬烷C9:</label><input style="width: 80px" name="NG_C9" id="NG_C9" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C10">癸烷C10:</label><input style="width: 80px" name="NG_C10" id="NG_C10" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_He">氦气He:</label><input style="width: 80px" name="NG_He" id="NG_He" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_Ar">氩气Ar:</label><input style="width: 80px" name="NG_Ar" id="NG_Ar" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_SUM">合计:</label><input style="width: 80px" id="NG_SUM" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div data-role="page" id="pageThree">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>差压式流量计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab" class="ui-btn-active">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
|
||||
<table style ="width:100%">
|
||||
<tr>
|
||||
<td style="width: 30%" colspan ="3">
|
||||
<a onclick="SavePar()" class="ui-btn ui-corner-all ui-shadow" data-mini="true">保存计量点参数</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dVFlowb"data-mini="true">体积流量(m³/d):</label><input style="width: 80px" name="dVFlowb" id="dVFlowb" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dMFlowb"data-mini="true">质量流量(kg/s):</label><input style="width: 80px" name="dMFlowb" id="dMFlowb" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dEFlowb"data-mini="true">能量流量(MJ/s):</label><input style="width: 80px" name="dEFlowb" id="dEFlowb" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dVFlowf"data-mini="true">工况流量(m³/h):</label><input style="width: 80px" name="dVFlowf" id="dVFlowf" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dCd"data-mini="true">流出系数:</label><input style="width: 80px" name="dCd" id="dCd" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dE"data-mini="true">渐近速度系数:</label><input style="width: 80px" name="dE" id="dE" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dFG"data-mini="true">相对密度系数:</label><input style="width: 80px" name="dFG" id="dFG" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dFT"data-mini="true">流动温度系数:</label><input style="width: 80px" name="dFT" id="dFT" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dDExpCoefficient"data-mini="true">可膨胀系数:</label><input style="width: 80px" name="dDExpCoefficient" id="dDExpCoefficient" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<%-- dCd dE dFG dFT dDViscosity dDExpCoefficient dRnPipe dBk dRoughNessPipe dCdCorrect dVelocityFlow dPressLost dBeta dZb dZf --%>
|
||||
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dZb"data-mini="true">标况压缩因子:</label><input style="width: 80px" name="dZb" id="dZb" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dZf"data-mini="true">工况压缩因子:</label><input style="width: 80px" name="dZf" id="dZf" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dRnPipe"data-mini="true">管道雷诺数:</label><input style="width: 80px" name="dRnPipe" id="dRnPipe" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dRoughNessPipe"data-mini="true">管道粗糙度系数:</label><input style="width: 80px" name="dRoughNessPipe" id="dRoughNessPipe" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dVelocityFlow"data-mini="true">流速(m/s):</label><input style="width: 80px" name="dVelocityFlow" id="dVelocityFlow" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dBeta"data-mini="true">直径比:</label><input style="width: 80px" name="dBeta" id="dBeta" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dBk"data-mini="true">锐利度系数:</label><input style="width: 80px" name="dBk" id="dBk" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dDViscosity"data-mini="true">动力粘度(mPa·s):</label><input style="width: 80px" name="dDViscosity" id="dDViscosity" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dKappa"data-mini="true">等熵指数:</label><input style="width: 80px" name="dKappa" id="dKappa" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var initFlag = true;
|
||||
var jsonJld = "";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$(document).on("pageinit", function () {
|
||||
|
||||
if (initFlag) {
|
||||
|
||||
|
||||
//填充单位和站场 计量点下拉框
|
||||
var url = '../../ASHX/getTreeCombox.ashx?action=getJldSelect';
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
dataType: "json",
|
||||
url: url,
|
||||
success: function (data) {
|
||||
|
||||
var dwcz = data[0].DWZC;
|
||||
jsonJld = data[1].JLD;
|
||||
|
||||
var opth = "";
|
||||
for (var i = 0; i < dwcz.length; i++) {
|
||||
opth += "<option value=" + dwcz[i].ORG_ID + ">" + dwcz[i].ORG_Name + "</option>";
|
||||
}
|
||||
$("#DWCZ").append(opth);
|
||||
|
||||
|
||||
// 填充单位下拉列表
|
||||
$("#DWCZ").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var selectedDWCZ = $("#DWCZ :selected").val();
|
||||
if (selectedDWCZ != -1) {
|
||||
var jdlArrOptionHtml = "";
|
||||
var jdlArr = jsonJld[0][selectedDWCZ];
|
||||
for (var i = 0; i < jdlArr.length; i++) {
|
||||
jdlArrOptionHtml += "<option value=" + jdlArr[i].ID + ">" + jdlArr[i].JLD_Name + "</option>";
|
||||
}
|
||||
// 清空之前的计量点列表
|
||||
$("#JLD option[value!=-1]").remove();
|
||||
$("#JLD option[value=-1]").attr("selected", true);
|
||||
$("#JLD").append(jdlArrOptionHtml);
|
||||
|
||||
|
||||
|
||||
//$("#JLD option[value='" + jdlArr[0].ID + "']").attr("selected", "selected");
|
||||
//$("#JLD").val(jdlArr[0].ID).selectmenu("refresh", true);
|
||||
}
|
||||
});
|
||||
// 计量点列表事件
|
||||
$("#JLD").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var jldID = $("#JLD :selected").val();
|
||||
if (jldID != -1) {
|
||||
//alert(jldID);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=getJldPar&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { jldid: jldID, gnmk: "KB" },
|
||||
success: function (data) {
|
||||
|
||||
var options = { jsonValue: data, isDebug: false };
|
||||
$("#WorkPar").initForm(options);
|
||||
$("#frmNGCom").initForm(options);
|
||||
sumZfM();
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
// 计量点列表事件
|
||||
$("#CYCS").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var CYCSID = $("#CYCS :selected").val();
|
||||
if (CYCSID != -1) {
|
||||
|
||||
var data = NGComCon[CYCSID].NGCom;
|
||||
|
||||
var options = { jsonValue: data, isDebug: false };
|
||||
|
||||
$("#WorkPar").initForm(options);
|
||||
$("#frmNGCom").initForm(options);
|
||||
|
||||
|
||||
sumZfM();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// 填充常数下拉列表
|
||||
var OptionHtml = "";
|
||||
|
||||
for (var i = 0; i < GDLX.length; i++) {
|
||||
OptionHtml += "<option value=" + GDLX[i].ID + ">" + GDLX[i].text + "</option>";
|
||||
}
|
||||
//alert(OptionHtml);
|
||||
$("#GDLX").append(OptionHtml);
|
||||
$("#GDLX").val(0).selectmenu('refresh', true);
|
||||
|
||||
OptionHtml = "";
|
||||
for (var i = 0; i < GDCZ.length; i++) {
|
||||
OptionHtml += "<option value=" + GDCZ[i].ID + ">" + GDCZ[i].text + "</option>";
|
||||
}
|
||||
$("#GDCZ").append(OptionHtml);
|
||||
$("#GDCZ").val(2).selectmenu('refresh', true);
|
||||
|
||||
OptionHtml = "";
|
||||
|
||||
for (var i = 0; i < CYSLLJLX.length; i++) {
|
||||
OptionHtml += "<option value=" + CYSLLJLX[i].ID + ">" + CYSLLJLX[i].text + "</option>";
|
||||
}
|
||||
$("#CYSLLJLX").append(OptionHtml);
|
||||
$("#CYSLLJLX").val(0).selectmenu('refresh', true);
|
||||
|
||||
OptionHtml = "";
|
||||
for (var i = 0; i < JLJCZ.length; i++) {
|
||||
OptionHtml += "<option value=" + JLJCZ[i].ID + ">" + JLJCZ[i].text + "</option>";
|
||||
}
|
||||
$("#JLJCZ").append(OptionHtml);
|
||||
$("#JLJCZ").val(9).selectmenu('refresh', true);
|
||||
|
||||
OptionHtml = "";
|
||||
for (var i = 0; i < QYFS.length; i++) {
|
||||
OptionHtml += "<option value=" + QYFS[i].ID + ">" + QYFS[i].text + "</option>";
|
||||
}
|
||||
$("#QYFS").append(OptionHtml);
|
||||
$("#QYFS").val(0).selectmenu('refresh', true);
|
||||
|
||||
OptionHtml = "";
|
||||
for (var i = 0; i < CBTJ.length; i++) {
|
||||
OptionHtml += "<option value=" + CBTJ[i].ID + ">" + CBTJ[i].text + "</option>";
|
||||
}
|
||||
$("#CBTJ").append(OptionHtml);
|
||||
$("#CBTJ").val(0).selectmenu('refresh', true);
|
||||
|
||||
OptionHtml = "";
|
||||
|
||||
for (var i = 0; i < CycsCom.length; i++) {
|
||||
OptionHtml += "<option value=" + CycsCom[i].ID + ">" + CycsCom[i].text + "</option>";
|
||||
}
|
||||
$("#CYCS").append(OptionHtml);
|
||||
//$("#CYCS").val(0).selectmenu('refresh', true);
|
||||
|
||||
|
||||
|
||||
$('#NG_C1').on('input', function (e) { sumZfM() });
|
||||
$('#NG_N2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_CO2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C3').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2O').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2S').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_CO').on('input', function (e) { sumZfM() });
|
||||
$('#NG_O2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_iC4').on('input', function (e) { sumZfM() });
|
||||
$('#NG_nC4').on('input', function (e) { sumZfM() });
|
||||
$('#NG_iC5').on('input', function (e) { sumZfM() });
|
||||
$('#NG_nC5').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C6').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C7').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C8').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C9').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C10').on('input', function (e) { sumZfM() });
|
||||
$('#NG_He').on('input', function (e) { sumZfM() });
|
||||
$('#NG_Ar').on('input', function (e) { sumZfM() });
|
||||
|
||||
|
||||
//
|
||||
//$("#pageOne").bind("swipeleft", function (e) { $.mobile.changePage('#pageTow', 'fade', false, false); });
|
||||
//$("#pageTwo").bind("swipeleft", function (e) { $.mobile.changePage('#pageThree', 'fade', false, false); });
|
||||
//$("#pageThree").bind("swipeleft", function (e) { $.mobile.changePage('#pageOne', 'fade', false, false); });
|
||||
|
||||
//$("#pageOne").bind("swiperight", function (e) { $.mobile.changePage('#pageThree', 'fade', false, false); });
|
||||
//$("#pageTwo").bind("swiperight", function (e) { $.mobile.changePage('#pageOne', 'fade', false, false); });
|
||||
//$("#pageThree").bind("swiperight", function (e) { $.mobile.changePage('#pageTwo', 'fade', false, false); });
|
||||
//alert('<%=Session ["userAccount"]%>');
|
||||
|
||||
var str= getEnable('<%=Session ["userAccount"]%>', "M0101");
|
||||
|
||||
//alert(101);
|
||||
initFlag = false;
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
function FlowCal() {
|
||||
|
||||
var NG_par = "";
|
||||
|
||||
if ($('#inP').val() == "") {
|
||||
alert("请输入压力!");
|
||||
return;
|
||||
}
|
||||
if ($('#inDp').val() == "") {
|
||||
alert("请输入差压!");
|
||||
return;
|
||||
}
|
||||
if ($('#inWd').val() == "") {
|
||||
alert("请输入温度!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (Math.abs(sumZfM() - 100) > 0.001) { $.messager.alert("提示", "组分和不为100%,请检查!"); return; }
|
||||
|
||||
|
||||
|
||||
|
||||
NG_par = "0";//流量计类别
|
||||
NG_par = NG_par + "," + $('#CYSLLJLX').val();//节流装置类型
|
||||
NG_par = NG_par + "," + "0";//流量计算标准
|
||||
NG_par = NG_par + "," + "0";//压缩因子计算标准
|
||||
NG_par = NG_par + "," + $('#CBTJ').val();//'计量参比条件
|
||||
NG_par = NG_par + "," + "101325";//计量参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//计量参比条件温度
|
||||
NG_par = NG_par + "," + "101325";//燃烧参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//燃烧参比条件温度
|
||||
NG_par = NG_par + "," + $('#DDDQY').val();//当地大气压
|
||||
NG_par = NG_par + "," + "2";//当地大气压单位
|
||||
NG_par = NG_par + "," + strZfM();//天然气组分
|
||||
NG_par = NG_par + "," + $('#QYFS').val();//取压方式
|
||||
NG_par = NG_par + "," + $('#GDLX').val();//管道类型
|
||||
NG_par = NG_par + "," + $('#GDZJ').val();//管道内径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//管道内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + $('#GDCZ').val();//管道材料
|
||||
NG_par = NG_par + "," + $('#JLJZJ').val();//孔板孔径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//孔板内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + $('#JLJCZ').val();//孔板材料
|
||||
NG_par = NG_par + "," + "0";//锐利度系数计算方法
|
||||
NG_par = NG_par + "," + "0";//孔板入口圆弧半径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + $('#inP').val();//输入压力
|
||||
NG_par = NG_par + "," + "2";//压力单位
|
||||
NG_par = NG_par + "," + "0";//压力类型
|
||||
NG_par = NG_par + "," + $('#inWd').val();//输入温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + $('#inDp').val();//输入差压
|
||||
NG_par = NG_par + "," + "1";//压力单位
|
||||
NG_par = NG_par + "," + "1";//体积流量单位
|
||||
NG_par = NG_par + "," + "2";//质量流量单位
|
||||
NG_par = NG_par + "," + "1";//能量流量单位
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
//url: '../../Pages/A_FlowCal/orifice.aspx?action=Cal' + "&t=" + Date.parse(new Date()),
|
||||
url: '../../ASHX/FlowCal.ashx?action=KBCal' + "&t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { Par: NG_par },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
//alert(JSON.stringify(data));
|
||||
$('#dCd').val(parseFloat(data[45]).toFixed(5));
|
||||
$('#dE').val(parseFloat(data[46]).toFixed(5));
|
||||
$('#dFG').val(parseFloat(data[47]).toFixed(5));
|
||||
$('#dFT').val(parseFloat(data[48]).toFixed(5));
|
||||
$('#dDViscosity').val(parseFloat(data[49]).toFixed(5));
|
||||
$('#dDExpCoefficient').val(parseFloat(data[50]).toFixed(5));
|
||||
$('#dRnPipe').val(parseFloat(data[51]).toFixed(0));
|
||||
$('#dBk').val(parseFloat(data[52]).toFixed(4));
|
||||
$('#dRoughNessPipe').val(parseFloat(data[53]).toFixed(2));
|
||||
$('#dCdCorrect').val(parseFloat(data[54]).toFixed(5));
|
||||
$('#dVFlowb').val(parseFloat(data[56]).toFixed(2));
|
||||
$('#dVFlowf').val(parseFloat(data[57]).toFixed(4));
|
||||
$('#dMFlowb').val(parseFloat(data[58]).toFixed(4));
|
||||
$('#dEFlowb').val(parseFloat(data[59]).toFixed(4));
|
||||
$('#dVelocityFlow').val(parseFloat(data[60]).toFixed(2));
|
||||
$('#dPressLost').val(parseFloat(data[61]).toFixed(2));
|
||||
$('#dBeta').val(parseFloat(data[62]).toFixed(4));
|
||||
$('#dZb').val(parseFloat(data[64]).toFixed(5));
|
||||
$('#dZf').val(parseFloat(data[65]).toFixed(5));
|
||||
$('#dKappa').val(parseFloat(data[80]).toFixed(5));
|
||||
//alert(11);
|
||||
setremainTimes('<%=Session ["userAccount"]%>', "M0101");
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function SavePar() {
|
||||
var saveStr1 = JSON.stringify($('#WorkPar').getFormJson()); // json对象;
|
||||
var saveStr2 = JSON.stringify($('#frmNGCom').getFormJson()); // json对象;
|
||||
|
||||
|
||||
saveStr = (saveStr1 + saveStr2).replace("}{",",");
|
||||
|
||||
// alert(JSON.stringify(saveStr));
|
||||
// alert(JSON.stringify(saveStr2));
|
||||
|
||||
|
||||
var jldID = $('#JLD').val();
|
||||
var jldIDName = $('#JLD').find("option:selected").text();
|
||||
|
||||
if (confirm("确定将计量点参数保存到计量点:" + jldIDName + "")) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=saveJldPar&' + "t=" + Date.parse(new Date()),
|
||||
//dataType: "json",
|
||||
data: { jldid: jldID, Par: saveStr, gnmk: "KB" },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
alert(JSON.stringify(data));
|
||||
|
||||
//$('#formPar').form('load', data);
|
||||
//$.messager.alert("提示", data);
|
||||
|
||||
//document.getElementById('message').innerHTML = JSON.stringify(data);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$("a[data-role=tab]").each(function () {
|
||||
var anchor = $(this);
|
||||
anchor.bind("click", function () {
|
||||
$.mobile.changePage(anchor.attr("href"), {
|
||||
transition: "none",
|
||||
changeHash: false
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
$("div[data-role=page]").bind("pagebeforeshow", function (e, data) {
|
||||
$.mobile.silentScroll(0);
|
||||
$.mobile.changePage.defaults.transition = 'slide';
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
200
NGTools/MobilePages/A_FlowCal/Orifice.aspx.cs
Normal file
200
NGTools/MobilePages/A_FlowCal/Orifice.aspx.cs
Normal file
@ -0,0 +1,200 @@
|
||||
using NG_Tools;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NGTools.MobilePages.A_FlowCal
|
||||
{
|
||||
public partial class Orifice : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (Request.QueryString["action"] == "Cal")
|
||||
{
|
||||
string[] tempPar = Request["Par"].Split(',');
|
||||
|
||||
Flowcal(tempPar);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void Flowcal(string[] par)
|
||||
{
|
||||
|
||||
double[] ngCom = new double[21];
|
||||
double[] tempPar = new double[110];
|
||||
for (int i = 0; i < par.Length; i++)
|
||||
{
|
||||
if (i != 11)
|
||||
{
|
||||
tempPar[i] = double.Parse(par[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int j = 0; j < 21; j++)
|
||||
{
|
||||
ngCom[j] = double.Parse(par[11].Split('_')[j]) / 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
FlowCal NGFLOW = new FlowCal();
|
||||
NG_Cal.FlowParStruct flPar = new NG_Cal.FlowParStruct();
|
||||
NG_Cal.GasPropsSTRUCT gasPar = new NG_Cal.GasPropsSTRUCT();
|
||||
gasPar.adMixture = ngCom;
|
||||
|
||||
UnitConvert MyConvert = new UnitConvert();
|
||||
|
||||
|
||||
flPar.dMeterType = (int)tempPar[0]; //流量计类别
|
||||
flPar.dCoreType = (int)tempPar[1]; //节流装置类型
|
||||
flPar.dFlowCalbz = (int)tempPar[2]; //流量计算标准
|
||||
flPar.dZcalbz = (int)tempPar[3]; //压缩因子计算标准
|
||||
flPar.dCbtj = (int)tempPar[4]; //'计量参比条件
|
||||
flPar.dPb_M = tempPar[5]; //计量参比条件压力
|
||||
flPar.dTb_M = tempPar[6]; //计量参比条件温度
|
||||
flPar.dPb_E = tempPar[7]; //燃烧参比条件压力
|
||||
flPar.dTb_E = tempPar[8]; //燃烧参比条件温度
|
||||
flPar.dPatmUnit = (int)tempPar[10]; //当地大气压单位
|
||||
flPar.dPatm = MyConvert.Converter("yl", tempPar[9], flPar.dPatmUnit, 0, 4); ; //当地大气压
|
||||
flPar.dNG_Compents = gasPar.adMixture; //天然气组分
|
||||
flPar.dPtmode = (int)tempPar[12]; //取压方式
|
||||
flPar.dPipeType = (int)tempPar[13]; //管道类型
|
||||
flPar.dPipeD = tempPar[14]; //管道内径
|
||||
flPar.dLenUnit = (int)tempPar[15]; //长度单位
|
||||
flPar.dPipeDtemp = tempPar[16]; //管道内径参考温度
|
||||
flPar.dPileDtempUint = (int)tempPar[17]; //温度单位
|
||||
flPar.dPipeMaterial = (int)tempPar[18]; //管道材料
|
||||
flPar.dOrificeD = tempPar[19]; //孔板孔径
|
||||
flPar.dOrificeUnit = (int)tempPar[20]; //长度单位
|
||||
flPar.dOrificeDtemp = tempPar[21]; //孔板内径参考温度
|
||||
flPar.dOrificeDtempUnit = (int)tempPar[22]; //温度单位
|
||||
flPar.dOrificeMaterial = (int)tempPar[23]; //孔板材料
|
||||
flPar.dOrificeSharpness = (int)tempPar[24]; //锐利度系数计算方法
|
||||
flPar.dOrificeRk = tempPar[25]; //孔板入口圆弧半径
|
||||
flPar.dOrificeRkLenUint = (int)tempPar[26]; //长度单位
|
||||
flPar.dPfUnit = (int)tempPar[28]; //压力单位
|
||||
flPar.dPf = MyConvert.Converter("yl", tempPar[27], flPar.dPfUnit, 0, 4); //输入压力
|
||||
flPar.dPfType = (int)tempPar[29]; //压力类型
|
||||
flPar.dTfUnit = (int)tempPar[31]; //温度单位
|
||||
flPar.dTf = MyConvert.Converter("wd", tempPar[30], flPar.dTfUnit, 1, 4); //输入温度
|
||||
flPar.dDpUnit = (int)tempPar[33]; //压力单位
|
||||
flPar.dDp = MyConvert.Converter("yl", tempPar[32], flPar.dDpUnit, 0, 4); //输入压力; //输入差压
|
||||
flPar.dVFlowUnit = (int)tempPar[34]; //体积流量单位
|
||||
flPar.dMFlowUnit = (int)tempPar[35]; //质量流量单位
|
||||
flPar.dEFlowUnit = (int)tempPar[36]; //能量流量单位
|
||||
|
||||
//将压力换算为绝压
|
||||
if (flPar.dPfType == 0)
|
||||
{
|
||||
flPar.dPf = flPar.dPf + flPar.dPatm;
|
||||
}
|
||||
|
||||
gasPar.dCbtj = flPar.dCbtj;
|
||||
gasPar.dPf = flPar.dPf;
|
||||
gasPar.dTf = flPar.dTf;
|
||||
|
||||
switch (gasPar.dCbtj)
|
||||
{
|
||||
case 2:
|
||||
gasPar.dPb = 101325;
|
||||
gasPar.dTb = 273.15;
|
||||
break;
|
||||
case 1:
|
||||
gasPar.dPb = 101325;
|
||||
gasPar.dTb = 288.15;
|
||||
break;
|
||||
case 0:
|
||||
gasPar.dPb = 101325;
|
||||
gasPar.dTb = 293.15;
|
||||
break;
|
||||
}
|
||||
|
||||
NG_Tools.NG_Cal NG_Cal = new NG_Cal();
|
||||
NG_Cal.Crit(ref gasPar, 0.0);
|
||||
|
||||
NGFLOW.OFlowCal(ref gasPar, ref flPar);
|
||||
|
||||
|
||||
tempPar[45] = flPar.dCd;
|
||||
tempPar[46] = flPar.dE;
|
||||
tempPar[47] = flPar.dFG;
|
||||
tempPar[48] = flPar.dFT;
|
||||
tempPar[49] = flPar.dDViscosity;
|
||||
tempPar[50] = flPar.dDExpCoefficient;
|
||||
tempPar[51] = flPar.dRnPipe;
|
||||
tempPar[52] = flPar.dBk;
|
||||
tempPar[53] = flPar.dRoughNessPipe;
|
||||
tempPar[54] = flPar.dCdCorrect;
|
||||
tempPar[55] = 0;
|
||||
tempPar[56] = flPar.dVFlowb * 86400;
|
||||
tempPar[57] = flPar.dVFlowf * 3600;
|
||||
tempPar[58] = flPar.dMFlowb;
|
||||
tempPar[59] = flPar.dEFlowb;
|
||||
tempPar[60] = flPar.dVelocityFlow;
|
||||
tempPar[61] = flPar.dPressLost;
|
||||
tempPar[62] = flPar.dBeta;
|
||||
|
||||
tempPar[63] = gasPar.dMrx;
|
||||
tempPar[64] = gasPar.dZb;
|
||||
tempPar[65] = gasPar.dZf;
|
||||
tempPar[66] = gasPar.dFpv;
|
||||
tempPar[67] = gasPar.dDb;
|
||||
tempPar[68] = gasPar.dDf;
|
||||
tempPar[69] = gasPar.dRhob;
|
||||
tempPar[70] = gasPar.dRhof;
|
||||
tempPar[71] = gasPar.dRD_Ideal;
|
||||
tempPar[72] = gasPar.dRD_Real;
|
||||
tempPar[73] = gasPar.dHo;
|
||||
tempPar[74] = gasPar.dH;
|
||||
tempPar[75] = gasPar.dS;
|
||||
tempPar[76] = gasPar.dCpi;
|
||||
tempPar[77] = gasPar.dCp;
|
||||
tempPar[78] = gasPar.dCv;
|
||||
tempPar[79] = gasPar.dk;
|
||||
tempPar[80] = gasPar.dKappa;
|
||||
tempPar[81] = gasPar.dSOS;
|
||||
tempPar[82] = gasPar.dCstar;
|
||||
tempPar[83] = gasPar.dHhvMol;
|
||||
tempPar[84] = gasPar.dLhvMol;
|
||||
tempPar[85] = gasPar.dHhvv;
|
||||
tempPar[86] = gasPar.dLhvv;
|
||||
tempPar[87] = gasPar.dHhvm;
|
||||
tempPar[88] = gasPar.dLhvm;
|
||||
tempPar[89] = gasPar.dZb11062;
|
||||
tempPar[90] = gasPar.dRhob11062;
|
||||
tempPar[91] = gasPar.dRhof11062;
|
||||
tempPar[92] = gasPar.dRD_Ideal11062;
|
||||
tempPar[93] = gasPar.dRD_Real11062;
|
||||
tempPar[94] = gasPar.dWobbeIndex;
|
||||
tempPar[95] = gasPar.Pc;
|
||||
tempPar[96] = gasPar.TC;
|
||||
tempPar[97] = gasPar.Bzsx;
|
||||
tempPar[98] = gasPar.Bzxx;
|
||||
tempPar[99] = gasPar.TotalC;
|
||||
tempPar[100] = gasPar.C2;
|
||||
tempPar[101] = gasPar.C2j;
|
||||
tempPar[102] = gasPar.C3j;
|
||||
tempPar[103] = gasPar.C4j;
|
||||
tempPar[104] = gasPar.C5j;
|
||||
tempPar[105] = gasPar.C6j;
|
||||
tempPar[106] = gasPar.C3C4;
|
||||
|
||||
StringBuilder Json = new StringBuilder();
|
||||
Json.Append("[");
|
||||
for (int i = 0; i < tempPar.Length; i++)
|
||||
{
|
||||
Json.Append(tempPar[i].ToString() + ",");
|
||||
}
|
||||
string json = (Json.Replace(",", "", Json.Length - 1, 1).Append("]")).ToString();
|
||||
|
||||
Response.Write(json);
|
||||
Response.End();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
17
NGTools/MobilePages/A_FlowCal/Orifice.aspx.designer.cs
generated
Normal file
17
NGTools/MobilePages/A_FlowCal/Orifice.aspx.designer.cs
generated
Normal file
@ -0,0 +1,17 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NGTools.MobilePages.A_FlowCal
|
||||
{
|
||||
|
||||
|
||||
public partial class Orifice
|
||||
{
|
||||
}
|
||||
}
|
592
NGTools/MobilePages/A_FlowCal/SuduCal.aspx
Normal file
592
NGTools/MobilePages/A_FlowCal/SuduCal.aspx
Normal file
@ -0,0 +1,592 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SuduCal.aspx.cs" Inherits="NGTools.MobilePages.A_FlowCal.SuduCal" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>速度式流量计算</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
|
||||
<script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
|
||||
<script src="../../MYJS/constant.js"></script>
|
||||
<script src="../../MYJS/MyToolsMobile.js"></script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div data-role="page" id="pageOne">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>速度式流量计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab" class="ui-btn-active">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab" class="ui-btn">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
<form method="post" id="WorkPar">
|
||||
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="DWCZ" style="width: 110px; font-size: small;">单位/场站</label>
|
||||
<select id="DWCZ" required="required" data-mini="true">
|
||||
<option value="-1">请选择场站:</option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="JLD" style="width: 110px; font-size: small;">计量点名称</label>
|
||||
<select id="JLD" required="required" data-mini="true">
|
||||
<option value="-1">请选择计量点:</option>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="inP" style="width: 110px; font-size: small;">表压力(MPa):</label>
|
||||
<input style="width: 90px" name="inP" id="inP" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="inWd" style="width: 110px; font-size: small;">温度(℃):</label>
|
||||
<input style="width: 90px" name="inWd" id="inWd" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="MCS" style="width: 110px; font-size: small;">脉冲数:</label>
|
||||
<input style="width: 90px" name="MCS" id="MCS" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="YBXS" style="width: 110px; font-size: small;">仪表系数:</label>
|
||||
<input style="width: 90px" name="YBXS" id="YBXS" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="DDDQY" style="width: 110px; font-size: small;">大气压(MPa):</label>
|
||||
<input style="width: 90px" name="DDDQY" id="DDDQY" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="CBTJ" style="width: 110px; font-size: small;">参比条件:</label>
|
||||
<select name="CBTJ" id="CBTJ" required="required" data-mini="true">
|
||||
<option value="-1">请选择参比条件:</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="page" id="pageTwo">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>速度式流量计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab" class="ui-btn-active">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
<form method="post" id="frmNGCom">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<a onclick="ZoreM()" class="ui-btn " data-mini="true">全部清零</a>
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<a onclick="copyZfM()" class="ui-btn " data-mini="true">复制组分</a>
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<a onclick="pasteZfM()" class="ui-btn " data-mini="true">粘贴组分</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="CYCS">常用组分:</label>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<select id="CYCS" required="required" data-mini="true">
|
||||
<option value="-1">请选择常用组分:</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C1">甲烷C1:</label><input style="width: 80px" name="NG_C1" id="NG_C1" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_N2">氮气N2:</label><input style="width: 80px" name="NG_N2" id="NG_N2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_CO2">二氧化碳CO2:</label><input style="width: 80px" name="NG_CO2" id="NG_CO2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C2">乙烷C2:</label><input style="width: 80px" name="NG_C2" id="NG_C2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C3">丙烷C3:</label><input style="width: 80px" name="NG_C3" id="NG_C3" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2O">水H2O:</label><input style="width: 80px" name="NG_H2O" id="NG_H2O" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2S">硫化氢H2S:</label><input style="width: 80px" name="NG_H2S" id="NG_H2S" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2">氢气H2:</label><input style="width: 80px" name="NG_H2" id="NG_H2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_CO">一氧化碳CO:</label><input style="width: 80px" name="NG_CO" id="NG_CO" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_O2">氧气O2:</label><input style="width: 80px" name="NG_O2" id="NG_O2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_iC4">异丁烷iC4:</label><input style="width: 80px" name="NG_iC4" id="NG_iC4" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_nC4">正丁烷nC4:</label><input style="width: 80px" name="NG_nC4" id="NG_nC4" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_iC5">异戊烷iC5:</label><input style="width: 80px" name="NG_iC5" id="NG_iC5" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_nC5">正戊烷nC5:</label><input style="width: 80px" name="NG_nC5" id="NG_nC5" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C6">己烷C6:</label><input style="width: 80px" name="NG_C6" id="NG_C6" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C7">庚烷C7:</label><input style="width: 80px" name="NG_C7" id="NG_C7" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C8">辛烷C8:</label><input style="width: 80px" name="NG_C8" id="NG_C8" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C9">壬烷C9:</label><input style="width: 80px" name="NG_C9" id="NG_C9" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C10">癸烷C10:</label><input style="width: 80px" name="NG_C10" id="NG_C10" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_He">氦气He:</label><input style="width: 80px" name="NG_He" id="NG_He" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_Ar">氩气Ar:</label><input style="width: 80px" name="NG_Ar" id="NG_Ar" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_SUM">合计:</label><input style="width: 80px" id="NG_SUM" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="page" id="pageThree">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>速度式流量计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab" class="ui-btn-active">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<a onclick="SavePar()" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ">保存计量点参数</a>
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<%--<a onclick="copyZfM()" class="ui-btn " data-mini="true">复制组分</a>--%>
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<%--<a onclick="pasteZfM()" class="ui-btn " data-mini="true">粘贴组分</a>--%>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dVFlowb" data-mini="true">体积流量(m³/d):</label><input style="width: 80px" name="dVFlowb" id="dVFlowb" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dVFlowf" data-mini="true">工况流量(m³/h):</label><input style="width: 80px" name="dVFlowf" id="dVFlowf" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dMFlowb" data-mini="true">质量流量(kg/s):</label><input style="width: 80px" name="dMFlowb" id="dMFlowb" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dEFlowb" data-mini="true">能量流量(MJ/s):</label><input style="width: 80px" name="dEFlowb" id="dEFlowb" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<%-- <td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dZb"data-mini="true">标况压缩因子:</label><input style="width: 80px" name="dZb" id="dZb" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dZf"data-mini="true">工况压缩因子:</label><input style="width: 80px" name="dZf" id="dZf" required="required" type="text" value="" data-mini="true" />
|
||||
</td>--%>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var initFlag = true;
|
||||
var jsonJld = "";
|
||||
|
||||
$(document).on("pageinit", function () {
|
||||
if (initFlag) {
|
||||
//填充单位和站场 计量点下拉框
|
||||
var url = '../../ASHX/getTreeCombox.ashx?action=getJldSelect';
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
dataType: "json",
|
||||
url: url,
|
||||
success: function (data) {
|
||||
var dwcz = data[0].DWZC;
|
||||
jsonJld = data[1].JLD;
|
||||
var opth = "";
|
||||
for (var i = 0; i < dwcz.length; i++) {
|
||||
opth += "<option value=" + dwcz[i].ORG_ID + ">" + dwcz[i].ORG_Name + "</option>";
|
||||
}
|
||||
$("#DWCZ").append(opth);
|
||||
|
||||
// 填充单位下拉列表
|
||||
$("#DWCZ").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var selectedDWCZ = $("#DWCZ :selected").val();
|
||||
if (selectedDWCZ != -1) {
|
||||
var jdlArrOptionHtml = "";
|
||||
var jdlArr = jsonJld[0][selectedDWCZ];
|
||||
for (var i = 0; i < jdlArr.length; i++) {
|
||||
jdlArrOptionHtml += "<option value=" + jdlArr[i].ID + ">" + jdlArr[i].JLD_Name + "</option>";
|
||||
}
|
||||
// 清空之前的计量点列表
|
||||
$("#JLD option[value!=-1]").remove();
|
||||
$("#JLD option[value=-1]").attr("selected", true);
|
||||
$("#JLD").append(jdlArrOptionHtml);
|
||||
|
||||
//$("#JLD option[value='" + jdlArr[0].ID + "']").attr("selected", "selected");
|
||||
//$("#JLD").val(jdlArr[0].ID).selectmenu("refresh", true);
|
||||
}
|
||||
});
|
||||
// 计量点列表事件
|
||||
$("#JLD").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var jldID = $("#JLD :selected").val();
|
||||
if (jldID != -1) {
|
||||
//alert(jldID);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=getJldPar&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { jldid: jldID, gnmk: "SD" },
|
||||
success: function (data) {
|
||||
alert(JSON.stringify(data));
|
||||
var options = { jsonValue: data, isDebug: false };
|
||||
$("#WorkPar").initForm(options);
|
||||
$("#frmNGCom").initForm(options);
|
||||
sumZfM();
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
// 计量点列表事件
|
||||
$("#CYCS").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var CYCSID = $("#CYCS :selected").val();
|
||||
if (CYCSID != -1) {
|
||||
|
||||
var data = NGComCon[CYCSID].NGCom;
|
||||
|
||||
var options = { jsonValue: data, isDebug: false };
|
||||
|
||||
$("#WorkPar").initForm(options);
|
||||
$("#frmNGCom").initForm(options);
|
||||
|
||||
|
||||
sumZfM();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 填充常数下拉列表
|
||||
var OptionHtml = "";
|
||||
|
||||
for (var i = 0; i < CBTJ.length; i++) {
|
||||
OptionHtml += "<option value=" + CBTJ[i].ID + ">" + CBTJ[i].text + "</option>";
|
||||
}
|
||||
$("#CBTJ").append(OptionHtml);
|
||||
$("#CBTJ").val(0).selectmenu('refresh', true);
|
||||
|
||||
OptionHtml = "";
|
||||
for (var i = 0; i < CycsCom.length; i++) {
|
||||
OptionHtml += "<option value=" + CycsCom[i].ID + ">" + CycsCom[i].text + "</option>";
|
||||
}
|
||||
$("#CYCS").append(OptionHtml);
|
||||
//$("#CYCS").val(0).selectmenu('refresh', true);
|
||||
|
||||
|
||||
|
||||
$('#NG_C1').on('input', function (e) { sumZfM() });
|
||||
$('#NG_N2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_CO2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C3').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2O').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2S').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_CO').on('input', function (e) { sumZfM() });
|
||||
$('#NG_O2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_iC4').on('input', function (e) { sumZfM() });
|
||||
$('#NG_nC4').on('input', function (e) { sumZfM() });
|
||||
$('#NG_iC5').on('input', function (e) { sumZfM() });
|
||||
$('#NG_nC5').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C6').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C7').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C8').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C9').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C10').on('input', function (e) { sumZfM() });
|
||||
$('#NG_He').on('input', function (e) { sumZfM() });
|
||||
$('#NG_Ar').on('input', function (e) { sumZfM() });
|
||||
|
||||
|
||||
//
|
||||
//$("#pageOne").bind("swipeleft", function (e) { $.mobile.changePage('#pageTow', 'fade', false, false); });
|
||||
//$("#pageTwo").bind("swipeleft", function (e) { $.mobile.changePage('#pageThree', 'fade', false, false); });
|
||||
//$("#pageThree").bind("swipeleft", function (e) { $.mobile.changePage('#pageOne', 'fade', false, false); });
|
||||
|
||||
//$("#pageOne").bind("swiperight", function (e) { $.mobile.changePage('#pageThree', 'fade', false, false); });
|
||||
//$("#pageTwo").bind("swiperight", function (e) { $.mobile.changePage('#pageOne', 'fade', false, false); });
|
||||
//$("#pageThree").bind("swiperight", function (e) { $.mobile.changePage('#pageTwo', 'fade', false, false); });
|
||||
//alert('<%=Session ["userAccount"]%>');
|
||||
|
||||
var str = getEnable('<%=Session ["userAccount"]%>', "M0102");
|
||||
|
||||
//alert(101);
|
||||
initFlag = false;
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
function FlowCal() {
|
||||
|
||||
var NG_par = "";
|
||||
|
||||
if ($('#inP').val() == "") {
|
||||
alert("请输入压力!");
|
||||
return;
|
||||
}
|
||||
if ($('#MCS').val() == "") {
|
||||
alert("请输入脉冲数!");
|
||||
return;
|
||||
}
|
||||
if ($('#inWd').val() == "") {
|
||||
alert("请输入温度!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (Math.abs(sumZfM() - 100) > 0.001) { $.messager.alert("提示", "组分和不为100%,请检查!"); return; }
|
||||
|
||||
|
||||
|
||||
|
||||
NG_par = "0";//流量计类别
|
||||
NG_par = NG_par + "," + "0";//节流装置类型
|
||||
NG_par = NG_par + "," + "0";//流量计算标准
|
||||
NG_par = NG_par + "," + "0";//压缩因子计算标准
|
||||
NG_par = NG_par + "," + $('#CBTJ').val();//'计量参比条件
|
||||
NG_par = NG_par + "," + "101325";//计量参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//计量参比条件温度
|
||||
NG_par = NG_par + "," + "101325";//燃烧参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//燃烧参比条件温度
|
||||
NG_par = NG_par + "," + $('#DDDQY').val();//当地大气压
|
||||
NG_par = NG_par + "," + "2";//当地大气压单位
|
||||
NG_par = NG_par + "," + strZfM();//天然气组分
|
||||
NG_par = NG_par + "," + "0";//取压方式
|
||||
NG_par = NG_par + "," + "0";//管道类型
|
||||
NG_par = NG_par + "," + "0";//仪表内径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//管道内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//管道材料
|
||||
NG_par = NG_par + "," + "0";//孔板孔径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//孔板内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//孔板材料
|
||||
NG_par = NG_par + "," + "0";//锐利度系数计算方法
|
||||
NG_par = NG_par + "," + "0";//孔板入口圆弧半径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + $('#inP').val();//输入压力
|
||||
NG_par = NG_par + "," + "2";//压力单位
|
||||
NG_par = NG_par + "," + "0";//压力类型
|
||||
NG_par = NG_par + "," + $('#inWd').val();//输入温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + $('#MCS').val();//输入脉冲数
|
||||
NG_par = NG_par + "," + "1";//压力单位
|
||||
NG_par = NG_par + "," + "1";//体积流量单位
|
||||
NG_par = NG_par + "," + "2";//质量流量单位
|
||||
NG_par = NG_par + "," + "1";//能量流量单位
|
||||
NG_par = NG_par + "," + $('#YBXS').val();//仪表系数
|
||||
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
//url: '../../Pages/A_FlowCal/orifice.aspx?action=Cal' + "&t=" + Date.parse(new Date()),
|
||||
url: '../../ASHX/FlowCal.ashx?action=SDCal' + "&t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { Par: NG_par },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
|
||||
$('#dVFlowb').val(parseFloat(data[56]).toFixed(2));
|
||||
$('#dVFlowf').val(parseFloat(data[57]).toFixed(4));
|
||||
$('#dMFlowb').val(parseFloat(data[58]).toFixed(4));
|
||||
$('#dEFlowb').val(parseFloat(data[59]).toFixed(4));
|
||||
|
||||
//alert(11);
|
||||
setremainTimes('<%=Session ["userAccount"]%>', "M0102");
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function SavePar() {
|
||||
var saveStr1 = JSON.stringify($('#WorkPar').getFormJson()); // json对象;
|
||||
var saveStr2 = JSON.stringify($('#frmNGCom').getFormJson()); // json对象;
|
||||
|
||||
|
||||
saveStr = (saveStr1 + saveStr2).replace("}{", ",");
|
||||
|
||||
// alert(JSON.stringify(saveStr));
|
||||
// alert(JSON.stringify(saveStr2));
|
||||
|
||||
|
||||
var jldID = $("#JLD :selected").val();
|
||||
var jldIDName = $('#JLD').find("option:selected").text();
|
||||
|
||||
if (confirm("确定将计量点参数保存到计量点:" + jldIDName + "")) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=saveJldPar&' + "t=" + Date.parse(new Date()),
|
||||
//dataType: "json",
|
||||
data: { jldid: jldID, Par: saveStr, gnmk: "SD" },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
alert(JSON.stringify(data));
|
||||
|
||||
//$('#formPar').form('load', data);
|
||||
//$.messager.alert("提示", data);
|
||||
|
||||
//document.getElementById('message').innerHTML = JSON.stringify(data);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$("a[data-role=tab]").each(function () {
|
||||
var anchor = $(this);
|
||||
anchor.bind("click", function () {
|
||||
$.mobile.changePage(anchor.attr("href"), {
|
||||
transition: "none",
|
||||
changeHash: false
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
$("div[data-role=page]").bind("pagebeforeshow", function (e, data) {
|
||||
$.mobile.silentScroll(0);
|
||||
$.mobile.changePage.defaults.transition = 'slide';
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
17
NGTools/MobilePages/A_FlowCal/SuduCal.aspx.cs
Normal file
17
NGTools/MobilePages/A_FlowCal/SuduCal.aspx.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NGTools.MobilePages.A_FlowCal
|
||||
{
|
||||
public partial class SuduCal : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
17
NGTools/MobilePages/A_FlowCal/SuduCal.aspx.designer.cs
generated
Normal file
17
NGTools/MobilePages/A_FlowCal/SuduCal.aspx.designer.cs
generated
Normal file
@ -0,0 +1,17 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NGTools.MobilePages.A_FlowCal
|
||||
{
|
||||
|
||||
|
||||
public partial class SuduCal
|
||||
{
|
||||
}
|
||||
}
|
653
NGTools/MobilePages/A_FlowCal/penzui.aspx
Normal file
653
NGTools/MobilePages/A_FlowCal/penzui.aspx
Normal file
@ -0,0 +1,653 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="penzui.aspx.cs" Inherits="NGTools.MobilePages.A_FlowCal.penzui" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>音速喷嘴流量计算</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
|
||||
<script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
|
||||
<script src="../../MYJS/constant.js"></script>
|
||||
<script src="../../MYJS/MyToolsMobile.js"></script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div data-role="page" id="pageOne">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>音速喷嘴流量计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab" class="ui-btn-active">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab" class="ui-btn">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
<form method="post" id="WorkPar">
|
||||
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="DWCZ" style="width: 110px; font-size: small;">单位/场站</label>
|
||||
<select id="DWCZ" required="required" data-mini="true">
|
||||
<option value="-1">请选择场站:</option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="JLD" style="width: 110px; font-size: small;">计量点名称</label>
|
||||
<select id="JLD" required="required" data-mini="true">
|
||||
<option value="-1">请选择计量点:</option>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="inP" style="width: 110px; font-size: small;">表压力(MPa):</label>
|
||||
<input style="width: 90px" name="inP" id="inP" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
|
||||
<td style="width: 50%">
|
||||
<label for="inWd" style="width: 110px; font-size: small;">温度(℃):</label>
|
||||
<input style="width: 90px" name="inWd" id="inWd" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="GDZJ" style="width: 110px; font-size: small;">管道内径(mm):</label>
|
||||
<input style="width: 90px" name="GDZJ" id="GDZJ" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="JLJZJ" style="width: 110px; font-size: small;">喷嘴喉径(mm):</label>
|
||||
<input style="width: 90px" name="JLJZJ" id="JLJZJ" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="DDDQY" style="width: 110px; font-size: small;">大气压(MPa):</label>
|
||||
<input style="width: 90px" name="DDDQY" id="DDDQY" required="required" type="text" value="" data-mini="true" />
|
||||
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="DDDQY" style="width: 110px; font-size: small;">流出系数:</label>
|
||||
<input style="width: 90px" name="LCXS" id="LCXS" required="required" type="text" value="" data-mini="true" />
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td style="width: 50%">
|
||||
<label for="JLJCZ" style="width: 110px; font-size: small;">节流件材质:</label>
|
||||
<select name="JLJCZ" id="JLJCZ" required="required" data-mini="true">
|
||||
<option value="-1">请选择节流件材质:</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td style="width: 50%">
|
||||
<label for="GDCZ" style="width: 110px; font-size: small;">管道材质:</label>
|
||||
<select name="GDCZ" id="GDCZ" required="required" data-mini="true">
|
||||
<option value="-1">请选择管道材质:</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="CBTJ" style="width: 110px; font-size: small;">参比条件:</label>
|
||||
<select name="CBTJ" id="CBTJ" required="required" data-mini="true">
|
||||
<option value="-1">请选择参比条件:</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="page" id="pageTwo">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>音速喷嘴流量计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab" class="ui-btn-active">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
<form method="post" id="frmNGCom">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<a onclick="ZoreM()" class="ui-btn " data-mini="true">全部清零</a>
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<a onclick="copyZfM()" class="ui-btn " data-mini="true">复制组分</a>
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<a onclick="pasteZfM()" class="ui-btn " data-mini="true">粘贴组分</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="CYCS">常用组分:</label>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<select id="CYCS" required="required" data-mini="true">
|
||||
<option value="-1">请选择常用组分:</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C1">甲烷C1:</label><input style="width: 80px" name="NG_C1" id="NG_C1" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_N2">氮气N2:</label><input style="width: 80px" name="NG_N2" id="NG_N2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_CO2">二氧化碳CO2:</label><input style="width: 80px" name="NG_CO2" id="NG_CO2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C2">乙烷C2:</label><input style="width: 80px" name="NG_C2" id="NG_C2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C3">丙烷C3:</label><input style="width: 80px" name="NG_C3" id="NG_C3" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2O">水H2O:</label><input style="width: 80px" name="NG_H2O" id="NG_H2O" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2S">硫化氢H2S:</label><input style="width: 80px" name="NG_H2S" id="NG_H2S" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2">氢气H2:</label><input style="width: 80px" name="NG_H2" id="NG_H2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_CO">一氧化碳CO:</label><input style="width: 80px" name="NG_CO" id="NG_CO" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_O2">氧气O2:</label><input style="width: 80px" name="NG_O2" id="NG_O2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_iC4">异丁烷iC4:</label><input style="width: 80px" name="NG_iC4" id="NG_iC4" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_nC4">正丁烷nC4:</label><input style="width: 80px" name="NG_nC4" id="NG_nC4" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_iC5">异戊烷iC5:</label><input style="width: 80px" name="NG_iC5" id="NG_iC5" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_nC5">正戊烷nC5:</label><input style="width: 80px" name="NG_nC5" id="NG_nC5" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C6">己烷C6:</label><input style="width: 80px" name="NG_C6" id="NG_C6" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C7">庚烷C7:</label><input style="width: 80px" name="NG_C7" id="NG_C7" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C8">辛烷C8:</label><input style="width: 80px" name="NG_C8" id="NG_C8" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C9">壬烷C9:</label><input style="width: 80px" name="NG_C9" id="NG_C9" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C10">癸烷C10:</label><input style="width: 80px" name="NG_C10" id="NG_C10" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_He">氦气He:</label><input style="width: 80px" name="NG_He" id="NG_He" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_Ar">氩气Ar:</label><input style="width: 80px" name="NG_Ar" id="NG_Ar" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_SUM">合计:</label><input style="width: 80px" id="NG_SUM" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div data-role="page" id="pageThree">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>音速喷嘴流量计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab" class="ui-btn-active">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 30%" colspan="3">
|
||||
<a onclick="SavePar()" class="ui-btn ui-corner-all ui-shadow" data-mini="true">保存计量点参数</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dVFlowb" data-mini="true">体积流量(m³/d):</label><input style="width: 80px" name="dVFlowb" id="dVFlowb" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dMFlowb" data-mini="true">质量流量(kg/s):</label><input style="width: 80px" name="dMFlowb" id="dMFlowb" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dEFlowb" data-mini="true">能量流量(MJ/s):</label><input style="width: 80px" name="dEFlowb" id="dEFlowb" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dVFlowf" data-mini="true">工况流量(m³/h):</label><input style="width: 80px" name="dVFlowf" id="dVFlowf" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dKappa" data-mini="true">等熵指数:</label><input style="width: 80px" name="dKappa" id="dKappa" required="required" type="text" value="" data-mini="true" />
|
||||
</td> <td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dCstar" data-mini="true">临界流函数:</label><input style="width: 80px" name="dCstar" id="dCstar" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var initFlag = true;
|
||||
var jsonJld = "";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$(document).on("pageinit", function () {
|
||||
|
||||
if (initFlag) {
|
||||
|
||||
|
||||
//填充单位和站场 计量点下拉框
|
||||
var url = '../../ASHX/getTreeCombox.ashx?action=getJldSelect';
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
dataType: "json",
|
||||
url: url,
|
||||
success: function (data) {
|
||||
|
||||
var dwcz = data[0].DWZC;
|
||||
jsonJld = data[1].JLD;
|
||||
|
||||
var opth = "";
|
||||
for (var i = 0; i < dwcz.length; i++) {
|
||||
opth += "<option value=" + dwcz[i].ORG_ID + ">" + dwcz[i].ORG_Name + "</option>";
|
||||
}
|
||||
$("#DWCZ").append(opth);
|
||||
|
||||
|
||||
// 填充单位下拉列表
|
||||
$("#DWCZ").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var selectedDWCZ = $("#DWCZ :selected").val();
|
||||
if (selectedDWCZ != -1) {
|
||||
var jdlArrOptionHtml = "";
|
||||
var jdlArr = jsonJld[0][selectedDWCZ];
|
||||
for (var i = 0; i < jdlArr.length; i++) {
|
||||
jdlArrOptionHtml += "<option value=" + jdlArr[i].ID + ">" + jdlArr[i].JLD_Name + "</option>";
|
||||
}
|
||||
// 清空之前的计量点列表
|
||||
$("#JLD option[value!=-1]").remove();
|
||||
$("#JLD option[value=-1]").attr("selected", true);
|
||||
$("#JLD").append(jdlArrOptionHtml);
|
||||
|
||||
|
||||
|
||||
//$("#JLD option[value='" + jdlArr[0].ID + "']").attr("selected", "selected");
|
||||
//$("#JLD").val(jdlArr[0].ID).selectmenu("refresh", true);
|
||||
}
|
||||
});
|
||||
// 计量点列表事件
|
||||
$("#JLD").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var jldID = $("#JLD :selected").val();
|
||||
if (jldID != -1) {
|
||||
//alert(jldID);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=getJldPar&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { jldid: jldID, gnmk: "PZ" },
|
||||
success: function (data) {
|
||||
|
||||
var options = { jsonValue: data, isDebug: false };
|
||||
$("#WorkPar").initForm(options);
|
||||
$("#frmNGCom").initForm(options);
|
||||
sumZfM();
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
// 计量点列表事件
|
||||
$("#CYCS").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var CYCSID = $("#CYCS :selected").val();
|
||||
if (CYCSID != -1) {
|
||||
|
||||
var data = NGComCon[CYCSID].NGCom;
|
||||
|
||||
var options = { jsonValue: data, isDebug: false };
|
||||
|
||||
$("#WorkPar").initForm(options);
|
||||
$("#frmNGCom").initForm(options);
|
||||
|
||||
|
||||
sumZfM();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// 填充常数下拉列表
|
||||
var OptionHtml = "";
|
||||
|
||||
|
||||
for (var i = 0; i < GDCZ.length; i++) {
|
||||
OptionHtml += "<option value=" + GDCZ[i].ID + ">" + GDCZ[i].text + "</option>";
|
||||
}
|
||||
$("#GDCZ").append(OptionHtml);
|
||||
$("#GDCZ").val(2).selectmenu('refresh', true);
|
||||
|
||||
|
||||
OptionHtml = "";
|
||||
for (var i = 0; i < JLJCZ.length; i++) {
|
||||
OptionHtml += "<option value=" + JLJCZ[i].ID + ">" + JLJCZ[i].text + "</option>";
|
||||
}
|
||||
$("#JLJCZ").append(OptionHtml);
|
||||
$("#JLJCZ").val(9).selectmenu('refresh', true);
|
||||
|
||||
|
||||
|
||||
OptionHtml = "";
|
||||
for (var i = 0; i < CBTJ.length; i++) {
|
||||
OptionHtml += "<option value=" + CBTJ[i].ID + ">" + CBTJ[i].text + "</option>";
|
||||
}
|
||||
$("#CBTJ").append(OptionHtml);
|
||||
$("#CBTJ").val(0).selectmenu('refresh', true);
|
||||
|
||||
OptionHtml = "";
|
||||
|
||||
for (var i = 0; i < CycsCom.length; i++) {
|
||||
OptionHtml += "<option value=" + CycsCom[i].ID + ">" + CycsCom[i].text + "</option>";
|
||||
}
|
||||
$("#CYCS").append(OptionHtml);
|
||||
//$("#CYCS").val(0).selectmenu('refresh', true);
|
||||
|
||||
|
||||
|
||||
$('#NG_C1').on('input', function (e) { sumZfM() });
|
||||
$('#NG_N2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_CO2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C3').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2O').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2S').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_CO').on('input', function (e) { sumZfM() });
|
||||
$('#NG_O2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_iC4').on('input', function (e) { sumZfM() });
|
||||
$('#NG_nC4').on('input', function (e) { sumZfM() });
|
||||
$('#NG_iC5').on('input', function (e) { sumZfM() });
|
||||
$('#NG_nC5').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C6').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C7').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C8').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C9').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C10').on('input', function (e) { sumZfM() });
|
||||
$('#NG_He').on('input', function (e) { sumZfM() });
|
||||
$('#NG_Ar').on('input', function (e) { sumZfM() });
|
||||
|
||||
|
||||
//
|
||||
//$("#pageOne").bind("swipeleft", function (e) { $.mobile.changePage('#pageTow', 'fade', false, false); });
|
||||
//$("#pageTwo").bind("swipeleft", function (e) { $.mobile.changePage('#pageThree', 'fade', false, false); });
|
||||
//$("#pageThree").bind("swipeleft", function (e) { $.mobile.changePage('#pageOne', 'fade', false, false); });
|
||||
|
||||
//$("#pageOne").bind("swiperight", function (e) { $.mobile.changePage('#pageThree', 'fade', false, false); });
|
||||
//$("#pageTwo").bind("swiperight", function (e) { $.mobile.changePage('#pageOne', 'fade', false, false); });
|
||||
//$("#pageThree").bind("swiperight", function (e) { $.mobile.changePage('#pageTwo', 'fade', false, false); });
|
||||
//alert('<%=Session ["userAccount"]%>');
|
||||
|
||||
var str = getEnable('<%=Session ["userAccount"]%>', "M0103");
|
||||
|
||||
//alert(101);
|
||||
initFlag = false;
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
function FlowCal() {
|
||||
|
||||
var NG_par = "";
|
||||
|
||||
if ($('#inP').val() == "") {
|
||||
alert("请输入压力!");
|
||||
return;
|
||||
}
|
||||
if ($('#LCXS').val() == "") {
|
||||
alert("请输入流出系数!");
|
||||
return;
|
||||
}
|
||||
if ($('#inWd').val() == "") {
|
||||
alert("请输入温度!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (Math.abs(sumZfM() - 100) > 0.001) { $.messager.alert("提示", "组分和不为100%,请检查!"); return; }
|
||||
|
||||
|
||||
|
||||
|
||||
NG_par = "2";//流量计类别
|
||||
NG_par = NG_par + "," + "0";//节流装置类型
|
||||
NG_par = NG_par + "," + "0";//流量计算标准
|
||||
NG_par = NG_par + "," + "0";//压缩因子计算标准
|
||||
NG_par = NG_par + "," + $('#CBTJ').val();//'计量参比条件
|
||||
NG_par = NG_par + "," + "101325";//计量参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//计量参比条件温度
|
||||
NG_par = NG_par + "," + "101325";//燃烧参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//燃烧参比条件温度
|
||||
NG_par = NG_par + "," + $('#DDDQY').val();//当地大气压
|
||||
NG_par = NG_par + "," + "2";//当地大气压单位
|
||||
NG_par = NG_par + "," + strZfM();//天然气组分
|
||||
NG_par = NG_par + "," + "0";//取压方式
|
||||
NG_par = NG_par + "," + "0";//管道类型
|
||||
NG_par = NG_par + "," + $('#GDZJ').val();//管道内径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//管道内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + $('#GDCZ').val();//管道材料
|
||||
NG_par = NG_par + "," + $('#JLJZJ').val();//孔板孔径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//孔板内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + $('#JLJCZ').val();//孔板材料
|
||||
NG_par = NG_par + "," + "0";//锐利度系数计算方法
|
||||
NG_par = NG_par + "," + "0";//孔板入口圆弧半径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + $('#inP').val();//输入压力
|
||||
NG_par = NG_par + "," + "2";//压力单位
|
||||
NG_par = NG_par + "," + "0";//压力类型
|
||||
NG_par = NG_par + "," + $('#inWd').val();//输入温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//输入差压
|
||||
NG_par = NG_par + "," + "1";//压力单位
|
||||
NG_par = NG_par + "," + "1";//体积流量单位
|
||||
NG_par = NG_par + "," + "2";//质量流量单位
|
||||
NG_par = NG_par + "," + "1";//能量流量单位
|
||||
NG_par = NG_par + "," + $('#LCXS').val();//喷嘴的流出系数
|
||||
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
//url: '../../Pages/A_FlowCal/orifice.aspx?action=Cal' + "&t=" + Date.parse(new Date()),
|
||||
url: '../../ASHX/FlowCal.ashx?action=PZCal' + "&t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { Par: NG_par },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
//alert(JSON.stringify(data));
|
||||
|
||||
$('#dVFlowb').val(parseFloat(data[56]).toFixed(2));
|
||||
$('#dVFlowf').val(parseFloat(data[57]).toFixed(4));
|
||||
$('#dMFlowb').val(parseFloat(data[58]).toFixed(4));
|
||||
$('#dEFlowb').val(parseFloat(data[59]).toFixed(4));
|
||||
|
||||
//$('#dZb').val(parseFloat(data[64]).toFixed(5));
|
||||
//$('#dZf').val(parseFloat(data[65]).toFixed(5));
|
||||
$('#dKappa').val(parseFloat(data[80]).toFixed(5));
|
||||
$('#dCstar').val(parseFloat(data[82]).toFixed(5));
|
||||
//alert(11);
|
||||
setremainTimes('<%=Session ["userAccount"]%>', "M0103");
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function SavePar() {
|
||||
var saveStr1 = JSON.stringify($('#WorkPar').getFormJson()); // json对象;
|
||||
var saveStr2 = JSON.stringify($('#frmNGCom').getFormJson()); // json对象;
|
||||
|
||||
|
||||
saveStr = (saveStr1 + saveStr2).replace("}{", ",");
|
||||
|
||||
// alert(JSON.stringify(saveStr));
|
||||
// alert(JSON.stringify(saveStr2));
|
||||
|
||||
|
||||
var jldID = $('#JLD').val();
|
||||
var jldIDName = $('#JLD').find("option:selected").text();
|
||||
|
||||
if (confirm("确定将计量点参数保存到计量点:" + jldIDName + "")) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=saveJldPar&' + "t=" + Date.parse(new Date()),
|
||||
//dataType: "json",
|
||||
data: { jldid: jldID, Par: saveStr, gnmk: "PZ" },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
alert(JSON.stringify(data));
|
||||
|
||||
//$('#formPar').form('load', data);
|
||||
//$.messager.alert("提示", data);
|
||||
|
||||
//document.getElementById('message').innerHTML = JSON.stringify(data);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$("a[data-role=tab]").each(function () {
|
||||
var anchor = $(this);
|
||||
anchor.bind("click", function () {
|
||||
$.mobile.changePage(anchor.attr("href"), {
|
||||
transition: "none",
|
||||
changeHash: false
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
$("div[data-role=page]").bind("pagebeforeshow", function (e, data) {
|
||||
$.mobile.silentScroll(0);
|
||||
$.mobile.changePage.defaults.transition = 'slide';
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
17
NGTools/MobilePages/A_FlowCal/penzui.aspx.cs
Normal file
17
NGTools/MobilePages/A_FlowCal/penzui.aspx.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NGTools.MobilePages.A_FlowCal
|
||||
{
|
||||
public partial class penzui : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
15
NGTools/MobilePages/A_FlowCal/penzui.aspx.designer.cs
generated
Normal file
15
NGTools/MobilePages/A_FlowCal/penzui.aspx.designer.cs
generated
Normal file
@ -0,0 +1,15 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NGTools.MobilePages.A_FlowCal {
|
||||
|
||||
|
||||
public partial class penzui {
|
||||
}
|
||||
}
|
800
NGTools/MobilePages/B_ParCal/NGParCal.aspx
Normal file
800
NGTools/MobilePages/B_ParCal/NGParCal.aspx
Normal file
@ -0,0 +1,800 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NGParCal.aspx.cs" Inherits="NGTools.MobilePages.B_ParCal.NGParCal" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>天然气参数计算</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
|
||||
<script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
|
||||
<script src="../../MYJS/constant.js"></script>
|
||||
<script src="../../MYJS/MyToolsMobile.js"></script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div data-role="page" id="pageOne">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>天然气参数计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab" class="ui-btn-active">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab" class="ui-btn">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
<form method="post" id="WorkPar">
|
||||
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="DWCZ" style="width: 110px; font-size: small;">单位/场站</label>
|
||||
<select id="DWCZ" required="required" data-mini="true">
|
||||
<option value="-1">请选择场站:</option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="JLD" style="width: 110px; font-size: small;">计量点名称</label>
|
||||
<select id="JLD" required="required" data-mini="true">
|
||||
<option value="-1">请选择计量点:</option>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="inP" style="width: 110px; font-size: small;">表压力(MPa):</label>
|
||||
<input style="width: 90px" name="inP" id="inP" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="inWd" style="width: 110px; font-size: small;">温度(℃):</label>
|
||||
<input style="width: 90px" name="inWd" id="inWd" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: 50%">
|
||||
<label for="DDDQY" style="width: 110px; font-size: small;">大气压(MPa):</label>
|
||||
<input style="width: 90px" name="DDDQY" id="DDDQY" required="required" type="text" value="" data-mini="true" />
|
||||
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="CBTJ" style="width: 110px; font-size: small;">参比条件:</label>
|
||||
<select name="CBTJ" id="CBTJ" required="required" data-mini="true">
|
||||
<option value="-1">请选择参比条件:</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="page" id="pageTwo">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>天然气参数计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab" class="ui-btn-active">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
<form method="post" id="frmNGCom">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<a onclick="ZoreM()" class="ui-btn " data-mini="true">全部清零</a>
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<a onclick="copyZfM()" class="ui-btn " data-mini="true">复制组分</a>
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<a onclick="pasteZfM()" class="ui-btn " data-mini="true">粘贴组分</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="CYCS">常用组分:</label>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<select id="CYCS" required="required" data-mini="true">
|
||||
<option value="-1">请选择常用组分:</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C1">甲烷C1:</label><input style="width: 80px" name="NG_C1" id="NG_C1" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_N2">氮气N2:</label><input style="width: 80px" name="NG_N2" id="NG_N2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_CO2">二氧化碳CO2:</label><input style="width: 80px" name="NG_CO2" id="NG_CO2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C2">乙烷C2:</label><input style="width: 80px" name="NG_C2" id="NG_C2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C3">丙烷C3:</label><input style="width: 80px" name="NG_C3" id="NG_C3" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2O">水H2O:</label><input style="width: 80px" name="NG_H2O" id="NG_H2O" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2S">硫化氢H2S:</label><input style="width: 80px" name="NG_H2S" id="NG_H2S" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2">氢气H2:</label><input style="width: 80px" name="NG_H2" id="NG_H2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_CO">一氧化碳CO:</label><input style="width: 80px" name="NG_CO" id="NG_CO" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_O2">氧气O2:</label><input style="width: 80px" name="NG_O2" id="NG_O2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_iC4">异丁烷iC4:</label><input style="width: 80px" name="NG_iC4" id="NG_iC4" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_nC4">正丁烷nC4:</label><input style="width: 80px" name="NG_nC4" id="NG_nC4" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_iC5">异戊烷iC5:</label><input style="width: 80px" name="NG_iC5" id="NG_iC5" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_nC5">正戊烷nC5:</label><input style="width: 80px" name="NG_nC5" id="NG_nC5" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C6">己烷C6:</label><input style="width: 80px" name="NG_C6" id="NG_C6" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C7">庚烷C7:</label><input style="width: 80px" name="NG_C7" id="NG_C7" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C8">辛烷C8:</label><input style="width: 80px" name="NG_C8" id="NG_C8" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C9">壬烷C9:</label><input style="width: 80px" name="NG_C9" id="NG_C9" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C10">癸烷C10:</label><input style="width: 80px" name="NG_C10" id="NG_C10" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_He">氦气He:</label><input style="width: 80px" name="NG_He" id="NG_He" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_Ar">氩气Ar:</label><input style="width: 80px" name="NG_Ar" id="NG_Ar" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_SUM">合计:</label><input style="width: 80px" id="NG_SUM" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div data-role="page" id="pageThree">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>天然气参数计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab" class="ui-btn-active">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 30%" colspan="3">
|
||||
<a onclick="SavePar()" class="ui-btn ui-corner-all ui-shadow" data-mini="true">保存计量点参数</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td colspan ="3" style ="color :red">GB/T 17747计算方法结果</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dZb" data-mini="true">标况压缩因子</label><input style="width: 80px" name="dZb" id="dZb" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dZf" data-mini="true">工况压缩因子</label><input style="width: 80px" name="dZf" id="dZf" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dFpv" data-mini="true">超压缩系数</label><input style="width: 80px" name="dFpv" id="dFpv" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dMrx" data-mini="true">分子量</label><input style="width: 80px" name="dMrx" id="dMrx" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dDb" data-mini="true">标况密度(mol/m³)</label><input style="width: 80px" name="dDb" id="dDb" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dDf" data-mini="true">工况密度(mol/m³)</label><input style="width: 80px" name="dDf" id="dDf" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dRhob" data-mini="true">标况密度(kg/m3)</label><input style="width: 80px" name="dRhob" id="dRhob" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dRhof" data-mini="true">工况密度(kg/m3)</label><input style="width: 80px" name="dRhof" id="dRhof" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dRD_Real" data-mini="true">真实相对密度</label><input style="width: 80px" name="dRD_Real" id="dRD_Real" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<%-- <td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dRD_Ideal" data-mini="true">理想相对密度</label><input style="width: 80px" name="dRD_Ideal" id="dRD_Ideal" required="required" type="text" value="" data-mini="true" />
|
||||
</td>--%>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan ="3" style ="color :red">热值</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dHhvMol" data-mini="true">高位发热量(MJ/mol)</label><input style="width: 80px" name="dHhvMol" id="dHhvMol" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dHhvv" data-mini="true">高位发热量(MJ/m³)</label><input style="width: 80px" name="dHhvv" id="dHhvv" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dHhvm" data-mini="true">高位发热量(MJ/kg)</label><input style="width: 80px" name="dHhvm" id="dHhvm" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dLhvMol" data-mini="true">低位发热量(MJ/mol)</label><input style="width: 80px" name="dLhvMol" id="dLhvMol" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dLhvv" data-mini="true">低位发热量(MJ/m³)</label><input style="width: 80px" name="dLhvv" id="dLhvv" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dLhvm" data-mini="true">低位发热量(MJ/kg)</label><input style="width: 80px" name="dLhvm" id="dLhvm" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan ="3" style ="color :red">AGA 10计算结果</td>
|
||||
</tr>
|
||||
<tr> <td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dKappa" data-mini="true">等熵指数</label><input style="width: 80px" name="dKappa" id="dKappa" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dSOS" data-mini="true">声速(m/s)</label><input style="width: 80px" name="dSOS" id="dSOS" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dCstar" data-mini="true">临界流函数</label><input style="width: 80px" name="dCstar" id="dCstar" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan ="3" style ="color :red">临界常数和爆炸极限</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="Pc" data-mini="true">临界压力(MPa)</label><input style="width: 80px" name="Pc" id="Pc" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="TC" data-mini="true">临界温度(℃)</label><input style="width: 80px" name="TC" id="TC" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="Bzsx" data-mini="true">爆炸上限</label><input style="width: 80px" name="Bzsx" id="Bzsx" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="Bzxx" data-mini="true">爆炸下限</label><input style="width: 80px" name="Bzxx" id="Bzxx" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan ="3" style ="color :red">烃含量</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="TotalC" data-mini="true">总炭含量(kg/m3)</label><input style="width: 80px" name="TotalC" id="TotalC" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="C2" data-mini="true">C2含量(kg/m3)</label><input style="width: 80px" name="C2" id="C2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="C2j" data-mini="true">C2+含量(kg/m3)</label><input style="width: 80px" name="C2j" id="C2j" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="C3j" data-mini="true">C3+含量(kg/m3)</label><input style="width: 80px" name="C3j" id="C3j" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="C4j" data-mini="true">C4+含量(kg/m3)</label><input style="width: 80px" name="C4j" id="C4j" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="C5j" data-mini="true">C5+含量(kg/m3)</label><input style="width: 80px" name="C5j" id="C5j" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="C6j" data-mini="true">C6+含量(kg/m3)</label><input style="width: 80px" name="C6j" id="C6j" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="C3C4" data-mini="true">C3C4含量(kg/m3)</label><input style="width: 80px" name="C3C4" id="C3C4" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan ="3" style ="color :red">GB/T 11062计算方法结果</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dZb11062" data-mini="true">标况压缩因子</label><input style="width: 80px" name="dZb11062" id="dZb11062" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dRhob11062" data-mini="true">标况密度(kg/m3)</label><input style="width: 80px" name="dRhob11062" id="dRhob11062" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dRhof11062" data-mini="true">工况密度(kg/m3)</label><input style="width: 80px" name="dRhof11062" id="dRhof11062" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dRD_Real11062" data-mini="true">真实相对密度</label><input style="width: 80px" name="dRD_Real11062" id="dRD_Real11062" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dWobbeIndex" data-mini="true">沃泊指数</label><input style="width: 80px" name="dWobbeIndex" id="dWobbeIndex" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan ="3" style ="color :red">其他参数</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dHo" data-mini="true">理想比焓</label><input style="width: 80px" name="dHo" id="dHo" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dH" data-mini="true">真实焓</label><input style="width: 80px" name="dH" id="dH" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dS" data-mini="true">真实熵</label><input style="width: 80px" name="dS" id="dS" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dCpi" data-mini="true">理想定压热容</label><input style="width: 80px" name="dCpi" id="dCpi" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dCp" data-mini="true">定压热容</label><input style="width: 80px" name="dCp" id="dCp" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dCv" data-mini="true">定容积热容</label><input style="width: 80px" name="dCv" id="dCv" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="dk" data-mini="true">比热比</label><input style="width: 80px" name="dk" id="dk" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var initFlag = true;
|
||||
var jsonJld = "";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$(document).on("pageinit", function () {
|
||||
|
||||
if (initFlag) {
|
||||
|
||||
|
||||
//填充单位和站场 计量点下拉框
|
||||
var url = '../../ASHX/getTreeCombox.ashx?action=getJldSelect';
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
dataType: "json",
|
||||
url: url,
|
||||
success: function (data) {
|
||||
|
||||
var dwcz = data[0].DWZC;
|
||||
jsonJld = data[1].JLD;
|
||||
|
||||
var opth = "";
|
||||
for (var i = 0; i < dwcz.length; i++) {
|
||||
opth += "<option value=" + dwcz[i].ORG_ID + ">" + dwcz[i].ORG_Name + "</option>";
|
||||
}
|
||||
$("#DWCZ").append(opth);
|
||||
|
||||
|
||||
// 填充单位下拉列表
|
||||
$("#DWCZ").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var selectedDWCZ = $("#DWCZ :selected").val();
|
||||
if (selectedDWCZ != -1) {
|
||||
var jdlArrOptionHtml = "";
|
||||
var jdlArr = jsonJld[0][selectedDWCZ];
|
||||
for (var i = 0; i < jdlArr.length; i++) {
|
||||
jdlArrOptionHtml += "<option value=" + jdlArr[i].ID + ">" + jdlArr[i].JLD_Name + "</option>";
|
||||
}
|
||||
// 清空之前的计量点列表
|
||||
$("#JLD option[value!=-1]").remove();
|
||||
$("#JLD option[value=-1]").attr("selected", true);
|
||||
$("#JLD").append(jdlArrOptionHtml);
|
||||
|
||||
|
||||
|
||||
//$("#JLD option[value='" + jdlArr[0].ID + "']").attr("selected", "selected");
|
||||
//$("#JLD").val(jdlArr[0].ID).selectmenu("refresh", true);
|
||||
}
|
||||
});
|
||||
// 计量点列表事件
|
||||
$("#JLD").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var jldID = $("#JLD :selected").val();
|
||||
if (jldID != -1) {
|
||||
//alert(jldID);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=getJldPar&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { jldid: jldID, gnmk: "MD" },
|
||||
success: function (data) {
|
||||
|
||||
var options = { jsonValue: data, isDebug: false };
|
||||
$("#WorkPar").initForm(options);
|
||||
$("#frmNGCom").initForm(options);
|
||||
sumZfM();
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
// 计量点列表事件
|
||||
$("#CYCS").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var CYCSID = $("#CYCS :selected").val();
|
||||
if (CYCSID != -1) {
|
||||
|
||||
var data = NGComCon[CYCSID].NGCom;
|
||||
|
||||
var options = { jsonValue: data, isDebug: false };
|
||||
|
||||
$("#WorkPar").initForm(options);
|
||||
$("#frmNGCom").initForm(options);
|
||||
|
||||
|
||||
sumZfM();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// 填充常数下拉列表
|
||||
var OptionHtml = "";
|
||||
|
||||
|
||||
for (var i = 0; i < CBTJ.length; i++) {
|
||||
OptionHtml += "<option value=" + CBTJ[i].ID + ">" + CBTJ[i].text + "</option>";
|
||||
}
|
||||
$("#CBTJ").append(OptionHtml);
|
||||
$("#CBTJ").val(0).selectmenu('refresh', true);
|
||||
|
||||
OptionHtml = "";
|
||||
|
||||
for (var i = 0; i < CycsCom.length; i++) {
|
||||
OptionHtml += "<option value=" + CycsCom[i].ID + ">" + CycsCom[i].text + "</option>";
|
||||
}
|
||||
$("#CYCS").append(OptionHtml);
|
||||
//$("#CYCS").val(0).selectmenu('refresh', true);
|
||||
|
||||
|
||||
|
||||
$('#NG_C1').on('input', function (e) { sumZfM() });
|
||||
$('#NG_N2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_CO2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C3').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2O').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2S').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_CO').on('input', function (e) { sumZfM() });
|
||||
$('#NG_O2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_iC4').on('input', function (e) { sumZfM() });
|
||||
$('#NG_nC4').on('input', function (e) { sumZfM() });
|
||||
$('#NG_iC5').on('input', function (e) { sumZfM() });
|
||||
$('#NG_nC5').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C6').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C7').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C8').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C9').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C10').on('input', function (e) { sumZfM() });
|
||||
$('#NG_He').on('input', function (e) { sumZfM() });
|
||||
$('#NG_Ar').on('input', function (e) { sumZfM() });
|
||||
|
||||
|
||||
//
|
||||
//$("#pageOne").bind("swipeleft", function (e) { $.mobile.changePage('#pageTow', 'fade', false, false); });
|
||||
//$("#pageTwo").bind("swipeleft", function (e) { $.mobile.changePage('#pageThree', 'fade', false, false); });
|
||||
//$("#pageThree").bind("swipeleft", function (e) { $.mobile.changePage('#pageOne', 'fade', false, false); });
|
||||
|
||||
//$("#pageOne").bind("swiperight", function (e) { $.mobile.changePage('#pageThree', 'fade', false, false); });
|
||||
//$("#pageTwo").bind("swiperight", function (e) { $.mobile.changePage('#pageOne', 'fade', false, false); });
|
||||
//$("#pageThree").bind("swiperight", function (e) { $.mobile.changePage('#pageTwo', 'fade', false, false); });
|
||||
//alert('<%=Session ["userAccount"]%>');
|
||||
|
||||
var str = getEnable('<%=Session ["userAccount"]%>', "M0101");
|
||||
|
||||
//alert(101);
|
||||
initFlag = false;
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
function FlowCal() {
|
||||
|
||||
var NG_par = "";
|
||||
|
||||
if ($('#inP').val() == "") {
|
||||
alert("请输入压力!");
|
||||
return;
|
||||
}
|
||||
if ($('#DDDQY').val() == "") {
|
||||
alert("请输入大气压力!");
|
||||
return;
|
||||
}
|
||||
if ($('#inWd').val() == "") {
|
||||
alert("请输入温度!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (Math.abs(sumZfM() - 100) > 0.001) { $.messager.alert("提示", "组分和不为100%,请检查!"); return; }
|
||||
|
||||
|
||||
|
||||
|
||||
NG_par = "0";//流量计类别
|
||||
NG_par = NG_par + "," + "0";//节流装置类型
|
||||
NG_par = NG_par + "," + "0";//流量计算标准
|
||||
NG_par = NG_par + "," + "0";//压缩因子计算标准
|
||||
NG_par = NG_par + "," + $('#CBTJ').val();//'计量参比条件
|
||||
NG_par = NG_par + "," + "101325";//计量参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//计量参比条件温度
|
||||
NG_par = NG_par + "," + "101325";//燃烧参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//燃烧参比条件温度
|
||||
NG_par = NG_par + "," + $('#DDDQY').val();//当地大气压
|
||||
NG_par = NG_par + "," + "2";//当地大气压单位
|
||||
NG_par = NG_par + "," + strZfM();//天然气组分
|
||||
NG_par = NG_par + "," + "0";//取压方式
|
||||
NG_par = NG_par + "," + "0";//管道类型
|
||||
NG_par = NG_par + "," + "150";//管道内径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//管道内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//管道材料
|
||||
NG_par = NG_par + "," + "50";//孔板孔径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//孔板内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//孔板材料
|
||||
NG_par = NG_par + "," + "0";//锐利度系数计算方法
|
||||
NG_par = NG_par + "," + "0";//孔板入口圆弧半径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + $('#inP').val();//输入压力
|
||||
NG_par = NG_par + "," + "2";//压力单位
|
||||
NG_par = NG_par + "," + "0";//压力类型
|
||||
NG_par = NG_par + "," + $('#inWd').val();//输入温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//输入差压
|
||||
NG_par = NG_par + "," + "1";//压力单位
|
||||
NG_par = NG_par + "," + "1";//体积流量单位
|
||||
NG_par = NG_par + "," + "2";//质量流量单位
|
||||
NG_par = NG_par + "," + "1";//能量流量单位
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
//url: '../../Pages/A_FlowCal/orifice.aspx?action=Cal' + "&t=" + Date.parse(new Date()),
|
||||
url: '../../ASHX/FlowCal.ashx?action=PARCal' + "&t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { Par: NG_par },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
|
||||
$('#dMrx').val(parseFloat(data[63]).toFixed(5));
|
||||
$('#dZb').val(parseFloat(data[64]).toFixed(5));
|
||||
$('#dZf').val(parseFloat(data[65]).toFixed(5));
|
||||
$('#dFpv').val(parseFloat(data[66]).toFixed(5));
|
||||
$('#dDb').val(parseFloat(data[67]).toFixed(5));
|
||||
$('#dDf').val(parseFloat(data[68]).toFixed(5));
|
||||
$('#dRhob').val(parseFloat(data[69]).toFixed(5));
|
||||
$('#dRhof').val(parseFloat(data[70]).toFixed(5));
|
||||
//$('#dRD_Ideal').val(parseFloat(data[71]).toFixed(5));
|
||||
$('#dRD_Real').val(parseFloat(data[72]).toFixed(5));
|
||||
$('#dHo').val(parseFloat(data[73]).toFixed(5));
|
||||
$('#dH').val(parseFloat(data[74]).toFixed(5));
|
||||
$('#dS').val(parseFloat(data[75]).toFixed(5));
|
||||
$('#dCpi').val(parseFloat(data[76]).toFixed(5));
|
||||
$('#dCp').val(parseFloat(data[77]).toFixed(5));
|
||||
$('#dCv').val(parseFloat(data[78]).toFixed(5));
|
||||
$('#dk').val(parseFloat(data[79]).toFixed(5));
|
||||
$('#dKappa').val(parseFloat(data[80]).toFixed(5));
|
||||
$('#dSOS').val(parseFloat(data[81]).toFixed(5));
|
||||
$('#dCstar').val(parseFloat(data[82]).toFixed(5));
|
||||
$('#dHhvMol').val(parseFloat(data[83]).toFixed(5));
|
||||
$('#dLhvMol').val(parseFloat(data[84]).toFixed(5));
|
||||
$('#dHhvv').val(parseFloat(data[85]).toFixed(5));
|
||||
$('#dLhvv').val(parseFloat(data[86]).toFixed(5));
|
||||
$('#dHhvm').val(parseFloat(data[87]).toFixed(5));
|
||||
$('#dLhvm').val(parseFloat(data[88]).toFixed(5));
|
||||
$('#dZb11062').val(parseFloat(data[89]).toFixed(5));
|
||||
$('#dRhob11062').val(parseFloat(data[90]).toFixed(5));
|
||||
$('#dRhof11062').val(parseFloat(data[91]).toFixed(5));
|
||||
$('#dRD_Ideal11062').val(parseFloat(data[92]).toFixed(5));
|
||||
$('#dRD_Real11062').val(parseFloat(data[93]).toFixed(5));
|
||||
$('#dWobbeIndex').val(parseFloat(data[94]).toFixed(5));
|
||||
$('#Pc').val(parseFloat(data[95]).toFixed(5));
|
||||
$('#TC').val(parseFloat(data[96]).toFixed(5));
|
||||
$('#Bzsx').val(parseFloat(data[97]).toFixed(5));
|
||||
$('#Bzxx').val(parseFloat(data[98]).toFixed(5));
|
||||
$('#TotalC').val(parseFloat(data[99]).toFixed(5));
|
||||
$('#C2').val(parseFloat(data[100]).toFixed(5));
|
||||
$('#C2j').val(parseFloat(data[101]).toFixed(5));
|
||||
$('#C3j').val(parseFloat(data[102]).toFixed(5));
|
||||
$('#C4j').val(parseFloat(data[103]).toFixed(5));
|
||||
$('#C5j').val(parseFloat(data[104]).toFixed(5));
|
||||
$('#C6j').val(parseFloat(data[105]).toFixed(5));
|
||||
$('#C3C4').val(parseFloat(data[106]).toFixed(5));
|
||||
//alert(11);
|
||||
setremainTimes('<%=Session ["userAccount"]%>', "M0101");
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function SavePar() {
|
||||
var saveStr1 = JSON.stringify($('#WorkPar').getFormJson()); // json对象;
|
||||
var saveStr2 = JSON.stringify($('#frmNGCom').getFormJson()); // json对象;
|
||||
|
||||
|
||||
saveStr = (saveStr1 + saveStr2).replace("}{", ",");
|
||||
|
||||
// alert(JSON.stringify(saveStr));
|
||||
// alert(JSON.stringify(saveStr2));
|
||||
|
||||
|
||||
var jldID = $('#JLD').val();
|
||||
var jldIDName = $('#JLD').find("option:selected").text();
|
||||
|
||||
if (confirm("确定将计量点参数保存到计量点:" + jldIDName + "")) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=saveJldPar&' + "t=" + Date.parse(new Date()),
|
||||
//dataType: "json",
|
||||
data: { jldid: jldID, Par: saveStr, gnmk: "MD" },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
alert(JSON.stringify(data));
|
||||
|
||||
//$('#formPar').form('load', data);
|
||||
//$.messager.alert("提示", data);
|
||||
|
||||
//document.getElementById('message').innerHTML = JSON.stringify(data);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$("a[data-role=tab]").each(function () {
|
||||
var anchor = $(this);
|
||||
anchor.bind("click", function () {
|
||||
$.mobile.changePage(anchor.attr("href"), {
|
||||
transition: "none",
|
||||
changeHash: false
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
$("div[data-role=page]").bind("pagebeforeshow", function (e, data) {
|
||||
$.mobile.silentScroll(0);
|
||||
$.mobile.changePage.defaults.transition = 'slide';
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
17
NGTools/MobilePages/B_ParCal/NGParCal.aspx.cs
Normal file
17
NGTools/MobilePages/B_ParCal/NGParCal.aspx.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NGTools.MobilePages.B_ParCal
|
||||
{
|
||||
public partial class NGParCal : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
15
NGTools/MobilePages/B_ParCal/NGParCal.aspx.designer.cs
generated
Normal file
15
NGTools/MobilePages/B_ParCal/NGParCal.aspx.designer.cs
generated
Normal file
@ -0,0 +1,15 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NGTools.MobilePages.B_ParCal {
|
||||
|
||||
|
||||
public partial class NGParCal {
|
||||
}
|
||||
}
|
912
NGTools/MobilePages/B_ParCal/Z_TableCal.aspx
Normal file
912
NGTools/MobilePages/B_ParCal/Z_TableCal.aspx
Normal file
@ -0,0 +1,912 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Z_TableCal.aspx.cs" Inherits="NGTools.MobilePages.B_ParCal.Z_TableCal" %>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>天然气压缩因子表格计算</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
|
||||
<script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
|
||||
|
||||
|
||||
<script src="../../MYJS/constant.js"></script>
|
||||
<script src="../../MYJS/MyToolsMobile.js"></script>
|
||||
|
||||
|
||||
<style>
|
||||
.scroll-container{
|
||||
width:800px;
|
||||
height:400px;
|
||||
overflow :auto ;
|
||||
}
|
||||
|
||||
.scroll-content{
|
||||
width:800px;
|
||||
height:400px;
|
||||
overflow :auto ;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div data-role="page" id="pageOne">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>压缩因子表格计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab" class="ui-btn-active">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab" class="ui-btn">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
<form method="post" id="WorkPar">
|
||||
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="DWCZ" style="width: 110px; font-size: small;">单位/场站</label>
|
||||
<select id="DWCZ" required="required" data-mini="true">
|
||||
<option value="-1">请选择场站:</option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="JLD" style="width: 110px; font-size: small;">计量点名称</label>
|
||||
<select id="JLD" required="required" data-mini="true">
|
||||
<option value="-1">请选择计量点:</option>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="inP" style="width: 110px; font-size: small;">起始压力(MPa):</label>
|
||||
<input style="width: 90px" name="inP" id="inP" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="inWd" style="width: 110px; font-size: small;">起始温度(℃):</label>
|
||||
<input style="width: 90px" name="inWd" id="inWd" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="yljg" style="width: 110px; font-size: small;">压力间隔(MPa):</label>
|
||||
<input style="width: 90px" name="yljg" id="yljg" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="wdjg" style="width: 110px; font-size: small;">温度间隔(MPa):</label>
|
||||
<input style="width: 90px" name="wdjg" id="wdjg" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="inPe" style="width: 110px; font-size: small;">终止压力(MPa):</label>
|
||||
<input style="width: 90px" name="inPe" id="inPe" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="inWde" style="width: 110px; font-size: small;">终止温度(℃):</label>
|
||||
<input style="width: 90px" name="inWde" id="inWde" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: 50%">
|
||||
<label for="DDDQY" style="width: 110px; font-size: small;">大气压(MPa):</label>
|
||||
<input style="width: 90px" name="DDDQY" id="DDDQY" required="required" type="text" value="" data-mini="true" />
|
||||
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="CBTJ" style="width: 110px; font-size: small;">参比条件:</label>
|
||||
<select name="CBTJ" id="CBTJ" required="required" data-mini="true">
|
||||
<option value="-1">请选择参比条件:</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="page" id="pageTwo">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>压缩因子表格计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab" class="ui-btn-active">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
<form method="post" id="frmNGCom">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<a onclick="ZoreM()" class="ui-btn " data-mini="true">全部清零</a>
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<a onclick="copyZfM()" class="ui-btn " data-mini="true">复制组分</a>
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<a onclick="pasteZfM()" class="ui-btn " data-mini="true">粘贴组分</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="CYCS">常用组分:</label>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<select id="CYCS" required="required" data-mini="true">
|
||||
<option value="-1">请选择常用组分:</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C1">甲烷C1:</label><input style="width: 80px" name="NG_C1" id="NG_C1" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_N2">氮气N2:</label><input style="width: 80px" name="NG_N2" id="NG_N2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_CO2">二氧化碳CO2:</label><input style="width: 80px" name="NG_CO2" id="NG_CO2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C2">乙烷C2:</label><input style="width: 80px" name="NG_C2" id="NG_C2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C3">丙烷C3:</label><input style="width: 80px" name="NG_C3" id="NG_C3" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2O">水H2O:</label><input style="width: 80px" name="NG_H2O" id="NG_H2O" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2S">硫化氢H2S:</label><input style="width: 80px" name="NG_H2S" id="NG_H2S" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2">氢气H2:</label><input style="width: 80px" name="NG_H2" id="NG_H2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_CO">一氧化碳CO:</label><input style="width: 80px" name="NG_CO" id="NG_CO" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_O2">氧气O2:</label><input style="width: 80px" name="NG_O2" id="NG_O2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_iC4">异丁烷iC4:</label><input style="width: 80px" name="NG_iC4" id="NG_iC4" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_nC4">正丁烷nC4:</label><input style="width: 80px" name="NG_nC4" id="NG_nC4" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_iC5">异戊烷iC5:</label><input style="width: 80px" name="NG_iC5" id="NG_iC5" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_nC5">正戊烷nC5:</label><input style="width: 80px" name="NG_nC5" id="NG_nC5" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C6">己烷C6:</label><input style="width: 80px" name="NG_C6" id="NG_C6" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C7">庚烷C7:</label><input style="width: 80px" name="NG_C7" id="NG_C7" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C8">辛烷C8:</label><input style="width: 80px" name="NG_C8" id="NG_C8" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C9">壬烷C9:</label><input style="width: 80px" name="NG_C9" id="NG_C9" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C10">癸烷C10:</label><input style="width: 80px" name="NG_C10" id="NG_C10" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_He">氦气He:</label><input style="width: 80px" name="NG_He" id="NG_He" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_Ar">氩气Ar:</label><input style="width: 80px" name="NG_Ar" id="NG_Ar" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_SUM">合计:</label><input style="width: 80px" id="NG_SUM" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div data-role="page" id="pageThree">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>压缩因子表格计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab" class="ui-btn-active">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 30%" colspan="3">
|
||||
<a onclick="SavePar()" class="ui-btn ui-corner-all ui-shadow" data-mini="true">保存计量点参数</a>
|
||||
<a onclick="ExportExcel()" class="ui-btn ui-corner-all ui-shadow" data-mini="true">导出Excel</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<div id="result" class ="scroll-container" style="width: 100%;overflow:auto">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var initFlag = true;
|
||||
var jsonJld = "";
|
||||
|
||||
var ETable = undefined;
|
||||
var jsonresult = undefined;
|
||||
|
||||
|
||||
|
||||
$(document).on("pageinit", function () {
|
||||
|
||||
if (initFlag) {
|
||||
|
||||
|
||||
//填充单位和站场 计量点下拉框
|
||||
var url = '../../ASHX/getTreeCombox.ashx?action=getJldSelect';
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
dataType: "json",
|
||||
url: url,
|
||||
success: function (data) {
|
||||
|
||||
var dwcz = data[0].DWZC;
|
||||
jsonJld = data[1].JLD;
|
||||
|
||||
var opth = "";
|
||||
for (var i = 0; i < dwcz.length; i++) {
|
||||
opth += "<option value=" + dwcz[i].ORG_ID + ">" + dwcz[i].ORG_Name + "</option>";
|
||||
}
|
||||
$("#DWCZ").append(opth);
|
||||
|
||||
|
||||
// 填充单位下拉列表
|
||||
$("#DWCZ").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var selectedDWCZ = $("#DWCZ :selected").val();
|
||||
if (selectedDWCZ != -1) {
|
||||
var jdlArrOptionHtml = "";
|
||||
var jdlArr = jsonJld[0][selectedDWCZ];
|
||||
for (var i = 0; i < jdlArr.length; i++) {
|
||||
jdlArrOptionHtml += "<option value=" + jdlArr[i].ID + ">" + jdlArr[i].JLD_Name + "</option>";
|
||||
}
|
||||
// 清空之前的计量点列表
|
||||
$("#JLD option[value!=-1]").remove();
|
||||
$("#JLD option[value=-1]").attr("selected", true);
|
||||
$("#JLD").append(jdlArrOptionHtml);
|
||||
|
||||
|
||||
|
||||
//$("#JLD option[value='" + jdlArr[0].ID + "']").attr("selected", "selected");
|
||||
//$("#JLD").val(jdlArr[0].ID).selectmenu("refresh", true);
|
||||
}
|
||||
});
|
||||
// 计量点列表事件
|
||||
$("#JLD").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var jldID = $("#JLD :selected").val();
|
||||
if (jldID != -1) {
|
||||
//alert(jldID);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=getJldPar&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { jldid: jldID, gnmk: "ZT" },
|
||||
success: function (data) {
|
||||
|
||||
var options = { jsonValue: data, isDebug: false };
|
||||
$("#WorkPar").initForm(options);
|
||||
$("#frmNGCom").initForm(options);
|
||||
sumZfM();
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
// 计量点列表事件
|
||||
$("#CYCS").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var CYCSID = $("#CYCS :selected").val();
|
||||
if (CYCSID != -1) {
|
||||
|
||||
var data = NGComCon[CYCSID].NGCom;
|
||||
|
||||
var options = { jsonValue: data, isDebug: false };
|
||||
|
||||
$("#WorkPar").initForm(options);
|
||||
$("#frmNGCom").initForm(options);
|
||||
|
||||
|
||||
sumZfM();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// 填充常数下拉列表
|
||||
var OptionHtml = "";
|
||||
|
||||
|
||||
for (var i = 0; i < CBTJ.length; i++) {
|
||||
OptionHtml += "<option value=" + CBTJ[i].ID + ">" + CBTJ[i].text + "</option>";
|
||||
}
|
||||
$("#CBTJ").append(OptionHtml);
|
||||
$("#CBTJ").val(0).selectmenu('refresh', true);
|
||||
|
||||
OptionHtml = "";
|
||||
|
||||
for (var i = 0; i < CycsCom.length; i++) {
|
||||
OptionHtml += "<option value=" + CycsCom[i].ID + ">" + CycsCom[i].text + "</option>";
|
||||
}
|
||||
$("#CYCS").append(OptionHtml);
|
||||
//$("#CYCS").val(0).selectmenu('refresh', true);
|
||||
|
||||
|
||||
|
||||
$('#NG_C1').on('input', function (e) { sumZfM() });
|
||||
$('#NG_N2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_CO2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C3').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2O').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2S').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_CO').on('input', function (e) { sumZfM() });
|
||||
$('#NG_O2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_iC4').on('input', function (e) { sumZfM() });
|
||||
$('#NG_nC4').on('input', function (e) { sumZfM() });
|
||||
$('#NG_iC5').on('input', function (e) { sumZfM() });
|
||||
$('#NG_nC5').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C6').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C7').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C8').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C9').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C10').on('input', function (e) { sumZfM() });
|
||||
$('#NG_He').on('input', function (e) { sumZfM() });
|
||||
$('#NG_Ar').on('input', function (e) { sumZfM() });
|
||||
|
||||
|
||||
//
|
||||
//$("#pageOne").bind("swipeleft", function (e) { $.mobile.changePage('#pageTow', 'fade', false, false); });
|
||||
//$("#pageTwo").bind("swipeleft", function (e) { $.mobile.changePage('#pageThree', 'fade', false, false); });
|
||||
//$("#pageThree").bind("swipeleft", function (e) { $.mobile.changePage('#pageOne', 'fade', false, false); });
|
||||
|
||||
//$("#pageOne").bind("swiperight", function (e) { $.mobile.changePage('#pageThree', 'fade', false, false); });
|
||||
//$("#pageTwo").bind("swiperight", function (e) { $.mobile.changePage('#pageOne', 'fade', false, false); });
|
||||
//$("#pageThree").bind("swiperight", function (e) { $.mobile.changePage('#pageTwo', 'fade', false, false); });
|
||||
//alert('<%=Session ["userAccount"]%>');
|
||||
|
||||
var str = getEnable('<%=Session ["userAccount"]%>', "M0101");
|
||||
|
||||
//alert(101);
|
||||
initFlag = false;
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
function FlowCal() {
|
||||
|
||||
var NG_par = "";
|
||||
jsonResult = undefined;
|
||||
if ($('#inP').val() == "") {
|
||||
alert("请输入压力!");
|
||||
return;
|
||||
}
|
||||
if ($('#DDDQY').val() == "") {
|
||||
alert("请输入大气压力!");
|
||||
return;
|
||||
}
|
||||
if ($('#inWd').val() == "") {
|
||||
alert("请输入温度!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (Math.abs(sumZfM() - 100) > 0.001) { $.messager.alert("提示", "组分和不为100%,请检查!"); return; }
|
||||
|
||||
|
||||
|
||||
|
||||
NG_par = "0";//流量计类别
|
||||
NG_par = NG_par + "," + "0";//节流装置类型
|
||||
NG_par = NG_par + "," + "0";//流量计算标准
|
||||
NG_par = NG_par + "," + "0";//压缩因子计算标准
|
||||
NG_par = NG_par + "," + $('#CBTJ').val();//'计量参比条件
|
||||
NG_par = NG_par + "," + "101325";//计量参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//计量参比条件温度
|
||||
NG_par = NG_par + "," + "101325";//燃烧参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//燃烧参比条件温度
|
||||
NG_par = NG_par + "," + $('#DDDQY').val();//当地大气压
|
||||
NG_par = NG_par + "," + "2";//当地大气压单位
|
||||
NG_par = NG_par + "," + strZfM();//天然气组分
|
||||
NG_par = NG_par + "," + "0";//取压方式
|
||||
NG_par = NG_par + "," + "0";//管道类型
|
||||
NG_par = NG_par + "," + "150";//管道内径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//管道内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//管道材料
|
||||
NG_par = NG_par + "," + "50";//孔板孔径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//孔板内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//孔板材料
|
||||
NG_par = NG_par + "," + "0";//锐利度系数计算方法
|
||||
NG_par = NG_par + "," + "0";//孔板入口圆弧半径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + $('#inP').val();//输入压力
|
||||
NG_par = NG_par + "," + "2";//压力单位
|
||||
NG_par = NG_par + "," + "0";//压力类型
|
||||
NG_par = NG_par + "," + $('#inWd').val();//输入温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//输入差压
|
||||
NG_par = NG_par + "," + "1";//压力单位
|
||||
NG_par = NG_par + "," + "1";//体积流量单位
|
||||
NG_par = NG_par + "," + "2";//质量流量单位
|
||||
NG_par = NG_par + "," + "1";//能量流量单位
|
||||
NG_par = NG_par + "," + $('#yljg').val();//压力步长
|
||||
NG_par = NG_par + "," + $('#wdjg').val();//温度步长
|
||||
NG_par = NG_par + "," + $('#inPe').val();//终止压力
|
||||
NG_par = NG_par + "," + $('#inWde').val();//终止温度
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
//url: '../../Pages/A_FlowCal/orifice.aspx?action=Cal' + "&t=" + Date.parse(new Date()),
|
||||
url: '../../ASHX/FlowCal.ashx?action=ZTCal' + "&t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { Par: NG_par },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
jsonresult = data.rows;
|
||||
|
||||
var div = document.getElementById("result");
|
||||
div.innerHTML = "";
|
||||
var table = document.createElement("table");
|
||||
var thead = document.createElement("tr");
|
||||
for (var p in jsonresult[0]) {//遍历json对象的每个key/value对,p为key
|
||||
var td = document.createElement("th");
|
||||
td.innerHTML = p;
|
||||
thead.appendChild(td);
|
||||
}
|
||||
table.appendChild(thead);
|
||||
for (var tableRowNo = 0; tableRowNo < jsonresult.length; tableRowNo++) {
|
||||
var tr = document.createElement("tr");
|
||||
for (var v in jsonresult[tableRowNo]) {//遍历json对象的每个key/value对,p为key
|
||||
var cell = document.createElement("td");
|
||||
|
||||
cell.innerHTML = jsonresult[tableRowNo][v];
|
||||
tr.appendChild(cell);
|
||||
}
|
||||
|
||||
table.appendChild(tr);
|
||||
}
|
||||
|
||||
ETable = table;
|
||||
|
||||
div.appendChild(table);
|
||||
|
||||
setremainTimes('<%=Session ["userAccount"]%>', "M0101");
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function SavePar() {
|
||||
var saveStr1 = JSON.stringify($('#WorkPar').getFormJson()); // json对象;
|
||||
var saveStr2 = JSON.stringify($('#frmNGCom').getFormJson()); // json对象;
|
||||
|
||||
|
||||
saveStr = (saveStr1 + saveStr2).replace("}{", ",");
|
||||
|
||||
// alert(JSON.stringify(saveStr));
|
||||
// alert(JSON.stringify(saveStr2));
|
||||
|
||||
|
||||
var jldID = $('#JLD').val();
|
||||
var jldIDName = $('#JLD').find("option:selected").text();
|
||||
|
||||
if (confirm("确定将计量点参数保存到计量点:" + jldIDName + "")) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=saveJldPar&' + "t=" + Date.parse(new Date()),
|
||||
//dataType: "json",
|
||||
data: { jldid: jldID, Par: saveStr, gnmk: "ZT" },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
alert(JSON.stringify(data));
|
||||
|
||||
//$('#formPar').form('load', data);
|
||||
//$.messager.alert("提示", data);
|
||||
|
||||
//document.getElementById('message').innerHTML = JSON.stringify(data);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function ExportExcel() {
|
||||
|
||||
//tableToExcel("result", "压缩因子表格");
|
||||
EasyUIDataGridToExcle();
|
||||
}
|
||||
|
||||
|
||||
$("a[data-role=tab]").each(function () {
|
||||
var anchor = $(this);
|
||||
anchor.bind("click", function () {
|
||||
$.mobile.changePage(anchor.attr("href"), {
|
||||
transition: "none",
|
||||
changeHash: false
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
$("div[data-role=page]").bind("pagebeforeshow", function (e, data) {
|
||||
$.mobile.silentScroll(0);
|
||||
$.mobile.changePage.defaults.transition = 'slide';
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 描述:导出表格对应的excel文件
|
||||
* 时间:2018-03-29
|
||||
* 作者:任恩远
|
||||
* 调用示例:
|
||||
* onclick = "tableToExcel(tableId,fileName)"
|
||||
*/
|
||||
/**
|
||||
* 描述:导出表格对应的excel文件
|
||||
* 时间:2018-03-29
|
||||
* 作者:任恩远
|
||||
* 调用示例:
|
||||
* onclick = "tableToExcel(tableId,fileName)"
|
||||
*/
|
||||
var tableToExcel = (function () {
|
||||
var uri = 'data:application/vnd.ms-excel;base64,'
|
||||
, template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->' +
|
||||
' <style type="text/css">' +
|
||||
'.excelTable {' +
|
||||
'border-collapse:collapse;' +
|
||||
' border:thin solid #999; ' +
|
||||
'}' +
|
||||
' .excelTable th {' +
|
||||
' border: thin solid #999;' +
|
||||
' padding:20px;' +
|
||||
' text-align: center;' +
|
||||
' border-top: thin solid #999;' +
|
||||
' ' +
|
||||
' }' +
|
||||
' .excelTable td{' +
|
||||
' border:thin solid #999;' +
|
||||
' padding:2px 5px;' +
|
||||
' text-align: center;' +
|
||||
' }</style>' + '</head><body><table border="1">{table}</table></body></html>'
|
||||
, base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))) }
|
||||
, format = function (s, c) { return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }) }
|
||||
return function (table, name) {
|
||||
if (!table.nodeType) table = document.getElementById(table)
|
||||
var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML };
|
||||
var downloadLink = document.createElement("a");
|
||||
downloadLink.href = uri + base64(format(template, ctx));
|
||||
downloadLink.download = name + ".xls";
|
||||
document.body.appendChild(downloadLink);
|
||||
downloadLink.click();
|
||||
document.body.removeChild(downloadLink);
|
||||
}
|
||||
})()
|
||||
|
||||
|
||||
|
||||
function exportTableToCSV(me, $table, filename) {
|
||||
var $headers = $table.find('tr:has(th)'), $rows = $table.find('tr:has(td)')
|
||||
// Temporary delimiter characters unlikely to be typed by keyboard
|
||||
// This is to avoid accidentally splitting the actual contents
|
||||
, tmpColDelim = String.fromCharCode(11) // vertical tab character
|
||||
, tmpRowDelim = String.fromCharCode(0) // null character
|
||||
// actual delimiter characters for CSV format
|
||||
, colDelim = '","', rowDelim = '"\r\n"';
|
||||
// Grab text from table into CSV formatted string
|
||||
var csv = '"';
|
||||
csv += formatRows($headers.map(grabRow));
|
||||
csv += rowDelim;
|
||||
csv += formatRows($rows.map(grabRow)) + '"';
|
||||
// Data URI
|
||||
var csvData = 'data:application/csv;charset=utf-8,\ufeff' + encodeURIComponent(csv);
|
||||
$(me)
|
||||
.attr({
|
||||
'download': filename,
|
||||
'href': csvData
|
||||
//,'target' : '_blank' //if you want it to open in a new window
|
||||
});
|
||||
//------------------------------------------------------------
|
||||
// Helper Functions
|
||||
//------------------------------------------------------------
|
||||
// Format the output so it has the appropriate delimiters
|
||||
function formatRows(rows) {
|
||||
return rows.get().join(tmpRowDelim)
|
||||
.split(tmpRowDelim).join(rowDelim)
|
||||
.split(tmpColDelim).join(colDelim);
|
||||
}
|
||||
|
||||
// Grab and format a row from the table
|
||||
function grabRow(i, row) {
|
||||
var $row = $(row);
|
||||
//for some reason $cols = $row.find('td') || $row.find('th') won't work...
|
||||
var $cols = $row.find('td');
|
||||
if (!$cols.length) $cols = $row.find('th');
|
||||
return $cols.map(grabCol)
|
||||
.get().join(tmpColDelim);
|
||||
}
|
||||
|
||||
// Grab and format a column from the table
|
||||
function grabCol(j, col) {
|
||||
var $col = $(col), $text = $col.text();
|
||||
return $text.replace('"', '""'); // escape double quotes
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
createTable(toid, jsondata, check, edit, del):用于动态创建table,第0行为表头,数据里必须包含表头和数据的id
|
||||
@toid:创建table到id为toid的节点下
|
||||
@jsondata:用于创建table的json格式的数据(须在jsondata里包含表头标题)
|
||||
@check:是否创建查看按钮
|
||||
@edit:是否创建编辑按钮
|
||||
@del:是否创建删除按钮
|
||||
*/
|
||||
function createTable(jsondata, check, edit, del) {
|
||||
var div = document.createElement("div");
|
||||
var table = document.createElement("table");
|
||||
var tr, td;
|
||||
for (i in jsondata) {
|
||||
tr = document.createElement("tr"); //创建tr
|
||||
//________________创建表头________________________________________
|
||||
if (i == 0) {
|
||||
for (j in jsondata[i]) { //根据数据在tr内创建td
|
||||
td = document.createElement("th");
|
||||
td.appendChild(document.createTextNode(jsondata[i][j]));
|
||||
if (j == "id") { //创建隐藏的td来存放id
|
||||
td.style.display = "none";
|
||||
}
|
||||
td.style.background = "#C1DAD7"; //设置表头颜色
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (check == true) { //创建查看按钮
|
||||
td = document.createElement("th");
|
||||
td.appendChild(document.createTextNode("查看"));
|
||||
td.style.background = "#C1DAD7"; //设置表头颜色
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (edit == true) { //创建编辑按钮
|
||||
td = document.createElement("th");
|
||||
td.appendChild(document.createTextNode("编辑"));
|
||||
td.style.background = "#C1DAD7"; //设置表头颜色
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (del == true) { //创建删除按钮
|
||||
td = document.createElement("th");
|
||||
td.appendChild(document.createTextNode("删除"));
|
||||
td.style.background = "#C1DAD7"; //设置表头颜色
|
||||
tr.appendChild(td);
|
||||
}
|
||||
}
|
||||
//________________创建数据行________________________________________
|
||||
else {
|
||||
for (j in jsondata[i]) { //根据数据在tr内创建td
|
||||
td = document.createElement("td");
|
||||
td.appendChild(document.createTextNode(jsondata[i][j]));
|
||||
if (j == "id") { //创建隐藏的td来存放id
|
||||
td.style.display = "none";
|
||||
}
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (check == true) { //创建查看按钮
|
||||
td = document.createElement("td");
|
||||
var btnCheck = document.createElement("button");
|
||||
btnCheck.appendChild(document.createTextNode("查看"));
|
||||
td.appendChild(btnCheck);
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (edit == true) { //创建编辑按钮
|
||||
td = document.createElement("td");
|
||||
var btnEdit = document.createElement("button");
|
||||
btnEdit.appendChild(document.createTextNode("编辑"));
|
||||
td.appendChild(btnEdit);
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (del == true) { //创建删除按钮
|
||||
td = document.createElement("td");
|
||||
var btnDel = document.createElement("button");
|
||||
btnDel.appendChild(document.createTextNode("删除"));
|
||||
td.appendChild(btnDel);
|
||||
tr.appendChild(td);
|
||||
}
|
||||
}
|
||||
table.appendChild(tr);
|
||||
}
|
||||
|
||||
div.appendChild(table);
|
||||
return div;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
作 用:将EasyUI的DataGrid表格,直接导出Excle
|
||||
例 子: EasyUIDataGridToExcle('SalaryReport', $('#dg'), 'getRows');
|
||||
说 明:文档名字,避免汉字,容易乱码 ,可能造成文档打不开的情况
|
||||
*/
|
||||
// strXlsName :文檔名字 exportGrid:$('#dg') H:getData:所有數據 getRows:當前頁的數據
|
||||
function EasyUIDataGridToExcle() {
|
||||
var f = $('<form action="../../ashx/ExportXls.ashx?ActionType=EasyUIDataGridToExcle" method="post" id="fm1"></form>');
|
||||
var i = $('<input type="hidden" id="txtContent" name="txtContent" />');
|
||||
var l = $('<input type="hidden" id="txtName" name="txtName" />');
|
||||
|
||||
|
||||
i.val(document.getElementById("result").innerHTML);
|
||||
//i.val(createTable(jsonresult, true, true, true).innerHTML);
|
||||
i.appendTo(f);
|
||||
l.val("压缩因子表");
|
||||
l.appendTo(f);
|
||||
f.appendTo(document.body).submit();
|
||||
var newf = document.getElementById("fm1");
|
||||
document.body.removeChild(newf);
|
||||
};
|
||||
function ChangeToTable(printDatagrid, H) {
|
||||
var tableString = '<table cellspacing="0" class="pb">';
|
||||
var frozenColumns = printDatagrid.datagrid("options").frozenColumns; // 得到frozenColumns对象
|
||||
var columns = printDatagrid.datagrid("options").columns; // 得到columns对象
|
||||
var nameList = new Array();
|
||||
|
||||
// 载入title
|
||||
if (typeof columns != 'undefined' && columns != '') {
|
||||
$(columns).each(function (index) {
|
||||
tableString += '\n<tr>';
|
||||
if (typeof frozenColumns != 'undefined' && typeof frozenColumns[index] != 'undefined') {
|
||||
for (var i = 0; i < frozenColumns[index].length; ++i) {
|
||||
if (!frozenColumns[index][i].hidden) {
|
||||
tableString += '\n<th width="' + frozenColumns[index][i].width + '"';
|
||||
if (typeof frozenColumns[index][i].rowspan != 'undefined' && frozenColumns[index][i].rowspan > 1) {
|
||||
tableString += ' rowspan="' + frozenColumns[index][i].rowspan + '"';
|
||||
}
|
||||
if (typeof frozenColumns[index][i].colspan != 'undefined' && frozenColumns[index][i].colspan > 1) {
|
||||
tableString += ' colspan="' + frozenColumns[index][i].colspan + '"';
|
||||
}
|
||||
if (typeof frozenColumns[index][i].field != 'undefined' && frozenColumns[index][i].field != '') {
|
||||
nameList.push(frozenColumns[index][i]);
|
||||
}
|
||||
tableString += '>' + frozenColumns[index][i].title + '</th>';
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < columns[index].length; ++i) {
|
||||
if (!columns[index][i].hidden) {
|
||||
tableString += '\n<th width="' + columns[index][i].width + '"';
|
||||
if (typeof columns[index][i].rowspan != 'undefined' && columns[index][i].rowspan > 1) {
|
||||
tableString += ' rowspan="' + columns[index][i].rowspan + '"';
|
||||
}
|
||||
if (typeof columns[index][i].colspan != 'undefined' && columns[index][i].colspan > 1) {
|
||||
tableString += ' colspan="' + columns[index][i].colspan + '"';
|
||||
}
|
||||
if (typeof columns[index][i].field != 'undefined' && columns[index][i].field != '') {
|
||||
nameList.push(columns[index][i]);
|
||||
}
|
||||
tableString += '>' + columns[index][i].title + '</th>';
|
||||
}
|
||||
}
|
||||
tableString += '\n</tr>';
|
||||
});
|
||||
}
|
||||
//alert(tableString);
|
||||
////获取表格数据内容
|
||||
//alert("nr");
|
||||
//alert(printDatagrid);
|
||||
var data = printDatagrid.datagrid("getData");
|
||||
var rows = data.originalRows;
|
||||
for (var i = 0; i < rows.length; ++i) {
|
||||
tableString += '\n<tr>';
|
||||
for (var j = 0; j < nameList.length; ++j) {
|
||||
var e = nameList[j].field.lastIndexOf('_0');
|
||||
tableString += '\n<td';
|
||||
if (nameList[j].align != 'undefined' && nameList[j].align != '') {
|
||||
tableString += ' style="text-align:' + nameList[j].align + ';"';
|
||||
}
|
||||
tableString += '>';
|
||||
if (e + 2 == nameList[j].field.length) {
|
||||
tableString += rows[i][nameList[j].field.substring(0, e)];
|
||||
}
|
||||
else
|
||||
tableString += rows[i][nameList[j].field];
|
||||
tableString += '</td>';
|
||||
}
|
||||
tableString += '\n</tr>';
|
||||
}
|
||||
tableString += '\n</table>';
|
||||
|
||||
//alert(tableString);
|
||||
return tableString;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
17
NGTools/MobilePages/B_ParCal/Z_TableCal.aspx.cs
Normal file
17
NGTools/MobilePages/B_ParCal/Z_TableCal.aspx.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NGTools.MobilePages.B_ParCal
|
||||
{
|
||||
public partial class Z_TableCal : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
15
NGTools/MobilePages/B_ParCal/Z_TableCal.aspx.designer.cs
generated
Normal file
15
NGTools/MobilePages/B_ParCal/Z_TableCal.aspx.designer.cs
generated
Normal file
@ -0,0 +1,15 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NGTools.MobilePages.B_ParCal {
|
||||
|
||||
|
||||
public partial class Z_TableCal {
|
||||
}
|
||||
}
|
909
NGTools/MobilePages/C_CNG/CNGV_TableCal.aspx
Normal file
909
NGTools/MobilePages/C_CNG/CNGV_TableCal.aspx
Normal file
@ -0,0 +1,909 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CNGV_TableCal.aspx.cs" Inherits="NGTools.MobilePages.C_CNG.CNGV_TableCal" %>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>CNG体积表格计算</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
|
||||
<script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
|
||||
|
||||
|
||||
<script src="../../MYJS/constant.js"></script>
|
||||
<script src="../../MYJS/MyToolsMobile.js"></script>
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div data-role="page" id="pageOne">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>CNG体积表格计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab" class="ui-btn-active">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab" class="ui-btn">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
<form method="post" id="WorkPar">
|
||||
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="DWCZ" style="width: 110px; font-size: small;">单位/场站</label>
|
||||
<select id="DWCZ" required="required" data-mini="true">
|
||||
<option value="-1">请选择场站:</option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="JLD" style="width: 110px; font-size: small;">计量点名称</label>
|
||||
<select id="JLD" required="required" data-mini="true">
|
||||
<option value="-1">请选择计量点:</option>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="inP" style="width: 110px; font-size: small;">起始压力(MPa):</label>
|
||||
<input style="width: 90px" name="inP" id="inP" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="inWd" style="width: 110px; font-size: small;">起始温度(℃):</label>
|
||||
<input style="width: 90px" name="inWd" id="inWd" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="yljg" style="width: 110px; font-size: small;">压力间隔(MPa):</label>
|
||||
<input style="width: 90px" name="yljg" id="yljg" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="wdjg" style="width: 110px; font-size: small;">温度间隔(MPa):</label>
|
||||
<input style="width: 90px" name="wdjg" id="wdjg" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<label for="inPe" style="width: 110px; font-size: small;">终止压力(MPa):</label>
|
||||
<input style="width: 90px" name="inPe" id="inPe" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="inWde" style="width: 110px; font-size: small;">终止温度(℃):</label>
|
||||
<input style="width: 90px" name="inWde" id="inWde" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: 50%">
|
||||
<label for="DDDQY" style="width: 110px; font-size: small;">大气压(MPa):</label>
|
||||
<input style="width: 90px" name="DDDQY" id="DDDQY" required="required" type="text" value="" data-mini="true" />
|
||||
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<label for="CBTJ" style="width: 110px; font-size: small;">参比条件:</label>
|
||||
<select name="CBTJ" id="CBTJ" required="required" data-mini="true">
|
||||
<option value="-1">请选择参比条件:</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: 50%">
|
||||
<label for="gscsrj" style="width: 110px; font-size: small;">管束车水容积(m³):</label>
|
||||
<input style="width: 90px" name="gscsrj" id="gscsrj" required="required" type="text" value="" data-mini="true" />
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="page" id="pageTwo">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>CNG体积表格计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab" class="ui-btn-active">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
<form method="post" id="frmNGCom">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<a onclick="ZoreM()" class="ui-btn " data-mini="true">全部清零</a>
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<a onclick="copyZfM()" class="ui-btn " data-mini="true">复制组分</a>
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<a onclick="pasteZfM()" class="ui-btn " data-mini="true">粘贴组分</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="CYCS">常用组分:</label>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<select id="CYCS" required="required" data-mini="true">
|
||||
<option value="-1">请选择常用组分:</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C1">甲烷C1:</label><input style="width: 80px" name="NG_C1" id="NG_C1" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_N2">氮气N2:</label><input style="width: 80px" name="NG_N2" id="NG_N2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_CO2">二氧化碳CO2:</label><input style="width: 80px" name="NG_CO2" id="NG_CO2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C2">乙烷C2:</label><input style="width: 80px" name="NG_C2" id="NG_C2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C3">丙烷C3:</label><input style="width: 80px" name="NG_C3" id="NG_C3" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2O">水H2O:</label><input style="width: 80px" name="NG_H2O" id="NG_H2O" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2S">硫化氢H2S:</label><input style="width: 80px" name="NG_H2S" id="NG_H2S" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_H2">氢气H2:</label><input style="width: 80px" name="NG_H2" id="NG_H2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_CO">一氧化碳CO:</label><input style="width: 80px" name="NG_CO" id="NG_CO" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_O2">氧气O2:</label><input style="width: 80px" name="NG_O2" id="NG_O2" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_iC4">异丁烷iC4:</label><input style="width: 80px" name="NG_iC4" id="NG_iC4" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_nC4">正丁烷nC4:</label><input style="width: 80px" name="NG_nC4" id="NG_nC4" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_iC5">异戊烷iC5:</label><input style="width: 80px" name="NG_iC5" id="NG_iC5" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_nC5">正戊烷nC5:</label><input style="width: 80px" name="NG_nC5" id="NG_nC5" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C6">己烷C6:</label><input style="width: 80px" name="NG_C6" id="NG_C6" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C7">庚烷C7:</label><input style="width: 80px" name="NG_C7" id="NG_C7" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C8">辛烷C8:</label><input style="width: 80px" name="NG_C8" id="NG_C8" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C9">壬烷C9:</label><input style="width: 80px" name="NG_C9" id="NG_C9" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_C10">癸烷C10:</label><input style="width: 80px" name="NG_C10" id="NG_C10" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_He">氦气He:</label><input style="width: 80px" name="NG_He" id="NG_He" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_Ar">氩气Ar:</label><input style="width: 80px" name="NG_Ar" id="NG_Ar" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%">
|
||||
<label style="width: 110px; font-size: small;" for="NG_SUM">合计:</label><input style="width: 80px" id="NG_SUM" required="required" type="text" value="" data-mini="true" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div data-role="page" id="pageThree">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<a onclick="window.open('../frmMainMobile.aspx')" class="ui-btn ui-corner-all ui-shadow ui-icon-home ui-btn-icon-left ">主页</a>
|
||||
<h1>CNG体积表格计算</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne" data-role="tab">工艺参数</a></li>
|
||||
<li><a href="#pageTwo" data-role="tab">组分数据</a></li>
|
||||
<li><a href="#pageThree" onclick="FlowCal()" data-role="tab" class="ui-btn-active">计算结果</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="main" class="ui-content">
|
||||
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 30%" colspan="3">
|
||||
<a onclick="SavePar()" class="ui-btn ui-corner-all ui-shadow" data-mini="true">保存计量点参数</a>
|
||||
<a onclick="ExportExcel()" class="ui-btn ui-corner-all ui-shadow" data-mini="true">导出Excel</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<div id="result" class="scroll-container" style="width: 100%;overflow:auto">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var initFlag = true;
|
||||
var jsonJld = "";
|
||||
|
||||
var ETable = undefined;
|
||||
var jsonresult = undefined;
|
||||
|
||||
$(document).on("pageinit", function () {
|
||||
|
||||
if (initFlag) {
|
||||
|
||||
|
||||
//填充单位和站场 计量点下拉框
|
||||
var url = '../../ASHX/getTreeCombox.ashx?action=getJldSelect';
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
dataType: "json",
|
||||
url: url,
|
||||
success: function (data) {
|
||||
|
||||
var dwcz = data[0].DWZC;
|
||||
jsonJld = data[1].JLD;
|
||||
|
||||
var opth = "";
|
||||
for (var i = 0; i < dwcz.length; i++) {
|
||||
opth += "<option value=" + dwcz[i].ORG_ID + ">" + dwcz[i].ORG_Name + "</option>";
|
||||
}
|
||||
$("#DWCZ").append(opth);
|
||||
|
||||
|
||||
// 填充单位下拉列表
|
||||
$("#DWCZ").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var selectedDWCZ = $("#DWCZ :selected").val();
|
||||
if (selectedDWCZ != -1) {
|
||||
var jdlArrOptionHtml = "";
|
||||
var jdlArr = jsonJld[0][selectedDWCZ];
|
||||
for (var i = 0; i < jdlArr.length; i++) {
|
||||
jdlArrOptionHtml += "<option value=" + jdlArr[i].ID + ">" + jdlArr[i].JLD_Name + "</option>";
|
||||
}
|
||||
// 清空之前的计量点列表
|
||||
$("#JLD option[value!=-1]").remove();
|
||||
$("#JLD option[value=-1]").attr("selected", true);
|
||||
$("#JLD").append(jdlArrOptionHtml);
|
||||
|
||||
|
||||
|
||||
//$("#JLD option[value='" + jdlArr[0].ID + "']").attr("selected", "selected");
|
||||
//$("#JLD").val(jdlArr[0].ID).selectmenu("refresh", true);
|
||||
}
|
||||
});
|
||||
// 计量点列表事件
|
||||
$("#JLD").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var jldID = $("#JLD :selected").val();
|
||||
if (jldID != -1) {
|
||||
//alert(jldID);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=getJldPar&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { jldid: jldID, gnmk: "GVT" },
|
||||
success: function (data) {
|
||||
|
||||
var options = { jsonValue: data, isDebug: false };
|
||||
$("#WorkPar").initForm(options);
|
||||
$("#frmNGCom").initForm(options);
|
||||
sumZfM();
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
// 计量点列表事件
|
||||
$("#CYCS").bind("change", function () {
|
||||
//alert(JSON.stringify(jsonJld[0]));
|
||||
var CYCSID = $("#CYCS :selected").val();
|
||||
if (CYCSID != -1) {
|
||||
|
||||
var data = NGComCon[CYCSID].NGCom;
|
||||
|
||||
var options = { jsonValue: data, isDebug: false };
|
||||
|
||||
$("#WorkPar").initForm(options);
|
||||
$("#frmNGCom").initForm(options);
|
||||
|
||||
|
||||
sumZfM();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// 填充常数下拉列表
|
||||
var OptionHtml = "";
|
||||
|
||||
|
||||
for (var i = 0; i < CBTJ.length; i++) {
|
||||
OptionHtml += "<option value=" + CBTJ[i].ID + ">" + CBTJ[i].text + "</option>";
|
||||
}
|
||||
$("#CBTJ").append(OptionHtml);
|
||||
$("#CBTJ").val(0).selectmenu('refresh', true);
|
||||
|
||||
OptionHtml = "";
|
||||
|
||||
for (var i = 0; i < CycsCom.length; i++) {
|
||||
OptionHtml += "<option value=" + CycsCom[i].ID + ">" + CycsCom[i].text + "</option>";
|
||||
}
|
||||
$("#CYCS").append(OptionHtml);
|
||||
//$("#CYCS").val(0).selectmenu('refresh', true);
|
||||
|
||||
|
||||
|
||||
$('#NG_C1').on('input', function (e) { sumZfM() });
|
||||
$('#NG_N2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_CO2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C3').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2O').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2S').on('input', function (e) { sumZfM() });
|
||||
$('#NG_H2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_CO').on('input', function (e) { sumZfM() });
|
||||
$('#NG_O2').on('input', function (e) { sumZfM() });
|
||||
$('#NG_iC4').on('input', function (e) { sumZfM() });
|
||||
$('#NG_nC4').on('input', function (e) { sumZfM() });
|
||||
$('#NG_iC5').on('input', function (e) { sumZfM() });
|
||||
$('#NG_nC5').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C6').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C7').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C8').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C9').on('input', function (e) { sumZfM() });
|
||||
$('#NG_C10').on('input', function (e) { sumZfM() });
|
||||
$('#NG_He').on('input', function (e) { sumZfM() });
|
||||
$('#NG_Ar').on('input', function (e) { sumZfM() });
|
||||
|
||||
|
||||
//
|
||||
//$("#pageOne").bind("swipeleft", function (e) { $.mobile.changePage('#pageTow', 'fade', false, false); });
|
||||
//$("#pageTwo").bind("swipeleft", function (e) { $.mobile.changePage('#pageThree', 'fade', false, false); });
|
||||
//$("#pageThree").bind("swipeleft", function (e) { $.mobile.changePage('#pageOne', 'fade', false, false); });
|
||||
|
||||
//$("#pageOne").bind("swiperight", function (e) { $.mobile.changePage('#pageThree', 'fade', false, false); });
|
||||
//$("#pageTwo").bind("swiperight", function (e) { $.mobile.changePage('#pageOne', 'fade', false, false); });
|
||||
//$("#pageThree").bind("swiperight", function (e) { $.mobile.changePage('#pageTwo', 'fade', false, false); });
|
||||
//alert('<%=Session ["userAccount"]%>');
|
||||
|
||||
var str = getEnable('<%=Session ["userAccount"]%>', "M0101");
|
||||
|
||||
//alert(101);
|
||||
initFlag = false;
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
function FlowCal() {
|
||||
|
||||
var NG_par = "";
|
||||
jsonResult = undefined;
|
||||
if ($('#inP').val() == "") {
|
||||
alert("请输入压力!");
|
||||
return;
|
||||
}
|
||||
if ($('#DDDQY').val() == "") {
|
||||
alert("请输入大气压力!");
|
||||
return;
|
||||
}
|
||||
if ($('#inWd').val() == "") {
|
||||
alert("请输入温度!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (Math.abs(sumZfM() - 100) > 0.001) { $.messager.alert("提示", "组分和不为100%,请检查!"); return; }
|
||||
|
||||
|
||||
|
||||
|
||||
NG_par = "0";//流量计类别
|
||||
NG_par = NG_par + "," + "0";//节流装置类型
|
||||
NG_par = NG_par + "," + "0";//流量计算标准
|
||||
NG_par = NG_par + "," + "0";//压缩因子计算标准
|
||||
NG_par = NG_par + "," + $('#CBTJ').val();//'计量参比条件
|
||||
NG_par = NG_par + "," + "101325";//计量参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//计量参比条件温度
|
||||
NG_par = NG_par + "," + "101325";//燃烧参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//燃烧参比条件温度
|
||||
NG_par = NG_par + "," + $('#DDDQY').val();//当地大气压
|
||||
NG_par = NG_par + "," + "2";//当地大气压单位
|
||||
NG_par = NG_par + "," + strZfM();//天然气组分
|
||||
NG_par = NG_par + "," + "0";//取压方式
|
||||
NG_par = NG_par + "," + "0";//管道类型
|
||||
NG_par = NG_par + "," + "150";//管道内径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//管道内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//管道材料
|
||||
NG_par = NG_par + "," + "50";//孔板孔径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//孔板内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//孔板材料
|
||||
NG_par = NG_par + "," + "0";//锐利度系数计算方法
|
||||
NG_par = NG_par + "," + "0";//孔板入口圆弧半径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + $('#inP').val();//输入压力
|
||||
NG_par = NG_par + "," + "2";//压力单位
|
||||
NG_par = NG_par + "," + "0";//压力类型
|
||||
NG_par = NG_par + "," + $('#inWd').val();//输入温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//输入差压
|
||||
NG_par = NG_par + "," + "1";//压力单位
|
||||
NG_par = NG_par + "," + "1";//体积流量单位
|
||||
NG_par = NG_par + "," + "2";//质量流量单位
|
||||
NG_par = NG_par + "," + "1";//能量流量单位
|
||||
NG_par = NG_par + "," + $('#yljg').val();//压力步长
|
||||
NG_par = NG_par + "," + $('#wdjg').val();//温度步长
|
||||
NG_par = NG_par + "," + $('#inPe').val();//终止压力
|
||||
NG_par = NG_par + "," + $('#inWde').val();//终止温度
|
||||
NG_par = NG_par + "," + $('#gscsrj').val();//管束车水容积
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
//url: '../../Pages/A_FlowCal/orifice.aspx?action=Cal' + "&t=" + Date.parse(new Date()),
|
||||
url: '../../ASHX/FlowCal.ashx?action=GSCVTCal' + "&t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { Par: NG_par },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
jsonresult = data.rows;
|
||||
|
||||
var div = document.getElementById("result");
|
||||
div.innerHTML = "";
|
||||
var table = document.createElement("table");
|
||||
var thead = document.createElement("tr");
|
||||
for (var p in jsonresult[0]) {//遍历json对象的每个key/value对,p为key
|
||||
var td = document.createElement("th");
|
||||
td.innerHTML = p;
|
||||
thead.appendChild(td);
|
||||
}
|
||||
table.appendChild(thead);
|
||||
for (var tableRowNo = 0; tableRowNo < jsonresult.length; tableRowNo++) {
|
||||
var tr = document.createElement("tr");
|
||||
for (var v in jsonresult[tableRowNo]) {//遍历json对象的每个key/value对,p为key
|
||||
var cell = document.createElement("td");
|
||||
|
||||
cell.innerHTML = jsonresult[tableRowNo][v];
|
||||
tr.appendChild(cell);
|
||||
}
|
||||
|
||||
table.appendChild(tr);
|
||||
}
|
||||
|
||||
ETable = table;
|
||||
div.appendChild(table);
|
||||
|
||||
setremainTimes('<%=Session ["userAccount"]%>', "M0101");
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function SavePar() {
|
||||
var saveStr1 = JSON.stringify($('#WorkPar').getFormJson()); // json对象;
|
||||
var saveStr2 = JSON.stringify($('#frmNGCom').getFormJson()); // json对象;
|
||||
|
||||
|
||||
saveStr = (saveStr1 + saveStr2).replace("}{", ",");
|
||||
|
||||
// alert(JSON.stringify(saveStr));
|
||||
// alert(JSON.stringify(saveStr2));
|
||||
|
||||
|
||||
var jldID = $('#JLD').val();
|
||||
var jldIDName = $('#JLD').find("option:selected").text();
|
||||
|
||||
if (confirm("确定将计量点参数保存到计量点:" + jldIDName + "")) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=saveJldPar&' + "t=" + Date.parse(new Date()),
|
||||
//dataType: "json",
|
||||
data: { jldid: jldID, Par: saveStr, gnmk: "GVT" },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
alert(JSON.stringify(data));
|
||||
|
||||
//$('#formPar').form('load', data);
|
||||
//$.messager.alert("提示", data);
|
||||
|
||||
//document.getElementById('message').innerHTML = JSON.stringify(data);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function ExportExcel() {
|
||||
|
||||
//tableToExcel("result", "压缩因子表格");
|
||||
EasyUIDataGridToExcle();
|
||||
}
|
||||
|
||||
|
||||
$("a[data-role=tab]").each(function () {
|
||||
var anchor = $(this);
|
||||
anchor.bind("click", function () {
|
||||
$.mobile.changePage(anchor.attr("href"), {
|
||||
transition: "none",
|
||||
changeHash: false
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
$("div[data-role=page]").bind("pagebeforeshow", function (e, data) {
|
||||
$.mobile.silentScroll(0);
|
||||
$.mobile.changePage.defaults.transition = 'slide';
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 描述:导出表格对应的excel文件
|
||||
* 时间:2018-03-29
|
||||
* 作者:任恩远
|
||||
* 调用示例:
|
||||
* onclick = "tableToExcel(tableId,fileName)"
|
||||
*/
|
||||
/**
|
||||
* 描述:导出表格对应的excel文件
|
||||
* 时间:2018-03-29
|
||||
* 作者:任恩远
|
||||
* 调用示例:
|
||||
* onclick = "tableToExcel(tableId,fileName)"
|
||||
*/
|
||||
var tableToExcel = (function () {
|
||||
var uri = 'data:application/vnd.ms-excel;base64,'
|
||||
, template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->' +
|
||||
' <style type="text/css">' +
|
||||
'.excelTable {' +
|
||||
'border-collapse:collapse;' +
|
||||
' border:thin solid #999; ' +
|
||||
'}' +
|
||||
' .excelTable th {' +
|
||||
' border: thin solid #999;' +
|
||||
' padding:20px;' +
|
||||
' text-align: center;' +
|
||||
' border-top: thin solid #999;' +
|
||||
' ' +
|
||||
' }' +
|
||||
' .excelTable td{' +
|
||||
' border:thin solid #999;' +
|
||||
' padding:2px 5px;' +
|
||||
' text-align: center;' +
|
||||
' }</style>' + '</head><body><table border="1">{table}</table></body></html>'
|
||||
, base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))) }
|
||||
, format = function (s, c) { return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }) }
|
||||
return function (table, name) {
|
||||
if (!table.nodeType) table = document.getElementById(table)
|
||||
var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML };
|
||||
var downloadLink = document.createElement("a");
|
||||
downloadLink.href = uri + base64(format(template, ctx));
|
||||
downloadLink.download = name + ".xls";
|
||||
document.body.appendChild(downloadLink);
|
||||
downloadLink.click();
|
||||
document.body.removeChild(downloadLink);
|
||||
}
|
||||
})()
|
||||
|
||||
|
||||
|
||||
function exportTableToCSV(me, $table, filename) {
|
||||
var $headers = $table.find('tr:has(th)'), $rows = $table.find('tr:has(td)')
|
||||
// Temporary delimiter characters unlikely to be typed by keyboard
|
||||
// This is to avoid accidentally splitting the actual contents
|
||||
, tmpColDelim = String.fromCharCode(11) // vertical tab character
|
||||
, tmpRowDelim = String.fromCharCode(0) // null character
|
||||
// actual delimiter characters for CSV format
|
||||
, colDelim = '","', rowDelim = '"\r\n"';
|
||||
// Grab text from table into CSV formatted string
|
||||
var csv = '"';
|
||||
csv += formatRows($headers.map(grabRow));
|
||||
csv += rowDelim;
|
||||
csv += formatRows($rows.map(grabRow)) + '"';
|
||||
// Data URI
|
||||
var csvData = 'data:application/csv;charset=utf-8,\ufeff' + encodeURIComponent(csv);
|
||||
$(me)
|
||||
.attr({
|
||||
'download': filename,
|
||||
'href': csvData
|
||||
//,'target' : '_blank' //if you want it to open in a new window
|
||||
});
|
||||
//------------------------------------------------------------
|
||||
// Helper Functions
|
||||
//------------------------------------------------------------
|
||||
// Format the output so it has the appropriate delimiters
|
||||
function formatRows(rows) {
|
||||
return rows.get().join(tmpRowDelim)
|
||||
.split(tmpRowDelim).join(rowDelim)
|
||||
.split(tmpColDelim).join(colDelim);
|
||||
}
|
||||
|
||||
// Grab and format a row from the table
|
||||
function grabRow(i, row) {
|
||||
var $row = $(row);
|
||||
//for some reason $cols = $row.find('td') || $row.find('th') won't work...
|
||||
var $cols = $row.find('td');
|
||||
if (!$cols.length) $cols = $row.find('th');
|
||||
return $cols.map(grabCol)
|
||||
.get().join(tmpColDelim);
|
||||
}
|
||||
|
||||
// Grab and format a column from the table
|
||||
function grabCol(j, col) {
|
||||
var $col = $(col), $text = $col.text();
|
||||
return $text.replace('"', '""'); // escape double quotes
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
createTable(toid, jsondata, check, edit, del):用于动态创建table,第0行为表头,数据里必须包含表头和数据的id
|
||||
@toid:创建table到id为toid的节点下
|
||||
@jsondata:用于创建table的json格式的数据(须在jsondata里包含表头标题)
|
||||
@check:是否创建查看按钮
|
||||
@edit:是否创建编辑按钮
|
||||
@del:是否创建删除按钮
|
||||
*/
|
||||
function createTable(jsondata, check, edit, del) {
|
||||
var div = document.createElement("div");
|
||||
var table = document.createElement("table");
|
||||
var tr, td;
|
||||
for (i in jsondata) {
|
||||
tr = document.createElement("tr"); //创建tr
|
||||
//________________创建表头________________________________________
|
||||
if (i == 0) {
|
||||
for (j in jsondata[i]) { //根据数据在tr内创建td
|
||||
td = document.createElement("th");
|
||||
td.appendChild(document.createTextNode(jsondata[i][j]));
|
||||
if (j == "id") { //创建隐藏的td来存放id
|
||||
td.style.display = "none";
|
||||
}
|
||||
td.style.background = "#C1DAD7"; //设置表头颜色
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (check == true) { //创建查看按钮
|
||||
td = document.createElement("th");
|
||||
td.appendChild(document.createTextNode("查看"));
|
||||
td.style.background = "#C1DAD7"; //设置表头颜色
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (edit == true) { //创建编辑按钮
|
||||
td = document.createElement("th");
|
||||
td.appendChild(document.createTextNode("编辑"));
|
||||
td.style.background = "#C1DAD7"; //设置表头颜色
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (del == true) { //创建删除按钮
|
||||
td = document.createElement("th");
|
||||
td.appendChild(document.createTextNode("删除"));
|
||||
td.style.background = "#C1DAD7"; //设置表头颜色
|
||||
tr.appendChild(td);
|
||||
}
|
||||
}
|
||||
//________________创建数据行________________________________________
|
||||
else {
|
||||
for (j in jsondata[i]) { //根据数据在tr内创建td
|
||||
td = document.createElement("td");
|
||||
td.appendChild(document.createTextNode(jsondata[i][j]));
|
||||
if (j == "id") { //创建隐藏的td来存放id
|
||||
td.style.display = "none";
|
||||
}
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (check == true) { //创建查看按钮
|
||||
td = document.createElement("td");
|
||||
var btnCheck = document.createElement("button");
|
||||
btnCheck.appendChild(document.createTextNode("查看"));
|
||||
td.appendChild(btnCheck);
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (edit == true) { //创建编辑按钮
|
||||
td = document.createElement("td");
|
||||
var btnEdit = document.createElement("button");
|
||||
btnEdit.appendChild(document.createTextNode("编辑"));
|
||||
td.appendChild(btnEdit);
|
||||
tr.appendChild(td);
|
||||
}
|
||||
if (del == true) { //创建删除按钮
|
||||
td = document.createElement("td");
|
||||
var btnDel = document.createElement("button");
|
||||
btnDel.appendChild(document.createTextNode("删除"));
|
||||
td.appendChild(btnDel);
|
||||
tr.appendChild(td);
|
||||
}
|
||||
}
|
||||
table.appendChild(tr);
|
||||
}
|
||||
|
||||
div.appendChild(table);
|
||||
return div;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
作 用:将EasyUI的DataGrid表格,直接导出Excle
|
||||
例 子: EasyUIDataGridToExcle('SalaryReport', $('#dg'), 'getRows');
|
||||
说 明:文档名字,避免汉字,容易乱码 ,可能造成文档打不开的情况
|
||||
*/
|
||||
// strXlsName :文檔名字 exportGrid:$('#dg') H:getData:所有數據 getRows:當前頁的數據
|
||||
function EasyUIDataGridToExcle() {
|
||||
var f = $('<form action="../../ashx/ExportXls.ashx?ActionType=EasyUIDataGridToExcle" method="post" id="fm1"></form>');
|
||||
var i = $('<input type="hidden" id="txtContent" name="txtContent" />');
|
||||
var l = $('<input type="hidden" id="txtName" name="txtName" />');
|
||||
|
||||
i.val(document.getElementById("result").innerHTML);
|
||||
//alert(document.getElementById("result").innerHTML);
|
||||
//i.val(createTable(jsonresult, true, true, true).innerHTML);
|
||||
i.appendTo(f);
|
||||
l.val("CNG体积表");
|
||||
l.appendTo(f);
|
||||
f.appendTo(document.body).submit();
|
||||
var newf = document.getElementById("fm1");
|
||||
document.body.removeChild(newf);
|
||||
};
|
||||
function ChangeToTable(printDatagrid, H) {
|
||||
var tableString = '<table cellspacing="0" class="pb">';
|
||||
var frozenColumns = printDatagrid.datagrid("options").frozenColumns; // 得到frozenColumns对象
|
||||
var columns = printDatagrid.datagrid("options").columns; // 得到columns对象
|
||||
var nameList = new Array();
|
||||
|
||||
// 载入title
|
||||
if (typeof columns != 'undefined' && columns != '') {
|
||||
$(columns).each(function (index) {
|
||||
tableString += '\n<tr>';
|
||||
if (typeof frozenColumns != 'undefined' && typeof frozenColumns[index] != 'undefined') {
|
||||
for (var i = 0; i < frozenColumns[index].length; ++i) {
|
||||
if (!frozenColumns[index][i].hidden) {
|
||||
tableString += '\n<th width="' + frozenColumns[index][i].width + '"';
|
||||
if (typeof frozenColumns[index][i].rowspan != 'undefined' && frozenColumns[index][i].rowspan > 1) {
|
||||
tableString += ' rowspan="' + frozenColumns[index][i].rowspan + '"';
|
||||
}
|
||||
if (typeof frozenColumns[index][i].colspan != 'undefined' && frozenColumns[index][i].colspan > 1) {
|
||||
tableString += ' colspan="' + frozenColumns[index][i].colspan + '"';
|
||||
}
|
||||
if (typeof frozenColumns[index][i].field != 'undefined' && frozenColumns[index][i].field != '') {
|
||||
nameList.push(frozenColumns[index][i]);
|
||||
}
|
||||
tableString += '>' + frozenColumns[index][i].title + '</th>';
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < columns[index].length; ++i) {
|
||||
if (!columns[index][i].hidden) {
|
||||
tableString += '\n<th width="' + columns[index][i].width + '"';
|
||||
if (typeof columns[index][i].rowspan != 'undefined' && columns[index][i].rowspan > 1) {
|
||||
tableString += ' rowspan="' + columns[index][i].rowspan + '"';
|
||||
}
|
||||
if (typeof columns[index][i].colspan != 'undefined' && columns[index][i].colspan > 1) {
|
||||
tableString += ' colspan="' + columns[index][i].colspan + '"';
|
||||
}
|
||||
if (typeof columns[index][i].field != 'undefined' && columns[index][i].field != '') {
|
||||
nameList.push(columns[index][i]);
|
||||
}
|
||||
tableString += '>' + columns[index][i].title + '</th>';
|
||||
}
|
||||
}
|
||||
tableString += '\n</tr>';
|
||||
});
|
||||
}
|
||||
//alert(tableString);
|
||||
////获取表格数据内容
|
||||
//alert("nr");
|
||||
//alert(printDatagrid);
|
||||
var data = printDatagrid.datagrid("getData");
|
||||
var rows = data.originalRows;
|
||||
for (var i = 0; i < rows.length; ++i) {
|
||||
tableString += '\n<tr>';
|
||||
for (var j = 0; j < nameList.length; ++j) {
|
||||
var e = nameList[j].field.lastIndexOf('_0');
|
||||
tableString += '\n<td';
|
||||
if (nameList[j].align != 'undefined' && nameList[j].align != '') {
|
||||
tableString += ' style="text-align:' + nameList[j].align + ';"';
|
||||
}
|
||||
tableString += '>';
|
||||
if (e + 2 == nameList[j].field.length) {
|
||||
tableString += rows[i][nameList[j].field.substring(0, e)];
|
||||
}
|
||||
else
|
||||
tableString += rows[i][nameList[j].field];
|
||||
tableString += '</td>';
|
||||
}
|
||||
tableString += '\n</tr>';
|
||||
}
|
||||
tableString += '\n</table>';
|
||||
|
||||
//alert(tableString);
|
||||
return tableString;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
17
NGTools/MobilePages/C_CNG/CNGV_TableCal.aspx.cs
Normal file
17
NGTools/MobilePages/C_CNG/CNGV_TableCal.aspx.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NGTools.MobilePages.C_CNG
|
||||
{
|
||||
public partial class CNGV_TableCal : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
15
NGTools/MobilePages/C_CNG/CNGV_TableCal.aspx.designer.cs
generated
Normal file
15
NGTools/MobilePages/C_CNG/CNGV_TableCal.aspx.designer.cs
generated
Normal file
@ -0,0 +1,15 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NGTools.MobilePages.C_CNG {
|
||||
|
||||
|
||||
public partial class CNGV_TableCal {
|
||||
}
|
||||
}
|
431
NGTools/MobilePages/frmLoginMobile.aspx
Normal file
431
NGTools/MobilePages/frmLoginMobile.aspx
Normal file
@ -0,0 +1,431 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="frmLoginMobile.aspx.cs" Inherits="NGTools.frmLoginMobile" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
|
||||
<script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
|
||||
|
||||
<script src="../MYJS/JsEncryptHelper.js"></script>
|
||||
<script src="../MYJS/MyTools.js"></script>
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
|
||||
var valitedCode = "";
|
||||
|
||||
window.onload = function () {
|
||||
var name = $('#txtUserName').val();
|
||||
var pswd = $('#txtPassword').val();
|
||||
|
||||
var orember = document.getElementById("rember");
|
||||
// var cuser = document.cookie = "user"+"="+name.value+";";
|
||||
// var cpswd = document.cookie = "password"+"="+pswd.value+";";
|
||||
//页面初始化时,如果帐号密码cookie存在则填充
|
||||
if (getCookie('txtUserName') && getCookie('txtPassword')) {
|
||||
$("#txtUserName").textbox('setValue', getCookie('txtUserName'));
|
||||
$("#txtPassword").passwordbox('setValue', getCookie('txtPassword'));
|
||||
orember.checked = true;
|
||||
}
|
||||
//复选框勾选状态发生改变时,如果未勾选则清除cookie
|
||||
orember.onchange = function () {
|
||||
if (!this.checked) {
|
||||
delCookie('txtUserName');
|
||||
delCookie('txtPassword');
|
||||
}
|
||||
else {
|
||||
tips.style.display = "black";
|
||||
}
|
||||
}
|
||||
//表单提交事件触发时,如果复选框是勾选状态则保存cookie
|
||||
dl.onsubmit = function () {
|
||||
if (remember.checked) {
|
||||
setCookie('txtUserName', name.value, 7); //保存帐号到cookie,有效期7天
|
||||
setCookie('txtPassword', pswd.value, 7); //保存密码到cookie,有效期7天
|
||||
}
|
||||
}
|
||||
};
|
||||
function login() {
|
||||
{
|
||||
var txtUserName = $("#txtUserName").val();
|
||||
var txtPassword = $("#txtPassword").val();
|
||||
if (txtUserName == "") {
|
||||
alert( "请输入用户名!");
|
||||
return false;
|
||||
} else if (txtPassword == "") {
|
||||
alert( "请输入密码!");
|
||||
return false;
|
||||
} else {
|
||||
//$("#btnLogin").click(function () {
|
||||
//console.info($("#txtPassword").val());
|
||||
//var user = ($("#txtUserName").val());
|
||||
//var pass = ($("#txtPassword").val());
|
||||
var data = {};
|
||||
data.username = txtUserName;
|
||||
data.passwd = txtPassword;
|
||||
//$.messager.alert( JSON.stringify(data));
|
||||
var result = $.encryptRequest({
|
||||
data: data
|
||||
});
|
||||
//$.messager.alert( JSON.stringify(result));
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
//dataType: "json",
|
||||
url: "frmLoginMobile.aspx?action=login" + "&t=" + Date.parse(new Date()),
|
||||
data: result,
|
||||
success: function (msg) {
|
||||
if (msg == "OK") {
|
||||
if (rember.checked) {
|
||||
setCookie('txtUserName', data.username, 7); //保存帐号到cookie,有效期7天
|
||||
setCookie('txtPassword', data.passwd, 7); //保存密码到cookie,有效期7天
|
||||
}
|
||||
window.location.href = "frmmainMobile.aspx";
|
||||
}
|
||||
else {
|
||||
alert( msg);
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
//$.messager.alert( JSON.stringify(e));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function modPass() {
|
||||
$("#modPass").dialog('open');
|
||||
$("#txtModPassUserName").textbox('setValue', $("#txtUserName").textbox('getValue'));
|
||||
$("#txtoldPassword").textbox('setValue', "");
|
||||
$("#txtNewPassword").textbox('setValue', "");
|
||||
$("#txtConfirmNewPassword").textbox('setValue', "");
|
||||
}
|
||||
|
||||
function getCode() {
|
||||
|
||||
|
||||
var Num = "";
|
||||
for (var i = 0; i < 6; i++) {
|
||||
Num += Math.floor(Math.random() * 10);
|
||||
}
|
||||
return Num;
|
||||
}
|
||||
|
||||
function isPhone(phone) {
|
||||
return /^1(3\d|4\d|5\d|6\d|7\d|8\d|9\d)\d{8}$/g.test(phone);
|
||||
}
|
||||
|
||||
function YanZheng() {
|
||||
var phoneNo = $("#zcPhoneNo").val();
|
||||
|
||||
if (phoneNo == "") {
|
||||
|
||||
alert( "请输入手机号码!");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isPhone(phoneNo)) {
|
||||
alert( "请输入正确的手机号码!");
|
||||
return false;
|
||||
}
|
||||
|
||||
var data = {};
|
||||
data.phoneNo = phoneNo;
|
||||
data.code = getCode();
|
||||
valitedCode = data.code;
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
url: "frmLoginMobile.aspx?action=YANZHENG" + "&t=" + Date.parse(new Date()),
|
||||
data: data,
|
||||
success: function (msg) {
|
||||
// alert(msg);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
disabledSubmitButton02();
|
||||
|
||||
}
|
||||
|
||||
/*按钮禁用10秒,并显示倒计时*/
|
||||
function disabledSubmitButton02() {
|
||||
$('#btnYZ').attr("disabled", "disabled"); //控制按钮为禁用
|
||||
var second = 60;
|
||||
var intervalObj = setInterval(function () {
|
||||
$('#btnYZ').val('重新发送(' + second + ')').button("refresh");
|
||||
if (second == 0) {
|
||||
$('#btnYZ').removeAttr("disabled");//将按钮可用
|
||||
$('#btnYZ').val('获取验证码').button("refresh");
|
||||
/* 清除已设置的setInterval对象 */
|
||||
clearInterval(intervalObj);
|
||||
}
|
||||
second--;
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
|
||||
function ZC() {
|
||||
//if ($("#formPar").form('validate')) {
|
||||
var userAccount = ($("#zcAccord").val());
|
||||
var userName = ($("#zcUserName").val());
|
||||
var oldpass = ($("#zcPassword").val());
|
||||
var conpass = ($("#zcConfirmPassword").val());
|
||||
var phoneNo = ($("#zcPhoneNo").val());
|
||||
var zcYanzheng = ($("#zcYanzheng").val());
|
||||
if (userAccount == "") {
|
||||
alert( "请输入用户账号!");
|
||||
return false;
|
||||
} else if (oldpass == "") {
|
||||
alert( "请输入新密码!");
|
||||
return false;
|
||||
} else if (conpass != oldpass) {
|
||||
alert( "确认密码与密码不同!");
|
||||
return false;
|
||||
} else if
|
||||
(valitedCode != zcYanzheng) {
|
||||
alert( "验证码不正确!");
|
||||
return false;
|
||||
}
|
||||
var data = {};
|
||||
data.userAccount = userAccount;
|
||||
data.userName = userName;
|
||||
data.passwd = oldpass;
|
||||
data.phoneNo = phoneNo;
|
||||
//$.messager.alert( JSON.stringify(data));
|
||||
var result = $.encryptRequest({
|
||||
data: data
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
url: "frmLoginMobile.aspx?action=ZC" + "&t=" + Date.parse(new Date()),
|
||||
data: result,
|
||||
success: function (msg) {
|
||||
if (msg == "ok") {
|
||||
alert( "用户注册成功!");
|
||||
} else {
|
||||
alert( msg);
|
||||
}
|
||||
|
||||
},
|
||||
error: function (e) {
|
||||
alert( JSON.stringify(e));
|
||||
}
|
||||
});
|
||||
//}
|
||||
|
||||
//else {
|
||||
// alert('操作提示', '存在必填项为空,请检查!', "warning");
|
||||
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
function ModifyPassSubmit() {
|
||||
|
||||
var user = ($("#txtModPassUserName").val());
|
||||
var oldpass = ($("#txtoldPassword").val());
|
||||
var newpass = ($("#txtNewPassword").val());
|
||||
var connewpass = ($("#txtConfirmNewPassword").val());
|
||||
|
||||
if (user == "") {
|
||||
alert( "请输入用户名!");
|
||||
txtModPassUserName.focus();
|
||||
return false;
|
||||
} else if (newpass == "") {
|
||||
alert( "请输入新密码!");
|
||||
txtNewPassword.focus();
|
||||
return false;
|
||||
} else if (newpass != connewpass) {
|
||||
alert( "确认密码与新密码不同!");
|
||||
txtConfirmNewPassword.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var data = {};
|
||||
data.username = user;
|
||||
data.oldpasswd = oldpass;
|
||||
data.newpasswd = newpass;
|
||||
//$.messager.alert( JSON.stringify(data));
|
||||
var result = $.encryptRequest({
|
||||
data: data
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
//dataType: "json",
|
||||
url: "frmLoginMobile.aspx?action=modPass" + "&t=" + Date.parse(new Date()),
|
||||
data: result,
|
||||
success: function (msg) {
|
||||
if (msg == "ok") {
|
||||
alert( "修改密码成功!");
|
||||
document.getElementById("modPass").style.display = "hide";
|
||||
} else {
|
||||
alert( msg);
|
||||
}
|
||||
|
||||
},
|
||||
error: function (e) {
|
||||
alert( JSON.stringify(e));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
//设置cookie
|
||||
function setCookie(name, value, day) {
|
||||
var date = new Date();
|
||||
date.setDate(date.getDate() + day);
|
||||
document.cookie = name + '=' + value + ';expires=' + date;
|
||||
};
|
||||
|
||||
//获取cookie
|
||||
function getCookie(name) {
|
||||
var reg = RegExp(name + '=([^;]+)');
|
||||
var arr = document.cookie.match(reg);
|
||||
if (arr) {
|
||||
return arr[1];
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
//删除cookie
|
||||
function delCookie(name) {
|
||||
setCookie(name, null, -1);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div data-role="page" id="pageOne">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<h1>天然气计算工具集</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne">密码登录</a></li>
|
||||
<li><a href="#pageTwo">用户注册</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div data-role="main" class="ui-content">
|
||||
<form class="easyui-form" style="padding-top: 10px; text-align: left">
|
||||
<div data-role="fifieldcontainle" style="text-align: left">
|
||||
|
||||
<label for="txtUserName">账号/姓名/手机:</label>
|
||||
<input id="txtUserName" name="username" required="required" data-options="prompt:'请输入账号或姓名或手机号'" type="text" value="" />
|
||||
<label for="txtPassword">密 码:</label>
|
||||
<input type="password" required="required" data-options="prompt:'请输入密码'" id="txtPassword" value="" />
|
||||
|
||||
<input type="checkbox" id="rember" checked="checked" />
|
||||
<label for="rember">记住密码</label>
|
||||
|
||||
<div data-role="controlgroup" data-type="horizontal" style="text-align: center">
|
||||
<a id="btnLogin" href="javascript:void(0)" data-role="button" onclick="login()" style="width: 80px;">登 录</a>
|
||||
<a id="btnModifyPassword" href="#pageThree" data-role="button" onclick="modPass()" style="width: 80px">修改密码</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
<h1>豫ICP备19037764号</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="page" id="pageTwo">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<h1>天然气工业计算工具集</h1>
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="#pageOne">密码登录</a></li>
|
||||
<li><a href="#pageTwo">用户注册</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div data-role="main" class="ui-content">
|
||||
<form class="easyui-form" style=" text-align: left" >
|
||||
<div data-role="fieldcontain">
|
||||
<label for="zcAccord">用户账号:</label>
|
||||
<input id="zcAccord" required="required" type="text" value="" />
|
||||
<label for="zcAcczcUserNameord">真实姓名:</label>
|
||||
<input id="zcAcczcUserNameord" style="width: 100%" required="required" type="text" value="" />
|
||||
<label for="zcPhoneNo">手机号码:</label>
|
||||
<input id="zcPhoneNo" style="width: 100%" required="required" type="text" value="" />
|
||||
<label for="zcYanzheng">验证码:</label>
|
||||
|
||||
<div class="ui-grid-a" style ="vertical-align :bottom">
|
||||
<div class="ui-block-a">
|
||||
<input id="zcYanzheng" style="width: 80px" required="required" type="text" value="" />
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
<input id="btnYZ" type="button" onclick="YanZheng()" style="width: 90px;" value="获取验证码" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label for="zcPhzcPasswordoneNo">登录密码:</label>
|
||||
<input id="zcPhzcPasswordoneNo" style="width: 100%" required="required" type="password" value="" />
|
||||
<label for="zcConfirmPassword">确认密码:</label>
|
||||
<input id="zcConfirmPassword" style="width: 100%" required="required" type="password" value="" />
|
||||
|
||||
<a id="btnZc" href="javascript:void(0)" data-role="button" onclick="ZC()" style="width: 160px;">用户注册</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
<h1>豫ICP备19037764号</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-role="page" data-dialog="true" id="pageThree">
|
||||
<div data-role="main" class="ui-content">
|
||||
|
||||
<br />
|
||||
<div class="">
|
||||
<span>用户名:</span>
|
||||
<input id="txtModPassUserName" name="username" data-option=" prompt:'请输入用户名'" type="text" value="" />
|
||||
</div>
|
||||
<br />
|
||||
<div class="">
|
||||
<span>原密码:</span>
|
||||
<input type="password" data-option=" prompt:'请输入原密码'" id="txtoldPassword" value="" />
|
||||
</div>
|
||||
<br />
|
||||
<div class="">
|
||||
<span>新密码:</span>
|
||||
<input type="password" data-option=" prompt:'请输入新密码'" id="txtNewPassword" value="" />
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<div class="">
|
||||
<span>再确认:</span>
|
||||
<input type="password" data-option=" prompt:请输入确认新密码" id="txtConfirmNewPassword" value="" />
|
||||
</div>
|
||||
<br />
|
||||
<div style="width: 200px; text-align: center; padding-left: 20px">
|
||||
<a id="btnModPass" href="#pageone" data-role="button" onclick="ModifyPassSubmit()" style="width: 100px">修改</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
301
NGTools/MobilePages/frmLoginMobile.aspx.cs
Normal file
301
NGTools/MobilePages/frmLoginMobile.aspx.cs
Normal file
@ -0,0 +1,301 @@
|
||||
using NGTools.Tools;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Aliyun.Acs.Core;
|
||||
using Aliyun.Acs.Core.Profile;
|
||||
using Aliyun.Acs.Core.Exceptions;
|
||||
using Aliyun.Acs.Core.Http;
|
||||
using ServerException = Aliyun.Acs.Core.Exceptions.ServerException;
|
||||
|
||||
namespace NGTools
|
||||
{
|
||||
public partial class frmLoginMobile : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (Request["action"] == "login")
|
||||
{
|
||||
_Login();
|
||||
}
|
||||
|
||||
if (Request["action"] == "modPass")
|
||||
{
|
||||
_modPass();
|
||||
}
|
||||
if (Request["action"] == "ZC")
|
||||
{
|
||||
_ZC();
|
||||
}
|
||||
if (Request["action"] == "YANZHENG")
|
||||
{
|
||||
_YANZHENG();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void _YANZHENG()
|
||||
{
|
||||
Response.ContentType = "text/plain";
|
||||
// string strUrl = "";
|
||||
string strPhoneNO = Request["phoneNo"];
|
||||
string strCode = Request["code"];
|
||||
|
||||
String accessKeyId = "LTAI4Fvps6yvL7PupRtHirCT";
|
||||
String accessKeySecret = "ArXySxkAhT3gitqeePAkSGPeHKpBhO";
|
||||
|
||||
IClientProfile profile = DefaultProfile.GetProfile("cn-hangzhou", accessKeyId, accessKeySecret);
|
||||
DefaultAcsClient client = new DefaultAcsClient(profile);
|
||||
CommonRequest request = new CommonRequest();
|
||||
request.Method = MethodType.POST;
|
||||
request.Domain = "dysmsapi.aliyuncs.com";
|
||||
request.Version = "2017-05-25";
|
||||
request.Action = "SendSms";
|
||||
// request.Protocol = ProtocolType.HTTP;
|
||||
request.AddQueryParameters("PhoneNumbers", strPhoneNO);
|
||||
request.AddQueryParameters("SignName", "NGTools");
|
||||
request.AddQueryParameters("TemplateCode", "SMS_177543713");
|
||||
request.AddQueryParameters("TemplateParam", "{\"code\":\"" + strCode + "\"}");
|
||||
// IClientProfile profile = DefaultProfile.GetProfile("ap-southeast-1", accessKeyId, accessKeySecret);
|
||||
//DefaultAcsClient client = new DefaultAcsClient(profile);
|
||||
//CommonRequest request = new CommonRequest
|
||||
//{
|
||||
// Method = MethodType.POST,
|
||||
// Domain = "dysmsapi.ap-southeast-1.aliyuncs.com",
|
||||
// Version = "2018-05-01",
|
||||
// Action = "SendMessageWithTemplate"
|
||||
//};
|
||||
//// request.Protocol = ProtocolType.HTTPS;
|
||||
//request.AddQueryParameters("To", strPhoneNO);
|
||||
//request.AddQueryParameters("From", "NGTools");
|
||||
//request.AddQueryParameters("TemplateCode", "SMS_177543713");
|
||||
//request.AddQueryParameters("TemplateParam", "{\"code\":\"" + strCode + "\"}");
|
||||
|
||||
try
|
||||
{
|
||||
CommonResponse response = client.GetCommonResponse(request);
|
||||
Console.WriteLine(response.Data);
|
||||
}
|
||||
catch (ServerException e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
}
|
||||
catch (ClientException e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
}
|
||||
|
||||
Response.Write("");
|
||||
Response.End();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void _ZC()
|
||||
{
|
||||
Response.ContentType = "text/plain";
|
||||
|
||||
JsEncryptHelper jsHelper = new JsEncryptHelper();
|
||||
string a = Request["userAccount"] + "";
|
||||
string b = Request["userName"] + "";
|
||||
string c = Request["passwd"] + "";
|
||||
string d = Request["phoneNo"] + "";
|
||||
|
||||
string userAccount = jsHelper.Decrypt(a);
|
||||
string userName = jsHelper.Decrypt(b);
|
||||
string passwd = jsHelper.Decrypt(c);
|
||||
string phoneNo = jsHelper.Decrypt(d);
|
||||
|
||||
DataTable dtUser = MySQLHelper.ExecuteDataTable(stringSQL.strSQL_User + userName + "' or user_account='" + userAccount + "' or phoneNo='" + phoneNo + "'");
|
||||
if (dtUser.Rows.Count == 0)
|
||||
{
|
||||
string strSQL = "insert into user (";
|
||||
strSQL += "user_account,";
|
||||
strSQL += "user_name,";
|
||||
strSQL += "pswd,";
|
||||
strSQL += "ORG_ID,";
|
||||
strSQL += "regDateTime,";
|
||||
strSQL += "phoneNo) values(";
|
||||
strSQL += "'" + userAccount + "',";
|
||||
strSQL += "'" + userName + "',";
|
||||
strSQL += "'" + passwd + "',";
|
||||
strSQL += "'" + userAccount + "00',";
|
||||
strSQL += "'" + DateTime.Now + "',";
|
||||
strSQL += "'" + phoneNo + "')";
|
||||
int intState = 0;
|
||||
intState = MySQLHelper.ExecuteNonQuery(strSQL);
|
||||
if (intState >= 0)
|
||||
{
|
||||
|
||||
strSQL = "insert into organization (";
|
||||
strSQL += "ORG_ID,";
|
||||
strSQL += "ORG_Name,";
|
||||
strSQL += "ORG_PARENT_ID,";
|
||||
strSQL += "ORG_TYPE) values(";
|
||||
strSQL += "'" + userAccount + "00',";
|
||||
strSQL += "'" + userName + "00',";
|
||||
strSQL += "'" + "MS00" + "',";
|
||||
strSQL += "'" + "公司" + "')";
|
||||
intState = 0;
|
||||
intState = MySQLHelper.ExecuteNonQuery(strSQL);
|
||||
|
||||
Response.Write("ok");
|
||||
Response.End();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Response.Write("注册失败");
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Write("账户、电话号码或姓名已被注册,请重新输入!");
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
|
||||
private void _modPass()
|
||||
{
|
||||
Response.ContentType = "text/plain";
|
||||
|
||||
//string userName = Request.Form["username"];
|
||||
//string oldpasswd = Request.Form["oldpasswd"];
|
||||
//string newpasswd = Request.Form["newpasswd"];
|
||||
|
||||
|
||||
JsEncryptHelper jsHelper = new JsEncryptHelper();
|
||||
string a = Request["username"] + "";
|
||||
string b = Request["oldpasswd"] + "";
|
||||
string c = Request["newpasswd"] + "";
|
||||
string userName = jsHelper.Decrypt(a);
|
||||
string oldpasswd = jsHelper.Decrypt(b);
|
||||
string newpasswd = jsHelper.Decrypt(c);
|
||||
|
||||
DataTable dtUser = MySQLHelper.ExecuteDataTable(stringSQL.strSQL_User + userName + "' or user_account='" + userName + "' or phoneNo='" + userName + "'");
|
||||
if (dtUser.Rows.Count > 0)
|
||||
{
|
||||
if (dtUser.Rows[0]["pswd"].ToString() == oldpasswd)
|
||||
{
|
||||
string strSQL = "update user set pswd='" + newpasswd + "' where user_name='" + userName + "' or user_account='" + userName + "' or phoneNo='" + userName + "'";
|
||||
int intState = 0;
|
||||
intState = MySQLHelper.ExecuteNonQuery(strSQL);
|
||||
if (intState >= 0)
|
||||
{
|
||||
Response.Write("ok");
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Write("用户名或密码有误,请仔细想想....");
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Write("没有这个用户!");
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void _Login()
|
||||
{
|
||||
Response.ContentType = "text/plain";
|
||||
|
||||
|
||||
JsEncryptHelper jsHelper = new JsEncryptHelper();
|
||||
string a = Request["username"] + "";
|
||||
string b = Request["passwd"] + "";
|
||||
string userName = jsHelper.Decrypt(a);
|
||||
string passWord = jsHelper.Decrypt(b);
|
||||
|
||||
DataTable dtUser = MySQLHelper.ExecuteDataTable(stringSQL.strSQL_User + userName + "' or user_account='" + userName + "' or phoneNo='" + userName + "'");
|
||||
if (dtUser.Rows.Count > 0)
|
||||
{
|
||||
if (dtUser.Rows[0]["loginflag"].ToString() == "0" || dtUser.Rows[0]["loginflag"].ToString() == "")
|
||||
{
|
||||
|
||||
|
||||
if (dtUser.Rows[0]["pswd"].ToString() == passWord)
|
||||
{
|
||||
Session["userName"] = dtUser.Rows[0]["user_name"].ToString(); ; //用户名
|
||||
Session["userAccount"] = dtUser.Rows[0]["user_account"].ToString(); //用户账号
|
||||
Session["userOrgID"] = dtUser.Rows[0]["ORG_ID"].ToString(); ;//所属单位ID
|
||||
Session["userRole"] = dtUser.Rows[0]["role"].ToString(); ;//用户角色
|
||||
Session["userAuthority"] = dtUser.Rows[0]["authority"].ToString(); //用户权限
|
||||
Session["phoneNo"] = dtUser.Rows[0]["phoneNo"].ToString(); //用户电话
|
||||
Session["regDateTime"] = dtUser.Rows[0]["regDateTime"].ToString(); //用户电话
|
||||
|
||||
string strSQL = "update user set loginflag='1' ,logintime='" + DateTime.Now + "' where user_name='" + userName + "' or user_account='" + userName + "' or phoneNo='" + userName + "'";
|
||||
int num = MySQLHelper.ExecuteNonQuery(strSQL);
|
||||
Session.Timeout = 5;
|
||||
|
||||
strSQL = "insert into loginrecord (user_id,login_DateTime) values (" + "'" + dtUser.Rows[0]["user_account"].ToString() + "','" + DateTime.Now + "')";
|
||||
num = MySQLHelper.ExecuteNonQuery(strSQL);
|
||||
|
||||
//string Json = "[{";
|
||||
//Json += "\"statue\":\"OK\"," + "\"userName\":\"" + dtUser.Rows[0]["user_name"].ToString() + "\",";
|
||||
//Json += "\"userAccount\":\"" + dtUser.Rows[0]["user_account"].ToString() + "\",";
|
||||
//Json += "\"userOrgID\":\"" + dtUser.Rows[0]["ORG_ID"].ToString() + "\",";
|
||||
//Json += "\"regDateTime\":\"" + dtUser.Rows[0]["regDateTime"].ToString() + "\"}]";
|
||||
|
||||
Response.Write("OK");
|
||||
Response.End();
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Write("密码错误,请仔细想想....");
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Write("这个账户在别的客户端已登录");
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Write("没有这个用户,请仔细想想你注册时用名字....");
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Base64解密
|
||||
/// </summary>
|
||||
/// <param name="codeName">解密采用的编码方式,注意和加密时采用的方式一致</param>
|
||||
/// <param name="result">待解密的密文</param>
|
||||
/// <returns>解密后的字符串</returns>
|
||||
public static string DecodeBase64(Encoding encode, string result)
|
||||
{
|
||||
string decode = "";
|
||||
byte[] bytes = Convert.FromBase64String(result);
|
||||
try
|
||||
{
|
||||
decode = encode.GetString(bytes);
|
||||
}
|
||||
catch
|
||||
{
|
||||
decode = result;
|
||||
}
|
||||
return decode;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
15
NGTools/MobilePages/frmLoginMobile.aspx.designer.cs
generated
Normal file
15
NGTools/MobilePages/frmLoginMobile.aspx.designer.cs
generated
Normal file
@ -0,0 +1,15 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NGTools {
|
||||
|
||||
|
||||
public partial class frmLoginMobile {
|
||||
}
|
||||
}
|
128
NGTools/MobilePages/frmMainMobile.aspx
Normal file
128
NGTools/MobilePages/frmMainMobile.aspx
Normal file
@ -0,0 +1,128 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="frmMainMobile.aspx.cs" Inherits="NGTools.frmMainMobile" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
|
||||
<script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
|
||||
<script src="../MYJS/JsEncryptHelper.js"></script>
|
||||
<script src="../MYJS/MyTools.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div data-role="page">
|
||||
<div data-role="header" data-position="fixed" data-tap-toggle="false">
|
||||
<h1>天然气工业计算工具集</h1>
|
||||
</div>
|
||||
<div data-role="main" class="ui-content">
|
||||
<%-- <a style="font-size: xx-large; color: #FF0000">开发中,请先使用电脑版本!</a>--%>
|
||||
<div data-role="collapsible-set">
|
||||
<div data-role="collapsible">
|
||||
<h1>流量计算</h1>
|
||||
<a onclick="window.open('A_FlowCal/Orifice.aspx')" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ">差压式流量计算</a>
|
||||
<a onclick="window.open('A_FlowCal/SuduCal.aspx')" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ">速度式流量计算</a>
|
||||
<a onclick="window.open('A_FlowCal/penzui.aspx')" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ">音速喷嘴流量计算</a>
|
||||
</div>
|
||||
<div data-role="collapsible">
|
||||
<h1>参数计算</h1>
|
||||
<a onclick="window.open('B_ParCal/NGParCal.aspx')" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ">天然气参数计算</a>
|
||||
<a onclick="window.open('B_ParCal/Z_TableCal.aspx')" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ">压缩因子表格计算</a>
|
||||
</div>
|
||||
<div data-role="collapsible">
|
||||
<h1>CNG计算</h1>
|
||||
<a onclick="window.open('C_CNG/CNGV_TableCal.aspx')" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ">CNG体积表格计算</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<%-- <div class="ui-block-a">
|
||||
<span>流量计算</span>
|
||||
<span><a onclick="window.open('A_FlowCal/Orifice.aspx')" class="ui-btn ui-corner-all ui-shadow ">差压式流量计算</a></span>
|
||||
<span><a onclick="window.open('A_FlowCal/SuduCal.aspx')" class="ui-btn ui-corner-all ui-shadow ">速度式流量计算</a></span>
|
||||
<span><a onclick="window.open('A_FlowCal/penzui.aspx')" class="ui-btn ui-corner-all ui-shadow ">音速喷嘴流量计算</a></span>
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
<span>第二个列</span>
|
||||
<span><a onclick="window.open('B_ParCal/NGParCal.aspx')" class="ui-btn ui-corner-all ui-shadow ">天然气参数计算</a></span>
|
||||
<span><a onclick="window.open('B_ParCal/Z_TableCal.aspx')" class="ui-btn ui-corner-all ui-shadow ">压缩因子表格计算</a></span>
|
||||
|
||||
</div>
|
||||
<div class="ui-block-c">
|
||||
<span>第三个列</span>
|
||||
<span><a onclick="window.open('C_CNG/CNGV_TableCal.aspx')" class="ui-btn ui-corner-all ui-shadow ">CNG体积表格计算</a></span>
|
||||
</div>--%>
|
||||
|
||||
|
||||
|
||||
<div data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
<a href="#" class="ui-btn ui-corner-all ui-shadow ">设置</a>
|
||||
<a href="#" class="ui-btn ui-corner-all ui-shadow ">功能</a>
|
||||
<a href="#" onclick="loginout()" class="ui-btn ui-corner-all ui-shadow ">退出</a>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var jsonGn = undefined;
|
||||
|
||||
$(document).on("pageinit", function () {
|
||||
|
||||
var url = '../pages/frmMain.aspx?action=getSystemTree' + "&t=" + Date.parse(new Date());
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
dataType: "json",
|
||||
url: url,
|
||||
success: function (data) {
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
function loginout() {
|
||||
$.messager.confirm('系统提示', '您确定要退出本次登录吗?', function (r) {
|
||||
if (r) {
|
||||
checkLogin("0");
|
||||
location.href ="frmLoginMobile.aspx";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function checkLogin(loginflag) {
|
||||
|
||||
if ('<%=Session["userName"] %>' == "") {
|
||||
top.location.href = "frmLoginMobile.aspx";
|
||||
}
|
||||
|
||||
var myDate = new Date();
|
||||
var strDatetime = ""; //获取日期与时间
|
||||
strDatetime += myDate.getFullYear() + "_"; //获取完整的年份(4位,1970-????)
|
||||
strDatetime += (myDate.getMonth() + 1) + "_"; //获取当前月份(0-11,0代表1月) // 所以获取当前月份是myDate.getMonth()+1;
|
||||
strDatetime += myDate.getDate() + " "; //获取当前日(1-31)
|
||||
strDatetime += myDate.getHours() + ":"; //获取当前小时数(0-23)
|
||||
strDatetime += myDate.getMinutes() + ":"; //获取当前分钟数(0-59)
|
||||
strDatetime += myDate.getSeconds(); //获取当前秒数(0-59)
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../pages/frmMain.aspx?action=updateLogin&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { username: '<%=Session["userName"] %>', loginflag: loginflag, datetime: strDatetime },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
//alert(JSON.stringify(data));
|
||||
|
||||
//$('#formPar').form('load', data);
|
||||
$.messager.alert("提示", data);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
17
NGTools/MobilePages/frmMainMobile.aspx.cs
Normal file
17
NGTools/MobilePages/frmMainMobile.aspx.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NGTools
|
||||
{
|
||||
public partial class frmMainMobile : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
17
NGTools/MobilePages/frmMainMobile.aspx.designer.cs
generated
Normal file
17
NGTools/MobilePages/frmMainMobile.aspx.designer.cs
generated
Normal file
@ -0,0 +1,17 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NGTools
|
||||
{
|
||||
|
||||
|
||||
public partial class frmMainMobile
|
||||
{
|
||||
}
|
||||
}
|
1715
NGTools/NGTools.csproj
Normal file
1715
NGTools/NGTools.csproj
Normal file
File diff suppressed because it is too large
Load Diff
40
NGTools/NGTools.csproj.user
Normal file
40
NGTools/NGTools.csproj.user
Normal file
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<ActiveDebugTarget />
|
||||
<NameOfLastUsedPublishProfile>ngtools</NameOfLastUsedPublishProfile>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
<Use64BitIISExpress />
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
</PropertyGroup>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<StartPageUrl>default.aspx</StartPageUrl>
|
||||
<StartAction>SpecificPage</StartAction>
|
||||
<AspNetDebugging>True</AspNetDebugging>
|
||||
<SilverlightDebugging>False</SilverlightDebugging>
|
||||
<NativeDebugging>False</NativeDebugging>
|
||||
<SQLDebugging>False</SQLDebugging>
|
||||
<ExternalProgram>
|
||||
</ExternalProgram>
|
||||
<StartExternalURL>
|
||||
</StartExternalURL>
|
||||
<StartCmdLineArguments>
|
||||
</StartCmdLineArguments>
|
||||
<StartWorkingDirectory>
|
||||
</StartWorkingDirectory>
|
||||
<EnableENC>False</EnableENC>
|
||||
<AlwaysStartWebServerOnDebug>True</AlwaysStartWebServerOnDebug>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
202
NGTools/Pages/A_FLowCal/JLD_GL.aspx
Normal file
202
NGTools/Pages/A_FLowCal/JLD_GL.aspx
Normal file
@ -0,0 +1,202 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JLD_GL.aspx.cs" Inherits="NGTools.Pages.A_FLowCal.JLD_GL" %>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>功能管理</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../Scripts/EASYUI/themes/default/easyui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../Scripts/EASYUI/themes/icon.css" />
|
||||
<!--2个js文件 ,要先引入jquery,然后再引入easyui-->
|
||||
<script src="../../Scripts/EASYUI/jquery.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="../../Scripts/EASYUI/jquery.easyui.min.js"></script>
|
||||
<script src="../../MYJS/MyTools.js"></script>
|
||||
<script src="../../Scripts/EASYUI/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="../../MYJS/constant.js"></script>
|
||||
</head>
|
||||
<body class="easyui-layout">
|
||||
|
||||
<div id="west"data-options="region:'west', split:true" title="计量点列表" style="width: 200px;">
|
||||
<div id="treeWest" style="width: 300px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="center"data-options="region:'center', split:true" title="">
|
||||
<table id="dg" style="width: 700px; height: auto" data-options="
|
||||
singleSelect:false,
|
||||
multiSort:true,
|
||||
remoteSort:false,
|
||||
onClickRow: onClickRow,
|
||||
onEndEdit: onEndEdit">
|
||||
<thead>
|
||||
<tr>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="tb" style="height: auto; display: none">
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="append()">添加</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="removeit()">删除</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true" onclick="accept()">保存</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-undo',plain:true" onclick="reject()">取消</a>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
var inserted = undefined;// $('#dg').datagrid('getChanges', inserted);
|
||||
var updated = undefined;// $('#dg').datagrid('getChanges', updated);
|
||||
var deleted = undefined;//$('#dg').datagrid('getChanges', deleted);
|
||||
|
||||
|
||||
|
||||
$(function () { //动态加载二级菜单
|
||||
var url = '../../ASHX/getTreeCombox.ashx?action=getORG';
|
||||
getTree($('#treeWest'), url);
|
||||
//初始化网格 根数据
|
||||
//getDataGrid($('#dg'), '../../ASHX/getTreeCombox.ashx?action=getDataGrid', "system_menu,parent_id~M00", '#tb');
|
||||
|
||||
|
||||
$('#treeWest').tree({
|
||||
onClick: function (node) {
|
||||
var url = '../../ASHX/getTreeCombox.ashx?action=getDataGrid';
|
||||
var parm = "jld,ORG_ID~" + node.id;// 格式 表名,条件字段名~条件字段值
|
||||
var toobar = '#tb';
|
||||
getDataGrid($('#dg'), url, parm, toobar);
|
||||
|
||||
}
|
||||
})
|
||||
});
|
||||
$(document).ready(function () { //动态加载二级菜单
|
||||
});
|
||||
var editIndex = undefined;
|
||||
function endEditing() {
|
||||
if (editIndex == undefined) { return true }
|
||||
if ($('#dg').datagrid('validateRow', editIndex)) {
|
||||
$('#dg').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function onClickRow(rowIndex, rowData) {
|
||||
$('#dg').datagrid('addEditor',
|
||||
[ //添加cardNo列editor
|
||||
{
|
||||
field: 'JLD_Name', editor: { type: 'textbox', options: { required: true, } }
|
||||
},
|
||||
{
|
||||
field: 'jldType', editor: { type: 'combobox', options: { valueField: 'ID', textField: 'text', data: jldType, required: true } }
|
||||
}
|
||||
]);
|
||||
//让选中行进入编辑状态
|
||||
if (editIndex != rowIndex) {
|
||||
if (endEditing()) {
|
||||
$('#dg').datagrid('selectRow', rowIndex)
|
||||
.datagrid('beginEdit', rowIndex);
|
||||
editIndex = rowIndex;
|
||||
} else {
|
||||
$('#dg').datagrid('selectRow', editIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onEndEdit(index, row) {
|
||||
//$.messager.alert("提示",2222);
|
||||
}
|
||||
function append() {
|
||||
$('#dg').datagrid('addEditor',
|
||||
[ //添加cardNo列editor
|
||||
{
|
||||
field: 'JLD_Name', editor: { type: 'textbox', options: { required: true, } }
|
||||
},
|
||||
{
|
||||
field: 'jldType', editor: { type: 'combobox', options: { valueField: 'ID', textField: 'text', data: jldType, required: true } }
|
||||
}
|
||||
|
||||
]);
|
||||
if (endEditing()) {
|
||||
try {
|
||||
editIndex = $('#dg').datagrid('getRows').length;
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
$('#dg').datagrid('appendRow', {
|
||||
ORG_ID: $("#treeWest").tree('getSelected').id,
|
||||
JLD_Name: "",
|
||||
jldType: "",
|
||||
|
||||
//PrefixInteger 各位数字补零方法 01 03
|
||||
//-----------------------------------------------复制注意修改
|
||||
|
||||
})
|
||||
$('#dg').datagrid('selectRow', editIndex)
|
||||
.datagrid('beginEdit', editIndex); //进入编辑状态
|
||||
|
||||
}
|
||||
}
|
||||
function removeit() {
|
||||
if (confirm("确定删除选中的这行数据吗?")) {
|
||||
var rows = $("#dg").datagrid('getSelected');
|
||||
var index = $("#dg").datagrid('getRowIndex', rows);
|
||||
|
||||
//$('#dg').datagrid('deleteRow', index);
|
||||
$('#dg').datagrid('cancelEdit', index)
|
||||
.datagrid('deleteRow', index);
|
||||
//getChanges();
|
||||
|
||||
}
|
||||
editIndex = undefined;
|
||||
}
|
||||
|
||||
function accept() { //批量保存 高效率地 同时保存修改,删除和插入的行,
|
||||
|
||||
if (endEditing()) {
|
||||
var url = "";
|
||||
url = '../../ASHX/getTreeCombox.ashx?action=SaveDataGrid' + "&t=" + Date.parse(new Date());
|
||||
var parm = "jld@" + getChanges(); // 格式 表名,条件字段名~条件字段值
|
||||
|
||||
if (confirm("确定更新选中的这行数据吗?")) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: url,
|
||||
//dataType: "json",
|
||||
//async: true,//异步请求,默认为true。如果需要发送同步请求发送false
|
||||
data: { par: parm },
|
||||
success: function (data) {
|
||||
$.messager.alert("提示", data);
|
||||
}
|
||||
})
|
||||
//getChanges();
|
||||
}
|
||||
else {
|
||||
reject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function reject() {
|
||||
$('#dg').datagrid('rejectChanges');
|
||||
editIndex = undefined;
|
||||
}
|
||||
function getChanges() {
|
||||
|
||||
var rows = $('#dg').datagrid('getChanges');
|
||||
inserted = $('#dg').datagrid('getChanges', "inserted");
|
||||
updated = $('#dg').datagrid('getChanges', "updated");
|
||||
deleted = $('#dg').datagrid('getChanges', "deleted");
|
||||
var effectRow = new Array();
|
||||
effectRow.push(JSON.stringify(inserted));
|
||||
effectRow.push(JSON.stringify(updated));
|
||||
effectRow.push(JSON.stringify(deleted));
|
||||
return effectRow.join('@');
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
17
NGTools/Pages/A_FLowCal/JLD_GL.aspx.cs
Normal file
17
NGTools/Pages/A_FLowCal/JLD_GL.aspx.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NGTools.Pages.A_FLowCal
|
||||
{
|
||||
public partial class JLD_GL : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
15
NGTools/Pages/A_FLowCal/JLD_GL.aspx.designer.cs
generated
Normal file
15
NGTools/Pages/A_FLowCal/JLD_GL.aspx.designer.cs
generated
Normal file
@ -0,0 +1,15 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NGTools.Pages.A_FLowCal {
|
||||
|
||||
|
||||
public partial class JLD_GL {
|
||||
}
|
||||
}
|
415
NGTools/Pages/A_FLowCal/orifice.aspx
Normal file
415
NGTools/Pages/A_FLowCal/orifice.aspx
Normal file
@ -0,0 +1,415 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="orifice.aspx.cs" Inherits="NGTools.Pages.A_FLowCal.orifice" %>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" />
|
||||
<meta name="renderer" content="webkit|ie-comp|ie-stand" />
|
||||
<title>流量计算</title>
|
||||
|
||||
<!--2个样式表文件-->
|
||||
<link rel="stylesheet" type="text/css" href="../../Scripts/EASYUI/themes/default/easyui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../Scripts/EASYUI/themes/icon.css" />
|
||||
<!--2个js文件 ,要先引入jquery,然后再引入easyui-->
|
||||
<script src="../../Scripts/EASYUI/jquery.min.js"></script>
|
||||
<script src="../../Scripts/EASYUI/jquery.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="../../Scripts/EASYUI/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="../../Scripts/EASYUI/base-loading.js"></script>
|
||||
<script src="../../Scripts/EASYUI/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
|
||||
<script src="../../MYJS/MyTools.js"></script>
|
||||
<script src="../../MYJS/constant.js"></script>
|
||||
</head>
|
||||
<body class="easyui-layout">
|
||||
|
||||
<div id="west"data-options="region:'west', split:true" title="计量点列表" style="width: 200px;">
|
||||
<div id="treeWest" style="width: 300px;"></div>
|
||||
</div>
|
||||
<div id="center" data-options="region:'center', split:true" title="">
|
||||
<form id="formPar" class="easyui-form">
|
||||
<div>
|
||||
<div id="btn" title="" class="easyui-panel" style="width: 900px; height: 55px; padding: 10px; text-align: center">
|
||||
<a id="CalFlow" href="javascript:void(0)" class="easyui-linkbutton c1" onclick=" FlowCal()" style="width: 130px">流量计算</a>
|
||||
<a id="saveBtn" href="javascript:void(0)" class="easyui-linkbutton c1" onclick=" SavePar()" style="width: 130px">保存计量点参数</a>
|
||||
<a id="Draw" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="$('#ddPar').dialog('open')" style="width: 130px">查看中间参数</a>
|
||||
</div>
|
||||
|
||||
<div id="NGRun" class="easyui-panel" title="工况参数" style="width: 900px; height: 75px; padding: 5px;">
|
||||
<a style="width: 140px; display: inline-block; text-align: right">表压力(MPa):</a><input required="required" name="inP" id="inP" class="easyui-numberbox" data-options="precision:5" style="border-color: #FF0000; text-align: right; width: 140px; background-color: #0099CC;" value="1.48" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right">差压(kPa):</a><input required="required" name="inDp" id="inDp" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 140px;" value="12.5" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right">温度(℃):</a><input required="required" name="inWd" id="inWd" class="easyui-numberbox" data-options="precision:3" style="text-align: right; width: 140px;" value="20" />
|
||||
</div>
|
||||
<div id="JldPar" class="easyui-panel" title="计量点参数" style="width: 900px; height: 165px; padding: 5px;" data-options="collapsible:true">
|
||||
<div id="GD" title="" style="width: 890px; height: 40px; padding: 5px;">
|
||||
<a style="width: 140px; display: inline-block; text-align: right">管道类型:</a><input required="required" name="GDLX" id="GDLX" class="easyui-combobox" style="text-align: right; width: 130px;" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right">管道材质:</a><input required="required" name="GDCZ" id="GDCZ" class="easyui-combobox" style="text-align: right; width: 170px;" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right">管道内径(mm):</a><input required="required" name="GDZJ" id="GDZJ" class="easyui-numberbox" data-options="precision:2" style="text-align: right; width: 130px;" />
|
||||
</div>
|
||||
|
||||
<div id="JLJ" title="" style="width: 890px; height: 40px; padding: 5px;">
|
||||
<a style="width: 140px; display: inline-block; text-align: right">流量计类型:</a><input required="required" name="CYSLLJLX" id="CYSLLJLX" class="easyui-combobox" style="text-align: right; width: 130px;" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right">节流件材质:</a><input required="required" name="JLJCZ" id="JLJCZ" class="easyui-combobox" style="text-align: right; width: 170px;" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right">节流件内径(mm):</a><input required="required" name="JLJZJ" id="JLJZJ" class="easyui-numberbox" data-options="precision:2" style="text-align: right; width: 130px;" />
|
||||
</div>
|
||||
<div id="CBCS" title="" style="width: 890px; height: 40px; padding: 5px;">
|
||||
<a style="width: 140px; display: inline-block; text-align: right">取压方式:</a><input required="required" name="QYFS" id="QYFS" class="easyui-combobox" style="text-align: right; width: 130px;" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right">参比条件:</a><input required="required" name="CBTJ" id="CBTJ" class="easyui-combobox" style="text-align: right; width: 170px;" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right">当地大气压(MPa):</a><input required="required" name="DDDQY" id="DDDQY" class="easyui-numberbox" data-options="precision:6" style="text-align: right; width: 130px;" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="NGPar" class="easyui-panel" title="天然气组成" style="width: 900px; height: 240px; padding: 5px;" data-options="collapsible:true">
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">甲烷C1:</a>
|
||||
<input required="required" name="NG_C1" id="NG_C1" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" value="0" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氮气N2:</a>
|
||||
<input required="required" name="NG_N2" id="NG_N2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">二氧化碳CO2:</a>
|
||||
<input required="required" name="NG_CO2" id="NG_CO2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">乙烷C2:</a>
|
||||
<input required="required" name="NG_C2" id="NG_C2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">丙烷C3:</a>
|
||||
<input required="required" name="NG_C3" id="NG_C3" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">水H2O:</a>
|
||||
<input required="required" name="NG_H2O" id="NG_H2O" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">硫化氢H2S:</a>
|
||||
<input required="required" name="NG_H2S" id="NG_H2S" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氢气H2:</a>
|
||||
<input required="required" name="NG_H2" id="NG_H2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">一氧化碳CO:</a>
|
||||
<input required="required" name="NG_CO" id="NG_CO" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氧气O2:</a>
|
||||
<input required="required" name="NG_O2" id="NG_O2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">异丁烷iC4:</a>
|
||||
<input required="required" name="NG_iC4" id="NG_iC4" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">正丁烷nC4:</a>
|
||||
<input required="required" name="NG_nC4" id="NG_nC4" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">异戊烷iC5:</a>
|
||||
<input required="required" name="NG_iC5" id="NG_iC5" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">正戊烷nC5:</a>
|
||||
<input required="required" name="NG_nC5" id="NG_nC5" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">己烷C6:</a>
|
||||
<input required="required" name="NG_C6" id="NG_C6" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">庚烷C7:</a>
|
||||
<input required="required" name="NG_C7" id="NG_C7" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">辛烷C8:</a>
|
||||
<input required="required" name="NG_C8" id="NG_C8" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">壬烷C9:</a>
|
||||
<input required="required" name="NG_C9" id="NG_C9" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">癸烷C10:</a>
|
||||
<input required="required" name="NG_C10" id="NG_C10" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氦气He:</a>
|
||||
<input required="required" name="NG_He" id="NG_He" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氩气Ar:</a>
|
||||
<input required="required" name="NG_Ar" id="NG_Ar" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">合计:</a>
|
||||
<input required="required" name="NGCom" id="NG_SUM" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
|
||||
<a id="Default" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="Zore()" style="text-align: center; width: 80px">全部清零</a>
|
||||
<a id="copyBtn" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="copyZf()" style="text-align: center; width: 60px">复制</a>
|
||||
<a id="pasteBtn" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="pasteZf()" style="text-align: center; width: 60px">粘贴</a>
|
||||
<a style="width: 80px; display: inline-block; text-align: right">常用参数:</a><input id="CYCS" class="easyui-combobox" onclick="NG_Default()" style="text-align: right; width: 140px;" />
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div id="Result" class="easyui-panel" title="参比条件的计算结果" style="width: 900px; height: 75px; padding: 5px;">
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding: 5px">体积流量(m³/d):</a><input id="dVFlowb" class="easyui-numberbox" data-options="precision:2,groupSeparator:','" style="text-align: right; width: 140px;" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding: 5px">质量流量(kg/s):</a><input id="dMFlowb" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 140px;" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding: 5px">能量流量(MJ/s):</a><input id="dEFlowb" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 140px;" />
|
||||
</div>
|
||||
|
||||
<div id="ddPar" class="easyui-dialog" title="流量中间参数" style="width: 900px; height: 220px; padding: 4px; display: none" data-options="closed:true">
|
||||
<%-- <div id="ddPar1" class="easyui-panel" title="" style="width: 890px; height: 250px; padding: 5px;" data-options="collapsible:true">--%>
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">流出系数:</a><input id="dCd" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px; padding: 5px" />
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">渐近速度系数E:</a><input id="dE" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px; padding: 5px" />
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">相对密度系数FG:</a><input id="dFG" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px; padding: 5px" />
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">流动温度系数FT:</a><input id="dFT" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px; padding: 5px" />
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">动力粘度(mPa·s):</a><input id="dDViscosity" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px; padding: 5px" />
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">可膨胀系数:</a><input id="dDExpCoefficient" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px; padding: 5px" />
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">管道雷诺数:</a><input id="dRnPipe" class="easyui-numberbox" data-options="precision:1" style="text-align: right; width: 120px; padding: 5px" />
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">锐利度系数:</a><input id="dBk" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px; padding: 5px" />
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">管道粗糙度系数:</a><input id="dRoughNessPipe" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px; padding: 5px" />
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">等熵指数:</a><input id="dKappa" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px; padding: 5px" />
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">工况流量(m³/h):</a><input id="dVFlowf" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px; padding: 5px" />
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">流速(m/s):</a><input id="dVelocityFlow" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px; padding: 5px" />
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">压力损失(Pa):</a><input id="dPressLost" class="easyui-numberbox" data-options="precision:1" style="text-align: right; width: 120px; padding: 5px" />
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">直径比:</a><input id="dBeta" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px; padding: 5px" />
|
||||
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">标况:</a><input id="dZb" class="easyui-numberbox" data-options="precision:6" style="text-align: right; width: 120px; padding: 5px;" />
|
||||
<a style="width: 160px; display: inline-block; text-align: right; padding: 5px">工况:</a><input id="dZf" class="easyui-numberbox" data-options="precision:6" style="text-align: right; width: 120px; padding: 5px;" />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="south" data-options="region:'south',split:false" style="height: 30px;">
|
||||
<label id="buyMessage" style="color:red " ></label>
|
||||
<label id="message" style="color:red " ></label>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
$("#CYCS").combobox({
|
||||
onSelect: function (rec) {
|
||||
$('#formPar').form('load', JSON.parse(NGComCon[rec.ID].NGCom));
|
||||
$('#NG_SUM').numberbox('setValue', sumZf());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function SavePar() {
|
||||
saveStr = JSON.stringify(getFormJson('#formPar')); // json对象;
|
||||
// alert(JSON.stringify(saveStr));
|
||||
|
||||
var node = $('#treeWest').tree('getSelected');
|
||||
var jldID = node.ID;
|
||||
if (jldID == "") {
|
||||
$.messager.alert("提示", "请选择计量点后再保存!")
|
||||
return;
|
||||
}
|
||||
if (confirm("确定将计量点参数保存到计量点:" + node.text + "")) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=saveJldPar&' + "t=" + Date.parse(new Date()),
|
||||
//dataType: "json",
|
||||
data: { jldid: node.id, Par: saveStr, gnmk: "KB" },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
//alert(JSON.stringify(data));
|
||||
|
||||
//$('#formPar').form('load', data);
|
||||
//$.messager.alert("提示", data);
|
||||
|
||||
document.getElementById('message').innerHTML = JSON.stringify(data);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
$('#treeWest').tree({
|
||||
|
||||
formatter: function (node) {
|
||||
|
||||
return '<span title=双击调取计量点数据" class="easyui-tooltip" >' + node.text + '</span>'
|
||||
},
|
||||
onDblClick: function (node) {
|
||||
clearForm();
|
||||
initialCom();
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=getJldPar&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { jldid: node.id, gnmk: "KB" },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
//alert(JSON.stringify(data));
|
||||
|
||||
$('#formPar').form('load', data);
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
function FlowCal() {
|
||||
|
||||
if ($("#formPar").form('validate')) {
|
||||
var NG_par = "";
|
||||
|
||||
if ($('#inP').numberbox('getValue') == "") {
|
||||
alert("请输入压力!");
|
||||
return;
|
||||
}
|
||||
if ($('#inDp').numberbox('getValue') == "") {
|
||||
alert("请输入差压!");
|
||||
return;
|
||||
}
|
||||
if ($('#inWd').numberbox('getValue') == "") {
|
||||
alert("请输入温度!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (Math.abs(sumZf() - 100) > 0.001) { $.messager.alert("提示", "组分和不为100%,请检查!"); return; }
|
||||
NG_par = "0";//流量计类别
|
||||
NG_par = NG_par + "," + $('#CYSLLJLX').combobox('getValue');//节流装置类型
|
||||
NG_par = NG_par + "," + "0";//流量计算标准
|
||||
NG_par = NG_par + "," + "0";//压缩因子计算标准
|
||||
NG_par = NG_par + "," + $('#CBTJ').combobox('getValue');//'计量参比条件
|
||||
NG_par = NG_par + "," + "101325";//计量参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//计量参比条件温度
|
||||
NG_par = NG_par + "," + "101325";//燃烧参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//燃烧参比条件温度
|
||||
NG_par = NG_par + "," + $('#DDDQY').numberbox('getValue');//当地大气压
|
||||
NG_par = NG_par + "," + "2";//当地大气压单位
|
||||
NG_par = NG_par + "," + strZf();//天然气组分
|
||||
NG_par = NG_par + "," + $('#QYFS').combobox('getValue');//取压方式
|
||||
NG_par = NG_par + "," + $('#GDLX').combobox('getValue');//管道类型
|
||||
NG_par = NG_par + "," + $('#GDZJ').numberbox('getValue');//管道内径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//管道内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + $('#GDCZ').combobox('getValue');//管道材料
|
||||
NG_par = NG_par + "," + $('#JLJZJ').numberbox('getValue');//孔板孔径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//孔板内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + $('#JLJCZ').combobox('getValue');//孔板材料
|
||||
NG_par = NG_par + "," + "0";//锐利度系数计算方法
|
||||
NG_par = NG_par + "," + "0";//孔板入口圆弧半径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + $('#inP').numberbox('getValue');//输入压力
|
||||
NG_par = NG_par + "," + "2";//压力单位
|
||||
NG_par = NG_par + "," + "0";//压力类型
|
||||
NG_par = NG_par + "," + $('#inWd').numberbox('getValue');//输入温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + $('#inDp').numberbox('getValue');//输入差压
|
||||
NG_par = NG_par + "," + "1";//压力单位
|
||||
NG_par = NG_par + "," + "1";//体积流量单位
|
||||
NG_par = NG_par + "," + "2";//质量流量单位
|
||||
NG_par = NG_par + "," + "1";//能量流量单位
|
||||
|
||||
alert(NG_par);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/FlowCal.ashx?action=KBCal' + "&t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { Par: NG_par },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
//alert(JSON.stringify(data));
|
||||
$('#dCd').numberbox('setValue', data[45]);
|
||||
$('#dE').numberbox('setValue', data[46]);
|
||||
$('#dFG').numberbox('setValue', data[47]);
|
||||
$('#dFT').numberbox('setValue', data[48]);
|
||||
$('#dDViscosity').numberbox('setValue', data[49]);
|
||||
$('#dDExpCoefficient').numberbox('setValue', data[50]);
|
||||
$('#dRnPipe').numberbox('setValue', data[51]);
|
||||
$('#dBk').numberbox('setValue', data[52]);
|
||||
$('#dRoughNessPipe').numberbox('setValue', data[53]);
|
||||
$('#dCdCorrect').numberbox('setValue', data[54]);
|
||||
$('#dVFlowb').numberbox('setValue', data[56]);
|
||||
$('#dVFlowf').numberbox('setValue', data[57]);
|
||||
$('#dMFlowb').numberbox('setValue', data[58]);
|
||||
$('#dEFlowb').numberbox('setValue', data[59]);
|
||||
$('#dVelocityFlow').numberbox('setValue', data[60]);
|
||||
$('#dPressLost').numberbox('setValue', data[61]);
|
||||
$('#dBeta').numberbox('setValue', data[62]);
|
||||
|
||||
$('#dZb').numberbox('setValue', data[64]);
|
||||
$('#dZf').numberbox('setValue', data[65]);
|
||||
$('#dKappa').numberbox('setValue', data[80]);
|
||||
|
||||
|
||||
setremainTimes('<%=Session ["userAccount"]%>', getQueryString("GNID"));
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
|
||||
$.messager.alert('操作提示', '存在必填项为空,请检查!', "warning");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var url = '../../ASHX/getTreeCombox.ashx?action=getJld';
|
||||
getTree($('#treeWest'), url);
|
||||
|
||||
$('#DDDQY').numberbox('setValue', 0.101325);
|
||||
|
||||
$("#GDLX").combobox({ data: GDLX, valueField: 'ID', textField: 'text' });
|
||||
$('#GDLX').combobox('select', GDLX[0].ID);
|
||||
|
||||
$('#GDCZ').combobox({ data: GDCZ, valueField: 'ID', textField: 'text' });
|
||||
$('#GDCZ').combobox('select', GDCZ[2].ID);
|
||||
|
||||
$('#CYSLLJLX').combobox({ data: CYSLLJLX, valueField: 'ID', textField: 'text' });
|
||||
$('#CYSLLJLX').combobox('select', CYSLLJLX[0].ID);
|
||||
|
||||
$('#JLJCZ').combobox({ data: JLJCZ, valueField: 'ID', textField: 'text' });
|
||||
$('#JLJCZ').combobox('select', JLJCZ[9].ID);
|
||||
|
||||
$('#QYFS').combobox({ data: QYFS, valueField: 'ID', textField: 'text' });
|
||||
$('#QYFS').combobox('select', QYFS[0].ID);
|
||||
|
||||
$('#CBTJ').combobox({ data: CBTJ, valueField: 'ID', textField: 'text' });
|
||||
$('#CBTJ').combobox('select', CBTJ[0].ID);
|
||||
|
||||
$('#CYCS').combobox({ data: CycsCom, valueField: 'ID', textField: 'text' });
|
||||
$('#CYCS').combobox('select', CycsCom[1].ID);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$('#NG_C1').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_N2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_CO2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C3').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_H2O').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_H2S').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_H2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_CO').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_O2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_iC4').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_nC4').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_iC5').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_nC5').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C6').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C7').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C8').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C9').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C10').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_He').numberbox({ onChange: function () { sumZf(); } });
|
||||
|
||||
|
||||
//if (getQueryString("enable").toString() == "False") {
|
||||
// document.getElementById("message").innerHTML = "试用期已过,如有需要请点系统设置->开通功能";
|
||||
// $('#saveBtn').linkbutton('disable');
|
||||
// $('#inP').numberbox('disable', true); //设置输入框为禁用
|
||||
// $('#NG_C1').numberbox('disable', true); //设置输入框为禁用
|
||||
//}
|
||||
|
||||
getEnable('<%=Session ["userAccount"]%>', getQueryString("GNID"));
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
201
NGTools/Pages/A_FLowCal/orifice.aspx.cs
Normal file
201
NGTools/Pages/A_FLowCal/orifice.aspx.cs
Normal file
@ -0,0 +1,201 @@
|
||||
using NG_Tools;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NGTools.Pages.A_FLowCal
|
||||
{
|
||||
public partial class orifice : System.Web.UI.Page
|
||||
{
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
//if (Request.QueryString["action"] == "Cal")
|
||||
//{
|
||||
// string[] tempPar = Request["Par"].Split(',');
|
||||
|
||||
// Flowcal(tempPar);
|
||||
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
private void Flowcal(string[] par)
|
||||
{
|
||||
|
||||
double[] ngCom = new double[21];
|
||||
double[] tempPar = new double[110];
|
||||
for (int i = 0; i < par.Length; i++)
|
||||
{
|
||||
if (i != 11)
|
||||
{
|
||||
tempPar[i] = double.Parse(par[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int j = 0; j < 21; j++)
|
||||
{
|
||||
ngCom[j] = double.Parse(par[11].Split('_')[j]) / 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
FlowCal NGFLOW = new FlowCal();
|
||||
NG_Cal.FlowParStruct flPar = new NG_Cal.FlowParStruct();
|
||||
NG_Cal.GasPropsSTRUCT gasPar = new NG_Cal.GasPropsSTRUCT();
|
||||
gasPar.adMixture = ngCom;
|
||||
|
||||
UnitConvert MyConvert = new UnitConvert();
|
||||
|
||||
|
||||
flPar.dMeterType = (int)tempPar[0]; //流量计类别
|
||||
flPar.dCoreType = (int)tempPar[1]; //节流装置类型
|
||||
flPar.dFlowCalbz = (int)tempPar[2]; //流量计算标准
|
||||
flPar.dZcalbz = (int)tempPar[3]; //压缩因子计算标准
|
||||
flPar.dCbtj = (int)tempPar[4]; //'计量参比条件
|
||||
flPar.dPb_M = tempPar[5]; //计量参比条件压力
|
||||
flPar.dTb_M = tempPar[6]; //计量参比条件温度
|
||||
flPar.dPb_E = tempPar[7]; //燃烧参比条件压力
|
||||
flPar.dTb_E = tempPar[8]; //燃烧参比条件温度
|
||||
flPar.dPatmUnit = (int)tempPar[10]; //当地大气压单位
|
||||
flPar.dPatm = MyConvert.Converter("yl", tempPar[9], flPar.dPatmUnit, 0, 4); ; //当地大气压
|
||||
flPar.dNG_Compents = gasPar.adMixture; //天然气组分
|
||||
flPar.dPtmode = (int)tempPar[12]; //取压方式
|
||||
flPar.dPipeType = (int)tempPar[13]; //管道类型
|
||||
flPar.dPipeD = tempPar[14]; //管道内径
|
||||
flPar.dLenUnit = (int)tempPar[15]; //长度单位
|
||||
flPar.dPipeDtemp = tempPar[16]; //管道内径参考温度
|
||||
flPar.dPileDtempUint = (int)tempPar[17]; //温度单位
|
||||
flPar.dPipeMaterial = (int)tempPar[18]; //管道材料
|
||||
flPar.dOrificeD = tempPar[19]; //孔板孔径
|
||||
flPar.dOrificeUnit = (int)tempPar[20]; //长度单位
|
||||
flPar.dOrificeDtemp = tempPar[21]; //孔板内径参考温度
|
||||
flPar.dOrificeDtempUnit = (int)tempPar[22]; //温度单位
|
||||
flPar.dOrificeMaterial = (int)tempPar[23]; //孔板材料
|
||||
flPar.dOrificeSharpness = (int)tempPar[24]; //锐利度系数计算方法
|
||||
flPar.dOrificeRk = tempPar[25]; //孔板入口圆弧半径
|
||||
flPar.dOrificeRkLenUint = (int)tempPar[26]; //长度单位
|
||||
flPar.dPfUnit = (int)tempPar[28]; //压力单位
|
||||
flPar.dPf = MyConvert.Converter("yl", tempPar[27], flPar.dPfUnit, 0, 4); //输入压力
|
||||
flPar.dPfType = (int)tempPar[29]; //压力类型
|
||||
flPar.dTfUnit = (int)tempPar[31]; //温度单位
|
||||
flPar.dTf = MyConvert.Converter("wd", tempPar[30], flPar.dTfUnit, 1, 4); //输入温度
|
||||
flPar.dDpUnit = (int)tempPar[33]; //压力单位
|
||||
flPar.dDp = MyConvert.Converter("yl", tempPar[32], flPar.dDpUnit, 0, 4); //输入压力; //输入差压
|
||||
flPar.dVFlowUnit = (int)tempPar[34]; //体积流量单位
|
||||
flPar.dMFlowUnit = (int)tempPar[35]; //质量流量单位
|
||||
flPar.dEFlowUnit = (int)tempPar[36]; //能量流量单位
|
||||
|
||||
//将压力换算为绝压
|
||||
if (flPar.dPfType == 0)
|
||||
{
|
||||
flPar.dPf = flPar.dPf + flPar.dPatm;
|
||||
}
|
||||
|
||||
gasPar.dCbtj = flPar.dCbtj;
|
||||
gasPar.dPf = flPar.dPf;
|
||||
gasPar.dTf = flPar.dTf;
|
||||
|
||||
switch (gasPar.dCbtj)
|
||||
{
|
||||
case 2:
|
||||
gasPar.dPb = 101325;
|
||||
gasPar.dTb = 273.15;
|
||||
break;
|
||||
case 1:
|
||||
gasPar.dPb = 101325;
|
||||
gasPar.dTb = 288.15;
|
||||
break;
|
||||
case 0:
|
||||
gasPar.dPb = 101325;
|
||||
gasPar.dTb = 293.15;
|
||||
break;
|
||||
}
|
||||
|
||||
NG_Tools.NG_Cal NG_Cal = new NG_Cal();
|
||||
NG_Cal.Crit(ref gasPar, 0.0);
|
||||
|
||||
NGFLOW.OFlowCal(ref gasPar, ref flPar);
|
||||
|
||||
|
||||
tempPar[45] = flPar.dCd;
|
||||
tempPar[46] = flPar.dE;
|
||||
tempPar[47] = flPar.dFG;
|
||||
tempPar[48] = flPar.dFT;
|
||||
tempPar[49] = flPar.dDViscosity;
|
||||
tempPar[50] = flPar.dDExpCoefficient;
|
||||
tempPar[51] = flPar.dRnPipe;
|
||||
tempPar[52] = flPar.dBk;
|
||||
tempPar[53] = flPar.dRoughNessPipe;
|
||||
tempPar[54] = flPar.dCdCorrect;
|
||||
tempPar[55] = 0;
|
||||
tempPar[56] = flPar.dVFlowb * 86400;
|
||||
tempPar[57] = flPar.dVFlowf * 3600;
|
||||
tempPar[58] = flPar.dMFlowb;
|
||||
tempPar[59] = flPar.dEFlowb;
|
||||
tempPar[60] = flPar.dVelocityFlow;
|
||||
tempPar[61] = flPar.dPressLost;
|
||||
tempPar[62] = flPar.dBeta;
|
||||
|
||||
tempPar[63] = gasPar.dMrx;
|
||||
tempPar[64] = gasPar.dZb;
|
||||
tempPar[65] = gasPar.dZf;
|
||||
tempPar[66] = gasPar.dFpv;
|
||||
tempPar[67] = gasPar.dDb;
|
||||
tempPar[68] = gasPar.dDf;
|
||||
tempPar[69] = gasPar.dRhob;
|
||||
tempPar[70] = gasPar.dRhof;
|
||||
tempPar[71] = gasPar.dRD_Ideal;
|
||||
tempPar[72] = gasPar.dRD_Real;
|
||||
tempPar[73] = gasPar.dHo;
|
||||
tempPar[74] = gasPar.dH;
|
||||
tempPar[75] = gasPar.dS;
|
||||
tempPar[76] = gasPar.dCpi;
|
||||
tempPar[77] = gasPar.dCp;
|
||||
tempPar[78] = gasPar.dCv;
|
||||
tempPar[79] = gasPar.dk;
|
||||
tempPar[80] = gasPar.dKappa;
|
||||
tempPar[81] = gasPar.dSOS;
|
||||
tempPar[82] = gasPar.dCstar;
|
||||
tempPar[83] = gasPar.dHhvMol;
|
||||
tempPar[84] = gasPar.dLhvMol;
|
||||
tempPar[85] = gasPar.dHhvv;
|
||||
tempPar[86] = gasPar.dLhvv;
|
||||
tempPar[87] = gasPar.dHhvm;
|
||||
tempPar[88] = gasPar.dLhvm;
|
||||
tempPar[89] = gasPar.dZb11062;
|
||||
tempPar[90] = gasPar.dRhob11062;
|
||||
tempPar[91] = gasPar.dRhof11062;
|
||||
tempPar[92] = gasPar.dRD_Ideal11062;
|
||||
tempPar[93] = gasPar.dRD_Real11062;
|
||||
tempPar[94] = gasPar.dWobbeIndex;
|
||||
tempPar[95] = gasPar.Pc;
|
||||
tempPar[96] = gasPar.TC;
|
||||
tempPar[97] = gasPar.Bzsx;
|
||||
tempPar[98] = gasPar.Bzxx;
|
||||
tempPar[99] = gasPar.TotalC;
|
||||
tempPar[100] = gasPar.C2;
|
||||
tempPar[101] = gasPar.C2j;
|
||||
tempPar[102] = gasPar.C3j;
|
||||
tempPar[103] = gasPar.C4j;
|
||||
tempPar[104] = gasPar.C5j;
|
||||
tempPar[105] = gasPar.C6j;
|
||||
tempPar[106] = gasPar.C3C4;
|
||||
|
||||
StringBuilder Json = new StringBuilder();
|
||||
Json.Append("[");
|
||||
for (int i = 0; i < tempPar.Length; i++)
|
||||
{
|
||||
Json.Append(tempPar[i].ToString() + ",");
|
||||
}
|
||||
string json = (Json.Replace(",", "", Json.Length - 1, 1).Append("]")).ToString();
|
||||
|
||||
Response.Write(json);
|
||||
Response.End();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
15
NGTools/Pages/A_FLowCal/orifice.aspx.designer.cs
generated
Normal file
15
NGTools/Pages/A_FLowCal/orifice.aspx.designer.cs
generated
Normal file
@ -0,0 +1,15 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NGTools.Pages.A_FLowCal {
|
||||
|
||||
|
||||
public partial class orifice {
|
||||
}
|
||||
}
|
361
NGTools/Pages/A_FLowCal/pzCal.aspx
Normal file
361
NGTools/Pages/A_FLowCal/pzCal.aspx
Normal file
@ -0,0 +1,361 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="pzCal.aspx.cs" Inherits="NGTools.Pages.A_FLowCal.pzCal" %>
|
||||
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" />
|
||||
<meta name="renderer" content="webkit|ie-comp|ie-stand">
|
||||
<title>流量计算</title>
|
||||
|
||||
<!--2个样式表文件-->
|
||||
<link rel="stylesheet" type="text/css" href="../../Scripts/EASYUI/themes/default/easyui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../Scripts/EASYUI/themes/icon.css" />
|
||||
<!--2个js文件 ,要先引入jquery,然后再引入easyui-->
|
||||
<script src="../../Scripts/EASYUI/jquery.min.js"></script>
|
||||
<script src="../../Scripts/EASYUI/jquery.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="../../Scripts/EASYUI/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="../../Scripts/EASYUI/base-loading.js"></script>
|
||||
<script src="../../Scripts/EASYUI/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
|
||||
<script src="../../MYJS/MyTools.js"></script>
|
||||
<script src="../../MYJS/constant.js"></script>
|
||||
</head>
|
||||
<body class="easyui-layout">
|
||||
|
||||
<div id="west" data-options="region:'west',split:true" title="计量点列表" style="width: 200px;">
|
||||
<div id="treeWest" style="width: 300px;"></div>
|
||||
</div>
|
||||
<div id="center" data-options="region:'center', split:true" title="">
|
||||
<form id="formPar" class="easyui-form">
|
||||
|
||||
<div>
|
||||
<div id="btn" title="" class="easyui-panel" style="width: 900px; height: 55px; padding: 10px; text-align: center">
|
||||
<a id="CalFlow" href="javascript:void(0)" class="easyui-linkbutton c1" onclick=" FlowCal()" style="width: 130px">流量计算</a>
|
||||
<a id="saveBtn" href="javascript:void(0)" class="easyui-linkbutton c1" onclick=" SavePar()" style="width: 130px">保存计量点参数</a>
|
||||
<a id="Draw" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="$('#ddPar').dialog('open')" style="width: 130px">查看中间参数</a>
|
||||
</div>
|
||||
<div id="NGRun" class="easyui-panel" title="工况参数" style="width: 900px; height: 75px; padding: 5px;">
|
||||
<a style="width: 100px; display: inline-block; text-align: right">表压力(MPa):</a><input required="required" name="inP" id="inP" class="easyui-numberbox" data-options="precision:5" style="border-color: #FF0000; text-align: right; width: 90px; background-color: #0099CC;" value="4" />
|
||||
<a style="width: 100px; display: inline-block; text-align: right">温度(℃):</a><input required="required" name="inWd" id="inWd" class="easyui-numberbox" data-options="precision:3" style="text-align: right; width: 90px;" value="20" />
|
||||
<a style="width: 100px; display: inline-block; text-align: right">大气压(MPa):</a><input required="required" name="DDDQY" id="DDDQY" class="easyui-numberbox" data-options="precision:6" style="text-align: right; width: 90px;" />
|
||||
<a style="width: 100px; display: inline-block; text-align: right">参比条件:</a><input required="required" name="CBTJ" id="CBTJ" class="easyui-combobox" style="text-align: right; width: 160px;" />
|
||||
</div>
|
||||
<div id="JldPar" class="easyui-panel" title="计量点参数" style="width: 900px; height: 110px; padding: 5px;" data-options="collapsible:true">
|
||||
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding-bottom: 5px; padding-top: 5px">管道材质:</a><input required="required" name="GDCZ" id="GDCZ" class="easyui-combobox" style="text-align: right; width: 130px;" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding-bottom: 5px; padding-top: 5px">管道内径(mm):</a><input required="required" name="GDZJ" id="GDZJ" class="easyui-numberbox" data-options="precision:2" style="text-align: right; width: 130px;" value="200" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding-bottom: 5px; padding-top: 5px">节流件材质:</a><input required="required" name="JLJCZ" id="JLJCZ" class="easyui-combobox" style="text-align: right; width: 130px;" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding-bottom: 5px; padding-top: 5px">喷嘴喉部直径(mm):</a><input required="required" name="JLJZJ" id="JLJZJ" class="easyui-numberbox" data-options="precision:2" style="text-align: right; width: 130px;" value="5" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding-bottom: 5px; padding-top: 5px">喷嘴流出系数:</a><input required="required" name="LCXS" id="LCXS" class="easyui-numberbox" data-options="precision:5" style="text-align: right; width: 130px;" value="0.9931" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="NGPar" class="easyui-panel" title="天然气组成" style="width: 900px; height: 240px; padding: 5px;" data-options="collapsible:true">
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">甲烷C1:</a>
|
||||
<input required="required" name="NG_C1" id="NG_C1" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" value="0" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氮气N2:</a>
|
||||
<input required="required" name="NG_N2" id="NG_N2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">二氧化碳CO2:</a>
|
||||
<input required="required" name="NG_CO2" id="NG_CO2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">乙烷C2:</a>
|
||||
<input required="required" name="NG_C2" id="NG_C2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">丙烷C3:</a>
|
||||
<input required="required" name="NG_C3" id="NG_C3" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">水H2O:</a>
|
||||
<input required="required" name="NG_H2O" id="NG_H2O" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">硫化氢H2S:</a>
|
||||
<input required="required" name="NG_H2S" id="NG_H2S" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氢气H2:</a>
|
||||
<input required="required" name="NG_H2" id="NG_H2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">一氧化碳CO:</a>
|
||||
<input required="required" name="NG_CO" id="NG_CO" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氧气O2:</a>
|
||||
<input required="required" name="NG_O2" id="NG_O2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">异丁烷iC4:</a>
|
||||
<input required="required" name="NG_iC4" id="NG_iC4" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">正丁烷nC4:</a>
|
||||
<input required="required" name="NG_nC4" id="NG_nC4" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">异戊烷iC5:</a>
|
||||
<input required="required" name="NG_iC5" id="NG_iC5" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">正戊烷nC5:</a>
|
||||
<input required="required" name="NG_nC5" id="NG_nC5" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">己烷C6:</a>
|
||||
<input required="required" name="NG_C6" id="NG_C6" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">庚烷C7:</a>
|
||||
<input required="required" name="NG_C7" id="NG_C7" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">辛烷C8:</a>
|
||||
<input required="required" name="NG_C8" id="NG_C8" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">壬烷C9:</a>
|
||||
<input required="required" name="NG_C9" id="NG_C9" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">癸烷C10:</a>
|
||||
<input required="required" name="NG_C10" id="NG_C10" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氦气He:</a>
|
||||
<input required="required" name="NG_He" id="NG_He" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氩气Ar:</a>
|
||||
<input required="required" name="NG_Ar" id="NG_Ar" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">合计:</a>
|
||||
<input required="required" name="NGCom" id="NG_SUM" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a id="Default" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="Zore()" style="text-align: center; width: 80px">全部清零</a>
|
||||
<a id="copyBtn" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="copyZf()" style="text-align: center; width: 60px">复制</a>
|
||||
<a id="pasteBtn" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="pasteZf()" style="text-align: center; width: 60px">粘贴</a>
|
||||
<a style="width: 80px; display: inline-block; text-align: right">常用参数:</a><input id="CYCS" class="easyui-combobox" onclick="NG_Default()" style="text-align: right; width: 140px;" />
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<div id="Result" class="easyui-panel" title="参比条件的计算结果" style="width: 900px; height: 75px; padding: 5px;">
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding: 5px">体积流量(m³/d):</a><input id="dVFlowb" class="easyui-numberbox" data-options="precision:2,groupSeparator:','" style="text-align: right; width: 140px;" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding: 5px">质量流量(kg/s):</a><input id="dMFlowb" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 140px;" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding: 5px">能量流量(MJ/s):</a><input id="dEFlowb" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 140px;" />
|
||||
</div>
|
||||
|
||||
<div id="ddPar" class="easyui-dialog" title="流量中间参数" style="width: 900px; height: 80px; padding: 4px; display: none" data-options="closed:true">
|
||||
<a style="width: 130px; display: inline-block; text-align: right; padding: 5px">工况流量(m³/h):</a><input id="dVFlowf" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 80px; padding: 5px" />
|
||||
<a style="width: 130px; display: inline-block; text-align: right">工况压缩因子:</a><input id="dZf" class="easyui-numberbox" data-options="precision:6" style="text-align: right; width: 80px;" />
|
||||
<a style="width: 130px; display: inline-block; text-align: right">等熵指数:</a><input id="dKappa" class="easyui-numberbox" data-options="precision:6" style="text-align: right; width: 80px;" />
|
||||
<a style="width: 130px; display: inline-block; text-align: right">临界流函数:</a><input id="dCstar" class="easyui-numberbox" data-options="precision:6" style="text-align: right; width: 80px;" />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="south" data-options="region:'south',split:false" style="height: 30px;">
|
||||
<label id="buyMessage" style="color:red " ></label>
|
||||
<label id="message" style="color:red " ></label>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
|
||||
|
||||
$("#CYCS").combobox({
|
||||
onSelect: function (rec) {
|
||||
$('#formPar').form('load', JSON.parse(NGComCon[rec.ID].NGCom));
|
||||
$('#NG_SUM').numberbox('setValue', sumZf());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function SavePar() {
|
||||
saveStr = JSON.stringify(getFormJson('#formPar')); // json对象;
|
||||
// alert(JSON.stringify(saveStr));
|
||||
|
||||
var node = $('#treeWest').tree('getSelected');
|
||||
var jldID = node.ID;
|
||||
if (jldID == "") {
|
||||
$.messager.alert("提示", "请选择计量点后再保存!")
|
||||
return;
|
||||
}
|
||||
if (confirm("确定将计量点参数保存到计量点:" + node.text + "")) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=saveJldPar&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { jldid: node.id, Par: saveStr, gnmk: "PZ" },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
//alert(JSON.stringify(data));
|
||||
|
||||
//$('#formPar').form('load', data);
|
||||
$.messager.alert("提示", data);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
$('#treeWest').tree({
|
||||
formatter: function (node) {
|
||||
|
||||
return '<span title=双击调取计量点数据" class="easyui-tooltip" >' + node.text + '</span>'
|
||||
},
|
||||
onDblClick: function (node) {
|
||||
|
||||
clearForm();
|
||||
initialCom();
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=getJldPar&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { jldid: node.id, gnmk: "PZ" },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
//alert(JSON.stringify(data));
|
||||
|
||||
$('#formPar').form('load', data);
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
function FlowCal() {
|
||||
if ($("#formPar").form('validate')) {
|
||||
|
||||
var NG_par = "";
|
||||
|
||||
if ($('#inP').numberbox('getValue') == "") {
|
||||
alert("请输入压力!");
|
||||
return;
|
||||
}
|
||||
if ($('#JLJZJ').numberbox('getValue') == "") {
|
||||
alert("请输入喉径!");
|
||||
return;
|
||||
}
|
||||
if ($('#inWd').numberbox('getValue') == "") {
|
||||
alert("请输入温度!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
NG_par = "2";//流量计类别
|
||||
NG_par = NG_par + "," + "0";//节流装置类型
|
||||
NG_par = NG_par + "," + "0";//流量计算标准
|
||||
NG_par = NG_par + "," + "0";//压缩因子计算标准
|
||||
NG_par = NG_par + "," + $('#CBTJ').combobox('getValue');//'计量参比条件
|
||||
NG_par = NG_par + "," + "101325";//计量参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//计量参比条件温度
|
||||
NG_par = NG_par + "," + "101325";//燃烧参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//燃烧参比条件温度
|
||||
NG_par = NG_par + "," + $('#DDDQY').numberbox('getValue');//当地大气压
|
||||
NG_par = NG_par + "," + "2";//当地大气压单位
|
||||
NG_par = NG_par + "," + strZf();//天然气组分
|
||||
NG_par = NG_par + "," + "0";//取压方式
|
||||
NG_par = NG_par + "," + "0";//管道类型
|
||||
NG_par = NG_par + "," + $('#GDZJ').numberbox('getValue');//管道内径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//管道内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + $('#GDCZ').combobox('getValue');//管道材料
|
||||
NG_par = NG_par + "," + $('#JLJZJ').numberbox('getValue');//孔板孔径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//孔板内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + $('#JLJCZ').combobox('getValue');//孔板材料
|
||||
NG_par = NG_par + "," + "0";//锐利度系数计算方法
|
||||
NG_par = NG_par + "," + "0";//孔板入口圆弧半径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + $('#inP').numberbox('getValue');//输入压力
|
||||
NG_par = NG_par + "," + "2";//压力单位
|
||||
NG_par = NG_par + "," + "0";//压力类型
|
||||
NG_par = NG_par + "," + $('#inWd').numberbox('getValue');//输入温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//输入差压
|
||||
NG_par = NG_par + "," + "1";//压力单位
|
||||
NG_par = NG_par + "," + "1";//体积流量单位
|
||||
NG_par = NG_par + "," + "2";//质量流量单位
|
||||
NG_par = NG_par + "," + "1";//能量流量单位
|
||||
NG_par = NG_par + "," + $('#LCXS').numberbox('getValue');//喷嘴的流出系数
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/FlowCal.ashx?action=PZCal' + "&t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { Par: NG_par },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
$('#dVFlowb').numberbox('setValue', data[56]);
|
||||
$('#dVFlowf').numberbox('setValue', data[57]);
|
||||
$('#dMFlowb').numberbox('setValue', data[58]);
|
||||
$('#dEFlowb').numberbox('setValue', data[59]);
|
||||
$('#dZf').numberbox('setValue', data[65]);
|
||||
|
||||
$('#dKappa').numberbox('setValue', data[80]);
|
||||
$('#dCstar').numberbox('setValue', data[82]);
|
||||
|
||||
var blEn = setremainTimes('<%=Session ["userAccount"]%>', getQueryString("GNID"));
|
||||
if (blEn == "0") {
|
||||
try {
|
||||
$('#saveBtn').linkbutton('disable');
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#inP').numberbox('disable', true); //设置输入框为禁用
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#NG_C1').numberbox('disable', true); //设置输入框为禁用
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
$.messager.alert('操作提示', '存在必填项为空,请检查!', "warning");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
$('#DDDQY').numberbox('setValue', 0.101325);
|
||||
initialCom();
|
||||
|
||||
|
||||
|
||||
var url = '../../ASHX/getTreeCombox.ashx?action=getJld';
|
||||
getTree($('#treeWest'), url);
|
||||
|
||||
|
||||
$('#NG_C1').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_N2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_CO2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C3').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_H2O').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_H2S').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_H2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_CO').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_O2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_iC4').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_nC4').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_iC5').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_nC5').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C6').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C7').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C8').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C9').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C10').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_He').numberbox({ onChange: function () { sumZf(); } });
|
||||
|
||||
|
||||
if (getQueryString("enable").toString() == "False") {document.getElementById("message").innerHTML = "试用期已过,如有需要请点系统设置->开通功能";
|
||||
$('#saveBtn').linkbutton('disable');
|
||||
$('#inP').numberbox('disable', true); //设置输入框为禁用
|
||||
$('#NG_C1').numberbox('disable', true); //设置输入框为禁用
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
152
NGTools/Pages/A_FLowCal/pzCal.aspx.cs
Normal file
152
NGTools/Pages/A_FLowCal/pzCal.aspx.cs
Normal file
@ -0,0 +1,152 @@
|
||||
using NG_Tools;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NGTools.Pages.A_FLowCal
|
||||
{
|
||||
public partial class pzCal : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (Request.QueryString["action"] == "Cal")
|
||||
{
|
||||
string[] tempPar = Request["Par"].Split(',');
|
||||
|
||||
Flowcal(tempPar);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void Flowcal(string[] par)
|
||||
{
|
||||
|
||||
double[] ngCom = new double[21];
|
||||
double[] tempPar = new double[110];
|
||||
for (int i = 0; i < par.Length; i++)
|
||||
{
|
||||
if (i != 11)
|
||||
{
|
||||
tempPar[i] = double.Parse(par[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int j = 0; j < 21; j++)
|
||||
{
|
||||
ngCom[j] = double.Parse(par[11].Split('_')[j]) / 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
FlowCal NGFLOW = new FlowCal();
|
||||
NG_Cal.FlowParStruct flPar = new NG_Cal.FlowParStruct();
|
||||
NG_Cal.GasPropsSTRUCT gasPar = new NG_Cal.GasPropsSTRUCT();
|
||||
gasPar.adMixture = ngCom;
|
||||
|
||||
UnitConvert MyConvert = new UnitConvert();
|
||||
|
||||
|
||||
flPar.dMeterType = (int)tempPar[0]; //流量计类别
|
||||
flPar.dCoreType = (int)tempPar[1]; //节流装置类型
|
||||
flPar.dFlowCalbz = (int)tempPar[2]; //流量计算标准
|
||||
flPar.dZcalbz = (int)tempPar[3]; //压缩因子计算标准
|
||||
flPar.dCbtj = (int)tempPar[4]; //'计量参比条件
|
||||
flPar.dPb_M = tempPar[5]; //计量参比条件压力
|
||||
flPar.dTb_M = tempPar[6]; //计量参比条件温度
|
||||
flPar.dPb_E = tempPar[7]; //燃烧参比条件压力
|
||||
flPar.dTb_E = tempPar[8]; //燃烧参比条件温度
|
||||
flPar.dPatmUnit = (int)tempPar[10]; //当地大气压单位
|
||||
flPar.dPatm = MyConvert.Converter("yl", tempPar[9], flPar.dPatmUnit, 0, 4); ; //当地大气压
|
||||
flPar.dNG_Compents = gasPar.adMixture; //天然气组分
|
||||
flPar.dPtmode = (int)tempPar[12]; //取压方式
|
||||
flPar.dPipeType = (int)tempPar[13]; //管道类型
|
||||
flPar.dPipeD = tempPar[14]/1000; //管道内径
|
||||
flPar.dLenUnit = (int)tempPar[15]; //长度单位
|
||||
flPar.dPipeDtemp = tempPar[16]; //管道内径参考温度
|
||||
flPar.dPileDtempUint = (int)tempPar[17]; //温度单位
|
||||
flPar.dPipeMaterial = (int)tempPar[18]; //管道材料
|
||||
flPar.dOrificeD = tempPar[19]/1000; //喷嘴喉径换算成米
|
||||
flPar.dOrificeUnit = (int)tempPar[20]; //长度单位
|
||||
flPar.dOrificeDtemp = tempPar[21]; //孔板内径参考温度
|
||||
flPar.dOrificeDtempUnit = (int)tempPar[22]; //温度单位
|
||||
flPar.dOrificeMaterial = (int)tempPar[23]; //孔板材料
|
||||
flPar.dOrificeSharpness = (int)tempPar[24]; //锐利度系数计算方法
|
||||
flPar.dOrificeRk = tempPar[25]; //孔板入口圆弧半径
|
||||
flPar.dOrificeRkLenUint = (int)tempPar[26]; //长度单位
|
||||
flPar.dPfUnit = (int)tempPar[28]; //压力单位
|
||||
flPar.dPf = MyConvert.Converter("yl", tempPar[27], flPar.dPfUnit, 0, 4); //输入压力
|
||||
flPar.dPfType = (int)tempPar[29]; //压力类型
|
||||
flPar.dTfUnit = (int)tempPar[31]; //温度单位
|
||||
flPar.dTf = MyConvert.Converter("wd", tempPar[30], flPar.dTfUnit, 1, 4); //输入温度
|
||||
flPar.dDpUnit = (int)tempPar[33]; //压力单位
|
||||
flPar.dDp = MyConvert.Converter("yl", tempPar[32], flPar.dDpUnit, 0, 4); //输入压力; //输入差压
|
||||
flPar.dVFlowUnit = (int)tempPar[34]; //体积流量单位
|
||||
flPar.dMFlowUnit = (int)tempPar[35]; //质量流量单位
|
||||
flPar.dEFlowUnit = (int)tempPar[36]; //能量流量单位
|
||||
flPar.dCd = tempPar[37]; //流出系数
|
||||
|
||||
|
||||
//将压力换算为绝压
|
||||
if (flPar.dPfType == 0)
|
||||
{
|
||||
flPar.dPf = flPar.dPf + flPar.dPatm;
|
||||
}
|
||||
|
||||
gasPar.dCbtj = flPar.dCbtj;
|
||||
gasPar.dPf = flPar.dPf;
|
||||
gasPar.dTf = flPar.dTf;
|
||||
|
||||
switch (gasPar.dCbtj)
|
||||
{
|
||||
case 2:
|
||||
gasPar.dPb = 101325;
|
||||
gasPar.dTb = 273.15;
|
||||
break;
|
||||
case 1:
|
||||
gasPar.dPb = 101325;
|
||||
gasPar.dTb = 288.15;
|
||||
break;
|
||||
case 0:
|
||||
gasPar.dPb = 101325;
|
||||
gasPar.dTb = 293.15;
|
||||
break;
|
||||
}
|
||||
|
||||
NG_Tools.NG_Cal NG_Cal = new NG_Cal();
|
||||
NG_Cal.Crit(ref gasPar, 0.0);
|
||||
|
||||
NGFLOW.NozellFLowCal(ref gasPar, ref flPar);
|
||||
|
||||
|
||||
|
||||
tempPar[56] = flPar.dVFlowb * 86400;
|
||||
tempPar[57] = flPar.dVFlowf * 3600;
|
||||
tempPar[58] = flPar.dMFlowb;
|
||||
tempPar[59] = flPar.dEFlowb;
|
||||
|
||||
tempPar[65] = gasPar.dZf;
|
||||
tempPar[80] = gasPar.dKappa;
|
||||
tempPar[82] = gasPar.dCstar;
|
||||
|
||||
|
||||
|
||||
|
||||
StringBuilder Json = new StringBuilder();
|
||||
Json.Append("[");
|
||||
for (int i = 0; i < tempPar.Length; i++)
|
||||
{
|
||||
Json.Append(tempPar[i].ToString() + ",");
|
||||
}
|
||||
string json = (Json.Replace(",", "", Json.Length - 1, 1).Append("]")).ToString();
|
||||
|
||||
Response.Write(json);
|
||||
Response.End();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
15
NGTools/Pages/A_FLowCal/pzCal.aspx.designer.cs
generated
Normal file
15
NGTools/Pages/A_FLowCal/pzCal.aspx.designer.cs
generated
Normal file
@ -0,0 +1,15 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NGTools.Pages.A_FLowCal {
|
||||
|
||||
|
||||
public partial class pzCal {
|
||||
}
|
||||
}
|
359
NGTools/Pages/A_FLowCal/suduCal.aspx
Normal file
359
NGTools/Pages/A_FLowCal/suduCal.aspx
Normal file
@ -0,0 +1,359 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="suduCal.aspx.cs" Inherits="NGTools.Pages.A_FLowCal.suduCal" %>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" />
|
||||
<meta name="renderer" content="webkit|ie-comp|ie-stand" />
|
||||
<title>流量计算</title>
|
||||
|
||||
<!--2个样式表文件-->
|
||||
<link rel="stylesheet" type="text/css" href="../../Scripts/EASYUI/themes/default/easyui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../Scripts/EASYUI/themes/icon.css" />
|
||||
<!--2个js文件 ,要先引入jquery,然后再引入easyui-->
|
||||
<script src="../../Scripts/EASYUI/jquery.min.js"></script>
|
||||
<script src="../../Scripts/EASYUI/jquery.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="../../Scripts/EASYUI/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="../../Scripts/EASYUI/base-loading.js"></script>
|
||||
<script src="../../Scripts/EASYUI/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
|
||||
<script src="../../MYJS/MyTools.js"></script>
|
||||
<script src="../../MYJS/constant.js"></script>
|
||||
</head>
|
||||
<body class="easyui-layout">
|
||||
|
||||
<div id="west"data-options="region:'west', split:true" title="计量点列表" style="width: 200px;">
|
||||
<div id="treeWest" style="width: 300px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="center"data-options="region:'center', split:true" title="">
|
||||
<form id="formPar" method="post" class="easyui-form">
|
||||
<div>
|
||||
<div id="btn" title="" class="easyui-panel" style="width: 900px; height: 55px; padding: 10px; text-align: center">
|
||||
<a id="CalFlow" href="javascript:void(0)" class="easyui-linkbutton c1" onclick=" FlowCal()" style="width: 130px">流量计算</a>
|
||||
<a id="saveBtn" href="javascript:void(0)" class="easyui-linkbutton c1" onclick=" SavePar()" style="width: 130px">保存计量点参数</a>
|
||||
<a id="Draw" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="$('#ddPar').dialog('open')" style="width: 130px">查看中间参数</a>
|
||||
</div>
|
||||
<div id="NGRun" class="easyui-panel" title="工况参数" style="width: 900px; height: 110px; padding: 5px;">
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding-bottom: 5px; padding-top: 5px">表压力(MPa):</a><input required="required" name="inP" id="inP" class="easyui-numberbox" data-options="precision:5" style="border-color: #FF0000; text-align: right; width: 120px; background-color: #0099CC;" value="1.48" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding-bottom: 5px; padding-top: 5px">温度(℃):</a><input required="required" name="inWd" id="inWd" class="easyui-numberbox" data-options="precision:3" style="text-align: right; width: 120px;" value="20" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding-bottom: 5px; padding-top: 5px">脉冲数:</a><input required="required" name="MCS" id="MCS" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px;" value="12.5" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding-bottom: 5px; padding-top: 5px">仪表系数:</a><input required="required" name="YBXS" id="YBXS" class="easyui-numberbox" data-options="precision:2" style="text-align: right; width: 120px;" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding-bottom: 5px; padding-top: 5px">当地大气压(MPa):</a><input required="required" name="DDDQY" id="DDDQY" class="easyui-numberbox" data-options="precision:6" style="text-align: right; width: 120px;" />
|
||||
<a style="width: 140px; display: inline-block; text-align: right; padding-bottom: 5px; padding-top: 5px">参比条件:</a><input required="required" name="CBTJ" id="CBTJ" class="combobox" style="text-align: right; width: 170px;" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="NGPar" class="easyui-panel" title="天然气组成" style="width: 900px; height: 240px; padding: 5px;" data-options="collapsible:true">
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">甲烷C1:</a>
|
||||
<input required="required" name="NG_C1" id="NG_C1" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" value="0" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氮气N2:</a>
|
||||
<input required="required" name="NG_N2" id="NG_N2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">二氧化碳CO2:</a>
|
||||
<input required="required" name="NG_CO2" id="NG_CO2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">乙烷C2:</a>
|
||||
<input required="required" name="NG_C2" id="NG_C2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">丙烷C3:</a>
|
||||
<input required="required" name="NG_C3" id="NG_C3" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">水H2O:</a>
|
||||
<input required="required" name="NG_H2O" id="NG_H2O" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">硫化氢H2S:</a>
|
||||
<input required="required" name="NG_H2S" id="NG_H2S" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氢气H2:</a>
|
||||
<input required="required" name="NG_H2" id="NG_H2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">一氧化碳CO:</a>
|
||||
<input required="required" name="NG_CO" id="NG_CO" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氧气O2:</a>
|
||||
<input required="required" name="NG_O2" id="NG_O2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">异丁烷iC4:</a>
|
||||
<input required="required" name="NG_iC4" id="NG_iC4" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">正丁烷nC4:</a>
|
||||
<input required="required" name="NG_nC4" id="NG_nC4" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">异戊烷iC5:</a>
|
||||
<input required="required" name="NG_iC5" id="NG_iC5" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">正戊烷nC5:</a>
|
||||
<input required="required" name="NG_nC5" id="NG_nC5" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">己烷C6:</a>
|
||||
<input required="required" name="NG_C6" id="NG_C6" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">庚烷C7:</a>
|
||||
<input required="required" name="NG_C7" id="NG_C7" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">辛烷C8:</a>
|
||||
<input required="required" name="NG_C8" id="NG_C8" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">壬烷C9:</a>
|
||||
<input required="required" name="NG_C9" id="NG_C9" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">癸烷C10:</a>
|
||||
<input required="required" name="NG_C10" id="NG_C10" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氦气He:</a>
|
||||
<input required="required" name="NG_He" id="NG_He" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氩气Ar:</a>
|
||||
<input required="required" name="NG_Ar" id="NG_Ar" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">合计:</a>
|
||||
<input required="required" name="NGCom" id="NG_SUM" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
|
||||
<a id="Default" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="Zore()" style="text-align: center; width: 80px">全部清零</a>
|
||||
<a id="copyBtn" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="copyZf()" style="text-align: center; width: 60px">复制</a>
|
||||
<a id="pasteBtn" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="pasteZf()" style="text-align: center; width: 60px">粘贴</a>
|
||||
<a style="width: 80px; display: inline-block; text-align: right">常用参数:</a><input id="CYCS" class="easyui-combobox" onclick="NG_Default()" style="text-align: right; width: 140px;" />
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<div id="Result" class="easyui-panel" title="参比条件的计算结果" style="width: 900px; height: 75px; padding: 5px;">
|
||||
<a style="width: 125px; display: inline-block; text-align: right; padding: 5px">体积流量(m³/d):</a><input id="dVFlowb" class="easyui-numberbox" data-options="precision:2,groupSeparator:','" style="text-align: right; width: 85px;" />
|
||||
<a style="width: 125px; display: inline-block; text-align: right; padding: 5px">质量流量(kg/s):</a><input id="dMFlowb" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 85px;" />
|
||||
<a style="width: 125px; display: inline-block; text-align: right; padding: 5px">能量流量(MJ/s):</a><input id="dEFlowb" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 85px;" />
|
||||
<a style="width: 125px; display: inline-block; text-align: right; padding: 5px">工况流量(m³/h):</a><input id="dVFlowf" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 85px; padding: 5px" />
|
||||
</div>
|
||||
|
||||
<div id="ddPar" class="easyui-dialog" title="流量中间参数" style="width: 900px; height: 220px; padding: 4px; display: none" data-options="closed:true">
|
||||
<a style="width: 125px; display: inline-block; text-align: right; padding: 5px">标况压缩因子:</a><input id="dZb" class="easyui-numberbox" data-options="precision:6" style="text-align: right; width: 90px; padding: 5px;" />
|
||||
<a style="width: 125px; display: inline-block; text-align: right; padding: 5px">工况压缩因子:</a><input id="dZf" class="easyui-numberbox" data-options="precision:6" style="text-align: right; width: 90px; padding: 5px;" />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div id="south" data-options="region:'south',split:false" style="height: 30px;">
|
||||
<label id="buyMessage" style="color:red " ></label>
|
||||
<label id="message" style="color:red " ></label>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
$("#CYCS").combobox({
|
||||
onSelect: function (rec) {
|
||||
$('#formPar').form('load', JSON.parse(NGComCon[rec.ID].NGCom));
|
||||
$('#NG_SUM').numberbox('setValue', sumZf());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function SavePar() {
|
||||
saveStr = JSON.stringify(getFormJson('#formPar')); // json对象;
|
||||
//alert(JSON.stringify(saveStr));
|
||||
|
||||
var node = $('#treeWest').tree('getSelected');
|
||||
var jldID = node.ID;
|
||||
if (jldID == "") {
|
||||
$.messager.alert("提示", "请选择计量点后再保存!")
|
||||
return;
|
||||
}
|
||||
if (confirm("确定将计量点参数保存到计量点:" + node.text + "")) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=saveJldPar&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { jldid: node.id, Par: saveStr, gnmk: "SD" },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
//alert(JSON.stringify(data));
|
||||
|
||||
$('#formPar').form('load', data);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
$('#treeWest').tree({
|
||||
formatter: function (node) {
|
||||
|
||||
return '<span title=双击调取计量点数据" class="easyui-tooltip" >' + node.text + '</span>'
|
||||
},
|
||||
onDblClick: function (node) {
|
||||
|
||||
clearForm();
|
||||
initialCom();
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=getJldPar&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { jldid: node.id, gnmk: "SD" },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
//alert(JSON.stringify(data));
|
||||
|
||||
$('#formPar').form('load', data);
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function FlowCal() {
|
||||
|
||||
if ($("#formPar").form('validate')) {
|
||||
|
||||
|
||||
var NG_par = "";
|
||||
|
||||
if ($('#inP').numberbox('getValue') == "") {
|
||||
alert("请输入压力!");
|
||||
return;
|
||||
}
|
||||
if ($('#MCS').numberbox('getValue') == "") {
|
||||
alert("请输入脉冲数!");
|
||||
return;
|
||||
}
|
||||
if ($('#inWd').numberbox('getValue') == "") {
|
||||
alert("请输入温度!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
NG_par = "1";//0 差压式 1 速度式 流量计类别
|
||||
NG_par = NG_par + "," + "0";//节流装置类型
|
||||
NG_par = NG_par + "," + "0";//流量计算标准
|
||||
NG_par = NG_par + "," + "0";//压缩因子计算标准
|
||||
NG_par = NG_par + "," + $('#CBTJ').combobox('getValue');//'计量参比条件
|
||||
NG_par = NG_par + "," + "101325";//计量参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//计量参比条件温度
|
||||
NG_par = NG_par + "," + "101325";//燃烧参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//燃烧参比条件温度
|
||||
NG_par = NG_par + "," + $('#DDDQY').numberbox('getValue');//当地大气压
|
||||
NG_par = NG_par + "," + "2";//当地大气压单位
|
||||
NG_par = NG_par + "," + strZf();//天然气组分
|
||||
NG_par = NG_par + "," + "0";//取压方式
|
||||
NG_par = NG_par + "," + "0";//管道类型
|
||||
NG_par = NG_par + "," + "0";//仪表内径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//管道内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//管道材料
|
||||
NG_par = NG_par + "," + "0";//孔板孔径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//孔板内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//孔板材料
|
||||
NG_par = NG_par + "," + "0";//锐利度系数计算方法
|
||||
NG_par = NG_par + "," + "0";//孔板入口圆弧半径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + $('#inP').numberbox('getValue');//输入压力
|
||||
NG_par = NG_par + "," + "2";//压力单位
|
||||
NG_par = NG_par + "," + "0";//压力类型
|
||||
NG_par = NG_par + "," + $('#inWd').numberbox('getValue');//输入温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + $('#MCS').numberbox('getValue');//输入脉冲数
|
||||
NG_par = NG_par + "," + "1";//压力单位
|
||||
NG_par = NG_par + "," + "1";//体积流量单位
|
||||
NG_par = NG_par + "," + "2";//质量流量单位
|
||||
NG_par = NG_par + "," + "1";//能量流量单位
|
||||
NG_par = NG_par + "," + $('#YBXS').numberbox('getValue');//仪表系数
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/FlowCal.ashx?action=SDCal&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { Par: NG_par },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
$('#dVFlowb').numberbox('setValue', data[56]);
|
||||
$('#dVFlowf').numberbox('setValue', data[57]);
|
||||
$('#dMFlowb').numberbox('setValue', data[58]);
|
||||
$('#dEFlowb').numberbox('setValue', data[59]);
|
||||
|
||||
$('#dZb').numberbox('setValue', data[64]);
|
||||
$('#dZf').numberbox('setValue', data[65]);
|
||||
|
||||
|
||||
setremainTimes('<%=Session ["userAccount"]%>', getQueryString("GNID"));
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
else {
|
||||
$.messager.alert('操作提示', '存在必填项为空,请检查!', "warning");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
initialCom();
|
||||
|
||||
$('#DDDQY').numberbox('setValue', 0.101325);
|
||||
|
||||
var url = '../../ASHX/getTreeCombox.ashx?action=getJld';
|
||||
getTree($('#treeWest'), url);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$('#NG_C1').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_N2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_CO2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C3').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_H2O').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_H2S').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_H2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_CO').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_O2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_iC4').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_nC4').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_iC5').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_nC5').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C6').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C7').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C8').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C9').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C10').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_He').numberbox({ onChange: function () { sumZf(); } });
|
||||
|
||||
|
||||
if (getQueryString("enable").toString() == "False") {document.getElementById("message").innerHTML = "试用期已过,如有需要请点系统设置->开通功能";
|
||||
try {
|
||||
$('#saveBtn').linkbutton('disable');
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#inP').numberbox('disable', true); //设置输入框为禁用
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#NG_C1').numberbox('disable', true); //设置输入框为禁用
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
148
NGTools/Pages/A_FLowCal/suduCal.aspx.cs
Normal file
148
NGTools/Pages/A_FLowCal/suduCal.aspx.cs
Normal file
@ -0,0 +1,148 @@
|
||||
using NG_Tools;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NGTools.Pages.A_FLowCal
|
||||
{
|
||||
public partial class suduCal : System.Web.UI.Page
|
||||
{
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (Request.QueryString["action"] == "Cal")
|
||||
{
|
||||
string[] tempPar = Request["Par"].Split(',');
|
||||
|
||||
Flowcal(tempPar);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void Flowcal(string[] par)
|
||||
{
|
||||
|
||||
double[] ngCom = new double[21];
|
||||
double[] tempPar = new double[110];
|
||||
for (int i = 0; i < par.Length; i++)
|
||||
{
|
||||
if (i != 11)
|
||||
{
|
||||
tempPar[i] = double.Parse(par[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int j = 0; j < 21; j++)
|
||||
{
|
||||
ngCom[j] = double.Parse(par[11].Split('_')[j]) / 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
FlowCal NGFLOW = new FlowCal();
|
||||
NG_Cal.FlowParStruct flPar = new NG_Cal.FlowParStruct();
|
||||
NG_Cal.GasPropsSTRUCT gasPar = new NG_Cal.GasPropsSTRUCT();
|
||||
gasPar.adMixture = ngCom;
|
||||
|
||||
UnitConvert MyConvert = new UnitConvert();
|
||||
|
||||
|
||||
flPar.dMeterType = (int)tempPar[0]; //流量计类别
|
||||
flPar.dCoreType = (int)tempPar[1]; //节流装置类型
|
||||
flPar.dFlowCalbz = (int)tempPar[2]; //流量计算标准
|
||||
flPar.dZcalbz = (int)tempPar[3]; //压缩因子计算标准
|
||||
flPar.dCbtj = (int)tempPar[4]; //'计量参比条件
|
||||
flPar.dPb_M = tempPar[5]; //计量参比条件压力
|
||||
flPar.dTb_M = tempPar[6]; //计量参比条件温度
|
||||
flPar.dPb_E = tempPar[7]; //燃烧参比条件压力
|
||||
flPar.dTb_E = tempPar[8]; //燃烧参比条件温度
|
||||
flPar.dPatmUnit = (int)tempPar[10]; //当地大气压单位
|
||||
flPar.dPatm = MyConvert.Converter("yl", tempPar[9], flPar.dPatmUnit, 0, 4); ; //当地大气压
|
||||
flPar.dNG_Compents = gasPar.adMixture; //天然气组分
|
||||
flPar.dPtmode = (int)tempPar[12]; //取压方式
|
||||
flPar.dPipeType = (int)tempPar[13]; //管道类型
|
||||
flPar.dPipeD = tempPar[14]; //管道内径
|
||||
flPar.dLenUnit = (int)tempPar[15]; //长度单位
|
||||
flPar.dPipeDtemp = tempPar[16]; //管道内径参考温度
|
||||
flPar.dPileDtempUint = (int)tempPar[17]; //温度单位
|
||||
flPar.dPipeMaterial = (int)tempPar[18]; //管道材料
|
||||
flPar.dOrificeD = tempPar[19]; //孔板孔径
|
||||
flPar.dOrificeUnit = (int)tempPar[20]; //长度单位
|
||||
flPar.dOrificeDtemp = tempPar[21]; //孔板内径参考温度
|
||||
flPar.dOrificeDtempUnit = (int)tempPar[22]; //温度单位
|
||||
flPar.dOrificeMaterial = (int)tempPar[23]; //孔板材料
|
||||
flPar.dOrificeSharpness = (int)tempPar[24]; //锐利度系数计算方法
|
||||
flPar.dOrificeRk = tempPar[25]; //孔板入口圆弧半径
|
||||
flPar.dOrificeRkLenUint = (int)tempPar[26]; //长度单位
|
||||
flPar.dPfUnit = (int)tempPar[28]; //压力单位
|
||||
flPar.dPf = MyConvert.Converter("yl", tempPar[27], flPar.dPfUnit, 0, 4); //输入压力
|
||||
flPar.dPfType = (int)tempPar[29]; //压力类型
|
||||
flPar.dTfUnit = (int)tempPar[31]; //温度单位
|
||||
flPar.dTf = MyConvert.Converter("wd", tempPar[30], flPar.dTfUnit, 1, 4); //输入温度
|
||||
flPar.dMeterFactor = (int)tempPar[37]; //仪表系数
|
||||
flPar.dPulseNum = tempPar[32]; //脉冲数
|
||||
flPar.dVFlowUnit = (int)tempPar[34]; //体积流量单位
|
||||
flPar.dMFlowUnit = (int)tempPar[35]; //质量流量单位
|
||||
flPar.dEFlowUnit = (int)tempPar[36]; //能量流量单位
|
||||
|
||||
|
||||
|
||||
//将压力换算为绝压
|
||||
if (flPar.dPfType == 0)
|
||||
{
|
||||
flPar.dPf = flPar.dPf + flPar.dPatm;
|
||||
}
|
||||
|
||||
gasPar.dCbtj = flPar.dCbtj;
|
||||
gasPar.dPf = flPar.dPf;
|
||||
gasPar.dTf = flPar.dTf;
|
||||
|
||||
switch (gasPar.dCbtj)
|
||||
{
|
||||
case 2:
|
||||
gasPar.dPb = 101325;
|
||||
gasPar.dTb = 273.15;
|
||||
break;
|
||||
case 1:
|
||||
gasPar.dPb = 101325;
|
||||
gasPar.dTb = 288.15;
|
||||
break;
|
||||
case 0:
|
||||
gasPar.dPb = 101325;
|
||||
gasPar.dTb = 293.15;
|
||||
break;
|
||||
}
|
||||
|
||||
NG_Tools.NG_Cal NG_Cal = new NG_Cal();
|
||||
NG_Cal.Crit(ref gasPar, 0.0);
|
||||
|
||||
NGFLOW.SdFlowCal(ref gasPar, ref flPar);
|
||||
|
||||
|
||||
|
||||
tempPar[56] = flPar.dVFlowb * 86400;
|
||||
tempPar[57] = flPar.dVFlowf * 3600;
|
||||
tempPar[58] = flPar.dMFlowb;
|
||||
tempPar[59] = flPar.dEFlowb;
|
||||
tempPar[64] = gasPar.dZb;
|
||||
tempPar[65] = gasPar.dZf;
|
||||
|
||||
|
||||
StringBuilder Json = new StringBuilder();
|
||||
Json.Append("[");
|
||||
for (int i = 0; i < tempPar.Length; i++)
|
||||
{
|
||||
Json.Append(tempPar[i].ToString() + ",");
|
||||
}
|
||||
string json = (Json.Replace(",", "", Json.Length - 1, 1).Append("]")).ToString();
|
||||
|
||||
Response.Write(json);
|
||||
Response.End();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
15
NGTools/Pages/A_FLowCal/suduCal.aspx.designer.cs
generated
Normal file
15
NGTools/Pages/A_FLowCal/suduCal.aspx.designer.cs
generated
Normal file
@ -0,0 +1,15 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NGTools.Pages.A_FLowCal {
|
||||
|
||||
|
||||
public partial class suduCal {
|
||||
}
|
||||
}
|
522
NGTools/Pages/B_YSYZ/Z_Table_Cal.aspx
Normal file
522
NGTools/Pages/B_YSYZ/Z_Table_Cal.aspx
Normal file
@ -0,0 +1,522 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Z_Table_Cal.aspx.cs" Inherits="NGTools.Pages.B_YSYZ.Z_Table_Cal" %>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" />
|
||||
<meta name="renderer" content="webkit|ie-comp|ie-stand" />
|
||||
<title>流量计算</title>
|
||||
|
||||
<!--2个样式表文件-->
|
||||
<link rel="stylesheet" type="text/css" href="../../Scripts/EASYUI/themes/default/easyui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../Scripts/EASYUI/themes/icon.css" />
|
||||
<!--2个js文件 ,要先引入jquery,然后再引入easyui-->
|
||||
<script src="../../Scripts/EASYUI/jquery.min.js"></script>
|
||||
<script src="../../Scripts/EASYUI/jquery.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="../../Scripts/EASYUI/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="../../Scripts/EASYUI/base-loading.js"></script>
|
||||
<script src="../../Scripts/EASYUI/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
|
||||
<script src="../../MYJS/MyTools.js"></script>
|
||||
<script src="../../MYJS/constant.js"></script>
|
||||
|
||||
</head>
|
||||
<body class="easyui-layout">
|
||||
|
||||
<div id="west" data-options="region:'west', split:true" title="计量点列表" style="width: 200px;">
|
||||
<div id="treeWest" style="width: 300px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="center" data-options="region:'center', split:true" title="">
|
||||
<form id="formPar" class="easyui-form">
|
||||
<div id="btn" title="" class="easyui-panel" style="width: 900px; height: 55px; padding: 10px; text-align: center">
|
||||
<a id="CalFlow" href="javascript:void(0)" class="easyui-linkbutton c1" onclick=" FlowCal()" style="width: 130px">压缩因子表格计算</a>
|
||||
<a id="saveBtn" href="javascript:void(0)" class="easyui-linkbutton c1" onclick=" SavePar()" style="width: 130px">保存计量点参数</a>
|
||||
<a id="ExportXls" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="EasyUIDataGridToExcle()" style="width: 130px">导出计算表格</a>
|
||||
</div>
|
||||
<div>
|
||||
<div id="pp" class="easyui-progressbar" data-options="value:0" style="width: 900px; height: 5px"></div>
|
||||
</div>
|
||||
<div id="NGRun" class="easyui-panel" title="工况参数" style="width: 900px; height: 140px; padding: 5px;">
|
||||
<a style="width: 130px; display: inline-block; text-align: right; padding: 5px">起始压力(MPa):</a><input required="required" name="inP" id="inP" class="easyui-numberbox" data-options="precision:3" style="border-color: #FF0000; text-align: right; padding: 5px; width: 130px; background-color: #0099CC;" value="0" />
|
||||
<a style="width: 130px; display: inline-block; text-align: right; padding: 5px">起始温度(℃):</a><input required="required" name="inWd" id="inWd" class="easyui-numberbox" data-options="precision:3" style="text-align: right; padding: 5px; width: 130px;" value="-10" />
|
||||
<a style="width: 130px; display: inline-block; text-align: right; padding: 5px">大气压(MPa):</a><input required="required" name="DDDQY" id="DDDQY" class="easyui-numberbox" data-options="precision:6" style="text-align: right; padding: 5px; width: 130px;" />
|
||||
<a style="width: 130px; display: inline-block; text-align: right; padding: 5px">压力间隔(MPa):</a><input required="required" name="yljg" id="yljg" class="easyui-numberbox" data-options="precision:2" style="border-color: #FF0000; text-align: right; padding: 5px; width: 130px; background-color: #0099CC;" value="0.1" />
|
||||
<a style="width: 130px; display: inline-block; text-align: right; padding: 5px">温度间隔(MPa):</a><input required="required" name="wdjg" id="wdjg" class="easyui-numberbox" data-options="precision:2" style="text-align: right; padding: 5px; width: 130px;" value="1" />
|
||||
<a style="width: 130px; display: inline-block; text-align: right; padding: 5px">参比条件:</a><input required="required" name="CBTJ" id="CBTJ" class="easyui-combobox" style="text-align: right; padding: 5px; width: 150px;" />
|
||||
<a style="width: 130px; display: inline-block; text-align: right; padding: 5px">终止压力(MPa):</a><input required="required" name="inPe" id="inPe" class="easyui-numberbox" data-options="precision:3" style="border-color: #FF0000; text-align: right; padding: 5px; width: 130px; background-color: #0099CC;" value="10" />
|
||||
<a style="width: 130px; display: inline-block; text-align: right; padding: 5px">终止温度(℃):</a><input required="required" name="inWde" id="inWde" class="easyui-numberbox" data-options="precision:3" style="text-align: right; padding: 5px; width: 130px;" value="50" />
|
||||
</div>
|
||||
|
||||
<div id="NGPar" class="easyui-panel" title="天然气组成" style="width: 900px; height: 240px; padding: 5px;" data-options="collapsible:true">
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">甲烷C1:</a>
|
||||
<input required="required" name="NG_C1" id="NG_C1" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" value="0" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氮气N2:</a>
|
||||
<input required="required" name="NG_N2" id="NG_N2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">二氧化碳CO2:</a>
|
||||
<input required="required" name="NG_CO2" id="NG_CO2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">乙烷C2:</a>
|
||||
<input required="required" name="NG_C2" id="NG_C2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">丙烷C3:</a>
|
||||
<input required="required" name="NG_C3" id="NG_C3" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">水H2O:</a>
|
||||
<input required="required" name="NG_H2O" id="NG_H2O" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">硫化氢H2S:</a>
|
||||
<input required="required" name="NG_H2S" id="NG_H2S" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氢气H2:</a>
|
||||
<input required="required" name="NG_H2" id="NG_H2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">一氧化碳CO:</a>
|
||||
<input required="required" name="NG_CO" id="NG_CO" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氧气O2:</a>
|
||||
<input required="required" name="NG_O2" id="NG_O2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">异丁烷iC4:</a>
|
||||
<input required="required" name="NG_iC4" id="NG_iC4" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">正丁烷nC4:</a>
|
||||
<input required="required" name="NG_nC4" id="NG_nC4" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">异戊烷iC5:</a>
|
||||
<input required="required" name="NG_iC5" id="NG_iC5" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">正戊烷nC5:</a>
|
||||
<input required="required" name="NG_nC5" id="NG_nC5" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">己烷C6:</a>
|
||||
<input required="required" name="NG_C6" id="NG_C6" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">庚烷C7:</a>
|
||||
<input required="required" name="NG_C7" id="NG_C7" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">辛烷C8:</a>
|
||||
<input required="required" name="NG_C8" id="NG_C8" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">壬烷C9:</a>
|
||||
<input required="required" name="NG_C9" id="NG_C9" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">癸烷C10:</a>
|
||||
<input required="required" name="NG_C10" id="NG_C10" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氦气He:</a>
|
||||
<input required="required" name="NG_He" id="NG_He" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<br />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氩气Ar:</a>
|
||||
<input required="required" name="NG_Ar" id="NG_Ar" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">合计:</a>
|
||||
<input required="required" name="NGCom" id="NG_SUM" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
||||
|
||||
<a id="Default" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="Zore()" style="text-align: center; width: 80px">全部清零</a>
|
||||
<a id="copyBtn" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="copyZf()" style="text-align: center; width: 60px">复制</a>
|
||||
<a id="pasteBtn" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="pasteZf()" style="text-align: center; width: 60px">粘贴</a>
|
||||
<a style="width: 80px; display: inline-block; text-align: right">常用参数:</a><input id="CYCS" class="easyui-combobox" onclick="NG_Default()" style="text-align: right; width: 140px;" />
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="Result" class="easyui-panel" title="天然气压缩因子表格" style="width: 900px; height: 300px; padding: 5px;" data-options="collapsible:true">
|
||||
<table id="dg" style="width: 900px; height: auto" data-options="
|
||||
singleSelect:true">
|
||||
<thead>
|
||||
<tr>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="south" data-options="region:'south',split:false" style="height: 30px;">
|
||||
<label id="buyMessage" style="color: red"></label>
|
||||
<label id="message" style="color: red"></label>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
|
||||
var boolEnableTime = false;
|
||||
|
||||
var timers = setInterval(function () {
|
||||
//if (boolEnableTime) {
|
||||
var value = $('#pp').progressbar('getValue');
|
||||
if (value < 100) {
|
||||
value += 0.1;
|
||||
//alert(value);
|
||||
$('#pp').progressbar('setValue', value);
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// //clearInterval(times);
|
||||
//}
|
||||
}, 200);
|
||||
|
||||
|
||||
|
||||
$("#CYCS").combobox({
|
||||
onSelect: function (rec) {
|
||||
$('#formPar').form('load', JSON.parse(NGComCon[rec.ID].NGCom));
|
||||
$('#NG_SUM').numberbox('setValue', sumZf());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function SavePar() {
|
||||
saveStr = JSON.stringify(getFormJson('#formPar')); // json对象;
|
||||
// alert(JSON.stringify(saveStr));
|
||||
|
||||
var node = $('#treeWest').tree('getSelected');
|
||||
var jldID = node.ID;
|
||||
if (jldID == "") {
|
||||
$.messager.alert("提示", "请选择计量点后再保存!")
|
||||
return;
|
||||
}
|
||||
if (confirm("确定将计量点参数保存到计量点:" + node.text + "")) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=saveJldPar&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { jldid: node.id, Par: saveStr, gnmk: "ZT" },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
//alert(JSON.stringify(data));
|
||||
|
||||
//$('#formPar').form('load', data);
|
||||
$.messager.alert("提示", data);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
$('#treeWest').tree({
|
||||
formatter: function (node) {
|
||||
|
||||
return '<span title=双击调取计量点数据" class="easyui-tooltip" >' + node.text + '</span>'
|
||||
},
|
||||
onDblClick: function (node) {
|
||||
|
||||
clearForm();
|
||||
initialCom();
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/getTreeCombox.ashx?action=getJldPar&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { jldid: node.id, gnmk: "ZT" },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
|
||||
//alert(JSON.stringify(data));
|
||||
|
||||
$('#formPar').form('load', data);
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
function FlowCal() {
|
||||
|
||||
if ($("#formPar").form('validate')) {
|
||||
|
||||
|
||||
try {
|
||||
$('#dg').datagrid('loadData', []);
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
var NG_par = "";
|
||||
if ($('#inP').numberbox('getValue') == "") {
|
||||
alert("请输入表压力!");
|
||||
return;
|
||||
}
|
||||
if ($('#inWd').numberbox('getValue') == "") {
|
||||
alert("请输入温度!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Math.abs(sumZf() - 100) > 0.001) { $.messager.alert("提示", "组分和不为100%,请检查!"); return; }
|
||||
NG_par = "0";//流量计类别
|
||||
NG_par = NG_par + "," + "0";//节流装置类型
|
||||
NG_par = NG_par + "," + "0";//流量计算标准
|
||||
NG_par = NG_par + "," + "0";//压缩因子计算标准
|
||||
NG_par = NG_par + "," + $('#CBTJ').combobox('getValue');//'计量参比条件
|
||||
NG_par = NG_par + "," + "101325";//计量参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//计量参比条件温度
|
||||
NG_par = NG_par + "," + "101325";//燃烧参比条件压力
|
||||
NG_par = NG_par + "," + "293.15";//燃烧参比条件温度
|
||||
NG_par = NG_par + "," + $('#DDDQY').numberbox('getValue');//当地大气压
|
||||
NG_par = NG_par + "," + "2";//当地大气压单位
|
||||
NG_par = NG_par + "," + strZf();//天然气组分
|
||||
NG_par = NG_par + "," + "0";//取压方式
|
||||
NG_par = NG_par + "," + "0";//管道类型
|
||||
NG_par = NG_par + "," + "150";//管道内径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//管道内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//管道材料
|
||||
NG_par = NG_par + "," + "50";//孔板孔径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + "20";//孔板内径参考温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//孔板材料
|
||||
NG_par = NG_par + "," + "0";//锐利度系数计算方法
|
||||
NG_par = NG_par + "," + "0";//孔板入口圆弧半径
|
||||
NG_par = NG_par + "," + "3";//长度单位
|
||||
NG_par = NG_par + "," + $('#inP').numberbox('getValue');//输入压力
|
||||
NG_par = NG_par + "," + "2";//压力单位
|
||||
NG_par = NG_par + "," + "0";//压力类型
|
||||
NG_par = NG_par + "," + $('#inWd').numberbox('getValue');//输入温度
|
||||
NG_par = NG_par + "," + "0";//温度单位
|
||||
NG_par = NG_par + "," + "0";//输入差压
|
||||
NG_par = NG_par + "," + "1";//压力单位
|
||||
NG_par = NG_par + "," + "1";//体积流量单位
|
||||
NG_par = NG_par + "," + "2";//质量流量单位
|
||||
NG_par = NG_par + "," + "1";//能量流量单位
|
||||
NG_par = NG_par + "," + $('#yljg').numberbox('getValue');//压力步长
|
||||
NG_par = NG_par + "," + $('#wdjg').numberbox('getValue');//温度步长
|
||||
NG_par = NG_par + "," + $('#inPe').numberbox('getValue');//终止压力
|
||||
NG_par = NG_par + "," + $('#inWde').numberbox('getValue');//终止温度
|
||||
|
||||
$('#CalFlow').linkbutton('disable');
|
||||
|
||||
$('#pp').progressbar('setValue', 0);
|
||||
|
||||
//boolEnableTime = true;
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '../../ASHX/FlowCal.ashx?action=ZTCal&' + "t=" + Date.parse(new Date()),
|
||||
dataType: "json",
|
||||
data: { Par: NG_par },
|
||||
traditional: true,
|
||||
success: function (data) {
|
||||
$('#dg').datagrid({
|
||||
loadMsg: '正在计算中...',
|
||||
pageSize: 20,
|
||||
pageList: [20, 30, 40, 50, 100],
|
||||
pagination: true,
|
||||
striped: true, //奇偶行是否区分
|
||||
singleSelect: true,//单选模式
|
||||
rownumbers: true,//行号
|
||||
fitColumns: false,
|
||||
autoRowHeight: false,
|
||||
//height: window.innerHeight - 45 - 58,
|
||||
//toolbar: toolbar,
|
||||
fit: true,
|
||||
columns: [data.title] //动态取标题
|
||||
});
|
||||
$('#dg').datagrid({ loadFilter: pagerFilter }).datagrid('loadData', data.rows); //动态取数据
|
||||
$('#CalFlow').linkbutton('enable');
|
||||
$('#pp').progressbar('setValue', 100);
|
||||
|
||||
var blEn = setremainTimes('<%=Session ["userAccount"]%>', getQueryString("GNID"));
|
||||
if (blEn == "0") {
|
||||
try {
|
||||
$('#saveBtn').linkbutton('disable');
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#inP').numberbox('disable', true); //设置输入框为禁用
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
$('#NG_C1').numberbox('disable', true); //设置输入框为禁用
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
$.messager.alert('操作提示', '存在必填项为空,请检查!', "warning");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//为网格添加分页
|
||||
function pagerFilter(data) {
|
||||
//$.messager.alert("提示",JSON.stringify(data));
|
||||
if (typeof data.length == 'number' && typeof data.splice == 'function') { // 判断数据是否是数组
|
||||
data = {
|
||||
total: data.length,
|
||||
rows: data
|
||||
}
|
||||
}
|
||||
var dg = $(this);
|
||||
var opts = dg.datagrid('options');
|
||||
var pager = dg.datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
dg.datagrid('loadData', data);
|
||||
}
|
||||
});
|
||||
if (!data.originalRows) {
|
||||
data.originalRows = (data.rows);
|
||||
}
|
||||
var start = (opts.pageNumber - 1) * parseInt(opts.pageSize);
|
||||
var end = start + parseInt(opts.pageSize);
|
||||
data.rows = (data.originalRows.slice(start, end));
|
||||
return data;
|
||||
};
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
$('#DDDQY').numberbox('setValue', 0.101325);
|
||||
|
||||
|
||||
initialCom();
|
||||
|
||||
var url = '../../ASHX/getTreeCombox.ashx?action=getJld';
|
||||
getTree($('#treeWest'), url);
|
||||
|
||||
|
||||
$('#NG_C1').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_N2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_CO2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C3').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_H2O').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_H2S').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_H2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_CO').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_O2').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_iC4').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_nC4').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_iC5').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_nC5').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C6').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C7').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C8').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C9').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_C10').numberbox({ onChange: function () { sumZf(); } });
|
||||
$('#NG_He').numberbox({ onChange: function () { sumZf(); } });
|
||||
|
||||
if (getQueryString("enable").toString() == "False") {
|
||||
document.getElementById("message").innerHTML = "试用期已过,如有需要请点系统设置->开通功能";
|
||||
$('#saveBtn').linkbutton('disable');
|
||||
$('#inP').numberbox('disable', true); //设置输入框为禁用
|
||||
$('#NG_C1').numberbox('disable', true); //设置输入框为禁用
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
作 用:将EasyUI的DataGrid表格,直接导出Excle
|
||||
例 子: EasyUIDataGridToExcle('SalaryReport', $('#dg'), 'getRows');
|
||||
说 明:文档名字,避免汉字,容易乱码 ,可能造成文档打不开的情况
|
||||
*/
|
||||
// strXlsName :文檔名字 exportGrid:$('#dg') H:getData:所有數據 getRows:當前頁的數據
|
||||
function EasyUIDataGridToExcle() {
|
||||
var f = $('<form action="../../ashx/ExportXls.ashx?ActionType=EasyUIDataGridToExcle" method="post" id="fm1"></form>');
|
||||
var i = $('<input type="hidden" id="txtContent" name="txtContent" />');
|
||||
var l = $('<input type="hidden" id="txtName" name="txtName" />');
|
||||
|
||||
i.val(ChangeToTable($("#dg"), "getData"));
|
||||
alert(($("#dg"), "getData"));
|
||||
alert(ChangeToTable($("#dg"), "getData"));
|
||||
i.appendTo(f);
|
||||
l.val("压缩因子表");
|
||||
l.appendTo(f);
|
||||
f.appendTo(document.body).submit();
|
||||
var newf = document.getElementById("fm1");
|
||||
document.body.removeChild(newf);
|
||||
};
|
||||
function ChangeToTable(printDatagrid, H) {
|
||||
var tableString = '<table cellspacing="0" class="pb">';
|
||||
var frozenColumns = printDatagrid.datagrid("options").frozenColumns; // 得到frozenColumns对象
|
||||
var columns = printDatagrid.datagrid("options").columns; // 得到columns对象
|
||||
var nameList = new Array();
|
||||
|
||||
// 载入title
|
||||
if (typeof columns != 'undefined' && columns != '') {
|
||||
$(columns).each(function (index) {
|
||||
tableString += '\n<tr>';
|
||||
if (typeof frozenColumns != 'undefined' && typeof frozenColumns[index] != 'undefined') {
|
||||
for (var i = 0; i < frozenColumns[index].length; ++i) {
|
||||
if (!frozenColumns[index][i].hidden) {
|
||||
tableString += '\n<th width="' + frozenColumns[index][i].width + '"';
|
||||
if (typeof frozenColumns[index][i].rowspan != 'undefined' && frozenColumns[index][i].rowspan > 1) {
|
||||
tableString += ' rowspan="' + frozenColumns[index][i].rowspan + '"';
|
||||
}
|
||||
if (typeof frozenColumns[index][i].colspan != 'undefined' && frozenColumns[index][i].colspan > 1) {
|
||||
tableString += ' colspan="' + frozenColumns[index][i].colspan + '"';
|
||||
}
|
||||
if (typeof frozenColumns[index][i].field != 'undefined' && frozenColumns[index][i].field != '') {
|
||||
nameList.push(frozenColumns[index][i]);
|
||||
}
|
||||
tableString += '>' + frozenColumns[index][i].title + '</th>';
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < columns[index].length; ++i) {
|
||||
if (!columns[index][i].hidden) {
|
||||
tableString += '\n<th width="' + columns[index][i].width + '"';
|
||||
if (typeof columns[index][i].rowspan != 'undefined' && columns[index][i].rowspan > 1) {
|
||||
tableString += ' rowspan="' + columns[index][i].rowspan + '"';
|
||||
}
|
||||
if (typeof columns[index][i].colspan != 'undefined' && columns[index][i].colspan > 1) {
|
||||
tableString += ' colspan="' + columns[index][i].colspan + '"';
|
||||
}
|
||||
if (typeof columns[index][i].field != 'undefined' && columns[index][i].field != '') {
|
||||
nameList.push(columns[index][i]);
|
||||
}
|
||||
tableString += '>' + columns[index][i].title + '</th>';
|
||||
}
|
||||
}
|
||||
tableString += '\n</tr>';
|
||||
});
|
||||
}
|
||||
//alert(tableString);
|
||||
////获取表格数据内容
|
||||
//alert("nr");
|
||||
//alert(printDatagrid);
|
||||
var data = printDatagrid.datagrid("getData");
|
||||
var rows = data.originalRows;
|
||||
for (var i = 0; i < rows.length; ++i) {
|
||||
tableString += '\n<tr>';
|
||||
for (var j = 0; j < nameList.length; ++j) {
|
||||
var e = nameList[j].field.lastIndexOf('_0');
|
||||
tableString += '\n<td';
|
||||
if (nameList[j].align != 'undefined' && nameList[j].align != '') {
|
||||
tableString += ' style="text-align:' + nameList[j].align + ';"';
|
||||
}
|
||||
tableString += '>';
|
||||
if (e + 2 == nameList[j].field.length) {
|
||||
tableString += rows[i][nameList[j].field.substring(0, e)];
|
||||
}
|
||||
else
|
||||
tableString += rows[i][nameList[j].field];
|
||||
tableString += '</td>';
|
||||
}
|
||||
tableString += '\n</tr>';
|
||||
}
|
||||
tableString += '\n</table>';
|
||||
|
||||
//alert(tableString);
|
||||
return tableString;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
30
NGTools/Pages/B_YSYZ/Z_Table_Cal.aspx.cs
Normal file
30
NGTools/Pages/B_YSYZ/Z_Table_Cal.aspx.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using NG_Tools;
|
||||
using NGTools.Tools;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
|
||||
namespace NGTools.Pages.B_YSYZ
|
||||
{
|
||||
public partial class Z_Table_Cal : System.Web.UI.Page
|
||||
{
|
||||
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user