Commit 7b2b006fc06c59af792760f56bf2cfaacd648902

Authored by Hacene SI HADJ MOHAND
1 parent d1774421

default liststart and liststop

Showing 1 changed file with 16 additions and 1 deletions   Show diff stats
src/TimeTableCatalog/XMLReader.cc
... ... @@ -29,7 +29,22 @@ void XMLReader::read(TimeTable& pTT) {
29 29  
30 30 // -- parse xml file and process nodes
31 31 parse(pTT);
32   -
  32 + // update listStopDate and listStartDate
  33 + if(pTT._listStopDate <=0 || pTT._listStartDate <=0){
  34 + double startDate=std::numeric_limits<double>::max();
  35 + double stopDate = -1;
  36 +
  37 + for (auto intrval : pTT.getIntervals()){
  38 + if(intrval._startTime <startDate)
  39 + startDate = intrval._startTime;
  40 + if(intrval._stopTime > stopDate)
  41 + stopDate = intrval._stopTime;
  42 + }
  43 + if(pTT._listStopDate <=0)
  44 + pTT._listStopDate = stopDate;
  45 + if(pTT._listStartDate <=0)
  46 + pTT._listStartDate = startDate;
  47 + }
33 48 // -- cleanup function for the XML library.
34 49 xmlCleanupParser();
35 50 }
... ...