2019-09-29 10:00:16 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace cylvester
|
|
|
|
{
|
|
|
|
public interface IPdSpectrumBind
|
|
|
|
{
|
2019-09-29 16:04:26 +00:00
|
|
|
IPdArray PdArray { get; }
|
2019-09-29 17:47:17 +00:00
|
|
|
int Energy { get; set; }
|
2019-09-29 10:00:16 +00:00
|
|
|
}
|
|
|
|
|
2019-09-29 16:04:26 +00:00
|
|
|
[ExecuteInEditMode]
|
2019-09-29 10:00:16 +00:00
|
|
|
public class PdSpectrumBind : MonoBehaviour, IPdSpectrumBind
|
|
|
|
{
|
|
|
|
public int channel;
|
|
|
|
public int startBin;
|
|
|
|
public int endBin;
|
2019-09-29 16:04:26 +00:00
|
|
|
public float topClip;
|
|
|
|
public float bottomClip;
|
2019-09-29 17:47:17 +00:00
|
|
|
|
2019-09-29 16:04:26 +00:00
|
|
|
private PdArray pdArray_;
|
2019-09-29 10:00:16 +00:00
|
|
|
|
2019-09-29 16:04:26 +00:00
|
|
|
private void Awake()
|
2019-09-29 10:00:16 +00:00
|
|
|
{
|
2019-09-29 16:04:26 +00:00
|
|
|
pdArray_ = new PdArray("fft_" + channel, 512);
|
2019-09-29 10:00:16 +00:00
|
|
|
}
|
2019-09-29 17:47:17 +00:00
|
|
|
|
|
|
|
public IPdArray PdArray => pdArray_;
|
|
|
|
|
|
|
|
public int Energy { get; set; }
|
2019-09-29 10:00:16 +00:00
|
|
|
}
|
|
|
|
}
|