Beispiel #1
0
        public Program(PTD ptd, int choice)
        {
            switch (choice)
            {
            case 1:
                InitializeComponent(ptd, (int)Mod.ASK);
                break;

            case 2:
                InitializeComponent(ptd, (int)Mod.FSK);
                break;

            case 3:
                InitializeComponent(ptd, (int)Mod.PSK);
                break;

            case 4:
                InitializeComponent(ptd, (int)Mod.WidmoASK);
                break;

            case 5:
                InitializeComponent(ptd, (int)Mod.WidmoFSK);
                break;

            case 6:
                InitializeComponent(ptd, (int)Mod.WidmoPSK);
                break;
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            /*double fn = 10000; //znacznie wieksze od fm
             * double fs = 32768; // fs >= 2*fn
             * double fm = 6; //znacznie mniejsze od fn
             * double T = 0.5;
             * double Am = 2;
             * double kA;
             * double kP;*/
            string bits = "11001010";
            double Tb   = 2;
            double A1   = 2;
            double A2   = 6;
            double fs   = 128;
            double NN   = 2;

            PTD ptd1 = new PTD(bits, Tb, A1, A2, fs, NN);

            Application.Run(new Program(ptd1, (int)Mod.ASK));
            Application.Run(new Program(ptd1, (int)Mod.FSK));
            Application.Run(new Program(ptd1, (int)Mod.PSK));
            Application.Run(new Program(ptd1, (int)Mod.WidmoASK));
            Application.Run(new Program(ptd1, (int)Mod.WidmoFSK));
            Application.Run(new Program(ptd1, (int)Mod.WidmoPSK));

            Console.ReadKey();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            double Tb = 2;             //nadać recznie pod wzgledem poprzedniego zadania

            PTD ptd = new PTD(Tb);

            Application.Run(new Program(ptd.get_t, ptd.get_zA, "1.ASK zA"));
            Application.Run(new Program(ptd.get_t, ptd.get_xt_ask, "2.ASK xt"));
            Application.Run(new Program(ptd.get_t, ptd.get_pt_ask, "3.ASK pt"));
            Application.Run(new Program(ptd.get_t, ptd.get_mt_ask, "4.ASK mt"));
            Application.Run(new Program(ptd.get_t, ptd.get_zP, "5.PSK zP"));
            Application.Run(new Program(ptd.get_t, ptd.get_xt_psk, "6.PSK xt"));
            Application.Run(new Program(ptd.get_t, ptd.get_pt_psk, "7.PSK pt"));
            Application.Run(new Program(ptd.get_t, ptd.get_mt_psk, "8.PSK mt"));
            Application.Run(new Program(ptd.get_t, ptd.get_zF, "9.FSK zF"));
            Application.Run(new Program(ptd.get_t, ptd.get_x1t_fsk, "10.FSK x1t"));
            Application.Run(new Program(ptd.get_t, ptd.get_x2t_fsk, "11.FSK x2t"));
            Application.Run(new Program(ptd.get_t, ptd.get_pt_fsk, "12.FSK pt"));
            Application.Run(new Program(ptd.get_t, ptd.get_mt_fsk, "13.FSK mt"));

            Console.ReadKey();
        }
Beispiel #4
0
        private void InitializeComponent(PTD ptd, int choice)
        {
            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
            System.Windows.Forms.DataVisualization.Charting.Legend    legend1    = new System.Windows.Forms.DataVisualization.Charting.Legend();
            System.Windows.Forms.DataVisualization.Charting.Series    series1    = new System.Windows.Forms.DataVisualization.Charting.Series();
            this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart();
            ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit();
            this.SuspendLayout();
            //
            // chart1
            //
            chartArea1.Name = "ChartArea1";
            this.chart1.ChartAreas.Add(chartArea1);
            legend1.Name = "Legend1";
            this.chart1.Legends.Add(legend1);
            this.chart1.Location = new System.Drawing.Point(12, 12);
            this.chart1.Name     = "chart1";
            series1.ChartArea    = "ChartArea1";
            series1.Legend       = "Legend1";

            this.chart1.Series.Add(series1);
            this.chart1.Size                        = new System.Drawing.Size(1205, 563);
            this.chart1.TabIndex                    = 0;
            this.chart1.Text                        = "chart1";
            this.chart1.Series[0].ChartType         = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            this.chart1.Series[0].BorderWidth       = 2;
            this.chart1.ChartAreas[0].AxisX.Minimum = 0;

            int localLength;             //zaleznie czy to ask, fsk czy ich widma, jest rowna liczbie probek (stosowane w petli)

            if (choice == (int)Mod.WidmoASK || choice == (int)Mod.WidmoFSK || choice == (int)Mod.WidmoPSK)
            {
                localLength = ptd.get_widmo_fK.Length;
            }
            else
            {
                localLength = ptd.get_t.Length;
            }

            int i;

            for (int j = 0; j < localLength; j++)
            {
                if (choice == (int)Mod.ASK)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.get_t[j], ptd.get_zA[j]);
                }
                else if (choice == (int)Mod.FSK)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.get_t[j], ptd.get_zF[j]);
                }
                else if (choice == (int)Mod.PSK)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.get_t[j], ptd.get_zP[j]);
                }

                else if (choice == (int)Mod.WidmoASK)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.get_widmo_fK[j], ptd.get_widmo_zA[j]);
                }
                else if (choice == (int)Mod.WidmoFSK)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.get_widmo_fK[j], ptd.get_widmo_zF[j]);
                }
                else if (choice == (int)Mod.WidmoPSK)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.get_widmo_fK[j], ptd.get_widmo_zP[j]);
                }
            }

            string name = "";

            if (choice == (int)Mod.WidmoASK)
            {
                ptd.findMaxDb(ptd.get_widmo_zA_log);
                name = Mod.ASK.ToString();
                this.chart1.Series[0].LegendText = "zA widmo\n AxisX: F\n AxisY: A";
                this.chart1.SaveImage("../../../" + (int)Mod.WidmoASK + " - zA_widmo.png", System.Windows.Forms.DataVisualization.Charting.ChartImageFormat.Png);                 //zapisujemy charta
            }
            else if (choice == (int)Mod.WidmoFSK)
            {
                ptd.findMaxDb(ptd.get_widmo_zF_log);
                name = Mod.FSK.ToString();
                this.chart1.Series[0].LegendText = "zF widmo\n AxisX: F\n AxisY: A";
                this.chart1.SaveImage("../../../" + (int)Mod.WidmoFSK + " - zF_widmo.png", System.Windows.Forms.DataVisualization.Charting.ChartImageFormat.Png);                 //zapisujemy charta
            }
            else if (choice == (int)Mod.WidmoPSK)
            {
                ptd.findMaxDb(ptd.get_widmo_zP_log);
                name = Mod.PSK.ToString();
                this.chart1.Series[0].LegendText = "zP widmo\n AxisX: F\n AxisY: A";
                this.chart1.SaveImage("../../../" + (int)Mod.WidmoPSK + " - zP_widmo.png", System.Windows.Forms.DataVisualization.Charting.ChartImageFormat.Png);                 //zapisujemy charta
            }
            else if (choice == (int)Mod.ASK)
            {
                this.chart1.Series[0].LegendText = "zA \n AxisX: T\n AxisY: F";
                this.chart1.SaveImage("../../../" + (int)Mod.ASK + " - zA.png", System.Windows.Forms.DataVisualization.Charting.ChartImageFormat.Png); //zapisujemy charta
                ptd.saveXNToFile(ptd.get_zA, "zA");                                                                                                    //zapisuje dane wyjsciowe dla Lab5 (Pamietaj raz "z" raz "t" (modulo 2)(parzyste/nieparzyste))
            }
            else if (choice == (int)Mod.FSK)
            {
                this.chart1.Series[0].LegendText = "zF \n AxisX: T\n AxisY: F";
                this.chart1.SaveImage("../../../" + (int)Mod.FSK + " - zF.png", System.Windows.Forms.DataVisualization.Charting.ChartImageFormat.Png); //zapisujemy charta
                ptd.saveXNToFile(ptd.get_zF, "zF");                                                                                                    //zapisuje dane wyjsciowe dla Lab5 (Pamietaj raz "z" raz "t" (modulo 2)(parzyste/nieparzyste))
            }
            else if (choice == (int)Mod.PSK)
            {
                this.chart1.Series[0].LegendText = "zP \n AxisX: T\n AxisY: F";
                this.chart1.SaveImage("../../../" + (int)Mod.PSK + " - zP.png", System.Windows.Forms.DataVisualization.Charting.ChartImageFormat.Png); //zapisujemy charta
                ptd.saveXNToFile(ptd.get_zP, "zP");                                                                                                    //zapisuje dane wyjsciowe dla Lab5 (Pamietaj raz "z" raz "t" (modulo 2)(parzyste/nieparzyste))
                ptd.saveXNToFile(ptd.get_t, "t");
                ptd.saveXNToFile(ptd.get_sant, "sant");
                ptd.saveXNToFile(ptd.get_sn1t, "sn1t");
                ptd.saveXNToFile(ptd.get_sn2t, "sn2t");
                ptd.saveXNToFile(ptd.get_spnt, "spnt");
            }


            if (choice == (int)Mod.WidmoASK || choice == (int)Mod.WidmoFSK || choice == (int)Mod.WidmoPSK)
            {
                Console.WriteLine("Szerokość pasma " + name + ": " + (ptd.get_widmo_fK[(int)ptd.getMax_pos[2]] - ptd.get_widmo_fK[(int)ptd.getMax_pos[0]]) + " Hz");
            }


            // Set ToolTips for Data Point Series

            /*chart1.Series[0].ToolTip = "x: #VALX \n y: #VAL";
             *
             * // Set ToolTips for legend items
             * chart1.Series[0].LegendToolTip = "Income in #LABEL  is #VAL million";
             *
             * // Set ToolTips for the Data Point labels
             * chart1.Series[0].LabelToolTip = "#PERCENT";
             *
             * // Set ToolTips for second Data Point
             * chart1.Series[0].Points[1].ToolTip = "Unknown";*/

            this.ClientSize = new System.Drawing.Size(1315, 587);
            this.Controls.Add(this.chart1);
            this.Name = "Program";

            ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit();
            this.ResumeLayout(false);
        }
