コード例 #1
0
bool SCH_SCREEN::IsJunctionNeeded( const wxPoint& aPosition )
{
    if( GetItem( aPosition, 0, SCH_JUNCTION_T ) )
        return false;

    if( GetWire( aPosition, 0, EXCLUDE_END_POINTS_T ) )
    {
        if( GetWire( aPosition, 0, END_POINTS_ONLY_T ) )
            return true;

        if( GetPin( aPosition, NULL, true ) )
            return true;
    }

    return false;
}
コード例 #2
0
ファイル: data.cpp プロジェクト: BackupTheBerlios/tfla-01-svn
int	 Data:: ScanWire(sample_time_t time_start,sample_time_t delta_time, unsigned nr_wire)
{
	bool c_value;
	int change_count;
	bool vn;
	unsigned mask;
	sample_time_t kt , k_last;
	kt      = time_start;
	k_last  = kt+delta_time;

	if (kt >= num_samples)
	{
		return(0);
	}
	else if (kt < 0)
	{
		if (k_last < 1)
		{
			return(0);
		}
		kt = 0;
	}
	if (k_last > num_samples)
	{
		// protected to search to far
		k_last = num_samples;
	}
	c_value = GetWire(time_start,nr_wire);
	change_count = 0;
	mask = (1<<nr_wire);
	while (kt < k_last)
	{
		vn = (GetSampleValue(kt) & mask);
		if (vn != c_value)
		{
			c_value = !c_value;
			change_count +=1;
		}
		if (kt >= m_start_time && kt < m_stop_time)
		{
			kt = m_stop_time;
		}
		else
		{
			kt +=1;
		}
	}
	return(change_count);
}
コード例 #3
0
bool SCH_SCREEN::IsTerminalPoint( const wxPoint& aPosition, int aLayer )
{
    wxCHECK_MSG( aLayer == LAYER_NOTES || aLayer == LAYER_BUS || aLayer == LAYER_WIRE, false,
                 wxT( "Invalid layer type passed to SCH_SCREEN::IsTerminalPoint()." ) );

    SCH_SHEET_PIN* label;
    SCH_TEXT*      text;

    switch( aLayer )
    {
    case LAYER_BUS:

        if( GetBus( aPosition ) )
            return true;

        label = GetSheetLabel( aPosition );

        if( label && IsBusLabel( label->GetText() ) && label->IsConnected( aPosition ) )
            return true;

        text = GetLabel( aPosition );

        if( text && IsBusLabel( text->GetText() ) && text->IsConnected( aPosition )
            && (text->Type() != SCH_LABEL_T) )
            return true;

        break;

    case LAYER_NOTES:

        if( GetLine( aPosition ) )
            return true;

        break;

    case LAYER_WIRE:
        if( GetItem( aPosition, std::max( GetDefaultLineThickness(), 3 ), SCH_BUS_WIRE_ENTRY_T) )
            return true;

        if( GetItem( aPosition, std::max( GetDefaultLineThickness(), 3 ), SCH_BUS_BUS_ENTRY_T) )
            return true;

        if( GetItem( aPosition, std::max( GetDefaultLineThickness(), 3 ), SCH_JUNCTION_T ) )
            return true;

        if( GetPin( aPosition, NULL, true ) )
            return true;

        if( GetWire( aPosition ) )
            return true;

        text = GetLabel( aPosition );

        if( text && text->IsConnected( aPosition ) && !IsBusLabel( text->GetText() ) )
            return true;

        label = GetSheetLabel( aPosition );

        if( label && label->IsConnected( aPosition ) && !IsBusLabel( label->GetText() ) )
            return true;

        break;

    default:
        break;
    }

    return false;
}