Пример #1
0
        public void SetDiFiFmax(Di?di, FiFmax?fiFmax)
        {
            DbC.Assure((di.HasValue && fiFmax.HasValue) ||
                       (di.HasValue == false && fiFmax.HasValue == false), "di and fi/fmax must be either both defined or undefined");

            if (di.HasValue && fiFmax.HasValue)
            {
                this.SetInterfaceByte(0, InterfaceByteType.Ta, CodingUtils.NibbleToByte((byte)fiFmax, (byte)di));
            }
            else
            {
                this.SetInterfaceByte(0, InterfaceByteType.Ta, null);
            }
            this.InvokePropertyChanged(nameof(GlobalInterfaceBytes.Di));
            this.InvokePropertyChanged(nameof(GlobalInterfaceBytes.DiValue));
            this.InvokePropertyChanged(nameof(GlobalInterfaceBytes.FiFmax));
            this.InvokePropertyChanged(nameof(GlobalInterfaceBytes.FiFmaxValue));
        }
Пример #2
0
        public void RemoveIndication()
        {
            DbC.Assure(this.IsOnlyIndicatedProtocol == false, "Last and only protocol inidication cannot be removed");

            foreach (AtrInterfaceByteGroupToken Group in this.Owner.TokenizedAtr.InterfaceByteGroups.ToArray())
            {
                if (Group.Type == (InterfaceByteGroupType)this.ProtocolType)
                {
                    if (Group.Number == 2)
                    {
                        //Special handling for group#2: instead of removal, type indication ahs to be changed to next protocol
                        this.Owner.TokenizedAtr.InterfaceByteGroups.ElementAt(0).NextInterfaceBytesIndicator.GroupType = this.Owner.TokenizedAtr.InterfaceByteGroups.Skip(2).First(_ => _.Type != (InterfaceByteGroupType)this.ProtocolType).Type;
                    }
                    else
                    {
                        this.Owner.TokenizedAtr.InterfaceByteGroups.Remove(Group);
                    }
                }
            }
            this.RemoveUnusedGroups();
        }
Пример #3
0
 public bool ReleaseReference(ComponentContainer componentContainer)
 {
     DbC.Assure(this.references.Contains(componentContainer));
     this.references.Remove(componentContainer);
     return(this.references.Count == 0);
 }
 public byte GetAsByte(byte lowerNibble)
 {
     DbC.Assure((lowerNibble & 0xF0) == 0x00);
     return((byte)(lowerNibble | (this.TaExists ? 0x10 : 0x00) | (this.TbExists ? 0x20 : 0x00) | (this.TcExists ? 0x40 : 0x00) | (this.TdExists ? 0x80 : 0x00)));
 }
 public ReadRecord(byte shortFileId, byte lengthToRead)
 {
     DbC.Assure((shortFileId & 0xE0) == 0x00, "Short file ID for read record can only have values from 0 to 31");
     this.ShortFileId  = shortFileId;
     this.LengthToRead = lengthToRead;
 }
 public ReadBinary(byte shortFileId, byte lengthToRead)
 {
     DbC.Assure((shortFileId & 0xF0) == 0x00, "Short file ID for read binary can only have values from 0 to 15");
     this.ShortFileId  = shortFileId;
     this.LengthToRead = lengthToRead;
 }