/// <summary> /// Mark the block as used, update the modulation type /// and request N blocks from flow queue /// </summary> /// <param name="flow"></param> /// <param name="modulation"></param> public void Use(Flow flow, Modulation modulation) { if (Used) throw new Exception("The block is already used!"); Modulation = modulation; Used = true; Flow = flow; if (flow == null) throw new Exception("No flow!"); if (flow.Data == null) throw new Exception("no data!"); Data = flow.Data.GetSlice(Size()); }
/// <summary> /// to_a converter /// </summary> /// <returns></returns> public static Modulation[] ToArray() { var names = new[] { "unknown", "bpsk", "qpsk", "qam16", "qam64", "qam256" }; var arr = new Modulation[names.Length]; for (int idx = 0; idx < names.Length; idx++) arr[idx] = new Modulation(idx, names[idx]); return arr; }