Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ////string a = "FKPC:00CU0018.1Y";
     UnitModel unit = new UnitModel("#1");
     object power = unit.Power;
     unit.time = DateTime.Now.ToString("yyyy-MM-dd 7:00:00");
     object hisPower = unit.HisPower;
     double judge = unit.judge;
     if (judge == -1000000)
         Response.Write("NO");
     else
         Response.Write(hisPower);
 }
Example #2
0
 /// <summary>
 /// 机组实时负荷
 /// </summary>
 /// <returns></returns>
 public double Power(string key)
 {
     UnitModel um = new UnitModel(key);
     return um.Power;
 }
Example #3
0
 /// <summary>
 /// 风速
 /// </summary>
 /// <returns></returns>
 public double GetWind(string key)
 {
     UnitModel um = new UnitModel(key);
     return um.Wind;
 }
Example #4
0
 /// <summary>
 /// 热耗
 /// </summary>
 /// <returns></returns>
 public double Heatconsumption(string key)
 {
     UnitModel um = new UnitModel(key);
     return um.Heatconsumption;
 }
Example #5
0
 /// <summary>
 /// 主汽流量
 /// </summary>
 /// <returns></returns>
 public double Flow(string key)
 {
     UnitModel um = new UnitModel(key);
     return um.Flow;
 }
Example #6
0
 /// <summary>
 /// 电量
 /// </summary>
 /// <returns></returns>
 public double GetDL(string key, string st, string et)
 {
     UnitModel um = new UnitModel(key, st, et);
     return um.Dl;
 }
Example #7
0
 /// <summary>
 /// 煤耗
 /// </summary>
 /// <returns></returns>
 public double Coalconsumption(string key)
 {
     UnitModel um = new UnitModel(key);
     return um.Coalconsumption;
 }
Example #8
0
 /// <summary>
 /// 锅炉效率
 /// </summary>
 /// <returns></returns>
 public double Efficiency(string key)
 {
     UnitModel um = new UnitModel(key);
     return um.Efficiency;
 }
Example #9
0
 /// <summary>
 /// 获取机组负荷、主汽流量、主汽压力、主汽温度、再热温度、真空、锅炉效率、热耗、煤耗的最新值
 /// </summary>
 /// <returns></returns>
 public double[] Val(string key)
 {
     UnitModel um = new UnitModel(key);
     return um.Val;
 }
Example #10
0
 /// <summary>
 /// 真空
 /// </summary>
 /// <returns></returns>
 public double Vacuum(string key)
 {
     UnitModel um = new UnitModel(key);
     return um.Vacuum;
 }
Example #11
0
 /// <summary>
 /// 主汽温度
 /// </summary>
 /// <returns></returns>
 public double Temperature(string key)
 {
     UnitModel um = new UnitModel(key);
     return um.Temperature;
 }
Example #12
0
 /// <summary>
 /// 主汽压力
 /// </summary>
 /// <returns></returns>
 public double Pressure(string key)
 {
     UnitModel um = new UnitModel(key);
     return um.Pressure;
 }
