Book a Demo

Author Topic: Visualize a variable (print it) at a diagram?  (Read 6208 times)

heba

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Visualize a variable (print it) at a diagram?
« on: March 24, 2015, 12:40:12 am »
Hi all,

is there a chance to print a variable's value on a diagram?  I tried to do that using a hyperlink, or in a note... but the %VAR% is never expanded.

My last idea would be something stereotyped plus a shape script but this sounds a bit too much :)

Thanks
Heiko
« Last Edit: March 24, 2015, 12:40:33 am by heba »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Visualize a variable (print it) at a diagram?
« Reply #1 on: March 24, 2015, 02:36:38 am »
What do you mean by "a variable's value"? If you set the run state of an object, it's clearly displayed in a compartment.

q.

heba

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Re: Visualize a variable (print it) at a diagram?
« Reply #2 on: March 24, 2015, 02:38:32 am »
Sorry for the unclear description.

Using "Local directories and paths..." I set a variable e.g. "BASE_DIR" to a certain path.  I want to display these values at the home page (initial diagram) of the model.

-Heiko

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Visualize a variable (print it) at a diagram?
« Reply #3 on: March 24, 2015, 02:42:39 am »
AFAIK there is no way to show that. You could write a script that creates  an appropriate Note or Text element.

q.

Graham_Moir

  • EA User
  • **
  • Posts: 749
  • Karma: +10/-15
    • View Profile
Re: Visualize a variable (print it) at a diagram?
« Reply #4 on: March 24, 2015, 04:22:36 am »
While you may not be able to pick up the value of the variables directly, as a workaround you could set up a dummy element of some sort, call it say "Environment" and then add a number of tagged values for the BASE_DIR and any other ones you're interested in.  Then place this element on the initial diagram and choose the diagram property to show the tagged values compartment.
« Last Edit: March 24, 2015, 05:14:59 am by Graham_Moir »

heba

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Re: Visualize a variable (print it) at a diagram?
« Reply #5 on: March 25, 2015, 06:43:35 pm »
Thanks, I played around a bit.  But I wasn't able to read the path variable in any kind so far.  It's probably only available to some internal functions :(

-Heiko

Graham_Moir

  • EA User
  • **
  • Posts: 749
  • Karma: +10/-15
    • View Profile
Re: Visualize a variable (print it) at a diagram?
« Reply #6 on: March 25, 2015, 10:06:44 pm »
As I said, you won't be able to pick up the value of those variables, but you could create tagged values that present the same values.   This means duplication, but it also meets your requirement of showing the information on the initial diagram, and as the information is largely static the duplication may be tolerable.
« Last Edit: March 26, 2015, 08:54:31 pm by Graham_Moir »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Visualize a variable (print it) at a diagram?
« Reply #7 on: March 26, 2015, 01:06:49 am »
The path variable is stored in %appdata%\sparx...\paths.txt

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Visualize a variable (print it) at a diagram?
« Reply #8 on: March 26, 2015, 09:57:52 am »
Quote
As I said, you won't be able to pick up the value of those variables, but you could create tagged values that present the same values.   This means duplication, but it also meets your requirement of showing the information on the initial diagram, and as the information is largely static the duplication may be tolerable.
I wouldn't think this would do the job. Yes, the local paths are static. But the point of them is that they can contain different values for different users of the same model. A tagged value can't do that.

Graham_Moir

  • EA User
  • **
  • Posts: 749
  • Karma: +10/-15
    • View Profile
Re: Visualize a variable (print it) at a diagram?
« Reply #9 on: March 26, 2015, 08:54:07 pm »
Ah yes, OK, understood.