### Author Topic: Calculate available watts remaining in rack based on shapes within the rack  (Read 6001 times)

0 Members and 1 Guest are viewing this topic.

#### dipster6

• Newbie
• Posts: 1
##### Calculate available watts remaining in rack based on shapes within the rack
« on: February 05, 2009, 04:29:52 PM »
Have a scenario where I need to calculate the remaining power within a rack by subtracting power each time a shape is inserted into the rack.

Have a custom stencil which contains three shapes.

1. Rack - One data field is "Watts Remaining"
2. Power Strip - Three data fields - "Amps", "Volts" and "Watts" (Watts already calculated based on entries in the amps and volts fields)
3. Server - Has a "Watts" field

What I need to do is associate a data graphic with the rack which lists the value in the "Watts Remaining" field.  The watts remaining needs to = the total watts available within the rack by adding all shape.powerstrip.x.prop.watts.value fields together and subtracting the sum of all shape.server.x.prop.watts.value fields.

Can this be done?

#### scott

• Full Member
• Posts: 97
##### Re: Calculate available watts remaining in rack based on shapes within the rack
« Reply #1 on: February 09, 2009, 04:59:53 PM »
One relatively straightforward way is to monitor two events: shape dropped and shape deleted.

When you drop a new rack onto the page, set its Watts Remaining field to the appropriate value, then
• each time a shape is dropped, subtract its watts value from the rack's
• each time a shape is deleted, add its watts value back to the rack

The data graphic displaying the Watts Remaining field will be updated automatically as the value changes. Unless I'm missing something, this should do what you need.

#### ben.oates

• Newbie
• Posts: 7
##### Re: Calculate available watts remaining in rack based on shapes within the rack
« Reply #2 on: April 29, 2009, 11:56:34 AM »
I am in a similar situation but I will need more information than the answer provided because I'm afraid I still don't understand.

I have a server shape and an instance shape. When I drop an instance shape onto a server shape it will be assigned a minimum/maximum heap size. I want to add all the minimum and maximum heap sizes together to show minimum/maximum memory in use on the server.

Almost identical problem, really.

However; as I imagine is the case with the original post. I might have more than one Server shape on a page. How do I reference the one I dropped a shape onto? Especially as there will be a number of other shapes inbetween.

Thanks,

Ben

#### aledlund

• Hero Member
• Posts: 1412
##### Re: Calculate available watts remaining in rack based on shapes within the rack
« Reply #3 on: April 29, 2009, 12:11:52 PM »
I believe David Parker talks to this type of solution/requirement in his book (visualizing information.....)
al

#### Visio Guy

• Hero Member
• Posts: 1718
• Smart Graphics for Visual People...n' Stuff
##### Re: Calculate available watts remaining in rack based on shapes within the rack
« Reply #4 on: May 01, 2009, 01:04:54 PM »
I wonder if this add-in might help?

It might be overkill for what you need, or perhaps solving a different problem, but maybe worth a look!
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

#### ben.oates

• Newbie
• Posts: 7
##### Re: Calculate available watts remaining in rack based on shapes within the rack
« Reply #5 on: May 11, 2009, 05:58:06 AM »
Thanks for that Visio Guy. Even if it doesn't help me, I know people this will come in very handy for. I'll try to dissect it for my needs.