Exemplo n.º 1
0
                StartTime = time.time()
                #---------------------------------------------------------------
                # Simulate HRM, FE-S, VTX (master device, broadcasting data)
                #---------------------------------------------------------------
                messages = []

                if clv.SimulateTrainer:
                    if True:
                        SpeedKmh, PedalEcho, HeartRate, CurrentPower, Cadence, Resistance, CurrentResistance, Buttons, Axis = \
                            SimulateReceiveFromTrainer (TargetPower, CurrentPower)
                    else:
                        Cadence, CurrentPower, SpeedKmh, HeartRate = 98, 234, 35.6, 123  # Always the same, ennoying but predictable

                    if clv.hrm >= 0:
                        messages.append(
                            hrm.BroadcastHeartrateMessage(
                                devAntDongle, HeartRate))

                    if clv.fe >= 0:
                        messages.append(
                            fe.BroadcastTrainerDataMessage(
                                devAntDongle, Cadence, CurrentPower, SpeedKmh,
                                HeartRate))

                    if clv.vtx >= 0:
                        EventCounter += 1
                        if EventCounter == 64: EventCounter = 0

                        if EventCounter % 64 < 4:  # Transmit 4 times (0, 1, 2, 3) Page 3
                            messages.append ( ant.ComposeMessage (ant.msgID_BroadcastData, \
                                                ant.msgPage03_TacxVortexDataCalibration (ant.channel_VTX, 0, ant.DeviceNumber_VTX)))
                        else:  # Transmit 60 times (4...63)    Page 0
Exemplo n.º 2
0
                #---------------------------------------------------------------
                # Simulate HRM, FE-S, VTX (master device, broadcasting data)
                #---------------------------------------------------------------
                messages = []

                if clv.SimulateTrainer:
                    if False:
                        raise NotImplementedError
                        # SpeedKmh, PedalEcho, HeartRate, CurrentPower, Cadence, Resistance, CurrentResistance, Buttons, Axis = \
                        #     SimulateReceiveFromTrainer (TargetPower, CurrentPower)
                    else:
                        Cadence, CurrentPower, SpeedKmh, HeartRate = 98, 234, 35.6, 123  # Always the same, ennoying but predictable

                    if clv.hrm >= 0:
                        messages.append(
                            hrm.BroadcastHeartrateMessage(HeartRate))

                    if clv.fe >= 0:
                        messages.append(
                            fe.BroadcastTrainerDataMessage(
                                Cadence, CurrentPower, SpeedKmh, HeartRate))

                    if clv.vtx >= 0:
                        EventCounter += 1
                        if EventCounter == 64: EventCounter = 0

                        if EventCounter % 64 < 4:  # Transmit 4 times (0, 1, 2, 3) Page 3
                            messages.append ( ant.ComposeMessage (ant.msgID_BroadcastData, \
                                                ant.msgPage03_TacxVortexDataCalibration (ant.channel_VTX, 0, ant.DeviceNumber_VTX)))
                        else:  # Transmit 60 times (4...63)    Page 0
                            messages.append ( ant.ComposeMessage (ant.msgID_BroadcastData, \
Exemplo n.º 3
0
                StartTime = time.time()
                #---------------------------------------------------------------
                # Simulate HRM, FE-S, VTX (master device, broadcasting data)
                #---------------------------------------------------------------
                messages     = []

                if clv.SimulateTrainer:
                    if False:
                        raise NotImplementedError
                        # SpeedKmh, PedalEcho, HeartRate, CurrentPower, Cadence, Resistance, CurrentResistance, Buttons, Axis = \
                        #     SimulateReceiveFromTrainer (TargetPower, CurrentPower)
                    else:
                        Cadence, CurrentPower, SpeedKmh, HeartRate = 98, 234, 35.6, 123     # Always the same, ennoying but predictable

                    if clv.hrm >= 0:
                        messages.append(hrm.BroadcastHeartrateMessage (HeartRate))

                    if clv.fe >= 0:
                        messages.append(fe.BroadcastTrainerDataMessage(Cadence, CurrentPower, SpeedKmh, HeartRate))

                    if clv.vtx >= 0:
                        EventCounter += 1
                        if EventCounter == 64: EventCounter = 0

                        if EventCounter % 64 < 4:  # Transmit 4 times (0, 1, 2, 3) Page 3
                            messages.append ( ant.ComposeMessage (ant.msgID_BroadcastData, \
                                                ant.msgPage03_TacxVortexDataCalibration (ant.channel_VTX, 0, ant.DeviceNumber_VTX)))
                        else:                       # Transmit 60 times (4...63)    Page 0
                            messages.append ( ant.ComposeMessage (ant.msgID_BroadcastData, \
                                                ant.msgPage00_TacxVortexDataSpeed (ant.channel_VTX, CurrentPower, SpeedKmh, Cadence)))