public PhosphorDisplay()
        {
            InitializeComponent();

            acqEngine = new AcquisitionEngine(new NetStream());
            acqEngine.AcquisitionTime = 0.15f / 1000;
            acqEngine.PretriggerTime  = 0.0f / 1000;

            // Zoom waveform
            displayTrig          = new ucPhosphorDisplay();
            displayTrig.channels = 1;

            displayTrig.horizontalScale = (float)(acqEngine.AcquisitionTime / displayTrig.horizontalDivisions / 2);
            displayTrig.verticalScale   = new float[3] {
                0.25f, 1, 1
            };

            Controls.Add(displayTrig);

            // Triggered waveform
            displayOverview                 = new ucPhosphorDisplay();
            displayOverview.channels        = 1;
            displayOverview.verticalScale   = displayTrig.verticalScale;
            displayOverview.horizontalScale = 1.0f;
            displayOverview.lowContrast     = true;

            Controls.Add(displayOverview);

            // Measurement "DMM"
            dmm = new ucRmsMeter();
            Controls.Add(dmm);

            // Control panel
            controls = new ucScopeControls(acqEngine, displayTrig, displayOverview);
            Controls.Add(controls);

            this.Layout += Form1_Layout;

            acqEngine.OverviewWaveform  += acqEngine_OverviewWaveform;
            acqEngine.TriggeredWaveform += acqEngine_Waveform;

            var t = new Timer();

            t.Tick += (sender, args) =>
            {
                if (triggerOk)
                {
                    triggerOk = false;

                    displayTrig.Invalidate();
                }
                if (overviewRefresh)
                {
                    overviewRefresh = false;

                    dmm.Invalidate();
                    displayOverview.Invalidate();
                }
            };

            t.Interval = 40; // 25 fps
            t.Start();

            acqEngine.Source.HighresVoltage += voltage =>
            {
                dmm.sixDigitVoltage = voltage;
                dmm.Invalidate();
            };
            this.SizeChanged += Form1_SizeChanged;
        }
        public PhosphorDisplay()
        {
            InitializeComponent();

            acqEngine = new AcquisitionEngine(new NetStream());
            acqEngine.AcquisitionTime = 0.15f/1000;
            acqEngine.PretriggerTime = 0.0f/1000;

            // Zoom waveform
            displayTrig = new ucPhosphorDisplay();
            displayTrig.channels = 1;

            displayTrig.horizontalScale = (float) (acqEngine.AcquisitionTime/displayTrig.horizontalDivisions/2);
            displayTrig.verticalScale = new float[3] { 0.25f, 1, 1};

            Controls.Add(displayTrig);

            // Triggered waveform
            displayOverview = new ucPhosphorDisplay();
            displayOverview.channels = 1;
            displayOverview.verticalScale= displayTrig.verticalScale;
            displayOverview.horizontalScale = 1.0f;
            displayOverview.lowContrast = true;

            Controls.Add(displayOverview);

            // Measurement "DMM"
            dmm = new ucRmsMeter();
            Controls.Add(dmm);

            // Control panel
            controls = new ucScopeControls(acqEngine, displayTrig, displayOverview);
            Controls.Add(controls);

            this.Layout += Form1_Layout;

            acqEngine.OverviewWaveform += acqEngine_OverviewWaveform;
            acqEngine.TriggeredWaveform += acqEngine_Waveform;

            var t = new Timer();
            t.Tick += (sender, args) =>
                          {
                              if (triggerOk)
                              {
                                  triggerOk = false;

                                  displayTrig.Invalidate();
                              }
                              if(overviewRefresh)
                              {
                                  overviewRefresh = false;

                                  dmm.Invalidate();
                                  displayOverview.Invalidate();
                              }
                          };

            t.Interval = 40; // 25 fps
            t.Start();

            acqEngine.Source.HighresVoltage += voltage =>
                                                   {
                                                       dmm.sixDigitVoltage = voltage;
                                                       dmm.Invalidate();
                                                   };
            this.SizeChanged += Form1_SizeChanged;
        }
 void Form1_SizeChanged(object sender, EventArgs e)
 {
     displayTrig.Invalidate();
 }