L0 = <http://www.simantics.org/Layer0-1.0>
+L0X = <http://www.simantics.org/Layer0X-1.0>
G2D = <http://www.simantics.org/G2D-1.0>
STR = <http://www.simantics.org/Structural-1.0>
DIA = <http://www.simantics.org/Diagram-2.0>
SYSDYN.Symbols : L0.Library
SYSDYN.SysdynConnectionType : STR.ConnectionType
-SYSDYN.DiagramToCompositeMapping <T L0.Trigger
+SYSDYN.DiagramToCompositeMapping <T L0X.Trigger
SYSDYN.ConfigurationDiagram <T DIA.Diagram
@L0.assert STR.HasModelingRules SYSDYN.SysdynDiagramModelingRules
SYSDYN.SymbolReferences : DIA.SymbolReferenceLibrary
BasicSymbols = SYSDYN.SymbolReferences.BasicSymbols : DIA.SymbolReferenceLibrary
-SYSDYN.Configuration <T STR.Composite <T L0.Realization
+SYSDYN.Configuration <T STR.Composite <T L0X.Realization
// TODO [L0.ConsistsOf all (Variable or Dependency or Module)]
-SYSDYN.HistoryRealization <T L0.Realization
-SYSDYN.DefaultRealization <T L0.Realization
+SYSDYN.HistoryRealization <T L0X.Realization
+SYSDYN.DefaultRealization <T L0X.Realization
//#####################################################################
// Variables
//#####################################################################
SYSDYN.Variable <T STR.Component
- @L0.singleProperty L0.HasType
+ @L0.singleProperty SYSDYN.Variable.Type
@L0.optionalProperty SYSDYN.HasArrayIndexes
@L0.optionalProperty SYSDYN.HasExpressions
@L0.assert L0.HasDataType $Double
+SYSDYN.Variable.Type <R L0.HasProperty
+ L0.HasDomain SYSDYN.Variable
+ L0.HasRange L0.String
SYSDYN.HasExpressions <R L0.DependsOn : L0.FunctionalRelation
L0.HasDomain SYSDYN.Variable
@L0.singleProperty SYSDYN.HasExpressions
SYSDYN.Auxiliary <T SYSDYN.IndependentVariable
- @L0.assert L0.HasType "Real"
+ @L0.assert SYSDYN.Variable.Type "Real"
SYSDYN.Valve <T SYSDYN.IndependentVariable
- @L0.assert L0.HasType "Real"
+ @L0.assert SYSDYN.Variable.Type "Real"
SYSDYN.Stock <T SYSDYN.IndependentVariable
- @L0.assert L0.HasType "Real"
+ @L0.assert SYSDYN.Variable.Type "Real"
SYSDYN.Cloud <T SYSDYN.Variable
@L0.optionalProperty L0.HasDescription
@L0.optionalProperty SYSDYN.HasUnit
@L0.assert SYSDYN.HasDefaultInputValue 0.0
- @L0.assert L0.HasType "Real"
+ @L0.assert SYSDYN.Variable.Type "Real"
SYSDYN.Enumeration <T SYSDYN.Variable
@L0.singleProperty SYSDYN.HasEnumerationIndexes
- @L0.assert L0.HasType "type"
+ @L0.assert SYSDYN.Variable.Type "type"
@L0.assert SYSDYN.IsReplaceable false
L0 = <http://www.simantics.org/Layer0-1.0>\r
+L0X = <http://www.simantics.org/Layer0X-1.0>\r
G2D = <http://www.simantics.org/G2D-1.0>\r
STR = <http://www.simantics.org/Structural-1.0>\r
DIA = <http://www.simantics.org/Diagram-2.0>\r
@L0.symmetric\r
DIA.HasVisibleTag TAGS.AdminIsVisible <R DIA.IsVisible\r
@L0.symmetric\r
- L0.HasTrigger _ : SYSDYN.DiagramToCompositeMapping\r
+ L0X.HasTrigger _ : SYSDYN.DiagramToCompositeMapping\r
// DIA.NavigationEnabled "false" \r
@L0.list\r
WorkforceElement : WM.WorkforceSymbol\r
DIA.HasFocusableTag TAGS.AdminIsFocusable\r
DIA.HasVisibleTag TAGS.AdminIsVisible\r
*/\r
- L0.HasTrigger _ : SYSDYN.DiagramToCompositeMapping\r
+ L0X.HasTrigger _ : SYSDYN.DiagramToCompositeMapping\r
@L0.list\r
WorkCompletionTimeInputElement : SYSDYN.InputSymbol\r
MOD.ElementToComponent WMC.WorkCompletionTimeInput\r
DIA.HasFocusableTag TAGS.AdminIsFocusable\r
DIA.HasVisibleTag TAGS.AdminIsVisible\r
*/\r
- L0.HasTrigger _ : SYSDYN.DiagramToCompositeMapping\r
+ L0X.HasTrigger _ : SYSDYN.DiagramToCompositeMapping\r
\r
@L0.list\r
TimeToAllocateResourcesElement : SYSDYN.AuxiliarySymbol\r
public final Resource Valve;\r
public final Resource ValveSymbol;\r
public final Resource Variable;\r
+ public final Resource Variable_Type;\r
+ public final Resource Variable_Type_Inverse;\r
public final Resource WithLookupExpression;\r
public final Resource angle;\r
public final Resource angle_Inverse;\r
public static final String Valve = "http://www.simantics.org/Sysdyn-1.0/Valve";\r
public static final String ValveSymbol = "http://www.simantics.org/Sysdyn-1.0/ValveSymbol";\r
public static final String Variable = "http://www.simantics.org/Sysdyn-1.0/Variable";\r
+ public static final String Variable_Type = "http://www.simantics.org/Sysdyn-1.0/Variable/Type";\r
+ public static final String Variable_Type_Inverse = "http://www.simantics.org/Sysdyn-1.0/Variable/Type/Inverse";\r
public static final String WithLookupExpression = "http://www.simantics.org/Sysdyn-1.0/WithLookupExpression";\r
public static final String angle = "http://www.simantics.org/Sysdyn-1.0/angle";\r
public static final String angle_Inverse = "http://www.simantics.org/Sysdyn-1.0/angle/Inverse";\r
Valve = getResourceOrNull(graph, URIs.Valve);\r
ValveSymbol = getResourceOrNull(graph, URIs.ValveSymbol);\r
Variable = getResourceOrNull(graph, URIs.Variable);\r
+ Variable_Type = getResourceOrNull(graph, URIs.Variable_Type);\r
+ Variable_Type_Inverse = getResourceOrNull(graph, URIs.Variable_Type_Inverse);\r
WithLookupExpression = getResourceOrNull(graph, URIs.WithLookupExpression);\r
angle = getResourceOrNull(graph, URIs.angle);\r
angle_Inverse = getResourceOrNull(graph, URIs.angle_Inverse);\r
import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.ui.DoubleClickEvent;\r
import org.simantics.ui.IDoubleClickAction;\r
public void doubleClickEvent(DoubleClickEvent e) throws DatabaseException {\r
ReadGraph g = e.getGraph();\r
Layer0 l0 = Layer0.getInstance(g);\r
+ Layer0X L0X = Layer0X.getInstance(g);\r
final Resource resource = ResourceAdaptionUtils.toSingleResource(e.getResource());\r
if(resource == null)\r
return;\r
\r
if(g.isInstanceOf(resource, sr.SysdynModel) || g.isInstanceOf(resource, sr.Variable)) {\r
consume(e);\r
- } else if(g.hasStatement(resource, l0.Represents)){\r
- Resource represents = g.getSingleObject(resource, l0.Represents); \r
+ } else if(g.hasStatement(resource, L0X.Represents)){\r
+ Resource represents = g.getSingleObject(resource, L0X.Represents); \r
if (g.isInstanceOf(represents, sr.Variable)) {\r
consume(e);\r
}\r
import org.simantics.layer0.Layer0;\r
import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.modeling.ModelingResources;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.structural.stubs.StructuralResource2;\r
import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.ui.SimanticsUI;\r
// Same as in SysdynProject.java. Should use the same code, not copy.\r
SysdynResource sr = SysdynResource.getInstance(g);\r
Layer0 l0 = Layer0.getInstance(g);\r
+ Layer0X L0X = Layer0X.getInstance(g);\r
ModelingResources mr = ModelingResources.getInstance(g);\r
StructuralResource2 sr2 = StructuralResource2.getInstance(g);\r
DiagramResource dr = DiagramResource.getInstance(g);\r
\r
\r
// Remove default mapping and add sysdyn mapping\r
- for(Resource trigger : g.getObjects(diagram, l0.HasTrigger)) {\r
+ for(Resource trigger : g.getObjects(diagram, L0X.HasTrigger)) {\r
if(g.isInstanceOf(trigger, mr.DiagramToCompositeMapping)) {\r
- g.deny(diagram, l0.HasTrigger, trigger);\r
+ g.deny(diagram, L0X.HasTrigger, trigger);\r
}\r
}\r
Resource mapping = g.newResource();\r
g.claim(mapping, l0.InstanceOf, null, sr.DiagramToCompositeMapping);\r
- g.claim(diagram, l0.HasTrigger, mapping);\r
+ g.claim(diagram, L0X.HasTrigger, mapping);\r
\r
Resource moduleSymbol = g.newResource();\r
g.claimLiteral(moduleSymbol, l0.HasName, name + " Symbol");\r
import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.sysdyn.ui.browser.nodes.InputNode;\r
\r
public class InputLabeler extends LabelerContributor<InputNode>{\r
@Override\r
public String getLabel(ReadGraph graph, InputNode var) throws DatabaseException {\r
Layer0 l0 = Layer0.getInstance(graph);\r
+ Layer0X L0X = Layer0X.getInstance(graph);\r
Resource varres = var.data;\r
StringBuilder sb = new StringBuilder();\r
for(Resource r : graph.getObjects(varres, l0.HasName))\r
sb.append(graph.getValue(r));\r
- if(graph.isInstanceOf(varres, l0.Realization)) {\r
- varres = graph.getPossibleObject(varres, l0.Represents);\r
+ if(graph.isInstanceOf(varres, L0X.Realization)) {\r
+ varres = graph.getPossibleObject(varres, L0X.Represents);\r
if(varres == null) return sb.toString();\r
}\r
sb.append(" : ");\r
ArrayList<AbstractNode<Resource>> result = new ArrayList<AbstractNode<Resource>>();\r
\r
Layer0 l0 = Layer0.getInstance(graph);\r
- Resource baseRealization = graph.syncRequest(new PossibleObject(model.data, l0.HasBaseRealization));\r
+ Resource baseRealization = graph.syncRequest(new PossibleObject(model.data, L0X.HasBaseRealization));\r
if (baseRealization != null) {\r
try {\r
String URI = graph.getURI(baseRealization);\r
import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.sysdyn.ui.browser.nodes.ModuleNode;\r
\r
public class ModuleLabeler extends LabelerContributor<ModuleNode>{\r
@Override\r
public String getLabel(ReadGraph graph, ModuleNode module) throws DatabaseException {\r
Layer0 l0 = Layer0.getInstance(graph);\r
+ Layer0X L0X = Layer0X.getInstance(graph);\r
Resource resource = module.data;\r
StringBuilder sb = new StringBuilder();\r
for(Resource r : graph.getObjects(resource, l0.HasName))\r
sb.append(graph.getValue(r));\r
- if(graph.isInstanceOf(resource, l0.Realization)) {\r
- resource = graph.getPossibleObject(resource, l0.Represents);\r
+ if(graph.isInstanceOf(resource, L0X.Realization)) {\r
+ resource = graph.getPossibleObject(resource, L0X.Represents);\r
if(resource == null) return sb.toString();\r
}\r
sb.append(" : ");\r
import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.sysdyn.ui.browser.nodes.VariableNode;\r
\r
public class VariableLabeler extends LabelerContributor<VariableNode<Resource>>{\r
@Override\r
public String getLabel(ReadGraph graph, VariableNode<Resource> var) throws DatabaseException {\r
Layer0 l0 = Layer0.getInstance(graph);\r
+ Layer0X L0X = Layer0X.getInstance(graph);\r
Resource varres = var.data;\r
StringBuilder sb = new StringBuilder();\r
for(Resource r : graph.getObjects(varres, l0.HasName))\r
sb.append(graph.getValue(r));\r
- if(graph.isInstanceOf(varres, l0.Realization)) {\r
- varres = graph.getPossibleObject(varres, l0.Represents);\r
+ if(graph.isInstanceOf(varres, L0X.Realization)) {\r
+ varres = graph.getPossibleObject(varres, L0X.Represents);\r
if(varres == null) return sb.toString();\r
}\r
sb.append(" : ");\r
import org.simantics.modeling.ComponentUtils;\r
import org.simantics.modeling.ModelingResources;\r
import org.simantics.modeling.ui.Activator;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.structural.stubs.StructuralResource2;\r
import org.simantics.structural2.StructuralVariables;\r
import org.simantics.sysdyn.SysdynResource;\r
Resource componentType = g.getSingleObject(r, mr.SymbolToComponentType);\r
r = g.getSingleObject(componentType, sr2.IsDefinedBy);\r
}\r
- Layer0 l0 = Layer0.getInstance(g);\r
- Resource represents = g.getPossibleObject(r, l0.Represents);\r
+ Layer0X L0X = Layer0X.getInstance(g);\r
+ Resource represents = g.getPossibleObject(r, L0X.Represents);\r
if(represents != null){\r
if(g.isInstanceOf(represents, sr.Configuration)) {\r
r = represents;\r
@Override\r
public void run(ReadGraph g) throws DatabaseException {\r
Resource cr = r;\r
- Layer0 l0 = Layer0.getInstance(g);\r
+ Layer0X L0X = Layer0X.getInstance(g);\r
if(g.isInheritedFrom(r, SysdynResource.getInstance(g).ModuleSymbol)) {\r
ModelingResources mr = ModelingResources.getInstance(g);\r
StructuralResource2 sr2 = StructuralResource2.getInstance(g);\r
Resource configuration = g.getSingleObject(componentType, sr2.IsDefinedBy);\r
cr = configuration;\r
} else { \r
- Resource represents = g.getPossibleObject(r, l0.Represents);\r
+ Resource represents = g.getPossibleObject(r, L0X.Represents);\r
if(represents != null && g.isInstanceOf(represents, SysdynResource.getInstance(g).Configuration)){\r
cr = represents;\r
} else {\r
import org.simantics.mapping.constraint.instructions.TypedBracketInstruction.CreationInstruction;\r
import org.simantics.modeling.services.ComponentNamingUtil;\r
import org.simantics.modeling.services.NamingException;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.project.IProject;\r
\r
public class SysdynCreationInstruction extends CreationInstruction {\r
Resource configuration = (Resource) bindings[lConfiguration];\r
\r
Layer0 l0 = Layer0.getInstance(g);\r
-\r
+ Layer0X L0X = Layer0X.getInstance(g);\r
+ \r
try {\r
String proposition = URIStringUtils.escape(ComponentNamingUtil.findFreshInstanceName(g, project, configurationRoot, configuration, componentType));\r
Resource result = GraphUtils.create(g,\r
l0.HasName, proposition\r
);\r
- g.claim(result, l0.Represents, result);\r
+ g.claim(result, L0X.Represents, result);\r
return result;\r
} catch (NamingException e1) {\r
throw new DatabaseException(e1);\r
import org.simantics.db.service.LifecycleSupport;\r
import org.simantics.db.service.SerialisationSupport;\r
import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.ui.SimanticsUI;\r
import org.simantics.ui.icons.ImageDescriptorProvider;\r
import org.simantics.ui.workbench.ResourceEditorInput2;\r
Layer0 L0 = Layer0.getInstance(g);\r
// 2. Validate modelURI\r
if (getModelURI() != null) {\r
+ Layer0X L0X = Layer0X.getInstance(g);\r
+ \r
// 3. Validate RVI\r
Resource model = g.getResource(modelURI);\r
- Resource baseRealization = g.getPossibleObject(model, L0.HasBaseRealization);\r
+ Resource baseRealization = g.getPossibleObject(model, L0X.HasBaseRealization);\r
Variable modelVariable = Variables.getVariable(g, g.getURI(baseRealization));\r
modelVariable.browse(g, getRVI());\r
}\r
import org.simantics.layer0.Layer0;\r
import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.modeling.ModelingResources;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.simulation.ontology.SimulationResource;\r
import org.simantics.spreadsheet.resource.SpreadsheetResource;\r
import org.simantics.structural.stubs.StructuralResource2;\r
* @param model Imported model\r
*/\r
private static void updateOldConfigurationToBaseRealization(WriteGraph graph, Resource model) {\r
- Layer0 l0 = Layer0.getInstance(graph);\r
+ Layer0X L0X = Layer0X.getInstance(graph);\r
try {\r
Resource configuration = graph.getPossibleObject(model, SimulationResource.getInstance(graph).HasConfiguration);\r
- if(configuration != null && !graph.hasStatement(configuration, l0.IsBaseRealizationOf, model))\r
- graph.claim(configuration, l0.IsBaseRealizationOf, model);\r
+ if(configuration != null && !graph.hasStatement(configuration, L0X.IsBaseRealizationOf, model))\r
+ graph.claim(configuration, L0X.IsBaseRealizationOf, model);\r
} catch (DatabaseException e) {\r
e.printStackTrace();\r
}\r
import org.simantics.layer0.Layer0;\r
import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.modeling.ModelingResources;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.structural.stubs.StructuralResource2;\r
import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.sysdyn.ui.browser.nodes.ModulesNode;\r
// Same as in SysdynProject.java. Should use the same code, not copy.\r
SysdynResource sr = SysdynResource.getInstance(g);\r
Layer0 l0 = Layer0.getInstance(g);\r
+ Layer0X L0X = Layer0X.getInstance(g);\r
ModelingResources mr = ModelingResources.getInstance(g);\r
StructuralResource2 sr2 = StructuralResource2.getInstance(g);\r
DiagramResource dr = DiagramResource.getInstance(g);\r
\r
\r
// Remove default mapping and add sysdyn mapping\r
- for(Resource trigger : g.getObjects(diagram, l0.HasTrigger)) {\r
+ for(Resource trigger : g.getObjects(diagram, L0X.HasTrigger)) {\r
if(g.isInstanceOf(trigger, mr.DiagramToCompositeMapping)) {\r
- g.deny(diagram, l0.HasTrigger, trigger);\r
+ g.deny(diagram, L0X.HasTrigger, trigger);\r
}\r
}\r
Resource mapping = g.newResource();\r
g.claim(mapping, l0.InstanceOf, null, sr.DiagramToCompositeMapping);\r
- g.claim(diagram, l0.HasTrigger, mapping);\r
+ g.claim(diagram, L0X.HasTrigger, mapping);\r
\r
Resource moduleSymbol = g.newResource();\r
g.claimLiteral(moduleSymbol, l0.HasName, name + " Symbol");\r
int modelNode = context.getIndex(model);\r
int defaultsNode = context.getIndex(defaultsResource);\r
graph.claim(model, L0.ConsistsOf, null, defaultsResource);\r
- graph.claim(model, L0.HasBaseRealization, null, defaultsResource);\r
+ graph.claim(model, L0X.HasBaseRealization, null, defaultsResource);\r
\r
// undiscovered.put(defaultsNode, new ResourceData(modelNode, configuration, L0.Realization, "BaseRealization", null, null));\r
\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.variable.ResourceVariable;\r
import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.sysdyn.SysdynResource;\r
\r
public class DefaultVariable extends ResourceVariable {\r
@SuppressWarnings("unchecked")\r
@Override\r
public <T> T getValue(ReadGraph graph) throws DatabaseException {\r
- Layer0 b = Layer0.getInstance(graph);\r
+ Layer0X L0X = Layer0X.getInstance(graph);\r
SysdynResource sr = SysdynResource.getInstance(graph);\r
- Resource represents = graph.getPossibleObject(resource, b.Represents);\r
+ Resource represents = graph.getPossibleObject(resource, L0X.Represents);\r
if(represents == null) return null;\r
//FIXME: doesn't support multiple expressions\r
Resource expressions = graph.getPossibleObject(represents, sr.HasExpressions);\r
@Override\r
public void setValue(WriteGraph graph, Object object, Binding binding) throws DatabaseException {\r
Layer0 l0 = Layer0.getInstance(graph);\r
+ Layer0X L0X = Layer0X.getInstance(graph);\r
SysdynResource sr = SysdynResource.getInstance(graph);\r
// if(!Bindings.DOUBLE.equals(binding)) return;\r
// if(!MutableDoubleBinding.INSTANCE.equals(binding)) return;\r
- Resource represents = graph.getPossibleObject(resource, l0.Represents);\r
+ Resource represents = graph.getPossibleObject(resource, L0X.Represents);\r
if(represents == null) return;\r
//FIXME: doesn't support multiple expressions\r
Resource expressions = graph.getPossibleObject(represents, sr.HasExpressions);\r
import org.simantics.modeling.ModelingUtils;\r
import org.simantics.modeling.services.CaseInsensitiveComponentNamingStrategy2;\r
import org.simantics.modeling.services.ComponentNamingStrategy;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.project.IProject;\r
import org.simantics.project.ProjectElementType;\r
import org.simantics.project.ProjectElements;\r
public void run(WriteGraph g, Resource library, Callback<Resource> callback, Callback<Throwable> errorCallback) {\r
try {\r
Layer0 l0 = Layer0.getInstance(g);\r
+ Layer0X L0X = Layer0X.getInstance(g);\r
SysdynResource sr = SysdynResource.getInstance(g);\r
SpreadsheetResource SHEET = SpreadsheetResource.getInstance(g);\r
ModelingUtils mu = new ModelingUtils(g);\r
Resource conf = GraphUtils.create2(g,\r
sr.Configuration,\r
l0.PartOf, model,\r
- l0.IsBaseRealizationOf, model,\r
+ L0X.IsBaseRealizationOf, model,\r
l0.HasName, modelName\r
);\r
\r
\r
ModelingResources mr = ModelingResources.getInstance(g);\r
// Remove default mapping and add sysdyn mapping\r
- for(Resource trigger : g.getObjects(diagram, l0.HasTrigger)) {\r
+ for(Resource trigger : g.getObjects(diagram, L0X.HasTrigger)) {\r
if(g.isInstanceOf(trigger, mr.DiagramToCompositeMapping)) {\r
- g.deny(diagram, l0.HasTrigger, trigger);\r
+ g.deny(diagram, L0X.HasTrigger, trigger);\r
}\r
}\r
Resource mapping = g.newResource();\r
g.claim(mapping, l0.InstanceOf, null, sr.DiagramToCompositeMapping);\r
- g.claim(diagram, l0.HasTrigger, mapping);\r
+ g.claim(diagram, L0X.HasTrigger, mapping);\r
\r
Resource report = GraphUtils.create2(g, DOC.Report, DOC.HasDocumentation, "===Report===");\r
\r
import org.simantics.layer0.Layer0;\r
import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.modeling.ModelingResources;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.simulation.ontology.SimulationResource;\r
import org.simantics.spreadsheet.resource.SpreadsheetResource;\r
import org.simantics.structural.stubs.StructuralResource2;\r
* @param model Imported model\r
*/\r
private static void updateOldConfigurationToBaseRealization(WriteGraph graph, Resource model) {\r
- Layer0 l0 = Layer0.getInstance(graph);\r
+ Layer0X L0X = Layer0X.getInstance(graph);\r
try {\r
Resource configuration = graph.getPossibleObject(model, SimulationResource.getInstance(graph).HasConfiguration);\r
- if(configuration != null && !graph.hasStatement(configuration, l0.IsBaseRealizationOf, model))\r
- graph.claim(configuration, l0.IsBaseRealizationOf, model);\r
+ if(configuration != null && !graph.hasStatement(configuration, L0X.IsBaseRealizationOf, model))\r
+ graph.claim(configuration, L0X.IsBaseRealizationOf, model);\r
} catch (DatabaseException e) {\r
e.printStackTrace();\r
}\r
private static Resource createSheet(WriteGraph graph, Resource book, String name, String[] colNames, int[] colWidths) throws DatabaseException {\r
\r
Layer0 L0 = Layer0.getInstance(graph);\r
+ Layer0X L0X = Layer0X.getInstance(graph);\r
SpreadsheetResource sr = SpreadsheetResource.getInstance(graph);\r
\r
Resource result = graph.newResource();\r
graph.addLiteral(newCell, sr.DoubleArrayCell_HasWidth, sr.DoubleArrayCell_HasWidth_Inverse, L0.Integer, 10, Bindings.INTEGER);\r
graph.addLiteral(newCell, sr.HasLocation, sr.HasLocation_Inverse, L0.String, "B2", Bindings.STRING);\r
graph.addLiteral(newCell, sr.DoubleArrayCell_HasDoubleArray, sr.DoubleArrayCell_HasDoubleArray_Inverse, L0.DoubleArray, doubles, Bindings.DOUBLE_ARRAY);\r
- graph.claim(result, L0.HasChildVariables, L0.HasChildVariables_Inverse, newCell);\r
+ graph.claim(result, L0X.HasChildVariables, L0X.HasChildVariables_Inverse, newCell);\r
\r
}\r
\r
import org.simantics.db.layer0.variable.Variable;\r
import org.simantics.db.layer0.variable.Variables;\r
import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.sysdyn.SysdynResource;\r
\r
public class ChildVariable extends AbstractChildVariable {\r
\r
@Override\r
public Resource getRepresents(ReadGraph graph) throws DatabaseException {\r
- Layer0 L0 = Layer0.getInstance(graph);\r
- Resource represents = graph.getPossibleObject(resource, L0.Represents);\r
+ Layer0X L0X = Layer0X.getInstance(graph);\r
+ Resource represents = graph.getPossibleObject(resource, L0X.Represents);\r
if(represents != null) return represents;\r
else return resource;\r
}\r
import org.simantics.db.layer0.variable.StandardGraphChildVariable;\r
import org.simantics.db.layer0.variable.Variable;\r
import org.simantics.layer0.Layer0;\r
+import org.simantics.operation.Layer0X;\r
\r
public class RunVariable extends StandardGraphChildVariable {\r
\r
\r
Resource getConfiguration(ReadGraph graph) throws DatabaseException {\r
Layer0 L0 = Layer0.getInstance(graph);\r
+ Layer0X L0X = Layer0X.getInstance(graph);\r
Resource experiment = graph.getPossibleObject(resource, L0.PartOf);\r
Resource model = graph.getPossibleObject(experiment, L0.PartOf);\r
- return graph.getPossibleObject(model, L0.HasBaseRealization);\r
+ return graph.getPossibleObject(model, L0X.HasBaseRealization);\r
}\r
\r
}\r
import org.simantics.layer0.Layer0;\r
import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.modeling.ModelingResources;\r
+import org.simantics.operation.Layer0X;\r
import org.simantics.simulation.ontology.SimulationResource;\r
import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.utils.datastructures.ArrayMap;\r
try {\r
SysdynResource sr = SysdynResource.getInstance(graph);\r
Layer0 l0 = Layer0.getInstance(graph);\r
+ Layer0X L0X = Layer0X.getInstance(graph);\r
SimulationResource simu = SimulationResource.getInstance(graph);\r
DocumentResource DOC = DocumentResource.getInstance(graph);\r
\r
\r
ModelingResources mr = ModelingResources.getInstance(graph);\r
// Remove default mapping and add sysdyn mapping\r
- for(Resource trigger : graph.getObjects(diagram, l0.HasTrigger)) {\r
+ for(Resource trigger : graph.getObjects(diagram, L0X.HasTrigger)) {\r
if(graph.isInstanceOf(trigger, mr.DiagramToCompositeMapping)) {\r
- graph.deny(diagram, l0.HasTrigger, trigger);\r
+ graph.deny(diagram, L0X.HasTrigger, trigger);\r
}\r
}\r
Resource mapping = graph.newResource();\r
graph.claim(mapping, l0.InstanceOf, null, sr.DiagramToCompositeMapping);\r
- graph.claim(diagram, l0.HasTrigger, mapping);\r
+ graph.claim(diagram, L0X.HasTrigger, mapping);\r
\r
graph.claim(model, simu.HasConfiguration, conf);\r
- graph.claim(model, l0.HasBaseRealization, conf);\r
+ graph.claim(model, L0X.HasBaseRealization, conf);\r
\r
Resource report = GraphUtils.create2(graph, DOC.Report, DOC.HasDocumentation, "===Report===");\r
\r
\r
public abstract class Variable implements IElement {\r
\r
- @RelatedValue("http://www.simantics.org/Layer0-1.0/HasType")\r
+ @RelatedValue("http://www.simantics.org/Sysdyn-1.0/Variable/Type")\r
protected String type;\r
\r
@RelatedValue("http://www.simantics.org/Layer0-1.0/HasName")\r