public DeviceObjectItem(int offset, Guid type, ObjectAspect aspect, DeviceObjectTypeFlags flags, int instance, string name)
 {
     Offset   = offset;
     Type     = type;
     Aspect   = aspect;
     Flags    = flags;
     Instance = instance;
     Name     = name;
 }
Esempio n. 2
0
        /// <summary>Identifies the specified slider in the ExtendedSliders enumeration</summary>
        /// <param name="aspect">Aspect describing the order of the control</param>
        /// <param name="typeGuid">GUID describing the type of control</param>
        /// <returns>The equivalent entry in the ExtendedSliders enumeration or 0</returns>
        private static ExtendedSliders identifySlider(ObjectAspect aspect, Guid typeGuid)
        {
            if (typeGuid == ObjectGuid.Slider)
            {
                if ((aspect & ObjectAspect.Acceleration) == ObjectAspect.Acceleration)
                {
                    return(ExtendedSliders.Acceleration1);
                }
                else if ((aspect & ObjectAspect.Velocity) == ObjectAspect.Velocity)
                {
                    return(ExtendedSliders.Velocity1);
                }
                else if ((aspect & ObjectAspect.Force) == ObjectAspect.Force)
                {
                    return(ExtendedSliders.Force1);
                }
                else if ((aspect & ObjectAspect.Position) == ObjectAspect.Position)
                {
                    return(ExtendedSliders.Slider1);
                }
            }

            return(0);
        }
        /// <summary>Identifies the specified slider in the ExtendedSliders enumeration</summary>
        /// <param name="aspect">Aspect describing the order of the control</param>
        /// <param name="typeGuid">GUID describing the type of control</param>
        /// <returns>The equivalent entry in the ExtendedSliders enumeration or 0</returns>
        private static ExtendedSliders identifySlider(ObjectAspect aspect, Guid typeGuid)
        {
            if (typeGuid == ObjectGuid.Slider) {
            if ((aspect & ObjectAspect.Acceleration) == ObjectAspect.Acceleration) {
              return ExtendedSliders.Acceleration1;
            } else if ((aspect & ObjectAspect.Velocity) == ObjectAspect.Velocity) {
              return ExtendedSliders.Velocity1;
            } else if ((aspect & ObjectAspect.Force) == ObjectAspect.Force) {
              return ExtendedSliders.Force1;
            } else if ((aspect & ObjectAspect.Position) == ObjectAspect.Position) {
              return ExtendedSliders.Slider1;
            }
              }

              return 0;
        }
        /// <summary>Identifies the specified axis in the ExtendedAxes enumeration</summary>
        /// <param name="aspect">Aspect describing the order of the control</param>
        /// <param name="typeGuid">GUID describing the type of control</param>
        /// <returns>The equivalent entry in the ExtendedAxes enumeration or 0</returns>
        private static ExtendedAxes identifyAxis(ObjectAspect aspect, Guid typeGuid)
        {
            ExtendedAxes axis;

              if (typeGuid == ObjectGuid.XAxis) {
            axis = ExtendedAxes.X;
              } else if (typeGuid == ObjectGuid.YAxis) {
            axis = ExtendedAxes.Y;
              } else if (typeGuid == ObjectGuid.ZAxis) {
            axis = ExtendedAxes.Z;
              } else if (typeGuid == ObjectGuid.RotationalXAxis) {
            axis = ExtendedAxes.RotationX;
              } else if (typeGuid == ObjectGuid.RotationalYAxis) {
            axis = ExtendedAxes.RotationY;
              } else if (typeGuid == ObjectGuid.RotationalZAxis) {
            axis = ExtendedAxes.RotationZ;
              } else {
            return 0;
              }

              if ((aspect & ObjectAspect.Acceleration) == ObjectAspect.Acceleration) {
            if (axis == ExtendedAxes.X) { return ExtendedAxes.AccelerationX; }
            if (axis == ExtendedAxes.Y) { return ExtendedAxes.AccelerationY; }
            if (axis == ExtendedAxes.Z) { return ExtendedAxes.AccelerationZ; }
            if (axis == ExtendedAxes.RotationX) { return ExtendedAxes.AngularAccelerationX; }
            if (axis == ExtendedAxes.RotationY) { return ExtendedAxes.AngularAccelerationY; }
            if (axis == ExtendedAxes.RotationZ) { return ExtendedAxes.AngularAccelerationZ; }
              } else if ((aspect & ObjectAspect.Velocity) == ObjectAspect.Velocity) {
            if (axis == ExtendedAxes.X) { return ExtendedAxes.VelocityX; }
            if (axis == ExtendedAxes.Y) { return ExtendedAxes.VelocityY; }
            if (axis == ExtendedAxes.Z) { return ExtendedAxes.VelocityZ; }
            if (axis == ExtendedAxes.RotationX) { return ExtendedAxes.AngularVelocityX; }
            if (axis == ExtendedAxes.RotationY) { return ExtendedAxes.AngularVelocityY; }
            if (axis == ExtendedAxes.RotationZ) { return ExtendedAxes.AngularVelocityZ; }
              } else if ((aspect & ObjectAspect.Force) == ObjectAspect.Force) {
            if (axis == ExtendedAxes.X) { return ExtendedAxes.ForceX; }
            if (axis == ExtendedAxes.Y) { return ExtendedAxes.ForceY; }
            if (axis == ExtendedAxes.Z) { return ExtendedAxes.ForceZ; }
            if (axis == ExtendedAxes.RotationX) { return ExtendedAxes.TorqueX; }
            if (axis == ExtendedAxes.RotationY) { return ExtendedAxes.TorqueY; }
            if (axis == ExtendedAxes.RotationZ) { return ExtendedAxes.TorqueZ; }
              } else if ((aspect & ObjectAspect.Position) == ObjectAspect.Position) {
            return axis;
              }

              return 0;
        }
