public void ReadTimeProgress() { CallForFreshData(); var rawVar = GetRawVariable("Progress"); var varVal = Single.Parse(rawVar); TimeProgressRead?.Invoke(this, new EventArgs <float>(varVal)); }
public void ReadTimeProgress() { EnqueueCallOnNetworkStream(nameof(ReadTimeProgress), netStream => { netStream.WriteByte(0x02); var data = new byte[4]; var len = netStream.Read(data, 0, 4); var timeProgress = BitConverter.ToSingle(data, 0); TimeProgressRead?.Invoke(this, new EventArgs <float>(timeProgress)); }); }
public void ReadTimeProgress() { _t0 = _t1; _t1 = DateTime.Now; var dt = _t1 - _t0; var dtms = (int)dt.TotalMilliseconds; _currentTime += dtms; int diff = _currentTime - _cycleTime; if (diff >= 0) { _currentTime = diff; } TimeProgressRead?.Invoke(this, new EventArgs <float>(_currentTime / (float)_cycleTime)); }