/* * 01000000 2nd BIP from left GREEN * 00000000 * * 01000000 2nd BIP from left YELLOW * 01000000 * * 00000000 2nd BIP from left RED * 01000000 * * 00000000 2nd BIP from left DARK * 00000000 * */ public BacklitPanelBIP(int ledBrightness, HIDSkeleton hidSkeleton) : base(GamingPanelEnum.BackLitPanel, hidSkeleton) { if (hidSkeleton.PanelInfo.GamingPanelType != GamingPanelEnum.BackLitPanel) { throw new ArgumentException(); } VendorId = 0x6A3; ProductId = 0xB4E; _ledBrightness = ledBrightness; BipFactory.RegisterBip(this); Startup(); }
public override void Dispose() { try { BipFactory.DeRegisterBip(this); Closed = true; } catch (Exception e) { SetLastException(e); } }
private void ExecuteThreaded(SortedList <int, BIPLight> bipLights) { try { try { if (bipLights == null) { return; } var bipEventHandlerManager = BipFactory.GetBipEventHandlerManager(); if (!BipFactory.HasBips()) { return; } for (var i = 0; i < bipLights.Count; i++) { if (AbortThread()) { Common.DebugP("Aborting BIPLink thread routine (AbortThread) #1"); break; } var bipLight = bipLights[i]; Thread.Sleep((int)bipLight.DelayBefore); if (AbortThread()) { Common.DebugP("Aborting BIPLink thread routine (AbortThread) #2"); break; } bipEventHandlerManager.ShowLight(bipLight); } } catch (Exception ex) { Common.DebugP(ex.Message); } } finally { SignalThreadHasFinished(); } }