public void PopulateSuspensionGridControl(Kinematics_Software_New _R1, VehicleGUI _vehicleGUI, Vehicle _vehicleGridControlPopulation, int OutputIndex) { _vehicleGUI.ocGUI_FL.bandedGridView_Outputs = CustomBandedGridView.CreateNewBandedGridView(1, 4, "Front Left Suspension Coordinates"); _vehicleGUI.GridControlOutputs_SCFL.BindingContext = new BindingContext(); _vehicleGUI.GridControlOutputs_SCFL.DataSource = null; _vehicleGUI.GridControlOutputs_SCFL.ForceInitialize(); _vehicleGUI.GridControlOutputs_SCFL.MainView = _vehicleGUI.ocGUI_FL.bandedGridView_Outputs; GridControlDataSource(_vehicleGUI.GridControlOutputs_SCFL, _vehicleGridControlPopulation.oc_FL[OutputIndex].OC_SC_DataTable, _vehicleGUI.ocGUI_FL.bandedGridView_Outputs, _R1); _vehicleGUI.ocGUI_FR.bandedGridView_Outputs = CustomBandedGridView.CreateNewBandedGridView(1, 4, "Front Right Suspension Coordinates"); _vehicleGUI.GridControlOutputs_SCFR.BindingContext = new BindingContext(); _vehicleGUI.GridControlOutputs_SCFR.DataSource = null; _vehicleGUI.GridControlOutputs_SCFR.ForceInitialize(); _vehicleGUI.GridControlOutputs_SCFR.MainView = _vehicleGUI.ocGUI_FR.bandedGridView_Outputs; GridControlDataSource(_vehicleGUI.GridControlOutputs_SCFR, _vehicleGridControlPopulation.oc_FR[OutputIndex].OC_SC_DataTable, _vehicleGUI.ocGUI_FR.bandedGridView_Outputs, _R1); _vehicleGUI.ocGUI_RL.bandedGridView_Outputs = CustomBandedGridView.CreateNewBandedGridView(1, 4, "Rear Left Suspension Coordinates"); _vehicleGUI.GridControlOutputs_SCRL.BindingContext = new BindingContext(); _vehicleGUI.GridControlOutputs_SCRL.DataSource = null; _vehicleGUI.GridControlOutputs_SCRL.ForceInitialize(); _vehicleGUI.GridControlOutputs_SCRL.MainView = _vehicleGUI.ocGUI_RL.bandedGridView_Outputs; GridControlDataSource(_vehicleGUI.GridControlOutputs_SCRL, _vehicleGridControlPopulation.oc_RL[OutputIndex].OC_SC_DataTable, _vehicleGUI.ocGUI_RL.bandedGridView_Outputs, _R1); _vehicleGUI.ocGUI_RR.bandedGridView_Outputs = CustomBandedGridView.CreateNewBandedGridView(1, 4, "Rear Right Suspension Coordinates"); _vehicleGUI.GridControlOutputs_SCRR.BindingContext = new BindingContext(); _vehicleGUI.GridControlOutputs_SCRR.DataSource = null; _vehicleGUI.GridControlOutputs_SCRR.ForceInitialize(); _vehicleGUI.GridControlOutputs_SCRR.MainView = _vehicleGUI.ocGUI_RR.bandedGridView_Outputs; GridControlDataSource(_vehicleGUI.GridControlOutputs_SCRR, _vehicleGridControlPopulation.oc_RR[OutputIndex].OC_SC_DataTable, _vehicleGUI.ocGUI_RR.bandedGridView_Outputs, _R1); }
/// <summary> /// /// </summary> /// <param name="_vehicleGUI"></param> /// <param name="Index"></param> /// <param name="IsRecreated"></param> /// <param name="_ImportCAD"></param> public void VehicleCADPreProcessor(VehicleGUI _vehicleGUI, int Index, bool IsRecreated, bool _ImportCAD, bool _SuspensionIsCreated) { try { if (!IsRecreated) { _vehicleGUI.TabPage_VehicleInputCAD = CustomXtraTabPage.CreateNewTabPage_ForInputs("Vehicle ", Vehicle.List_Vehicle[Index].VehicleID); } //_vehicleGUI.CADVehicleInputs = new CAD(); _vehicleGUI.CadIsTobeImported = _ImportCAD; if (_ImportCAD == true) { _vehicleGUI.TabPage_VehicleInputCAD.Controls.Add(_vehicleGUI.importCADForm); _vehicleGUI.importCADForm.Dock = DockStyle.Fill; } else { _vehicleGUI.TabPage_VehicleInputCAD.Controls.Add(_vehicleGUI.CADVehicleInputs); _vehicleGUI.CADVehicleInputs.Dock = DockStyle.Fill; } Kinematics_Software_New.TabControl_Outputs = CustomXtraTabPage.AddTabPages(Kinematics_Software_New.TabControl_Outputs, _vehicleGUI.TabPage_VehicleInputCAD); if (_SuspensionIsCreated) { if (_vehicleGUI.VisualizationType == VehicleVisualizationType.Generic) { EditORCreateVehicleCAD(_vehicleGUI.CADVehicleInputs, Vehicle.List_Vehicle[Index].VehicleID - 1, true, _vehicleGUI.Vehicle_MotionExists, 0, false, CadIsTobeImported, PlotWheel); } else if (_vehicleGUI.VisualizationType == VehicleVisualizationType.ImportedCAD) { EditORCreateVehicleCAD(_vehicleGUI.importCADForm.importCADViewport, Vehicle.List_Vehicle[Index].VehicleID - 1, true, _vehicleGUI.Vehicle_MotionExists, 0, false, CadIsTobeImported, PlotWheel); } } _vehicleGUI.CADVehicleInputs.SetupViewPort(); _vehicleGUI.CADVehicleInputs.Visible = true; Kinematics_Software_New.TabControl_Outputs.SelectedTabPage = _vehicleGUI.TabPage_VehicleInputCAD; } 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 Vehicle or VehicleGUI item being present, then the software won't crash } }