我正在尝试绘制直流电动机的功能图

问题描述 投票:1回答:1

]1这是图的图像,我正在尝试禁用图的连续线。

这里是代码:

// Get the panel to draw
GraphPane Grafik = zedGraphControl1.GraphPane;

// Add name of graph
Grafik.Title.Text = "Mehanička k-ka motora jednosmerne struje sa nezavisnom pobudom";

// Add label of y axis
Grafik.YAxis.Title.Text = "Brzina obrtanja n = [o/min]";

// Add label of x axis
Grafik.XAxis.Title.Text = "Moment M = [Nm]";

// Show the x axis grid 
Grafik.XAxis.MajorGrid.IsVisible = true;
//Grafik.XAxis.MinorGrid.IsVisible = true;

// Show the y axis grid
Grafik.YAxis.MajorGrid.IsVisible = true;
//Grafik.YAxis.MinorGrid.IsVisible = true;

// Clear the list of curves in case the signals have already been drawn by
Grafik.CurveList.Clear();

// Create a list of points
PointPairList listavrednsoti = new PointPairList();
PointPairList Momentopterecenja = new PointPairList();
PointPairList Brzinaopterecenja = new PointPairList();           

double Mmin = 0;
double Mmax = 200;

// Fill in the list of points
for (int i = 0; i < Form2.n; i++)
{
    for (double M = Mmin; M <= Mmax; M += 0.1)
    {
        double _x = M;
        double _y = (((Form2.niz[i].GetSetNapon) / (Form2.niz[i].GetSetFluks)) - ((Form2.niz[i].GetSetOtpornostIndukta + Form2.niz[i].GetSetDodanaOtpornostIndukta) / ((30 / Math.PI) * (Math.Pow(Form2.niz[i].GetSetFluks, 2)))) * _x);
        PointPair tacke = new PointPair(_x, _y);

        listavrednsoti.Add(tacke);                    
    }

    for (double Mt = 0; Mt <= (((Form2.niz[i].GetSetNapon) / (Form2.niz[i].GetSetFluks)) - ((Form2.niz[i].GetSetOtpornostIndukta + Form2.niz[i].GetSetDodanaOtpornostIndukta) / ((30 / Math.PI) * (Math.Pow(Form2.niz[i].GetSetFluks, 2)))) * Form2.niz[i].GetSetMoment); Mt += 0.1)
    {
        double _x1 = Form2.niz[i].GetSetMoment;
        double _y1 = Mt;
        PointPair tacke1 = new PointPair(_x1, _y1);

        Momentopterecenja.Add(tacke1);
    }

    for (double Nt = 0; Nt <=Form2.niz[i].GetSetMoment; Nt += 0.1)
    {
        double _x2 = Nt;
        double _y2 = (((Form2.niz[i].GetSetNapon) / (Form2.niz[i].GetSetFluks)) - ((Form2.niz[i].GetSetOtpornostIndukta + Form2.niz[i].GetSetDodanaOtpornostIndukta) / ((30 / Math.PI) * (Math.Pow(Form2.niz[i].GetSetFluks, 2)))) * Form2.niz[i].GetSetMoment);
        PointPair tacke2 = new PointPair(_x2, _y2);

        Brzinaopterecenja.Add(tacke2);
    }

    // add the point
    LineItem _prava = Grafik.AddCurve("n = f(M)", listavrednsoti, Color.Red, SymbolType.None);
    LineItem _kriva = Grafik.AddCurve("", Momentopterecenja, Color.Blue, SymbolType.None);
    LineItem _kriva2 = Grafik.AddCurve("", Brzinaopterecenja, Color.Blue, SymbolType.None);             

    zedGraphControl1.AxisChange();
}       
c# windows visual-studio zedgraph
1个回答
0
投票

使用PointPairList代替pointpair

PointPairList列表=新的PointPairList(100);

如果它是GLOBAL变量,则不能更改此限制。我尝试过,这很混乱。

© www.soinside.com 2019 - 2024. All rights reserved.