示例#1
0
        private void detectTimer_Tick(object sender, EventArgs e)
        {
            try
            {
                detectTimer.Enabled = false;
                var vrSet = new PSVR(Settings.Instance.EnableUDPBroadcast);
                PSVRController.DeviceConnected(vrSet);
                vrSet.SensorDataUpdate += VrSet_SensorDataUpdate;
                vrSet.Removed          += VrSet_Removed;

                Task.Run(() =>
                {
                    PSVRController.HeadsetOn();
                    PSVRController.EnableVRMode();
                    Thread.Sleep(1500);
                    PSVRController.EnableCinematicMode();
                    Thread.Sleep(1500);
                    PSVRController.ApplyCinematicSettings();
                });

                lblStatus.Text       = "VR set found";
                grpFunctions.Enabled = true;
                grpCinematic.Enabled = true;
                grpLeds.Enabled      = true;
            }
            catch (Exception ex) { detectTimer.Enabled = true; }
        }
示例#2
0
        private void detectTimer_Tick(object sender, EventArgs e)
        {
            try
            {
                detectTimer.Enabled = false;
                var vrSet = new PSVR(Settings.Instance.EnableUDPBroadcast);
                PSVRController.DeviceConnected(vrSet);
                vrSet.SensorDataUpdate += VrSet_SensorDataUpdate;
                vrSet.Removed          += VrSet_Removed;
                vrSet.INReport         += VrSet_CommandResponse;
                ThreadPool.QueueUserWorkItem((a) =>
                {
                    PSVRController.RequestDeviceInfo();
                    PSVRController.HeadsetOn();
                    PSVRController.EnableVRMode();
                    Thread.Sleep(1500);
                    PSVRController.EnableCinematicMode();
                    Thread.Sleep(1500);
                    PSVRController.ApplyCinematicSettings();
                });

                lblStatus.Text       = "VR set found";
                grpFunctions.Enabled = true;
                grpCinematic.Enabled = true;
                grpLeds.Enabled      = true;
            }
            catch { detectTimer.Enabled = true; }
        }