IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 19, 2006, 2:55:43 PM (20 years ago)
Author:
jhoblitt
Message:

VERSION to 0.30
add psTime support to the psdb templates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/glueforge/glueforge.in

    r8660 r9668  
    33# Copyright (C) 2005-2006  Joshua Hoblitt
    44#
    5 # $Id: glueforge.in,v 1.50 2006-08-28 23:50:20 jhoblitt Exp $
     5# $Id: glueforge.in,v 1.51 2006-10-20 00:55:43 jhoblitt Exp $
    66
    77use strict;
     
    9494    my $type = shift;
    9595
    96     my %primitives = map { $_ => 1 } qw( S8 S16 S32 S64 U8 U16 U32 U64 F32 F64 );
    97     my %mtypes = map { $_ => "PS_DATA_$_" } keys %primitives;
    98     my %ctypes = map { $_ => "ps$_" } keys %primitives;
     96    my %primitives = map { $_ => 1 }
     97            qw( S8 S16 S32 S64 U8 U16 U32 U64 F32 F64 );
     98    my %times = map { $_ => 1 } qw( UTC UT1 TAI TT );
     99    my %mtypes = (map({ $_ => "PS_DATA_$_" } keys %primitives),
     100                  map({ $_ => "PS_DATA_TIME" } keys %times));
     101    my %ctypes = (map({ $_ => "ps$_" } keys %primitives),
     102                  map({ $_ => "psTime*"} keys %times));
    99103
    100104    my %ttypes = (
     
    109113        F32     => 32.32,
    110114        F64     => 64.64,
     115        UTC     => '"0001-01-01T00:00:00Z"',
     116        UT1     => '"0001-01-01T00:00:00Z"',
     117        TAI     => '"0001-01-01T00:00:00Z"',
     118        TT      => '"0001-01-01T00:00:00Z"',
    111119    );
    112120
    113     if ( $primitives{$type} ) {
     121    if ($primitives{$type}) {
    114122        return {
    115123            ctype   => $ctypes{$type},
    116124            mtype   => $mtypes{$type},
    117125            test    => $ttypes{$type},
    118         };
     126        };
     127    }
     128    elsif ($times{$type}) {
     129        return {
     130            ctype   => $ctypes{$type},
     131            mtype   => $mtypes{$type},
     132            test    => $ttypes{$type},
     133            timetype => "PS_TIME_$type",
     134        };
    119135    } elsif ( $type =~ /STR|STRING/ ) {
    120136        return {
    121137            ctype   => "char*",
    122             mtype   => 'PS_DATA_STR',
     138            mtype   => 'PS_DATA_STRING',
    123139            test    => '"a string"',
    124140        };
     
    168184    my @items;
    169185
     186    # setup one table per nested metadata
     187    my @tables;
     188    foreach my $meta (@{$config}) {
     189        push @tables, tabledata_from_meta($meta);
     190    }
     191
     192=for off
    170193    # setup items
    171194    for (my $i = 0; $i < @{$config}; $i++) {
     
    176199
    177200        push @items, {
     201            %{$mdtypes},
    178202            name    => $elem->{name},
    179203            type    => $elem->{type},
    180             ctype   => $mdtypes->{ctype},
    181             mtype   => $mdtypes->{mtype},
    182             test    => $mdtypes->{test},
     204#            ctype   => $mdtypes->{ctype},
     205#            mtype   => $mdtypes->{mtype},
     206#            test    => $mdtypes->{test},
    183207            comment => $elem->{comment},
    184208            value   => $elem->{value},
    185209        };
    186210    }
     211=cut
    187212
    188213    $table{columns} = \@items;
     
    272297            name    => $column->{name},
    273298            type    => $column->{type},
    274             ctype   => $mdtypes->{ctype},
    275             mtype   => $mdtypes->{mtype},
    276             test    => $mdtypes->{test},
     299#            ctype   => $mdtypes->{ctype},
     300#            mtype   => $mdtypes->{mtype},
     301#            test    => $mdtypes->{test},
    277302            comment => $column->{comment},
    278303            value   => $column->{value},
     304            %{$mdtypes},
    279305        };
    280306    }
Note: See TracChangeset for help on using the changeset viewer.