#!/bin/sh

echo '

proc every {ms body} {eval $body;after $ms [info level 0]}

set pozadi blue
set pozd green
set front yellow
set shct brown


frame .base -relief raised -borderwidth 4
button .editace -text {Editace} -command {exec make -iBs editace &}
button .logbook -text {Logbook} -command {exec make -iBs logbook &}
button .editlb -text {Edit logbook} -command {exec make -iBs editlb &}
button .bnkons -text {Buon konsole} -command {exec make -iBs buonkonsole &}
button .bnkrus -text {Buon krusader} -command {exec make -iBs buonkrus &}
pack .editace .logbook .editlb .bnkons .bnkrus -in .base -side left;

frame .diagnostika -relief raised -borderwidth 4
label .clockt -text {Cas:} 
label .clock  -textvar time
label .capacbtt -text {Kond. bat Bt:}
label .capacbt -textvar CapacBt
pack .clockt .clock .capacbtt .capacbt -in .diagnostika -side left;

frame .zaklad -relief raised -borderwidth 4
button .shot -text {Shot} -command {exec make -iBs go}
button .init -text {Inicializace} -command {exec make -iBs inicializace}
button .nabijeni -text {Nabijeni} -command {exec make -iBs nabijeni}
button .priprava -text {Priprava} -command {exec make -iBs priprava}
button .vystrel -text {Vystrel} -command {exec make -iBs vystrel}
button .konec -text {Konec} -command {exec make -iBs konec}
pack .shot .init .nabijeni .priprava .vystrel .konec -in .zaklad -side left;

frame .vakuum  -relief raised -borderwidth 4       
label .vaklab -text {Vakuum} -background red
button .vakon -text {On} -command {exec make -iBs vakuumOn &}
button .vakoff -text {Off} -command {exec make -iBs vakuumOff &}
menubutton .vakuumoth -text "Vakuum others" -indicatoron 1 -menu .vakuumoth.menu -relief raised -bd 2 -highlightthickness 2 -anchor c -direction flush
menu .vakuumoth.menu -tearoff 0
.vakuumoth.menu add command -label "Hlavn ventil, rotaku pipojit" -command {exec make -iBs sw ch=1 st=H}
.vakuumoth.menu add command -label "Hlavn ventil, rotaku odpojit" -command {exec make -iBs sw ch=1 st=L}
.vakuumoth.menu add command -label "----------------"
.vakuumoth.menu add command -label "Zavzdunn vypnout" -command {exec make -iBs sw ch=3 st=H}
.vakuumoth.menu add command -label "Zavzdunit" -command {exec make -iBs sw ch=3 st=L}
.vakuumoth.menu add command -label "----------------"
.vakuumoth.menu add command -label "Rotaku zapnout" -command {exec make -iBs sw ch=2 st=H}
.vakuumoth.menu add command -label "Rotaku vypnout" -command {exec make -iBs sw ch=2 st=L}

pack .vaklab .vakon .vakoff .vakuumoth -in .vakuum -side left;

frame .grafika -relief raised -borderwidth 4
label .graflab -text {Grafika} -background red
button .vakuumgr -text {vakuum} -command {exec make vakuumgraf &}
button .killgr -text {kill graphs} -command {exec make killgnuplots}
pack .graflab .vakuumgr .killgr -in .grafika -side left


frame .das -relief raised -borderwidth 4
label .daslab -text {DAS} -background red
button .usbscope -text {USBscope} -command {exec make usbscope -B &}
pack .daslab .usbscope -in .das -side left


frame .testyon -relief raised -borderwidth 4
button .jednaon -text {1 on} -command {exec make -iBs sw ch=1 st=H}
button .dvaon -text {2 on} -command {exec make -iBs sw ch=2 st=H}
button .trion -text {3 on} -command {exec make -iBs sw ch=3 st=H}
button .ctyrion -text {4 on} -command {exec make -iBs sw ch=4 st=H}
button .peton -text {5 on} -command {exec make -iBs sw ch=5 st=H}
button .seston -text {6 on} -command {exec make -iBs sw ch=6 st=H}
button .sedmon -text {7 on} -command {exec make -iBs sw ch=7 st=H}
button .osmon -text {8 on} -command {exec make -iBs sw ch=8 st=H}
pack .jednaon .dvaon .trion .ctyrion .peton .seston .sedmon .osmon -in .testyon -side left

frame .testyof -relief raised -borderwidth 4
button .jednaof -text {1 off} -command {exec make -iBs sw ch=1 st=L}
button .dvaof -text {2 off} -command {exec make -iBs sw ch=2 st=L}
button .triof -text {3 off} -command {exec make -iBs sw ch=3 st=L}
button .ctyriof -text {4 off} -command {exec make -iBs sw ch=4 st=L}
button .petof -text {5 off} -command {exec make -iBs sw ch=5 st=L}
button .sestof -text {6 off} -command {exec make -iBs sw ch=6 st=L}
button .sedmof -text {7 off} -command {exec make -iBs sw ch=7 st=L}
button .osmof -text {8 off} -command {exec make -iBs sw ch=8 st=L}
pack .jednaof .dvaof .triof .ctyriof .petof .sestof .sedmof .osmof -in .testyof -side left

frame .testyps -relief raised -borderwidth 4
button .jednaps -text {1 puls} -command {exec make -iBs puls ch=1 }
button .dvaps -text {2 puls} -command {exec make -iBs puls ch=2 }
button .trips -text {3 puls} -command {exec make -iBs puls ch=3 }
button .ctyrips -text {4 puls} -command {exec make -iBs puls ch=4 }
button .petps -text {5 puls} -command {exec make -iBs puls ch=5 }
button .sestps -text {6 puls} -command {exec make -iBs puls ch=6 }
button .sedmps -text {7 puls} -command {exec make -iBs puls ch=7 }
button .osmps -text {8 puls} -command {exec make -iBs puls ch=8 }
pack .jednaps .dvaps .trips .ctyrips .petps .sestps .sedmps .osmps -in .testyps -side left





grid .base -column 1 -row 1  
grid .zaklad -column 1 -row 2 
grid .testyon -column 1 -row 3
grid .testyof -column 1 -row 4  
grid .testyps -column 1 -row 5  
grid .diagnostika -column 1 -row 6
grid .vakuum -column 1 -row 7
grid .grafika -column 1 -row 8
grid .das -column 1 -row 9

every 100 {set ::CapacBt [exec make -s ad4eth3 papid=papAD4etha];set ::time [clock format [clock sec] -format %H:%M:%S]; exec make -si kontrola} 


'|wish -name "Golem v.-1.0"





