Click here to Skip to main content
13,356,318 members (65,352 online)
   

C#

 
AnswerRe: intel Hex file creator from Txt File Pin
Psudonym22-Aug-17 19:13
memberPsudonym22-Aug-17 19:13 
GeneralI want to display this method into graphics form inside Private void VtfGraphicalViewMode(Graphics graphics){} Pin
Member 1321093321-Aug-17 9:09
memberMember 1321093321-Aug-17 9:09 
GeneralRe: I want to display this method into graphics form inside Private void VtfGraphicalViewMode(Graphics graphics){} Pin
OriginalGriff21-Aug-17 21:04
protectorOriginalGriff21-Aug-17 21:04 
Questionhow can I add data to datatable and bind it to datagridview c# Pin
ali nagi20-Aug-17 18:27
memberali nagi20-Aug-17 18:27 
AnswerRe: how can I add data to datatable and bind it to datagridview c# Pin
Mycroft Holmes20-Aug-17 21:38
professionalMycroft Holmes20-Aug-17 21:38 
Questionhow cal i cal my list for left right and total and draw graphs Pin
Member 1321093318-Aug-17 5:31
memberMember 1321093318-Aug-17 5:31 
AnswerRe: how cal i cal my list for left right and total and draw graphs Pin
Dave Kreskowiak18-Aug-17 5:47
mvpDave Kreskowiak18-Aug-17 5:47 
Questionhow can i Display Frequency graph of data i have.i stored it into list<>.now i want o display it as a graphical form Pin
Member 1321093318-Aug-17 6:33
memberMember 1321093318-Aug-17 6:33 
namespace VistaBalanceAlgorithms
{
    public class VerticalForce
    {
        public static float SteadyStateTotalForce = 1;
        public static bool SteadyState = false;

        public VerticalForce(float[] frameValues)
        {
            Left = 0;
            Right = 0;
            Total = 0;

            if (frameValues != null)
            {
                float leftForce = frameValues.Take(frameValues.Length / 2).Sum();
                float rightForce = frameValues.Skip(frameValues.Length / 2).Sum();
                Left = (int)((leftForce / SteadyStateTotalForce) * 100);
                Right = (int)((rightForce / SteadyStateTotalForce) * 100);

                Left = Left < 0 ? 0 : Left;
                Right = Right < 0 ? 0 : Right;

                Total = Left + Right;
            }
        }

        public int Left { get; protected set; }
        public int Right { get; protected set; }
        public int Total { get; protected set; }
    }

    public  class VerticalForceGraph
    {
        private List<VerticalForce> vtfList = new List<VerticalForce>();

        public int BufferSize { get; set; }

        public void Add(VerticalForce vtf)
        {
            vtfList.Add(vtf);

            // remove first item if condition
            if(vtfList.Count > BufferSize)
            {
               // vtfList.RemoveRange(1, 1);
                vtfList.RemoveAt(0);
              
            }
        }

        public int[] GetLeftVTF()
        {
           return vtfList.Select(x => x.Left).ToArray();
        }

        public int[] GetRightVTF()
        {
            return vtfList.Select(x => x.Right).ToArray();
        }

        public int[] GetTotalVTF()
        {
            return vtfList.Select(x => x.Total).ToArray();
        }


    }
}



