• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ModelException函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ModelException函数的典型用法代码示例。如果您正苦于以下问题:C++ ModelException函数的具体用法?C++ ModelException怎么用?C++ ModelException使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ModelException函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: sk

void SUR_GA::SetValue(const char *key, float value)
{
    string sk(key);

    if (StringMatch(sk, "ThreadNum"))
    {
        omp_set_num_threads((int) value);
    }
    else if (StringMatch(sk, "TimeStep"))
    {
        m_TimeStep = value * 60; //hour -> mimute
    }
    else if (StringMatch(sk, "T_snow"))
    {
        m_Tsnow = value;
    }
    else if (StringMatch(sk, "t_soil"))
    {
        m_Tsoil = value;
    }
    else if (StringMatch(sk, "T0"))
    {
        m_T0 = value;
    }
    else if (StringMatch(sk, "s_frozen"))
    {
        this->m_Sfrozen = value;
    }
    else
        throw ModelException("SUR_GA", "SetValue", "Parameter " + sk
                                                   +
                                                   " does not exist in SUR_GA method. Please contact the module developer.");

}
开发者ID:Shenfang1993,项目名称:SEIMS,代码行数:34,代码来源:SUR_GA.cpp


示例2: ModelException

void Model::pushCommandOnUndoStack(UndoCommand* command)
{
	if ( !modificationInProgress )
		throw ModelException("Changing the application tree without calling Model.beginModification() first");
	if ( performedUndoRedo )
		throw ModelException("Trying to execute new commands after performing an Undo or a Redo operation.");

	if ( pushedNewCommandsOnTheStack == false )
	{
		pushedNewCommandsOnTheStack = true;
		commands.beginMacro(modificationText);
	}

	commands.push(command);
	if (command->target()) commands.push(new AddModifiedNode(modifiedTargets, command->target()));
}
开发者ID:JurajKubelka,项目名称:Envision,代码行数:16,代码来源:Model.cpp


示例3: ModelException

void Integer::load(PersistentStore &store)
{
	if (store.currentNodeType() != typeName())
		throw ModelException("Trying to load an Integer node from an incompatible node type " + store.currentNodeType());

	set(store.loadIntValue());
}
开发者ID:JurajKubelka,项目名称:Envision,代码行数:7,代码来源:Integer.cpp


示例4: ModelException

void SUR_GA::initalOutputs()
{
    if (m_cellSize <= 0)
        throw ModelException("SUR_GA", "CheckInputData", "The dimension of the input data can not be less than zero.");
    // allocate the output variables
    if (this->m_PE == NULL)
    {
        this->m_PE = new float[this->m_cellSize];
    }
    if (this->m_INFIL == NULL)
    {
        this->m_INFIL = new float[this->m_cellSize];
    }
    // initialization
    for (int i = 0; i < m_cellSize; i++)
    {
        m_PE[i] = 0.0f;
        m_INFIL[i] = 0.0f;
    }

    if (this->m_w1 == NULL) initalW1W2();
    if (this->m_wfmp == NULL) this->initialWFMP();
    if (this->m_INFRate == NULL)
    {
        this->m_INFRate = new float[this->m_cellSize];
        for (int iCell = 0; iCell < m_cellSize; iCell++)
            this->m_INFRate[iCell] = 0.0f;
    }
}
开发者ID:Shenfang1993,项目名称:SEIMS,代码行数:29,代码来源:SUR_GA.cpp


示例5: ModelException

void Float::load(PersistentStore &store)
{
	if (store.currentNodeType() != typeName())
		throw ModelException("Trying to load a Float node from an incompatible node type " + store.currentNodeType());

	set(store.loadDoubleValue());
}
开发者ID:Andresbu,项目名称:Envision,代码行数:7,代码来源:Float.cpp


示例6: Node

Character::Character(Node *parent, PersistentStore &store, bool) :
	Node(parent)
{
	QString t = store.loadStringValue();
	if (t.size() != 1) throw ModelException("Creating character node failed. Invalid persistent store data: " + t);

	value = t[0];
}
开发者ID:Andresbu,项目名称:Envision,代码行数:8,代码来源:Character.cpp


示例7: ModelException

bool UnsaturatedFlow::CheckInputSize(const char *key, int n) {
    if (n <= 0) {
        throw ModelException("UnsaturatedFlow", "CheckInputSize",
                             "Input data for " + string(key) + " is invalid. The size could not be less than zero.");
        return false;
    }
    if (this->m_cellSize != n) {
        if (this->m_cellSize <= 0) { this->m_cellSize = n; }
        else {
            throw ModelException("UnsaturatedFlow", "CheckInputSize", "Input data for " + string(key) +
                " is invalid. All the input data should have same size.");
            return false;
        }
    }

    return true;
}
开发者ID:crazyzlj,项目名称:SEIMS,代码行数:17,代码来源:UnsaturatedFlow.cpp


