protected OneWireBase(OneWireGate gate, byte[] rom, string declarer) { this.gate=gate; this._decl=declarer; this.rom=rom; if(gate!=null) { gate.AddDevice(this); } }
public DS18B20(OneWireGate gate, byte[] rom) : base(gate, rom, "DS18B20") { }
public void SetOwner(Topic owner) { if(!object.ReferenceEquals(owner, _owner)) { if(_owner!=null) { _owner.Unsubscribe("#", ChildChaged); } _owner=owner; if(_owner!=null) { _tPresent=_owner.Get<bool>("_present"); _tPresent.saved=false; _owner.Get<string>("_declarer", _owner).value=_decl; PSetOwner(); _owner.Subscribe("#", ChildChaged); } else if(_gate!=null) { _gate.DelDevice(this); var dev=Topic.root.Get("/dev/1Wire").children.Select(z => z.GetValue() as OneWireBase).FirstOrDefault(z => z!=null && z!=this && this.rom.SequenceEqual(z.rom)); if(dev!=null) { dev.gate=_gate; } _gate=null; } } }
public DS2406(OneWireGate gate, byte[] rom) : base(gate, rom, "DS2406") { }