[PCB_FORUM] Re: Obsoleting parts

Hi, Dave:


1.      When defining the library part, our automation defines a custom 
property ("LAST_MODIFIED") that holds the creation or modification date of the 
part.  When the part is submitted to the library the LAST_MODIFIED date is 
updated automatically.
2.      The PCB Designer runs a perl script that extracts the package symbol 
names, and runs an extract on each symbol in the library to get the 
LAST_MODIFIED date.  The extracted date is compared with the LAST_MODIFIED date 
of the symbol in the board database, and a report is generated and displayed to 
the user noting differences.  It is then up to the designer to decide which to 
ignore and which to update.
3.      Sorry, I do not know exactly how the schematic version works, it was 
written and is supported by someone else.
4.      The script we run is part of a ~64000 line system that does not really 
lend itself to splitting up and sharing.  Here is the code for the .pl file, 
but there may be calls to subroutines that are off in some module somewhere.  
In other words: THIS WILL NOT WORK WITHOUT MODIFICATION

#!/tools/perl5.8.3/bin/perl
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#   cksymdate.pl
#-------------------------------------------------------------------------
#  Ver   Date     By   Description
#  ----  -------  ---  ---------------------------------------------------
#  2.01  27FEB07  GHP  Changed "autoload_array" to "autoloadArray" to
#                      facilitate seperation of the PCB and FET programs.
#  2.00  UNKNOWN  WLD  Converted to perl.  Unknown changes may have been
#                      made since release.
#  1.00  27MAR96  DWG  Introduced for use throughout tek.  Add code to get
#                      extract command from single point
#-------------------------------------------------------------------------
my $progVer  = "2.01";
my $progDate = "27FEB07";

$version = "$progVer, $progDate";

sub BEGIN {
  require 5.006_001;
  use FindBin qw($Bin);                                                         
                     # magic from page 415 of cookbook
  die "\n\n\aFindBin did not work. Maybe your directory is no longer 
existing?\n\n\n" if ( ! defined $Bin );
  use lib "$Bin/../pm_files" ;
  require autoloadArray;

  #This isn't working $EXTRACT = &determine_extract_command;        # go figure 
the extract command for the os and app
}

( undef , undef ) = &process_switches ( \@ARGV ,"$0" ); # check switches, has 
to be ahead of everything

print "\ncksymdate version $version, Tektronix, Inc.\n\n";
#
#USAGE:  cksymdate <allegro board name>
#OUTPUT: cksymdate.rpt
#THIS SCRIPT IS FOR USE IN CONJUNCTION WITH AN ALLEGRO DATABASE
#This script compares the LAST_MODIFIED property value foreach
#symbol in the specified board database with the library symbol
#and reports outdated symbols in cksymdate.rpt and creates an

#update.lst that can be used to update by list any outdated parts.

#       Set $PC if running under WinNT
if( $ENV{'OS'} eq "Windows_NT" ) {
  $PC = 1;
  if ( $ENV{EDAVERSION} =~ /psd14/ ) {
    $SYMPATH = "$ENV{'EDALIBS'}\\allegro\\allegro_v14\\draw\\package";
  } else {
    $SYMPATH = "$ENV{'EDALIBS'}\\allegro\\allegro_v15\\draw\\package";
  }
  #print "\n\nSymbol path is: $SYMPATH\n\n";
  $EXTRACT = "$ENV{'CDSROOT'}\\tools\\pcb\\bin\\extracta";
  #print "\n\nExtract path is: $EXRACT\n\n";
  $CLEAR = "cls";
} else {
        $PC = 0;
        $SYMPATH = "/stdapps/valid/teklib/pcb/draw/package";
        #print "\n\nSymbol path is: $SYMPATH\n\n";
        $EXTRACT = "/stdapps/valid/tools/pcb/bin/extract";
        #print "\n\nExtract path is: $EXRACT\n\n";
        $CLEAR = "clear";
}
#system "$CLEAR";
#print "\n\nThe board filename is set to: $ARGV[0]\n\n";
print "WARNING: \n";
print "This program is extracting data from the DISK copy of $ARGV[0], \n";
print "not the ACTIVE board.\n\n";
#
#
#
if($#ARGV != 0) {
  &GetBrdfn;
} else {
  #print "\n\nThe board filename is set to: $ARGV[0]\n\n";
  $brd_fn = $ARGV[0];
  &CheckBrdfn;
}

