Changeset 676 for applications/pmsm

Show
Ignore:
Timestamp:
10/22/09 01:13:47 (15 years ago)
Author:
smidl
Message:

logger refactoring

Location:
applications/pmsm
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • applications/pmsm/cfg/sim.cfg

    r654 r676  
    99        params = "pmsm107@zcu.cfg"; 
    1010        tstep = 1.0; // steps for profile in [s] 
    11         profileW = [1, 5, 0, -3, 0, 0, 0, 1, 0, 0 ]; 
     11        profileW = [1, 40, 0, -40, 0, 0, 0, 1, 0, 0 ]; 
    1212        opt = "u"; 
    1313}; 
  • applications/pmsm/pmsmDS.h

    r654 r676  
    5252        opt_modu = ( opt.find ( "modelu" ) !=string::npos ); 
    5353    } 
    54     void getdata ( vec &dt ) 
     54    void getdata ( vec &dt ) const 
    5555    { 
    5656        dt.set_subvector(0,vec ( KalmanObs,6 )); 
     
    114114    }; 
    115115 
    116     void log_add ( logger &L ) 
     116    void log_register ( logger &L ) 
    117117    { 
    118118        L_x = L.add ( rx, "x" ); 
     
    127127    } 
    128128 
    129     void logit ( logger &L ) 
     129    void log_write ( logger &L ) 
    130130    { 
    131131        L.logit ( L_x, vec ( x,4 )      ); 
  • applications/pmsm/pmsm_estim.cpp

    r666 r676  
    3030        F.lookupValue ( "experiment.ndat",Ndat ); 
    3131                 
    32         pDS->log_add ( *L ); 
    33         string nic=""; 
     32        pDS->log_register ( *L, "true" ); 
     33        string Ename; 
    3434        for (int i=0; i<nE; i++){ 
    35                 Es(i)->log_add(*L,nic); // estimate 
     35                try { 
     36                        UI::get ( Ename, F.getRoot()["estimators"][i], "name",UI::optional ); 
     37                } catch ( ...) { 
     38                        Ename="Est"+num2str ( i ); 
     39                } 
     40                Es(i)->log_register(*L,Ename); // estimate 
    3641        } 
    3742        L->init(); 
     
    4853                pDS->step();                                                    // simulator step 
    4954                pDS->getdata ( dt );                                    // read data 
    50                 pDS->logit ( *L ); 
     55                pDS->log_write (); 
    5156                 
    5257                // Estimators 
     
    5459                        Es(i)->bayes ( Dls(i)->pushdown ( dt ) );               // update estimates 
    5560 
    56                         Es(i)->logit (*L); 
     61                        Es(i)->log_write (); 
    5762                } 
    5863                // Regulators