Changeset 5227


Ignore:
Timestamp:
08/13/10 09:39:36 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added EnumToModelField.cpp Synchronization

Location:
issm/trunk/src/c/EnumDefinitions
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/EnumDefinitions/EnumToModelField.cpp

    r5103 r5227  
    1515                case ThicknessEnum : return "thickness";
    1616                case DragCoefficientEnum : return "drag_coefficient";
    17                 default : return "unknown";
     17                default : return ISSMERROR("No model field is associated to enum %s",EnumToString(en));
    1818        }
    1919}
  • issm/trunk/src/c/EnumDefinitions/EnumToString.cpp

    r5225 r5227  
    44*
    55*   WARNING: DO NOT MODIFY THIS FILE
    6 *            this file has been automatically generated by SynchronizeStrings.sh
     6*            this file has been automatically generated by Synchronize.sh
    77*            Please read README for more information
    88*/
  • issm/trunk/src/c/EnumDefinitions/README

    r5103 r5227  
    44- EnumToString.cpp
    55- src/m/enum/*
    6 all these files are automatically synchronized with EnumDefinitions.h
     6all these files are automatically synchronized with EnumDefinitions.h and EnumToModelField.cpp
    77
    88TO ADD AN ENUM:
    99add the corresponding lines to EnumDefinitions.h
    10 and executes the 2 synchronizing scripts.
    11 
    12 SYNCHRONIZEMATLABENUM
    13 This script synchronizes all matlab enums from EnumDefinitions.h
    14 
    15 SYNCHRONIZESTRINGS
    16 This scrpit synchronizes StringToEnum.cpp and EnumToString.cpp according to EnumDefinitions.h
     10and execute synchronizing script.
  • issm/trunk/src/c/EnumDefinitions/StringToEnum.cpp

    r5225 r5227  
    44*
    55*   WARNING: DO NOT MODIFY THIS FILE
    6 *            this file has been automatically generated by SynchronizeStrings.sh
     6*            this file has been automatically generated by Synchronize.sh
    77*            Please read README for more information
    88*/
  • issm/trunk/src/c/EnumDefinitions/Synchronize.sh

    r5225 r5227  
    11#!/bin/bash
    22#Synchronize EnumToString.cpp and StringToEnum.cpp
     3
    34
    45#first remove existing files
     
    67rm $ISSM_DIR/src/m/enum/*.m
    78
    8 echo "Synchronizing EnumToString..."
     9echo "Synchronizing Enums..."
     10
     11#Take care of EnumToModelField.m first (easy)
     12#Build EnumToModelField.m {{{1
     13cat <<END > EnumToModelField.m
     14function string=EnumToModelField(enum)
     15%ENUMTOMODELFIELD - output string of model field associated to enum
     16%
     17%   WARNING: DO NOT MODIFY THIS FILE
     18%            this file has been automatically generated by src/c/Synchronize.sh
     19%            Please read src/c/README for more information
     20%
     21%   Usage:
     22%      string=EnumToModelField(enum)
     23
     24switch enum,
     25
     26END
     27
     28cat EnumToModelField.cpp | grep "case" | sed -e "s/Enum/Enum()/g" -e "s/\"/'/g" >> EnumToModelField.m
     29
     30cat <<END >> EnumToModelField.m
     31otherwise, error(['Enum ' num2str(enum)  ' not found associated to any model field']);
     32
     33end
     34END
     35#}}}
     36
    937#Get all lines of EnumDefinitions2.h which hold Enum | remove all comas | add line number in the first column > put everything in file temp
    1038cat EnumDefinitions.h | grep -e "[0-9]Enum" -e "[Aa-Zz]Enum" | grep -v StringToEnum | sed -e "s/,//g" | awk '{ printf "%s %s\n", NR, $0 }' > temp
     
    1745*
    1846*   WARNING: DO NOT MODIFY THIS FILE
    19 *            this file has been automatically generated by SynchronizeStrings.sh
     47*            this file has been automatically generated by Synchronize.sh
    2048*            Please read README for more information
    2149*/
     
    3866*
    3967*   WARNING: DO NOT MODIFY THIS FILE
    40 *            this file has been automatically generated by SynchronizeStrings.sh
     68*            this file has been automatically generated by Synchronize.sh
    4169*            Please read README for more information
    4270*/
     
    5684%
    5785%   WARNING: DO NOT MODIFY THIS FILE
    58 %            this file has been automatically generated by src/c/SynchronizeMatlabEnum
     86%            this file has been automatically generated by src/c/Synchronize.sh
    5987%            Please read src/c/README for more information
    6088%
     
    72100%
    73101%   WARNING: DO NOT MODIFY THIS FILE
    74 %            this file has been automatically generated by src/c/SynchronizeMatlabEnum
     102%            this file has been automatically generated by src/c/Synchronize.sh
    75103%            Please read src/c/README for more information
    76104%
     
    198226mv StringToEnum.m         $ISSM_DIR/src/m/enum/
    199227mv EnumToString.m         $ISSM_DIR/src/m/enum/
     228mv EnumToModelField.m     $ISSM_DIR/src/m/enum/
    200229#}}}
    201230#clean up{{{
Note: See TracChangeset for help on using the changeset viewer.