| 161 | |
| 162 | #ifndef HEADLESS |
| 163 | static void Port_step(Port* that, float deltaTime) { |
| 164 | // Set plug lights |
| 165 | if (that->channels == 0) { |
| 166 | that->plugLights[0].setBrightness(0.f); |
| 167 | that->plugLights[1].setBrightness(0.f); |
| 168 | that->plugLights[2].setBrightness(0.f); |
| 169 | } |
| 170 | else if (that->channels == 1) { |
| 171 | float v = that->getVoltage() / 10.f; |
| 172 | that->plugLights[0].setSmoothBrightness(-v, deltaTime); |
| 173 | that->plugLights[1].setSmoothBrightness(v, deltaTime); |
| 174 | that->plugLights[2].setBrightness(0.f); |
| 175 | } |
| 176 | else { |
| 177 | float v = that->getVoltageRMS() / 10.f; |
| 178 | that->plugLights[0].setBrightness(0.f); |
| 179 | that->plugLights[1].setBrightness(0.f); |
| 180 | that->plugLights[2].setSmoothBrightness(v, deltaTime); |
| 181 | } |
| 182 | } |
| 183 | #endif |
| 184 | |
| 185 |
no test coverage detected