Changeset 874 for applications/doprava

Show
Ignore:
Timestamp:
03/22/10 17:02:09 (14 years ago)
Author:
prikryl
Message:

Constructor of AimsunDS needs user-info config as parameter.
AimsunDS accepts two parameters from config file: entrances and stop_time.

Location:
applications/doprava/aimsun_bdm
Files:
2 modified

Legend:

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

    r860 r874  
    1515 
    1616#define MAX_PATH_BYTES  (MAX_PATH*sizeof(TCHAR)) 
    17 #define MAX_EXE_PATH    (2*MAX_PATH) 
    1817#define MAX_EXE_BYTES   (MAX_EXE_PATH*sizeof(TCHAR)) 
    1918 
     
    4746const int MeasurementOffsets[]  = {  6, 42 }; 
    4847 
    49 AimsunDS::AimsunDS() : DS() 
     48AimsunDS::AimsunDS ( UIFile &cfg ) : DS() 
    5049{ 
    5150        HKEY  hKey; 
     
    6362        TCHAR szExePath[MAX_EXE_PATH];  /**< Command line when staring ELS3 controllers. */ 
    6463        TCHAR szEntrancePath[MAX_PATH]; /**< Points to the CSV file with vehicle entrances for the simulation. */ 
     64        string entranceFileName; 
     65        string stopTime; 
    6566        DWORD dwBufLen = MAX_PATH_BYTES; 
    6667        LONG  res; 
     
    211212                ); 
    212213 
     214        /* Fourth modification step. 
     215           Replace the `stop time` field of RunTime information. */ 
     216        UI::get ( stopTime, cfg, "stop_time" ); 
     217        replace_stoptime ( 
     218                szNetPath, 
     219                stopTime.c_str() 
     220                ); 
     221 
    213222        StringCbCat ( szScePath, MAX_EXE_PATH, TEXT("\"") ); 
    214223        StringCbCat ( szScePath, MAX_EXE_PATH, TEXT("\"") ); 
     
    261270        Sleep ( 5000 ); 
    262271 
     272        /* Query the configuration file for the name of the file containsing 
     273           vehicle entrances. */ 
     274        UI::get ( entranceFileName, cfg, "entrances" ); 
     275 
    263276        /* Prepare full path for vehicle input data. */ 
    264277        StringCbCopy ( szEntrancePath, MAX_EXE_PATH, szSceDir ); 
    265         StringCbCat ( szEntrancePath, MAX_EXE_PATH, TEXT("\\zlicin_20071212_495_601.csv") ); 
     278        StringCbCat  ( szEntrancePath, MAX_EXE_PATH, TEXT("\\") ); 
     279        StringCbCat  ( szEntrancePath, MAX_EXE_PATH, entranceFileName.c_str() ); 
    266280 
    267281        /* Initialise and start the vehicle input. 
  • applications/doprava/aimsun_bdm/aimsun_ds.h

    r844 r874  
    3030public: 
    3131    //! Constructor with fixed sampling period 
    32     AimsunDS (); 
     32    AimsunDS ( UIFile &cfg ); 
    3333 
    3434    //! Get measurements and signal plans from ELS3 controllers