Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong pin assignment due to same pin number #27

Open
Exorcismus opened this issue Apr 10, 2019 · 0 comments
Open

Wrong pin assignment due to same pin number #27

Exorcismus opened this issue Apr 10, 2019 · 0 comments

Comments

@Exorcismus
Copy link

Exorcismus commented Apr 10, 2019

While using the tool, I found the below case
image

it seems the application logic will skip the already associated pins, noting it was mis-assigned.
like in the above case, wrong pin 10 was already assigned to a package so the correct pin which had the same value was skipped

I have modified the logic abit to get the nearest point in that case, please check it

datasheet.cpp
void Datasheet::pinSearch(int numPage)
please find the intended block as the function is too large
`foreach (DatasheetPackage *package, packages)
{
// get last inserted pin
DatasheetPin *lastpin = package->pins.last();

                if (lastpin->pin == pin->pin){
                    //modify logic to handle different pins with same number
                    //continue;

                    if(package-> pins.length() >2){

                    //out << " executing tech2 for pin nummber "<<pin->pin << " and size is "<< pins.length()<< endl;
                    DatasheetPin *beforeLastPin =  package-> pins.at( package-> pins.length()-2);


                    qreal newPinDistance = pin->distanceToPoint( beforeLastPin->numPos.center());

                    qreal lastPinDistance = lastpin->distanceToPoint(beforeLastPin->numPos.center());

                    if(newPinDistance < lastPinDistance){

                        //out <<"pin number is :"<<pin->pin<< " replacing pin  "<<lastpin->name << " with "<< pin->name<< endl;

                        package->pins.replace(package->pins.length()-1,pin);

                        continue;


                    }

                    }
                    continue;

                }
                if(  lastpin->pin + 4 < pin->pin)
                    continue;

                qreal newdist = lastpin->distanceToPoint(center);
                if (newdist < dist)
                {
                    dist = newdist;
                    nearPackage = package;
                }
            }`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant