#!/usr/bin/wish

set x 232
set y 232

set fp [open "fifo" "w"]

label .label -textvariable lab
scale .escala -from 0 -to 463 -showvalue false -length 200 -variable x -orient horizontal \
-command Escala 
label .label2 -textvariable lab2
scale .escala2 -from 0 -to 463 -showvalue false -length 200 -variable y -orient horizontal \
-command Escala2

proc Escala { valor } { 
	global lab fp 
	set lab "Input: [ expr floor ( pow(1.01, $valor) * 10 ) / 100 ]"
	puts $fp "I$valor" 
	flush $fp
} 

proc Escala2 { valor } { 
	global lab2 fp 
	set lab2 "Output: [ expr floor ( pow(1.01, $valor) * 10 ) / 100 ]"
	puts $fp "O$valor" 
	flush $fp
} 

canvas .c -width 250 -height 100
set linea [.c create line 0 0 50 0 -fill green -width 10]

pack .label .escala .label2 .escala2 .c
