0

我正在创建一个插件,我可以在其中选择相机并具有左右按钮(当前左按钮正在记录它已移动),按钮工作但相机不移动。

这是我的代码片段:

    private void InitializeCommands()
    {
        this.MoveCamera = ReactiveCommand.Create<BtnCommands, Unit>(b => 
            {
                if (b == BtnCommands.Left)
                {
                    // here comes the API stuff to actually turn it
                    VideoOS.Platform.Messaging.Message msg = new VideoOS.Platform.Messaging.Message(MessageId.Control.PTZMoveCommand, VideoOS.Platform.Messaging.PTZMoveCommandData.Left);
                    EnvironmentManager.Instance.SendMessage(msg, this.SelectedCamera.FQID);
                }
                
                else if (b == BtnCommands.Right)
                {
                    // here comes the API stuff to actually turn it
                }
                return Unit.Default;
            });
        this.WhenAnyValue(x => x.SelectedCamera).Log(this, "Test").Subscribe();
        this.WhenAnyValue(b => b.MoveCamera).Log(this, "Moved?").Subscribe();
    }
4

0 回答 0