module Power_SA

semantic adaptation moore delayed power_sa

for fmu Power power
at "./path/to/Power.fmu"
input ports up, down, reaction_torque (N.m)
output ports armature_current (mA), motor_speed (m/s)

param init_armature_current = 0;
param init_displacement = 0;
param init_speed = 0;

out var stored_armature_current := init_armature_current;
out var stored_displacement := init_displacement;
out var stored_speed := init_speed;

out rules {
	true -> {
		stored_armature_current := armature_current;
		stored_displacement := displacement;
		stored_speed := speed;
	} --> {
		armature_current := stored_armature_current;
		displacement := stored_displacement;
		speed := stored_speed;
	}; 
}
