Example #1
0
            /// <summary>
            /// JointName is only checked if in both objects JointName is not NULL. Everything else is checked regardless
            /// </summary>
            /// <param name="obj"></param>
            /// <returns></returns>
            public override bool Equals(object obj)
            {
                if (!(obj is BoneAnimation animation))
                {
                    return(false);
                }
                bool result = TranslationX.SequenceEqual(animation.TranslationX) &&
                              TranslationY.SequenceEqual(animation.TranslationY) &&
                              TranslationZ.SequenceEqual(animation.TranslationZ) &&
                              RotationX.SequenceEqual(animation.RotationX) &&
                              RotationY.SequenceEqual(animation.RotationY) &&
                              RotationZ.SequenceEqual(animation.RotationZ) &&
                              ScaleX.SequenceEqual(animation.ScaleX) &&
                              ScaleY.SequenceEqual(animation.ScaleY) &&
                              ScaleZ.SequenceEqual(animation.ScaleZ);

                return(result && ((JointName != null && animation.JointName != null) ? JointName.Equals(animation.JointName) : true));
            }
Example #2
0
        public string GetHtmlString()
        {
            // #0: display-name, #1: id-label, #2: display-value, #3: css-classes (separate with spaces)
            string htmlFormat = "<div class='row'><div class='col-md-4 col-md-offset-1'>{0}:</div><div class='col-md-2'><label id='{1}' class='val-info {3}'>{2}</label></div></div>";

            StringBuilder builder = new StringBuilder();

            builder.AppendFormat(htmlFormat, "Status", "mouse-status", IsConnected ? "OK" : "KO", IsConnected ? "status-ok" : "status-ko");
            builder.AppendFormat(htmlFormat, "Calibration", "mouse-calibration", IsCalibrated ? "OK" : "KO", IsCalibrated ? "status-ok" : "status-ko");
            builder.AppendFormat(htmlFormat, "Translation X", "mouse-transx", TranslationX.ToString(), string.Empty);
            builder.AppendFormat(htmlFormat, "Translation Y", "mouse-trany", TranslationY.ToString(), string.Empty);
            builder.AppendFormat(htmlFormat, "Translation Z", "mouse-transz", TranslationZ.ToString(), string.Empty);
            builder.AppendFormat(htmlFormat, "Rotation X", "mouse-rotx", RotationX, string.Empty);
            builder.AppendFormat(htmlFormat, "Rotation Y", "mouse-roty", RotationY, string.Empty);
            builder.AppendFormat(htmlFormat, "Rotation Z", "mouse-rotz", RotationZ, string.Empty);
            builder.AppendFormat(htmlFormat, "Angle", "mouse-angle", Angle, string.Empty);
            builder.AppendFormat(htmlFormat, "Treshold", "mouse-treshold", Treshold, string.Empty);

            return(builder.ToString());
        }