void InitBP(int channelNumber) { AntManagerState.Instance.TripTotalKm = 0; var channelCad = usbDevice.getChannel(channelNumber); var bikePowerDisplay = new BikePowerDisplay(channelCad, network); bpCommander = new BPCommander(bikePowerDisplay); bpCommander.Start(); }
void InitBP(int channelNumber) { Int32 deviceNumber = Int32.Parse(ConfigurationManager.AppSettings["bike_power_device"]); if (deviceNumber < 0) { return; } var channelCad = usbDevice.getChannel(channelNumber); var bikePowerDisplay = new BikePowerDisplay(channelCad, network); bpCommander = new BPCommander(bikePowerDisplay, (UInt16)deviceNumber); bpCommander.Start(); }
void InitAC() { List <Updateable> updateables = new List <Updateable>(); updateables.Add(fecCommander); updateables.Add(this); if (bikeModel == BikeModel.BikePhysics) { CultureInfo cul = new CultureInfo("en-US", false); var CdA = float.Parse(ConfigurationManager.AppSettings["cda"], cul.NumberFormat); var Cxx = float.Parse(ConfigurationManager.AppSettings["cxx"], cul.NumberFormat); var bikeweight = float.Parse(ConfigurationManager.AppSettings["bikeweight"], cul.NumberFormat); var riderweight = float.Parse(ConfigurationManager.AppSettings["riderweight"], cul.NumberFormat); var bikePhysics = new BikePhysics(CdA, Cxx, bikeweight + riderweight); updateables.Add(bikePhysics); } var joyControl = new JoyControl(); acInterface = new ACInterface(updateables, joyControl); acInterface.NewLap += OnNewLap; bpCommander.Start(); }