Beispiel #5
0
        private void InitializeComponent(PTD ptd)
        {
            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
            System.Windows.Forms.DataVisualization.Charting.Legend    legend1    = new System.Windows.Forms.DataVisualization.Charting.Legend();
            System.Windows.Forms.DataVisualization.Charting.Series    series1    = new System.Windows.Forms.DataVisualization.Charting.Series();
            this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart();
            ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit();
            this.SuspendLayout();
            //
            // chart1
            //
            chartArea1.Name = "ChartArea1";
            this.chart1.ChartAreas.Add(chartArea1);
            legend1.Name = "Legend1";
            this.chart1.Legends.Add(legend1);
            this.chart1.Location = new System.Drawing.Point(12, 12);
            this.chart1.Name     = "chart1";
            series1.ChartArea    = "ChartArea1";
            series1.Legend       = "Legend1";

            this.chart1.Series.Add(series1);
            this.chart1.Size                = new System.Drawing.Size(1205, 563);
            this.chart1.TabIndex            = 0;
            this.chart1.Text                = "chart1";
            this.chart1.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;


            /*this.chart1.ChartAreas[0].AxisX.Minimum = 230;
             * this.chart1.ChartAreas[0].AxisX.Maximum = 250;
             * this.chart1.ChartAreas[0].AxisY.Minimum = -11;
             * this.chart1.ChartAreas[0].AxisY.Maximum = -6.5;*/
            //
            // Program
            switch (ptd.getsetChoice)
            {
            default:
                break;

                /*
                 * case 1:
                 *      this.chart1.ChartAreas[0].AxisX.Maximum = ptd.get_T;
                 *      this.chart1.Series[0].LegendText = "m(t)";
                 *      for (int i = 0; i < ptd.getN; i++)	{	this.chart1.Series[0].Points.AddXY(ptd.get_t[i], ptd.get_m[i]); }
                 *      break;
                 * case 2:
                 *      this.chart1.ChartAreas[0].AxisX.Maximum = ptd.get_T;
                 *      System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
                 *      this.chart1.Series.Add(series2);
                 *      this.chart1.Series[1].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
                 *      this.chart1.Series[0].LegendText = "m(t)";
                 *      this.chart1.Series[1].LegendText = "zA(t)";
                 *      for (int i = 0; i < ptd.getN; i++) { this.chart1.Series[0].Points.AddXY(ptd.get_t[i], ptd.get_m[i]); this.chart1.Series[1].Points.AddXY(ptd.get_t[i], ptd.get_zA[i]);  }
                 *      break;
                 * case 3:
                 *      this.chart1.ChartAreas[0].AxisX.Maximum = ptd.get_T;
                 *      System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
                 *      this.chart1.Series.Add(series3);
                 *      this.chart1.Series[1].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
                 *      this.chart1.Series[0].LegendText = "m(t)";
                 *      this.chart1.Series[1].LegendText = "zP(t)";
                 *      for (int i = 0; i < ptd.getN; i++) { this.chart1.Series[0].Points.AddXY(ptd.get_t[i], ptd.get_m[i]); this.chart1.Series[1].Points.AddXY(ptd.get_t[i], ptd.get_zP[i]); }
                 *      break;
                 * case 4:
                 *      this.chart1.ChartAreas[0].AxisX.Maximum = ptd.get_T;
                 *      System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
                 *      System.Windows.Forms.DataVisualization.Charting.Series series5 = new System.Windows.Forms.DataVisualization.Charting.Series();
                 *      this.chart1.Series.Add(series4);
                 *      this.chart1.Series.Add(series5);
                 *      this.chart1.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
                 *      this.chart1.Series[1].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
                 *      this.chart1.Series[2].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
                 *      this.chart1.Series[2].Color = System.Drawing.Color.Violet;
                 *      this.chart1.Series[0].LegendText = "m(t)";
                 *      this.chart1.Series[1].LegendText = "zA(t)";
                 *      this.chart1.Series[2].LegendText = "zP(t)";
                 *      this.chart1.Series[2].BorderWidth = 2;
                 *      for (int i = 0; i < ptd.getN; i++) { this.chart1.Series[0].Points.AddXY(ptd.get_t[i], ptd.get_m[i]); this.chart1.Series[1].Points.AddXY(ptd.get_t[i], ptd.get_zA[i]); this.chart1.Series[2].Points.AddXY(ptd.get_t[i], ptd.get_zP[i]); }
                 *      break;
                 * case 5:
                 *      this.chart1.Series[0].BorderWidth = 3;
                 *      for (int i = 0; i < ptd.getN / 2; i++)
                 *      {
                 *              this.chart1.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
                 *              this.chart1.Series[0].Points.AddXY(ptd.Widmo_zA_fK[i], ptd.Widmo_zA_log[i]);
                 *              //Console.WriteLine(ptd.Widmo_zA[i].im);
                 *      }
                 *      ptd.getsetChoice = 6;
                 *      break;
                 * case 6:
                 *      this.chart1.Series[0].BorderWidth = 3;
                 *      for (int i = 0; i < ptd.getN / 2; i++)
                 *      {
                 *              this.chart1.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
                 *              this.chart1.Series[0].Points.AddXY(ptd.Widmo_zP_fK[i], ptd.Widmo_zP_log[i]);
                 *              //Console.WriteLine(ptd.Widmo_zA[i].im);
                 *      }
                 *
                 *      break;
                 * //===================================
                 * //Testing testing...
                 * case 55:
                 *      this.chart1.Series[0].BorderWidth = 3;
                 *      for (int i = 0; i < ptd.getN / 2; i++)
                 *      {
                 *              this.chart1.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
                 *              this.chart1.Series[0].Points.AddXY(ptd.Widmo_zA[1][i], ptd.Widmo_zA[0][i]);
                 *              //Console.WriteLine(ptd.Widmo_zA[i].im);
                 *      }
                 *      ptd.getsetChoice = 66;
                 *      break;
                 * case 66:
                 *      this.chart1.Series[0].BorderWidth = 3;
                 *      for (int i = 0; i < ptd.getN / 2; i++)
                 *      {
                 *              this.chart1.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
                 *              this.chart1.Series[0].Points.AddXY(ptd.Widmo_zP[1][i], ptd.Widmo_zP[0][i]);
                 *              //Console.WriteLine(ptd.Widmo_zA[i].im);
                 *      }
                 *      ptd.getsetChoice = 6;
                 *      break;
                 * //===================================
                 */
            }
            //this.chart1.ChartAreas[0].AxisX.Minimum = 247;
            //this.chart1.ChartAreas[0].AxisX.Maximum = 255;

            System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
            this.chart1.Series.Add(series2);
            this.chart1.Series[1].ChartType         = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            this.chart1.Series[1].Color             = System.Drawing.Color.Red;
            this.chart1.Series[0].BorderWidth       = 1;
            this.chart1.ChartAreas[0].AxisX.Minimum = 0;
            //this.chart1.ChartAreas[0].AxisX.Maximum = (ptd.getN/2)-1;

            switch (ptd.getsetChoice)
            {
            case 111:

                for (int i = 0; i < (ptd.getN / 2); i++)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.Widmo_zA[1][i], ptd.Widmo_zA[0][i]);
                    ptd.getsetChoice = 222;
                }
                break;

            case 222:
                for (int i = 0; i < (ptd.getN / 2); i++)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.Widmo_zP[1][i], ptd.Widmo_zP[0][i]);
                }
                ptd.getsetChoice = -111;
                break;

            case 333:
                for (int i = 0; i < (ptd.getN / 2); i++)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.Widmo_zA[1][i], ptd.Widmo_zA[0][i]);
                }
                ptd.getsetChoice = 444;
                break;

            case 444:
                for (int i = 0; i < (ptd.getN / 2); i++)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.Widmo_zP[1][i], ptd.Widmo_zP[0][i]);
                }
                ptd.getsetChoice = -333;
                break;

            case 555:
                for (int i = 0; i < (ptd.getN / 2); i++)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.Widmo_zA[1][i], ptd.Widmo_zA[0][i]);
                }
                ptd.getsetChoice = 666;
                break;

            case 666:
                for (int i = 0; i < (ptd.getN / 2); i++)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.Widmo_zP[1][i], ptd.Widmo_zP[0][i]);
                }
                ptd.getsetChoice = -555;
                break;


            case -111:
                series1.Name = iii + ". Mod amp\n" + "kA=" + ptd.getKA + "\n";
                this.Text    = iii + ". Mod amp  " + "kA=" + ptd.getKA + "\n";
                iii++;
                for (int i = 1; i < ptd.Widmo_zA_log.Length; i++)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.Widmo_zA_fK[i], ptd.Widmo_zA_log[i]);
                    //this.chart1.Series[1].Points.AddXY(ptd.Widmo_zA_fK[i], ptd.getM3A);

                    if (ptd.getMax[0] >= ptd.getMax[1] - 3 && ptd.getMax[2] >= ptd.getMax[1] - 3)
                    {
                        if (ptd.getMax_pos[0] == i)
                        {
                            this.chart1.Series[1].Points.AddXY(ptd.Widmo_zA_fK[i], ptd.getMax[1] - 3);
                        }
                        if (ptd.getMax_pos[1] == i)
                        {
                            this.chart1.Series[1].Points.AddXY(ptd.Widmo_zA_fK[i], ptd.getMax[1] - 3);
                        }
                        if (ptd.getMax_pos[2] == i)
                        {
                            this.chart1.Series[1].Points.AddXY(ptd.Widmo_zA_fK[i], ptd.getMax[1] - 3);
                        }
                    }
                }
                Console.WriteLine("Szerokość pasma: " + (ptd.Widmo_zA_fK[(int)ptd.getMax_pos[2]] - ptd.Widmo_zA_fK[(int)ptd.getMax_pos[0]]) + " Hz");
                //this.chart1.ChartAreas[0].AxisX.Minimum = 10000-100;
                //this.chart1.ChartAreas[0].AxisX.Maximum = 10000+100;
                ptd.getsetChoice = -222;
                this.chart1.SaveImage("../../../" + (iii - 1) + " - zA.png", System.Windows.Forms.DataVisualization.Charting.ChartImageFormat.Png);                   //zapisujemy charta
                break;

            case -222:
                series1.Name = iii + ". Mod kat\n" + "kP=" + ptd.getKP + "\n";
                this.Text    = iii + ". Mod kat  " + "kP=" + ptd.getKP + "\n";
                iii++;
                for (int i = 1; i < ptd.Widmo_zP_log.Length; i++)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.Widmo_zP_fK[i], ptd.Widmo_zP_log[i]);
                    //this.chart1.Series[1].Points.AddXY(ptd.Widmo_zP_fK[i], ptd.getM3P);
                }
                //this.chart1.ChartAreas[0].AxisX.Minimum = 10000 - 100;
                //this.chart1.ChartAreas[0].AxisX.Maximum = 10000 + 100;
                this.chart1.SaveImage("../../../" + (iii - 1) + " - zP.png", System.Windows.Forms.DataVisualization.Charting.ChartImageFormat.Png);                         //zapisujemy charta
                break;

            case -333:
                series1.Name = iii + ". Mod amp\n" + "kA=" + ptd.getKA + "\n";
                this.Text    = iii + ". Mod amp  " + "kA=" + ptd.getKA + "\n";
                iii++;
                for (int i = 1; i < ptd.Widmo_zA_log.Length; i++)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.Widmo_zA_fK[i], ptd.Widmo_zA_log[i]);
                    //this.chart1.Series[1].Points.AddXY(ptd.Widmo_zA_fK[i], ptd.getM3A);
                }
                //this.chart1.ChartAreas[0].AxisX.Minimum = 10000 - 100;
                //this.chart1.ChartAreas[0].AxisX.Maximum = 10000 + 100;
                ptd.getsetChoice = -444;
                this.chart1.SaveImage("../../../" + (iii - 1) + " - zA.png", System.Windows.Forms.DataVisualization.Charting.ChartImageFormat.Png);                         //zapisujemy charta
                break;

            case -444:
                series1.Name = iii + ". Mod kat\n" + "kP=" + ptd.getKP + "\n";
                this.Text    = iii + ". Mod kat  " + "kP=" + ptd.getKP + "\n";
                iii++;
                for (int i = 1; i < ptd.Widmo_zP_log.Length; i++)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.Widmo_zP_fK[i], ptd.Widmo_zP_log[i]);
                    //this.chart1.Series[1].Points.AddXY(ptd.Widmo_zP_fK[i], ptd.getM3P);
                }
                //this.chart1.ChartAreas[0].AxisX.Minimum = 10000 - 100;
                //this.chart1.ChartAreas[0].AxisX.Maximum = 10000 + 100;
                this.chart1.SaveImage("../../../" + (iii - 1) + " - zP.png", System.Windows.Forms.DataVisualization.Charting.ChartImageFormat.Png);                         //zapisujemy charta
                break;

            case -555:
                series1.Name = iii + ". Mod amp\n" + "kA=" + ptd.getKA + "\n";
                this.Text    = iii + ". Mod amp  " + "kA=" + ptd.getKA + "\n";
                iii++;
                for (int i = 1; i < ptd.Widmo_zA_log.Length; i++)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.Widmo_zA_fK[i], ptd.Widmo_zA_log[i]);
                    //this.chart1.Series[1].Points.AddXY(ptd.Widmo_zA_fK[i], ptd.getM3A);
                }
                //this.chart1.ChartAreas[0].AxisX.Minimum = 10000 - 100;
                //this.chart1.ChartAreas[0].AxisX.Maximum = 10000 + 100;
                ptd.getsetChoice = -666;
                this.chart1.SaveImage("../../../" + (iii - 1) + " - zA.png", System.Windows.Forms.DataVisualization.Charting.ChartImageFormat.Png);                         //zapisujemy charta
                break;

            case -666:
                series1.Name = iii + ". Mod kat\n" + "kP" + ptd.getKP + "\n";
                this.Text    = iii + ". Mod kat  " + "kP" + ptd.getKP + "\n";
                iii++;
                for (int i = 1; i < ptd.Widmo_zP_log.Length; i++)
                {
                    this.chart1.Series[0].Points.AddXY(ptd.Widmo_zP_fK[i], ptd.Widmo_zP_log[i]);
                    //this.chart1.Series[1].Points.AddXY(ptd.Widmo_zP_fK[i], ptd.getM3P);
                }
                //this.chart1.ChartAreas[0].AxisX.Minimum = 10000 - 100;
                //this.chart1.ChartAreas[0].AxisX.Maximum = 10000 + 100;
                this.chart1.SaveImage("../../../" + (iii - 1) + " - zP.png", System.Windows.Forms.DataVisualization.Charting.ChartImageFormat.Png);                         //zapisujemy charta
                break;
            }

            this.ClientSize = new System.Drawing.Size(1315, 587);
            this.Controls.Add(this.chart1);
            this.Name = "Program";

            ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit();
            this.ResumeLayout(false);
        }
