private void SetSiteStatus(TcaAddr tca, ChipAddr chip, TcaChannel channel, SiteStatus status) { SiteModel model = Sites.Find(s => s.TcaAddr == tca && s.ChipAddr == chip && s.Channel == channel); if (model != null) { model.Status = status; } }
public UInt32 ReadReg(UInt16 startReg, UInt32 len, TcaAddr tcaAddr, TcaChannel tcaChannel, ChipAddr chipAddr)//返回读写寄存器的长度 { if (null == client) { return(0); } Msg msg = new ToFRequest(16) { Tt = TofType.R_reg, Num = (Int32)len, Addr = startReg, }; ((ToFRequest)msg).SetTofChipID(tcaAddr, tcaChannel, chipAddr); if (0 < client.SendMsg(msg)) { return(len); } return(0); }
public void SetTofChipID(TcaAddr tcaAddr, TcaChannel tcaChannel, ChipAddr chipAddr) { TofChipID = (byte)tcaAddr | ((byte)tcaChannel) << 8 | ((byte)chipAddr) << 16; }