117 lines
3.1 KiB
C#
117 lines
3.1 KiB
C#
using AdamThinkDevicesData;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UIElements;
|
|
|
|
public class Spectrumdetection : MonoBehaviour
|
|
{
|
|
public EquipmentCommon EquipmentCommon;
|
|
#region 频谱探测的参数
|
|
/// <summary>
|
|
/// 探测距离
|
|
/// </summary>
|
|
public string Detectionrange;
|
|
/// <summary>
|
|
/// 批目标处理能力
|
|
/// </summary>
|
|
public string Batchcapacity;
|
|
/// <summary>
|
|
/// 探测成功率
|
|
/// </summary>
|
|
public string Detectionsuccessrate;
|
|
/// <summary>
|
|
/// 探测响应时间
|
|
/// </summary>
|
|
public string Responsetime;
|
|
/// <summary>
|
|
/// 测向精度
|
|
/// </summary>
|
|
public string Directionfindingaccuracy;
|
|
/// <summary>
|
|
/// 最小探测速度
|
|
/// </summary>
|
|
public string Minimumdetectionvelocity;
|
|
#endregion
|
|
|
|
private bool _isStartRehearsing = false;
|
|
/// <summary>
|
|
/// 是否正在演练
|
|
/// </summary>
|
|
public bool isStartRehearsing
|
|
{
|
|
get { return _isStartRehearsing; }
|
|
set
|
|
{
|
|
if (_isStartRehearsing != value)
|
|
{
|
|
_isStartRehearsing = value;
|
|
OnActivationChanged?.Invoke(_isStartRehearsing);
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 布尔值变化时触发时间
|
|
/// </summary>
|
|
public event System.Action<bool> OnActivationChanged;
|
|
void Start()
|
|
{
|
|
EquipmentCommon = GetComponent<EquipmentCommon>();
|
|
OnActivationChanged += OnActivationChangedHandler;
|
|
}
|
|
/// <summary>
|
|
/// 演习是否启动
|
|
/// </summary>
|
|
void OnActivationChangedHandler(bool bol)
|
|
{
|
|
if (bol)
|
|
{
|
|
Debug.Log("开始演练");
|
|
}
|
|
else
|
|
{
|
|
Debug.Log("结束演练");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 读取设备参数
|
|
/// </summary>
|
|
public void FillInTheData(List<List_paraItem> weaponitemone)
|
|
{
|
|
for (int i = 0; i < weaponitemone.Count; i++)
|
|
{
|
|
switch (weaponitemone[i].para_name)
|
|
{
|
|
case "探测距离:":
|
|
Detectionrange = weaponitemone[i].para_value;
|
|
break;
|
|
case "批目标处理能力:":
|
|
Batchcapacity = weaponitemone[i].para_value;
|
|
break;
|
|
case "探测成功率:":
|
|
Detectionsuccessrate = weaponitemone[i].para_value;
|
|
break;
|
|
case "探测响应时间:":
|
|
Responsetime = weaponitemone[i].para_value;
|
|
break;
|
|
case "测向精度:":
|
|
Directionfindingaccuracy = weaponitemone[i].para_value;
|
|
break;
|
|
case "最小探测速度:":
|
|
Minimumdetectionvelocity = weaponitemone[i].para_value;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
private void OnDestroy()
|
|
{
|
|
OnActivationChanged -= OnActivationChangedHandler;
|
|
}
|
|
}
|