示例8: ModelException

void Boolean::load(PersistentStore &store)
{
	if (store.currentNodeType() != typeName())
		throw ModelException("Trying to load an Boolean node from an incompatible node type " + store.currentNodeType());

	bool val = store.loadIntValue();
	set(val);
}
开发者ID:fiirabig,项目名称:Envision,代码行数:8,代码来源:Boolean.cpp


示例9: ModelException

bool ReservoirMethod::CheckInputSize(const char* key, int n)
{
	if(n<=0)
		throw ModelException("GWA_RE","CheckInputSize","Input data for "+string(key) +" is invalid. The size could not be less than zero.");

	if(m_nCells != n)
	{
		if(m_nCells <= 0) 
			m_nCells = n;
		else
		{
			throw ModelException("GWA_RE","CheckInputSize","Input data for "+string(key) +" is invalid. All the input data should have same size.");
		}
	}

	return true;
}
开发者ID:SmileEric,项目名称:SEIMS,代码行数:17,代码来源:ReservoirMethod.cpp


示例10: sk

void DepressionFSDaily::SetValue(const char *key, float data)
{
    string sk(key);
    if (StringMatch(sk, VAR_DEPREIN)) m_depCo = data;
    else if (StringMatch(sk, VAR_OMP_THREADNUM))omp_set_num_threads((int) data); 
    else
        throw ModelException(MID_DEP_LINSLEY, "SetValue", "Parameter " + sk + " does not exist.");
}
开发者ID:Shenfang1993,项目名称:SEIMS,代码行数:8,代码来源:DepressionFSDaily.cpp


示例11: s

void SOL_WB::Set1DData(const char* key, int nRows, float* data)
{
	string s(key);
	if(StringMatch(s, Tag_SubbasinSelected))
	{
		m_subbasinSelected = data;
		m_subbasinSelectedCount = nRows;
		return;
	}

	if(StringMatch(s, VAR_T_RG))
	{
		m_RG = data;
		m_subbasinTotalCount = nRows;		

		return;
	}

	CheckInputSize(key,nRows);

	if(StringMatch(s, VAR_INLO))				
		m_Interception = data;
	else if(StringMatch(s, VAR_PRECI))			
		m_Precipitation = data;
	else if(StringMatch(s, VAR_INET))		
		m_EI = data;
	else if(StringMatch(s, VAR_DPST))		
		m_Depression = data;
	else if(StringMatch(s, VAR_DEET))		
		m_ED = data;	
	else if(StringMatch(s, VAR_INFIL))
		m_Infil = data;
	else if(StringMatch(s, VAR_SOET))	
		m_ES = data;
	else if(StringMatch(s, VAR_REVAP))		
		m_Revap = data;	
	else if(StringMatch(s, VAR_SURU))		
		m_RS = data;
	else if(StringMatch(s, VAR_T_RG))			
		m_RG = data;
	else if(StringMatch(s, VAR_SNSB))		
		m_SE = data;
	else if(StringMatch(s, VAR_TMIN))		
		m_tMin = data;	
	else if(StringMatch(s, VAR_TMAX))		
		m_tMax = data;	
	else if(StringMatch(s, VAR_SOTE))		
		m_SoilT = data;
	else if(StringMatch(s, VAR_SUBBSN))		
		m_subbasin = data;
	else if(StringMatch(s, VAR_SOILDEPTH))		
		m_Rootdepth = data;	
	else if(StringMatch(s, VAR_NEPR))	
		m_pNet = data;
	else
		throw ModelException("SOL_WB", "Set1DData", "Parameter " + s + " does not exist in the SOL_WB module.");

}
开发者ID:fannq,项目名称:SEIMS,代码行数:58,代码来源:SOL_WB.cpp


示例12: ModelException

bool PER_PI::CheckInputSize(const char* key, int n)
{
	if(n<=0)
	{
		throw ModelException(MID_PER_PI,"CheckInputSize","Input data for "+string(key) +" is invalid. The size could not be less than zero.");
		return false;
	}
	if(this->m_nCells != n)
	{
		if(this->m_nCells <=0) this->m_nCells = n;
		else
		{
			throw ModelException(MID_PER_PI,"CheckInputSize","Input data for "+string(key) +" is invalid. All the input data should have same size.");
			return false;
		}
	}
	return true;
}
开发者ID:fannq,项目名称:SEIMS,代码行数:18,代码来源:PER_PI.cpp


示例13: CheckInputSize

