Exemplo n.º 1
0
 void InvokeFire(RotationEventArgs e)
 {
     if (Fire != null)
     {
         Fire(this, e);
     }
 }
Exemplo n.º 2
0
 void InvokeYaw180(RotationEventArgs e)
 {
     if (Yaw180 != null)
     {
         Yaw180(this, e);
     }
 }
Exemplo n.º 3
0
 void InvokeResetPosition(RotationEventArgs e)
 {
     if (ResetPosition != null)
     {
         ResetPosition(this, e);
     }
 }
Exemplo n.º 4
0
 public void CheckConditionsAndFire(RotationEventArgs e, bool ignoreConditions = false)
 {
     if (ConditionsAreTrue(e) || ignoreConditions)
     {
         InvokeFire(e);
         FireCountSinceLastResetPos++;
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// true when all the properties of the condition return true when compared to the rotation event
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        public bool IsTrue(RotationEventArgs e)
        {
            if (ParentTrigger.TriggeringEvent != YawTrackerOrientationEvent.ResetPosition)
            {
                if (CompOperator == CompareOperator.Equal)
                {
                    if (e.HalfTurns != TargetHalfTurns)
                    {
                        return(false);
                    }
                }
                else if (CompOperator == CompareOperator.EqualOrGreaterThan)
                {
                    if (e.HalfTurns < TargetHalfTurns)
                    {
                        return(false);
                    }

                    if (e.HalfTurns > TargetHalfTurnsMax)
                    {
                        return(false);
                    }
                }

                if (TargetRotationSide != Direction.Either && e.RotationSide != TargetRotationSide)
                {
                    return(false);
                }

                if (TargetAccumulation != AccumulationStatus.Either && e.RotationAccumulationStatus != TargetAccumulation)
                {
                    return(false);
                }
            }
            else
            {
                if (e.PeakHalfTurns < TargetPeakHalfTurns)
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 6
0
        /// <summary>
        /// true when all the properties of the condition return true when compared to the rotation event
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        public bool IsTrue(RotationEventArgs e)
        {
            if (CompOperator == CompareOperator.Equal)
            {
                if (e.HalfTurns != TargetHalfTurns)
                {
                    return(false);
                }
            }
            else if (CompOperator == CompareOperator.EqualOrGreaterThan)
            {
                if (e.HalfTurns < TargetHalfTurns)
                {
                    return(false);
                }
            }


            if (e.HalfTurns > TargetHalfTurnsMax)
            {
                return(false);
            }


            if (TargetRotationSide != Direction.Either && e.RotationSide != TargetRotationSide)
            {
                return(false);
            }

            if (TargetAccumulation != AccumulationStatus.Either && e.RotationAccumulationStatus != TargetAccumulation)
            {
                return(false);
            }


            if (e.PeakHalfTurns < TargetPeakHalfTurns)
            {
                return(false);
            }


            return(true);
        }
Exemplo n.º 7
0
        protected bool ConditionsAreTrue(RotationEventArgs e)
        {
            if (FireLimitPerReset > 0 && FireCountSinceLastResetPos >= FireLimitPerReset)
            {
                return(false);
            }

            if (RotCondition != null)
            {
                if (RotCondition.IsTrue(e) == false)
                {
                    return(false);
                }
            }

            // further conditions...

            return(true);
        }
Exemplo n.º 8
0
 void OnTriggerFire(Object sender, RotationEventArgs e)
 {
     TheAction?.Run();
 }
Exemplo n.º 9
0
 void OnResetPosition(object sender, RotationEventArgs e)
 {
     FireCountSinceLastResetPos = 0;
 }
Exemplo n.º 10
0
 void OnTriggeringTrackerEvent(object sender, RotationEventArgs e)
 {
     CheckConditionsAndFire(e);
 }
Exemplo n.º 11
0
 void InvokeYaw180(RotationEventArgs e)
 {
     Yaw180?.Invoke(this, e);
 }
Exemplo n.º 12
0
 void InvokeResetPosition(RotationEventArgs e)
 {
     ResetPosition?.Invoke(this, e);
 }
Exemplo n.º 13
0
 void InvokeFire(RotationEventArgs e)
 {
     Fire?.Invoke(this, e);
 }