[GME-commit]
GMESRC/GME/ConstraintManager OCLGMECMFacade.h,1.10,1.11
GMEViolationDialog.cpp,1.13,1.14 GMEConstraintEx.h,1.6,1.7
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Mon May 31 16:33:03 CDT 2004
Update of /var/lib/gme/GMESRC/GME/ConstraintManager
In directory braindrain:/tmp/cvs-serv14891
Modified Files:
OCLGMECMFacade.h GMEViolationDialog.cpp GMEConstraintEx.h
Log Message:
violation lineno ref corrected, called functions displayed
CVS User: bogyom
Index: OCLGMECMFacade.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/ConstraintManager/OCLGMECMFacade.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** OCLGMECMFacade.h 27 Nov 2002 15:50:00 -0000 1.10
--- OCLGMECMFacade.h 31 May 2004 20:33:00 -0000 1.11
***************
*** 14,22 ****
namespace OclGmeCM
{
struct EvaluationRecord
{
! OclMeta::Object spObject;
OclTree::ViolationVector vecViolations;
OclGme::SpConstraint spConstraint;
};
--- 14,31 ----
namespace OclGmeCM
{
+ struct FuncItem
+ {
+ string text;
+ int serial;
+ };
+
+ typedef map<string, FuncItem> FuncDesc;
+
struct EvaluationRecord
{
! OclMeta::Object spObject;
OclTree::ViolationVector vecViolations;
OclGme::SpConstraint spConstraint;
+ FuncDesc calledFunctions;
};
***************
*** 89,92 ****
--- 98,104 ----
HRESULT EvaluateConstraints( EvaluationRecordVector& vecInputs, bool bShowProgress );
private :
+ void updateLineno(EvaluationRecord &rec);
+ bool getConstraintFunctionText(string &name, string &text);
+ void addFunctionTexts(EvaluationRecord &rec);
void LoadConstraintFunctions( OclGme::ConstraintFunctionVector& vecFounds, OclGme::ConstraintFunctionVector& vecFaileds, OclGme::ConstraintFunctionVector& vecSucceededs );
string GetSignature( OclGme::SpConstraintFunction spCF );
Index: GMEViolationDialog.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/ConstraintManager/GMEViolationDialog.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** GMEViolationDialog.cpp 17 Dec 2002 06:47:00 -0000 1.13
--- GMEViolationDialog.cpp 31 May 2004 20:33:00 -0000 1.14
***************
*** 172,185 ****
lvItem.mask = LVIF_TEXT;
lvItem.iSubItem = 1;
! CString strText = OclCommonEx::Convert( m_vecRecords[ i ].spConstraint->GetContextType() );
! lvItem.pszText = strText.GetBuffer( strText.GetLength() );
m_lstConstraints.SetItem( &lvItem );
! strText.ReleaseBuffer();
lvItem.iSubItem = 2;
! strText = OclCommonEx::Convert( m_vecRecords[ i ].spConstraint->GetName() );
! lvItem.pszText = strText.GetBuffer( strText.GetLength() );
m_lstConstraints.SetItem( &lvItem );
! strText.ReleaseBuffer();
}
--- 172,185 ----
lvItem.mask = LVIF_TEXT;
lvItem.iSubItem = 1;
! CString strText = m_vecRecords[ i ].spConstraint->GetContextType().c_str();// OclCommonEx::Convert( m_vecRecords[ i ].spConstraint->GetContextType() );
! lvItem.pszText = (char*)(LPCTSTR)strText; //.GetBuffer( strText.GetLength() );
m_lstConstraints.SetItem( &lvItem );
! // strText.ReleaseBuffer();
lvItem.iSubItem = 2;
! strText = m_vecRecords[ i ].spConstraint->GetName().c_str(); // OclCommonEx::Convert( m_vecRecords[ i ].spConstraint->GetName() );
! lvItem.pszText = (char*)(LPCTSTR)strText; //.GetBuffer( strText.GetLength() );
m_lstConstraints.SetItem( &lvItem );
! // strText.ReleaseBuffer();
}
***************
*** 425,436 ****
for ( int i = 0 ; i < m_lstExpression.GetItemCount() ; i++ ) {
LVITEM lvItem;
lvItem.mask = LVIF_IMAGE | LVIF_STATE;
! lvItem.state = ( i + 1== iLine ) ? LVIS_SELECTED : 0;
lvItem.stateMask = LVIS_SELECTED;
lvItem.iItem = i;
lvItem.iSubItem = 0;
! lvItem.iImage = ( i + 1== iLine ) ? 1 : 0;
m_lstExpression.SetItem( &lvItem );
! if ( i + 1== iLine )
m_lstExpression.EnsureVisible( i, false );
}
--- 425,437 ----
for ( int i = 0 ; i < m_lstExpression.GetItemCount() ; i++ ) {
LVITEM lvItem;
+ DWORD lparam = m_lstExpression.GetItemData(i);
lvItem.mask = LVIF_IMAGE | LVIF_STATE;
! lvItem.state = ( lparam + 1== iLine ) ? LVIS_SELECTED : 0;
lvItem.stateMask = LVIS_SELECTED;
lvItem.iItem = i;
lvItem.iSubItem = 0;
! lvItem.iImage = ( lparam + 1== iLine ) ? 1 : 0;
m_lstExpression.SetItem( &lvItem );
! if ( lparam + 1== iLine )
m_lstExpression.EnsureVisible( i, false );
}
***************
*** 445,458 ****
LVITEM lvItem;
! lvItem.mask = LVIF_NORECOMPUTE | LVIF_TEXT;
lvItem.iItem = m_lstObjects.GetItemCount();
lvItem.iSubItem = 0;
lvItem.iImage = 0;
lvItem.lParam = i;
! CString strTemp = OclCommonEx::Convert( vi.vecVariables[ i ] );
! lvItem.pszText = strTemp.GetBuffer( strTemp.GetLength() );
m_lstObjects.InsertItem( &lvItem );
! strTemp.ReleaseBuffer();
strTemp.Empty();
--- 446,459 ----
LVITEM lvItem;
! lvItem.mask = /*LVIF_NORECOMPUTE |*/ LVIF_TEXT;
lvItem.iItem = m_lstObjects.GetItemCount();
lvItem.iSubItem = 0;
lvItem.iImage = 0;
lvItem.lParam = i;
! CString strTemp = vi.vecVariables[ i ].c_str(); // OclCommonEx::Convert( vi.vecVariables[ i ] );
! lvItem.pszText = (char*)(LPCTSTR)strTemp;//.GetBuffer( strTemp.GetLength() );
m_lstObjects.InsertItem( &lvItem );
! // strTemp.ReleaseBuffer();
strTemp.Empty();
***************
*** 461,473 ****
lvItem.mask = LVIF_TEXT;
lvItem.iSubItem = 1;
! strTemp = OclCommonEx::Convert( vi.vecObjects[ i ] );
! lvItem.pszText = strTemp.GetBuffer( strTemp.GetLength() );
m_lstObjects.SetItem( &lvItem );
! strTemp.ReleaseBuffer();
}
! m_lstObjects.SetColumnWidth( 0, LVSCW_AUTOSIZE_USEHEADER );
m_lstObjects.SetColumnWidth( 1, LVSCW_AUTOSIZE_USEHEADER );
}
--- 462,533 ----
lvItem.mask = LVIF_TEXT;
lvItem.iSubItem = 1;
! strTemp = vi.vecObjects[ i ].c_str(); // OclCommonEx::Convert( vi.vecObjects[ i ] );
! lvItem.pszText = (char*)(LPCTSTR)strTemp; //.GetBuffer( strTemp.GetLength() );
m_lstObjects.SetItem( &lvItem );
! // strTemp.ReleaseBuffer();
}
! // m_lstObjects.SetColumnWidth( 0, LVSCW_AUTOSIZE_USEHEADER );
! m_lstObjects.SetColumnWidth( 0, 70);
m_lstObjects.SetColumnWidth( 1, LVSCW_AUTOSIZE_USEHEADER );
+ m_lstObjects.GetParent()->Invalidate();
+ }
+
+ void CViolationDialog::addFunctions()
+ {
+ CStringArray arrText;
+ OclGmeCM::FuncDesc::iterator it;
+ for (it = m_vecRecords[ m_iSelectedConstraint ].calledFunctions.begin();
+ it != m_vecRecords[ m_iSelectedConstraint ].calledFunctions.end(); it++)
+ {
+ arrText.RemoveAll();
+ int serial = it->second.serial;
+ CString strExpression = it->second.text.c_str(); // OclCommonEx::Convert(it->second.text);
+ strExpression.Replace( "\r", "" );
+ strExpression.Replace( "\n", "\r\n" );
+ strExpression.Replace( "\t", " " );
+ int iFPos = 0;
+ do {
+ iFPos = strExpression.Find( "\r\n" );
+ if ( iFPos == -1 )
+ arrText.Add( strExpression );
+ else {
+ arrText.Add( strExpression.Left( iFPos ) );
+ strExpression = strExpression.Right( strExpression.GetLength() - iFPos - 2 );
+ }
+ } while ( iFPos != -1 );
+
+ // Add Expression
+
+ LVITEM lvItem;
+ for ( int i = 0 ; i < arrText.GetSize() ; i++ ) {
+
+ // Add Line
+
+ lvItem.mask = LVIF_PARAM | LVIF_IMAGE | /*LVIF_NORECOMPUTE |*/ LVIF_TEXT;
+ lvItem.iItem = m_lstExpression.GetItemCount();
+ lvItem.iSubItem = 0;
+ lvItem.iImage = 0;
+ lvItem.lParam = it->second.serial*1000 +i;
+ CString strTemp;
+ strTemp.Format( "%d", it->second.serial*1000 + i + 1 );
+ lvItem.pszText = (char*)(LPCTSTR)strTemp; //.GetBuffer( strTemp.GetLength() );
+ m_lstExpression.InsertItem( &lvItem );
+
+ // strTemp.ReleaseBuffer();
+ strTemp.Empty();
+
+ // Add ExpressionPiece
+
+ lvItem.mask = LVIF_TEXT;
+ lvItem.iSubItem = 1;
+ strTemp = arrText.GetAt( i );
+ lvItem.pszText = (char*)(LPCTSTR)strTemp; //.GetBuffer( strTemp.GetLength() );
+ m_lstExpression.SetItem( &lvItem );
+
+ // strTemp.ReleaseBuffer();
+ }
+ }
}
***************
*** 483,487 ****
CStringArray arrText;
! CString strExpression = OclCommonEx::Convert( m_vecRecords[ m_iSelectedConstraint ].spConstraint->GetText() );
strExpression.Replace( "\r", "" );
strExpression.Replace( "\n", "\r\n" );
--- 543,547 ----
CStringArray arrText;
! CString strExpression = m_vecRecords[ m_iSelectedConstraint ].spConstraint->GetText().c_str(); // OclCommonEx::Convert( m_vecRecords[ m_iSelectedConstraint ].spConstraint->GetText() );
strExpression.Replace( "\r", "" );
strExpression.Replace( "\n", "\r\n" );
***************
*** 505,509 ****
// Add Line
! lvItem.mask = LVIF_IMAGE | LVIF_NORECOMPUTE | LVIF_TEXT;
lvItem.iItem = m_lstExpression.GetItemCount();
lvItem.iSubItem = 0;
--- 565,569 ----
// Add Line
! lvItem.mask = LVIF_PARAM | LVIF_IMAGE | /*LVIF_NORECOMPUTE |*/ LVIF_TEXT;
lvItem.iItem = m_lstExpression.GetItemCount();
lvItem.iSubItem = 0;
***************
*** 512,519 ****
CString strTemp;
strTemp.Format( "%d", i + 1 );
! lvItem.pszText = strTemp.GetBuffer( strTemp.GetLength() );
m_lstExpression.InsertItem( &lvItem );
! strTemp.ReleaseBuffer();
strTemp.Empty();
--- 572,579 ----
CString strTemp;
strTemp.Format( "%d", i + 1 );
! lvItem.pszText = (char*)(LPCTSTR)strTemp; // .GetBuffer( strTemp.GetLength() );
m_lstExpression.InsertItem( &lvItem );
! // strTemp.ReleaseBuffer();
strTemp.Empty();
***************
*** 523,533 ****
lvItem.iSubItem = 1;
strTemp = arrText.GetAt( i );
! lvItem.pszText = strTemp.GetBuffer( strTemp.GetLength() );
m_lstExpression.SetItem( &lvItem );
! strTemp.ReleaseBuffer();
}
! m_lstExpression.SetColumnWidth( 0, LVSCW_AUTOSIZE_USEHEADER );
m_lstExpression.SetColumnWidth( 1, LVSCW_AUTOSIZE_USEHEADER );
m_lstExpression.SetWindowPos( &wndTop, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE );
--- 583,596 ----
lvItem.iSubItem = 1;
strTemp = arrText.GetAt( i );
! lvItem.pszText = (char*)(LPCTSTR)strTemp; // .GetBuffer( strTemp.GetLength() );
m_lstExpression.SetItem( &lvItem );
! // strTemp.ReleaseBuffer();
}
! addFunctions();
!
! // m_lstExpression.SetColumnWidth( 0, LVSCW_AUTOSIZE_USEHEADER );
! m_lstExpression.SetColumnWidth( 0, 50);
m_lstExpression.SetColumnWidth( 1, LVSCW_AUTOSIZE_USEHEADER );
m_lstExpression.SetWindowPos( &wndTop, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE );
***************
*** 544,548 ****
// Add Line
! lvItem.mask = LVIF_IMAGE | LVIF_NORECOMPUTE | LVIF_TEXT;
if ( i == 0 ) {
lvItem.mask = lvItem.mask | LVIF_STATE;
--- 607,611 ----
// Add Line
! lvItem.mask = LVIF_IMAGE | /*LVIF_NORECOMPUTE |*/ LVIF_TEXT;
if ( i == 0 ) {
lvItem.mask = lvItem.mask | LVIF_STATE;
***************
*** 558,565 ****
else
strTemp.Format( "%d", vi.position.iLine );
! lvItem.pszText = strTemp.GetBuffer( strTemp.GetLength() );
m_lstErrors.InsertItem( &lvItem );
! strTemp.ReleaseBuffer();
strTemp.Empty();
--- 621,628 ----
else
strTemp.Format( "%d", vi.position.iLine );
! lvItem.pszText = (char*)(LPCTSTR)strTemp; //.GetBuffer( strTemp.GetLength() );
m_lstErrors.InsertItem( &lvItem );
! // strTemp.ReleaseBuffer();
strTemp.Empty();
***************
*** 573,580 ****
lvItem.iSubItem = 1;
strTemp.Format( "%d", vi.position.iColumn );
! lvItem.pszText = strTemp.GetBuffer( strTemp.GetLength() );
m_lstErrors.SetItem( &lvItem );
! strTemp.ReleaseBuffer();
strTemp.Empty();
*/
--- 636,643 ----
lvItem.iSubItem = 1;
strTemp.Format( "%d", vi.position.iColumn );
! lvItem.pszText = (char*)(LPCTSTR)strTemp; //.GetBuffer( strTemp.GetLength() );
m_lstErrors.SetItem( &lvItem );
! // strTemp.ReleaseBuffer();
strTemp.Empty();
*/
***************
*** 584,592 ****
lvItem.mask = LVIF_TEXT;
lvItem.iSubItem = 1;
! strTemp = OclCommonEx::Convert( vi.strMessage );
! lvItem.pszText = strTemp.GetBuffer( strTemp.GetLength() );
m_lstErrors.SetItem( &lvItem );
! strTemp.ReleaseBuffer();
strTemp.Empty();
--- 647,655 ----
lvItem.mask = LVIF_TEXT;
lvItem.iSubItem = 1;
! strTemp = vi.strMessage.c_str(); // OclCommonEx::Convert( vi.strMessage );
! lvItem.pszText = (char*)(LPCTSTR)strTemp; // .GetBuffer( strTemp.GetLength() );
m_lstErrors.SetItem( &lvItem );
! // strTemp.ReleaseBuffer();
strTemp.Empty();
***************
*** 594,602 ****
lvItem.iSubItem = 2;
! strTemp = OclCommonEx::Convert( vi.strSignature );
! lvItem.pszText = strTemp.GetBuffer( strTemp.GetLength() );
m_lstErrors.SetItem( &lvItem );
! strTemp.ReleaseBuffer();
}
--- 657,665 ----
lvItem.iSubItem = 2;
! strTemp = vi.strSignature.c_str(); // OclCommonEx::Convert( vi.strSignature );
! lvItem.pszText = (char*)(LPCTSTR)strTemp; // .GetBuffer( strTemp.GetLength() );
m_lstErrors.SetItem( &lvItem );
! // strTemp.ReleaseBuffer();
}
***************
*** 651,656 ****
return ( iType1 < iType2 ) ? -1 : ( iType1 > iType2 ) ? 1 : 0;
}
! CString str1 = OclCommonEx::Convert( ( pSortInfo->iColumn == 1 ) ? spConstraint1->GetContextType() : spConstraint1->GetName() );
! CString str2 = OclCommonEx::Convert( ( pSortInfo->iColumn == 1 ) ? spConstraint2->GetContextType() : spConstraint2->GetName() );
return strcmp( str1, str2 );
}
--- 714,719 ----
return ( iType1 < iType2 ) ? -1 : ( iType1 > iType2 ) ? 1 : 0;
}
! CString str1 = ( pSortInfo->iColumn == 1 ) ? spConstraint1->GetContextType().c_str() : spConstraint1->GetName().c_str(); // OclCommonEx::Convert( ( pSortInfo->iColumn == 1 ) ? spConstraint1->GetContextType() : spConstraint1->GetName() );
! CString str2 = ( pSortInfo->iColumn == 1 ) ? spConstraint2->GetContextType().c_str() : spConstraint2->GetName().c_str(); // OclCommonEx::Convert( ( pSortInfo->iColumn == 1 ) ? spConstraint2->GetContextType() : spConstraint2->GetName() );
return strcmp( str1, str2 );
}
Index: GMEConstraintEx.h
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/ConstraintManager/GMEConstraintEx.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** GMEConstraintEx.h 20 Nov 2002 18:37:00 -0000 1.6
--- GMEConstraintEx.h 31 May 2004 20:33:00 -0000 1.7
***************
*** 124,128 ****
private :
string m_strParameterList;
! string m_strExpression;
public :
--- 124,128 ----
private :
string m_strParameterList;
! string m_strExpression; // func body
public :
More information about the GME-commit
mailing list