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: New Enumerated Type
Topic Summary:
Created On: 24-Oct-2007 08:43
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 Paul Mitchell, on Wednesday, October 24, 2007 12:07 PM

Answer:
I have received a reply from Doors support at Telelogic and it works fine. Here's the code: // this is new new function ///////////////////////////// AttrType modifyAndAdd(AttrType atTypeToEdit, string sTypeName, string arrValues[], int arrOrdinals[], int arrColours[], string& sErrMsg) { int arrMaps[atTypeToEdit.size + 1] int i for (i = 0; i < atTypeToEdit.size + 1; i++) { arrMaps = i; } return modify(atTypeToEdit, sTypeName, arrValues, arrOrdinals, arrColours, arrMaps, sErrMsg) } //////////////////////////////////////////////////////// AttrType at = find(current Module, "Priority") // low, medium, high already exists setRealColorOptionForTypes(true) string new_strings[at.size+1] int new_values[at.size+1] int new_colors[at.size+1] for(i=0;i < at.size; i++) { new_strings = at.strings new_values = at.values new_colors = at.colors } string errmsg new_strings[at.size] = " Very High" //get(mod_field) // This is name of new value for type new_values[at.size] = at.size new_colors[at.size] = -1 string at_name = at.name AttrType at_new = modifyAndAdd(at,at_name,new_strings,new_values,new_colors,errmsg) // calls the new customized function instead of modify()
 24-Oct-2007 08:43
User is offline View Users Profile Print this message


Paul Mitchell

Posts: 3
Joined: 24-Oct-2007

Hi, I would like to add a new enumerated type to an already existing attribute with existing enumerated types present using DXL. The database must be maintained as before, but with an additional enumerated type for this particular attribute. I have tried a number of options and have not been able to get any to work. Can anyone help me out please? Thanks, Paul
Report this to a Moderator Report this to a Moderator
 24-Oct-2007 12:07
User is offline View Users Profile Print this message


Paul Mitchell

Posts: 3
Joined: 24-Oct-2007

Answer Answer
I have received a reply from Doors support at Telelogic and it works fine. Here's the code: // this is new new function ///////////////////////////// AttrType modifyAndAdd(AttrType atTypeToEdit, string sTypeName, string arrValues[], int arrOrdinals[], int arrColours[], string& sErrMsg) { int arrMaps[atTypeToEdit.size + 1] int i for (i = 0; i < atTypeToEdit.size + 1; i++) { arrMaps = i; } return modify(atTypeToEdit, sTypeName, arrValues, arrOrdinals, arrColours, arrMaps, sErrMsg) } //////////////////////////////////////////////////////// AttrType at = find(current Module, "Priority") // low, medium, high already exists setRealColorOptionForTypes(true) string new_strings[at.size+1] int new_values[at.size+1] int new_colors[at.size+1] for(i=0;i < at.size; i++) { new_strings = at.strings new_values = at.values new_colors = at.colors } string errmsg new_strings[at.size] = " Very High" //get(mod_field) // This is name of new value for type new_values[at.size] = at.size new_colors[at.size] = -1 string at_name = at.name AttrType at_new = modifyAndAdd(at,at_name,new_strings,new_values,new_colors,errmsg) // calls the new customized function instead of modify()
Report this to a Moderator Report this to a Moderator
 27-Feb-2008 20:57
User is offline View Users Profile Print this message


Ken McNair

Posts: 47
Joined: 12-Sep-2003

Paul,

Including the DXL code as in-line text has messed up the formatting. I've tried re-formatting it myself, but keep getting syntax errors. Can you please post the formatted version using the "Attach Code" button.

Many thanks,
Ken.
Report this to a Moderator Report this to a Moderator
 27-Feb-2008 21:25
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

Aye, Yikes that is kinda scarey...*lol*

I'm actually a little confused as to what Paul was originally trying to do. Is he trying to replace the attribute type of an attribute with a new attribute type? Or is he just trying to add a new enumeration to the attribute type.

A new enumeration can be added very simply by using the modify (attribute type):

modify (AttrType, type, string newName, string codes [], int values [], int colors, string &errmess)

This is documented in the DXL help files.

-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com
Report this to a Moderator Report this to a Moderator
 27-Feb-2008 21:28
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

I don't know why he wrote a custom function but here is the noncustom version of what he was doing.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 3-Mar-2008 16:24
User is offline View Users Profile Print this message


Ken McNair

Posts: 47
Joined: 12-Sep-2003

David,

Is this a complete DXL, or is there something else I need to do to make it work?

Thanks, Ken.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 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 2 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.