public void RearSuspensionType(SuspensionCoordinatesRearGUI _scrlGUI) { #region Determining the Suspension Type using the GUI Object RearSymmetry = _scrlGUI.RearSymmetryGUI; DoubleWishboneIdentifierRear = _scrlGUI.DoubleWishboneIdentifierRear; McPhersonIdentifierRear = _scrlGUI.McPhersonIdentifierRear; PushrodIdentifierRear = _scrlGUI.PushrodIdentifierRear; PullrodIdentifierRear = _scrlGUI.PullrodIdentifierRear; UARBIdentifierRear = _scrlGUI.UARBIdentifierRear; TARBIdentifierRear = _scrlGUI.TARBIdentifierRear; #endregion }
public void CreateNewSCRL(int i_create_scrl, SuspensionCoordinatesRearGUI create_scrlGUI_list) { ///<<summary> ///This section of the code creates a new SCRL and addes it to the List of SCRL objects ///</summary> #region Adding a new SCRL object to the list of SCRL objects SuspensionCoordinatesRearGUI scrlGUI = create_scrlGUI_list; Assy_List_SCRL.Insert(i_create_scrl, new SuspensionCoordinatesRear(scrlGUI)); Assy_List_SCRL[i_create_scrl].RearSuspensionType(scrlGUI); Assy_List_SCRL[i_create_scrl]._SCName = "Rear Left Coordinates " + Convert.ToString(i_create_scrl + 1); Assy_List_SCRL[i_create_scrl].SCRL_ID = i_create_scrl + 1; Assy_List_SCRL[i_create_scrl]._UndocommandsSCRL = new Stack <ICommand>(); Assy_List_SCRL[i_create_scrl]._RedocommandsSCRL = new Stack <ICommand>(); #endregion }
public void CreateRearCAD(CAD _susCADRear, SuspensionCoordinatesRearGUI _scrlGUI, SuspensionCoordinatesRear _sCRL, SuspensionCoordinatesRearRight _sCRR) { try { //_scrlGUI.CADRear.InitializeEntities(); _susCADRear.ClearViewPort(false, false, null); _susCADRear.InitializeLayers(); _susCADRear.SuspensionPlotterInvoker(_sCRL, 3, null, true, true, null, 0, 0, 0); _susCADRear.SuspensionPlotterInvoker(_sCRR, 4, null, true, true, null, 0, 0, 0); _susCADRear.ARBConnector(_susCADRear.CoordinatesRL.InboardPickUp, _susCADRear.CoordinatesRR.InboardPickUp); _susCADRear.RefreshViewPort(); } catch (Exception) { // Keeping this code in try and catch block will help during Open operation. If the method is called without a Suspension or SuspensionGUI item being present, then the software won't crash } }
public void Undo_ModifyObjectData(int l_unexcute_scrl, ICommand command) { ///<summary> /// This code is to undo the modification action which the user has performed /// </summary> #region Undoing the modification try { SuspensionCoordinatesRear _scrl_forUndo = (SuspensionCoordinatesRear)command; ICommand cmd = Assy_List_SCRL[l_unexcute_scrl]; Assy_List_SCRL[l_unexcute_scrl]._RedocommandsSCRL.Push(cmd); Assy_List_SCRL[l_unexcute_scrl] = _scrl_forUndo; PopulateDataTable(l_unexcute_scrl); SuspensionCoordinatesRearGUI.DisplaySCRLItem(Assy_List_SCRL[l_unexcute_scrl]); #region Calling Undo method for Opposite Suspension if symmetric if (Assy_List_SCRL[l_unexcute_scrl].RearSymmetry == true && IsUndoRedoCalledByRight == false) { SuspensionCoordinatesRearRight.IsUndoRedoCalledByLeft_IdentifierMethod(true);// This method sets the IsUndoRedoCalledByLeft variable to true and prevents an infinte loop UndoRedo undoRedo = new UndoRedo(); undoRedo.Identifier(SuspensionCoordinatesRearRight.Assy_List_SCRR[l_unexcute_scrl]._UndocommandsSCRR, SuspensionCoordinatesRearRight.Assy_List_SCRR[l_unexcute_scrl]._RedocommandsSCRR, l_unexcute_scrl + 1, SuspensionCoordinatesRearRight.Assy_List_SCRR[l_unexcute_scrl].SCRRIsModified); undoRedo.Undo(1); SuspensionCoordinatesRearRight.IsUndoRedoCalledByLeft_IdentifierMethod(false);//This method sets the value of IsUndoRedoCalledByLeft to false so that the Right Suspension coordinate can also be Undone } #endregion Kinematics_Software_New.EditRearCAD(l_unexcute_scrl); Kinematics_Software_New.SCRL_ModifyInVehicle(l_unexcute_scrl, Assy_List_SCRL[l_unexcute_scrl]); } catch (Exception) { } #endregion }
/// <summary> /// /// </summary> /// <param name="l_modify_scrl"></param> /// <param name="modify_scrl_list"></param> /// <param name="redo_Identifier"></param> public void ModifyObjectData(int l_modify_scrl, object modify_scrl_list, bool redo_Identifier) { ///<summary> ///In this section of the code, the Suspension is bring modified and it is placed under the method called ModifyObjectData because it is an Undoable operation ///</summary> #region Redoing the modification SuspensionCoordinatesRear _scrl_forRedo = (SuspensionCoordinatesRear)modify_scrl_list; ICommand cmd = Assy_List_SCRL[l_modify_scrl]; Assy_List_SCRL[l_modify_scrl]._UndocommandsSCRL.Push(cmd); Assy_List_SCRL[l_modify_scrl] = _scrl_forRedo; PopulateDataTable(l_modify_scrl); Assy_List_SCRL[l_modify_scrl].SCRLIsModified = true; SuspensionCoordinatesRearGUI.DisplaySCRLItem(Assy_List_SCRL[l_modify_scrl]); #region Calling Redo method for Opposite Suspension if symmetric if (Assy_List_SCRL[l_modify_scrl].RearSymmetry == true && IsUndoRedoCalledByRight == false) { SuspensionCoordinatesRearRight.IsUndoRedoCalledByLeft_IdentifierMethod(true); UndoRedo undoRedo = new UndoRedo(); undoRedo.Identifier(SuspensionCoordinatesRearRight.Assy_List_SCRR[l_modify_scrl]._UndocommandsSCRR, SuspensionCoordinatesRearRight.Assy_List_SCRR[l_modify_scrl]._RedocommandsSCRR, l_modify_scrl + 1, SuspensionCoordinatesRearRight.Assy_List_SCRR[l_modify_scrl].SCRRIsModified); undoRedo.Redo(1); SuspensionCoordinatesRearRight.IsUndoRedoCalledByLeft_IdentifierMethod(false); } #endregion Kinematics_Software_New.EditRearCAD(l_modify_scrl); Kinematics_Software_New.SCRL_ModifyInVehicle(l_modify_scrl, Assy_List_SCRL[l_modify_scrl]); #endregion }
public void RearCADPreProcessor(SuspensionCoordinatesRearGUI _scrlGUI, int Index, bool IsRecreated) { try { if (!IsRecreated) { _scrlGUI.TabPage_RearCAD = CustomXtraTabPage.CreateNewTabPage_ForInputs("Rear Suspension ", SuspensionCoordinatesRear.Assy_List_SCRL[Index].SCRL_ID); } _scrlGUI.CADRear = new CAD(); _scrlGUI.TabPage_RearCAD.Controls.Add(_scrlGUI.CADRear); Kinematics_Software_New.TabControl_Outputs = CustomXtraTabPage.AddTabPages(Kinematics_Software_New.TabControl_Outputs, _scrlGUI.TabPage_RearCAD); _scrlGUI.CADRear.Dock = DockStyle.Fill; CreateRearCAD(_scrlGUI.CADRear, _scrlGUI, SuspensionCoordinatesRear.Assy_List_SCRL[Index], SuspensionCoordinatesRearRight.Assy_List_SCRR[Index]); _scrlGUI.CADRear.SetupViewPort(); _scrlGUI.CADRear.Visible = true; Kinematics_Software_New.TabControl_Outputs.SelectedTabPage = _scrlGUI.TabPage_RearCAD; } catch (Exception E) { string error = E.Message; // Keeping this code in try and catch block will help during Open operation. If the method is called without a Suspension or SuspensionGUI item being present, then the software won't crash } }
public void EditRearLeftSuspension(int l_edit_scrl, SuspensionCoordinatesRearGUI _scrlGUI) { ICommand cmd = Assy_List_SCRL[l_edit_scrl]; Assy_List_SCRL[l_edit_scrl]._UndocommandsSCRL.Push(cmd); #region Rear Left coordinates editing SuspensionCoordinatesRear scrl_list = new SuspensionCoordinatesRear(_scrlGUI); scrl_list._UndocommandsSCRL = Assy_List_SCRL[l_edit_scrl]._UndocommandsSCRL; scrl_list._RedocommandsSCRL = Assy_List_SCRL[l_edit_scrl]._RedocommandsSCRL; scrl_list._SCName = Assy_List_SCRL[l_edit_scrl]._SCName; Assy_List_SCRL[l_edit_scrl] = scrl_list; Assy_List_SCRL[l_edit_scrl].SCRLDataTable = scrl_list.SCRLDataTable; Assy_List_SCRL[l_edit_scrl].SCRL_ID = l_edit_scrl + 1; Assy_List_SCRL[l_edit_scrl].RearSuspensionType(_scrlGUI); Assy_List_SCRL[l_edit_scrl].SCRLIsModified = true; PopulateDataTable(l_edit_scrl); #endregion _RedocommandsSCRL.Clear(); }
public SuspensionCoordinatesRear(SuspensionCoordinatesRearGUI _scrlGUI) { SCRLDataTable = _scrlGUI.SCRLDataTableGUI; #region Rear Coordinates, Initialization #region Fixed Points REAR LEFT Initialization - Double Wishbone & McPherson // Coordinates of Fixed Point A A1x = _scrlGUI.A1y; A1y = _scrlGUI.A1z; A1z = _scrlGUI.A1x; // Coordinates of Fixed Point B B1x = _scrlGUI.B1y; B1y = _scrlGUI.B1z; B1z = _scrlGUI.B1x; // Coordinates of Fixed Point C C1x = _scrlGUI.C1y; C1y = _scrlGUI.C1z; C1z = _scrlGUI.C1x; // Coordinates of Fixed Point D D1x = _scrlGUI.D1y; D1y = _scrlGUI.D1z; D1z = _scrlGUI.D1x; // Initial Coordinates of Moving Point I I1x = _scrlGUI.I1y; I1y = _scrlGUI.I1z; I1z = _scrlGUI.I1x; // Initial Coordinates of Moving Point Jo JO1x = _scrlGUI.JO1y; JO1y = _scrlGUI.JO1z; JO1z = _scrlGUI.JO1x; // Initial Coordinates of Fixed (For now when there is no steering) Point N N1x = _scrlGUI.N1y; N1y = _scrlGUI.N1z; N1z = _scrlGUI.N1x; // Coordinates of Fixed Point Q Q1x = _scrlGUI.Q1y; Q1y = _scrlGUI.Q1z; Q1z = _scrlGUI.Q1x; // Coordinates of Fixed Point R R1x = _scrlGUI.R1y; R1y = _scrlGUI.R1z; R1z = _scrlGUI.R1x; #endregion #region Moving Points REAR LEFT Initialization - Double Wishbone & McPherson // Initial Coordinates of Moving Point J J1x = _scrlGUI.J1y; J1y = _scrlGUI.J1z; J1z = _scrlGUI.J1x; // Initial Coordinates of Moving Point H H1x = _scrlGUI.H1y; H1y = _scrlGUI.H1z; H1z = _scrlGUI.H1x; // Initial Coordinates of Moving Point G G1x = _scrlGUI.G1y; G1y = _scrlGUI.G1z; G1z = _scrlGUI.G1x; // Initial Coordinates of Moving Point F F1x = _scrlGUI.F1y; F1y = _scrlGUI.F1z; F1z = _scrlGUI.F1x; // Initial Coordinates of Moving Point E E1x = _scrlGUI.E1y; E1y = _scrlGUI.E1z; E1z = _scrlGUI.E1x; // Initial Coordinates of Moving Point K K1x = _scrlGUI.K1y; //IN THE HELPFILE CLEAFLY MENTION THAT THE X COORDINATE IS TO BE INPUT AS CONTACT K1y = _scrlGUI.K1z; //PATCH CENTRE - 1/2 TIRE WIDTH K1z = _scrlGUI.K1x; // Initial Coordinates of Moving Point L L1x = _scrlGUI.K1y + 157.48; //IN THE HELPFILE CLEAFLY MENTION THAT THE X COORDINATE IS TO BE INPUT AS CONTACT L1y = _scrlGUI.K1z; //PATCH CENTRE - 1/2 TIRE WIDTH L1z = _scrlGUI.K1x; // Initial Coordinates of Moving Point M M1x = _scrlGUI.M1y; M1y = _scrlGUI.M1z; M1z = _scrlGUI.M1x; // Initial Coordinates of Moving Point O O1x = _scrlGUI.O1y; O1y = _scrlGUI.O1z; O1z = _scrlGUI.O1x; // Initial Coordinates of Moving Point P P1x = _scrlGUI.P1y; P1y = _scrlGUI.P1z; P1z = _scrlGUI.P1x; // Coordinates of Moving Contact Patch Point W W1x = _scrlGUI.W1y; W1y = _scrlGUI.W1z; W1z = _scrlGUI.W1x; // Ride Height Reference Points RideHeightRefx = _scrlGUI.RideHeightRefy; RideHeightRefy = _scrlGUI.RideHeightRefz; RideHeightRefz = _scrlGUI.RideHeightRefx; #endregion #region Link Lengths Calculations //Link Lengths LowerFrontLength = (Math.Sqrt(Math.Pow(D1x - E1x, 2) + Math.Pow(D1y - E1y, 2) + Math.Pow(D1z - E1z, 2))); LowerRearLength = (Math.Sqrt(Math.Pow(C1x - E1x, 2) + Math.Pow(C1y - E1y, 2) + Math.Pow(C1z - E1z, 2))); UpperFrontLength = (Math.Sqrt(Math.Pow(A1x - F1x, 2) + Math.Pow(A1y - F1y, 2) + Math.Pow(A1z - F1z, 2))); UpperRearLength = (Math.Sqrt(Math.Pow(B1x - F1x, 2) + Math.Pow(B1y - F1y, 2) + Math.Pow(B1z - F1z, 2))); PushRodLength = (Math.Sqrt(Math.Pow(H1x - G1x, 2) + Math.Pow(H1y - G1y, 2) + Math.Pow(H1z - G1z, 2))); PushRodLength_1 = (Math.Sqrt(Math.Pow(H1x - G1x, 2) + Math.Pow(H1y - G1y, 2) + Math.Pow(H1z - G1z, 2))); ToeLinkLength = (Math.Sqrt(Math.Pow(N1x - M1x, 2) + Math.Pow(N1y - M1y, 2) + Math.Pow(N1z - M1z, 2))); DamperLength = (Math.Sqrt(Math.Pow(J1x - JO1x, 2) + Math.Pow(J1y - JO1y, 2) + Math.Pow(J1z - JO1z, 2))); ARBDroopLinkLength = (Math.Sqrt(Math.Pow(O1x - P1x, 2) + Math.Pow(O1y - P1y, 2) + Math.Pow(O1z - P1z, 2))); ARBBladeLength = (Math.Sqrt(Math.Pow(P1x - Q1x, 2) + Math.Pow(P1y - Q1y, 2) + Math.Pow(P1z - Q1z, 2))); #endregion #endregion }
public void EditRearLeftCoordinatesGUI(Kinematics_Software_New _r1, SuspensionCoordinatesRearGUI _scrlGUI) { r1 = _r1; #region Editing the Rear Left Suspension Coordinates GUI Class using its own Data Table which is modified through the User Interface's GridControl #region Editing the Coordinates if the Suspension Type is Double Wishbone if (_scrlGUI.DoubleWishboneIdentifierRear == 1) { #region DOUBLE WISHBONE #region Fixed Points DOUBLE WISHBONE // Coordinates of Fixed Point D D1x = SCRLDataTableGUI.Rows[0].Field <double>(1); D1y = SCRLDataTableGUI.Rows[0].Field <double>(2); D1z = SCRLDataTableGUI.Rows[0].Field <double>(3); // Coordinates of Fixed Point C C1x = SCRLDataTableGUI.Rows[1].Field <double>(1); C1y = SCRLDataTableGUI.Rows[1].Field <double>(2); C1z = SCRLDataTableGUI.Rows[1].Field <double>(3); // Coordinates of Fixed Point A A1x = SCRLDataTableGUI.Rows[2].Field <double>(1); A1y = SCRLDataTableGUI.Rows[2].Field <double>(2); A1z = SCRLDataTableGUI.Rows[2].Field <double>(3); // Coordinates of Fixed Point B B1x = SCRLDataTableGUI.Rows[3].Field <double>(1); B1y = SCRLDataTableGUI.Rows[3].Field <double>(2); B1z = SCRLDataTableGUI.Rows[3].Field <double>(3); // Initial Coordinates of Moving Point I I1x = SCRLDataTableGUI.Rows[4].Field <double>(1); I1y = SCRLDataTableGUI.Rows[4].Field <double>(2); I1z = SCRLDataTableGUI.Rows[4].Field <double>(3); // Initial Coordinates of Moving Point Q Q1x = SCRLDataTableGUI.Rows[5].Field <double>(1); Q1y = SCRLDataTableGUI.Rows[5].Field <double>(2); Q1z = SCRLDataTableGUI.Rows[5].Field <double>(3); // Coordinates of Fixed Point N N1x = SCRLDataTableGUI.Rows[6].Field <double>(1); N1y = SCRLDataTableGUI.Rows[6].Field <double>(2); N1z = SCRLDataTableGUI.Rows[6].Field <double>(3); // Coordinates of Fixed Point JO JO1x = SCRLDataTableGUI.Rows[7].Field <double>(1); JO1y = SCRLDataTableGUI.Rows[7].Field <double>(2); JO1z = SCRLDataTableGUI.Rows[7].Field <double>(3); // Ride Height Reference Points RideHeightRefx = SCRLDataTableGUI.Rows[8].Field <double>(1); RideHeightRefy = SCRLDataTableGUI.Rows[8].Field <double>(2); RideHeightRefz = SCRLDataTableGUI.Rows[8].Field <double>(3); if (_scrlGUI.TARBIdentifierRear == 1) { // Initial Coordinates of Fixed Point R (Only active when the it is T ARB) R1x = SCRLDataTableGUI.Rows[19].Field <double>(1); R1y = SCRLDataTableGUI.Rows[19].Field <double>(2); R1z = SCRLDataTableGUI.Rows[19].Field <double>(3); } #endregion #region Moving Points DOUBLE WISHBONE // Initial Coordinates of Moving Point J J1x = SCRLDataTableGUI.Rows[9].Field <double>(1); J1y = SCRLDataTableGUI.Rows[9].Field <double>(2); J1z = SCRLDataTableGUI.Rows[9].Field <double>(3); // Initial Coordinates of Moving Point H H1x = SCRLDataTableGUI.Rows[10].Field <double>(1); H1y = SCRLDataTableGUI.Rows[10].Field <double>(2); H1z = SCRLDataTableGUI.Rows[10].Field <double>(3); // Initial Coordinates of Moving Point O O1x = SCRLDataTableGUI.Rows[11].Field <double>(1); O1y = SCRLDataTableGUI.Rows[11].Field <double>(2); O1z = SCRLDataTableGUI.Rows[11].Field <double>(3); // Initial Coordinates of Moving Point G G1x = SCRLDataTableGUI.Rows[12].Field <double>(1); G1y = SCRLDataTableGUI.Rows[12].Field <double>(2); G1z = SCRLDataTableGUI.Rows[12].Field <double>(3); // Initial Coordinates of Moving Point F F1x = SCRLDataTableGUI.Rows[13].Field <double>(1); F1y = SCRLDataTableGUI.Rows[13].Field <double>(2); F1z = SCRLDataTableGUI.Rows[13].Field <double>(3); // Initial Coordinates of Moving Point E E1x = SCRLDataTableGUI.Rows[14].Field <double>(1); E1y = SCRLDataTableGUI.Rows[14].Field <double>(2); E1z = SCRLDataTableGUI.Rows[14].Field <double>(3); // Initial Coordinates of Moving Point P P1x = SCRLDataTableGUI.Rows[15].Field <double>(1); P1y = SCRLDataTableGUI.Rows[15].Field <double>(2); P1z = SCRLDataTableGUI.Rows[15].Field <double>(3); // Initial Coordinates of Moving Point K K1x = SCRLDataTableGUI.Rows[16].Field <double>(1); K1y = SCRLDataTableGUI.Rows[16].Field <double>(2); K1z = SCRLDataTableGUI.Rows[16].Field <double>(3); // Initial Coordinates of Moving Point M M1x = SCRLDataTableGUI.Rows[17].Field <double>(1); M1y = SCRLDataTableGUI.Rows[17].Field <double>(2); M1z = SCRLDataTableGUI.Rows[17].Field <double>(3); // Coordinates of Moving Contact Patch Point W W1x = SCRLDataTableGUI.Rows[18].Field <double>(1); W1y = SCRLDataTableGUI.Rows[18].Field <double>(2); W1z = SCRLDataTableGUI.Rows[18].Field <double>(3); #endregion #endregion } #endregion #region Editing the Coordinates if the Suspension Type is McPherson if (_scrlGUI.McPhersonIdentifierRear == 1) { #region MCPHERSON #region Fixed Points MCPHERSON // Coordinates of Fixed Point D D1x = SCRLDataTableGUI.Rows[0].Field <double>(1); D1y = SCRLDataTableGUI.Rows[0].Field <double>(2); D1z = SCRLDataTableGUI.Rows[0].Field <double>(3); // Coordinates of Fixed Point C C1x = SCRLDataTableGUI.Rows[1].Field <double>(1); C1y = SCRLDataTableGUI.Rows[1].Field <double>(2); C1z = SCRLDataTableGUI.Rows[1].Field <double>(3); // Initial Coordinates of Moving Point Q Q1x = SCRLDataTableGUI.Rows[2].Field <double>(1); Q1y = SCRLDataTableGUI.Rows[2].Field <double>(2); Q1z = SCRLDataTableGUI.Rows[2].Field <double>(3); // Coordinates of Fixed Point N N1x = SCRLDataTableGUI.Rows[3].Field <double>(1); N1y = SCRLDataTableGUI.Rows[3].Field <double>(2); N1z = SCRLDataTableGUI.Rows[3].Field <double>(3); // Coordinates of Fixed Point JO JO1x = SCRLDataTableGUI.Rows[4].Field <double>(1); JO1y = SCRLDataTableGUI.Rows[4].Field <double>(2); JO1z = SCRLDataTableGUI.Rows[4].Field <double>(3); // Ride Height Reference Coordinates RideHeightRefx = SCRLDataTableGUI.Rows[5].Field <double>(1); RideHeightRefy = SCRLDataTableGUI.Rows[5].Field <double>(2); RideHeightRefz = SCRLDataTableGUI.Rows[5].Field <double>(3); // Coordinates of Fixed Point JO J1x = SCRLDataTableGUI.Rows[6].Field <double>(1); J1y = SCRLDataTableGUI.Rows[6].Field <double>(2); J1z = SCRLDataTableGUI.Rows[6].Field <double>(3); #endregion #region Moving Points MCPHERSON // Initial Coordinates of Moving Point E E1x = SCRLDataTableGUI.Rows[7].Field <double>(1); E1y = SCRLDataTableGUI.Rows[7].Field <double>(2); E1z = SCRLDataTableGUI.Rows[7].Field <double>(3); // Initial Coordinates of Moving Point P P1x = SCRLDataTableGUI.Rows[8].Field <double>(1); P1y = SCRLDataTableGUI.Rows[8].Field <double>(2); P1z = SCRLDataTableGUI.Rows[8].Field <double>(3); // Initial Coordinates of Moving Point K K1x = SCRLDataTableGUI.Rows[9].Field <double>(1); K1y = SCRLDataTableGUI.Rows[9].Field <double>(2); K1z = SCRLDataTableGUI.Rows[9].Field <double>(3); // Initial Coordinates of Moving Point M M1x = SCRLDataTableGUI.Rows[10].Field <double>(1); M1y = SCRLDataTableGUI.Rows[10].Field <double>(2); M1z = SCRLDataTableGUI.Rows[10].Field <double>(3); // Coordinates of Moving Contact Patch Point W W1x = SCRLDataTableGUI.Rows[11].Field <double>(1); W1y = SCRLDataTableGUI.Rows[11].Field <double>(2); W1z = SCRLDataTableGUI.Rows[11].Field <double>(3); #endregion #endregion } #endregion #endregion }