new slot
This commit is contained in:
16
spot.go
16
spot.go
@ -23,6 +23,7 @@ type TelnetSpot struct {
|
||||
NewDXCC bool
|
||||
NewBand bool
|
||||
NewMode bool
|
||||
NewSlot bool
|
||||
CallsignWorked bool
|
||||
}
|
||||
|
||||
@ -52,12 +53,14 @@ func ProcessTelnetSpot(re *regexp.Regexp, spotRaw string, SpotChanToFlex chan Te
|
||||
spot.NewBand = false
|
||||
spot.NewMode = false
|
||||
spot.NewDXCC = false
|
||||
spot.NewSlot = false
|
||||
|
||||
contactRepo := NewLog4OMContactsRepository(Cfg.SQLite.SQLitePath)
|
||||
defer contactRepo.db.Close()
|
||||
|
||||
contactsChan := make(chan []Contact)
|
||||
contactsModeChan := make(chan []Contact)
|
||||
contactsModeBandChan := make(chan []Contact)
|
||||
contactsBandChan := make(chan []Contact)
|
||||
contactsCallChan := make(chan []Contact)
|
||||
|
||||
@ -76,6 +79,9 @@ func ProcessTelnetSpot(re *regexp.Regexp, spotRaw string, SpotChanToFlex chan Te
|
||||
go contactRepo.ListByCallSign(spot.DX, spot.Band, spot.Mode, contactsCallChan, wg)
|
||||
contactsCall := <-contactsCallChan
|
||||
|
||||
go contactRepo.ListByCountryModeBand(spot.DX, spot.Band, spot.Mode, contactsModeBandChan, wg)
|
||||
contactsModeBand := <-contactsCallChan
|
||||
|
||||
wg.Wait()
|
||||
|
||||
if len(contacts) == 0 {
|
||||
@ -88,6 +94,11 @@ func ProcessTelnetSpot(re *regexp.Regexp, spotRaw string, SpotChanToFlex chan Te
|
||||
if len(contactsBand) == 0 {
|
||||
spot.NewBand = true
|
||||
}
|
||||
|
||||
if len(contactsModeBand) == 0 {
|
||||
spot.NewSlot = true
|
||||
}
|
||||
|
||||
if len(contactsCall) > 0 {
|
||||
spot.CallsignWorked = true
|
||||
}
|
||||
@ -115,6 +126,11 @@ func ProcessTelnetSpot(re *regexp.Regexp, spotRaw string, SpotChanToFlex chan Te
|
||||
spot.DX, spot.Spotter, spot.Frequency, spot.Band, spot.Mode, spot.Comment, spot.Time, spot.DXCC)
|
||||
}
|
||||
|
||||
if !spot.NewDXCC && spot.NewSlot && spot.Mode != "" {
|
||||
Log.Debugf("(** New Slot **) DX: %s - Spotter: %s - Freq: %s - Band: %s - Mode: %s - Comment: %s - Time: %s - DXCC: %s",
|
||||
spot.DX, spot.Spotter, spot.Frequency, spot.Band, spot.Mode, spot.Comment, spot.Time, spot.DXCC)
|
||||
}
|
||||
|
||||
if !spot.NewDXCC && !spot.NewBand && !spot.NewMode && spot.CallsignWorked {
|
||||
Log.Debugf("(** Worked **) DX: %s - Spotter: %s - Freq: %s - Band: %s - Mode: %s - Comment: %s - Time: %s - DXCC: %s",
|
||||
spot.DX, spot.Spotter, spot.Frequency, spot.Band, spot.Mode, spot.Comment, spot.Time, spot.DXCC)
|
||||
|
Reference in New Issue
Block a user