/// <summary>
        /// Initializes a new instance of the <see cref="FeatureStatusEventArgs"/> class.
        /// </summary>
        /// <param name="e">The event.</param>
        internal FeatureStatusEventArgs(ExternalInterface.Event e) : base(e)
        {
            var featureStatus = e.TimeStampedStatus.Status.FeatureStatus;

            FeatureName = featureStatus.FeatureName;
            Source      = featureStatus.Source;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CubeBatteryEventArgs" /> class.
 /// </summary>
 /// <param name="e">The event information.</param>
 internal CubeBatteryEventArgs(ExternalInterface.Event e) : base(e)
 {
     BatteryVolts            = e.CubeBattery.BatteryVolts;
     Level                   = (CubeBatteryLevel)e.CubeBattery.Level;
     FactoryId               = e.CubeBattery.FactoryId;
     TimeSinceLastReadingSec = e.CubeBattery.TimeSinceLastReadingSec;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CheckUpdateStatusEventArgs"/> class.
 /// </summary>
 /// <param name="e">The e.</param>
 internal CheckUpdateStatusEventArgs(ExternalInterface.Event e) : base(e)
 {
     Expected      = e.CheckUpdateStatusResponse.Expected;
     Progress      = e.CheckUpdateStatusResponse.Progress;
     UpdateStatus  = (UpdateStatus)e.CheckUpdateStatusResponse.UpdateStatus;
     UpdateVersion = e.CheckUpdateStatusResponse.UpdateVersion;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RobotObjectMovedEventArgs"/> class.
        /// </summary>
        /// <param name="e">The event.</param>
        internal RobotObjectMovedEventArgs(ExternalInterface.Event e) : base(e)
        {
            var objectMoved = e.ObjectEvent.ObjectMoved;

            ObjectId       = (int)objectMoved.ObjectId;
            RobotTimestamp = objectMoved.Timestamp;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="AttentionTransferEventArgs"/> class.
        /// </summary>
        /// <param name="e">The event.</param>
        internal AttentionTransferEventArgs(ExternalInterface.Event e) : base(e)
        {
            var attentionTransfer = e.AttentionTransfer;

            SecondsAgo = attentionTransfer.SecondsAgo;
            Reason     = attentionTransfer.Reason;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RobotObjectStoppedMovingEventArgs"/> class.
        /// </summary>
        /// <param name="e">The event.</param>
        internal RobotObjectStoppedMovingEventArgs(ExternalInterface.Event e) : base(e)
        {
            var objectStoppedMoving = e.ObjectEvent.ObjectStoppedMoving;

            ObjectId       = (int)objectStoppedMoving.ObjectId;
            RobotTimestamp = objectStoppedMoving.Timestamp;
        }
Exemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RobotObjectUpAxisChangedEventArgs"/> class.
        /// </summary>
        /// <param name="e">The event.</param>
        internal RobotObjectUpAxisChangedEventArgs(ExternalInterface.Event e) : base(e)
        {
            var objectUpAxisChanged = e.ObjectEvent.ObjectUpAxisChanged;

            ObjectId       = (int)objectUpAxisChanged.ObjectId;
            RobotTimestamp = objectUpAxisChanged.Timestamp;
            UpAxis         = (UpAxis)(int)objectUpAxisChanged.UpAxis;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="FaceEnrollmentCompletedEventArgs"/> class.
        /// </summary>
        /// <param name="e">The event.</param>
        internal FaceEnrollmentCompletedEventArgs(ExternalInterface.Event e) : base(e)
        {
            var faceEnrollmentCompleted = e.TimeStampedStatus.Status.FaceEnrollmentCompleted;

            FaceId = faceEnrollmentCompleted.FaceId;
            Name   = faceEnrollmentCompleted.Name;
            Result = (FaceEnrollmentResult)faceEnrollmentCompleted.Result;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RobotObjectConnectionStateEventArgs"/> class.
        /// </summary>
        /// <param name="e">The event.</param>
        internal RobotObjectConnectionStateEventArgs(ExternalInterface.Event e) : base(e)
        {
            var objectConnectionState = e.ObjectEvent.ObjectConnectionState;

            Connected        = objectConnectionState.Connected;
            FactoryId        = objectConnectionState.FactoryId;
            ObjectId         = (int)objectConnectionState.ObjectId;
            ObjectType       = objectConnectionState.ObjectType.ToSdkObjectType();
            CustomObjectType = objectConnectionState.ObjectType.ToSdkCustomObjectType();
        }
Exemplo n.º 10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StimulationInfoEventArgs"/> class.
        /// </summary>
        /// <param name="e">The event.</param>
        internal StimulationInfoEventArgs(ExternalInterface.Event e) : base(e)
        {
            var stimulationInfo = e.StimulationInfo;

            Acceleration     = stimulationInfo.Accel;
            EmotionEvents    = stimulationInfo.EmotionEvents.ToList().AsReadOnly();
            MaxValue         = stimulationInfo.MaxValue;
            MinValue         = stimulationInfo.MinValue;
            Value            = stimulationInfo.Value;
            ValueBeforeEvent = stimulationInfo.ValueBeforeEvent;
            Velocity         = stimulationInfo.Velocity;
        }
Exemplo n.º 11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RobotObservedObjectEventArgs"/> class.
        /// </summary>
        /// <param name="e">The event.</param>
        internal RobotObservedObjectEventArgs(ExternalInterface.Event e) : base(e)
        {
            var robotObservedObject = e.ObjectEvent.RobotObservedObject;

            ImageRect             = new ImageRect(robotObservedObject.ImgRect);
            IsActive              = robotObservedObject.IsActive != 0;
            ObjectId              = robotObservedObject.ObjectId;
            ObjectType            = robotObservedObject.ObjectType.ToSdkObjectType();
            CustomObjectType      = robotObservedObject.ObjectType.ToSdkCustomObjectType();
            Pose                  = new Pose(robotObservedObject.Pose);
            RobotTimestamp        = robotObservedObject.Timestamp;
            TopFaceOrientationRad = robotObservedObject.TopFaceOrientationRad;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RobotObservedFaceEventArgs"/> class.
        /// </summary>
        /// <param name="e">The event.</param>
        internal RobotObservedFaceEventArgs(ExternalInterface.Event e) : base(e)
        {
            var robotObservedFace = e.RobotObservedFace;

            Expression       = (FacialExpression)robotObservedFace.Expression;
            ExpressionValues = new ReadOnlyCollection <uint>(robotObservedFace.ExpressionValues);
            FaceId           = robotObservedFace.FaceId;
            ImageRect        = new ImageRect(robotObservedFace.ImgRect);
            LeftEye          = robotObservedFace.LeftEye.Select(r => new Point(r)).ToList().AsReadOnly();
            Mouth            = robotObservedFace.Mouth.Select(r => new Point(r)).ToList().AsReadOnly();
            Name             = robotObservedFace.Name;
            Nose             = robotObservedFace.Nose.Select(r => new Point(r)).ToList().AsReadOnly();
            Pose             = new Pose(robotObservedFace.Pose);
            RightEye         = robotObservedFace.RightEye.Select(r => new Point(r)).ToList().AsReadOnly();
            RobotTimestamp   = robotObservedFace.Timestamp;
        }
Exemplo n.º 13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RobotStateEventArgs"/> class.
        /// </summary>
        /// <param name="e">The event.</param>
        internal RobotStateEventArgs(ExternalInterface.Event e) : base(e)
        {
            var robotState = e.RobotState;

            Acceleration          = new Acceleration(robotState.Accel);
            CarryingObjectId      = robotState.CarryingObjectId;
            CarryingObjectOnTopId = robotState.CarryingObjectOnTopId;
            Gyro                 = new AngularVelocity(robotState.Gyro);
            HeadAngleRad         = robotState.HeadAngleRad;
            HeadTrackingObjectId = robotState.HeadTrackingObjectId;
            LastImageTimestamp   = robotState.LastImageTimeStamp;
            LeftWheelSpeedMmps   = robotState.LeftWheelSpeedMmps;
            LiftHeightMm         = robotState.LiftHeightMm;
            LocalizedToObjectId  = robotState.LocalizedToObjectId;
            Pose                 = new Pose(robotState.Pose);
            PoseAngleRad         = robotState.PoseAngleRad;
            PosePitchRad         = robotState.PosePitchRad;
            Proximity            = new ProximitySensorData(robotState.ProxData);
            RightWheelSpeedMmps  = robotState.RightWheelSpeedMmps;
            Status               = new RobotStatus(robotState.Status);
            Touch                = new TouchSensorData(robotState.TouchData);
        }
Exemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RobotObservedMotionEventArgs"/> class.
 /// </summary>
 /// <param name="e">The e.</param>
 internal RobotObservedMotionEventArgs(ExternalInterface.Event e) : base(e)
 {
     BottomImgArea = e.RobotObservedMotion.BottomImgArea;
     BottomImgX    = e.RobotObservedMotion.BottomImgX;
     BottomImgY    = e.RobotObservedMotion.BottomImgY;
     GroundArea    = e.RobotObservedMotion.GroundArea;
     GroundX       = e.RobotObservedMotion.GroundX;
     GroundY       = e.RobotObservedMotion.GroundY;
     ImgArea       = e.RobotObservedMotion.ImgArea;
     ImgX          = e.RobotObservedMotion.ImgX;
     ImgY          = e.RobotObservedMotion.ImgY;
     LeftImgArea   = e.RobotObservedMotion.LeftImgArea;
     LeftImgX      = e.RobotObservedMotion.LeftImgX;
     LeftImgY      = e.RobotObservedMotion.LeftImgY;
     RightImgArea  = e.RobotObservedMotion.RightImgArea;
     RightImgX     = e.RobotObservedMotion.RightImgX;
     RightImgY     = e.RobotObservedMotion.RightImgY;
     TopImgArea    = e.RobotObservedMotion.TopImgArea;
     TopImgX       = e.RobotObservedMotion.TopImgX;
     TopImgY       = e.RobotObservedMotion.TopImgY;
     Timestamp     = e.RobotObservedMotion.Timestamp;
 }
Exemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WakeWordEventArgs" /> class.
 /// </summary>
 /// <param name="e">The event info.</param>
 internal WakeWordEventArgs(ExternalInterface.Event e) : base(e)
 {
     WakeWordEventType = (WakeWordEventType)e.WakeWord.WakeWordTypeCase;
 }
Exemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MirrorModeDisabledEventArgs"/> class.
 /// </summary>
 /// <param name="e">The event.</param>
 internal MirrorModeDisabledEventArgs(ExternalInterface.Event e) : base(e)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="VisionModesAutoDisabledEventArgs"/> class.
 /// </summary>
 /// <param name="e">The event.</param>
 internal VisionModesAutoDisabledEventArgs(ExternalInterface.Event e) : base(e)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="KeepAliveEventArgs"/> class.
 /// </summary>
 /// <param name="e">The event.</param>
 internal KeepAliveEventArgs(ExternalInterface.Event e) : base(e)
 {
 }
Exemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TimestampedStatusEventArgs"/> class.
 /// </summary>
 /// <param name="e">The event.</param>
 internal TimestampedStatusEventArgs(ExternalInterface.Event e) : base(e)
 {
     StatusType = (StatusType)e.TimeStampedStatus.Status.StatusTypeCase;
     Timestamp  = DateTimeOffset.FromUnixTimeSeconds(e.TimeStampedStatus.TimestampUtc);
 }
Exemplo n.º 20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WakeWordEndEventArgs" /> class.
 /// </summary>
 /// <param name="e">The event.</param>
 internal WakeWordEndEventArgs(ExternalInterface.Event e) : base(e)
 {
     IntentHeard = e.WakeWord.WakeWordEnd.IntentHeard;
     IntentJson  = e.WakeWord.WakeWordEnd.IntentJson;
 }
Exemplo n.º 21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UserIntentEventArgs"/> class.
 /// </summary>
 /// <param name="e">The event.</param>
 internal UserIntentEventArgs(ExternalInterface.Event e) : base(e)
 {
     IntentData = e.UserIntent.JsonData;
     Intent     = Intents.DefaultIntents.GetIntentBy(Types.IntentData.Property.SdkId, e.UserIntent.IntentId);
 }
Exemplo n.º 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AlexaAuthEventArgs"/> class.
 /// </summary>
 /// <param name="e">The e.</param>
 internal AlexaAuthEventArgs(ExternalInterface.Event e) : base(e)
 {
     AuthState = (AlexaAuthState)e.AlexaAuthEvent.AuthState;
     Extra     = e.AlexaAuthEvent.Extra;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FaceScanStartedEventArgs"/> class.
 /// </summary>
 /// <param name="e">The event.</param>
 internal FaceScanStartedEventArgs(ExternalInterface.Event e) : base(e)
 {
 }
Exemplo n.º 24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UserIntentEventArgs"/> class.
 /// </summary>
 /// <param name="e">The event.</param>
 internal UserIntentEventArgs(ExternalInterface.Event e) : base(e)
 {
     Intent     = (UserIntent)e.UserIntent.IntentId;
     IntentData = e.UserIntent.JsonData;
 }
Exemplo n.º 25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RobotChangedObservedFaceIdEventArgs"/> class.
 /// </summary>
 /// <param name="e">The event.</param>
 internal RobotChangedObservedFaceIdEventArgs(ExternalInterface.Event e) : base(e)
 {
     NewId = e.RobotChangedObservedFaceId.NewId;
     OldId = e.RobotChangedObservedFaceId.OldId;
 }
Exemplo n.º 26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CameraSettingsUpdateEventArgs"/> class.
 /// </summary>
 /// <param name="e">The e.</param>
 internal CameraSettingsUpdateEventArgs(ExternalInterface.Event e) : base(e)
 {
     AutoExposureEnabled = e.CameraSettingsUpdate.AutoExposureEnabled;
     ExposureMs          = e.CameraSettingsUpdate.ExposureMs;
     Gain = e.CameraSettingsUpdate.Gain;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WakeWordEndEventArgs" /> class.
 /// </summary>
 /// <param name="e">The event.</param>
 internal WakeWordEndEventArgs(ExternalInterface.Event e) : base(e)
 {
     IntentHeard = e.WakeWord.WakeWordEnd.IntentHeard;
     IntentJson  = e.WakeWord.WakeWordEnd.IntentJson;
     Intent      = ParseUserIntent(e.WakeWord.WakeWordEnd.IntentJson);
 }
Exemplo n.º 28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CubeConnectionLostEventArgs"/> class.
 /// </summary>
 /// <param name="e">The event.</param>
 internal CubeConnectionLostEventArgs(ExternalInterface.Event e) : base(e)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PhotoTakenEventArgs"/> class.
 /// </summary>
 /// <param name="e">The event.</param>
 internal PhotoTakenEventArgs(ExternalInterface.Event e) : base(e)
 {
     PhotoId = e.PhotoTaken.PhotoId;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FaceScanCompleteEventArgs"/> class.
 /// </summary>
 /// <param name="e">The event.</param>
 internal FaceScanCompleteEventArgs(ExternalInterface.Event e) : base(e)
 {
 }