Пример #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (header_ != null)
            {
                hash ^= Header.GetHashCode();
            }
            if (FusionStatus != 0)
            {
                hash ^= FusionStatus.GetHashCode();
            }
            if (GnssStatus != 0)
            {
                hash ^= GnssStatus.GetHashCode();
            }
            if (LidarStatus != 0)
            {
                hash ^= LidarStatus.GetHashCode();
            }
            if (MeasurementTime != 0D)
            {
                hash ^= MeasurementTime.GetHashCode();
            }
            if (StateMessage.Length != 0)
            {
                hash ^= StateMessage.GetHashCode();
            }
            return(hash);
        }
        public ErrorCode GetFusedHeading(out int bIsFusing, out int bIsValid, out float value, out ErrorCode lastError)
        {
            FusionStatus toFill  = new FusionStatus();
            ErrorCode    errCode = GetFusedHeading(toFill, out value);

            bIsFusing = toFill.bIsFusing ? 1 : 0;
            bIsValid  = toFill.bIsValid ? 1 : 0;
            lastError = toFill.lastError;

            return(errCode);
        }
        public ErrorCode GetFusedHeading(out float value)
        {
            FusionStatus temp = new FusionStatus();

            return(GetFusedHeading(temp, out value));
        }
        /**
         * @param status    object reference to fill with fusion status flags.
         *					Caller may omit this parameter if flags are not needed.
         * @return fused heading in degrees.
         */
        public ErrorCode GetFusedHeading(FusionStatus status, out float value)
        {
            bool bIsFusing, bIsValid;

            float[] temp = new float[3];
            float   fusedHeading;

            ErrorCode errCode = GetThreeParam20(COND_STATUS_6, temp, 360f / 8192f);

            fusedHeading = temp[0];
            byte b2 = (byte)(_cache >> 16);

            string description;

            if (errCode != 0)
            {
                bIsFusing   = false;
                bIsValid    = false;
                description = "Could not receive status frame.  Check wiring and web-config.";
            }
            else
            {
                int flags = (b2) & 7;
                if (flags == 7)
                {
                    bIsFusing = true;
                }
                else
                {
                    bIsFusing = false;
                }

                if ((b2 & 0x8) == 0)
                {
                    bIsValid = false;
                }
                else
                {
                    bIsValid = true;
                }

                if (bIsValid == false)
                {
                    description = "Fused Heading is not valid.";
                }
                else if (bIsFusing == false)
                {
                    description = "Fused Heading is valid.";
                }
                else
                {
                    description = "Fused Heading is valid and is fusing compass.";
                }
            }

            /* fill caller's struct */
            status.heading     = fusedHeading;
            status.bIsFusing   = bIsFusing;
            status.bIsValid    = bIsValid;
            status.description = description;
            status.lastError   = errCode;

            value = fusedHeading;
            return(SetLastError(errCode));
        }
Пример #5
0
        /**
         * @param status    object reference to fill with fusion status flags.
         *					Caller may pass null if flags are not needed.
         * @return fused heading in degrees.
         */
        public float GetFusedHeading(FusionStatus status)
        {
            bool  bIsFusing, bIsValid;
            float fusedHeading;

            int errCode = GetThreeParam20(COND_STATUS_6, _cache_four_params, 360.0f / 8192.0f);

            fusedHeading = _cache_four_params[0];
            byte b2 = (byte)(_cache >> 16);

            String description;

            if (errCode != 0)
            {
                bIsFusing   = false;
                bIsValid    = false;
                description = "Could not receive status frame.  Check wiring and web-config.";
            }
            else
            {
                int flags = (b2) & 7;
                if (flags == 7)
                {
                    bIsFusing = true;
                }
                else
                {
                    bIsFusing = false;
                }

                if ((b2 & 0x8) == 0)
                {
                    bIsValid = false;
                }
                else
                {
                    bIsValid = true;
                }

                if (bIsValid == false)
                {
                    description = "Fused Heading is not valid.";
                }
                else if (bIsFusing == false)
                {
                    description = "Fused Heading is valid.";
                }
                else
                {
                    description = "Fused Heading is valid and is fusing compass.";
                }
            }

            if (status != null)
            {
                /* fill caller's struct */
                status.heading     = fusedHeading;
                status.bIsFusing   = bIsFusing;
                status.bIsValid    = bIsValid;
                status.description = description;
                status.lastError   = errCode;
            }

            HandleError(errCode);
            return(fusedHeading);
        }