public ANTManger() { if (antStick == null) { ANT_Common.enableDebugLogs(); findUsableAntDevice(); } /*if (ANT.FrameworkConfig.getInstance().remoteControlDevNum_negativeIsOff > 0) * { * numChannelsForDevices = antStick.getNumChannels() - 1; * RacerRemoteControl.startRemoteControl(antStick.getChannel(numChannelsForDevices)); * } * else * { * numChannelsForDevices = antStick.getNumChannels(); * }*/ numChannelsForDevices = antStick.getNumChannels(); ds_AntPlus_BikeSpd spdOnly = new ds_AntPlus_BikeSpd(); deviceList.Add(new AntPlus_Connection(spdOnly)); deviceList.Add(new AntPlus_Connection(new ds_AntPlus_BikeCad_UsingSpd(spdOnly))); deviceList.Add(new AntPlus_Connection(new ds_AntPlus_BikeSpdCad())); deviceList.Add(new AntPlus_Connection(new ds_AntPlus_BikeSpd())); //Add all devices from config /*foreach (ANT.FrameworkConfig.RacerInput i in ANT.FrameworkConfig.getInstance().enabledRacerInputs) * { * switch (i.type) * { * case ANT.FrameworkConfig.RacerInputType.ant_BikeCad_UsingSpd: * ds_AntPlus_BikeSpd spdOnly = new ds_AntPlus_BikeSpd(); * deviceList.Add(new AntPlus_Connection(spdOnly)); * deviceList.Add(new AntPlus_Connection(new ds_AntPlus_BikeCad_UsingSpd(spdOnly))); * break; * case ANT.FrameworkConfig.RacerInputType.ant_BikeCadAndSpd: * deviceList.Add(new AntPlus_Connection(new ds_AntPlus_BikeSpdCad())); * break; * case ANT.FrameworkConfig.RacerInputType.ant_BikeSpd: * deviceList.Add(new AntPlus_Connection(new ds_AntPlus_BikeSpd())); * break; * case ANT.FrameworkConfig.RacerInputType.ant_FitEqpmt: * deviceList.Add(new AntPlus_Connection(new ds_AntPlus_Fit())); * break; * case ANT.FrameworkConfig.RacerInputType.ant_StrideSDM: * deviceList.Add(new AntPlus_Connection(new ds_AntPlus_StrideSDM())); * break; * default: //Not one of the ant types, ignore * break; * } * * if (i.defaultDeviceId != 0) * deviceList.Last().dataSource.searchProfile.deviceNumber = i.defaultDeviceId; * * if (!String.IsNullOrWhiteSpace(i.displayName)) * deviceList.Last().dataSource.customSourceName = i.displayName; * }*/ startNextSearch(); }
public AntPlusDevMgr() { if (antStick == null) { ANT_Common.enableDebugLogs(); findUsableAntDevice(); } if (AntPlusRacerConfig.getInstance().remoteControlDevNum_negativeIsOff > 0) { numChannelsForDevices = antStick.getNumChannels() - 1; RacerRemoteControl.startRemoteControl(antStick.getChannel(numChannelsForDevices)); } else { numChannelsForDevices = antStick.getNumChannels(); } //Add all devices from config foreach (AntPlusRacerConfig.RacerInput i in AntPlusRacerConfig.getInstance().enabledRacerInputs) { switch (i.type) { case AntPlusRacerConfig.RacerInputType.ant_BikeCad_UsingSpd: ds_AntPlus_BikeSpd spdOnly = new ds_AntPlus_BikeSpd(); deviceList.Add(new AntPlus_Connection(spdOnly)); deviceList.Add(new AntPlus_Connection(new ds_AntPlus_BikeCad_UsingSpd(spdOnly))); break; case AntPlusRacerConfig.RacerInputType.ant_BikeCadAndSpd: deviceList.Add(new AntPlus_Connection(new ds_AntPlus_BikeSpdCad())); break; case AntPlusRacerConfig.RacerInputType.ant_BikeSpd: deviceList.Add(new AntPlus_Connection(new ds_AntPlus_BikeSpd())); break; case AntPlusRacerConfig.RacerInputType.ant_FitEqpmt: deviceList.Add(new AntPlus_Connection(new ds_AntPlus_Fit())); break; case AntPlusRacerConfig.RacerInputType.ant_StrideSDM: deviceList.Add(new AntPlus_Connection(new ds_AntPlus_StrideSDM())); break; default: //Not one of the ant types, ignore break; } if (i.defaultDeviceId != 0) { deviceList.Last().dataSource.searchProfile.deviceNumber = i.defaultDeviceId; } if (!String.IsNullOrWhiteSpace(i.displayName)) { deviceList.Last().dataSource.customSourceName = i.displayName; } } startNextSearch(); }