G'Day All,
Dennis: Thanks for your tips on values in the spot filters.
Bill W7OO: Are you ready! This is what you need until Dennis comes up with a better idea.
I have been mucking about today to see if I can write a "private function" to use for alerts and the spot log - to surpress repeated alerts - and try to discover what else might be possible.
I am assuming the spot log will be small, and my PC is fast, and will multi-task with Logic. I need to do more work with UTC time. My goals were to gain experience with a real problem, and have fun.
Who is willing to give it a go - do some testing to see that it works for them? Reply to this topic or email me.
The code returns FALSE if a specific spot has been seen in the last "spot_delay" seconds and is called in an alert filter by, for example ...
.T. AND check_alert( CALL, BAND, MODE, 600, 3000 ) AND <filter expression>
... the leading .T. allows one to "turn the alert off completely", check_alert surpresses repeated alerts by returning .F., and <filter> is the actual alert. The result puts 600 seconds between alerts and flashes a message box for 3 seconds when a spot is surpressed. The message box will go when it is proven to work correctly.
I started with this simple code ...
LPARAMETERS spot_call, spot_band, spot_mode, spot_delay, box_delay
MESSAGEBOX(spot_call,36,"Alert",1)
RETURN .T.
... which I compiled in Advanced, Database commands and it worked as expected. Then I added the scan through the spots for the call, to return FALSE if a spot log record is found in the last "spot_delay" seconds. Much reading of manuals and the Internet was included.
I added an index to the spot log for "CALL+DTOC(TIMESTAMP)" to facilitate the scan of the spots.
The following code works for me, surpressing alerts for calls for "spot_delay" seconds. UTC time needs to correctly implemented.
LPARAMETERS spot_call, spot_band, spot_mode, spot_delay, box_delay
* Spot time stamps are UTC
* UTC midnight is 36000 seconds after local midnight
* need to get utc time from the system and stop using the SECONDS() function.
utc = 36000
spot_alias = alias()
if not used("my_spots") then
use spots again shared noupdate order call_time alias my_spots in 0
endif
select my_spots
status = .T.
scan for ;
my_spots.call = spot_call and ;
my_spots.band = spot_band and ;
my_spots.mode = spot_mode and ;
between((seconds() - utc - ((hour(my_spots.timestamp)*60) + minute(my_spots.timestamp))*60),0,spot_delay)
status = .F.
endscan
IF status = .F.
MESSAGEBOX(spot_call + " " + transform(status),36,"Alert",box_delay)
ENDIF
IF EMPTY( spot_alias )
SELECT 0
ELSE
SELECT ( spot_alias )
ENDIF
return status
Dennis: Assistance with getting UTC time from Foxpro would be appreciated.
If you would rather I did not do this - just say so. No worries.
If I am "biting off more than I can chew" - just say so. No worries.
But, if a few hints will get me there - thanks in advanced.
My priority: Low - but others may have a higher priority.
Peter VK4IU
Peter VK4IU
You can help by posting images of
any errors and including your
Logic version.