void RenderBlockSequence(BlockSequence blockSequence) { foreach (Block block in blockSequence.Blocks) { RenderBlock(block); } }
public void Clock(bool b) { _raw <<= 1; _raw |= b ? 1u : 0u; _count++; if (_sequence == BlockSequence.WaitBitSync) { _syndrome = BuildSyndrome(_raw); _syndrome ^= 0x3d8; _sequence = _syndrome == 0 ? BlockSequence.GotA : BlockSequence.WaitBitSync; _blocks[0] = (UInt16)((_raw >> CheckwordBitsCount) & 0xffff); _count = 0; } if (_count == 26) { ProcessSyndrome(); if (_sequence == BlockSequence.GotD) { _dumpGroups.AnalyseFrames(_blocks[0], _blocks[1], _blocks[2], _blocks[3]); _sequence = BlockSequence.GotBitSync; } _count = 0; } }
public void Clock(bool b) { _raw <<= 1; _raw |= b ? 1u : 0u; _count++; if (_sequence == BlockSequence.WaitBitSync) { _syndrome = BuildSyndrome(_raw); _syndrome ^= 0x3d8; _sequence = _syndrome == 0 ? BlockSequence.GotA : BlockSequence.WaitBitSync; _blocks[0] = (UInt16)((_raw >> CheckwordBitsCount) & 0xffff); _count = 0; } if (_count == 26) { ProcessSyndrome(); if (_sequence == BlockSequence.GotD) { _dumpGroups.AnalyseFrames(_blocks[0], _blocks[1], _blocks[2], _blocks[3]); _sequence = BlockSequence.GotBitSync; } _count = 0; } }
private void ProcessSyndrome() { _syndrome = BuildSyndrome(_raw); switch (_sequence) { case BlockSequence.GotBitSync: _syndrome ^= 0x3d8; _sequence = BlockSequence.GotA; break; case BlockSequence.GotA: _syndrome ^= 0x3d4; _sequence = BlockSequence.GotB; break; case BlockSequence.GotB: _syndrome ^= (UInt16)((_blocks[1] & 0x800) == 0 ? 0x25c : 0x3cc); _sequence = BlockSequence.GotC; break; case BlockSequence.GotC: _syndrome ^= 0x258; _sequence = BlockSequence.GotD; break; } var blockIndex = (int)_sequence; if (_syndrome != 0) { if (_useFec) { var corrected = ApplyFEC(); if (_syndrome != 0 || corrected > MaxCorrectableBits) { _sequence = BlockSequence.WaitBitSync; } else { _blocks[blockIndex] = (UInt16)(_raw & 0xffff); } } else { _sequence = BlockSequence.WaitBitSync; } } else { _blocks[blockIndex] = (UInt16)((_raw >> CheckwordBitsCount) & 0xffff); } }
private void ProcessSyndrome() { this._syndrome = SyndromeDetector.BuildSyndrome(this._raw); switch (this._sequence) { case BlockSequence.GotBitSync: this._syndrome ^= 984; this._sequence = BlockSequence.GotA; break; case BlockSequence.GotA: this._syndrome ^= 980; this._sequence = BlockSequence.GotB; break; case BlockSequence.GotB: this._syndrome ^= (ushort)(((this._blocks[1] & 0x800) == 0) ? 604 : 972); this._sequence = BlockSequence.GotC; break; case BlockSequence.GotC: this._syndrome ^= 600; this._sequence = BlockSequence.GotD; break; } int sequence = (int)this._sequence; if (this._syndrome != 0) { if (this._useFec) { int num = this.ApplyFEC(); if (this._syndrome != 0 || num > 5) { this._sequence = BlockSequence.WaitBitSync; } else { this._blocks[sequence] = (ushort)(this._raw & 0xFFFF); } } else { this._sequence = BlockSequence.WaitBitSync; } } else { this._blocks[sequence] = (ushort)(this._raw >> 10 & 0xFFFF); } }
public void Clock(bool b) { this._raw <<= 1; this._raw |= (uint)(b ? 1 : 0); this._count++; if (this._sequence == BlockSequence.WaitBitSync) { this._syndrome = SyndromeDetector.BuildSyndrome(this._raw); this._syndrome ^= 984; this._sequence = ((this._syndrome != 0) ? BlockSequence.WaitBitSync : BlockSequence.GotA); this._blocks[0] = (ushort)(this._raw >> 10 & 0xFFFF); this._count = 0; } if (this._count == 26) { this.ProcessSyndrome(); if (this._sequence == BlockSequence.GotD) { this._frame.GroupA = this._blocks[0]; this._frame.GroupB = this._blocks[1]; this._frame.GroupC = this._blocks[2]; this._frame.GroupD = this._blocks[3]; this._frame.Filter = false; RdsFrameAvailableDelegate frameAvailable = this.FrameAvailable; if (frameAvailable != null) { frameAvailable(ref this._frame); } if (!this._frame.Filter) { this._dumpGroups.AnalyseFrames(ref this._frame); } this._sequence = BlockSequence.GotBitSync; } this._count = 0; } }
public void Clock(bool b) { this._raw <<= 1; this._raw |= (uint)(b ? 1 : 0); this._count++; if (this._sequence == BlockSequence.WaitBitSync) { this._syndrome = SyndromeDetector.BuildSyndrome(this._raw); this._syndrome ^= 984; this._sequence = ((this._syndrome != 0) ? BlockSequence.WaitBitSync : BlockSequence.GotA); this._blocks[0] = (ushort)(this._raw >> 10 & 0xFFFF); this._count = 0; } if (this._count == 26) { this.ProcessSyndrome(); if (this._sequence == BlockSequence.GotD) { this._dumpGroups.AnalyseFrames(this._blocks[0], this._blocks[1], this._blocks[2], this._blocks[3]); this._sequence = BlockSequence.GotBitSync; } this._count = 0; } }
private void ProcessSyndrome() { _syndrome = BuildSyndrome(_raw); switch (_sequence) { case BlockSequence.GotBitSync: _syndrome ^= 0x3d8; _sequence = BlockSequence.GotA; break; case BlockSequence.GotA: _syndrome ^= 0x3d4; _sequence = BlockSequence.GotB; break; case BlockSequence.GotB: _syndrome ^= (UInt16)((_blocks[1] & 0x800) == 0 ? 0x25c : 0x3cc); _sequence = BlockSequence.GotC; break; case BlockSequence.GotC: _syndrome ^= 0x258; _sequence = BlockSequence.GotD; break; } var blockIndex = (int)_sequence; if (_syndrome != 0) { if (_useFec) { var corrected = ApplyFEC(); if (_syndrome != 0 || corrected > MaxCorrectableBits) { _sequence = BlockSequence.WaitBitSync; } else { _blocks[blockIndex] = (UInt16)(_raw & 0xffff); } } else { _sequence = BlockSequence.WaitBitSync; } } else { _blocks[blockIndex] = (UInt16)((_raw >> CheckwordBitsCount) & 0xffff); } }