/**
 * @brief Return the array name
 * @return AffxString - The array name
 */
AffxString CNReporter::getArrayName()
{
  AffxString strArrayName;
  if (m_pEngine->getOpt("array-name") == "") {
    if ((m_pEngine->isOptDefined("cdf-file")) && (m_pEngine->getOpt("cdf-file") != "")) {
      strArrayName = Fs::basename(m_pEngine->getOpt("cdf-file"));
      int iFindIndex = strArrayName.indexOf(".");
      if (iFindIndex != -1) {
        strArrayName = strArrayName.substring(0, iFindIndex);
      }
    } else if ((m_pEngine->isOptDefined("spf-file")) && (m_pEngine->getOpt("spf-file") != "")) {
      strArrayName = Fs::basename(m_pEngine->getOpt("spf-file"));
      int iFindIndex = strArrayName.indexOf(".");
      if (iFindIndex != -1) {
        strArrayName = strArrayName.substring(0, iFindIndex);
      }
    } else {
      if (m_pEngine->isOptDefined("annotation-file")) {
        strArrayName =  Fs::basename(m_pEngine->getOpt("annotation-file"));
        int iFindIndex = strArrayName.indexOf(".");
        if (iFindIndex != -1) {
          strArrayName = strArrayName.substring(0, iFindIndex);
        }
      }
    }
  } else {
    strArrayName = m_pEngine->getOpt("array-name");
  }
  return strArrayName;
}
void CNReporter::loadParam(const AffxString& strName, PgOpt::PgOptType type, const AffxString& strValue, affymetrix_calvin_parameter::ParameterNameValueType& param)
{
  param.SetName(StringUtils::ConvertMBSToWCS(strName));
  switch (type) {
  case PgOpt::BOOL_OPT: param.SetValueInt8(((strValue == "true") ? (char)1 : (char)0)); break;
  case PgOpt::DOUBLE_OPT: param.SetValueFloat((float)::getDouble(strValue)); break;
  case PgOpt::INT_OPT: param.SetValueInt32(::getInt(strValue)); break;
  case PgOpt::STRING_OPT:
    if ((strName.indexOf("command-line") != -1) || (strName.indexOf("analysis") != -1) || (strName.indexOf("program-cvs-id") != -1) || (strName.indexOf("version-to-report") != -1) || (strName.endsWith("-dir"))) {
      param.SetValueText(StringUtils::ConvertMBSToWCS(strValue));
    } else {
      param.SetValueText(StringUtils::ConvertMBSToWCS(Fs::basename(strValue)));
    }
    break;
  default: throw(Except("Cannot find PgOpt type for: " + strName));
  }
}