Changeset 379 for trunk/org.modelica.mdt.omc/src
- Timestamp:
- 02/27/06 09:26:12 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/org.modelica.mdt.omc/src/org/modelica/mdt/omc/OMCProxy.java
r376 r379 191 191 { 192 192 String pathToOmc = null; 193 File workingDirectory; 193 194 194 195 /* … … 213 214 pathToOmc = omHome + "\\omc.exe"; 214 215 } 216 217 /* We should start OMC from the OPENMODELICAHOME directory */ 218 workingDirectory = new File(omHome); 215 219 216 220 /* … … 230 234 { 231 235 logOMCStatus("Running command " + command[0] + " " + command[1]); 232 Runtime.getRuntime().exec(command );236 Runtime.getRuntime().exec(command, null, workingDirectory); 233 237 logOMCStatus("Command run successfully."); 234 238 } … … 247 251 if(os.equals("Unix")) 248 252 { 249 secondaryPathToOmc = omHome + "/ Compiler/omc";253 secondaryPathToOmc = omHome + "/build/bin/omc"; 250 254 } 251 255 else if(os.equals("Windows")) 252 256 { 253 secondaryPathToOmc = omHome + "\\ Compiler\\omc.exe";257 secondaryPathToOmc = omHome + "\\build\\bin\\omc.exe"; 254 258 } 255 259 … … 258 262 logOMCStatus("Running command " 259 263 + command[0] + " " + command[1]); 260 Runtime.getRuntime().exec(command );264 Runtime.getRuntime().exec(command, null, workingDirectory); 261 265 logOMCStatus("Command run successfully."); 262 266 } … … 533 537 * 534 538 * @param className full class name where to look for packages 535 * @return an array of subclasses defined (and loaded into OMC) 536 * inside the class named className, but don't return packages in this 537 * class. The results is returned as Vector of objects but objects 538 * are actually String's. 539 * 539 * @return a <code>List</code> of subclasses defined (and loaded into OMC) 540 * inside the class named className. 541 * 540 542 * @throws ConnectException 541 543 * @throws UnexpectedReplyException … … 559 561 * @return the restriction type of the class or Type.CLASS if 560 562 * type can't be determined 561 * @throws ConnectException 563 * @throws ConnectException 564 * @throws UnexpectedReplyException 562 565 */ 563 566 public IModelicaClass.Type getRestrictionType(String className) … … 597 600 /** 598 601 * Fetches the error string from OMC. This should be called after an "Error" 599 * is received. 600 * @return 602 * is received. (Or whenever the queue of errors should be emptied.) 603 * @return the <code>String</code> of errors 601 604 * @throws ConnectException 602 605 */ … … 605 608 { 606 609 String res = sendExpression("getErrorString()"); 607 if(res != null) 610 611 /* Make sure the error string isn't empty */ 612 if(res != null && res.length() > 2) 608 613 { 609 614 res = res.trim(); … … 619 624 * checked. 620 625 * @param file the file we want to load 621 * @return either returns the classes (and packages) found in the file or622 * the error messages from OMC626 * @return a <code>ParseResult</code> containing the classes found in the 627 * file and the error messages from OMC 623 628 * @throws ConnectException 624 629 * @throws UnexpectedReplyException … … 645 650 { 646 651 res.setClassNames(new List()); 647 res.setCompileErrors(OMCParser.parseErrorString(errorString)); 652 if(errorString.equals("") == false) 653 { 654 res.setCompileErrors(OMCParser.parseErrorString(errorString)); 655 } 648 656 } 649 657 /* … … 668 676 669 677 /** 670 * Gets the location (file, line number and column number) of a Modelica671 * element.678 * Gets the location (file, starting and ending line number and column 679 * number) of a Modelica element. 672 680 * @param className the element we want to get location of 673 * @return an IElementLocation containing the file, line number and column674 * number of the given class681 * @return an <code>ElementLocation</code> containing the file, starting and 682 * ending line number and column number of the given class 675 683 * @throws ConnectException 676 684 * @throws UnexpectedReplyException … … 688 696 { 689 697 throw new 690 InvocationError(" fetching file position of " + className,698 InvocationError("Fetching file position of " + className, 691 699 "getCrefInfo(" + className + ")"); 692 700 } … … 694 702 695 703 /* 696 * The getCrefInfo reply ha vethe following format:704 * The getCrefInfo reply has the following format: 697 705 * 698 706 * <file path>,<something>,<start line>,<start column>,<end line>,<end column> … … 736 744 * 737 745 * @param className fully qualified name of the class/package 738 * @return true if className is a package false otherwise746 * @return true if className is a package, false otherwise 739 747 * @throws ConnectException 740 748 */ … … 750 758 } 751 759 760 /** 761 * Uses the OMC API call getElementsInfo to fetch lots of information 762 * about a class definition. See interactive_api.txt in the OMC 763 * source tree. 764 * @param className the fully qualified name of a class 765 * @return a <code>Collection</code> (of <code>ElementsInfo</code>) 766 * containing the information about className 767 */ 752 768 public Collection<ElementsInfo> getElementsInfo(String className) 753 769 throws ConnectException, InvocationError, UnexpectedReplyException … … 807 823 } 808 824 809 825 /** 826 * @return the name of the compiler that this plugin tries to communicate 827 * with (at least it tries...) 828 */ 810 829 public String getCompilerName() 811 830 {
Note: See TracChangeset
for help on using the changeset viewer.