Changeset 1234 for trunk/org.modelica.mdt.omc/src/org/modelica/mdt
- Timestamp:
- 01/24/12 21:24:44 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/org.modelica.mdt.omc/src/org/modelica/mdt/omc/OMCProxy.java
r1175 r1234 128 128 private boolean systemLibraryLoaded = false; 129 129 130 private ArrayList<String> standardLibraryPackages = null;130 private java.util.List<String> standardLibraryPackages = null; 131 131 132 132 /* should we trace the calls to sendExpression? */ 133 private boolean traceOMCCalls= false;134 private 135 136 private 137 private 138 private 139 private 133 private boolean traceOMCCalls = false; 134 private boolean traceOMCStatus = true; 135 136 private boolean traceStatusPreferences = false; 137 private boolean traceCommandsPreferences = false; 138 private boolean traceErrorPreferences = false; 139 private boolean traceReplyPrefereces = false; 140 140 141 141 { … … 638 638 639 639 /** 640 * outputs the message about a call error that occur ed640 * outputs the message about a call error that occurred 641 641 * when communicating with omc 642 642 * @param message the message to log … … 962 962 endLine = Integer.parseInt(tokens.elementAt(4).toString()); 963 963 endColumn = Integer.parseInt(tokens.elementAt(5).toString()); 964 964 965 965 if (startColumn == 0) { 966 966 assert(startLine == 1); … … 1050 1050 else 1051 1051 { 1052 /* OMC returned somet ing wierd, panic mode ! */1052 /* OMC returned something weird, panic mode ! */ 1053 1053 break; 1054 1054 } … … 1122 1122 * the server 1123 1123 */ 1124 public String[] getStandardLibrary() throws ConnectException 1125 { 1126 String openModelicaLibrary = System.getenv("OPENMODELICALIBRARY"); 1127 if (openModelicaLibrary != null) 1128 { 1129 File path = new File(openModelicaLibrary); 1130 ArrayList<String> libs = new ArrayList<String>(); 1131 for (File f: path.listFiles()) if (f.isDirectory()) libs.add(f.getName()); 1132 standardLibraryPackages = libs; 1133 } 1134 1135 if (!systemLibraryLoaded) 1136 { 1137 if (standardLibraryPackages == null) 1138 { 1139 ArrayList<String> libs = new ArrayList<String>(); 1140 libs.add("Modelica"); 1141 standardLibraryPackages = libs; 1142 } 1143 for (Object lib : standardLibraryPackages) 1144 { 1145 sendExpression("loadModel("+(String)lib+")", true); 1146 1147 } 1124 public String[] getStandardLibrary() throws ConnectException { 1125 if (!systemLibraryLoaded) { 1126 if (standardLibraryPackages == null) { 1127 standardLibraryPackages = new ArrayList<String>(); 1128 standardLibraryPackages.add("Modelica"); 1129 } 1130 1131 sendExpression("loadModel(Modelica)", true); 1148 1132 1149 1133 systemLibraryLoaded = true; 1150 1134 } 1151 1135 1152 return (String[]) standardLibraryPackages.toArray(new String[standardLibraryPackages.size()]); 1136 String[] arr = standardLibraryPackages.toArray(new String[0]); 1137 1138 return arr; 1153 1139 } 1154 1140
Note: See TracChangeset
for help on using the changeset viewer.