Bug fixes for handling boolean flags in DRC rules.
(cherry picked from commit cb53a18ee3
)
This commit is contained in:
parent
f0d205fed9
commit
e76a520c19
|
@ -1220,7 +1220,7 @@ void UOP::Exec( CONTEXT* ctx )
|
|||
result = arg1Value != 0.0 ? 0 : 1;
|
||||
break;
|
||||
default:
|
||||
result = 0.0;
|
||||
result = arg1Value != 0.0 ? 1 : 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -345,6 +345,10 @@ protected:
|
|||
{
|
||||
wxAny a = getter( aObject );
|
||||
|
||||
// We don't currently have a bool type, so change it to a numeric
|
||||
if( a.CheckType<bool>() )
|
||||
a = a.RawAs<bool>() ? 1 : 0;
|
||||
|
||||
if ( !( std::is_enum<T>::value && a.CheckType<int>() ) && !a.CheckType<T>() )
|
||||
throw std::invalid_argument( "Invalid requested type" );
|
||||
|
||||
|
|
|
@ -257,6 +257,10 @@ std::unique_ptr<LIBEVAL::VAR_REF> PCB_EXPR_UCODE::CreateVarRef( const wxString&
|
|||
{
|
||||
vref->SetType( LIBEVAL::VT_NUMERIC );
|
||||
}
|
||||
else if( prop->TypeHash() == TYPE_HASH( bool ) )
|
||||
{
|
||||
vref->SetType( LIBEVAL::VT_NUMERIC );
|
||||
}
|
||||
else if( prop->TypeHash() == TYPE_HASH( wxString ) )
|
||||
{
|
||||
vref->SetType( LIBEVAL::VT_STRING );
|
||||
|
|
Loading…
Reference in New Issue