Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Layout DXL to calculate totals
Topic Summary: Tracking Man Hours
Created On: 15-Mar-2006 17:10
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Nolita Morgan, on Wednesday, September 27, 2006 5:24 PM

Answer:
I played around and got that simple calculation in the DOORS module with a layout DXL column and converted it to a DXL Attribute to display in the form I created, but I have to manually refresh to get the calculations..... I like the Layout DXL when using the table in DOORS, but I would like the calculated value to display in my form. Suggestions?

Thanks in advance,
;.)
Nols

UPDATE 9/27/06 : I could not get the auto-calc value to display in my form, but the displaying of the value in the view was good enough....thanks to those who offered suggestions.
 15-Mar-2006 17:10
User is offline View Users Profile Print this message


Nolita Morgan

Posts: 27
Joined: 27-Dec-2002

Hello, I realize this is something I should have done in my many years of experience with DOORS, but I've never needed this before, I've always exported views to Excel and calculated the metrics needed from there.

I have some attributes set up for our engineers to enter in hours associated with a change request for Analysis, Design, Coding, Testing, Documentation and Costing and I've created a nice form for them to use whilst entering in this information. They want me to now have a field to autocalculate the total hours spent on the above activities. I was thinking that this should be a Layout DXL attribute to be included on my form but have not found a good example of this in the DOORS or DXL help. I checked my kitchen scripts and didn't find anything there. I thought I might find one here, but have not come across one as of yet. Anyone out there have something they could share or pointers for setting this up for a Layout DXL newbie?

Much thanks in advance!

-------------------------
Nolita C. Morgan
Computer Systems Analyst
NEXRAD Radar Operations Center
http://www.roc.noaa.gov/
Report this to a Moderator Report this to a Moderator
 16-Mar-2006 09:53
User is offline View Users Profile Print this message


Peter Chattaway

Posts: 14
Joined: 6-Apr-2004

Write normal DXL, except that:
1. assume variable obj is set to the current obj, i.e. the line
Object obj = current
has already been included for you, and
2. in order to display you result, use display i.e.
display("Hi World")

set up to int object attributes NewCount1 and NewCount2, and try following code
int i1 = obj."NewCount1"
int i2 = obj."NewCount2"
int itotal = i1 + i2
display itotal ""
Report this to a Moderator Report this to a Moderator
 20-Mar-2006 17:27
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Layout is inherently slow since every object is recalculated every time you display it, such as when scrolling. If the layout follows links and gets information, then scrolling a module can litterally take minutes PER SCROLL. Attribute DXL is superior in that its only recalculated when you open the module, explicitely demand a recalculation, some other time I don't recall. And also when the result is null. The main disadvantage of Attribute DXL is that you have to create an attribute in the module.

Your calculation seems to be a natural for Attribute DXL. Attached find a snippette of code that can make it work.

- Louie
Report this to a Moderator Report this to a Moderator
 23-Mar-2006 16:39
User is offline View Users Profile Print this message


Peter Chattaway

Posts: 14
Joined: 6-Apr-2004

Do I understand correctly then ?....
with Attribute DXL, when scrolling, if the result is null then the calculation for that object is redone.
BUT in all alther case the re-calcualtion is dependant on time, or when explicitly requested.

Pete
Report this to a Moderator Report this to a Moderator
 23-Mar-2006 16:39
User is offline View Users Profile Print this message


Peter Chattaway

Posts: 14
Joined: 6-Apr-2004

Do I understand correctly then ?....
with Attribute DXL, when scrolling, if the result is null then the calculation for that object is redone.
BUT in all alther case the re-calcualtion is dependant on time, or when explicitly requested.

Pete
Report this to a Moderator Report this to a Moderator
 28-Mar-2006 20:03
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

If the AttrDXL does something simple like divide the values of two other attributes, then any "recalculation" issues are mute since its already so fast. Recalculation matters most when links are involved, such as if you wish to display the Object IDs of all linked partner objects.

Section "DXL Attribute" in chapter "Attributes" of the DXL manual says AttrDXL is updated the first time its value is accessed, but that value is cached and displayed for subsequent accesses. Judging by these statements and imperical evidence, the value is NOT stored in the module when you close it, so when you open it again recalculation is required.

"Accessing" such an attribute value certinaly includes when reference it in some other DXL script (e.g. "string AttrDXLValue = obj.NameOfAttrDXL"), but its also accessed when you first display an object when that Attribute is in the current view. Thus, the first time you scroll down a module its slow since the values are being calculated, but subsequent scrolling is faster. You can force recalculation via the Tools menu, which you would want to do if you know the values should be updated.

If you AttrDXL calculates to null then you should, IMO, set it instead to a blank space; otherwise you will trigger constant recalculation.

You can write a single DXL that can be used as a Layout or as AttrDXL as demonstrated in the attached DXL. I'd make that a library function.

- Louie
Report this to a Moderator Report this to a Moderator
 21-Aug-2006 17:08
User is offline View Users Profile Print this message


Nolita Morgan

Posts: 27
Joined: 27-Dec-2002

Answer Answer
I played around and got that simple calculation in the DOORS module with a layout DXL column and converted it to a DXL Attribute to display in the form I created, but I have to manually refresh to get the calculations..... I like the Layout DXL when using the table in DOORS, but I would like the calculated value to display in my form. Suggestions?

Thanks in advance,
;.)
Nols

UPDATE 9/27/06 : I could not get the auto-calc value to display in my form, but the displaying of the value in the view was good enough....thanks to those who offered suggestions.

-------------------------
Nolita C. Morgan
Computer Systems Analyst
NEXRAD Radar Operations Center
http://www.roc.noaa.gov/

Edited: 27-Sep-2006 at 17:25 by Nolita Morgan
Report this to a Moderator Report this to a Moderator
 21-Aug-2006 19:46
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

It would be unusual, but I see no reason that a 'layout' cannot, in addition to 'display'ing a value, also set some attribute value. That is, it looks something like this:

Value = use 'obj' to calculate some value
ValueAttr = obj.NameTargetAttr
if (Value != ValueAttr) obj.NameTargetAttr = Value // [1] Update the attribute
display(Value) // [2] Display the Value in the column

Be SURE that the Target attribute does NOT record History, or in fact affect change bars nor affect change dates.

The only advantage I see of this is that the Attribute updates rediculously often, and not just when you open the module.

- Louie
Report this to a Moderator Report this to a Moderator
 22-Aug-2006 20:53
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Yes, AttrDXL is updated each time the object is displayed (like LayoutDXL) if the value is null. AttrDXL is updated when you open the module (or is it the first time the value is accessed after opening the module...) and when you request it via the Tools menu. There may be some other time also.

To prevent rediculous recalculation of AttrDXL you should set the result to a space if it is other wise null:

if (null Results) Results = " "
obj.attrDxlName = Results

- Louie
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.