]> gerrit.simantics Code Review - simantics/platform.git/blob
cdf478f3a4c3e9ed5d18702a9ad4706f95e61581
[simantics/platform.git] /
1 package org.simantics.simulator.toolkit;
2
3 import org.simantics.databoard.binding.Binding;
4 import org.simantics.simulation.sequences.action.AbstractActionContext;
5 import org.simantics.simulator.IDynamicExperimentLocal;
6 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory;
8
9 public class DynamicExperimentActionContext extends AbstractActionContext {
10
11         private static final Logger LOGGER = LoggerFactory.getLogger(DynamicExperimentActionContext.class);
12
13         final private IDynamicExperimentLocal experiment;
14         
15         public DynamicExperimentActionContext(IDynamicExperimentLocal experiment) {
16                 this.experiment = experiment;
17         }
18         
19         @Override
20         public Object get(String variableName, Binding binding) {
21                 return experiment.getVariableValueById(variableName);
22         }
23
24         @Override
25         public void set(String variableName, Object value, Binding binding) {
26                 experiment.setVariableValueById(variableName, value, binding);
27         }
28
29 }