コード例 #1
0
ファイル: ClientForm.cs プロジェクト: culturespy/ZapU
 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
ファイル: ServerForm.cs プロジェクト: culturespy/ZapU
 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;
         }
     }
 }