public UIMConfig() { for (int i = 0; i < AURADef.kSpeedModeCount; ++i) { zones_[i] = new UIMConfigMode(); } }
public UIMConfig(byte[] buf, ushort ofs, ushort len) { if (buf == null) { throw new ArgumentNullException("buf"); } for (int i = 0; i < AURADef.kSpeedModeCount; ++i) { zones_[i] = new UIMConfigMode(); } ushort ndx = ofs; ConfigurationPresentMarker = BitConverter.ToUInt32(buf, ndx); ndx += 4; Version = buf[ndx++]; this[SpeedMode.Work].EntrySpeed = BitConverter.ToSingle(buf, ndx); ndx += 4; this[SpeedMode.Work].Hysteresis = BitConverter.ToSingle(buf, ndx); ndx += 4; this[SpeedMode.Travel][DistanceZone.Approach] = BitConverter.ToSingle(buf, ndx); ndx += 4; this[SpeedMode.Travel][DistanceZone.Inside] = BitConverter.ToSingle(buf, ndx); ndx += 4; this[SpeedMode.Travel][DistanceZone.Critical] = BitConverter.ToSingle(buf, ndx); ndx += 4; this[SpeedMode.Work][DistanceZone.Approach] = BitConverter.ToSingle(buf, ndx); ndx += 4; this[SpeedMode.Work][DistanceZone.Inside] = BitConverter.ToSingle(buf, ndx); ndx += 4; this[SpeedMode.Work][DistanceZone.Critical] = BitConverter.ToSingle(buf, ndx); ndx += 4; AlarmToneRepeatTime = buf[ndx++]; AlarmFlags = buf[ndx++]; MiscFlags = buf[ndx++]; this[SpeedMode.Crawl].EntrySpeed = BitConverter.ToSingle(buf, ndx); ndx += 4; this[SpeedMode.Crawl].Hysteresis = BitConverter.ToSingle(buf, ndx); ndx += 4; this[SpeedMode.Crawl][DistanceZone.Approach] = BitConverter.ToSingle(buf, ndx); ndx += 4; this[SpeedMode.Crawl][DistanceZone.Inside] = BitConverter.ToSingle(buf, ndx); ndx += 4; this[SpeedMode.Crawl][DistanceZone.Critical] = BitConverter.ToSingle(buf, ndx); ndx += 4; AutoBrakeEnable = (buf[ndx] == 0) ? false : true; ndx++; AutoBrakeDelay = buf[ndx++]; }