Changeset 325 for trunk/org.modelica.mdt.omc/src/org/modelica
- Timestamp:
- 02/16/06 13:29:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/org.modelica.mdt.omc/src/org/modelica/mdt/omc/OMCProxy.java
r317 r325 91 91 92 92 private String[] standardLibraryPackages = { "Modelica" }; 93 93 94 94 /* should we trace the calls to sendExpression? */ 95 95 private static boolean traceOMCCalls = false; … … 484 484 return; 485 485 } 486 System.out.println( message);486 System.out.println("OMCSTATUS: " + message); 487 487 } 488 488 … … 527 527 String retval = sendExpression("getClassNames("+className+")"); 528 528 529 /* fetch error string but ignore it */ 530 getErrorString(); 531 529 532 return ModelicaParser.parseList(retval); 530 533 } … … 547 550 reply = reply.trim(); 548 551 reply = reply.substring(1, reply.length()-1); 552 553 /* fetch error string but ignore it */ 554 getErrorString(); 549 555 550 556 return IModelicaClass.Type.parse(reply); … … 586 592 ParseResults res = new ParseResults(); 587 593 588 // We need to call this to empty the error queue in OMC589 sendExpression("getMessagesString()");590 591 594 String fullName = file.getLocation().toString(); 592 595 String retval = 593 596 sendExpression("loadFileInteractiveQualified(\"" + fullName + "\")"); 594 597 595 String errorString = sendExpression("getMessagesString()"); 598 /* Always keep your stuff nice and tidy! */ 599 retval = retval.trim(); 596 600 597 601 /* 598 * See if there were parse errors 599 */ 600 if(retval.toLowerCase().contains("error") )602 * See if there were parse errors, an empty list {} also denotes error 603 */ 604 if(retval.toLowerCase().contains("error") || retval.equals("{}")) 601 605 { 602 606 res.setCompileErrors … … 614 618 /* 615 619 * If there were errors, but the compilation went through, 616 * collect the error messages. (Test if errorString == "") 617 */ 618 errorString = errorString.trim(); 619 if(errorString.equals("\"\"") == false) 620 { 621 errorString = errorString.substring(1, errorString.length() - 1); 620 * collect the error messages. (Test if errorString != "") 621 */ 622 String errorString = getErrorString(); 623 System.out.println("errorString: -->" + errorString + "<--"); 624 if(errorString.equals("") == false) 625 { 626 // errorString = errorString.trim(); 627 // errorString = errorString.substring(1, errorString.length() - 1); 628 System.out.println("setCompileErrors!!!"); 622 629 res.setCompileErrors(OMCParser.parseErrorString(errorString)); 623 630 } … … 641 648 String retval = sendExpression("getCrefInfo(" + className + ")"); 642 649 650 /* fetch error string but ignore it */ 651 getErrorString(); 652 643 653 if(retval.contains("Error") || retval.contains("error")) 644 654 { … … 680 690 { 681 691 throw new 682 UnexpectedReplyException(" can't parse getCrefInfo() reply, "+683 "unexpected format");692 UnexpectedReplyException("Can't parse getCrefInfo() reply, "+ 693 "unexpected format"); 684 694 } 685 695 … … 699 709 { 700 710 String retval = sendExpression("isPackage(" + className + ")"); 711 712 /* fetch error string but ignore it */ 713 getErrorString(); 714 701 715 return retval.contains("true"); 702 716 } … … 706 720 { 707 721 String retval = sendExpression("getElementsInfo("+ className +")"); 722 723 /* fetch error string but ignore it */ 724 getErrorString(); 708 725 709 726 /* … … 774 791 { 775 792 sendExpression("loadModel(Modelica)"); 793 794 /* fetch error string but ignore it */ 795 getErrorString(); 796 776 797 systemLibraryLoaded = true; 777 798 }
Note: See TracChangeset
for help on using the changeset viewer.