Sunday, January 12, 2025

Two Ways You Can Get Rid of the Infix in the Wire Command

Infix? You press the bindkey ('w') and, wherever your mouse is at that instant, that's where it starts from. Yuck!

The newbie way (me):

   if(key == 'w' /* && !xctx->ui_state */ && rstate==0)    /* place wire. */
   {
     /* AC hack trying to get rid of infix */
     xctx->ui_state |= MENUSTART;
     xctx->ui_state2 = MENUSTARTWIRE;
     break; /* AC hack */
     int prev_state = xctx->ui_state;
     if(xctx->semaphore >= 2) break;
     start_wire(xctx->mousex_snap, xctx->mousey_snap);
     if(prev_state == STARTWIRE) {
       tcleval("set constr_mv 0" );
       xctx->constr_mv=0;
     }
     break;
   }

And the pro way (Chayan):

   if(key == 'w' /* && !xctx->ui_state */ && rstate==0)    /* place wire. */
   {
    int prev_state = xctx->ui_state;
    if (xctx->semaphore >= 2) break;
    if (tclgetboolvar("infix_wire")) {
     start_wire(xctx->mousex_snap, xctx->mousey_snap);
    } else if (prev_state == STARTWIRE) {
     start_wire(xctx->mousex_snap, xctx->mousey_snap);
    } else {
     tcleval("xschem wire");
    }
    if (prev_state == STARTWIRE) {
     tcleval("set constr_mv 0");
     xctx->constr_mv = 0;
    }
    break;
   }

No comments:

Post a Comment

Who Needs Cadence Anymore (for Schematic Tree Reporting that is :)? Make Your Own Reporter with chatGPT!

You know what I mean, if you've used Cadence - the SHIFT-T thing that gives you the schematic tree can be VERY useful, at times. No Cade...