
!if $good!=$empty and $good notwordof osci out out1 out2
 isgood=yes
!endif

l=!itemcnt $ulist
!if $anstype=cv
 drawsrc1=$drawsrc1\
  line $cx,-2,$cx,2,green
!endif
!insdraw $drawsrc1
dcnt=1
!for i=1 to $l-1
 u=!item $i of $ulist
 v=!item $i+1 of $ulist
 !if $i>1
  llist=!append line line $u,$u,$u,$v,blue to $llist
  !insdraw $drawsrc1\
  $llist
  !advance dcnt
 !else
  llist=fcircle $u,$v,6,orange
 !endif
 llist=!append line line $u,$v,$v,$v,blue to $llist
 !insdraw $drawsrc1\
  text blue,$v+0.02,$axis-0.06,tiny,u$[$i+1]\
  dline $v,-2,$v,2,blue\
  $llist
 !advance dcnt
!next i

!if $isgood=yes
 llist=!append line dline $good,-2,$good,2,blue\
  text blue,$good+0.02,$axis-0.06,tiny,lim\
  fcircle $good,$good,6,blue to $llist
 !insdraw $drawsrc1\
  $llist
 !advance dcnt
!endif

alist=!word 1 to $dcnt of 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
animate_delay=120
animate_loop=1
anim=!exec animate $alist

