@Test public void testGetModelVariables() { SimulatedStepperMotor dut = new SimulatedStepperMotor(getBuilderFor(buildProperty())); List<Fmi2ScalarVariable> variables = dut.getModelVariables(); assertEquals(2,variables.size() ); Fmi2ScalarVariable outputVar = variables.get(0); assertIsRealVariable(outputVar); assertEquals("simulatedStepperMotor position",outputVar.getName() ); assertEquals("output",outputVar.getCausality() ); assertEquals(0,outputVar.getValueReference()); assertEquals("continuous",outputVar.getVariability()); Fmi2ScalarVariable inputVar = variables.get(1); assertEquals("simulatedStepperMotor torque",inputVar.getName() ); assertEquals(1,inputVar.getValueReference()); assertEquals("continuous",inputVar.getVariability()); assertIsInputVariable(inputVar); }
public List<Fmi2ScalarVariable> getModelVariables() { ArrayList<Fmi2ScalarVariable> result = new ArrayList<Fmi2ScalarVariable>(NB_VAR); result.add(createRealOutput(getType() + " position", "", baseref + 0)); result.add(createRealInput(getType() + " torque", "", baseref + 1)); return result; }
SimulatedStepperMotor implements GpioCompHwEmulation, SimulatedTimeListerner { public List<Fmi2ScalarVariable> getModelVariables() { ArrayList<Fmi2ScalarVariable> result = new ArrayList<Fmi2ScalarVariable>(NB_VAR); result.add(createRealOutput(getType() + " position", "", baseref + 0)); result.add(createRealInput(getType() + " torque", "", baseref + 1)); return result; } }
SimulatedStepperMotor implements GpioCompHwEmulation, SimulatedTimeListerner { public List<Fmi2ScalarVariable> getModelVariables() { ArrayList<Fmi2ScalarVariable> result = new ArrayList<Fmi2ScalarVariable>(NB_VAR); result.add(createRealOutput(getType() + " position", "", baseref + 0)); result.add(createRealInput(getType() + " torque", "", baseref + 1)); return result; } SimulatedStepperMotor(HardwareBuilder builder);  SimulatedStepperMotor();  SimulatedStepperMotor(org.raspinloop.config.PinState onState, org.raspinloop.config.PinState offState); }
SimulatedStepperMotor implements GpioCompHwEmulation, SimulatedTimeListerner { public List<Fmi2ScalarVariable> getModelVariables() { ArrayList<Fmi2ScalarVariable> result = new ArrayList<Fmi2ScalarVariable>(NB_VAR); result.add(createRealOutput(getType() + " position", "", baseref + 0)); result.add(createRealInput(getType() + " torque", "", baseref + 1)); return result; } SimulatedStepperMotor(HardwareBuilder builder);  SimulatedStepperMotor();  SimulatedStepperMotor(org.raspinloop.config.PinState onState, org.raspinloop.config.PinState offState); boolean enterInitialize(); boolean exitInitialize(); void terminate(); void reset(); List<Double> getReal(List<Integer> refs); List<Integer> getInteger(List<Integer> refs); List<Boolean> getBoolean(List<Integer> refs); boolean setReal(Map<Integer, Double> ref_values); boolean setInteger(Map<Integer, Integer> ref_values); boolean setBoolean(Map<Integer, Boolean> ref_values); boolean isTerminated(); List<Fmi2ScalarVariable> getModelVariables(); int registerBaseref(int baseref); @Override String getType(); @Override PinState getState(Pin pin); @Override void setState(Pin pin, PinState state); @Override void onRequestingSleep(long requestedNanos); @Override boolean usePin(Pin pin); org.raspinloop.config.Pin getPin(Pin pin); @Override String getHWGuid(); }
SimulatedStepperMotor implements GpioCompHwEmulation, SimulatedTimeListerner { public List<Fmi2ScalarVariable> getModelVariables() { ArrayList<Fmi2ScalarVariable> result = new ArrayList<Fmi2ScalarVariable>(NB_VAR); result.add(createRealOutput(getType() + " position", "", baseref + 0)); result.add(createRealInput(getType() + " torque", "", baseref + 1)); return result; } SimulatedStepperMotor(HardwareBuilder builder);  SimulatedStepperMotor();  SimulatedStepperMotor(org.raspinloop.config.PinState onState, org.raspinloop.config.PinState offState); boolean enterInitialize(); boolean exitInitialize(); void terminate(); void reset(); List<Double> getReal(List<Integer> refs); List<Integer> getInteger(List<Integer> refs); List<Boolean> getBoolean(List<Integer> refs); boolean setReal(Map<Integer, Double> ref_values); boolean setInteger(Map<Integer, Integer> ref_values); boolean setBoolean(Map<Integer, Boolean> ref_values); boolean isTerminated(); List<Fmi2ScalarVariable> getModelVariables(); int registerBaseref(int baseref); @Override String getType(); @Override PinState getState(Pin pin); @Override void setState(Pin pin, PinState state); @Override void onRequestingSleep(long requestedNanos); @Override boolean usePin(Pin pin); org.raspinloop.config.Pin getPin(Pin pin); @Override String getHWGuid();  }