Пример #1
0
        private void CreateSeriesFromS2P()
        {
            if (chrtCntrl == null)
            {
                return;
            }

            Double[] x = GetArrayOfReal(allVectors["Freq"]);
            ChartContoller.ChartAreaType linear = ChartContoller.ChartAreaType.Linear;
            SeriesChartType line  = SeriesChartType.Line;
            SeriesChartType point = SeriesChartType.Point;

            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["S11"]), $"Mag S11 dB", linear, line, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["S11"]), $"Mag S11 dB", linear, point, Color.Red);

            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["S11"]), $"Arg S11", linear, line, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["S11"]), $"Arg S11", linear, point, Color.Red);

            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["S21"]), $"Mag S21 dB", linear, line, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["S21"]), $"Mag S21 dB", linear, point, Color.Red);

            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["S21"]), $"Arg S21", linear, line, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["S21"]), $"Arg S21", linear, point, Color.Red);

            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["S12"]), $"Mag S12 dB", linear, line, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["S12"]), $"Mag S12 dB", linear, point, Color.Red);

            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["S12"]), $"Arg S12", linear, line, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["S12"]), $"Arg S12", linear, point, Color.Red);

            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["S22"]), $"Mag S22 dB", linear, line, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["S22"]), $"Mag S22 dB", linear, point, Color.Red);

            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["S22"]), $"Arg S22", linear, line, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["S22"]), $"Arg S22", linear, point, Color.Red);
        }
