コード例 #1
0
ファイル: params.cpp プロジェクト: Strongc/szarp
void Params::param_value_changed( iterator itr , double value , ProbeType pt )
{
	if( itr.itr == params.end() ) {
		sz_log(1, "Value changed of undefined param %s", itr->c_str() );
		return;
	}

	using std::isnan;

	auto pvalue = itr.itr->second->get_value( pt );
	if( pt.get_type() == ProbeType::Type::LIVE
	 && (value == pvalue || (isnan(value) && isnan(pvalue))) )
		/**
		 * With LIVE probes if values are equal even
		 * if both are NaNs do nothing. For other probe
		 * types always send update.
		 */
		return;

	itr.itr->second->set_value( value , pt );
	emit_value_changed( itr.itr->second , value , pt );
}