here i want to cal it on another class
//here i only created rectangle inside panel and draw x and y acc to panel scale
private void HeatmapViewMode(Graphics graphics)
        {
            graphics.SmoothingMode = SmoothingMode.AntiAlias;

            //draw border
            graphics.DrawRectangle(borderPen, new Rectangle(heatmapCoord_X, heatmapCoord_Y, heatmapWidth, heatmapHeight));
            // Draw CoP point & tail
            Pen semiTransPen = new Pen(Color.FromArgb(128, 0, 0, 255), 3);
            var points = m_CopTail.GetPoints().Select(c => { c.X = c.X - m_AutocenterOffsetX; c.Y = c.Y - m_AutocenterOffsetY; return c; }).ToArray();
            if (points != null && points.Length > 1)
            {
                SizeF copPointSize = new SizeF(10, 10);
                SizeF centerOffset = new SizeF(copPointSize.Width / 2, copPointSize.Height / 2);
                PointF copPoint = new PointF(COP.X - m_AutocenterOffsetX - centerOffset.Width,
                                             COP.Y - m_AutocenterOffsetY - centerOffset.Height);


                graphics.FillEllipse(Brushes.Red, new RectangleF(copPoint, copPointSize));

                if (m_CopTail.TimeRange.TotalSeconds > 0)
                    graphics.DrawCurve(semiTransPen, points);

                if ((Mode == ModeOfOperation.STABILITY_MODE && m_CopTail.HasAutoCenter() == true) ||
                    (m_CopTail.HasAutoCenter() == true && CopArrow == true))
                {
                    PointF centerPoint = new PointF(heatmapCoord_X + heatmapWidth / 2f,
                      heatmapCoord_Y + heatmapHeight / 2f);

                    PointF endPoint = new PointF(copPoint.X + centerOffset.Width, copPoint.Y + centerOffset.Height);

                    var distance = Math.Sqrt(Math.Pow((centerPoint.X - endPoint.X), 2) + Math.Pow((centerPoint.Y - endPoint.Y), 2));

                    float triggerZoneDiameter = 30f;
                    StabilityTriggerZoneDraw(graphics, triggerZoneDiameter, distance > triggerZoneDiameter);

                    graphics.DrawLine(stabilityArrowPen, centerPoint, endPoint);
                }


                if (heatmap != null)
                    heatmap.Draw(graphics, heatmapCoord_X - m_AutocenterOffsetX, heatmapCoord_Y - m_AutocenterOffsetY, 80);
            }
        }

AnswerRe: how can i Display Frequency graph of data i have.i stored it into list<>.now i want o display it as a graphical form Pin
Dave Kreskowiak18-Aug-17 8:15
mvpDave Kreskowiak18-Aug-17 8:15 
QuestionUnderstanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
Member 1336452016-Aug-17 17:14
memberMember 1336452016-Aug-17 17:14 
AnswerRe: Understanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
OriginalGriff16-Aug-17 20:48
protectorOriginalGriff16-Aug-17 20:48 
GeneralRe: Understanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
Member 1336452018-Aug-17 7:58
memberMember 1336452018-Aug-17 7:58 
GeneralRe: Understanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
OriginalGriff18-Aug-17 9:28
protectorOriginalGriff18-Aug-17 9:28 
AnswerRe: Understanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
BillWoodruff17-Aug-17 22:27
mvpBillWoodruff17-Aug-17 22:27 
QuestionRe: Understanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
Luc Pattyn18-Aug-17 3:11
professionalLuc Pattyn18-Aug-17 3:11 
AnswerRe: Understanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
OriginalGriff18-Aug-17 3:20
protectorOriginalGriff18-Aug-17 3:20 
GeneralRe: Understanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
Luc Pattyn18-Aug-17 3:25
professionalLuc Pattyn18-Aug-17 3:25 
AnswerRe: Understanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
Pete O'Hanlon18-Aug-17 3:46
protectorPete O'Hanlon18-Aug-17 3:46 
QuestionRe: Understanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
Luc Pattyn18-Aug-17 4:00
professionalLuc Pattyn18-Aug-17 4:00 
AnswerRe: Understanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
Pete O'Hanlon18-Aug-17 4:48
protectorPete O'Hanlon18-Aug-17 4:48 
GeneralRe: Understanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
OriginalGriff18-Aug-17 4:55
protectorOriginalGriff18-Aug-17 4:55 
GeneralRe: Understanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
Luc Pattyn18-Aug-17 5:30
professionalLuc Pattyn18-Aug-17 5:30 
GeneralRe: Understanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
Member 1336452018-Aug-17 8:24
memberMember 1336452018-Aug-17 8:24 
GeneralRe: Understanding the steps in creating a GUI project named DisplayQuotes in Visual Studios IDE, C# programming Pin
Richard Deeming18-Aug-17 8:33
mvpRichard Deeming18-Aug-17 8:33 
QuestionXML MySql error Pin
Rıza Berkay Ayçelebi14-Aug-17 2:34
memberRıza Berkay Ayçelebi14-Aug-17 2:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy |
Web04 | 2.8.180111.1 | Last Updated 23 Jan 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid