home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / NEURLNET / NERVES.ZIP / 87 / DATAMOD.C next >
Encoding:
C/C++ Source or Header  |  1990-10-02  |  15.8 KB  |  778 lines

  1. #include "defn.h"
  2. #include "nsdata.c"
  3. #include "proto.h"
  4.  
  5. void datamod(void) /* allows user to modify/add/delete neuron data */
  6.  {
  7.   enum asc_val asc;
  8.   enum ext_val ext;
  9.   char str[41];
  10.   char *p;
  11.   int newneur;
  12.   FILE *file;
  13.   int i,j,done,line,cc,newcon;
  14.   struct neuron *np,tn;
  15.   struct con *cp,*tc,*cq,*cs,*cl;
  16.   struct Iint *ip,ti;
  17.   double d;
  18.  
  19.   /* modify data */
  20. start:
  21.   clrscr();
  22.   textattr(BLUE + (LIGHTGRAY<<4));
  23.   gotoxy(1,24);
  24.   cputs(" ^S-Save file   Esc-Main menu                                                   ");
  25.   textattr(LIGHTGRAY);
  26. getname:
  27.   clrline(1);
  28.   gotoxy(1,1);
  29.   cputs("Neuron name: ");
  30.   i = 0;
  31.   while (!i)
  32.    i = bioskey(1);
  33.   asc = i & 0xff;
  34.   if (asc == ESC)
  35.    { /* return to main menu without saving */
  36.     bioskey(0);
  37.     return; /* go to main menu */
  38.    }
  39.   else
  40.    if (asc == CTRLS)
  41.     { /* save file */
  42.      bioskey(0);
  43.      /* count neurons */
  44.      for (i=0, j=0, np=ns; i<nn; i++, np++)
  45.       if (np->name[0])
  46.        j++;
  47.      clrscr();
  48.      if (neurfname[0])
  49.       {
  50.        cprintf("Save to %s? ",neurfname);
  51.        i = toupper(bioskey(0) & 0xff);
  52.       }
  53.      if (!neurfname[0] || i != 'Y')
  54.       {
  55.        gotoxy(1,1);
  56.        cputs("Enter file spec:                                      ");
  57.        gotoxy(18,1);
  58.        str[0] = 38;
  59.        p = cgets(str);
  60.        strcpy(neurfname,p);
  61.       }
  62.      file = fopen(neurfname,"wb");
  63.      fwrite(&j,2,1,file);
  64.      for (i=0, np=ns; i<nn; i++, np++)
  65.       if (np->name[0])
  66.        {
  67.     fwrite(np,27,1,file);
  68.     if (np->Iint)
  69.      j = (int)np->Iint - (int)Iinta + 1;
  70.     else
  71.      j = 0;
  72.     fwrite(&j,2,1,file);
  73.     fwrite(&(np->Isens),18,1,file);
  74.     if (np->con)
  75.      j = (int)np->con - (int)cona + 1;
  76.     else
  77.      j = 0;
  78.     fwrite(&j,2,1,file);
  79.        }
  80.      fwrite(&ni,2,1,file);
  81.      fwrite(Iinta,sizeof(struct Iint),ni,file);
  82.      fwrite(&nc,2,1,file);
  83.      for (i=0, cp=cona; i<nc; i++, cp++)
  84.       {
  85.        fwrite(cp,sizeof(struct con)-2,1,file);
  86.        if (cp->next)
  87.     j = (int)cp->next - (int)cona + 1;
  88.        else
  89.     j = 0;
  90.        fwrite(&j,2,1,file);
  91.       }
  92.      fclose(file);
  93.      return; /* go to main menu */
  94.     }
  95.   else
  96.    { /* neuron name input */
  97.     str[0] = 7;
  98.     p = cgets(str);
  99.     if ((*p == '?' || *p == '/') && *(p+1) == 0)
  100.      { /* list neuron names */
  101.       for (np=ns, i=0, j=0; i<nn & j<10; j++)
  102.        for (line=3; line<24 && i<nn; line++, i++, np++)
  103.     {
  104.      gotoxy(1+j*8,line);
  105.      while (!np->name[0] && i<nn)
  106.       {
  107.        np++;
  108.        i++;
  109.       }
  110.      if (i<nn)
  111.       cprintf("%s",np->name);
  112.     }
  113.       goto getname;
  114.      }
  115.     else
  116.      if (!*p)
  117.       goto getname;
  118.      else
  119.       {
  120.        for (np=ns, i=0; i<nn; i++, np++)
  121.     if (!strncmp(p,np->name,6))
  122.      break;
  123.        if (i == nn)
  124.     {
  125.      gotoxy(1,2);
  126.      cputs("Neuron not found; create new neuron? ");
  127.      if (toupper(bioskey(0) & 0xff) != 'Y')
  128.       goto getname;
  129.      newneur = TRUE;
  130.      nn++;
  131.     }
  132.        else
  133.     newneur = FALSE;
  134.       }
  135.     /* save neuron's data in temporary storage */
  136.     tn = *np;
  137.     if (newneur)
  138.      strcpy(tn.name,p);
  139.     if (np->Iint)
  140.      ti = *(np->Iint);
  141.     else
  142.      ti = *(Iinta + ni);
  143.     for (cp=np->con, tc=cona+nc, cc=0; cp!=NULL; cp=cp->next, cc++, tc++)
  144.      *tc = *cp;
  145.     tc = cona+nc;
  146.  
  147.     ndisp(tn,ti,3); /* display neuron's parameters */
  148.  
  149.     /* modify parameters */
  150.     line = 3;
  151.     done = FALSE;
  152.     while(!done)
  153.      {
  154.       i = 0;
  155.       while(!i)
  156.        i = bioskey(1);
  157.       asc = i & 0xff;
  158.       if (asc)
  159.        {
  160.     if (asc < 32)
  161.      {
  162.       bioskey(0);
  163.       switch(asc)
  164.        {
  165.         case CTRLD: /* delete neuron */
  166.          if (!strcmp(tn.name,np->name)) /* if existing neuron, delete */
  167.           np->name[0] = 0;
  168.          if (newneur)
  169.           nn--;
  170.          goto start;
  171.         case CTRLS: /* save neuron */
  172.          if (!newneur && strcmp(np->name,tn.name))
  173.           { /* copied neuron */
  174.            if (tn.Iint)
  175.         tn.Iint = Iinta+ni;
  176.            np = ns + nn;
  177.            np->Iint = 0;
  178.            np->con = 0;
  179.            nn++;
  180.           }
  181.          if (!np->con)
  182.           newcon = TRUE;
  183.          else
  184.           newcon = FALSE;
  185.          if (!np->Iint && tn.Iint)
  186.           ni++;
  187.          *(np) = tn;
  188.          if (tn.Iint)
  189.           *tn.Iint = ti;
  190.          j = 0;
  191.          cq = tc;
  192.          if (!newcon)
  193.           for (cp=np->con; cp!=NULL && j<cc; cp=cs, cq++, j++)
  194.            {
  195.         cs = cp->next;
  196.         *cp = *cq;
  197.         if (j == cc-1)
  198.          cp->next = NULL;
  199.         else
  200.          if (cs == NULL && j < cc-1)
  201.           cp->next = cona + nc;
  202.          else
  203.           cp->next = cs;
  204.            }
  205.              if (cp == NULL)
  206.           {
  207.            if (j != cc)
  208.         {
  209.          for (cp=cona+nc, i=0; j<cc; cp++, j++, cq++, i++)
  210.           {
  211.            if (!newcon)
  212.             *cp = *cq;
  213.            cp->next = cp + 1;
  214.           }
  215.          (cp-1)->next = NULL;
  216.          if (newcon)
  217.           np->con = cona + nc;
  218.          nc += i;
  219.         }
  220.           }
  221.          goto start;
  222.         case CR:
  223.          switch (line)
  224.           {
  225.            case 8: /* Intrinsic current type */
  226.         if (!tn.Iint)
  227.          {
  228.           tn.Iint = Iinta + ni;
  229.           ti.type = 0;
  230.          }
  231.         else
  232.          if (ti.type == 0)
  233.           ti.type = 1;
  234.          else
  235.           tn.Iint = NULL;
  236.         ndisp(tn,ti,line);
  237.                 break;
  238.            case 16: /* Sensory current function */
  239.         tn.Isens++;
  240.         if (tn.Isens > 6)
  241.          tn.Isens = 0;
  242.         ndisp(tn,ti,line);
  243.         break;
  244.            case 19: /* motor output type */
  245.         tn.mtype++;
  246.         if (tn.mtype > 2)
  247.          tn.mtype = 0;
  248.         ndisp(tn,ti,line);
  249.         break;
  250.            case 20: /* motor output sub type */
  251.         if (tn.mtype == 1)
  252.          {
  253.           tn.mname++;
  254.           if (tn.mname > 2)
  255.            tn.mname = 0;
  256.          }
  257.         else
  258.          if (tn.mtype == 2)
  259.           tn.mname = !tn.mname;
  260.          else
  261.           break;
  262.         ndisp(tn,ti,line);
  263.         break;
  264.            case 22: /* Switch to connections page */
  265.         conmod(tn.name,tc,&cc);
  266.         ndisp(tn,ti,3);
  267.         line = 3;
  268.         break;
  269.            default:
  270.         if (line < 22)
  271.          line++;
  272.         else
  273.          line = 1;
  274.         gotoxy(40,line);
  275.         break;
  276.           }
  277.          break;
  278.         case ESC:
  279.          if (newneur)
  280.           nn--;
  281.          goto start;
  282.         default:
  283.          break;
  284.        }
  285.      }
  286.     else
  287.      { /* process input */
  288.       if (line <= 7 ||
  289.          (tn.Iint && line >= 9 && line <= 15 &&
  290.           !(line == 12 && ti.type == 1)) ||
  291.          (tn.Isens && (line == 17) || (tn.Isens == OS && line == 18)) ||
  292.          (tn.mtype && (line == 21)))
  293.        { /* get numerical input */
  294.         gotoxy(40,line);
  295.         cputs("                   ");
  296.         gotoxy(40,line);
  297.         if (line == 1)
  298.          str[0] = 7;
  299.         else
  300.          str[0] = 15;
  301.         p = cgets(str);
  302.         if (line == 1)
  303.          {
  304.           strcpy(tn.name,p);
  305.           line = 3;
  306.           gotoxy(40,3);
  307.          }
  308.         else
  309.          {
  310.           d = atof(p);
  311.           gotoxy(40,line);
  312.           if (line == 18 || line == 17)
  313.            cprintf("%.4f",d);
  314.           else
  315.            cprintf("%.2f",d);
  316.           switch (line)
  317.            {
  318.         case 3: /* Gmem */
  319.          tn.Gmem = d * 1e-6;
  320.          break;
  321.         case 4: /* Cmem */
  322.          tn.Cmem = d * 1e-9;
  323.          break;
  324.         case 5: /* Vt */
  325.          tn.Vt = d * 1e-3;
  326.          break;
  327.         case 6: /* Fmin */
  328.          tn.Fmin = d;
  329.          break;
  330.         case 7: /* Gain */
  331.          tn.Gain = d * 1e3;
  332.          break;
  333.         case 9: /* IL */
  334.          ti.IL = d * 1e-9;
  335.          break;
  336.         case 10:
  337.          ti.pL[0] = d * 1e-3;
  338.          break;
  339.         case 11:
  340.          ti.pL[1] = d * 1e-3;
  341.          break;
  342.         case 12:
  343.          ti.pL[2] = d;
  344.          break;
  345.         case 13:
  346.          ti.IH = d * 1e-9;
  347.          break;
  348.         case 14:
  349.          ti.pH[0] = d * 1e-3;
  350.          break;
  351.         case 15:
  352.          ti.pH[1] = d * 1e-3;
  353.          break;
  354.         case 17:
  355.          tn.pI[0] = d * 1e-9;
  356.          break;
  357.         case 18:
  358.          tn.pI[1] = d * 1e-9;
  359.          break;
  360.         case 21:
  361.          tn.mconst = d;
  362.          break;
  363.         default:
  364.          break;
  365.            }
  366.           if (line < 22)
  367.            line++;
  368.           else
  369.            line = 3;
  370.           gotoxy(40,line);
  371.          }
  372.        }
  373.       else
  374.        bioskey(0);
  375.      }
  376.        }
  377.       else
  378.        {
  379.     ext = i>>8;
  380.     bioskey(0);
  381.     switch(ext)
  382.      {
  383.       case UP:
  384.        if (line > 1)
  385.         line--;
  386.        else
  387.         line = 22;
  388.        gotoxy(40,line);
  389.        break;
  390.       case DOWN:
  391.        if (line < 22)
  392.         line++;
  393.        else
  394.         line = 1;
  395.        gotoxy(40,line);
  396.        break;
  397.       default:
  398.        break;
  399.      }
  400.        }
  401.      }
  402.    }
  403.  }
  404.  
  405. void ndisp(struct neuron tn,struct Iint ti,int line)
  406.  { /* displays neuron parameters */
  407.  
  408.   clrscr();
  409.   cputs("Neuron name:");
  410.   gotoxy(40,1);
  411.   cprintf("%s",tn.name);
  412.   gotoxy(1,2);
  413.   cputs("Parameters:");
  414.   gotoxy(3,3);
  415.   cputs("Membrane conductance, Gmem [microS]:");
  416.   gotoxy(40,3);
  417.   cprintf("%.2f",tn.Gmem * 1e6);
  418.   gotoxy(3,4);
  419.   cputs("Membrane capacitance, Cmem [nanoF]:");
  420.   gotoxy(40,4);
  421.   cprintf("%.2f",tn.Cmem * 1e9);
  422.   gotoxy(3,5);
  423.   cputs("Threshold voltage, Vt [milliV]:");
  424.   gotoxy(40,5);
  425.   cprintf("%.2f",tn.Vt * 1e3);
  426.   gotoxy(3,6);
  427.   cputs("Minimum firing frequency, Fmin:");
  428.   gotoxy(40,6);
  429.   cprintf("%.2f",tn.Fmin);
  430.   gotoxy(3,7);
  431.   cputs("Gain [1/milliV]:");
  432.   gotoxy(40,7);
  433.   cprintf("%.2f",tn.Gain * 1e-3);
  434.   gotoxy(1,8);
  435.   cputs("Intrinsic current:");
  436.   gotoxy(40,8);
  437.   if (tn.Iint == NULL)
  438.    cputs("OFF");
  439.   else
  440.    {
  441.     if (ti.type == 0)
  442.      cputs("NON-RANDOM");
  443.     else
  444.      cputs("RANDOM");
  445.     gotoxy(3,9);
  446.     cputs("Low intrinsic current, LIC [nanoA]:");
  447.     gotoxy(40,9);
  448.     cprintf("%.2f",ti.IL * 1e9);
  449.     gotoxy(5,10);
  450.     if (ti.type == 0)
  451.      {
  452.       cputs("Threshold voltage [milliV]:");
  453.       gotoxy(40,10);
  454.       cprintf("%.2f",ti.pL[0] * 1e3);
  455.       gotoxy(5,11);
  456.       cputs("Base duration [millisec]:");
  457.       gotoxy(40,11);
  458.       cprintf("%.2f",ti.pL[1] * 1e3);
  459.       gotoxy(5,12);
  460.       cputs("Multiplier:");
  461.       gotoxy(40,12);
  462.       cprintf("%.2f",ti.pL[2]);
  463.      }
  464.     else
  465.      {
  466.       cputs("Minimum duration [millisec]:");
  467.       gotoxy(40,10);
  468.       cprintf("%.2f",ti.pL[0] * 1e3);
  469.       gotoxy(5,11);
  470.       cputs("Maximum duration [millisec]:");
  471.       gotoxy(40,11);
  472.       cprintf("%.2f",ti.pL[1] * 1e3);
  473.      }
  474.     gotoxy(3,13);
  475.     cputs("High intrinsic current, HIC [nanoA]:");
  476.     gotoxy(40,13);
  477.     cprintf("%.2f",ti.IH * 1e9);
  478.     gotoxy(5,14);
  479.     if (ti.type == 0)
  480.      {
  481.       cputs("Duration [millisec]:");
  482.       gotoxy(40,14);
  483.       cprintf("%.2f",ti.pH[0] * 1e3);
  484.      }
  485.     else
  486.      {
  487.       cputs("Minimum duration [millisec]:");
  488.       gotoxy(40,14);
  489.       cprintf("%.2f",ti.pH[0] * 1e3);
  490.       gotoxy(5,15);
  491.       cputs("Maximum duration [millisec]:");
  492.       gotoxy(40,15);
  493.       cprintf("%.2f",ti.pH[1] * 1e3);
  494.      }
  495.    }
  496.   gotoxy(1,16);
  497.   cputs("Sensory current function:");
  498.   gotoxy(40,16);
  499.   switch (tn.Isens)
  500.    {
  501.     case NONE:
  502.      cputs("NONE");
  503.      break;
  504.     case LAF:
  505.      cputs("LEG ANGLE FORWARD");
  506.      break;
  507.     case LAB:
  508.      cputs("LEG ANGLE BACKWARD");
  509.      break;
  510.     case AC:
  511.      cputs("ANTENNA CONTACT");
  512.      break;
  513.     case OS:
  514.      cputs("ODOR STRENGTH");
  515.      break;
  516.     case EC:
  517.      cputs("ENERGY CAPICITY");
  518.      break;
  519.     case MC:
  520.      cputs("MOUTH CONTACT");
  521.      break;
  522.    }
  523.   if (tn.Isens)
  524.    {
  525.     gotoxy(3,17);
  526.     cputs("Sensory current parameter 1 [nanoA]:");
  527.     gotoxy(40,17);
  528.     cprintf("%.4f",tn.pI[0] * 1e9);
  529.     if (tn.Isens == OS)
  530.      {
  531.       gotoxy(3,18);
  532.       cputs("Sensory current parameter 2 [nanoA]:");
  533.       gotoxy(40,18);
  534.       cprintf("%.4f",tn.pI[1] * 1e9);
  535.      }
  536.    }
  537.   gotoxy(1,19);
  538.   cputs("Motor output type:");
  539.   gotoxy(40,19);
  540.   if (tn.mtype == 0)
  541.    cputs("NONE");
  542.   else
  543.    {
  544.     if (tn.mtype == 1)
  545.      {
  546.       cputs("FORCE");
  547.       gotoxy(5,20);
  548.       cputs("Force type:");
  549.       gotoxy(40,20);
  550.       if (tn.mname == 0)
  551.        cputs("Forward");
  552.       else
  553.        if (tn.mname == 1)
  554.     cputs("Backward");
  555.        else
  556.     cputs("Lateral");
  557.       gotoxy(5,21);
  558.       cputs("Firing frequency multiplier:");
  559.       gotoxy(40,21);
  560.       cprintf("%.2f",tn.mconst);
  561.      }
  562.     else
  563.      {
  564.       cputs("STATE");
  565.       gotoxy(5,20);
  566.       cputs("State type:");
  567.       gotoxy(40,20);
  568.       if (tn.mname == 0)
  569.        cputs("Foot");
  570.       else
  571.        cputs("Mouth");
  572.       gotoxy(5,21);
  573.       cputs("Firing frequency threshold");
  574.       gotoxy(40,21);
  575.       cprintf("%.2f",tn.mconst);
  576.      }
  577.    }
  578.   gotoxy(1,22);
  579.   cputs("Connections:");
  580.   gotoxy(40,22);
  581.   cputs("MODIFY");
  582.   textattr(BLUE + (LIGHTGRAY<<4));
  583.   gotoxy(1,24);
  584.   cputs(" ^D-Delete neuron   ^S-Save neuron   Esc-New neuron                             ");
  585.   gotoxy(40,line);
  586.   textattr(LIGHTGRAY);
  587.  }
  588.  
  589. void conmod(char *nname,struct con *tc,int *cc)
  590.  { /* allows modification of neurons connections */
  591.   int i,j,done,line,field;
  592.   struct con *cp;
  593.   enum asc_val asc;
  594.   enum ext_val ext;
  595.   char str[10],*p;
  596.   double d;
  597.  
  598.   line = 3;
  599.   field = 0;
  600.   condisp(nname,tc,*cc,line,field);
  601.   done = FALSE;
  602.   while (!done)
  603.    {
  604.     cp = tc + line - 3;
  605.     i = 0;
  606.     while (!i)
  607.      i = bioskey(1);
  608.     asc = i & 0xff;
  609.     if (asc)
  610.      {
  611.       if (asc < 32)
  612.        {
  613.     bioskey(0);
  614.     switch (asc)
  615.      {
  616.       case CTRLD: /* delete connection */
  617.        for (j=line, cp=tc+line-2; j<=*cc+2; j++, cp++)
  618.         *(cp-1) = *cp;
  619.        (*cc)--;
  620.        condisp(nname,tc,*cc,line,field);
  621.        break;
  622.       case CR: /* change type */
  623.        if (field == 2)
  624.         {
  625.          cp->ctype++;
  626.          if (cp->ctype > 2)
  627.           cp->ctype = 0;
  628.          condisp(nname,tc,*cc,line,field);
  629.         }
  630.        else
  631.         if (cp->ctype == 1 && field == 5)
  632.          {
  633.           cp->U = !cp->U;
  634.           gotoxy(3 + field*10,line);
  635.           cprintf("%d",cp->U);
  636.           gotoxy(3 + field*10,line);
  637.          }
  638.        break;
  639.       case ESC: /* back to parameters */
  640.        done = TRUE;
  641.        break;
  642.       default:
  643.        break;
  644.      }
  645.        }
  646.       else
  647.        { /* enter connection data */
  648.     if (field == 2 || (field > 2 && !cp->ctype) || field == 5)
  649.      bioskey(0);
  650.     else
  651.      {
  652.       gotoxy(3 + field*10,line);
  653.       cputs("          ");
  654.       gotoxy(3 + field*10,line);
  655.       str[0] = 7;
  656.       p = cgets(str);
  657.       if (field == 1 || field == 4)
  658.        {
  659.         d = atof(p);
  660.         gotoxy(3 + field*10,line);
  661.         cprintf("%.2f",d);
  662.        }
  663.       switch (field)
  664.        {
  665.         case 0: /* sending neuron */
  666.          strcpy(cp->sname,p);
  667.          if (line == *cc + 3)
  668.           {
  669.            (*cc)++; /* add a new connection */
  670.            cp->Isr = 0.;
  671.            cp->ctype = 0;
  672.            cp->cname[0] = 0;
  673.            cp->Icr = 0;
  674.            cp->U = 0;
  675.            condisp(nname,tc,*cc,line,field);
  676.           }
  677.          break;
  678.         case 1: /* sending current */
  679.          cp->Isr = d * 1e-9;
  680.          break;
  681.         case 3: /* compound neuron */
  682.          strcpy(cp->cname,p);
  683.          break;
  684.         case 4: /* compound current */
  685.          cp->Icr = d * 1e-9;
  686.          break;
  687.        }
  688.       field++;
  689.       if (field > 5)
  690.        {
  691.         field = 0;
  692.         line++;
  693.        }
  694.       gotoxy(3 + field*10,line);
  695.      }
  696.        }
  697.      }
  698.     else
  699.      {
  700.       ext = i>>8;
  701.       bioskey(0);
  702.       switch (ext)
  703.        {
  704.     case UP:
  705.      if (line > 3)
  706.       line--;
  707.      else
  708.       {
  709.        line = *cc + 3;
  710.        if (line > 23);
  711.         line = 23;
  712.       }
  713.      break;
  714.     case DOWN:
  715.      if (line < *cc + 3 && line < 23)
  716.       line++;
  717.      else
  718.       line = 3;
  719.      break;
  720.     case RIGHT:
  721.      if (field < 5)
  722.       field++;
  723.      else
  724.       field = 0;
  725.      break;
  726.     case LEFT:
  727.      if (field > 0)
  728.       field--;
  729.      else
  730.       field = 5;
  731.      break;
  732.     default:
  733.      break;
  734.        }
  735.       gotoxy(3 + field*10,line);
  736.      }
  737.    }
  738.  }
  739.  
  740. void condisp(char *nname,struct con *tc,int cc,int line,int field)
  741.   { /* displays current neuron's connections */
  742.    int i;
  743.    struct con *cp;
  744.  
  745.    clrscr();
  746.    cprintf("Neuron name: %s",nname);
  747.    gotoxy(3,2);
  748.    cputs("Sending   Current   Type      Compound  Current   State");
  749.    for (i=0, cp=tc; i<cc; i++, cp++)
  750.     {
  751.      gotoxy(3,i+3);
  752.      cprintf("%-6s    %.2f",cp->sname,cp->Isr*1e9);
  753.      gotoxy(23,i+3);
  754.      if (cp->ctype == 0)
  755.       cputs("DIRECT");
  756.      else
  757.       if (cp->ctype == 1)
  758.        cputs("GATED");
  759.       else
  760.        cputs("MODULATED");
  761.      if (cp->ctype)
  762.       {
  763.        gotoxy(33,i+3);
  764.        cprintf("%-6s    %.2f",cp->cname,cp->Icr*1e9);
  765.        if (cp->ctype == 1)
  766.     {
  767.      gotoxy(53,i+3);
  768.      cprintf("%d",cp->U);
  769.     }
  770.       }
  771.     }
  772.    textattr(BLUE + (LIGHTGRAY<<4));
  773.    gotoxy(1,24);
  774.    cputs(" ^D-Delete connection   Esc-Return to parameters                                ");
  775.    textattr(LIGHTGRAY);
  776.    gotoxy(3 + field*10,line);
  777.  }
  778.