示例#1
0
    /// <summary>
    /// This method initializes necessary objects.
    /// </summary>
    public override void Initialize()
    {
        base.Initialize();

        Console.AddCommand("k_tilt", o => {
            if (o.Count == 1)
            {
                Console.WriteLine(Sensor.ElevationAngle.ToString());
            }
            else
            {
                Sensor.ElevationAngle = int.Parse(o[1]);
            }
        });
        Console.AddCommand("k_init", o =>
        {
            if (o.Count == 1)
            {
                DiscoverSensor();
            }
            else
            {
                DiscoverSensor(bool.Parse(o[1]), bool.Parse(o[2]));
            }
        });
        Console.AddCommand("k_uninit", o => Uninitialize());
        Console.AddCommand("k_video", o =>
        {
            if (o[1].ToLower() == "open")
            {
                OpenColorStream();
            }
            else if (o[1].ToLower() == "close")
            {
                ColorStream = null;
            }
        });
        Console.AddCommand("k_depth", o =>
        {
            if (o[1].ToLower() == "open")
            {
                OpenDepthStream();
            }
            else if (o[1].ToLower() == "close")
            {
                DepthStream = null;
            }
        });
        Console.AddCommand("k_status", o => Console.WriteLine(GetStatus()));
        Console.AddCommand("k_draw", o => Draw         = bool.Parse(o[1]));
        Console.AddCommand("k_seated", o => SeatedMode = bool.Parse(o[1]));
    }
示例#2
0
 public void AttachToConsole(Console console = null)
 {
     if (console == null)
     {
         return;
     }
     console.AddCommand("sp_start", sp_start);
     console.AddCommand("sp_stop", sp_stop);
     console.AddCommand("sp_clear", sp_clear);
     console.AddCommand("sp_add", sp_add);
     console.AddCommand("sp_rejectcmd", sp_rejectcmd);
     console.AddCommand("sp_hypocmd", sp_hypofunc);
     console.AddCommand("sp_recognizecmd", sp_recognizecmd);
 }