open(GET_SYM_DATES, "> sym_date_command.txt");
  print GET_SYM_DATES "SYMBOL\n";
  print GET_SYM_DATES "SYM_TYPE = 'PACKAGE'\n";
  print GET_SYM_DATES "SYM_NAME\n";
  print GET_SYM_DATES "LAST_MODIFIED\n";
  print GET_SYM_DATES "SYM_HAS_PIN_EDIT\n";
  print GET_SYM_DATES "END";
close(GET_SYM_DATES);

print "Extracting dates from board symbols. \n\n";
system ("$EXTRACT -q $brd_fn sym_date_command.txt | uniq > cksymdate_out.rpt");
unlink ("sym_date_command.txt");

print "Extracting dates from library parts. \n";
print "Sorry this takes a while. \n\n";
open(SYM_DATES, "cksymdate_out.rpt");
while ( chomp(<SYM_DATES>) ) {
  if(/^S/) {
    ($s, $part, $b_date, $pin_edit, $junk) = split(/!/);
    if($b_date) {
      $part =~ tr/A-Z/a-z/;
      $symbol = "$SYMPATH/$part.dra";
      if(-f "$symbol") {
        $l_date = `$EXTRACT -qs $symbol lastmodprop.txt | grep -v "Revising 
data"`;
        chomp($l_date);
        if("$b_date" ne "$l_date") {
          printf ("\a\a%-18s OUT OF DATE\n", $part);
          $bad_date{$part}="${b_date}!${l_date}!${pin_edit}";
        } else {
          printf ("%-18s OK\n", $part);
        }
      } else {
        printf ("%-18s not in symbol library\n", $part);
      }
    } else {
      $no_date{$part} = $part;
#     printf ("%-18s no date\n", $part);
    }
  } elsif(/^J/) {
    ($j,$dir,$ex_date,$lx,$ly,$ux,$uy,$accu,$unit,$uk1,$uk2,$errors,$status) = 
split(/!/);
  }
}
close(SYM_DATES);
unlink ("cksymdate_out.rpt");

open(UPDATE, ">update.lst");
open(OUTPUT, ">cksymdate.rpt");
print OUTPUT "\n\n
                      SYMBOL DATE STAMP REPORT
                      ------------------------

   Report Date: $ex_date
Library Location: $SYMPATH
Extracted From: $dir
   Board Units: $unit
Board Accuracy: $accu
    DRC Errors: $errors
    DRC Status: $status
\n\n";

if(%bad_date) {
  print OUTPUT "The following symbols have date stamp descrepencies:

   SYMBOL          LAST MODIFIED*      LIBRARY DATE   SYMBOL HAS EDITED PIN*
--------------------------------------------------------------------------\n";

  foreach(keys %bad_date) {
    ($b_date, $l_date, $pin_edit) = split(/!/, $bad_date{$_});
    print UPDATE "$_\n";
    printf OUTPUT ("   %-18s %-18s %-20s %-20s\n", $_, $b_date, $l_date, 
$pin_edit);
  }
  print OUTPUT 
"--------------------------------------------------------------------------\n";
  print OUTPUT "* = Data from board.\n";
  print OUTPUT "\n";
  print OUTPUT "NOTE:\n";
  print OUTPUT "A list file (update.lst) has been created that contains all\n";
  print OUTPUT "symbols listed in the above date stamp descrepencies 
section.\n";
  print OUTPUT "It can be used as input to the refresh_symbol command.\n";
}else{
    print OUTPUT "No outdated symbols found.\n\n";
}
if( %no_date ) {
  print OUTPUT "\n\nThe following symbols have no date in the LAST_MODIFIED 
field:\n\n";
  foreach(keys %no_date) {
    print OUTPUT "$no_date{$_}\n";
  }
}
print OUTPUT "\n\nEND OF REPORT\n";
print "\a\n\nDONE\n\n";
print "SEE cksymdate.rpt FOR A COMPLETE REPORT\n\n";
close(UPDATE);
close(OUTPUT);

sub GetBrdfn {
    print "\n\nPlease enter the board_filename.brd > ";
    $brd_fn = <STDIN>;
    chomp($brd_fn);
    &CheckBrdfn;
}

