Exemple #1
0
 public void startConnection()
 {
     trinusProcessor.resetDisconnectStatus();
     currentIntroStage = -1;
     trinusCursor.gameObject.SetActive(false);
     TrinusProcessor.trinusPause(false);
     setCurrentPage(UI_PAGE.CONNECTION_WAIT);
 }
Exemple #2
0
 public void setShowFps(bool on)
 {
     TrinusProcessor.getUserSettings().showFps = on;
     if (!on)
     {
         setHint();
     }
 }
Exemple #3
0
        public void ipEntered(string ip)
        {
            string vip = TrinusProcessor.validateIp(ip);

            TrinusProcessor.getUserSettings().forcedIP = vip;

            InputField ipField = getCurrentPageChildComponent <InputField> ("IpInputField");

            if (ipField != null)
            {
                ipField.text = vip == null? "" : vip;
            }
        }
Exemple #4
0
        public void setLensCorrection(int value)
        {
            List <string> presets = new List <string>(TrinusProcessor.LensParams.getPresetNames());

            if (value == 0)
            {
                TrinusProcessor.getUserSettings().lensParams.selectPreset(TrinusProcessor.LensParams.CUSTOM_PRESET);
            }
            else
            {
                TrinusProcessor.getUserSettings().lensParams.selectPreset(presets[value - 1]);
            }
            trinusProcessor.applyLensParams();
        }
Exemple #5
0
 public void restartConnection(bool doIntro)
 {
     TrinusProcessor.trinusPause(true);
     trinusProcessor.endStreaming();
     setMessage();
     setHint();
     if (doIntro)
     {
         openIntro(true);
     }
     else
     {
         startConnection();
     }
 }
Exemple #6
0
        public void sensorPortEntered(string port)
        {
            int portInt = 5555;

            if (!int.TryParse(port, out portInt) || (portInt <= 1024 || portInt >= 49151))
            {
                portInt = 5555;

                InputField portField = getCurrentPageChildComponent <InputField> ("SensorPortInputField");
                if (portField != null)
                {
                    portField.text = portInt.ToString();
                }
            }
            TrinusProcessor.getUserSettings().sensorPort = portInt;
        }
Exemple #7
0
        public void finishCustomLensSetup(bool save)
        {
            openSettings();
            Dropdown dropdown = getCurrentPageChild("LensCorrectionDropdown").GetComponent <Dropdown> ();

            if (save)
            {
                dropdown.captionText.text = TrinusProcessor.getUserSettings().lensParams.currentPreset;
                TrinusProcessor.getUserSettings().lensParams.savePreset();
            }
            else
            {
                TrinusProcessor.getUserSettings().lensParams.selectPreset(dropdown.captionText.text);                  //TrinusProcessor.LensParams.CUSTOM_PRESET);
                trinusProcessor.applyLensParams();
            }
        }
Exemple #8
0
        public void openCustomLensSetup()
        {
            setCurrentPage(UI_PAGE.LENS);

            TrinusProcessor.getUserSettings().lensParams.selectPreset(TrinusProcessor.LensParams.CUSTOM_PRESET);
            trinusProcessor.applyLensParams();

            updateSlider(getCurrentPageChild("SeparationSlider"), (int)(TrinusProcessor.getUserSettings().lensParams.screenx * 100));
            updateSlider(getCurrentPageChild("WidthSlider"), (int)(TrinusProcessor.getUserSettings().lensParams.scalex * 100));
            updateSlider(getCurrentPageChild("HeightSlider"), (int)(TrinusProcessor.getUserSettings().lensParams.scaley * 100));
            updateSlider(getCurrentPageChild("LensAngleXSlider"), (int)(TrinusProcessor.getUserSettings().lensParams.lensx * 100));
            updateSlider(getCurrentPageChild("WarpXSlider"), (int)(TrinusProcessor.getUserSettings().lensParams.warpx * 100));
            updateSlider(getCurrentPageChild("WarpYSlider"), (int)(TrinusProcessor.getUserSettings().lensParams.warpy * 100));
            updateSlider(getCurrentPageChild("WarpZSlider"), (int)(TrinusProcessor.getUserSettings().lensParams.warpz * 100));
            updateSlider(getCurrentPageChild("ChromaSlider"), (int)(TrinusProcessor.getUserSettings().lensParams.chroma * 100));
        }
