How to sound alarm after interval of time? 
Author Message
 How to sound alarm after interval of time?

Hi,

Couldn't think of a better way to express the subject.  Any suggestions
on how to approach this?

Police dispatch system.  Cops stop a car.  Dispatcher enters info and
starts timer.  Goes on with work on another screen/file.  

How do I make computer sound an alarm after x minutes has passed and
there is no response from the officer that stopped the car?  

Can be multiple cars stopped at one time.  

Would like an indicator to blink on foregraound screen.

Would like the row(s) to blink on the carstop screen.

Any ideas on how to approach this would be appreciated.  Thanks

--
regards,

chris



Mon, 13 Aug 2001 03:00:00 GMT  
 How to sound alarm after interval of time?
Hi Chris!

Quote:
> Any ideas on how to approach this would be appreciated.  Thanks

I had a similar situation in monitoring refrigerated containers on a
port. I tried several schemes, and finally settled on this one:

We made the monitoring an SDI application to get around the lack of
Timer events when the MDI menu is open. We used a "button bar" instead
of a menu. Set your window Timer to at least 100 (1/second).

For each "event" have an "event status history" file that has a key
that indicates whether the event is "active" and the alarm date/time
which you can calculate from the current date/time and the interval you
want to wait:

    AlarmDate = TODAY()
    AlarmTime = CLOCK() + 100*<interval to wait in seconds>
    LOOP WHILE AlarmTime > 8640000
        AlarmDate += 1
        AlarmTime -= 8640000
    END

Then add the record to the "event status history" file.

