// B.O.M Print private void button10_Click(object sender, EventArgs e) { Price = Cup_number * Price; DataSet DsData = GetDataSet(PadSerial.ToString(), Cup_number.ToString(), PadDiameter.ToString(), Price.ToString(), "4000"); ExportDataSetToExcel(DsData, "BOM.xlxs"); }
// Mould Finish private void button11_Click(object sender, EventArgs e) { Cavity_mass = combineShape1.Mass_value; System.Diagnostics.Debug.WriteLine("Mass: {0}", Cavity_mass); factor1.Mass_result.Text = Cavity_mass.ToString(); Demolding_Force = ForceCavity_calculation(Cavity_mass); System.Diagnostics.Debug.WriteLine("Demolding Force: {0}", Demolding_Force); factor1.DemoldingForce.Text = Demolding_Force.ToString(); Cup_number = CupNumber_calculation(900, 550); System.Diagnostics.Debug.WriteLine("Cup Number: {0}", Cup_number); draftVacuumGripper1.NumberOfVacuum.Text = Cup_number.ToString(); ForceperCup = ForceCup_calculation(Demolding_Force, Cup_number); double Force_to_lb = Convert.ToDouble(ForceperCup); Force_to_lb = Force_to_lb * 0.224; // Fixed Pressure double PSI = 88; PSI = PSI * 0.145; Cup_diameter = SuctionDiameter_calculation(Force_to_lb, PSI); System.Diagnostics.Debug.WriteLine("Suction Diameter: {0}", Cup_diameter); draftVacuumGripper1.PadDiameter.Text = Cup_diameter.ToString(); }
//Save private void button9_Click(object sender, EventArgs e) { //Gripper int[] Code = Getmodel(); // Box_area calculator if (combineBoxshape1.boxState2 == 1 && combineBoxshape1.boxState3 == 1 && combineBoxshape1.boxState4 == 1) { Box_A = combineBoxshape1.A_value; System.Diagnostics.Debug.WriteLine("A: {0}", Box_A); Box_B = combineBoxshape1.B_value; System.Diagnostics.Debug.WriteLine("B: {0}", Box_B); Box_C = combineBoxshape1.C_value; System.Diagnostics.Debug.WriteLine("C: {0}", Box_C); Box_Area = (2 * Box_A * Box_B) + (2 * Box_A * Box_C); System.Diagnostics.Debug.WriteLine("Area: {0}", Box_Area); } // Hardness if (rubberProperty1.HNState == 1) { Hardness = rubberProperty1.HN_value; System.Diagnostics.Debug.WriteLine("Hardness: {0}", Hardness); } Regression_cal(Box_Area, Hardness); //Vacuum Gripper if (combineBoxshape1.boxState == 1) { demold_f = demold_f / 10; System.Diagnostics.Debug.WriteLine("Vacuum Gripper"); factor1.Gripper_type.Text = "Vacuum Gripper"; Cavity_mass = combineBoxshape1.Mass_value; Cavity_mass = Cavity_mass + demold_f; System.Diagnostics.Debug.WriteLine("Mass: {0}", Cavity_mass); factor1.Mass_result.Text = Cavity_mass.ToString(); Demolding_Force = ForceCavity_calculation(Cavity_mass); System.Diagnostics.Debug.WriteLine("Demolding Force: {0}", Demolding_Force); factor1.DemoldingForce.Text = Demolding_Force.ToString(); Cup_number = CupNumber_calculation(900, 550); System.Diagnostics.Debug.WriteLine("Cup Number: {0}", Cup_number); draftVacuumGripper1.NumberOfVacuum.Text = Cup_number.ToString(); ForceperCup = ForceCup_calculation(Demolding_Force, Cup_number); Force_to_lb = Convert.ToDouble(ForceperCup); Force_to_lb = Force_to_lb * 0.224; // Fixed Pressure // double PSI = 88; PSI = PSI * 0.145; Cup_diameter = SuctionDiameter_calculation(Force_to_lb, PSI); System.Diagnostics.Debug.WriteLine("Suction Diameter: {0}", Cup_diameter); draftVacuumGripper1.PadDiameter.Text = Cup_diameter.ToString(); Image image = Image.FromFile(@"C:\Users\palmdotax\source\repos\GRipperDesign\Picture\Case1.png"); factor1.Set_picture.Image = image; //Cup int newDiamenter = Convert.ToInt32(Cup_diameter); newDiamenter = newDiamenter * 10; System.Diagnostics.Debug.WriteLine("Convert: {0}", newDiamenter); get_vacuumpadData(newDiamenter, "Flat"); } // Gripper แบบผังพืด else if (combineShape1.Support_value == 1) { Cavity_mass = combineShape1.Mass_value; System.Diagnostics.Debug.WriteLine("Rigid Gripper ผังผืด"); factor1.Gripper_type.Text = "Rigid Gripper ผังผืด"; Image image = Image.FromFile(@"C:\Users\palmdotax\source\repos\GRipperDesign\Picture\Gripper ผังผืด.png"); factor1.Set_picture.Image = image; } // Rigid Gripper else if (Code[2] == 3) { Cavity_mass = combineShape1.Mass_value; System.Diagnostics.Debug.WriteLine("Rigid Gripper"); factor1.Gripper_type.Text = "Rigid Gripper"; Image image = Image.FromFile(@"C:\Users\palmdotax\source\repos\GRipperDesign\Picture\Rigid Gripper.png"); factor1.Set_picture.Image = image; } else { System.Diagnostics.Debug.WriteLine("No recommended Gripper"); factor1.Gripper_type.Text = "No recommended Gripper"; } }