Multiple Timer Script
Webb - all rights reserved - ©2004
spacer
Author - Jann Scheuer
Email: scheuer@coco.ihi.ku.dk
Webpage:

Summary: Multiple purpose timer

Instructions: Application Timer consists of four units

J-Timer - timer control
J-TimerSh - unit for showing timer parameters
J-Tmod - timer clock unit
J-Ring - alarm unit

Only the first of these, J-Timer, should be chosen as the current function
set in rpn. The others are called from J-Timer.

The J-Timer is a multiple function multi-timer. You can put on the stack
as many values to count from as you like, and they will be handled by the
timer ind different ways depending on the setting of the parameters.

Timer continues counting when pilot is off. Alarms does not sound when
pilot is off.

1 Main page:

> - activate timer
! - set timer parameters
? - show timer parameters
Dn-button - activate timer
Up-button - delete tos

Usage: Choose parameters, put values on the stack and press Dn-button or
(arrow).

! Set parameters menu:

Tp: timer type:
Ser - serial timer, count on one value at a time
Rep - repeat counting
Par - count on all values in stack at once!

Di: counting direction:
Up - upwards
Dn - downwards
->0 - towards zero

St: stopping
First 0 - timer stops at first 0
Last 0 - timer stops at last 0

Sg: Periodical signal with fixed intervals

Wa: Warning signal before timer expires. Good for chess timing.

Al: Alarms
Long - long alarm when individual timers expire. Endless randomized alarm
in blues-scale when last timer expires.
Short - shorter, non-endless alarms.

Sp: Special timer
Sport - Sports timer. Counts from tos to playing time and sounds signal
every 5 minutes. Displays time played and time left. Displays  stoppage
time with signal every 1 minute.
Set playing time by putting it on stack before choosing sports timer.

? Show parameters menu:

Much the same as menu in main page.

2 Timer running page:

Shift - rotate stack so that different timers become active
Pause - pause and/or stop timer
Up-button - rotate stack
Dn-button - stop timer

3 Alarm page:

Stop - stop alarm
Dn-button - stop alarm


Examples:

Soccer timer:
Put 45 on the stack. Choose ! and Sp and Sport.
Put starting time on the stack (say 10 minutes if 10 minutes has been
played already).
Press Dn-button.
To get out of sports timer function, choose ! and Sp and no.

Chess timer:
Put 5 and -5 on the stack.
Choose ! and Tp and serial timer.
Choose ! and Di and counting towards 0.
Choose ! and St and First 0.
Choose ! and Wa and 1m warning.
Press Dn-button to activate timer.
Press Up-button to shift between players.

Noisy timer:
Put 0.1, 0.2, 0.3, 0.4, 0.5 on the stack.
Choose ! and Tp and parallel timer.
Choose ! and St and Last 0.
Choose ! and Sg and 10s signal interval.
Choose ! and Al and short.
Press Dn-button to activate timer.

Good luck! It probably takes practices to use this.

Comments to: scheuer@coco.ihi.ku.dk

Code:

RPN.1.g-2 \ J-Timer
{k}Vv#'12'=0(UhCb:
v#'11'=0(Uhh(d1Ud)));
[b]h0=0(D'Timer: write one or more\values to count from.\Format:
min.sec' d1.)
xg(g1xg>g20<|(D'Value for sports timer\is outside
interval.|Ok|'d1xgUdD'Playing time set to|Ok|'d1d1.))
xaxbxcxdxexfxg G'J-Tmod';
"J-Timer"
"!"
D'Set timer functions\Choose parameter|Tp|Di|St|Sg|Wa|Al|Sp|-|'c(
D'Timer type?|Ser|Rep|Par|-|'
g13<(Xa:d1):
D'Counting direction?|Up|Down|->0|-|'
g13<(Xb:d1):
D'Stop by|First 0|Last 0|-|'
g12<(Xc:d1):
D'Periodical signal every|No|10s|1m|5m|10m|15m|-|'
g16<(Xd:d1):
D'Warning?|No|10s|20s|30s|45s|1m|-|'
g16<(Xe:d1):
D'Alarm?|No|Short|Long|-|'
g13<(Xf:d1):
D'Special|No|Sport|-|'
c(0Xg:h(Xg:D'Push playing time on stack\and try again.|Ok|'d1):,):;);
"?"xaxbxcxdxexfxgG'J-TimerSh';
~
">"Cb;

RPN.2.g \ J-TimerSh
{o}XgXfXeXdXcXbXa
xgc(
D'Show parameters for timer\function|Tp|Di|St|Sg|Wa|Al|-|'
c(xac(D'Serial timer|Ok|':
D'Repeting timer|Ok|':
D'Parallel timer|Ok|'):
xbc(D'Counting up|Ok|':
D'Counting down|Ok|':
D'Counting towards 0|Ok|'):
xcc(D'Stopping by first 0|Ok|':
D'Stopping by last 0|Ok|'):
xdc(D'No periodical signal|Ok|':
D'Signal every 10s|Ok|':
D'Signal every 1m|Ok|':
D'Signal every 5m|Ok|':
D'Signal every 10m|Ok|':
D'Signal every 15m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|Stop|'(Ca);

RPN.2.c-2 \ J-Ring
{t}xa(G'J-Timer')Ct#'50'UTUd;
[N]c(#'220':#'233.1':#'246.9':#'261.6':#'277.2':#'293.6':#'311.1':#'329.6':#'349.2':#'370':#'392':#'415.3':#'440':#'466.2':#'493.9':#'523.3':#'554.4':#'587.3':#'622.2':#'659.3':#'698.5':#'740':#'784':#'830.6':#'880');
\ 25
[n]c(0:3:4:5:6:7:9:#'10':#'12':#'15':#'16':#'17':#'18':#'19':#'21':#'22':#'24')CN;

[r]#''#'17'%bCn#'86'S;
[t]8V{_vCr}xc1+Xcxcxbc(#'10':#'200')>(1Xa);
{o}h(:.)XbUd0Xc0XaCt1UT;
{k}Uhd11Xa;
"J-Ring"
"Stop"G'J-Timer';