コード例 #1
0
        /// <summary>
        /// Method to only assign the color table of the <see cref="CAD.viewportLayout1"/>'s <see cref="Legend"/>
        /// </summary>
        private void ReConditionLegend()
        {
            OutputClass tempOC = new OutputClass();

            GetDataLegendDataSource(ParentCAD.LegendDataTable);
            tempOC.MaxForce = MaxValue;
            tempOC.MinForce = MinValue;
            ParentCAD.AssignLegendColourTable();
            GridControlConditioning_SetDataSource();
        }
コード例 #2
0
        /// <summary>
        /// Event fired when the <see cref="simpleButtonOK"/> is clicked. This method repaints ALL the Arrows and Bars of the <see cref="CAD.viewportLayout1"/>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            ReConditionLegend();

            ParentCAD.PaintBarForce(UserNoForceWishboneColour, DisplayWishboneForces);

            ParentCAD.ConditionArrowForce(UserForceArrowStyle, ArrowNoForceCylLength, ArrowNoForceColor, ForcesToBeDisplayed);

            this.Hide();
        }
コード例 #3
0
        /// <summary>
        /// Medhot to Recreate the Entire Legend
        /// </summary>
        private void ReDoEntireLegend()
        {
            OutputClass tempOC = new OutputClass();

            GetDataLegendDataSource(ParentCAD.LegendDataTable);
            tempOC.MaxForce = MaxValue;
            tempOC.MinForce = MinValue;
            ParentCAD.PostProcessing(this, tempOC, UsersGradient1, UsersGradient2, UsersGradientStyle, NoOfSteps, StepSize);
            GridControlConditioning_SetDataSource();
        }
コード例 #4
0
 /// <summary>
 /// Event which is fired when the Colour of the <see cref="colorPickEdit2"/> is changed. This event causes the Legend Colours to be redrawn
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void colorPickEdit2_ColorChanged(object sender, EventArgs e)
 {
     ///<summary>Assinging the <see cref="UsersGradient1"/> property of this form</summary>
     UsersGradient2           = colorPickEdit2.Color;
     ParentCAD.GradientColor2 = UsersGradient2;
     ///<summary>Re-Painting the Colour Column of the <see cref="CAD.LegendDataTable"/></summary>
     ParentCAD.PaintLegendTableColorColumn(UsersGradient1, UsersGradient2);
     ///<summary>Reconditionring the Legend</summary>
     ReConditionLegend();
 }
コード例 #5
0
 /// <summary>
 /// Method to reset the Legend to its very initial state
 /// </summary>
 private void ResetLegend()
 {
     ///<summary>Resetting the <see cref="NoOfSteps"/> and the <see cref="StepSize"/> to because thats how the default legend is created</summary>
     NoOfSteps = 0;
     StepSize  = 0;
     textBoxNoOfSteps.Clear();
     textBoxStepSize.Clear();
     ///<summary>Calling the <see cref="CAD.PostProcessing(LegendEditor, OutputClass, Color, Color, GradientStyle, int, double)"/> method. This method is what initializes the Legend and hence it is use to reset it</summary>
     ParentCAD.PostProcessing(this, BaseOC, UsersGradient1, UsersGradient2, UsersGradientStyle, NoOfSteps, StepSize);
     GridControlConditioning_SetDataSource();
 }
コード例 #6
0
        private void AddRow()
        {
            ParentCAD.AddRowToLegendTable(0, 0, MaxValue, MinValue, UsersGradient1, UsersGradient2);

            //ParentCAD.LegendDataTable.AsEnumerable().OrderByDescending(legend => legend.Field<double>("Force Start"));

            ParentCAD.LegendDataTable.DefaultView.Sort = "Force Start";

            ParentCAD.LegendDataTable = ParentCAD.LegendDataTable.DefaultView.ToTable();

            ParentCAD.LegendDataTable = ParentCAD.LegendDataTable.AsEnumerable().Reverse().CopyToDataTable();

            ReConditionLegend();

            GridControlConditioning_SetDataSource();
        }
コード例 #7
0
        /// <summary>
        /// Public Inititalizer method which Performs all the Init activites required for a fully functioning <see cref="LegendEditor"/> Form
        /// </summary>
        /// <param name="_MasterOC">Base <see cref="OutputClass"/></param>
        /// <param name="_ParentCAD"></param>
        public void InitializeLegendEditor(OutputClass _MasterOC, CAD _ParentCAD)
        {
            ///<summary>Performing the Post Processing Activies of the Legend based on whether the Max and Min Value are 0. If they are 0 then it means the User is calling the Legend Editor for the very first time and hence the <see cref="BaseOC"/> should be passed</summary>
            if (MaxValue == 0 && MinValue == 0)
            {
                BaseOC = _MasterOC;
                _ParentCAD.PostProcessing(this, BaseOC, UsersGradient1, UsersGradient2, UsersGradientStyle, NoOfSteps, StepSize);
            }

            else
            {
                OutputClass tempOC = new OutputClass();
                tempOC.MaxForce = MaxValue;
                tempOC.MinForce = MinValue;
                _ParentCAD.PostProcessing(this, tempOC, UsersGradient1, UsersGradient2, UsersGradientStyle, NoOfSteps, StepSize);
            }

            ///<summary>Method to assign the Parent <see cref="CAD"/> object</summary>
            GetParentCADControl(_ParentCAD);

            ///<summary>Method to get the <see cref="LegendDataTable"/> property of this class</summary>
            GetDataLegendDataSource(_ParentCAD.LegendDataTable);

            ///<summary>Method to condition the <see cref="gridControl1"/> of this Form</summary>
            GridControlConditioning(_ParentCAD.LegendDataTable);

            ///<summary>Method to initialize the <see cref="CellValueChangedEventArgs"/> </summary>
            InitializeGridControlEvents();

            ///<remarks>
            ///It is best if the below lines of code are inside THIS Class and not the <see cref="VehicleGUI"/> class's <see cref="VehicleGUI.OutputDrawer(CAD, int, int, bool, bool)"/> method because this way, when the
            ///user wants to see the Forces of a different Motion Percentage, the options chosen by the user through the <see cref="LegendEditor"/> will be retained.
            /// </remarks>
            ///<summary>Painting the Bars according to Force Range in between which they lie. <see cref="LegendEditor.UserNoForceWishboneColour"/> value passed as <see cref="Color.White"/></summary>
            ParentCAD.PaintBarForce(UserNoForceWishboneColour, DisplayWishboneForces);

            ///<summary>Painting the Arrows according to Force Range in between which they lie</summary>
            ///<remarks>Since by default we have <see cref="ForceArrowStyle.Both"/> I can pass any random values for Length and Colour below</remarks>
            ParentCAD.ConditionArrowForce(UserForceArrowStyle, ArrowNoForceCylLength, ArrowNoForceColor, ForcesToBeDisplayed);
        }