Shop OBEX P1 Docs P2 Docs Learn Events
PropTerminal and String Questions — Parallax Forums

PropTerminal and String Questions

PhilldapillPhilldapill Posts: 1,283
edited 2009-06-21 18:58 in Propeller 1
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)
799 x 564 - 39K

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2009-06-21 16:03
    Hello Phil,

    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
  • localrogerlocalroger Posts: 3,452
    edited 2009-06-21 16:38
    Phil, you can transfer data from a lower object to a higher one if you make preparations. The higher object passes the RAM location of a var to the lower one, which then stuffs the var by direct memory access. (This is similar to how PASM processes communicate with their SPIN parents via a parameter passed to par in the cognew command).
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-06-21 18:58
    Stefan, if I'm writing to that RAM address, how do I know that there isn't anything stored there already?
Sign In or Register to comment.