update
This commit is contained in:
parent
306122d8f3
commit
3542231987
4 changed files with 6 additions and 8 deletions
|
|
@ -12,9 +12,9 @@ void Channel::_bind_methods() {
|
||||||
"set_device_number", "get_device_number");
|
"set_device_number", "get_device_number");
|
||||||
|
|
||||||
godot::ClassDB::bind_method(godot::D_METHOD("set_channel", "_channel"),
|
godot::ClassDB::bind_method(godot::D_METHOD("set_channel", "_channel"),
|
||||||
&Channel::SetDeviceNumber);
|
&Channel::SetChannel);
|
||||||
godot::ClassDB::bind_method(godot::D_METHOD("get_channel"),
|
godot::ClassDB::bind_method(godot::D_METHOD("get_channel"),
|
||||||
&Channel::GetDeviceNumber);
|
&Channel::GetChannel);
|
||||||
ADD_PROPERTY(godot::PropertyInfo(godot::Variant::INT, "channel"),
|
ADD_PROPERTY(godot::PropertyInfo(godot::Variant::INT, "channel"),
|
||||||
"set_channel", "get_channel");
|
"set_channel", "get_channel");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ PowerChannel::PowerChannel() {
|
||||||
channel_config_.frequency = 57;
|
channel_config_.frequency = 57;
|
||||||
channel_config_.transmission_type = 0;
|
channel_config_.transmission_type = 0;
|
||||||
channel_config_.device_type = DeviceTypes::kPower;
|
channel_config_.device_type = DeviceTypes::kPower;
|
||||||
channel_config_.channel_period = 8070;
|
channel_config_.channel_period = 8182;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PowerChannel::OnBroadcastData(godot::Ref<BroadcastPayload> data) {
|
void PowerChannel::OnBroadcastData(godot::Ref<BroadcastPayload> data) {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ extends Node3D
|
||||||
|
|
||||||
@onready var ant_device = $ANTDevice
|
@onready var ant_device = $ANTDevice
|
||||||
@onready var hr_label = $PanelContainer/hr_container/VBoxContainer/value_label
|
@onready var hr_label = $PanelContainer/hr_container/VBoxContainer/value_label
|
||||||
@onready var pwr_label = $PanelContainer/pwr_container/VBoxContainer/value_label
|
@onready var pwr_label = $PanelContainer/pwr_container/VBoxContainer/power_label
|
||||||
|
|
||||||
var timer: Timer
|
var timer: Timer
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,9 @@ script = ExtResource("1_a202f")
|
||||||
[node name="ANTDevice" type="ANTDevice" parent="."]
|
[node name="ANTDevice" type="ANTDevice" parent="."]
|
||||||
script = ExtResource("2_noarx")
|
script = ExtResource("2_noarx")
|
||||||
|
|
||||||
[node name="HeartRateChannel" type="HeartRateChannel" parent="ANTDevice"]
|
|
||||||
channel = 2
|
|
||||||
|
|
||||||
[node name="PowerChannel" type="PowerChannel" parent="ANTDevice"]
|
[node name="PowerChannel" type="PowerChannel" parent="ANTDevice"]
|
||||||
|
device_number = 23248
|
||||||
|
channel = 1
|
||||||
|
|
||||||
[node name="PanelContainer" type="BoxContainer" parent="."]
|
[node name="PanelContainer" type="BoxContainer" parent="."]
|
||||||
offset_right = 40.0
|
offset_right = 40.0
|
||||||
|
|
@ -86,7 +85,6 @@ horizontal_alignment = 1
|
||||||
[connection signal="broadcast_data_received" from="ANTDevice" to="ANTDevice" method="_on_broadcast_data_received"]
|
[connection signal="broadcast_data_received" from="ANTDevice" to="ANTDevice" method="_on_broadcast_data_received"]
|
||||||
[connection signal="channel_response_received" from="ANTDevice" to="ANTDevice" method="_on_channel_response_received"]
|
[connection signal="channel_response_received" from="ANTDevice" to="ANTDevice" method="_on_channel_response_received"]
|
||||||
[connection signal="device_number_received" from="ANTDevice" to="ANTDevice" method="_on_device_number_received"]
|
[connection signal="device_number_received" from="ANTDevice" to="ANTDevice" method="_on_device_number_received"]
|
||||||
[connection signal="heart_rate_updated" from="ANTDevice/HeartRateChannel" to="ANTDevice" method="_on_heart_rate_channel_heart_rate_updated"]
|
|
||||||
[connection signal="battery_status_received" from="ANTDevice/PowerChannel" to="ANTDevice" method="_on_power_channel_battery_status_received"]
|
[connection signal="battery_status_received" from="ANTDevice/PowerChannel" to="ANTDevice" method="_on_power_channel_battery_status_received"]
|
||||||
[connection signal="crank_torque_received" from="ANTDevice/PowerChannel" to="ANTDevice" method="_on_power_channel_crank_torque_received"]
|
[connection signal="crank_torque_received" from="ANTDevice/PowerChannel" to="ANTDevice" method="_on_power_channel_crank_torque_received"]
|
||||||
[connection signal="power_received" from="ANTDevice/PowerChannel" to="ANTDevice" method="_on_power_channel_power_received"]
|
[connection signal="power_received" from="ANTDevice/PowerChannel" to="ANTDevice" method="_on_power_channel_power_received"]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue