示例#1
0
 /// <summary>
 /// Determines the yoke size of a given lamination.
 /// 
 /// As of 04/04/2019 there is no support for custom yoke size and standard laminations are not given a yoke size.
 /// </summary>
 /// <param name="coreShape">Shape of the lamination.</param>
 /// <param name="phase">Phase of the design.</param>
 /// <param name="tongue">Tongue size of the lamination.</param>
 /// <returns>The yoke size for the lamination.</returns>
 public static double DetermineYoke(CoreShape coreShape, Phase phase, double tongue)
 {
     if (coreShape == CoreShape.EI && phase == Phase.SINGLE)
         return tongue / 2;
     else
         return tongue;
 }
示例#2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="isStd">If the lamination would be a standard lamination or not.</param>
 /// <param name="shape">Shape of the lamination.</param>
 /// <param name="grade">Grade of the lamination.</param>
 /// <param name="thickness">Lamination thickness.</param>
 public LaminationDetails(bool isStd, CoreShape shape, Grade grade, double thickness)
 {
     this.IsStandard = isStd;
     this.Shape = shape;
     this.Grade = grade;
     this.Thickness = thickness;
 }
示例#3
0
 /// <summary>
 /// Returns <see cref="CoreShape"/> from user input.
 ///
 /// As of 04/01/2019 no input checking is provided.
 /// </summary>
 /// <param name="value">Enum value to find with name of.</param>
 /// <returns>Type of core shape.</returns>
 public static CoreShape GetCoreShape(string value)
 {
     CoreShape coreShape = CoreShape.EI;
     if (Enum.TryParse(value, out coreShape))
         return coreShape;
     return CoreShape.EI;
 }
示例#4
0
 /// <summary>
 /// Constructor.
 ///
 /// If <paramref name="standardLamination"/> is true, the lamination sets its' <see cref="Surcharge"/> based on the function <see cref="Data.LoadedData.Prices.GetMaterialSurcharge(Grade)"/>.
 /// Otherwise <see cref="Surcharge"/> is set to 0 if <paramref name="standardLamination"/> is false.
 ///
 /// If <paramref name="weight"/> is 0 then the <see cref="Weight"/> property is set using the equation <see cref="Length"/> * <see cref="Height"/> * <see cref="Thickness"/> * 0.276.
 /// </summary>
 /// <param name="standardLamination">If the lamination to be created uses a standard lamination or is cut-to-length.</param>
 /// <param name="partNumber">Part number of the lamination.</param>
 /// <param name="shape">Shape of the lamination.</param>
 /// <param name="phase">Phase of the design lamination is used in.</param>
 /// <param name="grade">Grade of steel of the lamination.</param>
 /// <param name="thickness">Thickness of steel of the lamination.</param>
 /// <param name="tongue">Width of middle leg.</param>
 /// <param name="yoke">Width of two side legs and of top and bottom yoke.</param>
 /// <param name="windowWidth">Window width.</param>
 /// <param name="windowHeight">Window height.</param>
 /// <param name="scrapFactor">Weight ratio of used laminations and bought laminations. Used only for standard laminations. Between 0 and 1.</param>
 /// <param name="desctructionFactor">Built in destruction factor of the lamination.</param>
 /// <param name="excitationFactor">Built in excitation factor of the lamination.</param>
 /// <param name="cost">Cost of the lamination, does not include surcharge.</param>
 /// <param name="weight">Weight of the lamination, if 0 then the weight will be approximated.</param>
 protected internal Lamination(bool standardLamination, string partNumber, CoreShape shape, Phase phase, Grade grade, double thickness, double tongue, double yoke, double windowWidth, double windowHeight, double scrapFactor, double desctructionFactor, double excitationFactor, double cost, double weight)
 {
     this.StandardLamination   = standardLamination;
     this.LaminationPartNumber = partNumber;
     this.Shape             = shape;
     this.Phase             = phase;
     this.Grade             = grade;
     this.Thickness         = thickness;
     this.Tongue            = tongue;
     this.Yoke              = yoke;
     this.WindowWidth       = windowWidth;
     this.WindowHeight      = windowHeight;
     this.ScrapFactor       = scrapFactor;
     this.DestructionFactor = desctructionFactor;
     this.ExcitationFactor  = excitationFactor;
     if (standardLamination)
     {
         this.Surcharge = (double)GetMaterialSurcharge(grade);
         this.Cost      = cost;
     }
     else
     {
         this.Surcharge = 0;
         this.Cost      = cost;
     }
     if (weight != 0)
     {
         this.Weight = weight;
     }
     else
     {
         if (shape == CoreShape.FiveLegged)
         {
             this.Weight = ((Length * Height) - (3 * WindowWidth * WindowHeight)) * Thickness * 0.276;
         }
         else if (shape == CoreShape.UI)
         {
             this.Weight = ((Length * Height) - (WindowWidth * WindowHeight)) * Thickness * 0.276;
         }
         else
         {
             this.Weight = ((Length * Height) - (2 * WindowWidth * WindowHeight)) * Thickness * 0.276;
         }
     }
 }
示例#5
0
 /// <summary>
 /// 指定した図形と衝突しているか否かを調べる。
 /// </summary>
 /// <param name="shape">衝突を調べる図形</param>
 /// <returns>衝突したか否か</returns>
 public bool GetIsCollidedWith(Shape shape)
 {
     return(CoreShape.GetIsCollidedWith(shape.CoreShape));
 }
示例#6
0
            /// <summary>
            /// Returns a list of laminations that match given parameters, with a tongue that is bounded by [MinTongue, MaxTongue].
            /// </summary>
            /// <param name="coreShape">Shape of the lamination.</param>
            /// <param name="phase">Phase of the lamination.</param>
            /// <param name="grade">Grade of lamination.</param>
            /// <param name="thickness">Thickness of lamination.</param>
            /// <param name="minTongue">Minimum tongue size of lamination.</param>
            /// <param name="maxTongue">Maximum tongue size of lamination.</param>
            /// <returns>A list of all laminations that meet given parameters.</returns>
            public static List <Lamination> GetLaminations(CoreShape coreShape, Phase phase, Grade grade, double thickness, double minTongue, double maxTongue)
            {
                IEnumerable <Lamination> _laminations = __laminations.Where(l => l.Shape == coreShape && l.Phase == phase && l.Grade == grade && l.Thickness == thickness && l.Tongue >= minTongue && l.Tongue <= maxTongue);

                return(_laminations.ToList());
            }