示例#1
0
        static void testOne()
        {
            OpenGloveAPI api    = OpenGloveAPI.GetInstance();
            var          gloves = api.Devices;

            foreach (var glove in gloves)
            {
                for (int i = 0; i < 1001; i++)
                {
                    Stopwatch sw = new Stopwatch();
                    sw.Restart();
                    api.Activate(glove, (int)PalmarRegion.FingerIndexDistal, 255);
                    sw.Stop();
                    System.IO.File.AppendAllText(@"C:\Users\Sebastian\Documents\Tesis\pruebas\CS-API.txt", (sw.ElapsedTicks * 1000000 / Stopwatch.Frequency).ToString() + "\r\n");
                    Console.WriteLine("Test pass: UP " + i);
                    Thread.Sleep(250);

                    sw.Restart();
                    api.Activate(glove, (int)PalmarRegion.FingerIndexDistal, 0);
                    sw.Stop();
                    System.IO.File.AppendAllText(@"C:\Users\Sebastian\Documents\Tesis\pruebas\CS-API.txt", (sw.ElapsedTicks * 1000000 / Stopwatch.Frequency).ToString() + "\r\n");
                    Console.WriteLine("Test pass: DOWN " + i);
                    Thread.Sleep(250);
                }
                break;
            }
        }
示例#2
0
        static void testMany(int amount)
        {
            OpenGloveAPI api    = OpenGloveAPI.GetInstance();
            var          gloves = api.Devices;

            List <int> regions = new List <int>();

            List <int> upInit = new List <int>();

            List <int> downInit = new List <int>();

            for (int i = 0; i < amount; i++)
            {
                regions.Add(i);
                upInit.Add(255);
                downInit.Add(0);
            }

            //thumb
            regions.Add((int)PalmarRegion.FingerThumbDistal);
            upInit.Add(255);
            downInit.Add(0);

            //palm
            regions.Add((int)PalmarRegion.ThenarIndex);
            upInit.Add(255);
            downInit.Add(0);

            foreach (var glove in gloves)
            {
                for (int i = 0; i < 1000; i++)
                {
                    Stopwatch sw = new Stopwatch();
                    sw.Restart();
                    api.Activate(glove, regions, upInit);
                    sw.Stop();
                    System.IO.File.AppendAllText(@"C:\Users\Sebastian\Documents\Tesis\pruebas\CS-API.txt", (sw.ElapsedTicks * 1000000 / Stopwatch.Frequency).ToString() + "\r\n");
                    Console.WriteLine("Test pass: UP " + i);
                    Thread.Sleep(250);

                    sw.Restart();
                    api.Activate(glove, regions, downInit);
                    sw.Stop();
                    System.IO.File.AppendAllText(@"C:\Users\Sebastian\Documents\Tesis\pruebas\CS-API.txt", (sw.ElapsedTicks * 1000000 / Stopwatch.Frequency).ToString() + "\r\n");
                    Console.WriteLine("Test pass: DOWN " + i);
                    Thread.Sleep(250);
                }
                break;
            }
        }
示例#3
0
 public void OnMouseDown()
 {
     try
     {
         gloves = api.Devices;
         Debug.Log("dsadas");
         Debug.Log(gloves);
     }
     catch
     {
         Debug.Log("ERROR: El servicio no esta activo");
     }
     guante = gloves[1];
     api.Activate(guante, 1, 255);
     GetComponent <Rigidbody>().useGravity = false;
     this.transform.position = theDest.position;
     this.transform.parent   = GameObject.Find("Destination").transform;
 }
 public void OnMouseDown()
 {
     try
     {
         gloves = api.Devices;
         Debug.Log("dsadas");
         Debug.Log(gloves);
     }
     catch
     {
         Debug.Log("ERROR: El servicio no esta activo");
     }
     //List<int> regions = new List<int>() { 0, 1, 2, 3, 25, 18 };
     //List<int> intensity = new List<int>() { 255, 255, 255, 255, 255, 255 };
     Debug.Log("ssss");
     guante = gloves[0];
     api.Activate(guante, regions, intensity);
     GetComponent <Rigidbody>().useGravity = false;
     this.transform.position = theDest.position;
     this.transform.parent   = GameObject.Find("Destination").transform;
 }
示例#5
0
 public void ActiveMotorRegions(int[] regions, int impact, OpenGlove_API_C_Sharp_HL.ServiceReference1.Glove glove)
 {
     if (glove != null)
     {
         foreach (int region in regions)
         {
             openGloveAPI.Activate(glove, region, 255);
         }
     }
 }