Exemple #9
0
        void populateLensCorrectionDropdown()
        {
            Dropdown      dropdown = getCurrentPageChild("LensCorrectionDropdown").GetComponent <Dropdown> ();
            List <string> presets  = new List <string>(TrinusProcessor.LensParams.getPresetNames());

            presets.Insert(0, TrinusProcessor.LensParams.CUSTOM_PRESET);
            dropdown.options.Clear();
            foreach (string optionStr in presets)
            {
                dropdown.options.Add(new Dropdown.OptionData(optionStr));
            }
//			dropdown.options.AddRange
//			dropdown.AddOptions (null);
//			dropdown.ClearOptions ();
//			dropdown.AddOptions (presets);
            dropdown.captionText.text = TrinusProcessor.getUserSettings().lensParams.currentPreset;
        }
Exemple #10
0
        public void portEnteredOnConnection(string port)
        {
            int vport = TrinusProcessor.validatePort(port);

            InputField portField = getCurrentPageChildComponent <InputField> ("PortInputField");

            if (portField != null)
            {
                portField.text = vport == -1? "" : "" + vport;
            }

            Debug.Log("port set " + vport + " " + port);
            if (vport != -1)
            {
                TrinusProcessor.getUserSettings().videoPort = vport;
                restartConnection(false);
            }
        }
Exemple #11
0
        public void ipEnteredOnConnection(string ip)
        {
            Debug.Log("ip " + ip);                              // <F>
            ip = "192.168.1.129";                               // <F>
            string vip = TrinusProcessor.validateIp(ip);

            TrinusProcessor.getUserSettings().forcedIP = vip;                           // <F>

            /*		<F>
             * InputField ipField = getCurrentPageChildComponent<InputField> ("IpInputField");
             * if (ipField != null)
             *      ipField.text = vip == null? "" : vip;
             *
             * if (vip != null && !vip.Trim ().Equals ("")) {
             *      TrinusProcessor.getUserSettings ().forcedIP = vip;
             *      restartConnection (false);
             * } else
             *      TrinusProcessor.getUserSettings ().forcedIP = null;
             */
        }
Exemple #12
0
        public void ipEnteredOnConnection(string ip)
        {
            string vip = TrinusProcessor.validateIp(ip);

            InputField ipField = getCurrentPageChildComponent <InputField> ("IpInputField");

            if (ipField != null)
            {
                ipField.text = vip == null? "" : vip;
            }

            if (vip != null && !vip.Trim().Equals(""))
            {
                TrinusProcessor.getUserSettings().forcedIP = vip;
                restartConnection(false);
            }
            else
            {
                TrinusProcessor.getUserSettings().forcedIP = null;
            }
        }
Exemple #13
0
        // Use this for initialization
        void Awake()
        {
            trinusCursor    = transform.FindChild("TrinusCursor").transform;
            trinusProcessor = GameObject.Find("TrinusManager").GetComponent <TrinusProcessor> ();
            trinusMessage   = transform.FindChild("TrinusMessage").GetComponent <Text> ();
            trinusHint      = transform.FindChild("TrinusHint").GetComponent <Text> ();

            setMessage();
            setHint();

            trinusUIDefaultScale = transform.localScale.x;

            canvas = GetComponent <Canvas> ();

            TrinusProcessor.setMessageCallbacks(setMessage, setHint, setHint);
            setShowFps(TrinusProcessor.getUserSettings().showFps);

            Localization.setLocalization(transform);
            setTheme(trinusTheme);

            trinusCursor.gameObject.SetActive(false);
        }