Beispiel #6
0
 public Program(PTD ptd)
 {
     InitializeComponent(ptd);
 }
Beispiel #7
0
        static void Main(string[] args)
        {
            iii = 1;
            {            /*
                          * double fn=10000;//znacznie wieksze od fm
                          * double fs = 512;
                          * double fm = 1;
                          * double T = 1;
                          * double Am = 1;
                          * double kA = 0.8;
                          * double kP = 0.5; //wspolczynnik glebokosci modulacji (w %)
                          * //PTD ptd1 = new PTD(fs, fm, fn, kA, kP, T, Am, 4);
                          * //Application.Run(new Program(ptd1));
                          * PTD ptd1 = new PTD(fs, fm, fn, kA, kP, T, Am, 2);
                          * Application.Run(new Program(ptd1));
                          * Application.Run(new Program(ptd1)); // tu choice = 6
                          */
            }

            /*	double fn = 250;//znacznie wieksze od fm
             * double fs = 512; // fs >= 2*fn
             * double fm = 2;
             * double T = 1;
             * double Am = 1;
             * double kA;
             * double kP;*/
            double fn = 10000;         //znacznie wieksze od fm
            double fs = 32768;         // fs >= 2*fn
            double fm = 6;             //znacznie mniejsze od fn
            double T  = 0.5;
            double Am = 2;
            double kA;
            double kP;

            kA = 0.8;
            kP = 0.5;
            PTD ptd1 = new PTD(fs, fm, fn, kA, kP, T, Am, 111);

            Application.Run(new Program(ptd1));
            Application.Run(new Program(ptd1));
            Application.Run(new Program(ptd1));
            Application.Run(new Program(ptd1));

            kA = 10;
            kP = 2.14;
            PTD ptd2 = new PTD(fs, fm, fn, kA, kP, T, Am, 333);

            Application.Run(new Program(ptd2));
            Application.Run(new Program(ptd2));
            Application.Run(new Program(ptd2));
            Application.Run(new Program(ptd2));

            kA = 34;
            kP = 66;
            PTD ptd3 = new PTD(fs, fm, fn, kA, kP, T, Am, 555);

            Application.Run(new Program(ptd3));
            Application.Run(new Program(ptd3));
            Application.Run(new Program(ptd3));
            Application.Run(new Program(ptd3));

            Console.ReadKey();
        }