Changeset 762

Show
Ignore:
Timestamp:
01/11/10 14:39:33 (14 years ago)
Author:
smidl
Message:

bug in UI::save matrix + universal debugging function

Location:
library/bdm/base
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/base/user_info.cpp

    r737 r762  
    201201        tag = "matrix"; 
    202202 
     203        Setting &rows = set.add ( Setting::TypeInt ); 
     204        rows = matrix.rows(); 
     205 
    203206        Setting &cols = set.add ( Setting::TypeInt ); 
    204207        cols = matrix.cols(); 
    205  
    206         Setting &rows = set.add ( Setting::TypeInt ); 
    207         rows = matrix.rows(); 
    208  
     208         
    209209        Setting &elements = set.add ( Setting::TypeArray ); 
    210210 
     
    367367} 
    368368 
    369 } 
     369void UI_DBG ( Setting &S, const string &spc ){ 
     370        const char *Name=S.getName(); 
     371        if ( Name!=NULL ) {cout << spc << std::string ( Name );}; 
     372        Setting::Type T=S.getType(); 
     373        switch ( T ) { 
     374                case Setting::TypeArray: 
     375                        cout << endl; 
     376                        for ( int i=0;i<S.getLength();i++ ) {UI_DBG ( S[i], spc+" " );}; 
     377                        break; 
     378                case Setting::TypeList: 
     379                        cout << endl; 
     380                        for ( int i=0;i<S.getLength();i++ ) {UI_DBG ( S[i], spc+" " );}; 
     381                        break; 
     382                case Setting::TypeGroup: 
     383                        cout << endl; 
     384                        for ( int i=0;i<S.getLength();i++ ) {UI_DBG ( S[i], spc+" " );} 
     385                        break; 
     386                case Setting::TypeInt: 
     387                        cout << " = "; 
     388                        cout << int ( S ) <<endl; 
     389                        break; 
     390                case Setting::TypeFloat: 
     391                        cout << " = "; 
     392                        cout << double ( S ) <<endl; 
     393                        break; 
     394                case Setting::TypeString: 
     395                        cout << " = "; 
     396                        cout << ( const char* ) ( S ) <<endl; 
     397                        break; 
     398                case Setting::TypeBoolean: 
     399                        cout << " = "; 
     400                        cout << bool ( S ) <<endl; 
     401                        break; 
     402                default: {cout << "?";}; 
     403        }; 
     404} 
     405 
     406}//namespace 
  • library/bdm/base/user_info.h

    r760 r762  
    614614}; 
    615615 
     616//! auxiliary function for debugging 
     617void UI_DBG ( Setting &S, const string &spc ); 
     618 
    616619} 
    617620