import PowerWindowModel

semantic adaptation ArmatureCurrentSA armature_current_sa
at "./path/to/ArmatureCurrentSA.fmu"
for fmu controller
triggered by signal == true
in rules with crossing absolute tolerance = 1e-8 and relative tolerance = 0.0001, no hold {
	armature_current >! 5 -> obj_detected := true;
	otherwise -> obj_detected := false;
}
out rules with zero order hold {
	"up" -> up := 1;
	"stop" -> { up := 0; down := 0; };
	"down" -> down := 1;
	delay at up and down;
}

semantic adaptation WindowSA window_sa
at "./path/to/WindowSA.fmu"
for fmu window
out rules {
	reaction_torque := -reaction_torque;
}

semantic adaptation WindowObstacleSA window_obstacle_sa
at "./path/to/WindowObstacleSA.fmu"
for fmu window_sa, obstacle
multiply rate 10 times with first order interpolation
successive substitution starts at height with absolute tolerance = 1e-8 and relative tolerance = 0.0001

semantic adaptation PlantSA plant_sa
at "./path/to/PlantSA.fmu"
for fmu power, window_obstacle_sa
successive substitution starts at reaction_torque with absolute tolerance = 1e-6 and relative tolerance = 1e-6