private byte ControlBoxID(byte[] SensorAddress) { clsSensor Sensor = new clsSensor(mf); Sensor.Load(SensorByteAddress: SensorAddress); return(Sensor.ControlBoxID); }
public void Load() { cSensors.Clear(); DAO.Recordset RS; string SQL = "Select * from tblSensors order by senRecNum"; RS = mf.Dbase.DB.OpenRecordset(SQL); while (!RS.EOF) { clsSensor Sen = new clsSensor(mf); Sen.Load((short)RS.Fields["senID"].Value); cSensors.Add(Sen); RS.MoveNext(); } RS.Close(); }
public clsSensor Add(byte[] Address) { // check if exists short ID = ByteAddressFound(Address); if (ID == -1) { // new address cSensors.Add(new clsSensor(mf)); clsSensor Sen = cSensors[cSensors.Count - 1]; Sen.SetAddressBytes(Address); return(Sen); } else { // existing address clsSensor Sen = new clsSensor(mf); Sen.Load(ID); return(Sen); } }