Example #1
0
 /// <summary>
 /// When Settings are changed update the controls and the signal;
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 void SettingsChanged(object sender, EventArgs e)
 {
     InvokeOnMainThread(() => {
         UpdateScopeControls();
         ScopeView.Update();
     });
     if (!Oscilloscope.Hold && Oscilloscope.Trigger.Mode == TriggerMode.Run)
     {
         Oscilloscope.Channels [0].Samples.Clear();
         Oscilloscope.Channels [1].Samples.Clear();
     }
 }
Example #2
0
        /// <summary>
        /// Views did load.
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            MainView.BackgroundColor        = UIColor.FromPatternImage(UIImage.FromBundle("BACKGROUND/BG-0x0"));
            ServiceManager.SettingsChanged += SettingsChanged;
            ServiceManager.FullFrame       += HandleFullFrame;
            ScopeView.ServiceManager        = ServiceManager;
            ScopeView.Initialize();
            var timer = new Timer(200);

            timer.Elapsed += (object sender, ElapsedEventArgs e) => {
                timer.Stop();
                Service.Update();
                InvokeOnMainThread(ScopeView.Update);
                timer.Start();
            };
            timer.Enabled = true;
            timer.Start();

            ScopeView.SelectedChannel = 0;

            ScopeView.NewData += (object sender, NewDataEventArgs e) => InvokeOnMainThread(UpdateMeasurements);
        }
 void ReleaseDesignerOutlets()
 {
     if (btnAC1 != null)
     {
         btnAC1.Dispose();
         btnAC1 = null;
     }
     if (btnAC2 != null)
     {
         btnAC2.Dispose();
         btnAC2 = null;
     }
     if (btnAutorange != null)
     {
         btnAutorange.Dispose();
         btnAutorange = null;
     }
     if (btnBattery != null)
     {
         btnBattery.Dispose();
         btnBattery = null;
     }
     if (btnDC1 != null)
     {
         btnDC1.Dispose();
         btnDC1 = null;
     }
     if (btnDC2 != null)
     {
         btnDC2.Dispose();
         btnDC2 = null;
     }
     if (btnGND1 != null)
     {
         btnGND1.Dispose();
         btnGND1 = null;
     }
     if (btnGND2 != null)
     {
         btnGND2.Dispose();
         btnGND2 = null;
     }
     if (btnMarkerMeasurements != null)
     {
         btnMarkerMeasurements.Dispose();
         btnMarkerMeasurements = null;
     }
     if (btnMarkerMeasurements2 != null)
     {
         btnMarkerMeasurements2.Dispose();
         btnMarkerMeasurements2 = null;
     }
     if (btnProbe1 != null)
     {
         btnProbe1.Dispose();
         btnProbe1 = null;
     }
     if (btnProbe2 != null)
     {
         btnProbe2.Dispose();
         btnProbe2 = null;
     }
     if (btnSelectChannel1 != null)
     {
         btnSelectChannel1.Dispose();
         btnSelectChannel1 = null;
     }
     if (btnSelectChannel2 != null)
     {
         btnSelectChannel2.Dispose();
         btnSelectChannel2 = null;
     }
     if (btnSettings != null)
     {
         btnSettings.Dispose();
         btnSettings = null;
     }
     if (btnSignalMeasurements != null)
     {
         btnSignalMeasurements.Dispose();
         btnSignalMeasurements = null;
     }
     if (btnSignalMeasurements2 != null)
     {
         btnSignalMeasurements2.Dispose();
         btnSignalMeasurements2 = null;
     }
     if (btnSnap != null)
     {
         btnSnap.Dispose();
         btnSnap = null;
     }
     if (btnTimeLeft != null)
     {
         btnTimeLeft.Dispose();
         btnTimeLeft = null;
     }
     if (btnTimeRight != null)
     {
         btnTimeRight.Dispose();
         btnTimeRight = null;
     }
     if (btnTriggerCH1 != null)
     {
         btnTriggerCH1.Dispose();
         btnTriggerCH1 = null;
     }
     if (btnTriggerCH2 != null)
     {
         btnTriggerCH2.Dispose();
         btnTriggerCH2 = null;
     }
     if (btnTriggerHold != null)
     {
         btnTriggerHold.Dispose();
         btnTriggerHold = null;
     }
     if (btnTriggerNrml != null)
     {
         btnTriggerNrml.Dispose();
         btnTriggerNrml = null;
     }
     if (btnTriggerOnce != null)
     {
         btnTriggerOnce.Dispose();
         btnTriggerOnce = null;
     }
     if (btnTriggerRun != null)
     {
         btnTriggerRun.Dispose();
         btnTriggerRun = null;
     }
     if (btnTriggerSlopeDown != null)
     {
         btnTriggerSlopeDown.Dispose();
         btnTriggerSlopeDown = null;
     }
     if (btnTriggerSlopeUp != null)
     {
         btnTriggerSlopeUp.Dispose();
         btnTriggerSlopeUp = null;
     }
     if (btnVoltDown1 != null)
     {
         btnVoltDown1.Dispose();
         btnVoltDown1 = null;
     }
     if (btnVoltDown2 != null)
     {
         btnVoltDown2.Dispose();
         btnVoltDown2 = null;
     }
     if (btnVoltUp1 != null)
     {
         btnVoltUp1.Dispose();
         btnVoltUp1 = null;
     }
     if (btnVoltUp2 != null)
     {
         btnVoltUp2.Dispose();
         btnVoltUp2 = null;
     }
     if (lblTime != null)
     {
         lblTime.Dispose();
         lblTime = null;
     }
     if (lblTimeBase != null)
     {
         lblTimeBase.Dispose();
         lblTimeBase = null;
     }
     if (lblTrigger != null)
     {
         lblTrigger.Dispose();
         lblTrigger = null;
     }
     if (lblVolt1 != null)
     {
         lblVolt1.Dispose();
         lblVolt1 = null;
     }
     if (lblVolt2 != null)
     {
         lblVolt2.Dispose();
         lblVolt2 = null;
     }
     if (MainView != null)
     {
         MainView.Dispose();
         MainView = null;
     }
     if (ScopeView != null)
     {
         ScopeView.Dispose();
         ScopeView = null;
     }
 }