Changeset 190 in tmcsimulator for trunk/src/atmsdriver/model/LoopDetector.java
- Timestamp:
- 10/29/2017 10:51:53 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/atmsdriver/model/LoopDetector.java (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/atmsdriver/model/LoopDetector.java
r186 r190 20 20 final public int loopID; 21 21 final public String loopLocation; 22 final public int laneNum;23 22 24 23 /* dynamic data */ 25 24 public int vol; 26 25 public float occ; 27 private int spd;28 26 29 27 /** … … 34 32 * @param laneNum 35 33 */ 36 public LoopDetector(int loopID, String loopLocation , int laneNum)34 public LoopDetector(int loopID, String loopLocation) 37 35 { 38 36 /* Set static data */ 39 37 this.loopID = loopID; 40 38 this.loopLocation = loopLocation; 41 this.laneNum = laneNum;42 39 43 40 /* Init dynamic data */ 44 41 this.vol = 0; 45 this.spd = 0;46 42 this.occ = 0; 47 43 } … … 54 50 LOOP_ID("Loop_ID"), 55 51 LOOP_LOCATION("Loop_Location"), 56 LANE_NUM("Lane_Num"),57 52 VOL("Vol"), 58 SPD("Spd"),59 53 OCC("Occ"), 60 54 LOOP("Loop"); … … 88 82 build.append(Integer.toString(this.loopID)); 89 83 build.append(" "); 90 build.append(Integer.toString(this.laneNum));91 build.append(" ");92 84 if(!MetaDataOnly) 93 85 { … … 96 88 build.append(" "); 97 89 build.append(this.vol); 98 build.append(" ");99 build.append(this.spd);100 90 } 101 91 else … … 113 103 * @param spd speed 114 104 */ 115 public void updateLoop(int vol, float occ , int spd)105 public void updateLoop(int vol, float occ) 116 106 { 117 107 this.vol = vol; 118 108 this.occ = occ; 119 this.spd = spd;120 109 } 121 110 … … 140 129 loopElement.appendChild(loopLocElement); 141 130 142 Element laneNumElement = theDoc.createElement(XML_TAGS.LANE_NUM.tag);143 laneNumElement.appendChild(theDoc.createTextNode(String.valueOf(this.laneNum)));144 loopElement.appendChild(laneNumElement);145 146 131 Element volElement = theDoc.createElement(XML_TAGS.VOL.tag); 147 132 volElement.appendChild(theDoc.createTextNode(String.valueOf(this.vol))); … … 151 136 occElement.appendChild(theDoc.createTextNode(String.valueOf(this.occ))); 152 137 loopElement.appendChild(occElement); 153 154 Element spdElement = theDoc.createElement(XML_TAGS.SPD.tag);155 spdElement.appendChild(theDoc.createTextNode(String.valueOf(this.spd)));156 loopElement.appendChild(spdElement);157 138 } 158 139
Note: See TracChangeset
for help on using the changeset viewer.
