/* SCANLAB (CAP) -- SCM Plan Label Scan */ /* SCANLAB (CAP) -- SCM-Plan Labelliste erstellen */ /* // Copyright (c) 1996-2006 Oliver Bartels F+E, Erding // Author: Manfred Baumeister // Changes History: // mb (980911) ADAPTED TO BAE V4.2. // mb (980713) ENHANCEMENT: Dynamic multi-language support. // mb (971211) ADAPTED TO BAE V4.0. // mb (960619) ORIGINAL CODING. // // DESCRIPTION // // The scanlab User Language program scans labels in selectable // SCM project file and generates a label cross reference. */ // Includes #include "pop.ulh" // User Language popup utilities // Messages string UPRSELDDB = M("SCM-Jobdatei ? ","SCM Job File ? "); string FMTLISTHEAD = M("Datei '%s' Labels:\n","File '%s' Labels:\n"); #define FMTSCMLABEL ": %-15s : %-15s X=%8.3f Y=%8.3f\n" // Globals struct labdes { // Label descriptor string netname; // Label net name string planname; // Label plan name double x,y; // Label coordinates } labell[]; // Label list int labeln; // Label count // Main program main() { string filename; // Selected SCM DDB file name int i; // Loop control variable // Save current element with verification on request verifysave(); // Select SCM plan DDB file if ((filename=askddbfile(UPRSELDDB,DDBCLSCM))=="") // Abort error_abort(); // Scan labels scanlabels(filename); // Print label list printf(FMTLISTHEAD,filename); for (i=0;i>1; // Test if label found if ((compres=numstrcmp(netname,labell[sidx].netname))==0 && (compres=numstrcmp(planname,labell[sidx].planname))==0 && (compres=dblcmp(x,labell[sidx].x))==0 && (compres=dblcmp(labell[sidx].y,y))==0) // Multiple label entry break; // Update search area if (compres<0) sub=sidx-1; else slb=sidx+1; } // Re-sort label list for (sidx=labeln;sidx>slb;sidx--) labell[sidx]=labell[sidx-1]; // Insert new label to label list labell[slb].y=y; labell[slb].x=x; labell[slb].planname=planname; labell[slb].netname=netname; labeln++; } int dblcmp(double v1,double v2) // Compare double values // Returns: // ( 0) if equal values, // (-1) if value 1 smaller, // ( 1) if value 2 smaller // Parameters : // double v1 : Double value 1 // double v2 : Double value 2 { // Test if equal values if (v1==v2) return(0); // Test if value 1 smaller if (v1