private void InitializeGloves()
        {
            m_gloveR = new CfdGlove();
            m_gloveR.Open("USB0");

            m_gloveL = new CfdGlove();
            m_gloveL.Open("USB1");
        }
Exemple #2
0
 // Use this for initialization
 void Start()
 {
     guanteObject = new CfdGlove();
     try{
         guanteObject.Open("USB0");
         light.intensity = 5.0f;
     } catch {
         light.intensity = 1.0f;
     }
 }
Exemple #3
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

        // creat the glove
        fdGlove = new CfdGlove();

        // setup the timer
        tmrUpdate           = new System.Timers.Timer();
        tmrUpdate.Elapsed  += new ElapsedEventHandler(OurTimerCallback);
        tmrUpdate.Disposed += new EventHandler(OurTimerDisposed);
        tmrUpdate.Interval  = 250;
        tmrUpdate.Enabled   = true;
    }
Exemple #4
0
 // Use this for initialization
 void Start()
 {
     glove = new CfdGlove();
     try
     {
         glove.Open("USB0");
         print("连接到驱动");
         print(getGloveType());
     }
     catch
     {
         print("连接失败");
     }
 }
Exemple #5
0
        public Client(TcpClient Client)
        {
            CfdGlove fdGlove; //Glove class

            float[] farr = new float[20];

            fdGlove = new CfdGlove(); //create a new glove
            fdGlove.Open("USB0");
            fdGlove.SetCalibration(0, 4000, 3000);

            // reading
            for (int j = 0; j < 50;)
            {
                fdGlove.GetSensorScaledAll(ref farr); //read values

                string data = "[";


                for (int i = 0; i < 18; ++i)
                {
                    Console.WriteLine("Sensor " + i + " - Scaled: " + String.Format("{0:0.00}", farr[i]));
                    string number = farr[i].ToString();

                    data += String.Format("{0:0}", farr[i]);

                    if (i != 17)
                    {
                        data += ",";
                    }
                }

                data += "]";
                byte[] Buffer = Encoding.ASCII.GetBytes(data);

                Client.GetStream().Write(Buffer, 0, Buffer.Length);
                Thread.Sleep(2000);
                Console.Clear();
            }
            // end reading


            fdGlove.Close(); //close the glove
        }
Exemple #6
0
 public frmMain()
 {
     InitializeComponent();
     fdGlove = new CfdGlove();
 }