Esempio n. 1
0
 /// <summary>
 /// The constructor for a <see cref="MotorSafetyHelper"/> object
 /// </summary><remarks>
 /// The helper object is constructed for every object that wants to implement the Motor
 /// Safety protocol. The helper object has the code to actually do the timing and call the
 /// motors Stop() method when the timeout expires. The motor object is expected to call the
 /// Feed() method whenever the motors value is updated.
 /// </remarks>
 /// <param name="safeObject">A pointer to the motor object implementing <see cref="IMotorSafety"/>. This is used
 /// to call the Stop() method on the motor</param>
 public MotorSafetyHelper(IMotorSafety safeObject)
 {
     m_safeObject = safeObject;
     SafetyEnabled = false;
     Expiration = DefaultSafetyExpiration;
     m_stopTime = GetFPGATimestamp();
     lock (s_lockObject)
     {
         m_nextHelper = s_headHelper;
         s_headHelper = this;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// The constructor for a <see cref="MotorSafetyHelper"/> object
 /// </summary><remarks>
 /// The helper object is constructed for every object that wants to implement the Motor
 /// Safety protocol. The helper object has the code to actually do the timing and call the
 /// motors Stop() method when the timeout expires. The motor object is expected to call the
 /// Feed() method whenever the motors value is updated.
 /// </remarks>
 /// <param name="safeObject">A pointer to the motor object implementing <see cref="IMotorSafety"/>. This is used
 /// to call the Stop() method on the motor</param>
 public MotorSafetyHelper(IMotorSafety safeObject)
 {
     m_safeObject  = safeObject;
     SafetyEnabled = false;
     Expiration    = DefaultSafetyExpiration;
     m_stopTime    = GetFPGATimestamp();
     lock (s_lockObject)
     {
         m_nextHelper = s_headHelper;
         s_headHelper = this;
     }
 }