SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Command_SaveTLCoupledLaneDet.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // Writes e2 state of a link for the time the link has yellow/red
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
34 #include <microsim/MSNet.h>
38 #include <microsim/MSLinkCont.h>
42 
43 #ifdef CHECK_MEMORY_LEAKS
44 #include <foreign/nvwa/debug_new.h>
45 #endif // CHECK_MEMORY_LEAKS
46 
47 
48 // ===========================================================================
49 // method definitions
50 // ===========================================================================
52  MSDetectorFileOutput* dtf, unsigned int begin, OutputDevice& device, MSLink* link)
53  : Command_SaveTLCoupledDet(tlls, dtf, begin, device),
54  myLink(link), myLastState(LINKSTATE_TL_RED),
55  myHadOne(false) {
56  execute();
57 }
58 
59 
61 }
62 
63 
64 void
66  if (myLink->getState() == myLastState && myHadOne) {
67  return;
68  }
69  myHadOne = true;
72  if (myStartTime != end) {
74  myStartTime = end;
75  }
76  } else if (myLink->getState() == LINKSTATE_TL_RED) {
77  myDetector->reset();
79  }
81 }
82 
83 
84 
85 /****************************************************************************/
86