public void SetDeviceFilter(EDeviceModel deviceModel) { deviceFilter = deviceModel; deviceAdapter.SetConnections(service.GetConnectionsOfModel(deviceModel)); if (rig != null && deviceModel.AsRigType() != rig.rigType) { rig.Disconnect(); rig = null; } }
public override void OnRigFound(IRig newRig) { base.OnRigFound(newRig); if (rig == null) { if (newRig.rigType == deviceFilter.AsRigType()) { rig = newRig; } // Else the rig doen't match and we should ignore it } else { // Check if the old rig doesn't match the device filter. if (rig.rigType != deviceFilter.AsRigType()) { rig = null; if (newRig.rigType == deviceFilter.AsRigType()) { rig = newRig; } } // Else we already have a rig of the proper type. } }