![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: diff function Topic Summary: Created On: 20-Apr-2004 17:24 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Pieter, The attached file is a modified baseline comparison script which outputs to an rtf file which you can view in Word. Object text is compared using the diff function. Jon | |
![]() |
|
Does anybody have a simple example of how the diff function works for showing "red-lining" ? Care to share it? Can't seem to get it working from th DXL manual ...
Thanks, - Pieter ------------------------- Pieter de Waard www.nhindustries.com |
|
![]() |
|
![]() |
|
Pieter,
The attached file is a modified baseline comparison script which outputs to an rtf file which you can view in Word. Object text is compared using the diff function. Jon ------------------------- Jonathan Marshall EADS Astrium |
|
![]() |
|
![]() |
|
Thanks Jon. This a very usefull script that we'll use for DOORS-averse users in our community.
------------------------- Pieter de Waard www.nhindustries.com Edited: 21-Apr-2004 at 13:49 by Pieter DE WAARD |
|
![]() |
|
![]() |
|
Attached is a simple layout DXL fn that shows changes in the current Module using the diff function.
To show changes in Attributes other than Object Text,Heading & Type, just add your own ones in the array in line 1. The actual diff is @ line 119. We use this as part of a 'Manage Changes' view and have set up a filter which just shows Objects with any text in this column ( layout DXL ). The View also has deletes showing an these are also reported by the layout DXL. One thing I failed to get working, was the colour of the redlines in the Layout DXL. How do I get coloured text? regards, ------------------------- Dave +44 (0)23 9270 5711 david.robbins@astrium.eads.net ~~~~~~~~~~~~~~~~~~~~ EADS Astrium, Anchorage Road Portsmouth. Hampshire. UK PO3 5PU Edited: 23-May-2004 at 21:11 by Dave Robbins |
|
![]() |
|
![]() |
|
string attributeToGetHistoryFrom[] = { "Object Heading", "Object Text", "Object Type" }
// just add any new Attributes you want history displayed on into this array ^^^^^^^^^^^^^^^^^^^^^^^^^ // Layout DXL to display simple history/changes /* AUTHOR: Dave Robbins DATE: 24/05/04 FILE LOCATION: DESCRIPTION: This function runs as Layout DXL: ** Displays information on any new Objects ** Displays information on any changed Objects ** Displays information on any deleted Objects The View using this Layout DXL should filter on this column so just the changes are presented Presentation: Known issues/limitations: ** Uses new V7 'diff' function so won't work on pre-V7 Modules The script is not able to: */ /************************************************************************* CHANGES ************************************************************************** VERSION AUTHOR DATE DESCRIPTION/REASON 0.1 DIR 24/05/04 First issue *************************************************************************/ // globals // moved to top for ease of changing by any Users // functions //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// string getDeletedObjectInfo( Object o ) { string returnString = "" History hr for hr in o do { HistoryType ht = hr.type if( ht == deleteObject ) { // if in this condition, then there is relevent history to report... returnString = "Deleted by: " hr.author " on: " hr.date "" // get last deletion in case there has been some fannying about with the deletion... } } return returnString } // end getDeletedObjectInfo //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// string baselineState( Buffer &returnBuff, string attributeToProbe, Object o ) { string returnString = "" History hr for hr in o do { HistoryType ht = hr.type if( ht == modifyObject && hr.attrName == attributeToProbe ) { // if in this condition, then there is relevent history to report... string oldV = hr.plainOldValue string newV = hr.plainNewValue if( !null oldV ) { // changed data state returnBuff += oldV // only interested in original data returnString = "has changed" break // got the first data so can quit out }else { // new data state returnBuff += oldV // only interested in original data returnString = "is new" break // got the first data so can quit out } } } return returnString } // end baselineState //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// Buffer currentState( string attributeToProbe, Object o ) { Buffer returnBuff = create() returnBuff += probeAttr_(o,attributeToProbe) return returnBuff delete returnBuff // finished with the Buffer } // end currentState //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// string diffAttribute( Buffer &resBuf, string attributeToDiff, string &changeType, Object o ) { string returnString = "" Buffer originalText = create() changeType = baselineState( originalText, attributeToDiff, o ) returnString = diff(resBuf, originalText, currentState( attributeToDiff, o ), "\\cf1\\strike ", "\\cf3\\ul ") "" // new V7 function return returnString } // end diffAttribute //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// Buffer getHistoryForAttributes( Object o, string attributeToGetHistoryFromArray[] ) { Buffer returnBuff = create() int sizeOfArray = sizeof attributeToGetHistoryFromArray int everyEntryInArray if( !isDeleted( o ) ) { // all bets off if Object has been deleted // rattle through attributes array to get history from for (everyEntryInArray=0; everyEntryInArray < sizeOfArray; everyEntryInArray++) { string attributeToGetAnyChangesFrom = attributeToGetHistoryFromArray[ everyEntryInArray ]; if( exists attribute attributeToGetAnyChangesFrom ) { // Only proceed if valid attribute Buffer resBuf = create() string changeType = "" string errMess = diffAttribute( resBuf, attributeToGetAnyChangesFrom, changeType, o ) if( null errMess && !null changeType ) { returnBuff += "\nAttribute '" attributeToGetAnyChangesFrom "' {\\b " changeType ":}\n" returnBuff += resBuf returnBuff += "\n\n" } delete resBuf } } } else { returnBuff += "Object# " o."Absolute Number" " {\\b has been deleted.}\n" returnBuff += getDeletedObjectInfo( o ) "\n" } return returnBuff delete returnBuff } // end getHistoryForAttributes //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // main program //Object obj = current // obj already defined in layout DXL //print stringOf( getHistoryForAttributes( obj, attributeToGetHistoryFrom ) ) displayRich stringOf( getHistoryForAttributes( obj, attributeToGetHistoryFrom ) ) //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// ------------------------- Dave +44 (0)23 9270 5711 david.robbins@astrium.eads.net ~~~~~~~~~~~~~~~~~~~~ EADS Astrium, Anchorage Road Portsmouth. Hampshire. UK PO3 5PU |
|
![]() |
|
![]() |
|
Jon,
You stated in a previous (dated) post: quote: Can you re-post this script, or tell me where I can find it at? Thanks, Kim Turner Orbital Sciences Corp. |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
diff function
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.