public YZXUshort this[int ushortIndex] { get { if (ushortIndex.InRange(0, Mermory.UshortCount - 1, true)) { YZXUshort w = Mermory.Ushorts[ushortIndex]; return(w); } throw new InvalidOperationException(); } }
/// <summary> /// 映射模块到内存区域的某一个部分 /// 信息记录在每个YZXBit上 /// </summary> /// <param name="begin">起始</param> /// <param name="length">长度</param> /// <param name="unit">模块</param> public void Map(ushort begin, ushort length, YZXUnit unit) { for (ushort i = 0; i < length; i++) { YZXUshort us = this[begin + i]; us.Unit = unit; us.UShortIndexInUnit = i; for (int j = 0; j < 16; j++) { YZXBit b = us[j]; b.Unit = unit; b.UShortIndexInUnit = i; b.BitIndexInUnit = j; } } }