/* SSYMPATT (SCM) -- SCM Symbol Name Pattern Settings */ /* SSYMPATT (SCM) -- SCM-Symbol Namensmustereinstellungen */ /* // Copyright (c) 2002-2012 Oliver Bartels F+E, Muenchen // Author: Roman Ludwig // Changes History: // rl (120427) RELEASED FOR BAE V7.8. // rl (101019) RELEASED FOR BAE V7.6. // rl (091021) RELEASED FOR BAE V7.4. // rl (081014) RELEASED FOR BAE V7.2. // rl (071029) RELEASED FOR BAE V7.0. // rl (060829) RELEASED FOR BAE V6.8. // rl (050906) RELEASED FOR BAE V6.6. // rl (040811) RELEASED FOR BAE V6.4. // rl (030904) RELEASED FOR BAE V6.2. // rl (021209) RELEASED FOR BAE V6.0. // rl (021126) ORIGINAL CODING. // // DESCRIPTION // // The ssympatt User Language program provides functions to // set the base symbol name pattern data used for automatic // symbol naming. On symbol level this is the name pattern itself. // On schematic sheet level this is naming mode and the optional // name pattern start number. */ // Includes #include "baeparam.ulh" // User Language BAE param. access #include "pop.ulh" // User Language popup utilities #include "scm.ulh" // User Language SCM utilities // Disable undo state request #pragma ULCALLERNOUNDO // Messages string UPRABORT = M_UPRABORT(); string UPRPATFCT = M("Benennungsmodus selektieren!", "Select Symbol Naming Mode!"); string UPRPFCT1 = M("Standard","Standard"); string UPRPFCT2 = M("Nummernscan","Number scan"); string UPROPMODE = M("Benennungsmodus :","Name Generation Mode :"); string UPRFNUM = M("Startnummer ? ","Start Number ? "); string UPRFNUMD = M("Startnummer :","Start Number :"); string UPRPATD = M("Symbolname Muster","Part Name Pattern"); string UPRNIL = "--------"; // Main program void main() { int opmode = 1 /* Name pattern operation mode */; int firstnum /* First number */; double pcol = 18.0 /* Parameter column */; double cy /* Current y value */; int fnidx /* First number index */; int repflag = 1 /* Repeat flag */; // Check the plan class if (bae_planddbclass()!=DDBCLSCM && bae_planddbclass()!=DDBCLSSYM) error_class(); // Check if symbol level basic function call if (bae_planddbclass()==DDBCLSSYM) { bae_callmenu(MNU_SCMPNAMPAT); exit(0); } // Query the current number scan start if (cap_rulequery( RS_OCPLAN,0,RS_SCMSUBJ,RS_SYMSTART,"?d",firstnum)<1) { // Set default first number firstnum=1; opmode=0; } // Check for dialog support if (bae_dialclr()) { // Ask for operating mode bae_promptdialog(UPRPATFCT); bae_defmenusel(opmode); if ((opmode=bae_askmenu(3,UPRPFCT1,UPRPFCT2,UPRABORT))<0 || opmode>1) error_abort(); if (opmode==1) { // Ask for start number if (askint(firstnum,UPRFNUM,9)) error_abort(); } } else { // Create the dialog box controls cy=DIAL_TOPMARG; // Store operation mode controls dial_label(0.0,cy,UPROPMODE); bae_dialaddcontrol(PA_RBF,0,1,opmode,0.0,0.0,0.0, "",0,DIAL_LEFTMARG+pcol,cy,20.0,UPRPFCT1); cy+=DIAL_CTRVSTEP; bae_dialaddcontrol(PA_RBN,1,2,0,0.0,0.0,0.0, "",0,DIAL_LEFTMARG+pcol,cy,20.0,UPRPFCT2); cy+=DIAL_CTRVSTEP; // Store first number edit controls dial_label(0.0,cy,UPRFNUMD); fnidx=bae_dialaddcontrol(PA_INT|PA_CHKLL|PA_HBRDREL, 0,0,firstnum,0.0,0.0,0.0,"",9, DIAL_LEFTMARG+pcol,cy,DIAL_RIGHTEMARG,""); cy+=DIAL_BUTVSTEP; // Store the OK and abort button with seperator dial_hsep(cy); dial_okabort(cy); do { // Check the first number edit field status if (opmode==0) bae_dialsetdata( fnidx,PA_LAB,firstnum,0.0,UPRNIL); else bae_dialsetdata(fnidx, PA_INT|PA_CHKLL|PA_HBRDREL,firstnum,0.0,""); // Call the dialog function bae_setintpar(16,3039); switch (bae_dialaskparams(UPRPATD,0, DIAL_LEFTMARG+pcol+11.3+DIAL_RIGHTSMARG,cy)) { // Done case 0 : bae_dialgetdata(fnidx,firstnum,0.0,""); repflag=0; break; // Standard operation mode selected case 1 : opmode=0; bae_dialgetdata(fnidx,firstnum,0.0,""); break; // Number scan operation mode selected case 2 : opmode=1; break; // Fail/abort case (-1) : error_abort(); } } // Stop if no further repeat requests while (repflag); } // Save current state for undo bae_callmenu(MNU_BAESAVESTATE); // Set plan numbering rule predicate rsc_assplanintpred(0,RS_SYMSTART,opmode==0 ? (-1) : firstnum,(-1),""); } // User Language program end