示例#1
0
 private protected override void WachingStert()
 {
     Task.Run(() =>
     {
         OMG = new OMGinformer();
         SetEvents();
         OMG.StartInformStream(Config.IP);
     });
 }
示例#2
0
 private protected override void WachingStop()
 {
     OMG?.StopInformStream();
     OMG           = null;
     CurrentStatus = RigStatus.offline;
     ScanningStart();
     InformReceived?.Invoke(new RigInform {
         RigInactive = true
     });
     Waching = false;
 }
示例#3
0
 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);
 }