Esempio n. 1
0
 public static TrackRect SetValue(TrackRect trackrect, DataRow dr)
 {
     if (dr != null)
     {
         trackrect.strID       = dr["strID"].ToString();
         trackrect.nTrackID    = PageBase.static_ext_int(dr["nTrackID"]);
         trackrect.nRectLeft   = PageBase.static_ext_int(dr["nRectLeft"]);
         trackrect.nRectTop    = PageBase.static_ext_int(dr["nRectTop"]);
         trackrect.UnitId      = PageBase.static_ext_int(dr["UnitId"]);
         trackrect.ApanageId   = PageBase.static_ext_int(dr["ApanageId"]);
         trackrect.nRectRight  = PageBase.static_ext_int(dr["nRectRight"]);
         trackrect.nRectBottom = PageBase.static_ext_int(dr["nRectBottom"]);
     }
     return(trackrect);
 }
Esempio n. 2
0
        ///// <summary>
        ///// 获取指定value
        ///// </summary>
        ///// <param name="strSection"></param>
        ///// <param name="strIdent"></param>
        ///// <returns></returns>
        //public static string GetSingleTrackRect(string strSection, string strIdent)
        //{
        //    string strSql = "select strValue from TAB_TrackRect where 1=1";
        //    if (strSection != "")
        //    {
        //        strSql += " and strSection  = @strSection  ";
        //    }
        //    strSql += strIdent == "" ? "" : " and strIdent  = @strIdent ";
        //    SqlParameter[] sqlParams = {
        //                                   new SqlParameter("strSection ",strSection ),
        //                                   new SqlParameter("strIdent ",strIdent )
        //                               };
        //    return SqlHelper.ExecuteScalar(searchmaster.GetSqlConnConfig("57"), CommandType.Text, strSql, sqlParams).ToString();
        //}

        public static List <TrackRect> ListValue(DataTable dt)
        {
            List <TrackRect> listConfig = new List <TrackRect>();
            TrackRect        trackrect;

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    trackrect = new TrackRect();
                    listConfig.Add(SetValue(trackrect, dt.Rows[i]));
                }
            }
            return(listConfig);
        }
Esempio n. 3
0
        /// <summary>
        /// 设置右侧入场的机车xy坐标
        /// </summary>
        /// <param name="jclist"></param>
        public static List <lsDatJT6JiChe> RightFactory(List <lsDatJT6JiChe> jclist, int apanageid)
        {
            //待返回机车集合 此举为过滤数据库中无轨道数据的机车
            List <lsDatJT6JiChe> returnRightlist = new List <lsDatJT6JiChe>();
            //获取股道xy坐标配置
            List <TrackRect> trackrectlist = TrackRect.GetAllTrackRect(apanageid);

            foreach (TrackRect trackrect in trackrectlist)
            {
                double mapX = trackrect.nRectRight;
                double mapY = trackrect.nRectTop;
                foreach (lsDatJT6JiChe jc in jclist)
                {
                    if (jc.TrackId.ToString() == trackrect.nTrackID.ToString())
                    {
                        mapX     = mapX - hxd2bw - 1;
                        jc.nMapX = mapX;
                        jc.nMapY = mapY;
                        returnRightlist.Add(jc);
                    }
                }
            }
            return(returnRightlist);
        }