コード例 #1
0
 static int ShowShadowCamera(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 0);
         PTZCamera.ShowShadowCamera();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #2
0
    static int get_Field(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            PTZCamera obj = (PTZCamera)o;
            float     ret = obj.Field;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Field on a nil value" : e.Message));
        }
    }
コード例 #3
0
    static int get_Instence(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            PTZCamera obj = (PTZCamera)o;
            PTZCamera ret = obj.Instence;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Instence on a nil value" : e.Message));
        }
    }
コード例 #4
0
    static int set_FarClipPlane(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            PTZCamera obj  = (PTZCamera)o;
            float     arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.FarClipPlane = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index FarClipPlane on a nil value" : e.Message));
        }
    }
コード例 #5
0
 void OnEnable()
 {
     model = target as PTZCamera;
 }
コード例 #6
0
ファイル: Camera_Control.cs プロジェクト: KentZeng123/Orpheus
        static void Main(string[] args)
        {
            int        max_speed = 100;
            int        x_speed   = 0;
            int        y_speed   = 0;
            bool       speed_Changed;
            HttpClient client = new HttpClient();
            PTZCamera  cam    = new PTZCamera("192.168.0.42", "admin", "1234", client);

            while (true)
            {
                speed_Changed = false;
                if (Keyboard.GetState().IsKeyDown(Key.Up))
                {
                    if (y_speed != max_speed)
                    {
                        y_speed       = max_speed;
                        speed_Changed = true;
                    }
                }
                else if (Keyboard.GetState().IsKeyDown(Key.Down))
                {
                    if (y_speed != -max_speed)
                    {
                        y_speed       = -max_speed;
                        speed_Changed = true;
                    }
                }
                else if (y_speed != 0)
                {
                    y_speed       = 0;
                    speed_Changed = true;
                }

                if (Keyboard.GetState().IsKeyDown(Key.Left))
                {
                    if (x_speed != -max_speed)
                    {
                        x_speed       = -max_speed;
                        speed_Changed = true;
                    }
                }
                else if (Keyboard.GetState().IsKeyDown(Key.Right))
                {
                    if (x_speed != max_speed)
                    {
                        x_speed       = max_speed;
                        speed_Changed = true;
                    }
                }
                else if (x_speed != 0)
                {
                    x_speed       = 0;
                    speed_Changed = true;
                }

                if (speed_Changed)
                {
                    Console.WriteLine("x,y: " + x_speed + ", " + y_speed);
                    cam.set_speeds(x_speed, y_speed);
                }
            }
        }
コード例 #7
0
        public override byte[] GetCameraImage(int height, int width)
        {
            PTZCamera camera = (PTZCamera)PTZCamera.GetObject(PTZCamera.sClassName, PTZCamera.port);

            return(camera.GetRawImage());
        }
コード例 #8
0
 void Awake()
 {
     instence  = this;
     m_Cameras = GetComponentsInChildren <Camera>();
     UpdateAll();
 }