コード例 #1
0
 public Form1(SignalGenerator.SignalGenerator generator)
 {
     Generator = generator;
     InitializeComponent();
     ConnectedToDataPort = StartDataReader();
     timer1.Start();
     FormGraphics    = CreateGraphics();
     LeftUpCorner    = new Point(this.Size.Width / 21, this.Size.Width / 21);
     RightDownCorner = new Point(this.Size.Width / 21 * 19, this.Size.Height - (this.Size.Width / 21));
     ValuesToPrint   = new List <double>();
     StepSize        = (double)(RightDownCorner.X - LeftUpCorner.X) / MaxNumberOfValues;
 }
コード例 #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            SignalGenerator.SignalGenerator signalGenerator = new SignalGenerator.SignalGenerator();
            Thread Generator = new Thread(() => signalGenerator.GeneratorStart());

            Generator.Start();
            var form = new Form1(signalGenerator);

            Application.Run(form);
            Generator.Abort();
        }