parent
93b5038382
commit
1290cf6241
|
@ -141,27 +141,26 @@ std::string SPICE_GENERATOR_SOURCE::ItemLine( const SPICE_ITEM& aItem ) const
|
|||
case SIM_MODEL::TYPE::V_RANDUNIFORM:
|
||||
case SIM_MODEL::TYPE::I_RANDUNIFORM:
|
||||
{
|
||||
/* TODO
|
||||
args.append( "1 " );
|
||||
args.append( getParamValueString( "dt", "0" ) + " " );
|
||||
args.append( getParamValueString( "td", "0" ) + " " );
|
||||
std::string min = getParamValueString( "min", "0" );
|
||||
std::string max = getParamValueString( "max", "0" );
|
||||
|
||||
SIM_VALUE_FLOAT min = dynamic_cast<SIM_VALUE_FLOAT&>( m_model.FindParam( "max" )->value );
|
||||
args.append( min + " " );
|
||||
args.append( max + " " );
|
||||
|
||||
if( !min.ToString().empty() )
|
||||
min.FromString( "0" );
|
||||
double minVal = std::stod( min );
|
||||
double maxVal = std::stod( max );
|
||||
|
||||
SIM_VALUE_FLOAT max = dynamic_cast<SIM_VALUE_FLOAT&>( m_model.FindParam( "min" )->value );
|
||||
double rangeVal = maxVal - minVal;
|
||||
double offsetVal = ( maxVal + minVal ) / 2;
|
||||
|
||||
if( !max.ToString().empty() )
|
||||
max.FromString( "0" );
|
||||
std::string range = std::to_string( rangeVal );
|
||||
std::string offset = std::to_string( offsetVal );
|
||||
|
||||
SIM_VALUE_FLOAT range = max - min;
|
||||
SIM_VALUE_FLOAT offset = ( max + min ) / SIM_VALUE_FLOAT( 2 );
|
||||
|
||||
args.append( range.ToSpiceString() + " " );
|
||||
args.append( offset.ToSpiceString() + " " );
|
||||
*/
|
||||
args.append( range + " " );
|
||||
args.append( offset + " " );
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue