فهرست منبع

Merge remote-tracking branch 'remotes/origin/master' into insertcoin

slambb 11 ماه پیش
والد
کامیت
c7ade3f2ab

+ 41 - 10
Assets/BowArrow/InfraredCamera/InfraredDemo.cs

@@ -129,13 +129,13 @@ public class InfraredDemo : JCUnityLib.ViewBase
             updateDropdownResolution2();
         }
 
-        if (!hasCalled && value)
-        {
-            hasCalled = true;
-            //如果本地有记录,初始化一次
-            StartCoroutine(initScreenLocateManual());
-            Debug.Log("[InfraredDemo] SetVisiable Function!");
-        }
+        //if (!hasCalled && value)
+        //{
+        //    hasCalled = true;
+        //    //如果本地有记录,初始化一次
+        //    StartCoroutine(initScreenLocateManual());
+        //    Debug.Log("[InfraredDemo] SetVisiable Function!");
+        //}
     }
     void updateBtnSee() {
         mBtnSee.GetComponentInChildren<Text>().text = _visiable ? TextAutoLanguage2.GetTextByKey("HideInterface") : TextAutoLanguage2.GetTextByKey("DebugInfrared");//"隐藏界面" : "调试红外";
@@ -242,6 +242,9 @@ public class InfraredDemo : JCUnityLib.ViewBase
     //野鸭测试存储
     public ParamFloatValue duckHunterLevel = new ParamFloatValue("test_duckHunterLevelValue", 1);
 
+    //存储滑块信息。camera
+    public Dictionary<string ,ParamFloatValue> ParamFloatValueCameraSlider = new Dictionary<string, ParamFloatValue>();
+
     public static InfraredCameraHelper infraredCameraHelper;
     public static bool running { get => infraredCameraHelper != null; }
     private bool _inited;
@@ -390,6 +393,7 @@ public class InfraredDemo : JCUnityLib.ViewBase
 
                     //记录一个typeStr类型的数据存储操作对象
                     ParamFloatValue paramFloatValue = new ParamFloatValue("ic_uvc_" + typeStr, _defValue);
+                    ParamFloatValueCameraSlider.Add(typeStr, paramFloatValue);
                     if (typeStr == "PU_BRIGHTNESS" || typeStr == "PU_CONTRAST")
                     {
                         //获取设置默认存储的值
@@ -490,22 +494,23 @@ public class InfraredDemo : JCUnityLib.ViewBase
                 Slider slider = trans.GetComponent<Slider>();
                 Text textObj = trans.Find("text").GetComponent<Text>();
                 UVCCtrlInfo _UVCCtrlInfo = currentCameraInfo.GetInfo(typeStr);
+                ParamFloatValue paramFloatValue =  ParamFloatValueCameraSlider.GetValueOrDefault(typeStr);
                 //重置的值
                 int _defValue = _UVCCtrlInfo.def;
                 if (typeStr == "PU_BRIGHTNESS")
                 {
-                    _defValue = 50;
+                    _defValue = (int)paramFloatValue.GetDefault();
                 }
                 else if (typeStr == "PU_CONTRAST")
                 {
-                    _defValue = 50;
+                    _defValue = (int)paramFloatValue.GetDefault();
                 }
                 textObj.text = _defValue + "";
                 slider.value = _defValue;
                 //获取当前值
                 int _currentValue = currentCameraInfo.GetValue(typeStr);
                 //重置存储值
-                //dUVCParameters.GetValueOrDefault(typeStr).Set(_UVCCtrlInfo.def);
+                paramFloatValue.Reset();
                 //存储初始值,设置一次到UVC参数
                 if (_defValue != _currentValue) currentCameraInfo.SetValue(typeStr, _defValue);
             }
@@ -752,6 +757,15 @@ public class InfraredDemo : JCUnityLib.ViewBase
         _duckLevelDropdown.SetValueWithoutNotify(defLevel);
         _duckLevelDropdown.onValueChanged.AddListener(SetDuckLevelTest);
 
+
+        if (!hasCalled)
+        {
+            hasCalled = true;
+            //如果本地有记录,初始化一次算法坐标值
+            StartCoroutine(initScreenLocateManual());
+            Debug.Log("[InfraredDemo] SetVisiable Function!");
+        }
+
     }
 
 
@@ -1777,10 +1791,27 @@ public class ParamFloatValue
         if (!_valueLoaded) _value = PlayerPrefs.GetFloat(_saveKey, _valueDefault);
         return _value;
     }
+
+    public float GetDefault() {
+        return _valueDefault;
+    }
+
+    public string GetKey()
+    {
+        return _saveKey;
+    }
     public void Set(float value)
     {
         _value = value;
         PlayerPrefs.SetFloat(_saveKey, _value);
         PlayerPrefs.Save();
     }
+    /// <summary>
+    /// 重置成默认值
+    /// </summary>
+    public void Reset() {
+        PlayerPrefs.SetFloat(_saveKey, _valueDefault);
+        PlayerPrefs.Save();
+    }
+
 }

+ 5 - 3
Assets/SmartBow/Scripts/Views/InfraredViewParts/InfraredScreenPositioningView.cs

@@ -466,7 +466,8 @@ public class InfraredScreenPositioningView : JCUnityLib.ViewBase
                 LayoutAutoEnd.SetActive(true);
                 pointsParent.gameObject.SetActive(false);
                 CurrentUILineGenerator.enabled = true;
-                if (ScreenLocate.quadUnityVectorList.Count == 0)
+                QuadrilateralInCamera screenAuto = ScreenLocate.Main.ScreenIdentification.QuadAuto;
+                if (screenAuto == null)
                 {
                     AutoEndConfirmBtn.interactable = false;
                 }
@@ -686,11 +687,12 @@ public class InfraredScreenPositioningView : JCUnityLib.ViewBase
         SyncQuadUnityVectorListToMarkerPointesPos();
         //显示提示
         pointMarker.ShowHintImageParent(true);
+        AutoEndConfirmBtn.interactable = true;
+
         if (curStepView == ScreenPositioningStep.Start || curStepView == ScreenPositioningStep.AutoEnd) {
             //如果是开始页面进行自动定位的
             if (curStepView != ScreenPositioningStep.AutoEnd) {
                 SetScreenPositioningStepState(ScreenPositioningStep.AutoEnd);
-                AutoEndConfirmBtn.interactable = true;
             }
         }
         else if (curStepView == ScreenPositioningStep.Marker || curStepView == ScreenPositioningStep.Manual) {
@@ -967,8 +969,8 @@ public class InfraredScreenPositioningView : JCUnityLib.ViewBase
             //如果是开始页面进行自动定位的失败的
             if (curStepView != ScreenPositioningStep.AutoEnd) {
                 SetScreenPositioningStepState(ScreenPositioningStep.AutoEnd);
-                AutoEndConfirmBtn.interactable = false;
             }
+            AutoEndConfirmBtn.interactable = false;
         }
     }
     /// <summary>