sub CheckBrdfn {
    $brd_fn =~ s/$/.brd/ if($brd_fn !~ /.brd$/);
    if(!-f "$brd_fn") {
        #system "$CLEAR";
        print "\n\n     BAD PATH - COULD NOT FIND $brd_fn\n\n";
        &GetBrdfn;
    }else{
        #system ("$CLEAR");
        print "\n\nThe board filename is set to: $brd_fn\n\n";
    }
}

sub setup_program_names {
  my %program_names;

  $program_names{"cksymdate"} = "cksymdate.pl" ;                                
            # this is the only program for this one
                                                                                
                     # these are used by the command management system to get 
data for requested actions.
  $program_names{KEY_EGREP_STRING} = "\'.-> \.\./pl_files/cksymdate.pl\'";      
             # where the base script is for a multiple command script
  $program_names{KEY_PROGRAM_DIRECTORY} = dirname($0);                          
             # where this script was found
  $program_names{KEY_LINK_PREFIX} = "../perlib/pl_files/";                      
            # prefix for the ln command in unix world in relation to above dir
  $program_names{KEY_SWITCH_FILE}->{"$Bin/../pm_files/process_switches.pm"} = 1;
  $program_names{KEY_PL_FILE_PATH} = "%TEKPCBAPPS%\\perlib\\pl_files\\";

  &set_pcb_env_warnings;                                                        
                     # turn on warning messages about bad env variables
  return ( \%program_names );
}

--
George Patrick
Tektronix, Inc.
Central Engineering, EDS Applications Support
P.O. Box 500, M/S 39-512
Beaverton, OR 97077-0001
* 503-627-5272 (voice)     * 503-627-5587 (fax)
http://www.tektronix.com<http://www.tektronix.com/>    
http://www.pcb-designer.com<http://www.pcb-designer.com/>

"Off-Grid and Proud of it!"

-----Original Message-----
From: icu-pcb-forum-bounce@xxxxxxxxxxxxx 
[mailto:icu-pcb-forum-bounce@xxxxxxxxxxxxx] On Behalf Of Dave Seymour
Sent: Monday, May 04, 2009 18:53
To: icu-pcb-forum@xxxxxxxxxxxxx
Subject: [PCB_FORUM] Re: Obsoleting parts



George,



Can you tell me more about your script?



Do you have a layer in Allegro hold the date code? Etc.



Are you willing to share the script?



Thanks very much.



Dave





Dave Seymour

Ixia

919.267.4840


  _____


From: icu-pcb-forum-bounce@xxxxxxxxxxxxx 
[mailto:icu-pcb-forum-bounce@xxxxxxxxxxxxx] On Behalf Of 
george.h.patrick@xxxxxxxxxxxxx
Sent: Monday, May 04, 2009 6:08 PM
To: icu-pcb-forum@xxxxxxxxxxxxx
Subject: [PCB_FORUM] Re: Obsoleting parts



Hi, Shirley:



We move the PCB part to an OBSOLETE directory that is included in the PSMPATH.  
The schematic part is moved to an OBSOLETE library that is not allowed for new 
boards, but still available for packaging.  That way minor changes to existing 
production boards do not get popped off the board.



We support this with a script that compares a custom date property of parts on 
the board with the custom date properties of the same part in the library, 
alerting the PCB Designer that their board is using obsolete packages so they 
can find out if it needs to be updated.  Another script on the schematic side 
has a similar function.



--
George Patrick
Tektronix, Inc.
Central Engineering, EDS Applications Support
P.O. Box 500, M/S 39-512
Beaverton, OR 97077-0001
* 503-627-5272 (voice)     * 503-627-5587 (fax)
http://www.tektronix.com<http://www.tektronix.com/>    
http://www.pcb-designer.com<http://www.pcb-designer.com/>

"Off-Grid and Proud of it!"

-----Original Message-----
From: icu-pcb-forum-bounce@xxxxxxxxxxxxx 
[mailto:icu-pcb-forum-bounce@xxxxxxxxxxxxx] On Behalf Of Bradley, Shirley
Sent: Monday, May 04, 2009 09:27
To: icu-pcb-forum@xxxxxxxxxxxxx
Subject: [PCB_FORUM] Obsoleting parts

How is everyone obsoleting parts from the library. Some of these parts are used 
on production boards, so removing them from the library is not an option. Is 
there a way to hide the entry or freeze it so it can not be picked off the 
menu? What are you doing????



We are on 16.2 and do not have CIS.



Shirley M. Bradley

Cad Librarian

Intermec

tel: 319-369-3328



Other related posts: