/** * Get a parameter value from the string. * Get a parameter value from the camera status string. If it has been changed * been changed by the program, then don't update it. Program values have * precedence over those written in the camera. */ void IntCameraParameter::GetParamFromString(const char *string, int stringLength) { char resultString[150]; if (SearchForParam(m_getString, string, stringLength, resultString) >= 0) { if (!m_changed) m_value = atoi(resultString); } }
/** * Extract the parameter value from a string. * Extract the parameter value from the camera status message. * @param string The string returned from the camera. * @param length The length of the string from the camera. */ void EnumCameraParameter::GetParamFromString(const char *string, int stringLength) { char resultString[50]; if (SearchForParam(m_getString, string, stringLength, resultString) < 0) return; for (int i = 0; i < m_numChoices; i++) { if (strcmp(resultString, m_enumValues[i]) == 0) { if (!m_changed) // don't change parameter that's been set in code { m_value = i; } } } }