Example #1
0
 public void TestMemberFn_ToString_i()
 {
     var testCase = new Byte4();
     testCase.PackFrom(0.656f, 0.125f, 0.222f, 0.861f);
     String s = testCase.ToString ();
     Assert.That(s, Is.EqualTo("01000001"));
 }
Example #2
0
 public override string ToString()
 {
     return(CenterX.ToString() + ", " + CenterY.ToString() + ", " + SizeX.ToString() + ", " + SizeY.ToString() + ", " +
            NodeIndex.ToString() + ", " + NodeCount.ToString() + ", " + Short7.ToString() + ", " + Short8.ToString() + ", " +
            FloatUtil.ToString(Float1) + ", " + Byte1.ToString() + ", " + Byte2.ToString() + ", " + Byte3.ToString() + ", " + Byte4.ToString());
 }
Example #3
0
        /// <summary>
        /// Event for when the glControl1 is focused and the mouse is held down, this should be used 
        /// when navigating through the screen using the mouse.
        /// </summary>
        /// <param name="sender">The object that sent this event.</param>
        /// <param name="e">The arguments for the mouseEvent, should include the X and Y coordinates.</param>
        private void glControl1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            //IEnumerator<CurveItemTypePair> ienum = GraphInformation.CurveTypeItems.GetEnumerator();
            //while (ienum.MoveNext())
            //{
            //    ienum.Current.CurveObj.Render(true);
            //}

            Byte4 Pixel = new Byte4();
            GL.ReadPixels(e.X, glControl1.Height - e.Y, 1, 1, PixelFormat.Rgba, PixelType.UnsignedByte, ref Pixel);

            //Console.WriteLine(Pixel.ToString());

            IEnumerator<CurveItemTypePair> ienum2 = GraphInformation.CurveTypeItems.GetEnumerator();
            int igListIndex = 0;
            while (ienum2.MoveNext())
            {
                CurveItemTypePair curr = ienum2.Current;
                if (curr.CurveObj.m_colorID[0] == Pixel.R
                    && curr.CurveObj.m_colorID[1] == Pixel.G
                    && curr.CurveObj.m_colorID[2] == Pixel.B)
                {
                    CurrentFileIndex = igListIndex;
                }
                igListIndex++;
            }
            Console.WriteLine(Pixel.ToString());
            Console.WriteLine(CurrentFileIndex);

            MousePressed = true;
        }
Example #4
0
 /// <summary>
 /// 转为T28181云台控制命令
 /// </summary>
 /// <returns></returns>
 public override string ToString()
 {
     return(Byte1.ToString("X2") + Byte2.ToString("X2") + Byte3.ToString("X2") + Byte4.ToString("X2") +
            Byte5.ToString("X2") + Byte6.ToString("X2") + Byte7.ToString("X2") + Byte8.ToString("X2"));
 }