This commit is contained in:
Gregory Salaun 2024-10-31 15:57:53 +07:00
parent c86f531313
commit 861a5ff14b
4 changed files with 22 additions and 27 deletions

View File

@ -8,12 +8,6 @@ import (
"github.com/gorilla/mux" "github.com/gorilla/mux"
) )
//go:embed templates/*
// var tplFolder embed.FS
//go:embed images/*
// var imgFolder embed.FS
var tmpl *template.Template var tmpl *template.Template
var listNew = []New{} var listNew = []New{}

View File

@ -1,13 +1,13 @@
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 log_level: INFO # INFO or DEBUG or WARN
httpserver: true httpserver: true # not in use for now
telnetserver: true telnetserver: true # not in use for now
flexradiospot: true flexradiospot: true # not in use for now
sqlite: sqlite:
sqlite_path: 'C:\Perso\Seafile\Radio\Logs\Log4OM\Vietnam.SQLite' sqlite_path: 'C:\Perso\Seafile\Radio\Logs\Log4OM\Vietnam.SQLite' # SQLite Db oath of Log4OM
callsign: XV9Q callsign: XV9Q # Log4OM Callsign used to check if you get spotted by someone
cluster: cluster:
server: dxc.k0xm.net server: dxc.k0xm.net
port: 7300 port: 7300
@ -18,12 +18,12 @@ cluster:
command: #SET/NOFILTER command: #SET/NOFILTER
login_prompt: "Please enter your call:" login_prompt: "Please enter your call:"
flex: flex:
discovery: true discovery: true # Radio must be on same LAN than the program
ip: 10.10.10.120 #113.161.103.129 ip: 10.10.10.120 # if discovery is true no need to put an IP
spot_life: 600 spot_life: 600 # seconds
telnetserver: telnetserver: # Log4OM must be connected to this server ie: localhost:7301 if on same machine as this program else ip:7301
host: 0.0.0.0 host: 0.0.0.0
port: 7301 port: 7301
httpserver: httpserver: # this is the basic web gui
host: 0.0.0.0 host: 0.0.0.0
port: 3000 port: 3000

View File

@ -244,7 +244,7 @@ func (fc *FlexClient) ReadLine() {
for { for {
message, err := fc.Reader.ReadString(byte('\n')) message, err := fc.Reader.ReadString(byte('\n'))
if err != nil { if err != nil {
Log.Errorf("Error reading message from flexradio closing program: %s", err) Log.Errorf("Error reading message from FlexRadio, closing program: %s", err)
os.Exit(1) os.Exit(1)
} }
@ -257,7 +257,7 @@ func (fc *FlexClient) ReadLine() {
spot, _ := fc.Repo.FindSpotByCommandNumber(respSpot[1]) spot, _ := fc.Repo.FindSpotByCommandNumber(respSpot[1])
_, err := fc.Repo.UpdateFlexSpotNumberByID(respSpot[2], *spot) _, err := fc.Repo.UpdateFlexSpotNumberByID(respSpot[2], *spot)
if err != nil { if err != nil {
Log.Errorf("Could not update flex spot number in database: %s", err) Log.Errorf("Could not update Flex spot number in database: %s", err)
} }
} }

17
spot.go
View File

@ -40,6 +40,11 @@ func ProcessTelnetSpot(re *regexp.Regexp, spotRaw string, SpotChanToFlex chan Te
} }
spot.DXCC = GetDXCC(spot.DX, Countries) spot.DXCC = GetDXCC(spot.DX, Countries)
if spot.DXCC == "" {
Log.Infof("Could not identify the DXCC for %s", spot.DX)
}
spot.GetBand() spot.GetBand()
spot.GuessMode() spot.GuessMode()
spot.CallsignWorked = false spot.CallsignWorked = false
@ -86,15 +91,11 @@ func ProcessTelnetSpot(re *regexp.Regexp, spotRaw string, SpotChanToFlex chan Te
spot.CallsignWorked = true spot.CallsignWorked = true
} }
// send spot to SpotChan to Flex Client to send the spot to Flex radio // Send spots to FlexRadio
if Cfg.General.FlexRadioSpot { SpotChanToFlex <- spot
SpotChanToFlex <- spot
}
// send FlexSpot to HTTP Server // Send FlexSpot to HTTP Server
if Cfg.General.HTTPServer { SpotChanToHTTPServer <- spot
SpotChanToHTTPServer <- spot
}
if spot.NewDXCC { if spot.NewDXCC {
Log.Debugf("(** New DXCC **) DX: %s - Spotter: %s - Freq: %s - Band: %s - Mode: %s - Comment: %s - Time: %s - Command: %v, FlexSpot: %v", Log.Debugf("(** New DXCC **) DX: %s - Spotter: %s - Freq: %s - Band: %s - Mode: %s - Comment: %s - Time: %s - Command: %v, FlexSpot: %v",