Beispiel #1
0
        private void GenerateCustomSurfaceNextButton_Click(object sender, EventArgs e)
        {
            //FunctionWise.isSurfaceUserDefined = true;
            FunctionWise.initializeCustomSurfaceCoodinates(xValues, zValues);
            ToolInitialPositionForm toolInitialPositionForm = new ToolInitialPositionForm(preForm, null, SurfaceType.customSurface);

            toolInitialPositionForm.Show();
            this.preForm.Hide();
            this.Hide();
            this.Close();
        }
Beispiel #2
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();
     }
 }
Beispiel #3
0
 private void getSurfaceRoughnessButton_Click(object sender, EventArgs e)
 {
     FunctionWise.initializeLeadAndTilt(double.Parse(lead.Text), double.Parse(tilt.Text));
     FunctionWise.initializeStepOver(followingCut.Checked, double.Parse(stepOver.Text));
     if (double.IsNaN(FunctionWise.getSurfaceRoughness()))
     {
         MessageBox.Show("Stepover value is too large (Stepover cannot be greater than diameter of the tool)");
     }
     else
     {
         MessageBox.Show("Surface Roughness for tilt " + tilt.Text + ", and stepover " + stepOver.Text + ", is " + Math.Round(FunctionWise.getSurfaceRoughness(), 4) + " mm");
     }
 }
        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();
        }
 private void toolInitialPositionNext_Click_1(object sender, EventArgs e)
 {
     if (dataValidation())
     {
         FunctionWise.machiningParametersInitialization(double.Parse(verticalFeed.Text), double.Parse(horizonatalFeed.Text), double.Parse(rpm.Text), double.Parse(del_z.Text), double.Parse(del_phi.Text));
         FunctionWise.initializationSurfaceParameters(double.Parse(depth.Text), double.Parse(xMargin.Text), double.Parse(yMargin.Text), double.Parse(alpha.Text), double.Parse(beta.Text), double.Parse(stepSize.Text), surface);
         TaskSelectionForm.initializeRPMandFeed(double.Parse(rpm.Text), Math.Sqrt(Math.Pow(double.Parse(verticalFeed.Text), 2) + Math.Pow(double.Parse(horizonatalFeed.Text), 2)));
         TaskSelectionForm taskSelectionForm = new TaskSelectionForm(this);
         taskSelectionForm.Show();
         this.nextForm = taskSelectionForm;
         //TaskSelectionForm.rpm = double.Parse(rpm.Text);
         //TaskSelectionForm.feedRate = Math.Sqrt(Math.Pow(double.Parse(verticalFeed.Text),2)+ Math.Pow(double.Parse(horizonatalFeed.Text), 2));
         this.Hide();
         //FunctionWise.MainOfLogic();
     }
 }
Beispiel #6
0
 private void toolParameterNextButton_Click(object sender, EventArgs e)
 {
     if (dataValidation())
     {
         if (this.nextForm == null)
         {
             SelectWorkpieceProfileForm selectSurfaceForm = new SelectWorkpieceProfileForm(this);
             selectSurfaceForm.Show();
             this.nextForm = selectSurfaceForm;
         }
         else
         {
             this.nextForm.Show();
         }
         this.Hide();
         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);
         //FunctionWise.toolParametersInitialization(double.Parse(d.Text), double.Parse(h.Text), double.Parse(helixAngle.Text), double.Parse(rakeAngle.Text), int.Parse(noOfFlutes.Text));
     }
 }
Beispiel #7
0
 private void taskButton_Click(object sender, EventArgs e)
 {
     if (dataValidation())
     {
         if (exportToExcel.Checked)
         {
             saveFileDialog1.Filter   = "Excel Spreadsheet|*.xls";
             saveFileDialog1.FileName = (taskSimulateForces.Checked) ? "FCN data till time " + time.Text + " for lead " + lead.Text + " and tilt " + tilt.Text : "Cutting Zone at time " + time.Text + " for lead " + lead.Text + " and tilt " + tilt.Text;
             saveFileDialog1.Title    = "Export file at";
             if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 FunctionWise.locationOfExport   = saveFileDialog1.FileName;
                 FunctionWise.isExportExcelSheet = true;
             }
         }
         if (taskSimulateForces.Checked == true)
         {
             FunctionWise.initializeLeadAndTilt(double.Parse(lead.Text), double.Parse(tilt.Text));
             FunctionWise.initializeStepOver(followingCut.Checked, double.Parse(stepOver.Text));
             FunctionWise.plotGraphs(double.Parse(time.Text));
         }
         if (taskLeadTiltAngle.Checked == true)
         {
             FunctionWise.initializeStepOver(followingCut.Checked, double.Parse(stepOver.Text));
             FindLeadAndTiltForm output = new FindLeadAndTiltForm(double.Parse(time.Text));
             //output.Parent = this;
             output.Show();
         }
         if (taskDisplayCuttingZone.Checked == true)
         {
             FunctionWise.initializeLeadAndTilt(double.Parse(lead.Text), double.Parse(tilt.Text));
             FunctionWise.initializeStepOver(followingCut.Checked, double.Parse(stepOver.Text));
             FunctionWise.simulateEngagementRegion(double.Parse(time.Text));
         }
     }
 }