コード例 #1
0
 /*
  * 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(SaitekPanelsEnum.BackLitPanel, hidSkeleton)
 {
     if (hidSkeleton.PanelType != SaitekPanelsEnum.BackLitPanel)
     {
         throw new ArgumentException();
     }
     VendorId       = 0x6A3;
     ProductId      = 0xB4E;
     _ledBrightness = ledBrightness;
     BipFactory.RegisterBip(this);
     Startup();
 }
コード例 #2
0
 public override void Shutdown()
 {
     try
     {
         BipFactory.DeRegisterBip(this);
         Closed = true;
     }
     catch (Exception e)
     {
         SetLastException(e);
     }
 }
コード例 #3
0
ファイル: BIPLink.cs プロジェクト: fjknc/DCSFlightpanels
 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();
     }
 }