Esempio n. 1
0
 protected virtual void OnReset(EventArgs e)
 {
     if (Reseted != null)
     {
         Reseted.Invoke(this, e);
     }
 }
Esempio n. 2
0
        protected override void Reset()
        {
            foreach (var entity in Entity.All)
            {
                entity.Reset();
            }

            ResetRequested = false;
            Reseted?.Invoke();
        }
Esempio n. 3
0
        private void ReceiveHandle(object arg)
        {
            var line = arg as String;

            try
            {
                var args = new Answer(line);
                switch (args.Message)
                {
                case "Hello":
                    Reseted?.Invoke();
                    break;

                case "dropped":
                    Dropped?.Invoke(int.Parse(args.Values["N"]));
                    break;

                case "queued":
                    Queued?.Invoke(int.Parse(args.Values["N"]));
                    break;

                case "started":
                    Started?.Invoke(int.Parse(args.Values["N"]));
                    break;

                case "completed":
                    Completed?.Invoke(int.Parse(args.Values["N"]), args.Values);
                    break;

                case "failed":
                    Failed?.Invoke(int.Parse(args.Values["N"]), line);
                    break;

                case "debug":
                    Debug?.Invoke(line);
                    break;

                case "error":
                    Error?.Invoke(line);
                    break;

                default:
                    break;
                }
                if (args.Values.ContainsKey("Q"))
                {
                    SetQ(int.Parse(args.Values["Q"]), int.Parse(args.Values["N"]));
                }
            }
            catch
            {
                Logger.Instance.Error(this, "exception", line);
            }
        }
Esempio n. 4
0
        public void Reset()
        {
            if (Value is bool)
            {
                Value = false;
            }
            else
            {
                Value = null;
            }

            Reseted?.Invoke(this, null);
            ValidationResult = null;
        }
Esempio n. 5
0
        /// <summary>
        /// Resets the state of <see cref="ITimer"/>.
        /// </summary>
        /// <exception cref="ObjectDisposedException"><c>UniSharper.Timers.Timer</c> is disposed.</exception>
        public void Reset()
        {
            if (disposed)
            {
                throw new ObjectDisposedException(GetType().FullName);
            }

            Stop();

            CurrentCount = 0;
            time         = 0f;

            if (Reseted != null)
            {
                Reseted.Invoke(this, EventArgs.Empty);
            }
        }
Esempio n. 6
0
        private void RunThreadProc()
        {
            while (running)
            {
                if (commandsRun.TryDequeue(out Command cmd))
                {
                    Started?.Invoke(cmd.id);
                    Dictionary <string, string> results;

                    if (cmd.command == "M114" || cmd.command == "M119")
                    {
                        results = new Dictionary <string, string>();
                        if (cmd.command == "M114")
                        {
                            results["X"] = "0.0";
                            results["Y"] = "0.0";
                            results["Z"] = "0.0";
                        }
                        if (cmd.command == "M119")
                        {
                            results["EX"] = "0";
                            results["EY"] = "0";
                            results["EZ"] = "0";
                            results["EP"] = "0";
                        }
                    }
                    else
                    {
                        if (cmd.command == "M999")
                        {
                            Reseted?.Invoke();
                            continue;
                        }
                        results = opts;
                    }

                    Completed?.Invoke(cmd.id, results);
                    if (commandsRun.Count == maxLength - 1)
                    {
                        EmptySlotAppeared?.Invoke();
                    }
                    SlotsNumberReceived?.Invoke(cmd.id);
                }
                Thread.Sleep(50);
            }
        }
Esempio n. 7
0
 /// <summary>
 /// Resets the lap
 /// </summary>
 public virtual void Reset()
 {
     _lastFrame      = null;
     AvgCadence      = MaxCadence = 0;
     AvgHeartRate    = MaxHeartRate = 0;
     AvgPower        = MaxPower = 0;
     _avgSpeed.Value = 0;
     _maxSpeed.Value = 0;
     _distance       = new Distance(0, DistanceUnit.Meter);
     StartTime       = DateTime.MinValue;
     _elapsedTime    = 0;
     _movingTime     = 0;
     _timeFrames.Clear();
     _cadenceCalculator.Reset();
     _hrCalculator.Reset();
     _powerCalculator.Reset();
     _moveCalculator.Reset();
     _ascentCalculator.Reset();
     Reseted?.Invoke(this, EventArgs.Empty);
 }
Esempio n. 8
0
        private void Reset(int width, int height)
        {
            Color?backgroundColor = BackBuffer?.BackgroundColor;

            BackBuffer?.Dispose();
            DepthBuffer?.Dispose();

            ResizeBuffers(width, height);

            BackBuffer  = new BackBuffer(Device10, Device11);
            DepthBuffer = new DepthBuffer(Device11, width, height);

            if (backgroundColor != null)
            {
                BackBuffer.BackgroundColor = backgroundColor.Value;
            }

            SetViewport(width, height);
            SetTargets();

            Reseted?.Invoke(this);
        }
Esempio n. 9
0
 /// <summary>
 /// To reset the indicator status to initial. The method is called each time when initial settings are changed (for example, the length of period).
 /// </summary>
 public virtual void Reset()
 {
     IsFormed = false;
     Container.ClearValues();
     Reseted?.Invoke();
 }
Esempio n. 10
0
 private void OnResetButtonPointerUp()
 {
     Reseted?.Invoke();
 }
 public void RTSender_Reseted()
 {
     Logger.Instance.Debug(this, "unlock", "reseted");
     waitResponse.Reset();
     Reseted?.Invoke();
 }
Esempio n. 12
0
 /// <summary>
 /// Notifies that <see cref="Reset"/> was called.
 /// </summary>
 protected void OnReseted()
 {
     Reseted?.Invoke(this, EventArgs.Empty);
 }