![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: New Enumerated Type Topic Summary: Created On: 24-Oct-2007 08:43 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() 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() | |
![]() |
|
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
|
|
![]() |
|
![]() |
|
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()
|
|
![]() |
|
![]() |
|
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. |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
David,
Is this a complete DXL, or is there something else I need to do to make it work? Thanks, Ken. |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
New Enumerated Type
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.