예제 #1
0
 void OnMovesenseControllerCallbackEvent(object sender, MovesenseController.EventArgs e)
 {
     switch (e.Type)
     {
     case MovesenseController.EventType.NOTIFICATION:
         for (int i = 0; i < e.OriginalEventArgs.Count; i++)
         {
             var ne = (NotificationCallback.EventArgs)e.OriginalEventArgs[i];
             UpdateTransform(MovesenseDevice.ContainsSerialAt(ne.Serial), ne);
         }
         break;
     }
 }
예제 #2
0
    void OnMovesenseControllerCallbackEvent(object sender, MovesenseController.EventArgs e)
    {
                #pragma warning disable CS0162
        if (isLogging)
        {
            Debug.Log(TAG + "OnMovesenseControllerCallbackEvent, e.Type: " + e.Type);
        }
                #pragma warning restore CS0162
        switch (e.Type)
        {
        case MovesenseController.EventType.NOTIFICATION:                // got data from a sensor
                        #pragma warning disable CS0162
            if (isLogging)
            {
                Debug.Log(TAG + "OnMovesenseControllerCallbackEvent, case MovesenseController.EventType.NOTIFICATION");
            }
                        #pragma warning restore CS0162
            for (int i = 0; i < e.OriginalEventArgs.Count; i++)
            {
                var ne = (NotificationCallback.EventArgs)e.OriginalEventArgs[i];
                                #pragma warning disable CS0162
                if (isLogging)
                {
                    Debug.Log(TAG + "OnMovesenseControllerCallbackEvent, e.OriginalEventArgs[" + i + "].Data: " + ne.Data);
                }
                                #pragma warning restore CS0162
                RefreshPanelSubscription(MovesenseDevice.ContainsSerialAt(ne.Serial), ne);
            }
            break;

        case MovesenseController.EventType.CONNECTED:                   // a sensor succesfully connected (in the background)
            RefreshScrollViewContentConnectedDevices(false);
            break;

        case MovesenseController.EventType.DISCONNECTED:                // a sensor disconnected
            RefreshScrollViewContentConnectedDevices(true);

            RefreshPanelSubscription(0, null);
            break;
        }
    }