| 1007 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1008 | |
| 1009 | string FGFunction::CreateOutputNode(Element* el, const string& Prefix) |
| 1010 | { |
| 1011 | string nName; |
| 1012 | |
| 1013 | if ( !Name.empty() ) { |
| 1014 | if (Prefix.empty()) |
| 1015 | nName = PropertyManager->mkPropertyName(Name, false); |
| 1016 | else { |
| 1017 | if (is_number(Prefix)) { |
| 1018 | if (Name.find("#") != string::npos) { // if "#" is found |
| 1019 | Name = replace(Name,"#",Prefix); |
| 1020 | nName = PropertyManager->mkPropertyName(Name, false); |
| 1021 | } else { |
| 1022 | FGXMLLogging log(el, LogLevel::ERROR); |
| 1023 | log << "Malformed function name with number: " << Prefix |
| 1024 | << " and property name: " << Name |
| 1025 | << " but no \"#\" sign for substitution.\n"; |
| 1026 | } |
| 1027 | } else { |
| 1028 | nName = PropertyManager->mkPropertyName(Prefix + "/" + Name, false); |
| 1029 | } |
| 1030 | } |
| 1031 | |
| 1032 | pNode = PropertyManager->GetNode(nName, true); |
| 1033 | if (pNode->isTied()) { |
| 1034 | XMLLogException err(el); |
| 1035 | err << "Property " << nName << " has already been successfully bound (late).\n"; |
| 1036 | throw err; |
| 1037 | } |
| 1038 | } |
| 1039 | |
| 1040 | return nName; |
| 1041 | } |
| 1042 | |
| 1043 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 1044 | |