Пример #1
0
 void ProxyQueueStateCallback(DeviceBase device, int depth)
 {
     if (this.InvokeRequired)
     {
         var d = new DeviceBase.DeviceQueueStateCallback(ProxyQueueStateCallback);
         this.BeginInvoke(d, new object[] { device, depth });
     }
     else
     {
         if (depth == 0)
         {
             if (!first_resync_received)
             {
                 AddMessage("Device state synchronized.");
             }
             first_resync_received = true;
             clear_to_send         = true;
         }
     }
 }
Пример #2
0
 public void ZapQueueStateCallback(DeviceBase device, int depth)
 {
     if (this.InvokeRequired)
     {
         var d = new DeviceBase.DeviceQueueStateCallback(ZapQueueStateCallback);
         this.BeginInvoke(d, new object[] { device, depth });
     }
     else
     {
         if (depth == 0 && client_needs_resync)
         {
             Proxy.SetLevels(new LevelsCommand()
             {
                 A = FeedbackA.Value, B = FeedbackB.Value, MA = 0, Mode = ControlMode.absolute
             });
             Proxy.SetMode(new ModeCommand()
             {
                 Mode = (int)_last_mode, MA = FeedbackM.Value
             });
             client_needs_resync = false;
         }
     }
 }