| 309 | |
| 310 | |
| 311 | static void Port_step(Port* that, float deltaTime) { |
| 312 | // Set plug lights |
| 313 | if (that->channels == 0) { |
| 314 | that->plugLights[0].setBrightness(0.f); |
| 315 | that->plugLights[1].setBrightness(0.f); |
| 316 | that->plugLights[2].setBrightness(0.f); |
| 317 | } |
| 318 | else if (that->channels == 1) { |
| 319 | float v = that->getVoltage() / 10.f; |
| 320 | that->plugLights[0].setSmoothBrightness(-v, deltaTime); |
| 321 | that->plugLights[1].setSmoothBrightness(v, deltaTime); |
| 322 | that->plugLights[2].setBrightness(0.f); |
| 323 | } |
| 324 | else { |
| 325 | float v = that->getVoltageRMS() / 10.f; |
| 326 | that->plugLights[0].setBrightness(0.f); |
| 327 | that->plugLights[1].setBrightness(0.f); |
| 328 | that->plugLights[2].setSmoothBrightness(v, deltaTime); |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | |
| 333 | void Module::doProcess(const ProcessArgs& args) { |
no test coverage detected