public void MatchUIWithSRWorksSetting() { Default_Values.Clear(); for (int i = 0; i < sliders.Count; i++) { Default_Values.Add(GetValue((ControlMode)i, ValueToGet.Value)); } int result = SRWorkModule_API.GetDepthParameterBool((int)DepthCmd.ENABLE_REFINEMENT, ref refinement_setting); if (result == (int)Error.WORK) { ViveSR_DualCameraImageCapture.DepthRefinement = refinement_setting; } else { Debug.LogWarning("Depth refinemenet call status: " + (Error)result); } Default_isDepthRefinementOn = ViveSR_DualCameraImageCapture.DepthRefinement; Default_isEdgeEnhanceOn = ViveSR_DualCameraImageCapture.DepthEdgeEnhance; Default_DepthCase = ViveSR_DualCameraImageCapture.DepthCase; for (int i = 0; i < sliders.Count; i++) { sliders[i].value = GetValue((ControlMode)i, ValueToGet.Value); } switches_status[(int)ControlMode.Refinement - sliders.Count].text = Default_isDepthRefinementOn ? "On" : "Off"; switches_status[(int)ControlMode.EdgeEnhance - sliders.Count].text = Default_isEdgeEnhanceOn ? "On" : "Off"; switches_status[(int)ControlMode.DepthCase - sliders.Count].text = Default_DepthCase == DepthCase.DEFAULT ? "Default" : "Close Range"; }
private void UpdateWhileWorking() { if (FrameworkStatus != FrameworkStatus.WORKING) { return; } if (EnableSeeThroughModule == true && EnableUnitySeeThrough == false) { Modules[0].Initial(); SRWorkModule_API.TurnOffUndistortDataToDepth(); SRWorkModule_API.UnlinkModule((int)ModuleType.SEETHROUGH, (int)ModuleType.DEPTH); if (SeeThrough.SRWork_SeeThrough.b4KImageReady) { SeeThrough.SRWork_SeeThrough.SkipVGASeeThrough(true); } EnableUnitySeeThrough = true; } if (EnableSeeThroughNon4KDistortDataUse == true && EnableUnitySeeThroughNon4KDistortData == false) { bool result = SeeThrough.SRWork_SeeThrough.TurnOnSeeThroughDistortData(); if (result) { EnableUnitySeeThroughNon4KDistortData = true; } } else if (EnableSeeThroughNon4KDistortDataUse == false && EnableUnitySeeThroughNon4KDistortData == true) { bool result = SeeThrough.SRWork_SeeThrough.TurnOffSeeThroughDistortData(); if (result) { EnableUnitySeeThroughNon4KDistortData = false; } } if (EnableDepthMeshModule == true && EnableUnityDepthMesh == false) { Modules[1].Initial(); //Get refinement setting of engine. int result = SRWorkModule_API.GetDepthParameterBool((int)DepthCmd.ENABLE_REFINEMENT, ref refinement_setting); if (result == (int)SR.Error.WORK) { ViveSR_DualCameraImageCapture.DepthRefinement = refinement_setting; } SRWorkModule_API.UnlinkModule((int)ModuleType.DEPTH, (int)ModuleType.DEPTHMESH); EnableUnityDepthMesh = true; } if (EnableRigidReconstructionModule == true && EnableUnityReconstruction == false) { Modules[2].Initial(); SRWorkModule_API.UnlinkModule((int)ModuleType.DEPTH, (int)ModuleType.RIGIDRECONSTRUCTION); EnableUnityReconstruction = true; } }