Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[DRAW heartbeat] Anyone have a heartbeat/ECG style chart?

 [1/3] from: gregg::pointillistic::com at: 17-Jul-2007 13:13


I'm working on a "heartbeat" system (of sorts) and thought it might be nice to have a graphical display for it, like a scrolling ECG that shows blips when a beat occurs, making it easy to see when a process has flatlined. Does anyone, any of you GUI gurus, have anything like that already written? -- Gregg

 [2/3] from: james::mustard::co::nz at: 18-Jul-2007 11:52


For your amusement ;) rebol[] random/seed now/time beats: copy [4 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] heartbeat: func [/local g n p beatpart][ g: copy [] p: copy [] beatpart: copy/part beats 24 repeat n length? beatpart [ append p compose [(as-pair n * 10 (beatpart/:n) * -10) (as-pair (n * 10) + 5 (beatpart/:n) * 10)] ] append g compose/deep [ translate 0x60 fill-pen off line-width 5 pen 0.255.0.200 spline 20 (p) line-width 1 pen 0.255.100 spline 20 (p) ] append beats first beats remove beats return g ] view layout/size [ at 10x10 box 260x120 black edge [size: 0x0] rate 0:00:0.1 effect [draw[]] feel [ engage: func [f a e][ if a = 'time [f/effect/draw: heartbeat show f] ] ] ] 280x140 Gregg Irwin wrote:

 [3/3] from: gregg::pointillistic::com at: 17-Jul-2007 18:19


Hi James, JM> For your amusement ;) Very cool James! Thanks. -- Gregg