Exemplo n.º 1
0
        public static Dictionary <KeyValuePair <string, string>, double> EvaluateEdgeCrushTestMatrix(
            double L, double B, double H,
            string caseType, string printType,
            QualityData qualityData,
            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, caseType, qualityData, 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);
        }
Exemplo n.º 2
0
        public static double ComputeStaticBCT(
            double length, double width, double height, string caseType
            , QualityData qualityData
            , FormulaType mcKeeFormulaType)
        {
            if (!CaseTypeDictionary.ContainsKey(caseType))
            {
                throw new ECTException(ECTException.ErrorType.ERROR_INVALIDCASETYPE, caseType);
            }
            double caseTypeCoef = CaseTypeDictionary[caseType];

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

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

            default:
                throw new ECTException(ECTException.ErrorType.ERROR_INVALIDFORMULATYPE, string.Empty);
            }
        }
Exemplo n.º 3
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);
            }
        }
        private void OnEditItem(object sender, EventArgs e)
        {
            SourceGrid.CellContext context = (SourceGrid.CellContext)sender;
            int         iSel = context.Position.Row - 1;
            QualityData q    = CardboardQualityAccessor.Instance.CardboardQualities[iSel];
            var         form = new FormEditCardboardQualityData()
            {
                Mode        = FormEditCardboardQualityData.EMode.MODE_MODIFY,
                QualityName = q.Name,
                Profile     = q.Profile,
                Thickness   = q.Thickness,
                ECT         = q.ECT,
                StiffnessX  = q.RigidityDX,
                StiffnessY  = q.RigidityDY
            };

            if (DialogResult.OK == form.ShowDialog())
            {
                CardboardQualityAccessor.Instance.RemoveQuality(iSel);
                CardboardQualityAccessor.Instance.AddQuality(
                    form.QualityName,
                    form.Profile,
                    form.Thickness,
                    form.ECT,
                    form.StiffnessX,
                    form.StiffnessY);
                FillGrid();
            }
        }
Exemplo n.º 5
0
 public QualityData(QualityData data)
 {
     _name       = data._name;
     _thickness  = data._thickness;
     _ECT        = data._ECT;
     _rigidityDX = data._rigidityDX;
     _rigidityDY = data._rigidityDY;
 }
Exemplo n.º 6
0
 public QualityData(QualityData data)
 {
     Name       = data.Name;
     Profile    = data.Profile;
     Thickness  = data.Thickness;
     ECT        = data.ECT;
     RigidityDX = data.RigidityDX;
     RigidityDY = data.RigidityDY;
 }
        public QualityData GetQualityDataByName(string name)
        {
            var         qualities = CardboardQualities;
            QualityData qd        = qualities.Find(q => q.Name.ToLower() == name.ToLower());

            if (null == qd)
            {
                throw new ECTException(ECTException.ErrorType.ERROR_INVALIDCARDBOARD, name);
            }
            return(qd);
        }
Exemplo n.º 8
0
 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 OnMaterialChanged(object sender, RangeRegionChangedEventArgs e)
        {
            // compute max layer count from static BCT
            QualityData qdata = SelectedMaterial;

            if (null == qdata)
            {
                return;
            }
            Vector3D caseDim   = CaseDimensions;
            double   staticBCT = qdata.ComputeStaticBCT(caseDim, Resources.CASETYPE_AMERICANCASE, McKeeFormulaType);

            FillGridDynamicBCT();
        }
Exemplo n.º 10
0
        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)
                    );
            }
        }