private protected override void WachingStert() { Task.Run(() => { OMG = new OMGinformer(); SetEvents(); OMG.StartInformStream(Config.IP); }); }
private protected override void WachingStop() { OMG?.StopInformStream(); OMG = null; CurrentStatus = RigStatus.offline; ScanningStart(); InformReceived?.Invoke(new RigInform { RigInactive = true }); Waching = false; }
private void SetEvents() { OMG.StreamStart += () => Task.Run(() => { ScanningStop(); CurrentStatus = RigStatus.works; }); OMG.StreamEnd += () => Task.Run(() => { OMG?.ClearEvents(); OMG = null; CurrentStatus = RigStatus.offline; ScanningStart(); InformReceived?.Invoke(new RigInform { RigInactive = true }); Waching = false; }); OMG.SentInform += RO => InformReceived.Invoke(RO); }