Beispiel #1
0
        protected override void Decode(byte[] Data)
        {
            InMap        = (Data[0] == 0);
            Good         = true;
            TargetNumber = Data[1] & 0xF;

            Target =
                new MapTarget()
            {
                Kind = (MapTargetKind)(Data[1] >> 4),
                X    = BitConverter.ToInt16(new byte[2] {
                    Data[3], Data[2]
                }, 0),
                AlsEn     = ((Data[4] >> 7) & 1) != 0,
                OnStation = ((Data[4] >> 6) & 1) != 0,
                Length    = BitConverter.ToUInt16(new byte[2] {
                    Data[5], (byte)(Data[4] & 0x1F)
                }, 0),
                ConditionallyAllowLigthForFreight = ((Data[6] >> 7) & 1) != 0,
                PullForwardForPassenger           = ((Data[6] >> 6) & 1) != 0,
                PullForwardForFreight             = ((Data[6] >> 5) & 1) != 0,
                AlsEnNewTable = ((Data[6] >> 4) & 1) != 0,
                Speed         = BitConverter.ToUInt16(new byte[2] {
                    Data[7], (byte)((Data[6] >> 2) & 1)
                }, 0),
                AlsnFreq = (Data[6] >> 0) & 3
            };
        }
Beispiel #2
0
        protected override void Decode(byte[] Data)
        {
            InMap = (Data[0] == 0);
            Good = true;
            TargetNumber = Data[1] & 0xF;

            Target =
                new MapTarget()
                {
                    Kind = (MapTargetKind)(Data[1] >> 4),
                    X = BitConverter.ToInt16(new byte[2] { Data[3], Data[2] }, 0),
                    AlsEn = ((Data[4] >> 7) & 1) != 0,
                    OnStation = ((Data[4] >> 6) & 1) != 0,
                    Length = BitConverter.ToUInt16(new byte[2] { Data[5], (byte)(Data[4] & 0x1F) }, 0),
                    ConditionallyAllowLigthForFreight = ((Data[6] >> 7) & 1) != 0,
                    PullForwardForPassenger = ((Data[6] >> 6) & 1) != 0,
                    PullForwardForFreight = ((Data[6] >> 5) & 1) != 0,
                    AlsEnNewTable = ((Data[6] >> 4) & 1) != 0,
                    Speed = BitConverter.ToUInt16(new byte[2] { Data[7], (byte)((Data[6] >> 2) & 1) }, 0),
                    AlsnFreq = (Data[6] >> 0) & 3
                };
        }