Changeset 1395
- Timestamp:
- 03/12/12 18:49:05 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modelicaml/org.openmodelica.modelicaml.helper/src/org/openmodelica/modelicaml/helper/impl/VerificationModelsGenerator.java
r1253 r1395 16 16 import org.eclipse.uml2.uml.Class; 17 17 import org.eclipse.uml2.uml.Classifier; 18 import org.eclipse.uml2.uml.Comment; 18 19 import org.eclipse.uml2.uml.Element; 19 20 import org.eclipse.uml2.uml.NamedElement; … … 543 544 Object tolerance = testScenarioModel.getValue(sTestScenario, Constants.propertyName_tolerance); 544 545 simulationModel.setValue(sSimulation, Constants.propertyName_tolerance, tolerance); 546 547 Comment annotationExperimentComment = simulationModel.createOwnedComment(); 548 Stereotype annotationStereotype = annotationExperimentComment.getApplicableStereotype(Constants.stereotypeQName_Annotation); 549 if (annotationStereotype != null) { 550 551 // apply stereotype 552 annotationExperimentComment.applyStereotype(annotationStereotype); 553 554 // Example of a Modelica annotation string: annotation(experiment(StartTime = 0.0, StopTime = 150)); 555 556 String annotationString = "experiment("; 557 558 if (startTime!= null) {annotationString = annotationString + "StartTime=" + startTime.toString(); } 559 if (stopTime!= null) {annotationString = annotationString + ", StopTime=" + stopTime.toString(); } 560 //if (numberOfIntervals!= null) {annotationString = annotationString + ", Output=" + numberOfIntervals.toString(); } 561 if (tolerance!= null) {annotationString = annotationString + ", Tolerance=" + tolerance.toString(); } 562 563 annotationString = annotationString + ")"; 564 annotationExperimentComment.setBody(annotationString); 565 annotationExperimentComment.setValue(annotationStereotype, Constants.propertyName_fullAnnotationString, (Object)annotationString); 566 } 567 else { 568 // System.err.println("Could not access the annotation stereotype"); 569 } 545 570 } 546 571 }
Note: See TracChangeset
for help on using the changeset viewer.