Esempio n. 5
0
        /// <summary>Identifies the specified axis in the ExtendedAxes enumeration</summary>
        /// <param name="aspect">Aspect describing the order of the control</param>
        /// <param name="typeGuid">GUID describing the type of control</param>
        /// <returns>The equivalent entry in the ExtendedAxes enumeration or 0</returns>
        private static ExtendedAxes identifyAxis(ObjectAspect aspect, Guid typeGuid)
        {
            ExtendedAxes axis;

            if (typeGuid == ObjectGuid.XAxis)
            {
                axis = ExtendedAxes.X;
            }
            else if (typeGuid == ObjectGuid.YAxis)
            {
                axis = ExtendedAxes.Y;
            }
            else if (typeGuid == ObjectGuid.ZAxis)
            {
                axis = ExtendedAxes.Z;
            }
            else if (typeGuid == ObjectGuid.RotationalXAxis)
            {
                axis = ExtendedAxes.RotationX;
            }
            else if (typeGuid == ObjectGuid.RotationalYAxis)
            {
                axis = ExtendedAxes.RotationY;
            }
            else if (typeGuid == ObjectGuid.RotationalZAxis)
            {
                axis = ExtendedAxes.RotationZ;
            }
            else
            {
                return(0);
            }

            if ((aspect & ObjectAspect.Acceleration) == ObjectAspect.Acceleration)
            {
                if (axis == ExtendedAxes.X)
                {
                    return(ExtendedAxes.AccelerationX);
                }
                if (axis == ExtendedAxes.Y)
                {
                    return(ExtendedAxes.AccelerationY);
                }
                if (axis == ExtendedAxes.Z)
                {
                    return(ExtendedAxes.AccelerationZ);
                }
                if (axis == ExtendedAxes.RotationX)
                {
                    return(ExtendedAxes.AngularAccelerationX);
                }
                if (axis == ExtendedAxes.RotationY)
                {
                    return(ExtendedAxes.AngularAccelerationY);
                }
                if (axis == ExtendedAxes.RotationZ)
                {
                    return(ExtendedAxes.AngularAccelerationZ);
                }
            }
            else if ((aspect & ObjectAspect.Velocity) == ObjectAspect.Velocity)
            {
                if (axis == ExtendedAxes.X)
                {
                    return(ExtendedAxes.VelocityX);
                }
                if (axis == ExtendedAxes.Y)
                {
                    return(ExtendedAxes.VelocityY);
                }
                if (axis == ExtendedAxes.Z)
                {
                    return(ExtendedAxes.VelocityZ);
                }
                if (axis == ExtendedAxes.RotationX)
                {
                    return(ExtendedAxes.AngularVelocityX);
                }
                if (axis == ExtendedAxes.RotationY)
                {
                    return(ExtendedAxes.AngularVelocityY);
                }
                if (axis == ExtendedAxes.RotationZ)
                {
                    return(ExtendedAxes.AngularVelocityZ);
                }
            }
            else if ((aspect & ObjectAspect.Force) == ObjectAspect.Force)
            {
                if (axis == ExtendedAxes.X)
                {
                    return(ExtendedAxes.ForceX);
                }
                if (axis == ExtendedAxes.Y)
                {
                    return(ExtendedAxes.ForceY);
                }
                if (axis == ExtendedAxes.Z)
                {
                    return(ExtendedAxes.ForceZ);
                }
                if (axis == ExtendedAxes.RotationX)
                {
                    return(ExtendedAxes.TorqueX);
                }
                if (axis == ExtendedAxes.RotationY)
                {
                    return(ExtendedAxes.TorqueY);
                }
                if (axis == ExtendedAxes.RotationZ)
                {
                    return(ExtendedAxes.TorqueZ);
                }
            }
            else if ((aspect & ObjectAspect.Position) == ObjectAspect.Position)
            {
                return(axis);
            }

            return(0);
        }