IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 19, 2006, 5:23:56 PM (20 years ago)
Author:
eugene
Message:

added latex bits to def files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libautocode/generate

    r5900 r6454  
    2323    $TIMEOUT = 0;
    2424
     25    &init_key ("DESCRIPTION");
    2526    &init_key ("TIMEOUT");
    26     &init_key ("NAME");
    2727    &init_key ("EXTNAME");
    2828    &init_key ("STRUCT");
     29    &init_key ("NAME");
    2930    &init_key ("FILE");
    3031    &init_key ("SIZE");
     
    4344        &set_keypair ($key, $value);
    4445
    45         # there are used internally (not just a replacement)
     46        # these are used internally (not just a replacement)
    4647        if ($key eq "TYPE")    { $TYPE = $value;   }
    4748        if ($key eq "SIZE")    { $SIZE = $value;   }
     
    8384        if ($line =~ m|/\*\* STRUCT DEFINITION \*\*/|) {
    8485            &write_structure;
     86        }
     87
     88        # fill in latex table description
     89        if ($line =~ m|%%% LATEX TABLE DEFINITION|) {
     90            &write_latex;
    8591        }
    8692
     
    141147    }
    142148
     149}
     150
     151sub write_latex {
     152
     153    for ($i = 0; $i < @field; $i++) {
     154        # skip SUBSTRUCT type of entries:
     155        if ($mode[$i] eq "SUBSTRUCT") { next; }
     156
     157        ($type, $Np) = &get_type_array ($format[$i]);
     158
     159        if ($type eq "e_time")        { $type = "unsigned int"; }
     160
     161        # print STDOUT "$field[$i] .. $type[$i] .. $comment[$i] .. $unit[$i]\n";
     162
     163        printf FILE "%-20s & ",       "\\code{$field[$i]} ";
     164        printf FILE "%-20s & ",       "$type";
     165        printf FILE "%-35s & ",       "$comment[$i]";
     166        printf FILE "%-20s \\\\ \n",  "$unit[$i]";
     167    }
    143168}
    144169
Note: See TracChangeset for help on using the changeset viewer.