Changeset 640
- Timestamp:
- 12/05/16 02:31:34 (8 years ago)
- Location:
- cpp/frams
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/model/modelparts.cpp
r637 r640 159 159 { 160 160 if (i) t+="\n"; 161 t+=" "; t+=p.name(i); t+=" ("; t+=p.id(i); t+=")"; 162 switch(*p.type(i)) 163 { 164 case 'd': t+=" integer"; 165 {paInt a,b,c; int n=p.getMinMax(i,a,b,c); if (n>=2) t+=SString::sprintf(" %d..%d",a,b); if (n>=3) t+=SString::sprintf(" (default %d)",c);} 166 break; 167 case 'f': t+=" float"; 168 {double a,b,c; int n=p.getMinMax(i,a,b,c); if (n>=2) t+=SString::sprintf(" %g..%g",a,b); if (n>=3) t+=SString::sprintf(" (default %g)",c);} 169 break; 170 case 's': t+=" string"; 171 {int a,b; SString c; int n=p.getMinMax(i,a,b,c); if ((n>=2)&&(b>0)) t+=SString::sprintf(", max %d chars",b); if (n>=3) t+=SString::sprintf(" (default \"%s\")",c.c_str());} 172 break; 173 case 'x': t+=" anything"; break; 174 } 161 t+=" "; t+=p.name(i); t+=" ("; t+=p.id(i); t+=") "; 162 t+=p.describeType(i); 175 163 if (h=p.help(i)) if (*h) {t+=" - "; t+=h;} 176 164 } -
cpp/frams/param/param.cpp
r574 r640 739 739 } 740 740 741 SString ParamInterface::describeType(const char* type) 742 { 743 SString t; 744 switch(type[0]) 745 { 746 case 'd': t+="integer"; 747 {paInt a,b,c; int n=getMinMax(type,a,b,c); if (n>=2) t+=SString::sprintf(" %d..%d",a,b); if (n>=3) t+=SString::sprintf(" (default %d)",c);} 748 break; 749 case 'f': t+="float"; 750 {double a,b,c; int n=getMinMax(type,a,b,c); if (n>=2) t+=SString::sprintf(" %g..%g",a,b); if (n>=3) t+=SString::sprintf(" (default %g)",c);} 751 break; 752 case 's': t+="string"; 753 {int a,b; SString c; int n=getMinMax(type,a,b,c); if ((n>=2)&&(b>0)) t+=SString::sprintf(", max %d chars",b); if (n>=3) t+=SString::sprintf(" (default \"%s\")",c.c_str());} 754 break; 755 case 'x': t+="untyped value"; break; 756 case 'p': t+="function"; break; 757 case 'o': t+="object"; if (type[1]) {t+=" of class "; t+=type+1;} break; 758 default: return "unknown type"; 759 } 760 return t; 761 } 762 741 763 //////////////////////////////// PARAM //////////////////////////////////// 742 764 -
cpp/frams/param/param.h
r574 r640 155 155 void setMax(int i); 156 156 157 /** return the human readable description of the given type */ 158 static SString describeType(const char* type); 159 SString describeType(int i) {return describeType(type(i));} 160 157 161 /** copy all property values from other ParamInterface object */ 158 162 void copyFrom(ParamInterface *src);
Note: See TracChangeset
for help on using the changeset viewer.