Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Method to Initalize the Grid Control, assign a Data Source and Main View to it, assign Value Change and Value Editor Methods
        /// </summary>

        #region Grid Control Initializer

        private void InitializeGridControls(int _noOfColumns, string _bandName, string _columnName1, string _columnName2, GridControl _gridControl, DataTable _dataSource, CustomBandedGridView _bandedGridView, bool Coordinate, Kinematics_Software_New _r)
        {
            float fontSize = 11;

            _bandedGridView             = CustomBandedGridView.CreateNewBandedGridView(0, _noOfColumns, _bandName);
            _gridControl.BindingContext = new BindingContext();
            _gridControl.DataSource     = null;
            _gridControl.ForceInitialize();
            _gridControl.DataSource           = _dataSource;
            _gridControl.MainView             = _bandedGridView;
            _bandedGridView.CellValueChanged += BandedGrid_LoadCase_CellValueChanged;
            _bandedGridView.ValidatingEditor += BandedGrid_LoadCase_ValidatingEditor;

            FontFamily LoadCaseFont = new FontFamily("Tahoma");

            _bandedGridView.Appearance.Row.Font = new Font(LoadCaseFont, fontSize);
            if (!Coordinate)
            {
                _bandedGridView = CustomBandedGridColumn.ColumnEditor_ForLoadCases(_bandedGridView, _columnName1, _columnName2);
            }
            else
            {
                _bandedGridView = CustomBandedGridColumn.ColumnEditor_ForSuspension(_bandedGridView, _r);
            }
        }
        public static CustomBandedGridView ColumnEditor_ForSuspension(CustomBandedGridView bandedGridView_ForSuspension, Kinematics_Software_New _r1)
        {
            bandedGridView_ForSuspension.OptionsView.ShowColumnHeaders = true;

            bandedGridView_ForSuspension.Columns[0].Caption = "Pick Up Point";
            bandedGridView_ForSuspension.Columns[0].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            bandedGridView_ForSuspension.Columns[0].BestFit();
            bandedGridView_ForSuspension.Columns[0].Group();
            bandedGridView_ForSuspension.Columns[0].Visible = false;

            bandedGridView_ForSuspension.Columns[1].Caption = "X (mm)";
            bandedGridView_ForSuspension.Columns[1].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            bandedGridView_ForSuspension.Columns[1].BestFit();
            bandedGridView_ForSuspension.Columns[1].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            bandedGridView_ForSuspension.Columns[1].DisplayFormat.FormatString = "n3";

            bandedGridView_ForSuspension.Columns[2].Caption = "Y (mm)";
            bandedGridView_ForSuspension.Columns[2].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            bandedGridView_ForSuspension.Columns[2].BestFit();
            bandedGridView_ForSuspension.Columns[2].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            bandedGridView_ForSuspension.Columns[2].DisplayFormat.FormatString = "n3";

            bandedGridView_ForSuspension.Columns[3].Caption = "Z (mm)";
            bandedGridView_ForSuspension.Columns[3].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            bandedGridView_ForSuspension.Columns[3].BestFit();
            bandedGridView_ForSuspension.Columns[3].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            bandedGridView_ForSuspension.Columns[3].DisplayFormat.FormatString = "n3";

            bandedGridView_ForSuspension.ExpandAllGroups();

            return(bandedGridView_ForSuspension);
        }
        public static CustomBandedGridView ColumnEditor_ForHeatMapControl(CustomBandedGridView _bandedGridView)
        {
            FontFamily font     = new FontFamily("Tahoma");
            float      fontSize = 10;

            //_bandedGridView.Columns[0].BestFit();


            for (int i = 0; i < _bandedGridView.Columns.Count; i++)
            {
                _bandedGridView.Columns[i].AppearanceCell.Font        = new Font(font, fontSize);
                _bandedGridView.Columns[i].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                _bandedGridView.Columns[i].DisplayFormat.FormatString = "n3";
            }

            _bandedGridView.Columns[0].AppearanceCell.Font = new Font(font, fontSize, FontStyle.Bold);
            _bandedGridView.Columns[0].AppearanceCell.TextOptions.Trimming = DevExpress.Utils.Trimming.None;
            _bandedGridView.Columns[0].AppearanceCell.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;

            if (_bandedGridView.Columns.Count > 2)
            {
                if (_bandedGridView.Columns.Count > 8)
                {
                    //_bandedGridView.Columns[10].Visible = false;
                }
            }

            _bandedGridView.OptionsView.ShowColumnHeaders = true;

            return(_bandedGridView);
        }
        public static CustomBandedGridView ColumnEditor_ForChassis(CustomBandedGridView bandedGridView_ForChassis)
        {
            bandedGridView_ForChassis.OptionsView.ShowColumnHeaders = true;

            bandedGridView_ForChassis.Columns[0].Caption = "Component";
            bandedGridView_ForChassis.Columns[0].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            bandedGridView_ForChassis.Columns[0].BestFit();
            bandedGridView_ForChassis.Columns[0].Group();
            bandedGridView_ForChassis.Columns[0].Visible = false;

            bandedGridView_ForChassis.Columns[1].Caption = "Mass (Kg)";
            bandedGridView_ForChassis.Columns[1].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            bandedGridView_ForChassis.Columns[1].BestFit();


            bandedGridView_ForChassis.Columns[2].Caption = "X (mm)";
            bandedGridView_ForChassis.Columns[2].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            bandedGridView_ForChassis.Columns[2].BestFit();


            bandedGridView_ForChassis.Columns[3].Caption = "Y (mm)";
            bandedGridView_ForChassis.Columns[3].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            bandedGridView_ForChassis.Columns[3].BestFit();


            bandedGridView_ForChassis.Columns[4].Caption = "Z (mm)";
            bandedGridView_ForChassis.Columns[4].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            bandedGridView_ForChassis.Columns[4].BestFit();



            bandedGridView_ForChassis.ExpandAllGroups();

            return(bandedGridView_ForChassis);
        }
        //static void button_Click(object sender, EventArgs e)
        //{
        //    r1.CopyFrontLeftTORight_Click(sender, e);
        //}
        #endregion

        #region Column Override method to edit the column properties for the Motion View
        public static CustomBandedGridView ColumnEditor_ForMotion(CustomBandedGridView bandedGridView_Motion, Kinematics_Software_New _r1)
        {
            bandedGridView_Motion.OptionsView.ShowColumnHeaders = true;

            bandedGridView_Motion.Columns[0].Caption = "Percentage Motion";
            bandedGridView_Motion.Columns[0].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            bandedGridView_Motion.Columns[0].BestFit();
            //bandedGridView_Motion.Columns[0].Group();
            bandedGridView_Motion.Columns[0].Visible = true;

            bandedGridView_Motion.Columns[1].Caption = "Wheel Deflection";
            bandedGridView_Motion.Columns[1].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            bandedGridView_Motion.Columns[1].BestFit();
            bandedGridView_Motion.Columns[1].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            bandedGridView_Motion.Columns[1].DisplayFormat.FormatString = "n3";

            bandedGridView_Motion.Columns[2].Caption = "Steering Angle";
            bandedGridView_Motion.Columns[2].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            bandedGridView_Motion.Columns[2].BestFit();
            bandedGridView_Motion.Columns[2].DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            bandedGridView_Motion.Columns[2].DisplayFormat.FormatString = "n3";

            bandedGridView_Motion.ExpandAllGroups();

            return(bandedGridView_Motion);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Method to initialize the <see cref="bandedGridView1"/>, set the <see cref="GridControl.DataSource"/> and perform some conditioning for the <see cref="GridControl.MainView"/> (which is the <see cref="bandedGridView1"/>)
        /// </summary>
        /// <param name="_legendDataTable"><see cref="DataTable"/> of the Legend</param>
        private void GridControlConditioning(DataTable _legendDataTable)
        {
            ///<summary> Initializing the <see cref="bandedGridView1"/> </summary>
            bandedGridView1 = CustomBandedGridView.CreateNewBandedGridView(0, 3, "Legend Data");

            ///<summary>Setting the DataSource and MainView of the <see cref="gridControl1"/></summary>
            GridControlConditioning_SetDataSource();

            ///<summary>Conditioning the Columns of the BandedGridView </summary>
            bandedGridView1 = CustomBandedGridColumn.ColumnEditor_ForLegend(bandedGridView1);

            ///<summary>Assigning the Colour Column of the Legend with the <see cref="repositoryItemColorPickEdit1"/> so that it displayes the colours from the <see cref="LegendDataTable"/></summary>
            bandedGridView1.Columns[2].ColumnEdit = repositoryItemColorPickEdit1;
        }
        /// <summary>
        /// Method to assign the <see cref="gridControlHeatMap"/> Data Source, Main View and Paint the Heat Map
        /// </summary>
        /// <param name="noOfColumns"></param>
        /// <param name="outputChannel"></param>
        private void DrawHeatMap(int noOfColumns, string outputChannel)
        {
            BatchRunGUI.bandedGridViewBatchRun = CustomBandedGridView.CreateNewBandedGridView(0, noOfColumns, outputChannel + " Heat Map");

            gridControlHeatMap.DataSource = HeatMapDataSource;

            gridControlHeatMap.MainView = BatchRunGUI.bandedGridViewBatchRun;

            BatchRunGUI.bandedGridViewBatchRun = CustomBandedGridColumn.ColumnEditor_ForHeatMapControl(BatchRunGUI.bandedGridViewBatchRun);

            ConditionHeatMap(OutputMode);

            BatchRunGUI.bandedGridViewBatchRun.Columns[1].SortOrder = DevExpress.Data.ColumnSortOrder.Descending;
        }
Exemplo n.º 9
0
        public static CustomBandedGridView CreateNewBandedGridView(int l_InputItem, int NoOfColumns, string _BandName)
        {
            bandedGridView      = new CustomBandedGridView();
            bandedGridView.Name = "Banded Grid View";

            band = CustomGridBand.CreateNewGridBand(NoOfColumns, _BandName);

            bandedGridView.Bands.Add(band);
            bandedGridView.OptionsView.ShowColumnHeaders = false;
            bandedGridView.OptionsCustomization.AllowQuickHideColumns = false;
            bandedGridView.OptionsView.ShowGroupPanel = false;


            return(bandedGridView);
        }
        public static CustomBandedGridView ColumnEditor_ForLoadCases(CustomBandedGridView _bandedGridView, string _caption1, string _caption2)
        {
            //float fontSize = 11;
            //FontFamily LoadCaseFont = new FontFamily("Tahoma");
            //_bandedGridView.Appearance.Row.Font = new Font(LoadCaseFont, fontSize);

            _bandedGridView.OptionsView.ShowColumnHeaders = true;

            _bandedGridView.Columns[0].Caption = _caption1;
            _bandedGridView.Columns[0].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            _bandedGridView.Columns[0].BestFit();

            _bandedGridView.Columns[1].Caption = _caption2;
            _bandedGridView.Columns[1].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            _bandedGridView.Columns[1].BestFit();

            _bandedGridView.ExpandAllGroups();

            return(_bandedGridView);
        }
Exemplo n.º 11
0
 public void InitializeGridControl_MotionView(int Index, Kinematics_Software_New _r1)
 {
     try
     {
         r1 = _r1;
         int guiIndex = Vehicle.List_Vehicle[Index].vehicle_Motion.MotionID - 1;
         MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion = CustomBandedGridView.CreateNewBandedGridView(guiIndex, 3, "Motion View");
         _r1.gridControl2.DataSource = Vehicle.List_Vehicle[Index].vehicle_Motion.Motion_DataTable;
         _r1.gridControl2.MainView   = MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion;
         MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion.FocusedRowChanged += BandedGridView_Motion_FocusedRowChanged;
         MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion.OptionsNavigation.EnterMoveNextColumn = true;
         MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion.OptionsNavigation.AutoMoveRowFocus    = true;
         MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion.OptionsNavigation.AutoFocusNewRow     = true;
         MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion = CustomBandedGridColumn.ColumnEditor_ForMotion(MotionGUI.List_MotionGUI[guiIndex].bandedGridView_Motion, _r1);
     }
     catch (Exception)
     {
         // If I open a project which has no motion but has a vehicle then this function will be called on account of the fact that the there exists a Vehicle. At that point, this method will fail because the guiIndex will be -1. SO to allow the remaining
         // open function to continue, this TryCatch block exists
     }
 }
Exemplo n.º 12
0
 public void GridControlDataSource(GridControl _gridControl, DataTable _dataTable, CustomBandedGridView _bandedGridview, Kinematics_Software_New _R1)
 {
     _gridControl.DataSource = _dataTable;
     _bandedGridview         = CustomBandedGridColumn.ColumnEditor_ForSuspension(_bandedGridview, _R1);
 }