Skip to content

Commit

Permalink
add lowband frequencies
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelscholle committed Jul 22, 2024
1 parent 4259a05 commit c1f7618
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
12 changes: 9 additions & 3 deletions app/telemetry/settings/frequencyhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ QList<int> FrequencyHelper::get_frequencies(int filter)
{
QList<int> ret;
if(filter==0){
auto tmp=openhd::get_openhd_channels_1_to_5();
auto tmp=openhd::get_openhd_channels_1_to_7();
for(auto& channel:tmp){
ret.push_back(channel.frequency);
}
Expand Down Expand Up @@ -83,11 +83,11 @@ bool FrequencyHelper::get_frequency_radar(int frequency_mhz)

int FrequencyHelper::get_frequency_openhd_race_band(int frequency_mhz)
{
// 5700,5745,5785,5825,5865
// 5700,5745,5785,5825,5865,5260,5280
if(frequency_mhz==5700){
return 1;
}
if(frequency_mhz==5745){
if(frequency_mhz== ){
return 2;
}
if(frequency_mhz==5785){
Expand All @@ -99,6 +99,12 @@ int FrequencyHelper::get_frequency_openhd_race_band(int frequency_mhz)
if(frequency_mhz==5865){
return 5;
}
if(frequency_mhz==5260){
return 6;
}
if(frequency_mhz==5280){
return 7;
}
return -1;
}

Expand Down
4 changes: 2 additions & 2 deletions app/telemetry/settings/wifi_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ static std::vector<WifiChannel> frequencies_to_channels(
return ret;
}

static std::vector<WifiChannel> get_openhd_channels_1_to_5() {
std::vector<uint32_t> frequencies = {5700, 5745, 5785, 5825, 5865};
static std::vector<WifiChannel> get_openhd_channels_1_to_7() {
std::vector<uint32_t> frequencies = {5700, 5745, 5785, 5825, 5865, 5260, 5280};
return frequencies_to_channels(frequencies);
}

Expand Down
6 changes: 5 additions & 1 deletion qml/ui/sidebar/EditFrequencyElement.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ import OpenHD 1.0
BaseJoyEditElement{
m_title: "Frequency"

// 5700,5745,5785,5825,5865
// 5700,5745,5785,5825,5865,5280,5260
ListModel{
id: frequencies_model
ListElement {frequency: 5700; verbose:"5700Mhz\nOHD 1"}
ListElement {frequency: 5745; verbose:"5745Mhz\nOHD 2"}
ListElement {frequency: 5785; verbose:"5785Mhz\nOHD 3"}
ListElement {frequency: 5825; verbose:"5825Mhz\nOHD 4"}
ListElement {frequency: 5865; verbose:"5865Mhz\nOHD 5"}
ListElement {frequency: 5280; verbose:"5280Mhz\nOHD 6"}
ListElement {frequency: 5260; verbose:"5260Mhz\nOHD 7"}
}
ListModel{
id: frequencies_model_with_5180mhz_lowband
Expand All @@ -31,6 +33,8 @@ BaseJoyEditElement{
ListElement {frequency: 5785; verbose:"5785Mhz\nOHD 3"}
ListElement {frequency: 5825; verbose:"5825Mhz\nOHD 4"}
ListElement {frequency: 5865; verbose:"5865Mhz\nOHD 5"}
ListElement {frequency: 5260; verbose:"5260Mhz\nOHD 6"}
ListElement {frequency: 5280; verbose:"5280Mhz\nOHD 7"}
}
function get_model(){
if(settings.dev_show_5180mhz_lowband){
Expand Down
6 changes: 5 additions & 1 deletion qml/ui/sidebar/MappedMavlinkChoices.qml
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,16 @@ Item {
}

// Built dynamically depending on the settings
// 5700,5745,5785,5825,5865
// 5700,5745,5785,5825,5865,5260,5280
ListModel{
id: frequencies_model
ListElement {value: 5700; verbose:"5700Mhz\nOHD 1"}
ListElement {value: 5745; verbose:"5745Mhz\nOHD 2"}
ListElement {value: 5785; verbose:"5785Mhz\nOHD 3"}
ListElement {value: 5825; verbose:"5825Mhz\nOHD 4"}
ListElement {value: 5865; verbose:"5865Mhz\nOHD 5"}
ListElement {value: 5260; verbose:"5260Mhz\nOHD 6"}
ListElement {value: 5280; verbose:"5280Mhz\nOHD 7"}
}
ListModel{
id: frequencies_model_with_5180mhz_lowband
Expand All @@ -154,6 +156,8 @@ Item {
ListElement {value: 5785; verbose:"5785Mhz\nOHD 3"}
ListElement {value: 5825; verbose:"5825Mhz\nOHD 4"}
ListElement {value: 5865; verbose:"5865Mhz\nOHD 5"}
ListElement {value: 5260; verbose:"5260Mhz\nOHD 6"}
ListElement {value: 5280; verbose:"5280Mhz\nOHD 7"}
}
ListModel{
id: elements_model_channel_width
Expand Down

0 comments on commit c1f7618

Please sign in to comment.