Пример #1
0
        public GloveModel()
        {
            gc = GloveController.GetSingleton(ModelType.HandOnly);
            //            var mLogger = Logger.GetInstance(mw.txt_log);
            //            gc.RegisterLogger(mLogger);

            //if (!gc.IsConnected((int)handType)) //接入手套
            //{
            //    gc.Connect(chuankou, 0);       //连接手套和串口
            //}
            rhb             = Rehabilitation.GetSingleton();
            dh              = DataWarehouse.GetSingleton();
            sc              = SkeletonCalculator.GetSingleton("");
            handinformation = HandInf.GetSingleton();

            OptimizedData = HandInf.GetSingleton();

            fram       = new SkeletonJson();
            Mychuankou = "COM3";


            //pullDataTimer = new Timer(500);
            //pullDataTimer.Elapsed += pullDataTimer_Tick;
            //pullDataTimer.Start();
        }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     m_targetGlove = m_targetGlove.GetComponent <GloveController>();
     m_slider      = GetComponent <BarSlider>();
     m_frame       = GetComponent <UIFrame>();
     m_frame.SetLabel(m_targetGlove.GetGestureName(m_gestureindex));
 }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        m_rollingAverage = new List <double[]>();
        m_glove          = GetComponent <GloveController>();

        foreach (string gesture in m_glove.gestureTypes)
        {
            animation.Play(gesture);
            animation[gesture].layer     = 1;
            animation[gesture].blendMode = AnimationBlendMode.Blend;
        }
    }
Пример #4
0
    // Initialization
    //------------------
    void Awake()
    {
        m_instance = this;

        //Collision lists
        m_leftInstrumentProximity  = new List <GameObject>();
        m_rightInstrumentProximity = new List <GameObject>();
        m_leftInstrumentInterior   = new List <GameObject>();
        m_rightInstrumentInterior  = new List <GameObject>();
        m_leftHandHydra            = m_leftHand.GetComponent <HydraHand>();
        m_rightHandHydra           = m_rightHand.GetComponent <HydraHand>();

        m_leftGlove  = m_leftHand.GetComponent <GloveController>();
        m_rightGlove = m_rightHand.GetComponent <GloveController>();
    }
Пример #5
0
        private GloveModule(MainWindow mw)
        {
            this.mw = mw;
            gc      = GloveController.GetSingleton(ModelType.HandOnly);
            var mLogger = Logger.GetInstance(mw.txt_log);

            gc.RegisterLogger(mLogger);
            rhb = Rehabilitation.GetSingleton();
            dh  = DataWarehouse.GetSingleton();
            string[] ports = gc.GetPorts();
            if (ports.Length > 0)
            {
                ports.ToList().ForEach(n => mw.cbb_port.Items.Add(n));
                mw.cbb_port.SelectedItem = mw.cbb_port.Items[mw.cbb_port.Items.Count - 1];
            }
            // socket module
            sm = SocketManager.GetInstance();
            sm.Start(10200);
            sc                     = SkeletonCalculator.GetSingleton("");
            pullDataTimer          = new Timer(10);
            pullDataTimer.Elapsed += pullDataTimer_Tick;
            pullDataTimer.Start();
        }
Пример #6
0
 public virtual void Awake()
 {
     m_toolHandState   = BaseTool.HandState.SEARCHING;
     m_gloveController = GetComponent <GloveController>();
     m_targets         = new List <object>();
 }
Пример #7
0
    /*
     * Common tools for each hand
     */
    public void SetCommonTools(BaseTool.ToolHand hand)
    {
        GloveController m_glove = GetGloveController(hand);

        //Physics selector
        //------------
        if (m_glove.GetGestureDown("CLOSED_HAND") || Input.GetKeyDown(KeyCode.LeftControl))
        {
            ToolController.Instance.PushTool(typeof(InstrumentGestureTool), hand, BaseTool.ToolMode.GRABBING);
        }

        //Physics pull
        //------------
        if (m_glove.GetGestureDown("PINKY") || Input.GetKeyDown(KeyCode.LeftShift))
        {
            ToolController.Instance.PushTool(typeof(InstrumentGestureTool), hand, BaseTool.ToolMode.TERTIARY);
        }

//		else if(m_glove.GetGestureDown("THREE_SWIPE") || Input.GetKeyDown(KeyCode.LeftShift)){
//			ToolController.Instance.PushTool(typeof(InstrumentGestureTool), hand, BaseTool.ToolMode.TERTIARY);
//		}

        //Gesture Selector Primary
        //--------------------
        else if (m_glove.GetGestureDown("INDEX_POINT") || Input.GetKeyDown(KeyCode.W))
        {
            ToolController.Instance.PushTool(typeof(InstrumentGestureTool), hand, BaseTool.ToolMode.PRIMARY);
        }

        //Gesture selector secondary
        //--------------------
        else if (m_glove.GetGestureDown("INDEX_MIDDLE") || Input.GetKeyDown(KeyCode.E))
        {
            ToolController.Instance.PushTool(typeof(InstrumentGestureTool), hand, BaseTool.ToolMode.SECONDARY);
        }

        else if (m_glove.GetGestureDown("ROCK_ON") || Input.GetKeyDown(KeyCode.S))
        {
            ToolController.Instance.PushTool(typeof(InstrumentGestureTool), hand, BaseTool.ToolMode.TERTIARY);
        }

        //Fingerplay gestures
        if (m_glove.GetGestureDown("PLAY_1"))
        {
            ToolController.Instance.PushTool(typeof(InstrumentGestureTool), hand, BaseTool.ToolMode.PLAY1);
        }
        else if (m_glove.GetGestureDown("PLAY_2"))
        {
            ToolController.Instance.PushTool(typeof(InstrumentGestureTool), hand, BaseTool.ToolMode.PLAY2);
        }
        else if (m_glove.GetGestureDown("PLAY_3"))
        {
            ToolController.Instance.PushTool(typeof(InstrumentGestureTool), hand, BaseTool.ToolMode.PLAY3);
        }
        else if (m_glove.GetGestureDown("PLAY_4"))
        {
            ToolController.Instance.PushTool(typeof(InstrumentGestureTool), hand, BaseTool.ToolMode.PLAY4);
        }

        //Return to idle
        //--------------
        if (m_glove.GetGestureDown("IDLE_HAND"))
        {
            //ToolController.Instance.PopTool(hand);
            ToolController.Instance.PushTool(typeof(InstrumentGestureTool), hand, BaseTool.ToolMode.IDLE);
            m_glove.SetCollider(m_glove.activeGesture);
        }
    }
Пример #8
0
 private ControlServerManage()
 {
     gc = GloveModule.GetSingleton().gc;
 }