Dynamic Stripchart Image Generator
Phil Pilgrim (PhiPi)
Posts: 23,514
Continuing my quest to create dynamic image content with the Spinneret, I've come up with an object that produces strip charts, like this one:
The image is a bitmap (.bmp). This format was chosen because it's paletted and does not require an image-compression algorithm to produce. The following aspects of the stripchart are programmable:
Here's a link to my SpinneretCAM web server with another stripchart example:
That image is produced with using the following code snippets:
The objects in the attached archive are autodocument-ready and can be uploaded to read in document format here:
-Phil
The image is a bitmap (.bmp). This format was chosen because it's paletted and does not require an image-compression algorithm to produce. The following aspects of the stripchart are programmable:
- Width (up to 496 active pixels, 512 pixels total)
- Height
- Horizontal scaling
- Paper color
- Grid spacing and color
- Pen color
Here's a link to my SpinneretCAM web server with another stripchart example:
That image is produced with using the following code snippets:
cht.new(201, 400, 20, 16, $eeffee, $aaffaa, $ff0000, -$1_0000, $1_0000, @cht_buffer) 'Create chart specs. repeat i from 0 to 800 cht.add_datum(sin(i << 5)) 'Fill the chart with data. ... cht.begin 'Begin a new 'Generate a chart, and send it to the client. repeat while i := cht.block server.array(i, cht.block_size) server.end_custom_contentTypically, the chart would not be filled with data all at once, but one datum at a time at scheduled intervals, with the excess scrolling off the bottom. Such data often represent time sequences such as line voltage, temperature, windspeed, humidity, etc.
The objects in the attached archive are autodocument-ready and can be uploaded to read in document format here:
-Phil
Comments
Here's a photo of the Spinneret server that creates them, with a TSL230 light-to-frequency sensor and a DS1620 temperature sensor:
The two sensors are multiplexed, as described in this thread:
I've got it sitting in my living room next to a window. You should be able to tell when I turned the room lights on in the evening and then off when I hit the sack.
-Phil
-Phil
http://phipi.homelinux.org:4567
Now you'll have to wait an hour or so before any interesting trends appear.
-Phil
This is excellent. Time to put my local environment online.
Rick
Connecting " virtual" and "physical" life ?
Great !
I need it for remote monitoring server temp/power rooms and racks
Seems you are working on a GD2 processor
Now it needs some compression (to jpeg or so)
As to compression, LZW-GIF is probably the best candidate for crisp graphic images (as opposed to photos), since it's lossless. However, it does require a large chunk of memory for its string table, so I don't know how viable it is for the Prop.
-Phil
The Spinneret has been moved out to my shop, which has forced-air electric heat. You can see when the heater comes on. BTW, it's not really that hot in here. (I'm not that old!) The ambient near the temp sensor is about 10 degrees warmer than the overall air temperature. The W5100 puts out a bit of heat; the Prop, not so much.
-Phil