@@ -339,11 +339,15 @@ internal IRServo(Object s)
339339 MinConfigPositionProperty = IRServoMechanismType . GetProperty ( "MinPosition" ) ;
340340 MaxConfigPositionProperty = IRServoMechanismType . GetProperty ( "MaxPosition" ) ;
341341
342- PositionProperty = IRServoMechanismType . GetProperty ( "Position" ) ;
343342 SpeedProperty = IRServoMechanismType . GetProperty ( "SpeedLimit" ) ;
344343 ConfigSpeedProperty = IRServoMechanismType . GetProperty ( "DefaultSpeed" ) ;
344+ CurrentSpeedProperty = IRServoMechanismType . GetProperty ( "CurrentSpeed" ) ;
345345 AccelerationProperty = IRServoMechanismType . GetProperty ( "AccelerationLimit" ) ;
346-
346+ IsMovingProperty = IRServoMechanismType . GetProperty ( "IsMoving" ) ;
347+ IsFreeMovingProperty = IRServoMechanismType . GetProperty ( "IsFreeMoving" ) ;
348+ IsLockedProperty = IRServoMechanismType . GetProperty ( "IsLocked" ) ;
349+ IsAxisInvertedProperty = IRServoMechanismType . GetProperty ( "IsAxisInverted" ) ;
350+
347351 MoveRightMethod = IRServoMechanismType . GetMethod ( "MoveRight" , BindingFlags . Public | BindingFlags . Instance ) ;
348352 MoveLeftMethod = IRServoMechanismType . GetMethod ( "MoveLeft" , BindingFlags . Public | BindingFlags . Instance ) ;
349353 MoveCenterMethod = IRServoMechanismType . GetMethod ( "MoveCenter" , BindingFlags . Public | BindingFlags . Instance ) ;
@@ -368,7 +372,7 @@ public String Name
368372 private PropertyInfo HighlightProperty ;
369373 public bool Highlight
370374 {
371- get { return ( bool ) HighlightProperty . GetValue ( actualServo , null ) ; }
375+ // get { return (bool)HighlightProperty.GetValue(actualServo, null); }
372376 set { HighlightProperty . SetValue ( actualServo , value , null ) ; }
373377 }
374378
@@ -417,13 +421,46 @@ public float Speed
417421 set { SpeedProperty . SetValue ( actualServoMechanism , value , null ) ; }
418422 }
419423
424+ private PropertyInfo CurrentSpeedProperty ;
425+ public float CurrentSpeed
426+ {
427+ get { return ( float ) CurrentSpeedProperty . GetValue ( actualServoMechanism , null ) ; }
428+ set { CurrentSpeedProperty . SetValue ( actualServoMechanism , value , null ) ; }
429+ }
430+
420431 private PropertyInfo AccelerationProperty ;
421432 public float Acceleration
422433 {
423434 get { return ( float ) AccelerationProperty . GetValue ( actualServoMechanism , null ) ; }
424435 set { AccelerationProperty . SetValue ( actualServoMechanism , value , null ) ; }
425436 }
426437
438+ private PropertyInfo IsMovingProperty ;
439+ public bool IsMoving
440+ {
441+ get { return ( bool ) IsMovingProperty . GetValue ( actualServoMechanism , null ) ; }
442+ }
443+
444+ private PropertyInfo IsFreeMovingProperty ;
445+ public bool IsFreeMoving
446+ {
447+ get { return ( bool ) IsFreeMovingProperty . GetValue ( actualServoMechanism , null ) ; }
448+ }
449+
450+ private PropertyInfo IsLockedProperty ;
451+ public bool IsLocked
452+ {
453+ get { return ( bool ) IsLockedProperty . GetValue ( actualServoMechanism , null ) ; }
454+ set { IsLockedProperty . SetValue ( actualServoMechanism , value , null ) ; }
455+ }
456+
457+ private PropertyInfo IsAxisInvertedProperty ;
458+ public bool IsAxisInverted
459+ {
460+ get { return ( bool ) IsAxisInvertedProperty . GetValue ( actualServoMechanism , null ) ; }
461+ set { IsAxisInvertedProperty . SetValue ( actualServoMechanism , value , null ) ; }
462+ }
463+
427464 private MethodInfo MoveRightMethod ;
428465 internal void MoveRight ( )
429466 {
@@ -465,6 +502,32 @@ internal void Stop()
465502 {
466503 StopMethod . Invoke ( actualServoMechanism , new System . Object [ ] { } ) ;
467504 }
505+
506+ public override bool Equals ( object o )
507+ {
508+ var servo = o as IRServo ;
509+ return servo != null && actualServo . Equals ( servo . actualServo ) ;
510+ }
511+
512+ public override int GetHashCode ( )
513+ {
514+ return ( actualServo != null ? actualServo . GetHashCode ( ) : 0 ) ;
515+ }
516+
517+ public static bool operator == ( IRServo left , IRServo right )
518+ {
519+ return Equals ( left , right ) ;
520+ }
521+
522+ public static bool operator != ( IRServo left , IRServo right )
523+ {
524+ return ! Equals ( left , right ) ;
525+ }
526+
527+ protected bool Equals ( IRServo other )
528+ {
529+ return Equals ( actualServo , other . actualServo ) ;
530+ }
468531 }
469532
470533 public class IRServoGroupsList : List < IRControlGroup >
0 commit comments