Esempio n. 1
0
        public void CreateNewChassis(int l_create_chassis, ChassisGUI create_chassisGUI_list)
        {
            ///<<summary>
            ///This section of the code creates a new tire and addes it to the List of tire objects
            ///</summary>

            #region Adding the new chassis to the list of Chassis Objects
            ChassisGUI chassisGUI = create_chassisGUI_list;
            Assy_List_Chassis.Insert(l_create_chassis, new Chassis(chassisGUI));
            Assy_List_Chassis[l_create_chassis]._ChassisName         = "Chassis " + Convert.ToString(l_create_chassis + 1);
            Assy_List_Chassis[l_create_chassis].ChassisID            = l_create_chassis + 1;
            Assy_List_Chassis[l_create_chassis]._UndocommandsChassis = new Stack <ICommand>();
            Assy_List_Chassis[l_create_chassis]._RedocommandsChassis = new Stack <ICommand>();
            #endregion
        }
Esempio n. 2
0
        public void ModifyObjectData(int l_modify_chassis, object modify_chassis_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 Chassis object to the List of Chassis Objects

            Chassis chassis_list;
            if (redo_Identifier == false)
            {
                chassis_list = new Chassis((ChassisGUI)modify_chassis_list);
            }
            else
            {
                chassis_list = (Chassis)modify_chassis_list;
            }

            ICommand cmd = Assy_List_Chassis[l_modify_chassis];
            Assy_List_Chassis[l_modify_chassis]._UndocommandsChassis.Push(cmd);

            chassis_list._UndocommandsChassis = Assy_List_Chassis[l_modify_chassis]._UndocommandsChassis;
            chassis_list._RedocommandsChassis = Assy_List_Chassis[l_modify_chassis]._RedocommandsChassis;
            chassis_list._ChassisName         = Assy_List_Chassis[l_modify_chassis]._ChassisName;

            Assy_List_Chassis[l_modify_chassis] = chassis_list;
            Assy_List_Chassis[l_modify_chassis].ChassisDataTable  = chassis_list.ChassisDataTable;
            Assy_List_Chassis[l_modify_chassis].ChassisID         = l_modify_chassis + 1;
            Assy_List_Chassis[l_modify_chassis].ChassisIsModified = true;

            PopulateDataTable(l_modify_chassis);

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

            ChassisGUI.DisplayChassisItem(Assy_List_Chassis[l_modify_chassis]);

            Kinematics_Software_New.Chassis_ModifyInVehicle(l_modify_chassis, Assy_List_Chassis[l_modify_chassis]);

            #endregion
        }
Esempio n. 3
0
        public Chassis(ChassisGUI _chassisGUI)
        {
            ChassisDataTable = _chassisGUI.ChassisDataTableGUI;

            #region Chassis Parameter Intitialization
            #region Suspended Mass Initialization
            SuspendedMass = _chassisGUI.SuspendedMass;
            #endregion

            #region Non Suspended Masses Initialization
            NonSuspendedMassFL = _chassisGUI._NonSuspendedMassFL;
            NonSuspendedMassFR = _chassisGUI._NonSuspendedMassFR;
            NonSuspendedMassRL = _chassisGUI._NonSuspendedMassRL;
            NonSuspendedMassRR = _chassisGUI._NonSuspendedMassRR;
            #endregion

            #region Suspended Mass Centre of Gravity Coordinates Initialization
            SuspendedMassCoGx = _chassisGUI._SuspendedMassCoGy;
            SuspendedMassCoGy = _chassisGUI._SuspendedMassCoGz;
            SuspendedMassCoGz = _chassisGUI._SuspendedMassCoGx;
            #endregion

            #region Non Suspended Mass Centres of Gravity Coordinates Initialization
            NonSuspendedMassFLCoGx = _chassisGUI._NonSuspendedMassFLCoGy;
            NonSuspendedMassFLCoGy = _chassisGUI._NonSuspendedMassFLCoGz;
            NonSuspendedMassFLCoGz = _chassisGUI._NonSuspendedMassFLCoGx;

            NonSuspendedMassFRCoGx = _chassisGUI._NonSuspendedMassFRCoGy;
            NonSuspendedMassFRCoGy = _chassisGUI._NonSuspendedMassFRCoGz;
            NonSuspendedMassFRCoGz = _chassisGUI._NonSuspendedMassFRCoGx;

            NonSuspendedMassRLCoGx = _chassisGUI._NonSuspendedMassRLCoGy;
            NonSuspendedMassRLCoGy = _chassisGUI._NonSuspendedMassRLCoGz;
            NonSuspendedMassRLCoGz = _chassisGUI._NonSuspendedMassRLCoGx;

            NonSuspendedMassRRCoGx = _chassisGUI._NonSuspendedMassRRCoGy;
            NonSuspendedMassRRCoGy = _chassisGUI._NonSuspendedMassRRCoGz;
            NonSuspendedMassRRCoGz = _chassisGUI._NonSuspendedMassRRCoGx;
            #endregion

            #endregion
        }
Esempio n. 4
0
        public void Undo_ModifyObjectData(int l_unexcute, ICommand command)
        {
            ///<summary>
            /// This code is to undo the modification action which the user has performed
            /// </summary>

            try
            {
                #region Undoing the modification
                ICommand cmd = Assy_List_Chassis[l_unexcute];
                Assy_List_Chassis[l_unexcute]._RedocommandsChassis.Push(cmd);

                Assy_List_Chassis[l_unexcute] = (Chassis)command;

                PopulateDataTable(l_unexcute);

                ChassisGUI.DisplayChassisItem(Assy_List_Chassis[l_unexcute]);

                Kinematics_Software_New.Chassis_ModifyInVehicle(l_unexcute, Assy_List_Chassis[l_unexcute]);

                #endregion
            }
            catch (Exception) { }
        }