Пример #1
0
 private void displayToolProfile_Click(object sender, EventArgs e)
 {
     if (dataValidation())
     {
         FunctionWise.isDisplayProfile = true;
         FunctionWise.initializeToolGeometryParametresForGeneralMillingTool(double.Parse(d.Text), double.Parse(r.Text), double.Parse(r_r.Text), double.Parse(r_z.Text), double.Parse(alpha.Text), double.Parse(beta.Text), double.Parse(h.Text), double.Parse(helixAngle.Text), double.Parse(rakeAngle.Text), int.Parse(noOfFlutes.Text), toolType, constHelix.Checked);
         double del_z   = 0.1;
         double del_phi = 5; // degrees
         FunctionWise.machiningParametersInitialization(1, 0, 1, del_z, del_phi);
         FunctionWise.descritizationOfMultipleTool();
     }
 }
Пример #2
0
        public void getBestLeadAndTilt()
        {
            button1.Hide();
            finalLabel.Hide();

            double FminForDifferentLeadAndTilts = double.MaxValue;
            double lBest = 0;
            double tBest = 0;
            int    lmin  = int.Parse(leadMin.Text);
            int    lmax  = int.Parse(leadMax.Text);
            int    tmin  = int.Parse(tiltMin.Text);
            int    tmax  = int.Parse(tiltMax.Text);

            progressBar1.Maximum = (int)((lmax - lmin + 1) * (tmax - tmin + 1));
            int count = 0;

            for (int l = lmin; l <= lmax; l++)
            {
                for (int t = tmin; t <= tmax; t++)
                {
                    count++;
                    FunctionWise.initializeLeadAndTilt(l, t);
                    FunctionWise.descritizationOfMultipleTool(); // Not writing descritezation in getFmax Function because tool geometry is fixed
                    dynamicLabel.Text = "Calculating Fmax for lead = " + l + " degrees and tilt = " + t + " degrees";
                    double Fmax = FunctionWise.getFmax(time);
                    maximumForceForLeadTilt.Text = "Maximum Force for the and lead and tilt = " + Math.Round(Fmax, 2) + " N";
                    progressBar1.Value           = count;
                    if (FminForDifferentLeadAndTilts > Fmax)
                    {
                        FminForDifferentLeadAndTilts  = Fmax;
                        leadTiltForMimimumForces.Text = "Best combination till now is lead = " + l + " , tilt = " + t;
                        minForceTIllNow.Text          = "Minimum value of force till now = " + Math.Round(Fmax, 2) + " N";
                        Update();
                        lBest = l;
                        tBest = t;
                    }
                    this.Update();
                }
            }
            finalLabel.Text = "Lead = " + lBest + " degrees and Tilt = " + tBest + " degrees for minimum forces";
            button1.Show();
            finalLabel.Show();
            dynamicLabel.Hide();
            progressBar1.Hide();
            leadTiltForMimimumForces.Hide();
            maximumForceForLeadTilt.Hide();
            minForceTIllNow.Hide();
            this.Update();
        }