From 861a5ff14b098eb14b5824e98a34470d100a2739 Mon Sep 17 00:00:00 2001 From: Greg Date: Thu, 31 Oct 2024 15:57:53 +0700 Subject: [PATCH] update --- HTTPServer.go | 6 ------ config.yml | 22 +++++++++++----------- flexradio.go | 4 ++-- spot.go | 17 +++++++++-------- 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/HTTPServer.go b/HTTPServer.go index 1da5147..1db6f3d 100644 --- a/HTTPServer.go +++ b/HTTPServer.go @@ -8,12 +8,6 @@ import ( "github.com/gorilla/mux" ) -//go:embed templates/* -// var tplFolder embed.FS - -//go:embed images/* -// var imgFolder embed.FS - var tmpl *template.Template var listNew = []New{} diff --git a/config.yml b/config.yml index 5eb6f69..f880bc1 100644 --- a/config.yml +++ b/config.yml @@ -1,13 +1,13 @@ general: delete_log_file_at_start: true log_to_file: true - log_level: INFO - httpserver: true - telnetserver: true - flexradiospot: true + log_level: INFO # INFO or DEBUG or WARN + httpserver: true # not in use for now + telnetserver: true # not in use for now + flexradiospot: true # not in use for now sqlite: - sqlite_path: 'C:\Perso\Seafile\Radio\Logs\Log4OM\Vietnam.SQLite' - callsign: XV9Q + sqlite_path: 'C:\Perso\Seafile\Radio\Logs\Log4OM\Vietnam.SQLite' # SQLite Db oath of Log4OM + callsign: XV9Q # Log4OM Callsign used to check if you get spotted by someone cluster: server: dxc.k0xm.net port: 7300 @@ -18,12 +18,12 @@ cluster: command: #SET/NOFILTER login_prompt: "Please enter your call:" flex: - discovery: true - ip: 10.10.10.120 #113.161.103.129 - spot_life: 600 -telnetserver: + discovery: true # Radio must be on same LAN than the program + ip: 10.10.10.120 # if discovery is true no need to put an IP + spot_life: 600 # seconds +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 port: 7301 -httpserver: +httpserver: # this is the basic web gui host: 0.0.0.0 port: 3000 \ No newline at end of file diff --git a/flexradio.go b/flexradio.go index e80776b..50f6d9d 100644 --- a/flexradio.go +++ b/flexradio.go @@ -244,7 +244,7 @@ func (fc *FlexClient) ReadLine() { for { message, err := fc.Reader.ReadString(byte('\n')) 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) } @@ -257,7 +257,7 @@ func (fc *FlexClient) ReadLine() { spot, _ := fc.Repo.FindSpotByCommandNumber(respSpot[1]) _, err := fc.Repo.UpdateFlexSpotNumberByID(respSpot[2], *spot) 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) } } diff --git a/spot.go b/spot.go index 1de001c..45c4361 100644 --- a/spot.go +++ b/spot.go @@ -40,6 +40,11 @@ func ProcessTelnetSpot(re *regexp.Regexp, spotRaw string, SpotChanToFlex chan Te } spot.DXCC = GetDXCC(spot.DX, Countries) + + if spot.DXCC == "" { + Log.Infof("Could not identify the DXCC for %s", spot.DX) + } + spot.GetBand() spot.GuessMode() spot.CallsignWorked = false @@ -86,15 +91,11 @@ func ProcessTelnetSpot(re *regexp.Regexp, spotRaw string, SpotChanToFlex chan Te spot.CallsignWorked = true } - // send spot to SpotChan to Flex Client to send the spot to Flex radio - if Cfg.General.FlexRadioSpot { - SpotChanToFlex <- spot - } + // Send spots to FlexRadio + SpotChanToFlex <- spot - // send FlexSpot to HTTP Server - if Cfg.General.HTTPServer { - SpotChanToHTTPServer <- spot - } + // Send FlexSpot to HTTP Server + SpotChanToHTTPServer <- spot 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",