History of Stopwatch Script
Webb - all rights reserved - ©2004
spacer


modified by Russ Webb on  2004-04-22 21:12:14

Author - Jann Scheuer
Email: scheuer@coco.ihi.ku.dk
Webpage:

Summary: Stopwatch with running clock and indexed split and lap
times

Instructions: Application StopWatch

by Jann Scheuer, scheuer@coco.ihi.ku.dk

1 Units
Application StopWatch consists of two units: StopW and StopMod.
Only the first, StopW, should be chosen as current function set in RPN.
(I suggest you place unit StopMod at the bottom of the function set list.)

2 Description
Application StopWatch features a running clock (in seconds),
indexed split and lap times, and sorting facilities for viewing
and manipulating split and lap times.

Split and lap values are shown in seconds and hundreds of seconds.
Values are indexed (on the 6'th digit after the comma) so that the
operator may see which split and lap times go together (i.e. were
tapped in simultaneously).

Stopwatch may be operated by up and down scroll buttons, and therefore
it overrides function set scrolling by means of scroll buttons.

3 Buttons

Unit StopW

But
Menu for defining scroll button function in unit StopMod (i.e. running
stopwatch).
Lap - up button puts lap time on stack, shown as negative values.
Split - up button puts split time on stack.
Both - up button puts lap and split times on stack.
OvWr? - toggles clear/keep stack mode when putting split and lap values on
stack.

Off
Offset or delay. Value in hundreds of seconds added to time values so as to
compensate amongst others for operator's reaction time. If stack is empty
offset
value is shown. If stack is not empty, tos is saved as offset value.

Cls
Clear stack.

Up
Rotate stack upwards.

Dn
Rotate stack downwards.

Srt
Sort values on stack.
Values may be sorted according to their indexes (Asc-i, Des-i) or
according to
numeric values (Asc, Des).

Start
Start stopwatch.

Up scroll button
Clear stack.

Down scroll button
Start stopwatch.


Unit StopMod
(running stopwatch)

.....running.....
No function.

L
Put lap time on stack, shown as negative values.

S
Put split time on stack.

B
Put both lap and split time on stack.

Stop
Stop stopwatch.

Up scroll button
As defined in menu But in StopW.

Down scroll button
Stop stopwatch.

Code:

RPN.2.h \ StopW
{k}Ttxb+r2Vv#'12'=0(UhxaG'J-StopMod':v#'11'=0(UhhV{_vd1}Ud:d1;));
{o}xc0=0xc3=0|!(0Xc);
[h]#'100'*fb;
[s]Xh{1Xg0Xdh1-V{_vxd1+Xdxdg@Xexd1+g@Xfxhc(xexf>:xexf<:xeChxfCh>:xeChxfCh<)
(0Xgxfxd1+p@xexd2+p@)}xg(B)};
"StopW"
"But"D'Buttons: Dn - start/stop \Up - choose function:
|Lap|Split|Both|OvWr?|'
Vv3=0(xc3-bXc:vXa)xa2>(xa3-Xa)xaxc+Xa;
"_Off"h(Xb:xb);
"Cls"hV{_vd1};
~
"Up"hr@;
"Dn"hk@;
"Srt"D'Sort order|Asc|Des|Asc-i|Des-i|'Cs;
~
"Start"Ttxb+xaG'StopMod';

RPN.2.f \ StopMod
{t}Ttxa-#'100'/wxc(d1Cu)#'30'UTUdd1;
[0]#'0.000001';
[+]xfC0+Xf;
[h]#'100';
[a]xa-Ch/xf+;
[l]Vvxb-Ch/nvXbxf-;
[u]G'J-StopW';
[d]XehV{_vd1}xe;
{k}TtUhC+r2Vv#'11'=0(xdc(Cl:Ca:g1Clr2Ca:CdCl:CdCa:Cdg1Clr2Ca):v#'12'=0(1Xc:d1));

{o}XdXaxaXb0Xc0Xf1UT;
{c}CaUd;
"StopMod"
".....running.....";
~
"L"TtC+Cl;
"S"TtC+Ca;
"B"TtC+g1Clr2Ca;
~
"Stop"TtC+Cu;