Ejemplo n.º 1
0
        public float[] FindOptimalNumberOfMods(float leftFiller, float rightFiller)
        {
            float numberOfMods   = 0;
            float optimalModSize = 0;
            float remainingWallLength;

            remainingWallLength  = calculateWorkableSpace();
            remainingWallLength -= (leftFiller + rightFiller);

            if (remainingWallLength > Constants.SOFT_MAX_WINDOW_SIZE)
            {
                numberOfMods   = 1;
                optimalModSize = remainingWallLength;

                while (optimalModSize > Constants.SOFT_MAX_WINDOW_SIZE)
                {
                    numberOfMods++;
                    optimalModSize = remainingWallLength / numberOfMods;
                }
            }

            optimalModSize = GlobalFunctions.RoundDownToNearestEighthInch(optimalModSize);

            float extraFiller = remainingWallLength - (optimalModSize * numberOfMods);

            float fillerOne = 2f;
            float fillerTwo = 2f;

            GlobalFunctions.splitFillerToOutside(ref fillerOne, ref fillerTwo, extraFiller);

            return(new float[] { numberOfMods, optimalModSize, extraFiller });
        }
Ejemplo n.º 2
0
        public float[] FindMaximumNumberOfMods(float leftFiller, float rightFiller)
        {
            float numberOfMods   = 0;
            float optimalModSize = 0;
            float remainingWallLength;

            remainingWallLength  = calculateWorkableSpace();
            remainingWallLength -= (leftFiller + rightFiller);

            numberOfMods   = (float)((int)(remainingWallLength / Constants.SOFT_MIN_MOD_SIZE));
            optimalModSize = remainingWallLength / numberOfMods;

            optimalModSize = GlobalFunctions.RoundDownToNearestEighthInch(optimalModSize);

            float extraFiller = remainingWallLength - (optimalModSize * numberOfMods);

            float fillerOne = 2f;
            float fillerTwo = 2f;

            GlobalFunctions.splitFillerToOutside(ref fillerOne, ref fillerTwo, extraFiller);

            return(new float[] { numberOfMods, optimalModSize, extraFiller });
        }