version="0.0.0"/>\r
\r
<includes\r
- id="org.simantics.operating"\r
- version="0.0.0"\r
- optional="true"/>\r
+ id="org.simantics.eclipsec.launcher"\r
+ version="0.0.0"/>\r
\r
<plugin\r
id="org.simantics.objmap"\r
id="org.simantics.fmu.me.win32"\r
download-size="0"\r
install-size="0"\r
+ version="0.0.0"/>\r
+<!--\r
+ <plugin\r
+ id="org.simantics.document.ontology2"\r
+ download-size="0"\r
+ install-size="0"\r
version="0.0.0"\r
unpack="false"/>\r
\r
+ <plugin\r
+ id="org.simantics.document.server"\r
+ download-size="0"\r
+ install-size="0"\r
+ version="0.0.0"\r
+ unpack="false"/>\r
+\r
+ <plugin\r
+ id="org.simantics.document.vaadin"\r
+ download-size="0"\r
+ install-size="0"\r
+ version="0.0.0"\r
+ unpack="false"/>\r
+\r
+ <plugin\r
+ id="org.simantics.document.workbench"\r
+ download-size="0"\r
+ install-size="0"\r
+ version="0.0.0"\r
+ unpack="false"/>\r
+\r
+ <plugin\r
+ id="org.simantics.document.workbench.ontology"\r
+ download-size="0"\r
+ install-size="0"\r
+ version="0.0.0"\r
+ unpack="false"/>\r
+\r
+ <plugin\r
+ id="org.simantics.views2.swt"\r
+ download-size="0"\r
+ install-size="0"\r
+ version="0.0.0"\r
+ unpack="false"/>\r
+\r
+ <plugin\r
+ id="org.simantics.swt.ontology"\r
+ download-size="0"\r
+ install-size="0"\r
+ version="0.0.0"\r
+ unpack="false"/>\r
+-->\r
</feature>\r
</with>\r
</visibleWhen>\r
</command>\r
- -->\r
+ -->\r
</menu>\r
<dynamic\r
class="org.simantics.ui.contribution.OpenWithMenuContribution"\r
"http://www.simantics.org/Sysdyn-1.1/Browser", \r
/*"http://www.simantics.org/Operating-1.1/Browser", \r
* Operating interfaces are not functioning properly. They have not been maintained. */ \r
- "http://www.simantics.org/Documentation-1.1/OldBrowser",\r
+ "http://www.simantics.org/DocumentWorkbench-1.0/OldBrowser",\r
"http://www.simantics.org/Image-1.1/Browser")); \r
\r
private BinaryFunction<Object[], GraphExplorer, Object[]> selectionTransformation = new BinaryFunction<Object[], GraphExplorer, Object[]>() {\r
for(String r : rangeComponents) {\r
r = r.trim();\r
boolean componentIsValid = false;\r
- for(EnumerationIndex ei : enumerations.get(i).getEnumerationIndexes()) {\r
+ Enumeration enumeration = enumerations.get(i);\r
+ for(EnumerationIndex ei : enumeration.getEnumerationIndexes()) {\r
if(ei.getName().equals(r)) {\r
componentIsValid = true;\r
break;\r
try {\r
int index = Integer.parseInt(r);\r
int min = 1;\r
- int max = enumerations.get(i).getEnumerationIndexes().size();\r
- if(index >= min && index <= max) {\r
+ int max = enumeration.getEnumerationIndexes().size();\r
+ if(index >= min && index <= max || enumeration.isReplaceable()) {\r
componentIsValid = true;\r
error = new SyntaxError();\r
error.setMessage("Using numbers as array indexes is not encouraged");\r
result.put(i, error);\r
} else {\r
error = new SyntaxError();\r
- error.setMessage("Invalid array index " + index + ". Numbered index must be between " + min + " and " + max + " unless the enumeration is overridden. In that case, ignore this warning.");\r
+ error.setMessage("Invalid array index " + index + ". Numbered index must be between " + min + " and " + max);\r
error.setType(ExpressionField.SYNTAX_ERROR);\r
result.put(i, error);\r
}\r
\r
private class simulateDurationJob extends Job {\r
\r
+ private boolean canceled = false;\r
private double duration;\r
private final SysdynGameExperiment experiment;\r
public simulateDurationJob(String name, SysdynGameExperiment experiment, double duration) {\r
this.duration = duration;\r
this.experiment = experiment;\r
}\r
+ \r
+ @Override\r
+ protected void canceling() {\r
+ canceled = true;\r
+ }\r
\r
@Override\r
protected IStatus run(IProgressMonitor monitor) {\r
monitor.worked(1);\r
\r
int stepNumber = 1;\r
- while(control.getTime() < (eTime - 1e-9)) { // Substract a very small number, because OpenModelica is not very precise with its Real numbers\r
+ while(control.getTime() < (eTime - 1e-9) && !canceled) { // Substract a very small number, because OpenModelica is not very precise with its Real numbers\r
monitor.subTask("Simulate step (time = " + control.getTime() + ")");\r
control.simulateStep();\r
monitor.worked(1);\r
StringBuilder redeclarations = new StringBuilder();\r
if(!getRedeclarations().isEmpty()) {\r
\r
+ boolean first = true;\r
Iterator<Redeclaration> i = getRedeclarations().iterator();\r
while(i.hasNext()) {\r
Redeclaration rd = i.next();\r
- redeclarations.append(rd.getRedeclaration());\r
- if(i.hasNext())\r
- redeclarations.append(",");\r
+ String redeclaration = rd.getRedeclaration();\r
+ if(redeclaration != null && !redeclaration.isEmpty()) {\r
+ if(!first) {\r
+ redeclarations.append(",");\r
+ } else {\r
+ first = false;\r
+ }\r
+ redeclarations.append(redeclaration);\r
+ }\r
}\r
}\r
return redeclarations.toString();\r
}\r
\r
private void addRange(String key, HashSet<String> usedCells, StringBuilder clazz) {\r
- usedCells.add(key);\r
- Object value = cells.get(key);\r
- if(value instanceof String || value instanceof MutableString) {\r
- try {\r
- Double d = Double.parseDouble(value.toString());\r
- value = d;\r
- } catch (NumberFormatException e) {\r
- }\r
- } \r
+ if(usedCells.add(key)) {\r
+ Object value = cells.get(key);\r
+ if(value instanceof String || value instanceof MutableString) {\r
+ try {\r
+ Double d = Double.parseDouble(value.toString());\r
+ value = d;\r
+ } catch (NumberFormatException e) {\r
+ }\r
+ } \r
\r
- if(value instanceof Double) {\r
- Double d = (Double)value;\r
- clazz.append(" parameter Real " + key + " = " + d + " /* Actual value read from init file */;\n");\r
+ if(value instanceof Double) {\r
+ Double d = (Double)value;\r
+ clazz.append(" parameter Real " + key + " = " + d + " /* Actual value read from init file */;\n");\r
+ }\r
}\r
}\r
\r
if(rangeToken.matches("[\\[\\]:]")) {\r
sb.append(rangeToken);\r
} else if (rangeToken.equals(",")) {\r
- sb.append(rangeToken);\r
- index++;\r
- } else if(rangeToken.equals(enumerations.get(index).getName())) {\r
- sb.append(":");\r
+ sb.append(rangeToken);\r
+ index++;\r
+ } else if(index < enumerations.size()) {\r
+ if(rangeToken.equals(enumerations.get(index).getName())) {\r
+ sb.append(":");\r
+ } else {\r
+ int i = indexOf(enumerations.get(index), rangeToken);\r
+ if(i >= 0)\r
+ sb.append(i);\r
+ else\r
+ sb.append(rangeToken);\r
+ }\r
} else {\r
- int i = indexOf(enumerations.get(index), rangeToken);\r
- if(i >= 0)\r
- sb.append(i);\r
- else\r
- sb.append(rangeToken);\r
+ sb.append(rangeToken);\r
}\r
-\r
}\r
return sb.toString();\r
}\r