Пример #2
0
        private void CreateSeries()
        {
            if (chrtCntrl == null)
            {
                return;
            }

            chrtCntrl.Clear();

            Double[] x = new Double[freqs.Count];
            x = freqs.ToArray();

            ChartContoller.ChartAreaType logx   = ChartContoller.ChartAreaType.LogX;
            ChartContoller.ChartAreaType linear = ChartContoller.ChartAreaType.Linear;
            ChartContoller.ChartAreaType polar  = ChartContoller.ChartAreaType.Polar;
            SeriesChartType line  = SeriesChartType.Line;
            SeriesChartType point = SeriesChartType.Point;

            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["Z in"]), $"In ReZ err = {measRe}%", logx, line, Color.Blue);
            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["Zmeas in"]), $"In ReZ err = {measRe}%", logx, point, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["Zcalc in"]), $"In ReZ err = {measRe}%", logx, line, Color.Red);

            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["Z in"]), $"In ImZ err = {measIm}%", logx, line, Color.Blue);
            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["Zmeas in"]), $"In ImZ err = {measIm}%", logx, point, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["Zcalc in"]), $"In ImZ err = {measIm}%", logx, line, Color.Red);

            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["Y in"]), $"In ReY err = {measRe}%", logx, line, Color.Blue);
            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["Ymeas in"]), $"In ReY err = {measRe}%", logx, point, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["Ycalc in"]), $"In ReY err = {measRe}%", logx, line, Color.Red);

            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["Y in"]), $"In ImY err = {measIm}%", logx, line, Color.Blue);
            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["Ymeas in"]), $"In ImY err = {measIm}%", logx, point, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["Ycalc in"]), $"In ImY err = {measIm}%", logx, line, Color.Red);

            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["Z out"]), $"Out ReZ err = {measRe}%", logx, line, Color.Blue);
            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["Zmeas out"]), $"Out ReZ err = {measRe}%", logx, point, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["Zcalc out"]), $"Out ReZ err = {measRe}%", logx, line, Color.Red);

            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["Z out"]), $"Out ImZ err = {measIm}%", logx, line, Color.Blue);
            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["Zmeas out"]), $"Out ImZ err = {measIm}%", logx, point, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["Zcalc out"]), $"Out ImZ err = {measIm}%", logx, line, Color.Red);

            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["Y out"]), $"Out ReY err = {measRe}%", logx, line, Color.Blue);
            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["Ymeas out"]), $"Out ReY err = {measRe}%", logx, point, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfReal(allVectors["Ycalc out"]), $"Out ReY err = {measRe}%", logx, line, Color.Red);

            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["Y out"]), $"Out ImY err = {measIm}%", logx, line, Color.Blue);
            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["Ymeas out"]), $"Out ImY err = {measIm}%", logx, point, Color.Red);
            chrtCntrl.AddSerias(x, GetArrayOfImag(allVectors["Ycalc out"]), $"Out ImY err = {measIm}%", logx, line, Color.Red);

            chrtCntrl.AddSerias(GetArrayOfReal(allVectors["Z in"]), GetArrayOfImag(allVectors["Z in"]), $"In Z-plane", linear, line, Color.Blue);
            chrtCntrl.AddSerias(GetArrayOfReal(allVectors["Zmeas in"]), GetArrayOfImag(allVectors["Zmeas in"]), $"In Z-plane", linear, point, Color.Red);
            chrtCntrl.AddSerias(GetArrayOfReal(allVectors["Zcalc in"]), GetArrayOfImag(allVectors["Zcalc in"]), $"In Z-plane", linear, line, Color.Red);

            chrtCntrl.AddSerias(GetArrayOfReal(allVectors["Y in"]), GetArrayOfImag(allVectors["Y in"]), $"In Y-plane", linear, line, Color.Blue);
            chrtCntrl.AddSerias(GetArrayOfReal(allVectors["Ymeas in"]), GetArrayOfImag(allVectors["Ymeas in"]), $"In Y-plane", linear, point, Color.Red);
            chrtCntrl.AddSerias(GetArrayOfReal(allVectors["Ycalc in"]), GetArrayOfImag(allVectors["Ycalc in"]), $"In Y-plane", linear, line, Color.Red);

            chrtCntrl.AddSerias(GetArrayOfReal(allVectors["Z out"]), GetArrayOfImag(allVectors["Z out"]), $"Out Z-plane", linear, line, Color.Blue);
            chrtCntrl.AddSerias(GetArrayOfReal(allVectors["Zmeas out"]), GetArrayOfImag(allVectors["Zmeas out"]), $"Out Z-plane", linear, point, Color.Red);
            chrtCntrl.AddSerias(GetArrayOfReal(allVectors["Zcalc out"]), GetArrayOfImag(allVectors["Zcalc out"]), $"Out Z-plane", linear, line, Color.Red);

            chrtCntrl.AddSerias(GetArrayOfReal(allVectors["Y out"]), GetArrayOfImag(allVectors["Y out"]), $"Out Y-plane", linear, line, Color.Blue);
            chrtCntrl.AddSerias(GetArrayOfReal(allVectors["Ymeas out"]), GetArrayOfImag(allVectors["Ymeas out"]), $"Out Y-plane", linear, point, Color.Red);
            chrtCntrl.AddSerias(GetArrayOfReal(allVectors["Ycalc out"]), GetArrayOfImag(allVectors["Ycalc out"]), $"Out Y-plane", linear, line, Color.Red);

            chrtCntrl.AddSerias(GetArrayOfPhase(allVectors["G_Z in"]), GetArrayOfMagnitude(allVectors["G_Z in"]), $"In Z gamma", polar, line, Color.Blue);
            chrtCntrl.AddSerias(GetArrayOfPhase(allVectors["G_Zmeas in"]), GetArrayOfMagnitude(allVectors["G_Zmeas in"]), $"In Z gamma", polar, point, Color.Red);
            chrtCntrl.AddSerias(GetArrayOfPhase(allVectors["G_Zmeascalc in"]), GetArrayOfMagnitude(allVectors["G_Zmeascalc in"]), $"In Z gamma", polar, line, Color.Red);

            chrtCntrl.AddSerias(GetArrayOfPhase(allVectors["G_Z out"]), GetArrayOfMagnitude(allVectors["G_Z out"]), $"Out Z gamma", polar, line, Color.Blue);
            chrtCntrl.AddSerias(GetArrayOfPhase(allVectors["G_Zmeas out"]), GetArrayOfMagnitude(allVectors["G_Zmeas out"]), $"Out Z gamma", polar, point, Color.Red);
            chrtCntrl.AddSerias(GetArrayOfPhase(allVectors["G_Zmeascalc out"]), GetArrayOfMagnitude(allVectors["G_Zmeascalc out"]), $"Out Z gamma", polar, line, Color.Red);

            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfReal(allVectors["Ymeas in"]), $"Re Y11", linear, line, Color.Red);
            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfImag(allVectors["Ymeas in"]), $"Im Y11", linear, line, Color.Red);
            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfReal(allVectors["Ymeas out"]), $"Re Y22", linear, line, Color.Red);
            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfImag(allVectors["Ymeas out"]), $"Im Y22", linear, line, Color.Red);

            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfReal(allVectors["Ymeas in"]), $"Re Y11", linear, point, Color.Red);
            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfImag(allVectors["Ymeas in"]), $"Im Y11", linear, point, Color.Red);
            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfReal(allVectors["Ymeas out"]), $"Re Y22", linear, point, Color.Red);
            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfImag(allVectors["Ymeas out"]), $"Im Y22", linear, point, Color.Red);

            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfMagnitude(allVectors["Y 21"]), $"Mag Y21", linear, line, Color.Blue);
            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfMagnitude(allVectors["Ymeas 21"]), $"Mag Y21", linear, point, Color.Red);
            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfMagnitude(allVectors["Ymeas 21"]), $"Mag Y21", linear, line, Color.Red);

            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfPhase(allVectors["Y 21"]), $"Arg Y21", linear, line, Color.Blue);
            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfPhase(allVectors["Ymeas 21"]), $"Arg Y21", linear, point, Color.Red);
            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfPhase(allVectors["Ymeas 21"]), $"Arg Y21", linear, line, Color.Red);

            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfMagnitude(allVectors["Y 12"]), $"Mag Y12", linear, line, Color.Blue);
            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfMagnitude(allVectors["Ymeas 12"]), $"Mag Y12", linear, point, Color.Red);
            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfMagnitude(allVectors["Ymeas 12"]), $"Mag Y12", linear, line, Color.Red);

            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfPhase(allVectors["Y 12"]), $"Arg Y12", linear, line, Color.Blue);
            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfPhase(allVectors["Ymeas 12"]), $"Arg Y12", linear, point, Color.Red);
            chrtCntrl.AddSerias(freqs.ToArray(), GetArrayOfPhase(allVectors["Ymeas 12"]), $"Arg Y12", linear, line, Color.Red);
        }