예제 #1
0
 /// <summary>
 /// 按照不同语言添加不同的品牌名称
 /// </summary>
 /// <param name="lang">语言</param>
 /// <param name="brand">品牌</param>
 /// <param name="name">此语言下的品牌名称</param>
 public void Add(PumpID pid, OcclusionLevel level, int syringeSize, float mid)
 {
     if (!m_HashProductPressure.ContainsKey(pid))
     {
         LevelPressure lp = new LevelPressure(level);
         lp.Add(syringeSize, mid);
         ProductPressure pp = new ProductPressure(pid);
         pp.Add(lp);
         m_HashProductPressure.Add(pid, pp);
     }
     else
     {
         ProductPressure pp = m_HashProductPressure[pid] as ProductPressure;
         LevelPressure   lp = pp.Find(level);
         if (lp != null)
         {
             lp.Add(syringeSize, mid);
         }
         else
         {
             lp = new LevelPressure(level);
             lp.Add(syringeSize, mid);
             pp.Add(lp);
         }
     }
 }
예제 #2
0
        /// <summary>
        /// 取某类型泵的某个压力等级下某个尺寸的最大压力配置值
        /// </summary>
        /// <param name="pid"></param>
        /// <param name="size"></param>
        /// <param name="level"></param>
        /// <returns></returns>
        public float GetMaxBySizeLevel(PumpID pid, int size, OcclusionLevel level)
        {
            ProductPressure pp = GetPressureByProductID(pid);

            if (pp == null)
            {
                return(0);
            }
            LevelPressure lp = pp.Find(level);

            if (lp == null)
            {
                return(0);
            }
            SizePressure sp = lp.Find(size);

            if (sp == null)
            {
                return(0);
            }
            return(sp.m_Mid);
        }