Merge pull request #5584 from sethalves/fix-eye-calibration-saving

re-enabled ctrlaltdavid's eye calibration code
This commit is contained in:
Philip Rosedale 2015-08-17 14:49:44 -07:00
commit 31e4878902

View file

@ -153,21 +153,20 @@ void EyeTracker::onStreamStarted() {
qCDebug(interfaceapp) << "Eye Tracker: Started streaming"; qCDebug(interfaceapp) << "Eye Tracker: Started streaming";
} }
// TODO: Re-enable once saving / loading calibrations is working if (_isStreaming) {
//if (_isStreaming) { // Automatically load calibration if one has been saved.
// // Automatically load calibration if one has been saved. QString availableCalibrations = QString(smi_getAvailableCalibrations());
// QString availableCalibrations = QString(smi_getAvailableCalibrations()); if (availableCalibrations.contains(HIGH_FIDELITY_EYE_TRACKER_CALIBRATION)) {
// if (availableCalibrations.contains(HIGH_FIDELITY_EYE_TRACKER_CALIBRATION)) { result = smi_loadCalibration(HIGH_FIDELITY_EYE_TRACKER_CALIBRATION);
// result = smi_loadCalibration(HIGH_FIDELITY_EYE_TRACKER_CALIBRATION); if (result != SMI_RET_SUCCESS) {
// if (result != SMI_RET_SUCCESS) { qCWarning(interfaceapp) << "Eye Tracker: Error loading calibration:" << smiReturnValueToString(result);
// qCWarning(interfaceapp) << "Eye Tracker: Error loading calibration:" << smiReturnValueToString(result); QMessageBox::warning(nullptr, "Eye Tracker Error", "Error loading calibration"
// QMessageBox::warning(nullptr, "Eye Tracker Error", "Error loading calibration" + smiReturnValueToString(result));
// + smiReturnValueToString(result)); } else {
// } else { qCDebug(interfaceapp) << "Eye Tracker: Loaded calibration";
// qCDebug(interfaceapp) << "Eye Tracker: Loaded calibration"; }
// } }
// } }
//}
} }
#endif #endif
@ -260,11 +259,10 @@ void EyeTracker::calibrate(int points) {
if (result != SMI_RET_SUCCESS) { if (result != SMI_RET_SUCCESS) {
qCWarning(interfaceapp) << "Eye Tracker: Error performing calibration:" << smiReturnValueToString(result); qCWarning(interfaceapp) << "Eye Tracker: Error performing calibration:" << smiReturnValueToString(result);
} else { } else {
// TODO: Re - enable once saving / loading calibrations is working result = smi_saveCalibration(HIGH_FIDELITY_EYE_TRACKER_CALIBRATION);
//result = smi_saveCalibration(HIGH_FIDELITY_EYE_TRACKER_CALIBRATION); if (result != SMI_RET_SUCCESS) {
//if (result != SMI_RET_SUCCESS) { qCWarning(interfaceapp) << "Eye Tracker: Error saving calibration:" << smiReturnValueToString(result);
// qCWarning(interfaceapp) << "Eye Tracker: Error saving calibration:" << smiReturnValueToString(result); }
//}
} }
} }
@ -292,11 +290,10 @@ QString EyeTracker::smiReturnValueToString(int value) {
return "Eye cameras not available"; return "Eye cameras not available";
case smi_ErrorReturnValue::SMI_ERROR_OCULUS_RUNTIME_NOT_SUPPORTED: case smi_ErrorReturnValue::SMI_ERROR_OCULUS_RUNTIME_NOT_SUPPORTED:
return "Oculus runtime not supported"; return "Oculus runtime not supported";
// TODO: Re-enable once saving / loading calibrations is working case smi_ErrorReturnValue::SMI_ERROR_FILE_NOT_FOUND:
//case smi_ErrorReturnValue::SMI_ERROR_FILE_NOT_FOUND: return "File not found";
// return "File not found"; case smi_ErrorReturnValue::SMI_ERROR_FILE_EMPTY:
//case smi_ErrorReturnValue::SMI_ERROR_FILE_EMPTY: return "File empty";
// return "File empty";
case smi_ErrorReturnValue::SMI_ERROR_UNKNOWN: case smi_ErrorReturnValue::SMI_ERROR_UNKNOWN:
return "Unknown error"; return "Unknown error";
default: default: