: __stoptimers
15 0 do I tstop drop loop stopeib ;
__stoptimers
forget __stoptimers
forget __eibtbl
128 1 4 array __eibtbl
: __eibfunction
__eibtbl @ ?dup 0= if exit then execute ;
# USE "['] your_function your_object __eibregister" in "oninit"
: __eibregister ( function objnr -- )
dup 0< if 2drop exit then
dup 127 > if 2drop exit then
__eibtbl ! ;
var __acttimer
: __newtimer 1 __acttimer +! ;
#Is the button pressed?
: __buttonpressed 0xFFFFF43C 0x4000 and 0= ;
# USE ": oninit oninit .....your code.... ;"
: oninit ['] __eibfunction dup oneibc oneibu starteib ;
__acttimer @ const __diagrammtimer
__newtimer
#Updaterate in Schritten a 10-ms
#define __diagramm_data_update_rate 100
#justiere eingangsdaten in den Bereich 0..255
#define __diagramm_adjust_range_to_uchar
#der Name für das Diagramm
#define __diagramm_name diagramm1
#das Datenobjekt für das Diagramm
#define eib.displaydata eib.data
__diagramm_name 4 + c@ const w
__diagramm_name 5 + c@ const h
__diagramm_name 6 + c@ const objnr
__diagramm_name 9 + c@ const x
__diagramm_name 10 + c@ h + const y
__diagramm_name 12 + @ 0xFFFF and const foreg
__diagramm_name 12 + @ -16 shift 0xFFFF and const backg
160 1 1 array values
var __diagramm_active
: __diagramminsert ( ypos -- )
x values c@
__diagramm_active @ if
x over backg pixel
swap x over foreg pixel
else swap
then
x values c!
x w + x 1+ do
I values c@ 2dup <> if ( val[x] val[ x+1] )
__diagramm_active @ if
I over backg pixel
swap I over foreg pixel
else swap
then
I values c!
else drop
then
loop
drop
;
: __diagrammadjust ( yval -- ypos )
__diagramm_adjust_range_to_uchar
dup 0< if drop 0 then
dup 255 > if drop 255 then
y swap h * 255 / -
;
: __diagramm_getval
__diagrammtimer tstart
eib.displaydata eibget
__diagrammadjust __diagramminsert ;
: display
?dup 0= if
__diagrammtimer tstop
x 1 - y 2 + 2dup h - 2 - 1 0 line
x 1 - y 2 + 2dup swap w + 1+ swap 1 0 line
x w + x do
I dup values c@ foreg pixel
loop
1 __diagramm_active !
__diagrammtimer tcont drop
exit
then
7 = if 0 __diagramm_active ! then
;
' display __diagramm_name !
: oninit
oninit
__diagrammtimer ['] __diagramm_getval __diagramm_data_update_rate tinit __diagrammtimer tstart
x w + x do 0 __diagrammadjust I values c! loop
;
: oninit mvis2_1_patch @ 0= if exit then
oninit
0 mvis2_1_patch !
;
: __initpatch
drop
oninit ;
' __initpatch mvis2_1_patch !
fsave
reset
sorry, aber ich konnte nicht anders, da ich auch keine Ahnung vom Forthcode habe!

Aber vielleicht kann ja jemand die Stellle markieren, der code ist aus der Arcus Vorlage!
PS: Morgen bekommst du Deine Zwillinge allerdings brauche ich noch das Geschlecht, wäre doch blöd oder? ;-)
Gruß
Christoph


Einen Kommentar schreiben: