public double ComputeStaticBCT(Vector3D dim, string caseType, McKeeFormula.FormulaType formulaType) { return(McKeeFormula.ComputeStaticBCT( dim.X, dim.Y, dim.Z, caseType, this, formulaType)); }
public double ComputeStaticBCT(double caseLength, double caseWidth, double caseHeight, string caseType, McKeeFormula.FormulaType formulaType) { return(McKeeFormula.ComputeStaticBCT( caseLength, caseWidth, caseHeight, caseType, this, formulaType)); }
/// <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); } }
private void OnReport(object sender, EventArgs e) { try { // build list of BCT QualityData qdata = SelectedMaterial; Vector3D caseDim = CaseDimensions; var dynBCTmatrix = McKeeFormula.EvaluateEdgeCrushTestMatrix( caseDim.X, caseDim.Y, caseDim.Z, Resources.CASETYPE_AMERICANCASE, IsDoubleWall, PrintSurface, qdata, McKeeFormulaType); List <DynamicBCTRow> listBCTRows = new List <DynamicBCTRow>(); foreach (var keyStorage in McKeeFormula.StockCoefDictionary.Keys) { List <double> values = new List <double>(); foreach (var keyHumidity in McKeeFormula.HumidityCoefDictionary.Keys) { values.Add(dynBCTmatrix[new KeyValuePair <string, string>(keyStorage, keyHumidity)]); } listBCTRows.Add(new DynamicBCTRow() { Name = keyStorage, Values = values }); } // build report data var reportData = new ReportDataPackStress() { Author = CardboardQualityAccessor.Instance.UserName, McKeeFormulaType = (int)McKeeFormulaType, Box = CaseProperties, Mat = new Material() { Name = qdata.Name, Profile = qdata.Profile, Thickness = qdata.Thickness, ECT = qdata.ECT, RigidityDX = qdata.RigidityDX, RigidityDY = qdata.RigidityDY }, StaticBCT = StaticBCT, Analysis = null, BCTRows = listBCTRows }; using (var form = new FormReportDesign(reportData)) form.ShowDialog(); } catch (Exception ex) { _log.Error(ex.Message); } }
private void FillGridDynamicBCT() { Vector3D caseDim = CaseDimensions; QualityData qdata = SelectedMaterial; if (null != qdata) { FillGridDynamicBCT( McKeeFormula.EvaluateEdgeCrushTestMatrix( caseDim.X, caseDim.Y, caseDim.Z, Resources.CASETYPE_AMERICANCASE, PrintSurface, qdata, McKeeFormulaType) ); } }
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; }
/// <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 ""; } }