Changeset 13698
- Timestamp:
- Oct 8, 2019 4:03:53 PM (2 months ago)
- Location:
- branches/dev-5819/ModelicaCasADiInterface/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/dev-5819/ModelicaCasADiInterface/src/CompilerOptionsWrapper.cpp
r13252 r13698 69 69 while(iter.hasNext()){ 70 70 java::lang::String key(iter.next().this$); 71 out <<"\033[31m"<<env->to String(key.this$) <<"\033[0m"<< ": ";72 out << env->to String(optr.getDescription(key).this$);71 out <<"\033[31m"<<env->toPyUnicode(key.this$) <<"\033[0m"<< ": "; 72 out << env->toPyUnicode(optr.getDescription(key).this$); 73 73 out << "\n"; 74 74 } … … 89 89 } 90 90 91 void ModelicaOptionsWrapper::print(std::ostream& os) const { os << "ModelicaOptionsWrapper(" << env->to String(optr.this$) << ")"; }91 void ModelicaOptionsWrapper::print(std::ostream& os) const { os << "ModelicaOptionsWrapper(" << env->toPyUnicode(optr.this$) << ")"; } 92 92 93 93 void OptimicaOptionsWrapper::setStringOption(std::string opt, std::string val) { … … 130 130 while(iter.hasNext()){ 131 131 java::lang::String key(iter.next().this$); 132 out <<"\033[31m"<<env->to String(key.this$) <<"\033[0m"<< ": ";133 out << env->to String(optr.getDescription(key).this$);132 out <<"\033[31m"<<env->toPyUnicode(key.this$) <<"\033[0m"<< ": "; 133 out << env->toPyUnicode(optr.getDescription(key).this$); 134 134 out << "\n"; 135 135 } … … 150 150 } 151 151 152 void OptimicaOptionsWrapper::print(std::ostream& os) const { os << "OptimicaOptionsWrapper(" << env->to String(optr.this$) << ")"; }152 void OptimicaOptionsWrapper::print(std::ostream& os) const { os << "OptimicaOptionsWrapper(" << env->toPyUnicode(optr.this$) << ")"; } 153 153 }; // End namespace -
branches/dev-5819/ModelicaCasADiInterface/src/sharedTransferFunctionality.hpp
r11286 r13698 314 314 AbstractEquation eq = AbstractEquation(equationList.get(i).this$); 315 315 if (eq.isIgnoredForCasADi()) { 316 char *str = env->to String(eq.this$);316 char *str = env->toPyUnicode(eq.this$); 317 317 std::cerr << "Warning: Ignored equation:\n" << str << std::endl; 318 318 delete[] str; … … 448 448 if(fv.hasFStringComment()) { 449 449 Comment comment = Comment(fv.getFStringComment().this$); 450 var->setAttribute("comment", casadi::MX::sym(env->to String(comment.getComment().this$)));450 var->setAttribute("comment", casadi::MX::sym(env->toPyUnicode(comment.getComment().this$))); 451 451 } 452 452 } … … 466 466 for (int i = 0; i < attributeList.getNumChild(); ++i) { 467 467 attr = Attribute(attributeList.getChild(i).this$); 468 std::string name = env->to String(attr.name().this$);468 std::string name = env->toPyUnicode(attr.name().this$); 469 469 if (name != "stateSelect" && name.find("__") != 0) { 470 470 // Don't transfer stateSelect attribute, since enumerations are not supported … … 561 561 List attributeList = derivedType.getFAttributes(); 562 562 Attribute attr; 563 std::string typeName = env->to String(derivedType.getName().this$);564 std::string baseTypeName = env->to String((Type(derivedType.getBaseType().this$)).toString().this$);563 std::string typeName = env->toPyUnicode(derivedType.getName().this$); 564 std::string baseTypeName = env->toPyUnicode((Type(derivedType.getBaseType().this$)).toPyUnicode().this$); 565 565 ModelicaCasADi::Ref<ModelicaCasADi::UserType> userType = new ModelicaCasADi::UserType(typeName, getBaseTypeForDerivedType(m, baseTypeName)); 566 566 for (int i = 0; i < attributeList.getNumChild(); ++i) { 567 567 attr = Attribute(attributeList.getChild(i).this$); 568 userType->setAttribute(env->to String(attr.name().this$), toMX(attr.getValue()));568 userType->setAttribute(env->toPyUnicode(attr.name().this$), toMX(attr.getValue())); 569 569 } 570 570 m->addNewVariableType(userType); … … 607 607 { 608 608 ModelicaCasADi::Ref<ModelicaCasADi::UserType> userType; 609 if (!std::string(env->to String(fv.getDerivedType().this$)).empty()) {610 userType = (ModelicaCasADi::UserType*) m->getVariableType(env->to String(fv.getDerivedType().this$)).getNode();609 if (!std::string(env->toPyUnicode(fv.getDerivedType().this$)).empty()) { 610 userType = (ModelicaCasADi::UserType*) m->getVariableType(env->toPyUnicode(fv.getDerivedType().this$)).getNode(); 611 611 if(userType.getNode() == NULL) { 612 612 throw std::runtime_error("Variable's derived type not present in Model when Variable transferred"); … … 693 693 } 694 694 695 std::string aliasName = env->to String(fv.alias().name().this$);695 std::string aliasName = env->toPyUnicode(fv.alias().name().this$); 696 696 ModelicaCasADi::Ref<ModelicaCasADi::Variable> aliasVariable = m->getVariable(aliasName); 697 697 if (aliasVariable == NULL) { … … 725 725 FVar var = FVar(vars.get(i).this$); 726 726 if (var.type().isEnum()) { 727 char *str = env->to String(var.this$);727 char *str = env->toPyUnicode(var.this$); 728 728 std::cerr << "Warning: Ignored enumeration typed variable:\n" << str << std::endl; 729 729 delete[] str; -
branches/dev-5819/ModelicaCasADiInterface/src/transferModelica.cpp
r13252 r13698 174 174 StringFromUTF(modelName.c_str())); 175 175 176 std::string identfier = env->to String(fclass.nameUnderscore().this$);176 std::string identfier = env->toPyUnicode(fclass.nameUnderscore().this$); 177 177 // Initialize the model with the model identfier. 178 178 m->initializeModel(identfier); -
branches/dev-5819/ModelicaCasADiInterface/src/transferOptimica.cpp
r13252 r13698 172 172 StringFromUTF(modelName.c_str())).this$); 173 173 174 std::string identfier = env->to String(fclass.nameUnderscore().this$);174 std::string identfier = env->toPyUnicode(fclass.nameUnderscore().this$); 175 175 std::string option = "normalize_minimum_time_problems"; 176 176 bool normalizedTime = fclass.myOptions().getBooleanOption(StringFromUTF(option.c_str()));
Note: See TracChangeset
for help on using the changeset viewer.