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