Changeset 902 for applications/doprava

Show
Ignore:
Timestamp:
04/13/10 19:48:45 (14 years ago)
Author:
prikryl
Message:

Crashes in UI::get()

Location:
applications/doprava/aimsun_bdm
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • applications/doprava/aimsun_bdm/aimsun_ds.cpp

    r874 r902  
    4646const int MeasurementOffsets[]  = {  6, 42 }; 
    4747 
    48 AimsunDS::AimsunDS ( UIFile &cfg ) : DS() 
     48AimsunDS::AimsunDS () : DS() 
     49{ 
     50  /* Description of the channels of the data vector. */ 
     51  Drv = RV ( "{" 
     52    "495_VA  495_VB   495_VC   495_VD   495_VE   495_VF " 
     53    "495_DVA 495_DVB  495_DVA1 495_DVB1 495_DVC  495_DVD  495_DVE  495_DVF  495_DVF1 " 
     54    "495_S1  495_S2   495_S3   495_S4   495_S5   495_S5a " 
     55    "601_VA  601_VB   601_VC   601_VD   601_VE   601_SE " 
     56        "601_DVA 601_DVAa 601_DVB  601_DVBa 601_DVB1 601_DVC  601_DVD  601_DVD1 601_DSE 601_DVE 601_DSE1 601_DVE1 " 
     57    "601_S6  601_S6a  601_S7   601_S8   601_S9   601_S9a " 
     58    "}", 
     59        "    1,      1,      1,      1,      1,       1,      " 
     60        "    2,      2,      2,      2,      2,       2,      2,      2,      2," 
     61        "    2,      2,      2,      2,      2,       2," 
     62        "    1,      1,      1,      1,      1,       1,      " 
     63        "    2,      2,      2,      2,      2,       2,       2,       2,       2,       2,       2,       2," 
     64        "    2,      2,      2,      2,      2,       2" 
     65        ); 
     66  /* Remember the size of the data vector. */ 
     67  dtsize = Drv._dsize(); 
     68 
     69  /* Description of the channels of the input vector. */ 
     70  Urv = RV ( "{" 
     71          "Tc" 
     72          "495_offset" 
     73          "495_VA  495_VB   495_VC   495_VD   495_VE   495_VF " 
     74          "601_offset" 
     75          "601_VA  601_VB   601_VC   601_VD   601_VE   601_SE " 
     76          "}" ); 
     77  /* Remember the size of the input vector. */ 
     78  utsize = Urv._dsize(); 
     79 
     80  /* Initialise the pointer to received data. */ 
     81  p_rsp = NULL; 
     82} 
     83 
     84void AimsunDS::from_setting ( const Setting &cfg ) 
     85{ 
     86        /* Check the `stop time` field in configuration. */ 
     87        UI::get ( stopTime, cfg, "stop_time" ); 
     88 
     89        /* Query the configuration file for the name of the file containsing 
     90           vehicle entrances. */ 
     91        UI::get ( entranceFileName, cfg, "entrances" ); 
     92} 
     93 
     94void AimsunDS::validate () 
    4995{ 
    5096        HKEY  hKey; 
     
    62108        TCHAR szExePath[MAX_EXE_PATH];  /**< Command line when staring ELS3 controllers. */ 
    63109        TCHAR szEntrancePath[MAX_PATH]; /**< Points to the CSV file with vehicle entrances for the simulation. */ 
    64         string entranceFileName; 
    65         string stopTime; 
    66110        DWORD dwBufLen = MAX_PATH_BYTES; 
    67111        LONG  res; 
     
    214258        /* Fourth modification step. 
    215259           Replace the `stop time` field of RunTime information. */ 
    216         UI::get ( stopTime, cfg, "stop_time" ); 
    217260        replace_stoptime ( 
    218261                szNetPath, 
     
    220263                ); 
    221264 
    222         StringCbCat ( szScePath, MAX_EXE_PATH, TEXT("\"") ); 
    223         StringCbCat ( szScePath, MAX_EXE_PATH, TEXT("\"") ); 
     265        //??? 
     266        //StringCbCat ( szScePath, MAX_EXE_PATH, TEXT("\"") ); 
     267        //StringCbCat ( szScePath, MAX_EXE_PATH, TEXT("\"") ); 
    224268 
    225269        /* Spawn the process. */ 
     
    270314        Sleep ( 5000 ); 
    271315 
    272         /* Query the configuration file for the name of the file containsing 
    273            vehicle entrances. */ 
    274         UI::get ( entranceFileName, cfg, "entrances" ); 
    275316 
    276317        /* Prepare full path for vehicle input data. */ 
     
    289330                ); 
    290331 
    291   /* Description of the channels of the data vector. */ 
    292   Drv = RV ( "{" 
    293     "495_VA  495_VB   495_VC   495_VD   495_VE   495_VF " 
    294     "495_DVA 495_DVB  495_DVA1 495_DVB1 495_DVC  495_DVD  495_DVE  495_DVF  495_DVF1 " 
    295     "495_S1  495_S2   495_S3   495_S4   495_S5   495_S5a " 
    296     "601_VA  601_VB   601_VC   601_VD   601_VE   601_SE " 
    297         "601_DVA 601_DVAa 601_DVB  601_DVBa 601_DVB1 601_DVC  601_DVD  601_DVD1 601_DSE 601_DVE 601_DSE1 601_DVE1 " 
    298     "601_S6  601_S6a  601_S7   601_S8   601_S9   601_S9a " 
    299     "}", 
    300         "    1,      1,      1,      1,      1,       1,      " 
    301         "    2,      2,      2,      2,      2,       2,      2,      2,      2," 
    302         "    2,      2,      2,      2,      2,       2," 
    303         "    1,      1,      1,      1,      1,       1,      " 
    304         "    2,      2,      2,      2,      2,       2,       2,       2,       2,       2,       2,       2," 
    305         "    2,      2,      2,      2,      2,       2" 
    306         ); 
    307   /* Remember the size of the data vector. */ 
    308   dtsize = Drv._dsize(); 
    309  
    310   /* Description of the channels of the input vector. */ 
    311   Urv = RV ( "{" 
    312           "Tc" 
    313           "495_offset" 
    314           "495_VA  495_VB   495_VC   495_VD   495_VE   495_VF " 
    315           "601_offset" 
    316           "601_VA  601_VB   601_VC   601_VD   601_VE   601_SE " 
    317           "}" ); 
    318   /* Remember the size of the input vector. */ 
    319   utsize = Urv._dsize(); 
    320  
    321   /* Initialise the pointer to received data. */ 
    322   p_rsp = NULL; 
    323332} 
    324333 
  • applications/doprava/aimsun_bdm/aimsun_ds.h

    r874 r902  
    3030public: 
    3131    //! Constructor with fixed sampling period 
    32     AimsunDS ( UIFile &cfg ); 
     32    AimsunDS (); 
    3333 
    3434    //! Get measurements and signal plans from ELS3 controllers 
     
    4343        //! number of steps 
    4444        int max_length() {return 960;} 
     45 
     46        virtual void from_setting ( const Setting &cfg ); 
     47        virtual void validate ( void ); 
    4548         
    4649    // TODO dodelat void to_setting( Setting &root ) const; 
    4750private: 
     51        //! File name containing vehicle entrances into the network 
     52        string entranceFileName; 
     53         
     54        //! Stip time of the simulation 
     55        string stopTime; 
     56         
    4857        void AimsunDS::initVGS ( 
    4958                const vgs_headway_mode headway, 
     
    5261                const string &globalStatsPath 
    5362        ); 
     63 
    5464};