Changeset 5227
- Timestamp:
- 08/13/10 09:39:36 (15 years ago)
- Location:
- issm/trunk/src/c/EnumDefinitions
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/EnumDefinitions/EnumToModelField.cpp
r5103 r5227 15 15 case ThicknessEnum : return "thickness"; 16 16 case DragCoefficientEnum : return "drag_coefficient"; 17 default : return "unknown";17 default : return ISSMERROR("No model field is associated to enum %s",EnumToString(en)); 18 18 } 19 19 } -
issm/trunk/src/c/EnumDefinitions/EnumToString.cpp
r5225 r5227 4 4 * 5 5 * WARNING: DO NOT MODIFY THIS FILE 6 * this file has been automatically generated by Synchronize Strings.sh6 * this file has been automatically generated by Synchronize.sh 7 7 * Please read README for more information 8 8 */ -
issm/trunk/src/c/EnumDefinitions/README
r5103 r5227 4 4 - EnumToString.cpp 5 5 - src/m/enum/* 6 all these files are automatically synchronized with EnumDefinitions.h 6 all these files are automatically synchronized with EnumDefinitions.h and EnumToModelField.cpp 7 7 8 8 TO ADD AN ENUM: 9 9 add 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 10 and execute synchronizing script. -
issm/trunk/src/c/EnumDefinitions/StringToEnum.cpp
r5225 r5227 4 4 * 5 5 * WARNING: DO NOT MODIFY THIS FILE 6 * this file has been automatically generated by Synchronize Strings.sh6 * this file has been automatically generated by Synchronize.sh 7 7 * Please read README for more information 8 8 */ -
issm/trunk/src/c/EnumDefinitions/Synchronize.sh
r5225 r5227 1 1 #!/bin/bash 2 2 #Synchronize EnumToString.cpp and StringToEnum.cpp 3 3 4 4 5 #first remove existing files … … 6 7 rm $ISSM_DIR/src/m/enum/*.m 7 8 8 echo "Synchronizing EnumToString..." 9 echo "Synchronizing Enums..." 10 11 #Take care of EnumToModelField.m first (easy) 12 #Build EnumToModelField.m {{{1 13 cat <<END > EnumToModelField.m 14 function 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 24 switch enum, 25 26 END 27 28 cat EnumToModelField.cpp | grep "case" | sed -e "s/Enum/Enum()/g" -e "s/\"/'/g" >> EnumToModelField.m 29 30 cat <<END >> EnumToModelField.m 31 otherwise, error(['Enum ' num2str(enum) ' not found associated to any model field']); 32 33 end 34 END 35 #}}} 36 9 37 #Get all lines of EnumDefinitions2.h which hold Enum | remove all comas | add line number in the first column > put everything in file temp 10 38 cat 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 … … 17 45 * 18 46 * WARNING: DO NOT MODIFY THIS FILE 19 * this file has been automatically generated by Synchronize Strings.sh47 * this file has been automatically generated by Synchronize.sh 20 48 * Please read README for more information 21 49 */ … … 38 66 * 39 67 * WARNING: DO NOT MODIFY THIS FILE 40 * this file has been automatically generated by Synchronize Strings.sh68 * this file has been automatically generated by Synchronize.sh 41 69 * Please read README for more information 42 70 */ … … 56 84 % 57 85 % WARNING: DO NOT MODIFY THIS FILE 58 % this file has been automatically generated by src/c/Synchronize MatlabEnum86 % this file has been automatically generated by src/c/Synchronize.sh 59 87 % Please read src/c/README for more information 60 88 % … … 72 100 % 73 101 % WARNING: DO NOT MODIFY THIS FILE 74 % this file has been automatically generated by src/c/Synchronize MatlabEnum102 % this file has been automatically generated by src/c/Synchronize.sh 75 103 % Please read src/c/README for more information 76 104 % … … 198 226 mv StringToEnum.m $ISSM_DIR/src/m/enum/ 199 227 mv EnumToString.m $ISSM_DIR/src/m/enum/ 228 mv EnumToModelField.m $ISSM_DIR/src/m/enum/ 200 229 #}}} 201 230 #clean up{{{
Note:
See TracChangeset
for help on using the changeset viewer.