コード例 #1
0
ファイル: DelayEffect.cs プロジェクト: ewingnnut/DirectOutput
 /// <summary>
 /// Triggers the effect.<br/>
 /// If the TargetEffect throws a exception, it will be deactivated.
 /// </summary>
 /// <param name="TableElementData">The TableElementData object for the TableElement which has triggered the effect.</param>
 public override void Trigger(TableElementData TableElementData)
 {
     if (TargetEffect != null)
     {
         Table.Pinball.Alarms.RegisterAlarm(DelayMs, TriggerTargetEffect, TableElementData, true);
     }
 }
コード例 #2
0
 /// <summary>
 /// Method to update the state and/or add a entry to the list
 /// </summary>
 /// <param name="Data">Table elemtn data for the update.</param>
 public void UpdateState(TableElementData Data)
 {
     if (Data.TableElementType != TableElementTypeEnum.NamedElement)
     {
         if (Contains(Data.TableElementType, Data.Number))
         {
             _NumberedTableElementsDictionary[Data.TableElementType][Data.Number].Value = Data.Value;
         }
         else
         {
             Add(Data.TableElementType, Data.Number, Data.Value);
         }
     }
     else
     {
         //Update named element
         if (Contains(Data.Name))
         {
             _NamedTableElementsDictionary[Data.Name.ToUpperInvariant()].Value = Data.Value;
         }
         else
         {
             Add(Data.Name.ToUpperInvariant(), Data.Value);
         }
     }
 }
コード例 #3
0
 /// <summary>
 /// Updates the TableElements list with data received from Pinmame.
 /// </summary>
 /// <param name="Data">Data received from Pinmame and handled by the PinMameInputManger</param>
 public void UpdateTableElement(TableElementData Data)
 {
     TableElements.UpdateState(Data);
 }
コード例 #4
0
ファイル: Table.cs プロジェクト: ewingnnut/DirectOutput
 /// <summary>
 /// Updates the TableElements list with data received from Pinmame.
 /// </summary>
 /// <param name="Data">Data received from Pinmame and handled by the PinMameInputManger</param>
 public void UpdateTableElement(TableElementData Data)
 {
     TableElements.UpdateState(Data.TableElementType, Data.Number, Data.Value);
 }
コード例 #5
0
ファイル: Pinball.cs プロジェクト: ewingnnut/DirectOutput
 /// <summary>
 /// Receives the table element data from the calling app.<br />
 /// The received data is put in a queue and the internal thread of the framework is notified about the availability of new data.
 /// </summary>
 /// <param name="TableElementData">The table element data to be received.</param>
 public void ReceiveData(TableElementData TableElementData)
 {
     InputQueue.Enqueue(TableElementData);
     MainThreadSignal();
     ThreadInfoList.HeartBeat("Data delivery");
 }
コード例 #6
0
ファイル: Pinball.cs プロジェクト: ewingnnut/DirectOutput
 /// <summary>
 /// Updates the table element statistics.
 /// </summary>
 /// <param name="TableElementData">The table element data.</param>
 /// <param name="Duration">The duration.</param>
 public void UpdateTableElementStatistics(TableElementData TableElementData, TimeSpan Duration)
 {
     try
     {
         TableElementCallStatistics[TableElementData.TableElementType].AddDuration(Duration);
     }
     catch (Exception E)
     {
         Log.Exception("Could not update TimeSpanStatistics for Pinball table element type {0} ({1})".Build(TableElementData.ToString(), TableElementData), E);
     }
 }
コード例 #7
0
ファイル: EffectBase.cs プロジェクト: ewingnnut/DirectOutput
 /// <summary>
 /// Triggers the effect with the given TableElementData.<br></br>
 /// \warning Remember that the TableElementData parameter will contain null if a effect is called as a static effect. Make sure your implementation of this method does not fail resp. throw exceptions when called with null.
 /// </summary>
 /// <param name="TableElementData">TableElementData for the TableElement which has triggered the effect.</param>
 public abstract void Trigger(TableElementData TableElementData);
コード例 #8
0
 /// <summary>
 /// Triggers the assigned Effect.
 /// <remarks> If the assigned effect throws a exception the effect will be deactivated.</remarks>
 /// </summary>
 /// <param name="TableElementData">The table element data.</param>
 public void Trigger(TableElementData TableElementData)
 {
     if (Effect != null)
     {
         try
         {
             Effect.Trigger(TableElementData);
         }
         catch (Exception E)
         {
             if (TableElementData != null)
             {
                 Log.Exception("A exception occured when triggering effect {0} for table element {1} {2} with value {3}. Effect assignement will be deactivated.".Build(new object[] { Effect.Name, TableElementData.TableElementType, TableElementData.Number, TableElementData.Value }), E);
             }
             else
             {
                 Log.Exception("A exception occured when triggering effect {0} as a static effect.Effect assignement will be deactivated.".Build(new object[] { Effect.Name}), E);
             }
             Effect = null;
         }
     }
 }
コード例 #9
0
ファイル: Table.cs プロジェクト: pixelmagic66/DirectOutput
 /// <summary>
 /// Updates the TableElements list with data received from Pinmame.
 /// </summary>
 /// <param name="Data">Data received from Pinmame and handled by the PinMameInputManger</param>
 public void UpdateTableElement(TableElementData Data)
 {
     TableElements.UpdateState(Data.TableElementType, Data.Number, Data.Value);
 }