コード例 #1
0
void TParamContainer::link(const TParamContainer *src) {
  assert(getParamCount() == src->getParamCount());
  for (int i = 0; i < getParamCount(); i++) {
    assert(getParamName(i) == src->getParamName(i));
    assert(m_imp->m_vars[i]->getName() == getParamName(i));
    m_imp->m_vars[i]->setParam(src->getParam(i));
  }
}
コード例 #2
0
void TColorStyle::assignBlend(const TColorStyle &a, const TColorStyle &b,
                              double t) {
  // Blend colors
  {
    int col, colCount = getColorParamCount();
    assert(a.getColorParamCount() == colCount &&
           b.getColorParamCount() == colCount);

    for (col = 0; col != colCount; ++col)
      setColorParamValue(
          col, blend(a.getColorParamValue(col), b.getColorParamValue(col), t));
  }

  // Blend parameters
  {
    int par, parCount = getParamCount();
    assert(a.getParamCount() == parCount && b.getParamCount() == parCount);

    for (par = 0; par != parCount; ++par) {
      switch (getParamType(par)) {
      case DOUBLE:
        setParamValue(par, (1 - t) * a.getParamValue(double_tag(), par) +
                               t * b.getParamValue(double_tag(), par));
        break;
      default:
        break;
      }
    }
  }

  invalidateIcon();
}
コード例 #3
0
void XsldbgConfigImpl::slotNextParam()
{
	addParam(parameterNameEdit->text(), parameterValueEdit->text());
	if (paramIndex < getParamCount())
		paramIndex++;

   repaintParam();
}
void SmsPluginSetting::getParamList(MSG_SMSC_LIST_S *pSMSCList)
{
	MSG_BEGIN();

	int paramCnt = 0;

	paramCnt = getParamCount();

	MSG_DEBUG("Parameter Count [%d]", paramCnt);

	int ret = TAPI_API_SUCCESS;
	int reqId = 0;

	MSG_SMSC_DATA_S tmpSmscData = {};

	for (int index = 0; index < paramCnt; index++)
	{
		ret = tel_get_sms_parameters(pTapiHandle, index, TapiEventGetParam, NULL);

		if (ret == TAPI_API_SUCCESS)
		{
			MSG_DEBUG("######## tel_get_sms_parameters() Success !!! #######");
		}
		else
		{
			THROW(MsgException::SMS_PLG_ERROR, "######## tel_get_sms_parameters() Fail !!! return : %d #######", ret);
		}

		if (getParamEvent(&tmpSmscData) == true)
		{
			MSG_DEBUG("######## Get Parameter was Successful !!! #######");
		}
		else
		{
		 	THROW(MsgException::SMS_PLG_ERROR, "######## Get Parameter was Failed !!! #######");
		}

		memcpy(&(pSMSCList->smscData[index]), &tmpSmscData, sizeof(MSG_SMSC_DATA_S));

		MSG_DEBUG("pid[%d]", pSMSCList->smscData[index].pid);
		MSG_DEBUG("val_period[%d]", pSMSCList->smscData[index].valPeriod);
		MSG_DEBUG("name[%s]", pSMSCList->smscData[index].name);

		MSG_DEBUG("ton[%d]", pSMSCList->smscData[index].smscAddr.ton);
		MSG_DEBUG("npi[%d]", pSMSCList->smscData[index].smscAddr.npi);
		MSG_DEBUG("address[%s]", pSMSCList->smscData[index].smscAddr.address);
	}

	pSMSCList->totalCnt = paramCnt;
	pSMSCList->selected = selectedParam;

	MSG_DEBUG("total_count[%d]", pSMSCList->totalCnt);

	MSG_END();
}
コード例 #5
0
void XsldbgConfigImpl::repaintParam()
{
	if (paramIndex < getParamCount()){
		LibxsltParam *param = getParam(paramIndex);
		parameterNameEdit->setText(param->getName());
		parameterValueEdit->setText(param->getValue());
	}else{
		parameterNameEdit->setText("");
		parameterValueEdit->setText("");
	}
}
コード例 #6
0
void TParamContainer::unlink() {
  for (int i = 0; i < getParamCount(); i++) {
    // TRangeParam *p0;//,*p1;
    TParamVar *var = m_imp->m_vars[i];
    TParam *param  = var->getParam();
    // p0 = dynamic_cast<TRangeParam *>(param);
    var->setParam(param->clone());
    /*p1 = dynamic_cast<TRangeParam *>(var->getParam());
if(p0 && p1)
{
string name = p0->getName();
name = p1->getName();
}*/
  }
}
コード例 #7
0
bool TColorStyle::operator==(const TColorStyle &cs) const {
  if (getTagId() != cs.getTagId()) return false;

  if (getMainColor() != cs.getMainColor()) return false;

  int paramCount = getParamCount();
  if (paramCount != cs.getParamCount()) return false;

  int colorParamCount = getColorParamCount();
  if (colorParamCount != cs.getColorParamCount()) return false;

  if (m_name != cs.getName()) return false;
  if (m_originalName != cs.getOriginalName()) return false;
  if (m_globalName != cs.getGlobalName()) return false;
  if (m_isEditedFromOriginal != cs.getIsEditedFlag()) return false;
  if (m_pickedPosition != cs.getPickedPosition()) return false;
  if (m_flags != cs.getFlags()) return false;

  for (int p = 0; p < colorParamCount; ++p)
    if (getColorParamValue(p) != cs.getColorParamValue(p)) return false;

  for (int p = 0; p < paramCount; ++p) {
    switch (getParamType(p)) {
    case BOOL:
      if (getParamValue(bool_tag(), p) != cs.getParamValue(bool_tag(), p))
        return false;
      break;
    case INT:
    case ENUM:
      if (getParamValue(int_tag(), p) != cs.getParamValue(int_tag(), p))
        return false;
      break;
    case DOUBLE:
      if (getParamValue(double_tag(), p) != cs.getParamValue(double_tag(), p))
        return false;
      break;
    case FILEPATH:
      if (getParamValue(TFilePath_tag(), p) !=
          cs.getParamValue(TFilePath_tag(), p))
        return false;
      break;
    default:
      assert(false);
    }
  }

  return true;
}
void SmsPluginSetting::initConfigData(MSG_SIM_STATUS_T SimStatus)
{
	MSG_BEGIN();

	msg_error_t	err = MSG_SUCCESS;

	// Init SMS Parameter
	int paramCnt = 0;
	int failCnt = 0;

	paramCnt = getParamCount();

	MSG_DEBUG("Parameter Count [%d]", paramCnt);

	MSG_SMSC_DATA_S tmpSmscData = {};
	MSG_SMSC_LIST_S tmpSmscList = {};

	for (int index = 0; index < paramCnt; index++)
	{
		if (getParam(index, &tmpSmscData) == false)
		{
			failCnt++;
			continue;
		}

		memcpy(&(tmpSmscList.smscData[index]), &tmpSmscData, sizeof(MSG_SMSC_DATA_S));

		MSG_DEBUG("pid[%d]", tmpSmscList.smscData[index].pid);
		MSG_DEBUG("val_period[%d]", tmpSmscList.smscData[index].valPeriod);
		MSG_DEBUG("name[%s]", tmpSmscList.smscData[index].name);

		MSG_DEBUG("ton[%d]", tmpSmscList.smscData[index].smscAddr.ton);
		MSG_DEBUG("npi[%d]", tmpSmscList.smscData[index].smscAddr.npi);
		MSG_DEBUG("address[%s]", tmpSmscList.smscData[index].smscAddr.address);
	}

	tmpSmscList.totalCnt = (paramCnt - failCnt);
	tmpSmscList.selected = selectedParam;

	if (paramCnt > 0)
	{
		err = addSMSCList(&tmpSmscList);

		if (err == MSG_SUCCESS)
		{
			MSG_DEBUG("########  Add SMSC List Success !!! #######");
		}
		else
		{
			MSG_DEBUG("########  Add SMSC List Fail !!! return : %d #######", err);
		}
	}

	// Init CB Config
	if (SimStatus == MSG_SIM_STATUS_CHANGED)
	{
		MSG_DEBUG("simStatus == MSG_SIM_STATUS_CHANGED");

		MSG_CBMSG_OPT_S cbMsgOpt = {};

		if (getCbConfig(&cbMsgOpt) == true)
		{
			err = addCbOpt(&cbMsgOpt);

			if (err == MSG_SUCCESS)
			{
				MSG_DEBUG("########  Add CB Option Success !!! #######");
			}
			else
			{
				MSG_DEBUG("########  Add CB Option Fail !!! return : %d #######", err);
			}
		}
	}
	else if (SimStatus == MSG_SIM_STATUS_NORMAL)
	{
		MSG_DEBUG("simStatus == MSG_SIM_STATUS_NORMAL");

		// Set CB Data into SIM in case of same SIM
		MSG_SETTING_S cbSetting;
		cbSetting.type = MSG_CBMSG_OPT;

		getCbOpt(&cbSetting);

		setCbConfig(&(cbSetting.option.cbMsgOpt));
	}

	MSG_END();
}
コード例 #9
0
const TParamVar *TParamContainer::getParamVar(int index) const
{
	assert(0 <= index && index < getParamCount());
	return m_imp->m_vars[index];
}
コード例 #10
0
string TParamContainer::getParamName(int index) const
{
	assert(0 <= index && index < getParamCount());
	return m_imp->m_vars[index]->getName();
}
コード例 #11
0
bool TParamContainer::isParamHidden(int index) const
{
	assert(0 <= index && index < getParamCount());
	return m_imp->m_vars[index]->isHidden();
}