Exemple #14
0
        public void openSettings()
        {
            if (disableTrackingWhenPaused)
            {
                trinusProcessor.disableHeadTracking(true);
            }

            setCurrentPage(UI_PAGE.SETTINGS);

            populateLensCorrectionDropdown();

            getCurrentPageChildComponent <Toggle> ("FpsToggle").isOn = TrinusProcessor.getUserSettings().showFps;
            getCurrentPageChildComponent <Dropdown> ("HeadTrackingDropdown").value = TrinusProcessor.getUserSettings().yawScale - 1;
            updateSlider(getCurrentPageChild("FovSlider"), trinusProcessor.getFov());
            updateSlider(getCurrentPageChild("IpdSlider"), (int)(TrinusProcessor.getUserSettings().ipd * 100));
            //		getCurrentPageChildComponent<Dropdown>("QualityDropdown").GetComponent<Dropdown> ().value = Screen.currentResolution.height == 900? 1 :
            //			(Screen.currentResolution.height < 900? 0 : 2);
            int resolutionIndex = 0;

            if (Screen.height > 500)
            {
                resolutionIndex++;
            }
            if (Screen.height > 800)
            {
                resolutionIndex++;
            }
            if (Screen.height > 1000)
            {
                resolutionIndex++;
            }
            //Debug.Log ("RI " + resolutionIndex + " " + Screen.currentResolution.height + " " + Screen.height);
            getCurrentPageChildComponent <Dropdown> ("QualityDropdown").GetComponent <Dropdown> ().value = resolutionIndex;

            getCurrentPageChild("CustomButton").gameObject.SetActive(lensSettingsPage != null);

            getCurrentPageChildComponent <Toggle> ("MonoscopicToggle").isOn = trinusProcessor.getMonoscopic();
        }
 void Awake()
 {
     trinusProcessor = GameObject.Find("TrinusManager").GetComponent <TrinusProcessor> ();
 }
Exemple #16
0
 public void setChroma(System.Single v)
 {
     TrinusProcessor.getUserSettings().lensParams.chroma = (v / 100f);
     trinusProcessor.setChroma(TrinusProcessor.getUserSettings().lensParams.chroma);
 }
Exemple #17
0
 public void setWarpZ(System.Single v)
 {
     TrinusProcessor.getUserSettings().lensParams.warpz = (v / 100f);
     trinusProcessor.setWarp(TrinusProcessor.getUserSettings().lensParams.warpx, TrinusProcessor.getUserSettings().lensParams.warpy, TrinusProcessor.getUserSettings().lensParams.warpz);
 }
Exemple #18
0
 public void setLensX(System.Single v)
 {
     TrinusProcessor.getUserSettings().lensParams.lensx = (v / 100f);
     trinusProcessor.setLensCenter(TrinusProcessor.getUserSettings().lensParams.lensx, TrinusProcessor.getUserSettings().lensParams.lensy);
 }
Exemple #19
0
 public void setScaleY(System.Single v)
 {
     TrinusProcessor.getUserSettings().lensParams.scaley = (v / 100f);
     trinusProcessor.setScale(TrinusProcessor.getUserSettings().lensParams.scalex, TrinusProcessor.getUserSettings().lensParams.scaley);
 }
Exemple #20
0
 public void setScreenX(System.Single v)
 {
     TrinusProcessor.getUserSettings().lensParams.screenx = (v / 100f);
     trinusProcessor.setScreenCenter(TrinusProcessor.getUserSettings().lensParams.screenx, TrinusProcessor.getUserSettings().lensParams.screeny);
 }
Exemple #21
0
 public void setIpd(System.Single v)
 {
     TrinusProcessor.getUserSettings().ipd = (v / 100f);
     trinusProcessor.setIpd(TrinusProcessor.getUserSettings().ipd);
 }
Exemple #22
0
 public void setTracking(int value)
 {
     TrinusProcessor.getUserSettings().yawScale = value == 0? 1 : value * 2;
 }