Exemple #1
0
        /// <summary>
        /// 把信息加载到场站类
        /// </summary>
        /// <param name="id"></param>
        /// <param name="typ"></param>
        /// <param name="c"></param>
        /// <returns></returns>
        private string GetStr(string id, string typ, czInfo c)
        {
            string s = "";

            //装机容量
            double rl = GetRl(typ, id);

            c.装机容量 = rl;

            //机型
            c.机型 = GetMachineName(typ, id);


            //风速 测点
            c.风速 = GetFS(typ, id);


            //功率
            c.功率 = GetDl(id, typ, 4);


            //出力率
            if (rl == 0)
            {
                c.出力率 = 0;
            }
            else
            {
                c.出力率 = Math.Round(c.功率 / rl * 100, 2);
            }

            //限负荷



            //日电量
            double rdl = GetDl(id, typ, 1);

            c.日电量 = rdl;


            //日等效利用小时
            if (rl == 0)
            {
                c.日等效利用小时 = 0;
            }
            else
            {
                c.日等效利用小时 = Math.Round(rdl * 10 / rl, 2);
            }


            //月电量
            double ydl = GetDl(id, typ, 2);

            c.月电量 = ydl;


            //月计划
            double yjh = GetJHDl(id, typ, 2);

            c.月计划 = yjh;


            //月完成率
            if (yjh == 0)
            {
                c.月完成率 = 0;
            }
            else
            {
                c.月完成率 = Math.Round(ydl / yjh * 100, 2);
            }


            //月等效利用小时
            if (rl == 0)
            {
                c.月等效利用小时 = 0;
            }
            else
            {
                c.月等效利用小时 = Math.Round(ydl * 10 / rl, 2);
            }

            //年电量
            double ndl = GetDl(id, typ, 3);

            c.年电量 = ndl;

            //年计划
            double njh = GetJHDl(id, typ, 3);

            c.年计划 = njh;

            //年完成率
            if (njh == 0)
            {
                c.年完成率 = 0;
            }
            else
            {
                c.年完成率 = Math.Round(ndl / njh * 100, 2);
            }


            //年等效利用小时

            if (rl == 0)
            {
                c.年等效利用小时 = 0;
            }
            else
            {
                c.年等效利用小时 = Math.Round(ndl * 10 / rl, 2);
            }

            //总台数

            c.总台数 = GetState(id, typ, 0);
            //运行
            c.运行 = GetState(id, typ, 1);
            //计划检修

            //故障
            c.故障 = GetState(id, typ, 4);

            //待机
            c.待机 = GetState(id, typ, 3);

            //机组故障率
            c.机组故障率 = 0;

            //机组状态排名


            //出力率排名


            czxxList.Add(c);
            return(s);
        }
Exemple #2
0
        /// <summary>
        /// 获得场站信息
        /// </summary>
        /// <param name="dt"></param>
        private void GetCZInfo(DataTable dtArea)
        {
            DataTable Sdt   = null;
            DataTable dtOrg = null;

            //循环区域
            for (int area = 0; area < dtArea.Rows.Count; area++)
            {
                dtOrg = dl.RunDataTable("select * from ADMINISTRATOR.T_BASE_ORG where T_COMID='" + dtArea.Rows[area]["T_COMID"] + "'", out errMsg);

                //循环场站
                for (int a = 0; a < dtOrg.Rows.Count; a++)
                {
                    czInfo c = new czInfo();
                    Sdt = dl.RunDataTable("select * from ADMINISTRATOR.T_BASE_PERIOD where T_ORGID='" + dtOrg.Rows[a]["T_ORGID"] + "'", out errMsg);

                    if (Sdt.Rows.Count > 0)
                    {
                        if (Sdt.Rows.Count > 1)
                        {
                            c.区域      = dtArea.Rows[area]["T_COMDESC"].ToString();
                            c.T_ORGID = dtOrg.Rows[a]["T_ORGID"].ToString();
                            c.风电场     = dtOrg.Rows[a]["T_ORGDESC"].ToString();
                            GetStr(dtOrg.Rows[a]["T_ORGID"].ToString(), "1", c);
                            for (int b = 0; b < Sdt.Rows.Count; b++)
                            {
                                c            = new czInfo();
                                c.区域         = dtArea.Rows[area]["T_COMDESC"].ToString();
                                c.T_ORGID    = dtOrg.Rows[a]["T_ORGID"].ToString();
                                c.T_PERIODID = Sdt.Rows[b]["T_PERIODID"].ToString();
                                c.风电场        = Sdt.Rows[b]["T_PERIODDESC"].ToString();
                                GetStr(Sdt.Rows[b]["T_PERIODID"].ToString(), "2", c);
                            }
                        }
                        else
                        {
                            if (Sdt.Rows[0]["T_PERIODDESC"].ToString() == "全部")
                            {
                                //取组织机构描述
                                c         = new czInfo();
                                c.区域      = dtArea.Rows[area]["T_COMDESC"].ToString();
                                c.T_ORGID = dtOrg.Rows[a]["T_ORGID"].ToString();
                                c.风电场     = dtOrg.Rows[a]["T_ORGDESC"].ToString();
                                GetStr(dtOrg.Rows[a]["T_ORGID"].ToString(), "1", c);
                            }
                            else
                            {
                                //取场站描述
                                c            = new czInfo();
                                c.区域         = dtArea.Rows[area]["T_COMDESC"].ToString();
                                c.T_ORGID    = dtOrg.Rows[a]["T_ORGID"].ToString();
                                c.T_PERIODID = Sdt.Rows[0]["T_PERIODID"].ToString();
                                c.风电场        = Sdt.Rows[0]["T_PERIODDESC"].ToString();
                                GetStr(Sdt.Rows[0]["T_PERIODID"].ToString(), "2", c);
                            }
                        }
                    }
                    else
                    {
                        c         = new czInfo();
                        c.区域      = dtArea.Rows[area]["T_COMDESC"].ToString();
                        c.T_ORGID = dtOrg.Rows[a]["T_ORGID"].ToString();
                        c.风电场     = dtOrg.Rows[a]["T_ORGDESC"].ToString();
                        GetStr(dtOrg.Rows[a]["T_ORGID"].ToString(), "1", c);
                    }
                }
            }
        }