Meanwhile, in the EVENT:Timer, every interval, do a
SET(AlarmDateTimeKey) followed by a NEXT. Thie gets the FIRST
(earliest) record on the file. Check the AlarmDate and AlarmTime to the
current date/time:

    IF TODAY() > AlarmDate |
            OR (TODAY() = AlarmDate AND CLOCK() >= AlarmTime THEN
        ... Process your alarm ...
    END        

Now, this is where we got cute. We had TWO Browseboxes on the screen.
One of them simply showed the overall status of the yard. The other was
filtered to show ONLY containers that had active alarms, and in REVERSE
date/time. Part of processing an alarmed event history record was to
POST(EVENT:ScrollTop,?AlarmBrowse) to update the alarm box. Adding a
sound event can help too. Also, we colored new events a bright
White-on-Red, which with the sound really caught the attention.

HTH!

-- Craig (The Data Ferret)
Using Virtual Access 4.02 build 244 (32-bit) in Win95
Clarion Prof Dev 2.1 / Clarion for DOS 3.x
Clarion for Windows 1.0, 1.5, 2.0 / C4b / C5 Enterprise
Pervasive.SQL / SQL Anywhere 5.5
CPCS CCS CLACom WinEvent CWA
JANUS/Ada 83 95 CLAW
"Do not meddle in the affairs of FERRETS...."



Mon, 13 Aug 2001 03:00:00 GMT  
 How to sound alarm after interval of time?
Chris,

    I would take the main frame timer event and have it monitor a queue. In
the queue, I'd put the thread of the window that want's to be notified and
the time it was entered or the time it should start alarming (this would be
set up by the thread screen, so you can have more than one type of screen
set alarms and the timer could notify each window as necessary). This timer
routine could send post's to the appropriate threads and the threads would
handle it. Alternately, you could have the main frame handle all the alarm
stuff. Hope that gives you an idea...

    Regards,

    kurtt

    Kurt Pawlikowski
    The Pinrod Corporation

    (773) 284-9500
    http://pinrod.com

Quote:

> Hi,

> Couldn't think of a better way to express the subject.  Any suggestions
> on how to approach this?

> Police dispatch system.  Cops stop a car.  Dispatcher enters info and
> starts timer.  Goes on with work on another screen/file.

> How do I make computer sound an alarm after x minutes has passed and
> there is no response from the officer that stopped the car?

> Can be multiple cars stopped at one time.

> Would like an indicator to blink on foregraound screen.

> Would like the row(s) to blink on the carstop screen.

> Any ideas on how to approach this would be appreciated.  Thanks

> --
> regards,

> chris




Mon, 13 Aug 2001 03:00:00 GMT  
 How to sound alarm after interval of time?
Hi Chris,



Quote:
>I thought I might try this approach: At the car stop, write a record to
>a file with a time stamp.  Periodically step thru the 15 to 50 records
>in the file to see if time has been exceeded.  Sound an alarm as
>appropriate.   I do not have any idea how to notify other threads about
>overtimes, but I will read the manual for a change<g>.

I'd add to the file when the call comes in with the start time and
(obviously) not an end time.  I'd also add this to a queue so you
don't have to access the file all the time.  Then it should be fairly
simple to loop through the queue every minute or so (with a timer) and
check if there is need for alarm.  Then I'd access the record in the
database and see if another user has logged an end time and if not,
I'd sound the alarm, if the end time has been entered, I'd delete the
entry from the queue.  You'd need to store a unique record ID in the
queue (if it's not autonumbered, then use the key fields that make up
for a unique ID) as then you can use a Get (or TryGet() in ABC) to go
directly to the record in question when you need to check it.  I use a
similar approach in IKB to register logins and how much time people
spend in the databases.  When they enter the program I write a record
with IP address, start date/time to the logins database and when they
exit, I update the record with the end date/time.  

Best regards,

Arnor Baldvinsson        
[Team Topspeed - Internet Connect]
Allerup Edb
Denmark

Check out Icetips and Icetips Knowledgebase
http://www.icetips.com
UIN nr.: 2428601



Tue, 14 Aug 2001 03:00:00 GMT  
 How to sound alarm after interval of time?
Hi Chris,



Quote:
>On your concept (and Kurt's), how would I know if another dispatcher
>entered a new record?

>BTW, on my existing system, the CarStopLog is a permanent file. It has
>an active record flag as part of a key.  I have never implemented an
>alarm.

One idea would be to s{*filter*}the queue and use a temporary file instead.
That way all users would have access to it.  When a call comes in you
create a record in it, when it's terminated, you add the end time to
the main file and delete the record from the temp file.  You'd
basically have a browse on this temp file that get's refreshed say
once a minute on a timer, that way all users would have a updated view
of what is active and what isn't.  When you've refreshed the browse,
you loop through the records in the temp file and check for how long
time has elapsed.  This would, however, require that the workstations
used synchronized time (from the server for example) so that the time
entered by one workstation isn't completely out of sync with something
entered on another workstation.  Since this file would never be more
than 50 records or so (if I understood you correctly) it shouldn't
take that much time to process.  You could basically use the same
structure as the CarStopLog file uses so assigning of fields would be
simple.  

The code could be something like:

 RefreshBrowseFromFile
 Set(LogFile)
 Loop
   Next(LogFile)
   If ErrorCode()
     Break
   End
   If Clock() - LOG:EnterTime > OneMinute
     Beep
     Message('Car has not logged in for more than one minute')
   End
 End

Another option would be to stuff the > OneMinute entries into a queue
that was displaid in a listbox on the same window, instead of using a
message.

Best regards,

Arnor Baldvinsson        
[Team Topspeed - Internet Connect]
Allerup Edb
Denmark

Check out Icetips and Icetips Knowledgebase
http://www.*-*-*.com/
UIN nr.: 2428601



Tue, 14 Aug 2001 03:00:00 GMT  
 How to sound alarm after interval of time?
Chris,

    I've been busy and haven't kept up with this newsgroup. Did Arnor answer
your question sufficently?

    Regards,

    kurtt

    Kurt Pawlikowski
    The Pinrod Corporation

    (773) 284-9500
    http://pinrod.com

Quote:

> Hi Arnor,

> I get the point.  My idea might slow up the system a bit.

> On your concept (and Kurt's), how would I know if another dispatcher
> entered a new record?

> BTW, on my existing system, the CarStopLog is a permanent file. It has
> an active record flag as part of a key.  I have never implemented an
> alarm.

> Thanks
> --
> regards,

> chris


> > Hi Chris,



> > >I thought I might try this approach: At the car stop, write a record to
> > >a file with a time stamp.  Periodically step thru the 15 to 50 records
> > >in the file to see if time has been exceeded.  Sound an alarm as
> > >appropriate.   I do not have any idea how to notify other threads about
> > >overtimes, but I will read the manual for a change<g>.

> > I'd add to the file when the call comes in with the start time and
> > (obviously) not an end time.  I'd also add this to a queue so you
> > don't have to access the file all the time.  Then it should be fairly
> > simple to loop through the queue every minute or so (with a timer) and
> > check if there is need for alarm.  Then I'd access the record in the
> > database and see if another user has logged an end time and if not,
> > I'd sound the alarm, if the end time has been entered, I'd delete the
> > entry from the queue.  You'd need to store a unique record ID in the
> > queue (if it's not autonumbered, then use the key fields that make up
> > for a unique ID) as then you can use a Get (or TryGet() in ABC) to go
> > directly to the record in question when you need to check it.  I use a
> > similar approach in IKB to register logins and how much time people
> > spend in the databases.  When they enter the program I write a record
> > with IP address, start date/time to the logins database and when they
> > exit, I update the record with the end date/time.

> > Best regards,

> > Arnor Baldvinsson
> > [Team Topspeed - Internet Connect]
> > Allerup Edb
> > Denmark

> > Check out Icetips and Icetips Knowledgebase
> > http://www.icetips.com
> > UIN nr.: 2428601



Thu, 23 Aug 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. alarm sound needed+cycle

2. sounding the alarm ?

3. Newbie: How to sound an alarm

4. Sounding the alarm bell on a workstation

5. Loop separate sounds, separate intervals

6. 12TET Musical 3-Interval-String/6-Interval Cell/Set Non-Redundancy Permutation Ordering Problem:

7. Virtual time alarm

8. Inconsistent Time Interval

9. How to measure time intervals

10. non uniform time interval on the x axis chart

11. How-to time short intervals?

12. Timing interval for 100us

 

 
Powered by phpBB® Forum Software