DebugView
debugViewCpp.JPG

Chiron Debug View

An easy debug chart view for C++ and C#!

Available from NuGet or directly here:

Nuget

Download ChironDebugView

Use the ChironDebugView_CPP.cpp and Program.cs as an example. The "ChironDebugView.exe" is the application which shows the data. Note that you need the absolute path to this file! For the examples below assume the path is "C:\\Users\\Public\\Documents\\ChironTools\\ChironDebugView.exe", but you can replace this by some other folder ("packages\\...", e.g.)

C++ Usage

debugViewCpp.JPG

In the CPP folder you find the "ChiDebugOut.h" file where the ChiDebugOut class is defined. Add this header to your C++ project. The "ChironDebugView_CPP.cpp" file is an example how to use the "ChiDebugOut::showDebugWindow" function:

ChironDebugView_CPP.cpp
    
	// ChironDebugView_CPP.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include 
#include "ChiDebugOut.h"

int main()
{
    std::cout << "Hello World!\n";

    std::vector< std::vector> xData;
    std::vector x1;
    x1.push_back(3);
    x1.push_back(4);
    xData.push_back(x1);

    std::vector< std::vector> yData;
    std::vector y1;
    y1.push_back(33);
    y1.push_back(44);
    yData.push_back(y1);

    std::vector names;
    names.push_back("Plot1");

    std::vector plotModes;
    plotModes.push_back(0);

    ChiDebugOut::showDebugWindow("C:\\Users\\Public\\Documents\\ChironTools\\ChironDebugView.exe",
        "C:\\Users\\Public\\Documents\\ChironTools\\tempDebugFile1.txt", xData, yData, names, plotModes, "myTest");

    std::vector plots;
    ChiPlotData p1;
    p1.name = "Plot1";
    p1.mode = 0;
    p1.x.clear();
    p1.x.push_back(4);
    p1.x.push_back(5);
    p1.x.push_back(6);
    p1.y.clear();
    p1.y.push_back(4);
    p1.y.push_back(5);
    p1.y.push_back(6);
    plots.push_back(p1);
    ChiPlotData p2;
    p2.name = "Plot2";
    p2.mode = 4;
    p2.x.clear();
    p2.x.push_back(4);
    p2.x.push_back(5);
    p2.x.push_back(6);
    p2.y.clear();
    p2.y.push_back(5);
    p2.y.push_back(6);
    p2.y.push_back(7);
    plots.push_back(p2);

    ChiDebugOut::showDebugWindow("C:\\Users\\Public\\Documents\\ChironTools\\ChironDebugView.exe",
        "C:\\Users\\Public\\Documents\\ChironTools\\tempDebugFile2.txt", plots, "myTest2");
}


    
  

C# Usage

debugViewNet.JPG

In the NET folder you find the "ChiDebugOut.cs" file where the ChiDebugOut class is defined. Add this file to your C# project. The "Program.cs" file is an example how to use the "ChironDebugView_NET.ChiDebugOut.showDebugWindow" function:

Program.cs
    
	using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace ChironDebugView_NET
{
    internal class Program
    {
        static double gauss(double x, double a, double b, double c)
        {
            var v1 = (x - b);
            var v2 = (v1 * v1) / (2 * (c * c));
            var v3 = a * Math.Exp(-v2);
            return v3;
        }

        static void Main(string[] args)
        {
            int num = 100;
            float delta = 100.0f / num;
            List> xData = new List>() ;
            List x1 = new List();
            List x2 = new List();
            List> yData = new List>();
            List y1 = new List();
            List y2 = new List();
            for (int i = 0; i < num; i++)
            {
                x1.Add(i * delta);
                y1.Add((float)gauss(i * delta, 33, 57, 4));
                x2.Add(i * delta);
                y2.Add((float)gauss(i * delta, 100, 45, 4));
            }
            xData.Add(x1);
            yData.Add(y1);
            xData.Add(x2);
            yData.Add(y2);

            List < string> names = new List();
            names.Add("Gauss");
            names.Add("Dist");

            List plotModes = new List();
            plotModes.Add(0);
            plotModes.Add(0);

            ChironDebugView_NET.ChiDebugOut.showDebugWindow("C:\\Users\\Public\\Documents\\ChironTools\\ChironDebugView.exe",
                "C:\\Users\\Public\\Documents\\ChironTools\\tempDebugFile1.txt", xData, yData, names, plotModes, "myTest");


            num = 50;
            delta = 100.0f / num;
            List plots = new List();
            ChiPlotData p1 = new ChiPlotData();
            p1.name = "Plot1";
            p1.mode = 0;
            p1.x = new List();
            p1.y = new List();

            ChiPlotData p2 = new ChiPlotData();
            p2.name = "Plot2";
            p2.mode = 0;
            p2.x = new List();
            p2.y = new List();

            for (int i = 0; i < num; i++)
            {
                p1.x.Add(i * delta);
                p1.y.Add((float)gauss(i * delta, 44, 70, 4));
                p2.x.Add(i * delta);
                p2.y.Add((float)gauss(i * delta, 55, 65, 4));
            }

            plots.Add(p1);
            plots.Add(p2);

            ChironDebugView_NET.ChiDebugOut.showDebugWindow("C:\\Users\\Public\\Documents\\ChironTools\\ChironDebugView.exe",
                "C:\\Users\\Public\\Documents\\ChironTools\\tempDebugFile2.txt", plots, "myTest2");

            Trace.WriteLine("Finished.");
        }
    }
}

    
  

Donation

Send us an email if you need help or have some suggestions:

t.office@gmx.net

If you want to support our developement, you can donate here: