Beispiel #1
0
        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
        }
Beispiel #4
0
        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 EditFrontLeftSuspension(int l_edit_scfl, SuspensionCoordinatesFrontGUI _scflGUI)
        {
            ICommand cmd = Assy_List_SCFL[l_edit_scfl];

            Assy_List_SCFL[l_edit_scfl]._UndocommandsSCFL.Push(cmd);

            #region Front Left Cooridinates Editing
            SuspensionCoordinatesFront scfl_list = new SuspensionCoordinatesFront(_scflGUI);
            scfl_list._UndocommandsSCFL = Assy_List_SCFL[l_edit_scfl]._UndocommandsSCFL;
            scfl_list._RedocommandsSCFL = Assy_List_SCFL[l_edit_scfl]._RedocommandsSCFL;
            scfl_list._SCName           = Assy_List_SCFL[l_edit_scfl]._SCName;

            Assy_List_SCFL[l_edit_scfl] = scfl_list;
            Assy_List_SCFL[l_edit_scfl].SCFLDataTable = scfl_list.SCFLDataTable;
            Assy_List_SCFL[l_edit_scfl].SCFL_ID       = l_edit_scfl + 1;
            Assy_List_SCFL[l_edit_scfl].FrontSuspensionType(_scflGUI);
            Assy_List_SCFL[l_edit_scfl].SCFLIsModified = true;

            PopulateDataTable(l_edit_scfl);

            #endregion

            _RedocommandsSCFL.Clear();
        }
 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
     }
 }
        public static void DisplaySCFLItem(SuspensionCoordinatesFront _scfl)
        {
            r1.gridControl2.DataSource = _scfl.SCFLDataTable;

            #region Delete
            //r1.A1xFL.Text = Convert.ToString(_scfl.A1x);
            //r1.A1yFL.Text = Convert.ToString(_scfl.A1y);
            //r1.A1zFL.Text = Convert.ToString(_scfl.A1z);

            //r1.B1xFL.Text = Convert.ToString(_scfl.B1x);
            //r1.B1yFL.Text = Convert.ToString(_scfl.B1y);
            //r1.B1zFL.Text = Convert.ToString(_scfl.B1z);

            //r1.C1xFL.Text = Convert.ToString(_scfl.C1x);
            //r1.C1yFL.Text = Convert.ToString(_scfl.C1y);
            //r1.C1zFL.Text = Convert.ToString(_scfl.C1z);

            //r1.D1xFL.Text = Convert.ToString(_scfl.D1x);
            //r1.D1yFL.Text = Convert.ToString(_scfl.D1y);
            //r1.D1zFL.Text = Convert.ToString(_scfl.D1z);

            //r1.E1xFL.Text = Convert.ToString(_scfl.E1x);
            //r1.E1yFL.Text = Convert.ToString(_scfl.E1y);
            //r1.E1zFL.Text = Convert.ToString(_scfl.E1z);

            //r1.F1xFL.Text = Convert.ToString(_scfl.F1x);
            //r1.F1yFL.Text = Convert.ToString(_scfl.F1y);
            //r1.F1zFL.Text = Convert.ToString(_scfl.F1z);

            //r1.G1xFL.Text = Convert.ToString(_scfl.G1x);
            //r1.G1yFL.Text = Convert.ToString(_scfl.G1y);
            //r1.G1zFL.Text = Convert.ToString(_scfl.G1z);

            //r1.H1xFL.Text = Convert.ToString(_scfl.H1x);
            //r1.H1yFL.Text = Convert.ToString(_scfl.H1y);
            //r1.H1zFL.Text = Convert.ToString(_scfl.H1z);

            //r1.I1xFL.Text = Convert.ToString(_scfl.I1x);
            //r1.I1yFL.Text = Convert.ToString(_scfl.I1y);
            //r1.I1zFL.Text = Convert.ToString(_scfl.I1z);

            //r1.J1xFL.Text = Convert.ToString(_scfl.J1x);
            //r1.J1yFL.Text = Convert.ToString(_scfl.J1y);
            //r1.J1zFL.Text = Convert.ToString(_scfl.J1z);

            //r1.JO1xFL.Text = Convert.ToString(_scfl.JO1x);
            //r1.JO1yFL.Text = Convert.ToString(_scfl.JO1y);
            //r1.JO1zFL.Text = Convert.ToString(_scfl.JO1z);

            //r1.K1xFL.Text = Convert.ToString(_scfl.K1x);
            //r1.K1yFL.Text = Convert.ToString(_scfl.K1y);
            //r1.K1zFL.Text = Convert.ToString(_scfl.K1z);

            //r1.M1xFL.Text = Convert.ToString(_scfl.M1x);
            //r1.M1yFL.Text = Convert.ToString(_scfl.M1y);
            //r1.M1zFL.Text = Convert.ToString(_scfl.M1z);

            //r1.N1xFL.Text = Convert.ToString(_scfl.N1x);
            //r1.N1yFL.Text = Convert.ToString(_scfl.N1y);
            //r1.N1zFL.Text = Convert.ToString(_scfl.N1z);

            //r1.O1xFL.Text = Convert.ToString(_scfl.O1x);
            //r1.O1yFL.Text = Convert.ToString(_scfl.O1y);
            //r1.O1zFL.Text = Convert.ToString(_scfl.O1z);

            //r1.P1xFL.Text = Convert.ToString(_scfl.P1x);
            //r1.P1yFL.Text = Convert.ToString(_scfl.P1y);
            //r1.P1zFL.Text = Convert.ToString(_scfl.P1z);

            //r1.Q1xFL.Text = Convert.ToString(_scfl.Q1x);
            //r1.Q1yFL.Text = Convert.ToString(_scfl.Q1y);
            //r1.Q1zFL.Text = Convert.ToString(_scfl.Q1z);

            //r1.R1xFL.Text = Convert.ToString(_scfl.R1x);
            //r1.R1yFL.Text = Convert.ToString(_scfl.R1y);
            //r1.R1zFL.Text = Convert.ToString(_scfl.R1z);

            //r1.W1xFL.Text = Convert.ToString(_scfl.W1x);
            //r1.W1yFL.Text = Convert.ToString(_scfl.W1y);
            //r1.W1zFL.Text = Convert.ToString(_scfl.W1z);

            //r1.RideHeightRefFLx.Text = Convert.ToString(_scfl.RideHeightRefx);
            //r1.RideHeightRefFLy.Text = Convert.ToString(_scfl.RideHeightRefy);
            //r1.RideHeightRefFLz.Text = Convert.ToString(_scfl.RideHeightRefz);
            #endregion
        }