This commit is contained in:
2025-06-29 18:38:39 +02:00
parent 13fa688329
commit 4d5c810786
4 changed files with 8 additions and 6 deletions

View File

@ -14,10 +14,12 @@ type Config struct {
General struct {
DeleteLogFileAtStart bool `yaml:"delete_log_file_at_start"`
LogToFile bool `yaml:"log_to_file"`
Callsign string `yaml:"callsign"`
LogLevel string `yaml:"log_level"`
TelnetServer bool `yaml:"telnetserver"`
FlexRadioSpot bool `yaml:"flexradiospot"`
} `yaml:"general"`
Database struct {
MySQL bool `yaml:"mysql"`
SQLite bool `yaml:"sqlite"`
@ -27,9 +29,9 @@ type Config struct {
MySQLHost string `yaml:"mysql_host"`
MySQLPort string `yaml:"mysql_port"`
} `yaml:"database"`
SQLite struct {
SQLitePath string `yaml:"sqlite_path"`
Callsign string `yaml:"callsign"`
} `yaml:"sqlite"`
Cluster struct {

View File

@ -1,5 +1,6 @@
general:
delete_log_file_at_start: true
callsign: F4BPO # Log4OM Callsign used to check if you get spotted by someone
log_to_file: true
log_level: DEBUG # INFO or DEBUG or WARN
telnetserver: true # not in use for now
@ -14,7 +15,6 @@ database:
mysql_port: 3306
sqlite:
sqlite_path: 'C:\Perso\Seafile\Radio\Logs\Log4OM\F4BPO.SQLite' # SQLite Db oath of Log4OM
callsign: F4BPO # Log4OM Callsign used to check if you get spotted by someone
cluster:
server: cluster.f4bpo.com # dxc.k0xm.net dxc.sm7iun.se
port: 7300

View File

@ -177,7 +177,7 @@ func (fc *FlexClient) SendSpottoFlex(spot TelnetSpot) {
flexSpot.Priority = "1"
flexSpot.BackgroundColor = "#ff000000"
flexSpot.Comment = flexSpot.Comment + " [New DXCC]"
} else if spot.DX == Cfg.SQLite.Callsign {
} else if spot.DX == Cfg.General.Callsign {
flexSpot.Color = "#ffff0000"
flexSpot.Priority = "1"
flexSpot.BackgroundColor = "#ff000000"
@ -286,10 +286,10 @@ func (fc *FlexClient) ReadLine() {
Log.Errorf("could not find spot by flex spot number in database: %s", err)
}
msg := fmt.Sprintf(`To ALL de %s <%s> : Clicked on "%s" at %s`, Cfg.SQLite.Callsign, spot.UTCTime, spot.DX, spot.FrequencyHz)
msg := fmt.Sprintf(`To ALL de %s <%s> : Clicked on "%s" at %s`, Cfg.General.Callsign, spot.UTCTime, spot.DX, spot.FrequencyHz)
if len(fc.TCPServer.Clients) > 0 {
fc.MsgChan <- msg
Log.Infof("%s clicked on spot \"%s\" at %s", Cfg.SQLite.Callsign, spot.DX, spot.FrequencyMhz)
Log.Infof("%s clicked on spot \"%s\" at %s", Cfg.General.Callsign, spot.DX, spot.FrequencyMhz)
}
}

View File

@ -43,7 +43,7 @@ func main() {
log := NewLog()
log.Info("Running FlexDXCluster version 0.6")
log.Infof("Callsign: %s", cfg.SQLite.Callsign)
log.Infof("Callsign: %s", cfg.General.Callsign)
DeleteDatabase("./flex.sqlite", log)