PropTerminal and String Questions
Philldapill
Posts: 1,283
I've been using Ariba's PropTerminal for a while now and it's turning into a big mess, so I'm trying to clean up. Don't get me wrong, PropTerminal is fantastic - my organizational skills are lacking...
One of the things I'd like to make, are standardized graphs. I will be graphing all sorts of data such as temperature, current, and voltage, so these graphs will come in handy. To accomplish this, I was thinking about making a specific object that would store certain properties about the graph, such as position, dimensions, number of divisions, color, etc. This object woud also include many functions for setting up the graph on the screen of PropTerminal. So, with this object, I could call a generic function like "CreateGraph(x,y,xDim,yDim)", and it would handle creating all the graphics and keeping track of these properties.
However, to be able to set stuff up on the screen, requires the ability to send data over the PropPlug, to the computer. Since spin doesn't allow an object lower down on the heirarchy tree to send data to an object higher up on the heirarchy tree, this won't work. Instead, I think I could have each graph object add commands to a string(buffer), then have the main Terminal object continuously look at each graph object, grab any command strings, and send them.
I'm pretty sure this would work, but not as sure as to if this is the best way. Regardless, how do I add a single byte to a string?
Attached is a screen shot of a graph that I am manually drawing at the moment.(No, not by hand LOL)
One of the things I'd like to make, are standardized graphs. I will be graphing all sorts of data such as temperature, current, and voltage, so these graphs will come in handy. To accomplish this, I was thinking about making a specific object that would store certain properties about the graph, such as position, dimensions, number of divisions, color, etc. This object woud also include many functions for setting up the graph on the screen of PropTerminal. So, with this object, I could call a generic function like "CreateGraph(x,y,xDim,yDim)", and it would handle creating all the graphics and keeping track of these properties.
However, to be able to set stuff up on the screen, requires the ability to send data over the PropPlug, to the computer. Since spin doesn't allow an object lower down on the heirarchy tree to send data to an object higher up on the heirarchy tree, this won't work. Instead, I think I could have each graph object add commands to a string(buffer), then have the main Terminal object continuously look at each graph object, grab any command strings, and send them.
I'm pretty sure this would work, but not as sure as to if this is the best way. Regardless, how do I add a single byte to a string?
Attached is a screen shot of a graph that I am manually drawing at the moment.(No, not by hand LOL)
Comments
the command strsize will give you the actual length of a zero-terminated string
and then you can calculate the offset where in RAM you have to store the appending byte and again appendig a zero after this byte
best regards
Stefan