Ejemplo n.º 1
0
        public Damper(DamperGUI _damperGUI)
        {
            DamperDataTable = _damperGUI.DamperDataTableGUI;

            #region Damper Parameters Initialization
            DamperGasPressure = _damperGUI._DamperGasPressure;
            DamperShaftDia    = _damperGUI._DamperShaftDia;
            DamperFreeLength  = _damperGUI._DamperFreeLength;
            DamperStroke      = _damperGUI._DamperStroke;
            #endregion
        }
Ejemplo n.º 2
0
        public void CreateNewDamper(int l_create_damper, DamperGUI create_damperGUI_list)
        {
            ///<<summary>
            ///This section of the code creates a new damper and addes it to the List of damper objects
            ///</summary>

            #region Adding a new damper to the list of damper objects
            DamperGUI damperGUI = create_damperGUI_list;
            Assy_List_Damper.Insert(l_create_damper, new Damper(damperGUI));
            Assy_List_Damper[l_create_damper]._DamperName         = "Damper " + Convert.ToString(l_create_damper + 1);
            Assy_List_Damper[l_create_damper].DamperID            = l_create_damper + 1;
            Assy_List_Damper[l_create_damper]._UndocommandsDamper = new Stack <ICommand>();
            Assy_List_Damper[l_create_damper]._RedocommandsDamper = new Stack <ICommand>();
            #endregion
        }
Ejemplo n.º 3
0
        public void ModifyObjectData(int l_modify_damper, object modify_damper_list, bool redo_Identifier)
        {
            ///<summary>
            ///In this section of the code, the tire is bring modified and it is placed under the method called Execute because it is an Undoable operation
            ///</summary>


            #region Editing the Damper Object in the list of Damper Objects
            Damper damper_list;
            if (redo_Identifier == false)
            {
                damper_list = new Damper((DamperGUI)modify_damper_list);
            }
            else
            {
                damper_list = (Damper)modify_damper_list;
            }

            ICommand cmd = Assy_List_Damper[l_modify_damper];
            Assy_List_Damper[l_modify_damper]._UndocommandsDamper.Push(cmd);

            damper_list._UndocommandsDamper = Assy_List_Damper[l_modify_damper]._UndocommandsDamper;
            damper_list._RedocommandsDamper = Assy_List_Damper[l_modify_damper]._RedocommandsDamper;
            damper_list._DamperName         = Assy_List_Damper[l_modify_damper]._DamperName;

            Assy_List_Damper[l_modify_damper] = damper_list;
            Assy_List_Damper[l_modify_damper].DamperDataTable  = damper_list.DamperDataTable;
            Assy_List_Damper[l_modify_damper].DamperID         = l_modify_damper + 1;
            Assy_List_Damper[l_modify_damper].DamperIsModified = true;

            PopulateDataTable(l_modify_damper);

            #endregion

            if (redo_Identifier == false)
            {
                _RedocommandsDamper.Clear();
            }

            DamperGUI.DisplayDamperItem(Assy_List_Damper[l_modify_damper]);

            Kinematics_Software_New.Damper_ModifyInVehicle(l_modify_damper, Assy_List_Damper[l_modify_damper]);
        }
Ejemplo n.º 4
0
        public void Undo_ModifyObjectData(int l_unexecute_damper, ICommand command)
        {
            ///<summary>
            /// This code is to undo the modification action which the user has performed
            /// </summary>

            try
            {
                #region Undo the damper modification
                ICommand cmd = Assy_List_Damper[l_unexecute_damper];
                Assy_List_Damper[l_unexecute_damper]._RedocommandsDamper.Push(cmd);

                Assy_List_Damper[l_unexecute_damper] = (Damper)command;

                PopulateDataTable(l_unexecute_damper);

                DamperGUI.DisplayDamperItem(Assy_List_Damper[l_unexecute_damper]);

                Kinematics_Software_New.Damper_ModifyInVehicle(l_unexecute_damper, Assy_List_Damper[l_unexecute_damper]);

                #endregion
            }
            catch (Exception) { }
        }