private static void measure() { _connectedMtwData.Clear(); foreach (var detectedDevices in _xda._DetectedDevices) { _measuringDevice = _xda.getDevice(detectedDevices.deviceId()); _measuringDevice.gotoMeasurement(); var deviceIds = _measuringDevice.children(); for (uint i = 0; i < deviceIds.size(); i++) { var trackingDevice = new XsDevice(deviceIds.at(i)); var callback = new MyMtCallback(); var mtwData = new ConnectedMtData(); _connectedMtwData.Add(trackingDevice.deviceId().toInt(), mtwData); // connect signals callback.DataAvailable += new EventHandler <DataAvailableArgs>(_callbackHandler_DataAvailable); trackingDevice.addCallbackHandler(callback); _measuringMts.Add(trackingDevice, callback); logger.Log($"Completed setting up tracker {trackingDevice.deviceId().toInt().ToString()} for measuring."); } logger.Log($"Completed setting up device {detectedDevices.deviceId().toInt().ToString()} for measuring."); } }
private void CheckForMTWConnections() { if (_acceptNewMTWs) { int nextCount = _masterDevice.childCount(); if (nextCount != _totalConnectedMTWs) { UnityEngine.Debug.Log("Number of connected MTWs: " + nextCount); _totalConnectedMTWs = nextCount; XsDevicePtrArray deviceIds = _masterDevice.children(); for (uint i = 0; i < deviceIds.size(); i++) { XsDevice dev = new XsDevice(deviceIds.at(i)); UnityEngine.Debug.Log(string.Format("Device {0} ({1})", i, dev.deviceId().toInt())); } } } }