| 181 | |
| 182 | |
| 183 | void Micropolis::drawValve() |
| 184 | { |
| 185 | float r, c, i; |
| 186 | |
| 187 | r = resValve; |
| 188 | |
| 189 | if (r < -1500) { |
| 190 | r = -1500; |
| 191 | } |
| 192 | |
| 193 | if (r > 1500) { |
| 194 | r = 1500; |
| 195 | } |
| 196 | |
| 197 | c = comValve; |
| 198 | |
| 199 | if (c < -1500) { |
| 200 | c = -1500; |
| 201 | } |
| 202 | |
| 203 | if (c > 1500) { |
| 204 | c = 1500; |
| 205 | } |
| 206 | |
| 207 | i = indValve; |
| 208 | |
| 209 | if (i < -1500) { |
| 210 | i = -1500; |
| 211 | } |
| 212 | |
| 213 | if (i > 1500) { |
| 214 | i = 1500; |
| 215 | } |
| 216 | |
| 217 | if ((r != resLast) || |
| 218 | (c != comLast) || |
| 219 | (i != indLast)) { |
| 220 | |
| 221 | resLast = (int)r; |
| 222 | comLast = (int)c; |
| 223 | indLast = (int)i; |
| 224 | |
| 225 | setDemand(r, c, i); |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | |
| 230 | void Micropolis::setDemand(float r, float c, float i) |
nothing calls this directly
no outgoing calls
no test coverage detected