/// <summary> /// Method to obtain the information regardin the <see cref="BatchRunGUI"/> and by extension the <see cref="List{T}"/> of <see cref="LoadCase"/> inside the <see cref="BatchRunForm.BatchRunloadCases"/> /// </summary> /// <param name="_batchRunGUI"></param> public void GetBatchRunData(List <BatchRunGUI> _batchRunGUI) { R1 = Kinematics_Software_New.AssignFormVariable(); int BatchRunIndex = 0; for (int i = 0; i < _batchRunGUI.Count; i++) { if (_batchRunGUI[i].navBarGroupBatchRunResults.Name == R1.navBarControlResults.ActiveGroup.Name) { BatchRunIndex = i; break; } } BatchRunGUI_ForHeatMap = BatchRunGUI.batchRuns_GUI[BatchRunIndex]; LoadCaseList_ForHeatMap = BatchRunGUI_ForHeatMap.batchRun.BatchRunloadCases; GetOutputChannelData(); textEditBatchRun.Text = BatchRunGUI_ForHeatMap.Name; if (BatchRunGUI_ForHeatMap.batchRunVehicle.sc_FL.SuspensionMotionExists) { OutputMode = BatchRunOutputMode.MultipleOutputChannel; toolStripStatusLabelOPChannelModeValue.Text = "Multiple Channels"; } else { OutputMode = BatchRunOutputMode.SingleOutputChannel; toolStripStatusLabelOPChannelModeValue.Text = "Single Channel"; } }
/// <summary> /// Fires when the Create Suspension Button of the CoordinateMap UserCOntrol is clicked. This method creates a new Suspension item for each corner /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void simpleButtonCreateSuspension_Click(object sender, EventArgs e) { ///<summary>Getting the Object of the Main Form </summary> Kinematics_Software_New R1 = Kinematics_Software_New.AssignFormVariable(); R1.GeometryType(DoubleWishboneFront, DoubleWishboneRear, McPhersonFront, McPhersonRear); R1.ActuationType(PushrodFront, PullrodFront, PushrodRear, PullrodRear); R1.AntiRollBarType(UARBFront, TARBFront, UARBRear, TARBRear); R1.NoOfCouplings(NoOfCouplings); R1.FrontSymmetry = FrontSymmetry; R1.RearSymmetry = RearSymmetry; R1.CurrentSuspensionIsMapped = SuspensionCreationMode.Mapping; #region Creating new Suspension Coordinate items for each corner R1.barButtonSCFLItem.PerformClick(); R1.barButtonItemSCFRItem.PerformClick(); R1.barButtonItemSCRLItem.PerformClick(); R1.barButtonItemSCRRItem.PerformClick(); #endregion #region Invoking the CAD Creator R1.CreateFrontInputCAD(SuspensionCoordinatesFront.SCFLCounter - 1, false); R1.CreateRearInputCAD(SuspensionCoordinatesRear.SCRLCounter - 1, false); #endregion }
public SuspensionType(bool _onlyTemplate_DesignMode) { R1 = Kinematics_Software_New.AssignFormVariable(); InitializeComponent(); InitializeVariables(); OnlyTemplate_DesignMode = _onlyTemplate_DesignMode; }
public SuspensionType(bool _importCAD, XUC_CoordinateMap _coordinateMap) { R1 = Kinematics_Software_New.AssignFormVariable(); InitializeComponent(); InitializeVariables(); OnlyTemplate_ImportCAD = _importCAD; coordinateMap = _coordinateMap; }
/// <summary> /// Method to edit the actual Setup Change class' object /// </summary> /// <param name="setupChangeMaster"></param> /// <param name="identifier"></param> public void EditSetupChangeDeltas(SetupChange_CornerVariables setupChangeMaster, int identifier) { R1 = Kinematics_Software_New.AssignFormVariable(); int indexSetup = R1.navBarGroupSetupChange.SelectedLinkIndex; SetupChange.List_SetupChange[indexSetup].InitOrEditDeltas(this, setupChangeMaster, identifier); }
/// <summary> /// Link Clicked event of the <see cref="NavBarItem"/> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _navBaritemSetupChange_LinkClicked(object sender, NavBarLinkEventArgs e) { R1 = Kinematics_Software_New.AssignFormVariable(); int index = R1.navBarGroupSetupChange.SelectedLinkIndex; Kinematics_Software_New.TabControl_Outputs.SelectedTabPageIndex = Kinematics_Software_New.TabControl_Outputs.TabPages.IndexOf(List_SetupChangeGUI[index].TabPage_SetupChangeGUI); Kinematics_Software_New.TabControl_Outputs.TabPages[Kinematics_Software_New.TabControl_Outputs.SelectedTabPageIndex].PageVisible = true; }
/// <summary> /// Method to initialize the <see cref="BatchRunForm"/> /// </summary> /// <param name="_loadCasesForBatchRun"></param> public void InitializeBatchRunForm(List <LoadCase> _loadCasesForBatchRun) { R1 = Kinematics_Software_New.AssignFormVariable(); batchRun.toolStripProgressBar1.ProgressBar.Value = 0; batchRun.toolStripProgressBar1.ProgressBar.Update(); batchRun.PopulateBatchRunLoadCases(_loadCasesForBatchRun); R1.ComboboxBatchRunVehicleOperations(); R1.comboBoxBatchRunMotionOperations(); }
/// <summary> /// Link Clicked event for the <see cref="navBarItem_BatchRun_Results"/> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BatchRunGUI_LinkClicked(object sender, NavBarLinkEventArgs e) { R1 = Kinematics_Software_New.AssignFormVariable(); string Name = e.Link.Group.Name; int SelectedPageIndex = 0; int Index = 0; ///<summary>Finding out which of <see cref="BatchRunGUI"/> object from the <seealso cref="batchRuns_GUI"/> <see cref="List{T}"/> to use </summary> for (int i = 0; i < batchRuns_GUI.Count; i++) { if (Name == batchRuns_GUI[i].navBarGroupBatchRunResults.Name) { Index = batchRuns_GUI[i].navBarGroupBatchRunResults.navBarID - 1; break; } } ///<summary>Iterating through each item of the <see cref="navBarItem_BatchRun_Results"/> to find which one of it was clicked</summary> foreach (string itemName in batchRuns_GUI[Index].navBarItem_BatchRun_Results.Keys) { if (e.Link.ItemName == itemName) { ///<summary>Using the Key of the selected <see cref="navBarItem_BatchRun_Results"/> and passing it to the <see cref="TabPages_BatchRUn"/> dictionary to find the Tab Page which is to be made visible and selected </summary> SelectedPageIndex = Kinematics_Software_New.TabControl_Outputs.TabPages.IndexOf(batchRuns_GUI[Index].TabPages_BatchRUn[itemName]); Kinematics_Software_New.TabControl_Outputs.TabPages[SelectedPageIndex].PageVisible = true; Kinematics_Software_New.TabControl_Outputs.SelectedTabPageIndex = SelectedPageIndex; } } for (int i = 0; i < HeatMapWorksheet.Worksheets.Count; i++) { if (Kinematics_Software_New.TabControl_Outputs.SelectedTabPage.Contains(HeatMapWorksheet.Worksheets[i])) { R1.barButtonItemModifyHeatMap.Enabled = true; } else { R1.barButtonItemModifyHeatMap.Enabled = false; } } }
/// <summary> /// Method to ensure that the same <see cref="NavBarGroup"/> is not added again to the <see cref="Kinematics_Software_New.navBarControlResults"/> /// </summary> /// <param name="_batchRUnGUICheck"></param> /// <returns></returns> private bool NavBarGroupRepeatedCheck(BatchRunGUI _batchRUnGUICheck) { R1 = Kinematics_Software_New.AssignFormVariable(); if (R1.navBarControlResults.Groups.Count != 0) { foreach (NavBarGroup group in R1.navBarControlResults.Groups) { if (group.Name == _batchRUnGUICheck.navBarGroupBatchRunResults.Name) { return(true); } } return(false); } else { return(false); } }
/// <summary> /// Method to perform the NavBar Operations for the Batch Run /// </summary> /// <param name="_batchRunGUI"></param> public void BatchRun_NavBarGroupOperations(BatchRunGUI _batchRunGUI, List <LoadCase> _batchRunLoadCases) { R1 = Kinematics_Software_New.AssignFormVariable(); int index = _batchRunGUI.ID - 1; if (!NavBarGroupRepeatedCheck(_batchRunGUI)) { ///<summary>Creating a <see cref="NavBarGroup"/> object </summary> _batchRunGUI.navBarGroupBatchRunResults = _batchRunGUI.navBarGroupBatchRunResults.CreateNewNavBarGroup_For_VehicleResults(_batchRunGUI.navBarGroupBatchRunResults, R1.navBarControlResults, _batchRunGUI.ID, _batchRunGUI.Name); ///<summary>Adding the created <see cref="NavBarGroup"/> object to the <see cref="navBarControlResults"/></summary> R1.navBarControlResults.Groups.Add(_batchRunGUI.navBarGroupBatchRunResults); ///<summary>Activating the newly added group</summary> int groupIndex = R1.navBarControlResults.Groups.IndexOf(_batchRunGUI.navBarGroupBatchRunResults); R1.navBarControlResults.ActiveGroup = R1.navBarControlResults.Groups[groupIndex]; } CreateNavBarItem(_batchRunLoadCases, _batchRunGUI.navBarItem_BatchRun_Results, _batchRunGUI.navBarGroupBatchRunResults, R1.navBarControlResults); }
/// <summary> /// Event which is fired when the <see cref="simpleButtonOK"/> is clicked. This method transfers information to <see cref="Kinematics_Software_New.CreateHeatMapWorksheet(string, BatchRunOutputMode, HeatMapMode, SpecialCaseOption)"/> /// which then creates a new <see cref="HeatMapWorksheet"/> and also /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void simpleButtonOK_Click(object sender, EventArgs e) { toolStripProgressBar1.ProgressBar.Step = 10; toolStripProgressBar1.ProgressBar.Increment(10); toolStripProgressBar1.ProgressBar.Update(); R1 = Kinematics_Software_New.AssignFormVariable(); toolStripProgressBar1.ProgressBar.Increment(10); toolStripProgressBar1.ProgressBar.Update(); HeatMapName = textEditHeatMapName.Text; toolStripProgressBar1.ProgressBar.Increment(10); toolStripProgressBar1.ProgressBar.Update(); if (Operationmode == Mode.Create) { if (SpecialCase != SpecialCaseOption.None) { WorkSheetID = R1.CreateHeatMapWorksheet(textEditHeatMapName.Text, OutputMode, HeatMapMode.SpecialCase, SpecialCase); } else if (SpecialCase == SpecialCaseOption.None) { WorkSheetID = R1.CreateHeatMapWorksheet(textEditHeatMapName.Text, OutputMode, HeatMapMode.RegularHeatMap, SpecialCaseOption.None); } } toolStripProgressBar1.ProgressBar.Increment(10); toolStripProgressBar1.ProgressBar.Update(); HeatMapWorksheet.Worksheets[WorkSheetID - 1].GeatHeatMapInformation(OutputChannel, BatchRunGUI_ForHeatMap, LoadCaseList_ForHeatMap); toolStripProgressBar1.ProgressBar.Increment(10); toolStripProgressBar1.ProgressBar.Update(); toolStripProgressBar1.ProgressBar.Value = 100; toolStripProgressBar1.ProgressBar.Update(); this.Hide(); }
/// <summary> /// Overloaded Constructor /// </summary> /// <param name="_setupChangeName">Name of the Setup Change</param> /// <param name="_setupChangeID">ID of the Setup Change </param> public SetupChange_GUI(string _setupChangeName, int _setupChangeID) { R1 = Kinematics_Software_New.AssignFormVariable(); ///<summary>Assinging the Name</summary> _SetupChangeName = _setupChangeName + _setupChangeID; ///<summary>Assinging the ID</summary> _SetupChangeID = _setupChangeID; ///<summary>Initializing the <see cref="SetupChange_CornerVariables"/>objects</summary> setupChangeFL_GUI = new SetupChange_CornerVariables(); setupChangeFR_GUI = new SetupChange_CornerVariables(); setupChangeRL_GUI = new SetupChange_CornerVariables(); setupChangeRR_GUI = new SetupChange_CornerVariables(); XUC_SetupChange = new XUC_SetupChange(); ///<summary>Initializing the <see cref="NavBarItem"/> Object</summary> navBarItemSetupChange = new CusNavBarItem(_setupChangeName, _setupChangeID, this); ///<summary>Initialzing the <see cref="CustomXtraTabPage"/> object</summary> TabPage_SetupChangeGUI = CustomXtraTabPage.CreateNewTabPage_ForInputs(_setupChangeName, _setupChangeID); }
private void OutputDrawer(CAD vehicleCADDrawer_Output, int VehicleIndex, int OutputIndex, bool _importCAD, bool _plotWheel) { try { //vehicleCADDrawer_Output = new CAD(); vehicleCADDrawer_Output.GetCoG(Vehicle.List_Vehicle[VehicleIndex].chassis_vehicle); ///<remarks> Plotting the Front Left Outputs. CP Forces which are calculated are passed so that the arrows can be plotted for them <seealso cref="CAD.PlotArrows(double, double, double, double, double, double, bool)"/></remarks> vehicleCADDrawer_Output.SuspensionPlotterInvoker(Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex].scmOP, 1, Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex].waOP, false, _plotWheel, Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_FL_Fx, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_FL_Fy + Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex].CW, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_FL_Fz); ///<remarks> Plotting the Front Right Outputs. CP Forces which are calculated are passed so that the arrows can be plotted for them <seealso cref="CAD.PlotArrows(double, double, double, double, double, double, bool)"/></remarks> vehicleCADDrawer_Output.SuspensionPlotterInvoker(Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex].scmOP, 2, Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex].waOP, false, _plotWheel, Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_FR_Fx, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_FR_Fy + Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex].CW, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_FR_Fz); ///<remarks> Plotting the Rear Left Outputs. CP Forces which are calculated are passed so that the arrows can be plotted for them <seealso cref="CAD.PlotArrows(double, double, double, double, double, double, bool)"/></remarks> vehicleCADDrawer_Output.SuspensionPlotterInvoker(Vehicle.List_Vehicle[VehicleIndex].oc_RL[OutputIndex].scmOP, 3, Vehicle.List_Vehicle[VehicleIndex].oc_RL[OutputIndex].waOP, false, _plotWheel, Vehicle.List_Vehicle[VehicleIndex].oc_RL[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_RL_Fx, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_RL_Fy + Vehicle.List_Vehicle[VehicleIndex].oc_RL[OutputIndex].CW, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_RL_Fz); ///<remarks> Plotting the Rear Right Outputs. CP Forces which are calculated are passed so that the arrows can be plotted for them <seealso cref="CAD.PlotArrows(double, double, double, double, double, double, bool)"/></remarks> vehicleCADDrawer_Output.SuspensionPlotterInvoker(Vehicle.List_Vehicle[VehicleIndex].oc_RR[OutputIndex].scmOP, 4, Vehicle.List_Vehicle[VehicleIndex].oc_RR[OutputIndex].waOP, false, _plotWheel, Vehicle.List_Vehicle[VehicleIndex].oc_RR[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_RR_Fx, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_RR_Fy + Vehicle.List_Vehicle[VehicleIndex].oc_RR[OutputIndex].CW, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.TotalLoad_RR_Fz); vehicleCADDrawer_Output.ARBConnector(vehicleCADDrawer_Output.CoordinatesFL.InboardPickUp, vehicleCADDrawer_Output.CoordinatesFR.InboardPickUp); vehicleCADDrawer_Output.SteeringCSystemPlotter(Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex].scmOP, Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex].scmOP, vehicleCADDrawer_Output.CoordinatesFL.InboardPickUp, vehicleCADDrawer_Output.CoordinatesFR.InboardPickUp); vehicleCADDrawer_Output.ARBConnector(vehicleCADDrawer_Output.CoordinatesRL.InboardPickUp, vehicleCADDrawer_Output.CoordinatesRR.InboardPickUp); Vector3D ForcePLeft, ForceQLeft, ForcePRight, ForceQRight = new Vector3D(); ///<summary>Obtaining the Forces in the FL, FR, RL, RR Steering Rack Points of the FRONT</summary> GetAttachmentPointForces(Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex], out ForcePLeft, out ForceQLeft, out ForcePRight, out ForceQRight, true, false); CADVehicleOutputs.PlotLoadCase(Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.FL_BearingCoordinates, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.FR_BearingCoordinates, false, true, false, ForcePLeft, ForceQLeft, ForcePRight, ForceQRight); ///<summary>Obtaining the Forces in the FL, FR, RL, RR ARB Points of the FRONT</summary> GetAttachmentPointForces(Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex], out ForcePLeft, out ForceQLeft, out ForcePRight, out ForceQRight, false, false); CADVehicleOutputs.PlotLoadCase(Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.FL_BearingCoordinates, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.FR_BearingCoordinates, false, false, false, ForcePLeft, ForceQLeft, ForcePRight, ForceQRight); ///<summary>Obtaining the Forces in the FL, FR, RL, RR Steering Rack Points of the REAR</summary> GetAttachmentPointForces(Vehicle.List_Vehicle[VehicleIndex].oc_RL[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].oc_RR[OutputIndex], out ForcePLeft, out ForceQLeft, out ForcePRight, out ForceQRight, false, false); CADVehicleOutputs.PlotLoadCase(Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.RL_BearingCoordinates, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.RR_BearingCoordinates, false, true, false, ForcePLeft, ForceQLeft, ForcePRight, ForceQRight); ///<summary>Using manipulation to obtain the forces on the Left and Right Steering Column Attachment Points</summary> GetAttachmentPointForces(Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex], out ForcePLeft, out ForceQLeft, out ForcePRight, out ForceQRight, false, true); CADVehicleOutputs.PlotLoadCase(Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.SteeringColumnBearing, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.SteeringColumnBearing, false, true, true, ForcePLeft, new Vector3D(), ForcePRight, new Vector3D()); vehicleCADDrawer_Output.PlotLoadCaseInputForces(Vehicle.List_Vehicle[this._VehicleID - 1].chassis_vehicle, Vehicle.List_Vehicle[this._VehicleID - 1].vehicleLoadCase); vehicleCADDrawer_Output.PlotMomentArrows(Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex].scmOP.W1x, Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex].scmOP.W1y, Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex].scmOP.W1z, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.NSM_FL_Mx, Vehicle.List_Vehicle[VehicleIndex].vehicleLoadCase.NSM_FL_Mz); ///<remarks>Order of Painting is Important</remarks> ///<summary>Creating a temporary Output Class Variable which will hold the Max and Min Values collated from ALL THE 4 CORNERS</summary> OutputClass MasterOC = new OutputClass(); MasterOC = MasterOC.PopulateForceLists(Vehicle.List_Vehicle[VehicleIndex].oc_FL[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].oc_FR[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].oc_RL[OutputIndex], Vehicle.List_Vehicle[VehicleIndex].oc_RR[OutputIndex]); ///<summary>Calling the <see cref="LegendEditor"/> and initializing it and then calling the <see cref="CAD.PostProcessing(LegendEditor, OutputClass, Color, Color, GradientStyle, int, double)"/> method which draws the DataTable for the Legend and the Legend too </summary> LoadCaseLegend.InitializeLegendEditor(MasterOC, CADVehicleOutputs); ///<summary>This Loop exists to allow the imported files to be translated around the Suspension </summary> if (_importCAD && OutputIGESPlotted && TranslateChassisToGround) { r1 = Kinematics_Software_New.AssignFormVariable(); int opIndex = 0; int motionInd = Vehicle.List_Vehicle[_VehicleID - 1].vehicle_Motion.MotionID - 1; opIndex = MotionGUI.List_MotionGUI[motionInd].bandedGridView_Motion.FocusedRowHandle; ImportedCADTranslationHistory.Add(-Vehicle.List_Vehicle[_VehicleID - 1].oc_FL[opIndex].FinalRideHeight_1); for (int i = 0; i < vehicleCADDrawer_Output.viewportLayout1.Entities.Count; i++) { if (vehicleCADDrawer_Output.viewportLayout1.Entities[i] is BlockReference) { BlockReference br = vehicleCADDrawer_Output.viewportLayout1.Entities[i] as BlockReference; br.Translate(0, -(ImportedCADTranslationHistory[ImportedCADTranslationHistory.Count - 1] - ImportedCADTranslationHistory[ImportedCADTranslationHistory.Count - 2]), 0); } } } devDept.Eyeshot.RegenOptions ro = new devDept.Eyeshot.RegenOptions(); vehicleCADDrawer_Output.viewportLayout1.Entities.Regen(ro); vehicleCADDrawer_Output.viewportLayout1.Invalidate(); } catch (Exception E) { MessageBox.Show(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 crasha } }