public void SuspensionPlotterInvoker(SuspensionCoordinatesFront _scfl, SuspensionCoordinatesFrontRight _scfr, SuspensionCoordinatesRear _scrl, SuspensionCoordinatesRearRight _scrr) { #region Invoking the Plotter for all the four corners of the Suspension PlotSuspension(_scfl); PlotSuspension(_scfr); PlotSuspension(_scrl); PlotSuspension(_scrr); viewportLayout1.SetView(viewType.Isometric); viewportLayout1.ZoomFit(); #endregion }
public void Undo_ModifyObjectData(int l_unexcute_scfl, ICommand command) { ///<summary> /// This code is to undo the modification action which the user has performed /// </summary> #region Undo the Modification try { SuspensionCoordinatesFront _scfl_forUndo = (SuspensionCoordinatesFront)command; ICommand cmd = Assy_List_SCFL[l_unexcute_scfl]; Assy_List_SCFL[l_unexcute_scfl]._RedocommandsSCFL.Push(cmd); Assy_List_SCFL[l_unexcute_scfl] = _scfl_forUndo; PopulateDataTable(l_unexcute_scfl); SuspensionCoordinatesFrontGUI.DisplaySCFLItem(Assy_List_SCFL[l_unexcute_scfl]); #region Calling Undo method for Opposite Suspension if symmetric if (Assy_List_SCFL[l_unexcute_scfl].FrontSymmetry == true && IsUndoRedoCalledByRight == false) { SuspensionCoordinatesFrontRight.IsUndoRedoCalledByLeft_IdentifierMethod(true);// This method sets the IsUndoRedoCalledByLeft variable to true and prevents an infinte loop UndoRedo undoRedo = new UndoRedo(); undoRedo.Identifier(SuspensionCoordinatesFrontRight.Assy_List_SCFR[l_unexcute_scfl]._UndocommandsSCFR, SuspensionCoordinatesFrontRight.Assy_List_SCFR[l_unexcute_scfl]._RedocommandsSCFR, l_unexcute_scfl + 1, SuspensionCoordinatesFrontRight.Assy_List_SCFR[l_unexcute_scfl].SCFRIsModified); undoRedo.Undo(1); SuspensionCoordinatesFrontRight.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.EditFrontCAD(l_unexcute_scfl); Kinematics_Software_New.SCFL_ModifyInVehicle(l_unexcute_scfl, Assy_List_SCFL[l_unexcute_scfl]); } catch (Exception) { } #endregion }
public void ModifyObjectData(int l_modify_SCFL, object modify_scfl_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 Redo the Modification SuspensionCoordinatesFront _scfl_forRedo = (SuspensionCoordinatesFront)modify_scfl_list; ICommand cmd = Assy_List_SCFL[l_modify_SCFL]; Assy_List_SCFL[l_modify_SCFL]._UndocommandsSCFL.Push(cmd); Assy_List_SCFL[l_modify_SCFL] = _scfl_forRedo; PopulateDataTable(l_modify_SCFL); Assy_List_SCFL[l_modify_SCFL].SCFLIsModified = true; SuspensionCoordinatesFrontGUI.DisplaySCFLItem(Assy_List_SCFL[l_modify_SCFL]); #region Calling Redo method for Opposite Suspension if symmetric if (Assy_List_SCFL[l_modify_SCFL].FrontSymmetry == true && IsUndoRedoCalledByRight == false) { SuspensionCoordinatesFrontRight.IsUndoRedoCalledByLeft_IdentifierMethod(true);// This method sets the IsUndoRedoCalledByLeft variable to true and prevents an infinte loop UndoRedo undoRedo = new UndoRedo(); undoRedo.Identifier(SuspensionCoordinatesFrontRight.Assy_List_SCFR[l_modify_SCFL]._UndocommandsSCFR, SuspensionCoordinatesFrontRight.Assy_List_SCFR[l_modify_SCFL]._RedocommandsSCFR, l_modify_SCFL + 1, SuspensionCoordinatesFrontRight.Assy_List_SCFR[l_modify_SCFL].SCFRIsModified); undoRedo.Redo(1); SuspensionCoordinatesFrontRight.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.EditFrontCAD(l_modify_SCFL); Kinematics_Software_New.SCFL_ModifyInVehicle(l_modify_SCFL, Assy_List_SCFL[l_modify_SCFL]); #endregion }
public void ModifyObjectData(int l_modify_scfr, object modify_scfr_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 SuspensionCoordinatesFrontRight _scfr_forRedo = (SuspensionCoordinatesFrontRight)modify_scfr_list; ICommand cmd = Assy_List_SCFR[l_modify_scfr]; Assy_List_SCFR[l_modify_scfr]._UndocommandsSCFR.Push(cmd); Assy_List_SCFR[l_modify_scfr] = _scfr_forRedo; Assy_List_SCFR[l_modify_scfr].SCFRIsModified = true; PopulateDataTable(l_modify_scfr); SuspensionCoordinatesFrontRightGUI.DisplaySCFRItem(Assy_List_SCFR[l_modify_scfr]); #region Calling Redo method for Opposite Suspension if symmetric if (SuspensionCoordinatesFrontRight.Assy_List_SCFR[l_modify_scfr].FrontSymmetry == true && IsUndoRedoCalledByLeft == false) { SuspensionCoordinatesFront.IsUndoRedoCalledByRight_IdentifierMethod(true); UndoRedo undoRedo = new UndoRedo(); undoRedo.Identifier(SuspensionCoordinatesFront.Assy_List_SCFL[l_modify_scfr]._UndocommandsSCFL, SuspensionCoordinatesFront.Assy_List_SCFL[l_modify_scfr]._RedocommandsSCFL, l_modify_scfr + 1, SuspensionCoordinatesFront.Assy_List_SCFL[l_modify_scfr].SCFLIsModified); undoRedo.Redo(1); SuspensionCoordinatesFront.IsUndoRedoCalledByRight_IdentifierMethod(false);// This method sets the IsUndoRedoCalledByRight variable to false and allows the left suspenson coordinate to be undone } #endregion Kinematics_Software_New.EditFrontCAD(l_modify_scfr); Kinematics_Software_New.SCFR_ModifyInVehicle(l_modify_scfr, Assy_List_SCFR[l_modify_scfr]); #endregion }
public void EditFrontRightSuspension(int l_edit_scfr, SuspensionCoordinatesFrontRightGUI _scfrGUI) { ICommand cmd = Assy_List_SCFR[l_edit_scfr]; Assy_List_SCFR[l_edit_scfr]._UndocommandsSCFR.Push(cmd); #region Front Right Coordinates editing SuspensionCoordinatesFrontRight scfr_list = new SuspensionCoordinatesFrontRight(_scfrGUI); scfr_list._UndocommandsSCFR = Assy_List_SCFR[l_edit_scfr]._UndocommandsSCFR; scfr_list._RedocommandsSCFR = Assy_List_SCFR[l_edit_scfr]._RedocommandsSCFR; scfr_list._SCName = Assy_List_SCFR[l_edit_scfr]._SCName; Assy_List_SCFR[l_edit_scfr] = scfr_list; Assy_List_SCFR[l_edit_scfr].SCFRDataTable = scfr_list.SCFRDataTable; Assy_List_SCFR[l_edit_scfr].SCFR_ID = l_edit_scfr + 1; Assy_List_SCFR[l_edit_scfr].FrontSuspensionType(_scfrGUI); Assy_List_SCFR[l_edit_scfr].SCFRIsModified = true; PopulateDataTable(l_edit_scfr); #endregion _RedocommandsSCFR.Clear(); }
public static void DisplaySCFRItem(SuspensionCoordinatesFrontRight _scfr) { r1.gridControl2.DataSource = _scfr.SCFRDataTable; #region Delete //r1.A1xFR.Text = Convert.ToString(_scfr.A1x); //r1.A1yFR.Text = Convert.ToString(_scfr.A1y); //r1.A1zFR.Text = Convert.ToString(_scfr.A1z); //r1.B1xFR.Text = Convert.ToString(_scfr.B1x); //r1.B1yFR.Text = Convert.ToString(_scfr.B1y); //r1.B1zFR.Text = Convert.ToString(_scfr.B1z); //r1.C1xFR.Text = Convert.ToString(_scfr.C1x); //r1.C1yFR.Text = Convert.ToString(_scfr.C1y); //r1.C1zFR.Text = Convert.ToString(_scfr.C1z); //r1.D1xFR.Text = Convert.ToString(_scfr.D1x); //r1.D1yFR.Text = Convert.ToString(_scfr.D1y); //r1.D1zFR.Text = Convert.ToString(_scfr.D1z); //r1.E1xFR.Text = Convert.ToString(_scfr.E1x); //r1.E1yFR.Text = Convert.ToString(_scfr.E1y); //r1.E1zFR.Text = Convert.ToString(_scfr.E1z); //r1.F1xFR.Text = Convert.ToString(_scfr.F1x); //r1.F1yFR.Text = Convert.ToString(_scfr.F1y); //r1.F1zFR.Text = Convert.ToString(_scfr.F1z); //r1.G1xFR.Text = Convert.ToString(_scfr.G1x); //r1.G1yFR.Text = Convert.ToString(_scfr.G1y); //r1.G1zFR.Text = Convert.ToString(_scfr.G1z); //r1.H1xFR.Text = Convert.ToString(_scfr.H1x); //r1.H1yFR.Text = Convert.ToString(_scfr.H1y); //r1.H1zFR.Text = Convert.ToString(_scfr.H1z); //r1.I1xFR.Text = Convert.ToString(_scfr.I1x); //r1.I1yFR.Text = Convert.ToString(_scfr.I1y); //r1.I1zFR.Text = Convert.ToString(_scfr.I1z); //r1.J1xFR.Text = Convert.ToString(_scfr.J1x); //r1.J1yFR.Text = Convert.ToString(_scfr.J1y); //r1.J1zFR.Text = Convert.ToString(_scfr.J1z); //r1.JO1xFR.Text = Convert.ToString(_scfr.JO1x); //r1.JO1yFR.Text = Convert.ToString(_scfr.JO1y); //r1.JO1zFR.Text = Convert.ToString(_scfr.JO1z); //r1.K1xFR.Text = Convert.ToString(_scfr.K1x); //r1.K1yFR.Text = Convert.ToString(_scfr.K1y); //r1.K1zFR.Text = Convert.ToString(_scfr.K1z); //r1.M1xFR.Text = Convert.ToString(_scfr.M1x); //r1.M1yFR.Text = Convert.ToString(_scfr.M1y); //r1.M1zFR.Text = Convert.ToString(_scfr.M1z); //r1.N1xFR.Text = Convert.ToString(_scfr.N1x); //r1.N1yFR.Text = Convert.ToString(_scfr.N1y); //r1.N1zFR.Text = Convert.ToString(_scfr.N1z); //r1.O1xFR.Text = Convert.ToString(_scfr.O1x); //r1.O1yFR.Text = Convert.ToString(_scfr.O1y); //r1.O1zFR.Text = Convert.ToString(_scfr.O1z); //r1.P1xFR.Text = Convert.ToString(_scfr.P1x); //r1.P1yFR.Text = Convert.ToString(_scfr.P1y); //r1.P1zFR.Text = Convert.ToString(_scfr.P1z); //r1.Q1xFR.Text = Convert.ToString(_scfr.Q1x); //r1.Q1yFR.Text = Convert.ToString(_scfr.Q1y); //r1.Q1zFR.Text = Convert.ToString(_scfr.Q1z); //r1.R1xFR.Text = Convert.ToString(_scfr.R1x); //r1.R1yFR.Text = Convert.ToString(_scfr.R1y); //r1.R1zFR.Text = Convert.ToString(_scfr.R1z); //r1.W1xFR.Text = Convert.ToString(_scfr.W1x); //r1.W1yFR.Text = Convert.ToString(_scfr.W1y); //r1.W1zFR.Text = Convert.ToString(_scfr.W1z); //r1.RideHeightRefFRx.Text = Convert.ToString(_scfr.RideHeightRefx); //r1.RideHeightRefFRy.Text = Convert.ToString(_scfr.RideHeightRefy); //r1.RideHeightRefFRz.Text = Convert.ToString(_scfr.RideHeightRefz); #endregion }
public void CreateFrontCAD(CAD _susCADFront, SuspensionCoordinatesFrontGUI _scflGUI, /*int index,*/ SuspensionCoordinatesFront _scFL, SuspensionCoordinatesFrontRight _scFR) { ///<summary> ///This method is called during editing of a Suspension Item ///</summary> try { //_scflGUI.CADFront.InitializeEntities(); _susCADFront.ClearViewPort(false, false, null); _susCADFront.InitializeLayers(); _susCADFront.SuspensionPlotterInvoker(_scFL, 1, null, true, true, null, 0, 0, 0); _susCADFront.SuspensionPlotterInvoker(_scFR, 2, null, true, true, null, 0, 0, 0); _susCADFront.ARBConnector(_susCADFront.CoordinatesFL.InboardPickUp, _susCADFront.CoordinatesFR.InboardPickUp); _susCADFront.SteeringCSystemPlotter(_scFL, _scFR, _susCADFront.CoordinatesFL.InboardPickUp, _susCADFront.CoordinatesFR.InboardPickUp); _susCADFront.RefreshViewPort(); } 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 } }