/*
This file is deprecated
*/
import PowerWindowModel

module Power_SA

semantic adaptation moore delayed power_sa

for fmu power

input ports u, d;

output ports armature_current, speed, displacement;

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

in var stored_windowsa_u, stored_windowsa_d;

in rules {
	true -> {
		stored_windowsa_u := window_sa.u;
		stored_windowsa_d := window_sa.d;
	} --> {
		power.u := stored_windowsa_u; 
		power.d := stored_windowsa_d; 
	};
}

control rules {
	power.doStep(t, H);
}

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 := power.armature_current;
	} --> {
		window_sa.armature_current := stored_armature_current;
	}; 
	true -> {
		stored_displacement := power.displacement;
	} --> {
		window_sa.displacement := stored_displacement;
	}; 
	true -> {
		stored_speed := power.speed;
	} --> {
		window_sa.speed := stored_speed;
	}; 
}
