HRESULT readingChanged(IInclinometer *, IInclinometerReadingChangedEventArgs *args) { ComPtr<IInclinometerReading> value; HRESULT hr = args->get_Reading(&value); if (FAILED(hr)) { qCWarning(lcWinRtSensors) << "Failed to get rotation reading" << qt_error_string(hr); return hr; } FLOAT x; hr = value->get_PitchDegrees(&x); if (FAILED(hr)) qCWarning(lcWinRtSensors) << "Failed to get rotation X" << qt_error_string(hr); FLOAT y; hr = value->get_RollDegrees(&y); if (FAILED(hr)) qCWarning(lcWinRtSensors) << "Failed to get rotation Y" << qt_error_string(hr); FLOAT z; hr = value->get_YawDegrees(&z); if (FAILED(hr)) qCWarning(lcWinRtSensors) << "Failed to get rotation Z" << qt_error_string(hr); DateTime dateTime; hr = value->get_Timestamp(&dateTime); if (FAILED(hr)) qCWarning(lcWinRtSensors) << "Failed to get rotation timestamp" << qt_error_string(hr); reading.setFromEuler(x, y, z); reading.setTimestamp(dateTimeToMsSinceEpoch(dateTime)); q->newReadingAvailable(); return S_OK; }
static PyObject *meth_QRotationReading_setFromEuler(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { qreal a0; qreal a1; qreal a2; QRotationReading *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "Bddd", &sipSelf, sipType_QRotationReading, &sipCpp, &a0, &a1, &a2)) { sipCpp->setFromEuler(a0,a1,a2); Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QRotationReading, sipName_setFromEuler, doc_QRotationReading_setFromEuler); return NULL; }