Example #13
0
        private void InitTable(DataTable _dtPoints)
        {
            //drPoits = _dtPoints.Select("T_UNITID<>'0'");
            //string[] _strUnit = new string[drPoits.Length];
            //string[] _strPoints = new string[drPoits.Length * (_dtPoints.Columns.Count - 3)];
            //int j = 0;
            //for (int i = 0; i < drPoits.Length; i++)
            //{
            //    _strUnit[i] = drPoits[i][1].ToString();
            //    for (int k = 2; k < _dtPoints.Columns.Count - 1; k++)
            //    {
            //        _strPoints[j] = drPoits[i][k].ToString();
            //        j++;
            //    }
            //}
            //double[] _val = new double[_strPoints.Length];
            //_val = bllPoint.GetPointVal(_strPoints);

            //sbl.Append("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#cccccc\">");
            //sbl.Append("<tr class=\"td1\">");
            //sbl.Append("<td>机组</td>");
            //sbl.Append("<td>运行状态</td>");
            //sbl.Append("<td>机组负荷</td>");
            //sbl.Append("<td>主汽流量</td>");
            //sbl.Append("<td>主汽压力</td>");
            //sbl.Append("<td>主汽温度</td>");
            //sbl.Append("<td>再热温度</td>");
            //sbl.Append("<td>真空</td>");
            //sbl.Append("<td>锅炉效率</td>");
            //sbl.Append("<td>热耗</td>");
            //sbl.Append("<td>煤耗</td>");
            //sbl.Append("</tr>");
            //for (int i = 0; i < _strUnit.Length; i++)
            //{
            //    if (i % 2 == 0)
            //        sbl.Append("<tr class=\"td2\">");
            //    else
            //        sbl.Append("<tr class=\"td3\">");
            //    sbl.Append("<td>" + _strUnit[i] + "</td>");
            //    for (int k = -1; k < _dtPoints.Columns.Count - 3; k++)
            //    {
            //        if (k == -1)
            //            if (_val[(k + 1) + (k + 1) * i] < 5)
            //                sbl.Append("<td>停机</td>");
            //            else
            //                sbl.Append("<td>运行</td>");
            //        else
            //            if (_val[k + (dtPoints.Columns.Count - 3) * i] == -1000000)
            //                sbl.Append("<td style='color: red;'>bad</td>");
            //            else
            //                sbl.Append("<td>" + _val[k + (dtPoints.Columns.Count - 3) * i] + "</td>");
            //    }
            //    sbl.Append("</tr>");
            //}
            //sbl.Append("</table>");

            drPoits = _dtPoints.Select("T_UNITID<>'0'");
            string[] _strUnit = new string[drPoits.Length];
            string[] _strPoints = new string[drPoits.Length * (_dtPoints.Columns.Count - 3)];
            for (int i = 0; i < drPoits.Length; i++)
            {
                _strUnit[i] = drPoits[i][1].ToString();

            }
            sbl.Append("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#cccccc\">");
            sbl.Append("<tr class=\"td1\">");
            sbl.Append("<td>机组</td>");
            sbl.Append("<td>运行状态</td>");
            sbl.Append("<td>机组负荷</td>");
            sbl.Append("<td>主汽流量</td>");
            sbl.Append("<td>主汽压力</td>");
            sbl.Append("<td>主汽温度</td>");
            sbl.Append("<td>再热温度</td>");
            sbl.Append("<td>真空</td>");
            sbl.Append("<td>锅炉效率</td>");
            sbl.Append("<td>热耗</td>");
            sbl.Append("<td>煤耗</td>");
            sbl.Append("</tr>");
            double[] _vals = new double[36];
            for (int i = 1; i <= drPoits.Length; i++)
            {
                UnitModel unit = new UnitModel(drPoits[i - 1][1].ToString());
                double[] v = unit.Val;
                for (int k = 0; k < 9; k++)
                {
                    _vals[(i - 1) * 9 + k] = v[k];
                }
                //_vals[(i - 1) * 9 + 0] = unit.Power;
                //_vals[(i - 1) * 9 + 1] = unit.Flow;
                //_vals[(i - 1) * 9 + 2] = unit.Pressure;
                //_vals[(i - 1) * 9 + 3] = unit.Temperature;
                //_vals[(i - 1) * 9 + 4] = unit.ReheatTemperature;
                //_vals[(i - 1) * 9 + 5] = unit.Vacuum;
                //_vals[(i - 1) * 9 + 6] = unit.Efficiency;
                //_vals[(i - 1) * 9 + 7] = unit.Heatconsumption;
                //_vals[(i - 1) * 9 + 8] = unit.Coalconsumption;
            }

            for (int i = 0; i < _strUnit.Length; i++)
            {
                if (i % 2 == 0)
                    sbl.Append("<tr class=\"td2\">");
                else
                    sbl.Append("<tr class=\"td3\">");
                sbl.Append("<td>" + _strUnit[i] + "</td>");
                for (int k = -1; k < _dtPoints.Columns.Count - 3; k++)
                {
                    if (k == -1)
                        if (_vals[(k + 1) + (k + 1) * i] < 5)
                            sbl.Append("<td>停机</td>");
                        else
                            sbl.Append("<td>运行</td>");
                    else
                        if (_vals[k + 9 * i] == -1000000)
                            sbl.Append("<td style='color: red;'>bad</td>");
                        else
                            sbl.Append("<td>" + _vals[k + 9 * i] + "</td>");
                }
                sbl.Append("</tr>");
            }
            sbl.Append("</table>");

            object _obj = new
            {
                tbl = sbl.ToString()
            };

            string result = JsonConvert.SerializeObject(_obj);
            Response.Write(result);
            Response.End();
        }