Example #1
0
        /// <summary>
        /// Compute static BCT
        /// </summary>
        public static double ComputeStaticBCT(
            double length, double width, double height
            , string cardboardId, string caseType
            , FormulaType mcKeeFormulaType)
        {
            if (!McKeeFormula.CardboardQualityDictionary.ContainsKey(cardboardId))
            {
                throw new Exception(Exception.ErrorType.ERROR_INVALIDCARDBOARD, cardboardId);
            }
            QualityData qualityData = McKeeFormula.CardboardQualityDictionary[cardboardId];

            if (!McKeeFormula.CaseTypeDictionary.ContainsKey(caseType))
            {
                throw new Exception(Exception.ErrorType.ERROR_INVALIDCASETYPE, caseType);
            }
            double caseTypeCoef = McKeeFormula.CaseTypeDictionary[caseType];

            switch (mcKeeFormulaType)
            {
            case FormulaType.MCKEE_CLASSIC:
                return(McKeeFormula.ComputeBCT_ECT(length, width, qualityData.Thickness, qualityData.ECT) * caseTypeCoef);

            case FormulaType.MCKEE_IMPROVED:
                return(McKeeFormula.ComputeBCT_Stiffness(length, width, height,
                                                         qualityData.Thickness, qualityData.RigidityDX, qualityData.RigidityDY,
                                                         qualityData.ECT) * caseTypeCoef);

            default:
                throw new TreeDim.EdgeCrushTest.Exception(Exception.ErrorType.ERROR_INVALIDFORMULATYPE, string.Empty);
            }
        }
 /// <summary>
 /// Convert to McKeeFormula to string
 /// </summary>
 public static string ModeText(McKeeFormula.FormulaType type)
 {
     switch (type)
     {
         case McKeeFormula.FormulaType.MCKEE_CLASSIC: return TreeDim.EdgeCrushTest.Properties.Resource.MCKEEFORMULA_CLASSIC;
         case McKeeFormula.FormulaType.MCKEE_IMPROVED: return TreeDim.EdgeCrushTest.Properties.Resource.MCKEEFORMULA_IMPROVED;
         default: return "";
     }
 }
        public static Dictionary<KeyValuePair<string, string>, double> EvaluateEdgeCrushTestMatrix(
            double L, double B, double H
            , string cardboardId, string caseType, string printType
            , McKeeFormula.FormulaType mcKeeFormulaType)
        {
            // get dictionnaries
            Dictionary<string, double> humidityCoefDictionary = HumidityCoefDictionary;
            Dictionary<string, double> stockCoefDictionary = StockCoefDictionary;
            double printCoef = PrintCoefDictionary[printType];
            // get cardboard quality data
            double bct_static = ComputeStaticBCT(L, B, H, cardboardId, caseType, mcKeeFormulaType);

            Dictionary<KeyValuePair<string, string>, double> edgeCrushTestMatrix = new Dictionary<KeyValuePair<string, string>, double>();
            foreach (string humidityRange in HumidityCoefDictionary.Keys)
                foreach (string stockDuration in StockCoefDictionary.Keys)
                {
                    edgeCrushTestMatrix.Add(new KeyValuePair<string, string>(stockDuration, humidityRange)
                        , bct_static * printCoef * stockCoefDictionary[stockDuration] * humidityCoefDictionary[humidityRange]);
                }
            return edgeCrushTestMatrix;
        }