public void unregisterModule(PModule module) { if (module.getLightCount() <= 0) return; int moduleIndex = module.getComponentIndex(); int vaIndex = ((VoiceArea) module.getParentComponent()).isPolyVoiceArea() ? 0 : 1; PLight light = module.getLight(0); switch (light.getType()) { case PLightDescriptor.TYPE_LED: unregisterLED(moduleIndex, vaIndex, light); break; case PLightDescriptor.TYPE_METER: case PLightDescriptor.TYPE_LED_ARRAY: unregisterMeter(moduleIndex, vaIndex, light); break; } }
public void registerModule(PModule module) { if (module.getLightCount() <= 0) return; int moduleIndex = module.getComponentIndex(); int vaIndex = ((VoiceArea) module.getParentComponent()).isPolyVoiceArea() ? 0 : 1; PLight light = module.getLight(0); switch (light.getType()) { case PLightDescriptor.TYPE_LED: registerLED(moduleIndex, vaIndex, light); break; case PLightDescriptor.TYPE_LED_ARRAY: case PLightDescriptor.TYPE_METER: { PLight a = light; PLight b = module.getLightCount() > 1 ? module.getLight(1) : null; if (b != null && a.getIntAttribute("index", -1) == 1) { PLight tmp = b; b = a; a = tmp; } registerMeter(moduleIndex, vaIndex, b, a); } break; } }