void IUH_OL::Set1DData(const char* key, const int n, float* data) {
    CheckInputSize(key, n);
    string sk(key);
    if (StringMatch(sk, VAR_SUBBSN)) m_subbsnID = data;
    else if (StringMatch(sk, VAR_SURU)) m_surfRf = data;
    else {
        throw ModelException(MID_IUH_OL, "Set1DData", "Parameter " + sk + " does not exist.");
    }
}
开发者ID:crazyzlj,项目名称:SEIMS,代码行数:9,代码来源:IUH_OL.cpp


示例14: s

void PER_PI::SetValue(const char* key, float data)
{
	string s(key);
	if(StringMatch(s, Tag_TimeStep))		m_dt = int(data);	
	else if(StringMatch(s, VAR_T_SOIL))		m_frozenT = data;
	else if (StringMatch(s, VAR_OMP_THREADNUM))omp_set_num_threads((int)data);
	else									
		throw ModelException(MID_PER_PI,"SetValue",
		    "Parameter " + s + " does not exist in current module. Please contact the module developer.");
}
开发者ID:fannq,项目名称:SEIMS,代码行数:10,代码来源:PER_PI.cpp


示例15: InitialOutputs

void SNO_SP::Get1DData(const char* key, int* n, float** data) {
    InitialOutputs();
    string s(key);
    if (StringMatch(s, VAR_SNME)) *data = m_snowMelt;
    else if (StringMatch(s, VAR_SNAC)) *data = m_snowAccum;
    else {
        throw ModelException(MID_SNO_SP, "Get1DData", "Result " + s + " does not exist.");
    }
    *n = m_nCells;
}
开发者ID:crazyzlj,项目名称:SEIMS,代码行数:10,代码来源:SNO_SP.cpp


示例16: sk

void PER_PI::Get2DData(const char* key, int *nRows, int *nCols, float*** data)
{
	string sk(key);
	*nRows = m_nCells;
	*nCols = m_nSoilLayers;
	if (StringMatch(sk, VAR_PERCO))   *data = m_perc;
	else
		throw ModelException(MID_PER_PI, "Get2DData", "Output " + sk 
		+ " does not exist. Please contact the module developer.");
}
开发者ID:fannq,项目名称:SEIMS,代码行数:10,代码来源:PER_PI.cpp


示例17: sk

void IUH_OL::Set2DData(const char* key, const int nRows, const int nCols, float** data) {
    string sk(key);
    if (StringMatch(sk, VAR_OL_IUH)) {
        CheckInputSize(VAR_OL_IUH, nRows);
        m_iuhCell = data;
        m_iuhCols = nCols;
    } else {
        throw ModelException(MID_IUH_OL, "Set2DData", "Parameter " + sk + " does not exist.");
    }
}
开发者ID:crazyzlj,项目名称:SEIMS,代码行数:10,代码来源:IUH_OL.cpp


示例18: s

void UnsaturatedFlow::SetValue(const char* key, float data)
{
	string s(key);
	if(StringMatch(s,"T_Soil"))				this->m_ForzenT = data;
	else if (StringMatch(s, "ThreadNum"))
	{
		omp_set_num_threads((int)data);
	}
	else									throw ModelException("UnsaturatedFlow","SetValue","Parameter " + s + " does not exist in UnsaturatedFlow method. Please contact the module developer.");
}
开发者ID:SmileEric,项目名称:SEIMS,代码行数:10,代码来源:UnsaturatedFlow.cpp


示例19: CheckInputSize

void SNO_SP::Set1DData(const char* key, const int n, float* data) {
    CheckInputSize(key, n);
    string s(key);
    if (StringMatch(s, VAR_TMEAN)) m_meanTemp = data;
    else if (StringMatch(s, VAR_TMAX)) m_maxTemp = data;
    else if (StringMatch(s, VAR_NEPR)) m_netPcp = data;
    else {
        throw ModelException(MID_SNO_SP, "Set1DData", "Parameter " + s + " does not exist.");
    }
}
开发者ID:crazyzlj,项目名称:SEIMS,代码行数:10,代码来源:SNO_SP.cpp


示例20: InitialOutputs

void IUH_OL::GetValue(const char* key, float* value) {
    InitialOutputs();
    string sk(key);
    if (StringMatch(sk, VAR_SBOF) && m_inputSubbsnID > 0) {
        /// For MPI version to transfer data across subbasins
        *value = m_Q_SBOF[m_inputSubbsnID];
    } else {
        throw ModelException(MID_IUH_OL, "GetValue", "Result " + sk + " does not exist.");
    }
}
开发者ID:crazyzlj,项目名称:SEIMS,代码行数:10,代码来源:IUH_OL.cpp



注:本文中的ModelException函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ModelInstance函数代码示例发布时间:2022-05-30
下一篇:
C++ Model函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap