correct band guess
This commit is contained in:
parent
50c86e82d7
commit
eaa0c62892
@ -1,7 +1,7 @@
|
|||||||
general:
|
general:
|
||||||
delete_log_file_at_start: true
|
delete_log_file_at_start: true
|
||||||
log_to_file: true
|
log_to_file: true
|
||||||
log_level: INFO # INFO or DEBUG or WARN
|
log_level: DEBUG # INFO or DEBUG or WARN
|
||||||
telnetserver: true # not in use for now
|
telnetserver: true # not in use for now
|
||||||
flexradiospot: true # not in use for now
|
flexradiospot: true # not in use for now
|
||||||
sqlite:
|
sqlite:
|
||||||
|
25
spot.go
25
spot.go
@ -131,60 +131,61 @@ func ProcessTelnetSpot(re *regexp.Regexp, spotRaw string, SpotChanToFlex chan Te
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (spot *TelnetSpot) GetBand() {
|
func (spot *TelnetSpot) GetBand() {
|
||||||
|
freq := FreqMhztoHz(spot.Frequency)
|
||||||
switch true {
|
switch true {
|
||||||
case strings.HasPrefix(spot.Frequency, "1.8"):
|
case strings.HasPrefix(freq, "1.8"):
|
||||||
spot.Band = "160M"
|
spot.Band = "160M"
|
||||||
if spot.Mode == "SSB" {
|
if spot.Mode == "SSB" {
|
||||||
spot.Mode = "LSB"
|
spot.Mode = "LSB"
|
||||||
}
|
}
|
||||||
case strings.HasPrefix(spot.Frequency, "3"):
|
case strings.HasPrefix(freq, "3."):
|
||||||
spot.Band = "80M"
|
spot.Band = "80M"
|
||||||
if spot.Mode == "SSB" {
|
if spot.Mode == "SSB" {
|
||||||
spot.Mode = "LSB"
|
spot.Mode = "LSB"
|
||||||
}
|
}
|
||||||
case strings.HasPrefix(spot.Frequency, "5."):
|
case strings.HasPrefix(freq, "5."):
|
||||||
spot.Band = "60M"
|
spot.Band = "60M"
|
||||||
if spot.Mode == "SSB" {
|
if spot.Mode == "SSB" {
|
||||||
spot.Mode = "LSB"
|
spot.Mode = "LSB"
|
||||||
}
|
}
|
||||||
case strings.HasPrefix(spot.Frequency, "7"):
|
case strings.HasPrefix(freq, "7."):
|
||||||
spot.Band = "40M"
|
spot.Band = "40M"
|
||||||
if spot.Mode == "SSB" {
|
if spot.Mode == "SSB" {
|
||||||
spot.Mode = "LSB"
|
spot.Mode = "LSB"
|
||||||
}
|
}
|
||||||
case strings.HasPrefix(spot.Frequency, "10"):
|
case strings.HasPrefix(freq, "10."):
|
||||||
spot.Band = "30M"
|
spot.Band = "30M"
|
||||||
case strings.HasPrefix(spot.Frequency, "14"):
|
case strings.HasPrefix(freq, "14."):
|
||||||
spot.Band = "20M"
|
spot.Band = "20M"
|
||||||
if spot.Mode == "SSB" {
|
if spot.Mode == "SSB" {
|
||||||
spot.Mode = "USB"
|
spot.Mode = "USB"
|
||||||
}
|
}
|
||||||
case strings.HasPrefix(spot.Frequency, "18"):
|
case strings.HasPrefix(freq, "18."):
|
||||||
spot.Band = "17M"
|
spot.Band = "17M"
|
||||||
if spot.Mode == "SSB" {
|
if spot.Mode == "SSB" {
|
||||||
spot.Mode = "USB"
|
spot.Mode = "USB"
|
||||||
}
|
}
|
||||||
case strings.HasPrefix(spot.Frequency, "21"):
|
case strings.HasPrefix(freq, "21."):
|
||||||
spot.Band = "15M"
|
spot.Band = "15M"
|
||||||
if spot.Mode == "SSB" {
|
if spot.Mode == "SSB" {
|
||||||
spot.Mode = "USB"
|
spot.Mode = "USB"
|
||||||
}
|
}
|
||||||
case strings.HasPrefix(spot.Frequency, "24"):
|
case strings.HasPrefix(freq, "24."):
|
||||||
spot.Band = "12M"
|
spot.Band = "12M"
|
||||||
if spot.Mode == "SSB" {
|
if spot.Mode == "SSB" {
|
||||||
spot.Mode = "USB"
|
spot.Mode = "USB"
|
||||||
}
|
}
|
||||||
case strings.HasPrefix(spot.Frequency, "28"):
|
case strings.HasPrefix(freq, "28."):
|
||||||
spot.Band = "10M"
|
spot.Band = "10M"
|
||||||
if spot.Mode == "SSB" {
|
if spot.Mode == "SSB" {
|
||||||
spot.Mode = "USB"
|
spot.Mode = "USB"
|
||||||
}
|
}
|
||||||
case strings.HasPrefix(spot.Frequency, "29"):
|
case strings.HasPrefix(freq, "29."):
|
||||||
spot.Band = "10M"
|
spot.Band = "10M"
|
||||||
if spot.Mode == "SSB" {
|
if spot.Mode == "SSB" {
|
||||||
spot.Mode = "USB"
|
spot.Mode = "USB"
|
||||||
}
|
}
|
||||||
case strings.HasPrefix(spot.Frequency, "50"):
|
case strings.HasPrefix(freq, "50."):
|
||||||
spot.Band = "6M"
|
spot.Band = "6M"
|
||||||
if spot.Mode == "SSB" {
|
if spot.Mode == "SSB" {
|
||||||
spot.Mode = "USB"
|
spot.Mode = "USB"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user